@kedataindo/docflow-vue 0.0.35 → 0.0.36
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.
- package/dist/index.cjs +52 -52
- package/dist/index.js +36809 -36808
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -592,7 +592,18 @@
|
|
|
592
592
|
*/const qt=Z("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$b=["title"],Bs=s.defineComponent({__name:"ThemeToggle",setup(e){const{isDark:t,toggle:n}=So(),{t:i}=ct();return(r,a)=>(s.openBlock(),s.createElementBlock("button",{type:"button",class:"p-2 rounded-lg border border-slate-200 bg-slate-50 text-slate-500 transition-colors hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200",title:s.unref(t)?s.unref(i)("theme.lightMode"):s.unref(i)("theme.darkMode"),onClick:a[0]||(a[0]=(...o)=>s.unref(n)&&s.unref(n)(...o))},[s.unref(t)?(s.openBlock(),s.createBlock(s.unref(qb),{key:0,class:"h-4 w-4"})):(s.openBlock(),s.createBlock(s.unref(_b),{key:1,class:"h-4 w-4"}))],8,$b))}}),Wb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADkdJREFUeAHt3f+xG8cNwHEok/8tV+BTB3IFoTuQKzBTQaQKTFUguwI9V2C5Ar1UoOcKxA5kV4AszGOGeXm/eNy9xQLfzwznZcaZscnjEnvAHiACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ1TPBX1T1efnzurz+UV4vy+u5wJub8rour5+fPXu2F7CATVm82/LnnbBoR/K2LOKdJPc3Sa4s3l35815YvKP5cb52qaWOwOULYFvlT4KRvSmR+CdJKvsC/lz+TIKR/VFeL8oi/kMSSruFnu97J8Ho7NbnR0kqZQQui3cqfz4KCziS70oUvpZkskZg+8WeBJGkjMLpIvAcfT8LIvq+ROEPkkjGCJz2fimBd/OBnDRSLeA5cbUVRDWV178kkVRbaMpGKVg56dssRy3TROD51M4kiC5VWSlFBKZslFKKslKWCEzZKJ8UUTh8BKZslNq2ROFfJLAMC9geVngpyCj8OenQW+i5bMTizcsSWqHLSqEjMGUjSPCyUtgITNkIM4vC7yWokBGYxBXuELKsFDUCc94Zt72TgMIt4LlNzlaA//WyfDdeSzDhttAkrvCAcGWlUBGYNjl4RLhz0mEiMOedcQYrK91IAJEi8FZYvHiaMAmtEBGYshEWCFFWihKBKRvhXO8jtN8ZfgGXi/BKKBvhfJMEOCc9/BY6WNloX15XcpjCF+kJGot09kO7EV/XKvVUh+6sbKRxpOioWN7j6/L6on4MndAaNgJrrLLRVYkC/5Qk5mtnz2l7+cEaNqE18gK2J0y2EsOLbAOry/XbyOEH2IPr8vl/JwMaMok1/4JvJYbrjNPm54jnZSzoRg/J0OGMmoWO9GRJ5gTKW/Hz/ofMQQy3gPVw3nnIX8t7TJLUnP31EoUnGbCsNNw9sMZ72ih9KcPRNR2u/c5QEVhjtskJ33jtCbxk4O1aDHV7NkwEDlY2ui3VPJ+7lOtr13YjPgxTVhopAkeerhC68doTeaqDD3O2fogFHKxsdJ/NXBtNad597MQHuxZDtN8ZYguteaYr3JQv8reS1FzGsYSWh3LOEMlF9xFYc01XCNl47anmxfJWfBgiueg+AgcsGz2GspKvhJbrY66uI3DQstFjUg2ovoeXKGxcJxfdRmClTU66BxxOlev/q/g5cee2rOQ5AmePQtnLSm/Ezzlpt9fC5QJWpisYykqOzkl7TS663EInTFzdZy+HE1opE1pzWclKiJP05zK56C4CK9MVTk2S+Jy0w7KSu9s6VxE4+HnnpSgr+SoruZrq4C0C233GJDhFWclXWcnV00puIjBlo0cN23itBmc90NxcC08LOFKTuhaGbbxWg7Nz0ntxklx0sYWeE1dbwUOGbbxWA+137uYiAlM2erK9UFairHSiewSeC+ST4CkmoaxE+50TXSMwZaNFaL9D+53/6h2BI7fJaWW4xmsNvBE/upb4ui3gJG1yWnmV/Jy0HaTwNNXhB+mk2xba2TZoRJSVKCv1icBz2WgjuMQwjddacHZOepJOycUuEZiyUTWck04+1WH1CJy0TU4rTHVIXlZaNQI7HOwcRfb2O2nLSmtHYEu5s3jrY6qDH6uWlVZbwJSNmqL9TtKpDqttoUlcNbcvX+QXklTWqQ6rRGDa5KzCbeO1NWSd6tA8Ajt7giQ6ykrJpjqsEYF52mg9tN9JNtWhaQSmTU43rhqvrS3TVIfWETh7NOiFp5WSTHVotoDnssZW0ANlJV9THZoFsmZbaMpG3e2F9jvh2+80icCUjVyYhPY74ac6VI/AtMlxhbJS8HPSLSIwZSM/aL/jq6xUPQpXjcCUjdzq2nitt/K9tB8xL6fUql6L2guY6Qo+0X4naPudaltopiu41rXxWm+RpzpUi8CUjdzbC2UlT2WlKu13qkRgpisMYRLKSp7a71RJaF0cgSkbDaVL4zVPopWVakRgpiuMg7JSsKkOFy1g2uQMiakOgaY6XLSFZrrCsCgrBWm/szgCM11haEx1CNJ+Z3EEpmw0PM5Jq1pZ6aX0tzi5uGgBz7/eHpIh9savyuuh7hNTg3/2XO7ffj30z7zZlS+Np7PCq5pzAR/Fh0W3NUsXsIfoa4mIt6NFkPLZffPAP55O/re1iLUEx0baIQr72kl+3fxalDf8UvtL06qnvNfX2tZGEivv/536cXZGekkSa5K+9pm2feW92k6j5QmibyS3vfgxyZmWLODe93c7SaYs4qvy51qAW5Ys4Bvp63fJ6WdpYy+5TeLH2fe/Zy/g+SRLz6THF8mp1Q9n1h/EIw9lpKPf5ExLD3L0PIr2QlDLVfIM9CR+DiNdL6kDL13Atp3rdeGzNoufpL60NeCZp+/SopNxixZw5w4HdgxwJ/nU7qixS/5Y4Vb8PIhjO6FFtzKXPszQswg+5EGOJbR+s8C9JO7OYdTXAY7FUwwvfR64Z4cD23J8mr/c0dU+trpLvng9dZDpuxMqH8ZH7euLBm7YVt7bVutK3fa3vP/JPgP1of+10MMH4sFOginv6bnW/7JNklh5/+/VDx+BR/2cJ/2sgb6g5b38pHU1HzjtmfoJNuaTVFClraz6a5z9ptxXfJCBaf3EFQ3t/Dz/a14889JW1lmHg6m8ftXxt9S/Sl0/UTZys3ivXF4L+4VTXz7qgFtqJXFVnTpKXGnF72Tt6YSeWnaaTXl9LB+Yp/OuD5ovbu0TQjtJTA+7sUl88L0T0v5lpfvsZABaP3HlpWVMF+orceV/J6SHD+yL+vReDwk3l7TNl22SxJSy0fnKf+iP6tdndfql1vr3adnLRh7aPx01uRZV5wMfqa+y0l3+GnTlqdSkhyxpzYu8l8Psnb0kpUHOOz+kdhLrL3NZyVtC65T9sFipycWWRtskrigb+Vm8PstGj1G/Ca0ju1fvnqHW+vdpnHcOWja6rUkEPuH9gfFjJO621dc2A+J2kttWeNqoDvWVBbxPt84MSuKqKk1WNmodgY1FYe/Pnlrz9NWjsLa5T6NNjh9baaz5Ap63Dz2b4D3FRRPillASV9WVz/SV+GqT829prEkZ6bY5utmTIJP4terMXD1sdbdSz14oG4UvG922xhZ6hLKS2ejDg8eq0UaJK8pG+RJXq0TgIz2cy92IX9vywf8ijTWIFDYvKm2/7PkH0b5bk/S3lxUbBq4SgU94T7BM0pi2aai2ldwslzCJD6s2DFx1AZc3di2+E1qTNDRHitrJslWSJV41uh1Zar/GDu7U2hHYjFBWaqVFpMheNqrdcvcSqyVBj1ZfwJ2nOjym2bFKPRzZ3EpdJK5EXokPXc47r5rEOuUs5X/ULBnUInElTFfw8h3q1jCwxxb6qOdUh/s0OY2lbVq6ZJ+usBPa5PSLwMZpWenrmgtjTrLYIZaaPw6UjRyVjXpei54R2HiMwl9JXZa4qh3ZV0+WOOOqbCQddV3ATs9JT1JJo7O5Yz4cXomzstH12mWj27puoY36a79T7TRWgyQL0xUCTle4RO8ttLepDqbKD0mjJAttcpiu4JP6ab9z8SN+2qa1LtMVkrTJOUf3CHzC02ylS7VIXO0kMaVs5J/6iMIXDRXT+nONLv5vGp0yXeFeniKwsbJS78MJk1ymRUsX789St+apTc5OHHG1gJ2UlRZvfbXNNi972ajFGfKlrnqXjW7rXka6TR2UlcpFOvtz0foDuc1eaJOTrk3OObxtoV2039FlrXVabPN42ojE1Zi0b0LrrAWsbRJXTFegbPQodxH4RM+y0rmHBVpE39eS21aYrvAotwt4br9zJX1MT/0/arvE1W+SlLbpmb3U6m1yzuEuiXVK+yW0ntQjWtskroy7ZMmatH7P7EtsPPcc87yF7tl+Z6OPTC2cf1xaHLAgcZVsukJotlC0TzLjc3lt7vlvsgTLJ63vszpNlqxF/SSuzCTO/V2csyhcPkg7ofVR1jXZv7P8u6/L3w/l9accHva3yGzP+bbY1hN9SVydxfU98Cn1P9XhUrTJSTpd4RKu74FviX4e2Et71F7STle4xDAR2JRfaWviHbE+askSj/3BVqHtsvlLDLUTGm0Be2u/U0v2spFl873sQIa6FiNtoT2236nhmsRV7ukKlxgqAh+pz6kOS30oX5rvJSlH13LIhoFDReATke4XJ0lKaZNzsSEjsAlUVrJf/hejZD1r0TYTK5YatoQ3agQ2UaKwfYE9tYxp7qTm6yUZuZNBDbuA5+3OTmJ4Xb7UKR4f1MPxVC8HNswHz08bPWbYLbQJWFa6Ki/7Mt1E2lLPEXdTXj+Iv9ueoUt4Qy9gM0cuT1PaMY7hD9AMv4BNgnPSqG8vARoGjpzEOhXtcAfaC/HkV4gIbJwdx4NvYZ78ihKBjT2tlKqWisXCZPzDLGCnw8LhT6iGgWG20GYuK9npnkmAu4V68ivSFjrq00qoJ1zLolAR+IiyEu6wl4BzpkJF4BNEYdwWsmFgyAhs1FdzcPQVtmFg5AUctf0OzveyLODfJaCoW+ieUx3gy1XUxWvCRmBDWQkSvGFg2Ahs5iictl0r4k+6CB2BjygrpZRi0kXoCHwi+lQH/L+dJJBiAZdf4hshoZXJzchtcs6RYgttKCulEjpxdSrLFppz0nkMN13hEmki8FGJxFZWeimIaC8Bzzs/JE0EPkFCK65U0deki8CGslJIKQekZ4zAxg530H4nlp0klHIB034nnKGnK1wi5RbaUFYKJU3Z6LasW2jKSnEMORa0lrQR+KhEYhvLkmKwWEB24upbSSxtBD4qXwArK+0Eo/lQXt9JcukXsCmL2LbSVoK4Enh3XV6bcs2+jzTBcan0W+i7lG21ndT6SuDJn3Ko9VL+AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA83X8ABwAmKHa9twUAAAAASUVORK5CYII=",Gb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAZqZJREFUeAHtvV2MZmdyHvbU6R5yuPxrAoEdBw6mR0gC5Mpc3USCFOxQMfSviFIUwHdsIrrQSpZ2RrJErVarnl55tVnAEocR5F1L1nIGuUguDHPlWMpKsj2zimIJDmBSSQAhhrPTayFSIjth7/+Q030q55yqp6re0831kvPX3d8pcvr7vvN/3vNW1VNP1fseYJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZ5LSKYJFJNi7e3Ng/s39x+PoehfwV0f4pQKHD/8OntZPq9F34dVqlfgT71L4f/orvM1sf36f9lfvY8vG4dr7hU+z4fu5yjHF5nt8OIL5NXJNtKONlaD8eWKdDYzquHT+vl9cxbCa8xeEcw49+upfcfjwWxM4ldhKezs43SR9NJbHKriHuLfeb2kHGK+3Hc9bl9gdx7f34+dqw7Y019C/d+uR7d7HIosCjPPqT/3Jr6EMvDv3kSSkKOv4XypLKEUqGqjCu5M22ah0+lSiPEQrl27mSmWIrld+PK5OS2jVp3b8XmJYKz9VeL8KQpOJTmTRuxnQUec3DccefjQKOy7xBaGAm5aNxC6UMZRvW95Mh0FBArduFQTzKUKbCD3elPco51O5FP7T/D957GSsua1hxeeyF//OyoHtx6BFnrfeI9Z/RLXhPq1bOe9jkrXxJerZJ1cx7cWPrgMMfQSxUlfCc4pvR8Uw/xdd3PJ3GuWQ6lF+DqSQvW3xvsOPndYkrHT0gr07FL8iPH2prh1O7PiotLQDvJe8JZotsH3Qik2FK5TUvSt33w3vjCT08b2a6XGsjGpZ8BsrzCi50/+F3Sv8vfusGVlhWWoEf/ZmbT0uP/654BTHrPnbAPp1riLDnZU/3fmmdjv1Li7Y2ymvrJ0/pOgbqbTnJpCzZeadt6KWhdXu140uxMcoOPp24Eyqq5PLY1JUkdhcuNONC61KVXqjwov6ZYIO2wsGFf6cRcHPm16D1nqxtJGOP2rb2QHhySWAwKvH6f/QdnxuU+A+xotJhhaU7wCvTlwST6jrH/upBWPq9Q+oW29kmIkSd4Rr96JKLfGPlflPHtM5ZNkA1HuI/JbWzwHaPhSUctho61xp2x9HMOthFxfbcNzwiJqTgqF3bQ1DxaWzs1nk/k/esJuXQ/n6mBDm84VDsBmEowbcir4dru21ceHEDKyorq8CP//TNraEnbE4/0l3SY5iauKfUiA3peueK2Dvkq6hbQ3PhetE6Sk0VHbfuGXX7wsZOtCGpH8CWS8DoWFW9bguLaaUKLlVxaFsOYP4uvKOYfUGF7+77CxSonpPLPCjnh6SSxkGbFgGNWLNidt8SZ7S/G+tPnNnGiopgBWXjhZubB8D1oU9sVo3hd4fRHoPRPSdb6wt8x5acclY3GV04E0xFbkgfjfOZMvQBTycCiEHlJH12fl6jnyM0O4itenxU5trtBd0zJiM1Z8592yCv2G4krZRW4BBpdphxjvuLdkY5voaRGNtNZsrZ7tt7mO/nKiTjtEHfP7P/D3/0BlZMVtIDH4hsD1mLc+Gc1GEyPC5jrMbuYj1FQFIl8iAqWgNSNWRHGG1ettrIlrHNXR22OhEk4ayUMaOEUxegur1QBh5GSpTOo/sCxqTq1+5xO91eHJk2I6F0HMxdLiFyktlgoBsEFIKsy125XL0xVDIWRiSRuM2UtgpDGUg6bzyON93dNlZQVk6BR+87OJznhJFboxSGc905eLrCQkbD1QR3nt1IxOueTRwFE5MLPWWBz9GpI7YOaOk2pI/0il8YPSm9vXX44mN5FVL9XFUemDM32OsxdOzo9xsKF7Fs7N6ljcj9hPeItEUanjfvUj3+z+sMlr6LtJQdSggmeAaGAdl4fWnfYjuGXS+sffcvP4sVk5VT4IPBUguxWPGkiAg00iShdAkT0bhNqrN5D2NLUTwZ5nSxfTPlt0MoqTMHA7QT0iqgHyJiXjTHym0L5OfxUX7CITOq4SFzDIfkktrCv5MRimKQNnzV1E1fXjg/DY3P+FfCkTaKXr1507jldkfj03nbOPznfTgR90urRmitlAJPxJXIcwAqtqX1R4W4prSNd6apRyJJjyc1tNLco8b6Q4qoHkoa1KSymZfyXkjDQvfLXYVKlAon9F5SYS2a3GoWdZH1FaQSoKaF/RzljHHPzGVH+GlXzvOK6zm0kn2RF29z4cGWo2mZaCvmnRhF5DMJvqEYQb/SbtrtfPfY+vuwQrJiHnhIOYTqjZJsMgsP4KsbspdbRN5Um64lzBE1AS/zn5qeB+zEpqRRqEFk60RW44FbptZxuu+ljYMt90QvS5TrRHNC8dhu6AHSpHlUNPO+JLKcQc/W8uoyng8VQpiyFivnbRMcgYYSmvFKpKPCNFGtNLVjiNNkiTbayCOa531nn/3YJlZEVkaBH3vhs5cn1nmSqbdNHSe6iXsjqkLWXtSjNEodMWDCTs2wDdy9ehtXXPEcakaVaTqkVC8FPC7pGo+B/UKrF8JM1f20BVUkLs070JqynU7JfK5fXeaKNWlfeIkoMkGNCqX9lBki1EsqS7R6/GKGpP2tKIjay0aRJgtSqkz1qdsHB9tYEVkJBR6JK+lG6GwwmZ40SKpUD8meA98WjQLNhSSVK1ziR/9I8ofCXlecnvtE917aQm9to0AWfDT2RQBooycS8Xg1EVIvwg/cUclD2YnJy63EPbYXw/soQKZcj2mwxe3ZjiTt/BJqTCwVOMtM8ytgBrMBdX2Ny7fWv/vFC1gBWQkFPpC1ETpv8vcclTZeCagKBeu04YVmu4UjVV9vHU+0hdLiGxPeVl2jpnknD/9dSgwR+VQo88R+2eGDEhCURcwpw1MyeaVAuO90hvkjK7HSy/tfJeStRq0cGvWYfiwt9dNlmwhJzGREernsWqrZ0hXHaofa4kUyRCVmV7qV8MKnvhZ644U/29ROX4bMEKZpaA17BUn4lM7GKqioWCIBpiRmhFobuWKJ3n6UJ51SVajKOm7ag8dFogKZRhqBioMwJHblOlMaCY3lOWx/ieIKVKWnx7OSsybKtetM2KraLkOji1mv7A7Zz1mMkaZ3FmTcbeesTjiRgszjkUPXV6rbVMPg2rlkc/0//q7d/v/4rT/CKZZT74H7tf1XVKvy0OlRC0PZQG+ZNRzTitqJK5sjtaQyGVI4acTORTbYYjU/lWu5x5qKal9KPEyPKtoF4UX87Iw1WWc/l/D86qwtlZdsMXiuTiMM93Cigf+a9SFeaIHWG3ssPovDeTiSWWDeORFIyY03zLMU6yVxDQ7F+QiQDV6vExWB0JD2BwdXTnta6VQr8OM/86+2hmf7dIGcqCymdY5SKhhxYKtRySALeloDdug5HJZ6jlhR/vqZpMaJ4Z0KwEVqUMTtPIimRyydnQpWHVeFrlKPj8x7u2Eqlyo5NBKQbAutCMBsCaKiS5VNIHCWmlwDolTMkY8m7K/KKgwSLA0WI7JIqmXeWLUWkXEZNJV+ko3uXd2pTiudagUWTxtJCVQrfIO2Fl3CxdA7c10pP0RgarjHbmCd5zrgDDfQxopVSzC/pnC4bW4WrOiqhI8vDsVyKJr1htbBlbGmlvPTndWDtBbHx0NLtpVGRRWQ8SZvwSG4ZFwdpFcClmha1n43xs/YBPHUmjA3jjCqxQoy7s19aQOlDtP0tn8fvv3FTZxSObUK/MT7/+RyjDYCQpm0aGUNQ5Exnv30Thbuh77L1/c9tGp5hZyIxSVD0mhIBnzC/ko18tO2KWWFQeiA3XGNcV+5MfG9hN/lqKpAydocu7J67snDlZVcNTW9rZii4cjbwqwdHBRoqrJ/dBL5LKaTNC/HjOPcQLLhjK2Xcs9+JQ17PZ1zY21NXsYpFcEplJG4OljrP0OGsk5pU7KQSoIoe974pZeqlD79DEK5kMUN8+/TWh+NBC/KCJccp+F6hLtOiFkgvbsyjiQar6Pv3bfyfOV6ymil6bvlptuRSbwf98ttG5TrzHuy9an103F47uHC+lLzrMS4jiZ68VgXpSjDt+5ZlhnR/DQaKacV8v16t5FsnGw3n1YH9fnlqChf1nu7jE/jQJ/Z/9SlGzhlcio98MF6v93keKUlkUxUGlPPZZOEZS953Ay2GB/agQmv6zqJzhn51+zAkoeOs4k0aaNyOBIyPXEkDYrM3ToS3QukpLJU2/xrsRZoz+nXmUqZGEH89A6HDfF2WUUlBZbzRgvURuxdU2zgIOhk2L3h4h4bZ5/7yfzaw0hkgXR45EmN5UWcQjl1aaSN7T9/ut/vP8bf4n2eUK9ivVDTEhQXrZD4x0rJCpnBeFQifEbJUooQy2mJa1USujd1zeSFpJIycD/nzJgfMxhePXy91CcJbxVeFzQ5M6X3mLSYJzZSKlRAX2qwn5cD9YEkldzOCKKVM/02g9qwuccEadQKDxHtCNT0GNKQROouGT2UNomY3EtB/135D77tc/ovf/tUTb9z6jxwf3v/FTqNulwbF9j0I2FKo2SX4k/kFsVR4jgEjqui18e4hDQEfux0mFHSGC4rvDX5Ip1Qo0bviwslpMw0VBiD8GocEFHuDIJSmukhLAc7gEaknAdhXDTMkzPMSYQ5A03dYcv24YRFaqPHDH5Nu/rFDaz+IRjxluLMWjxIYcMT4DgTH05YNVKGdt04ddPvnCoFfvyDf7Y1dJdNd3ve2ZM5RUnFuHupth4Bwpp+Nn3TdNqa3dOW0PNJ2b8hcpAQ9YjOquFNrbOp90tNZ+8eKCbDE8ymuLHjIONyJEqehw/tb0lT4/rOL+DoXLc16cWT6GrbL+9RVN/inqldGlYmuShHLNXyamsQ1WB9XLjdaAuztSAJnsnz5aob3SODEp8iEZwS2dj+s81+H9cHF7YJJ5BIhjgx4iV2pTKp760FemqQCksOK0k1Hp+u1PI0gQFReo/y2CPxk3GcpjLV/exaEDiXcDqINnPbhVSzYYi+P8ktniOXE1qHFpfzJbnEzd1zOi/kNmlqh/kUNyTbaBR4TQ6bZyRY/k6iCs21xX0QDSCggma4ovP7iLYMtFD282tvqlL6IODNlPTS7cu7b//upddwCuTUeOBBebd0HG1EyEtL7z2TZFDGSYYdHRe78iBTLvSm3IOM8ey8VUXK+FwSolrWaq01gmqB8uNAdREcPrpfUwM84ddVPqWqT7Ndhvc8tuShSoYsPa5tK1JyYJNOOEFmHjp+CyL3rHlcy+faPQmxu7bXVgBMK0TGiZyADCFa9402Xo4YQmaHa8jMfl1PDaF1Kjzw6H0P9vEZBIGRaZ3GE2lJubgewTXNdIrgsE+E7ZY8YTE9Vl+OT5/gnpfpC/egqdGI4vvYrxwTcaT0PIW4iXXcz1GB30kfyzvzoHZPvTaTzOXxild1aJoogNfP8xtySf3urXGmFUxD2XtXeH3SpsPaZ1DuI+83FDyegYbFLNd7xFsufPBw0851n4xSaDQPhkP0Q1rpJ2/ghMup8MB9321XbzKXZn5jFklQeUfx7wKmc4T9pgS8DlWDFGpdoTOdsEEHLWHFPuublxi0jKQB0UKSWHX7uZC95mc6aOJFhCety8WrypzMYpWa2Hd2+pwBU0pFlaLeiB83AHIw9daGkuiCqkbCCXqYC6gEQGnXVEJbGDXhvH7fyG1Z1lWXI1diUtywDpuvvXwaCK0Tr8CP/+z/9ezgEbZCF6V4XyAUSkoiV1HhmRMcuc7X0wFog121aqMtaIyGebtC4BBqSpbxArNSq+mkXqrUQPb22uKYeVpXIipxbtRaMgmYbDoUUJ+rHYE0efLWyMF1VvMa0rVJrm+ahQR0bS6dbVjItSZ3rfXqwNvrg5M4SgqqiQ3MeB9uI93szvYnvk5acMLliQ/+3zenkklCRMCJEZJOBe1V4ieKiwtEncHWWQWQ+hv0JEmndj/f1zBofZOfxDl52UZ4lWM49NsdPq92Xf9ar2f2gH3ffP/omx8Xr4+f+0cse6sF+0cf563WvfXG9n2/PUus8Wsal/Wdbgy3+uzQKBcGgH+uVrtNwmcRz83RCbxIpoHLRsQR+MfzZFgEQvjDRF88M40wYK9/Y+08blzawwmVdZxgmdJGKueqWyCwtT8M61qPBe8SwkqqtNDcmZ7Njut4WjztKQE348AO/TxNOSrxONdUr+WMvEQvRPB8pfIEIlcefuihnb0r7z6xnWn/qy/7jfHPmR94+SJkbXt4bk9SSb1NQA4wy15R3CYhum2euEclftkTcH6Cj6cnA4bCMRL6b6w/vL89XOMlnFA5sR54Shv13XV6X0RKgQQMnWt6UXpBemV6wCjcP5Is0npsxB/1jlPImEr4pCdID4CAxfMaab365b/9Dc9jVeSvvbx5Zr97dfi2kV4XU0OZ4es9b0/Ca9yJ7d4Hr1DrtRMdFxTUIJ589rXefPxviCNPLKF1YmPgg36w4j5JXQRRZlUb5TXyalaiVMxWKK+XKcIftqbG+ob1TJqO3isqcrC+zsziLIQNkkmC4Ol73cEqyX///K6i/74o3YI3Y8fYvT6gaGJYnFypAycPYPvYw6PRLPG8OskY0X7rtw705BZ3nEgFHr3v8FS2iHr5Mq8yFs3iKMlyxabkVlPnfV2hsMZdOk6nQRVFJWRYohTxGTuIkB/y7Z1RNkMfZI1fn8PuXm7c+vg37mLFZP/vPX+jP9Areqg6TZ1QS7KfSWFtaPAMjepnkoUsL8Vs/tmq1zZcdOg/F9a+9W+dyLc6nEgFPujXp0Q8IVJY4MBbokRgDFG1kiaVgfUjsG7WdihDCr3H1PRPibh0xgqjLkOtzYjpY9iXOLZXT2zMe6eyPyCPoR0+N37nsyrqRQ6rGE77oLLCl1lwzJptPgY/hrSjxcB0mDYDPsZT/RIubJ+4tNKJU+DHt/98a4hb3Vq6hfV16WU13K1EfS9ct2WuaOGt8zmnVxBE/kELCWVHU+XqJt/qqyVQfZwjyBrEtoJNrKp88vm9oYWuFANJ1JNf0KTgCImiBQEqMW1mjF3IHdpMlG9DgzotGZ/r+e6hd524tNKJU+ChqbebhL2k553XzdZc5wiLmdfMWNm3K5VRoevT4ax0r42eQ7mFx0Oc0fPGpXPktWqbm81Cjc2Ni6+u7Auq9//ec4MXHtNn5i7HyfbCoJqBm3K/EcYEMvIpg0JZaYwDTaWEVy4FPUCEV9kX5CK+/SObOEFyohT4iQ/+68uWR6wVTkZkTLMsShIU6mbdxGFx2S+fb2PMoRw77BVFWZpnh5FMN/uiHH1jO3UlBgNqcQK9fqShp0uUjTfffHOl3uczFz3A8yzEMi5Bc94yMNww/OQKF8vDq6J61OKAM7QB4+bsB4qivKMx2FjruxNVJy04IbKx/fpmrwdj2sgVmKW4TPMQ0ioy09MUZCD20ZKmsIQ+0KQhgm2OIowIlrgNCSxf7jXOiHSIoCh/732wTnHjn+Px+4O94TLevYpkFuXMf/Hy9aElLrS1zKOUtkJt7wySI1U4fXBEmKJO3VP35XEzvVfONyzr+/4Z/KP338AJkBPjgXv022PaiCEOmUcQBh0qlZNUS0Gp4LBN7SW8Giu1iXvL/vaMo4e402e/0Rl5lRRVQ16hMZVSg7Rpw+5JOcUTr30tcnvwwsVXJkFYlLd6G5bMsv5SmlLM2g3soeis/trSTTV0FnvAw8fa2sl5WfiJUODR+w4fW6a0mrY49YWji6iqanBJM9i1b0Wp5bDOgw86q9+5aauoJbZmL5CW2ZZyJam9nmeeKrSknG+sJ8GFsz/0BxewqvLJMTcsl+NRWvSbBCQKhaCa9s/hdUxQwCcn+lXQJWvMIZCSRfCTD98vdN/2CxdxAuREKPAAal7xoBYNowz3Zq5BoMzKIguHEbNMGFTifsX70mIj5x0OJWvIL2e4YQSZPXvNcFkZhlNR3eR770S9Jtgopq47nROvfa2y3+OloZ1eB5gOymmAa0w8TWtEPUWMYPInW+F0So2rGfsmBGMMrZnJ0MELn4C00rFX4Me3/83W0MpPc/idFm1E5P1qGWU+bEdH8dDCc0+LR76J6KueURmaIl4bavxUJZxzazs64Vy1HeVoyDRTeHMtsFqtdlrxVx557z89EZb/nsiQVhra50PxO4FKSR0BldNoDKr9PfyUYlouL0APP5CxMQFc9hLZ6B56+NiTi4JjLk9s/383R+JKKhERcag/wOaBmkbaqhzkTq+LSOdoBLi2DyqpEecgURLrC7GlTlaRqFKPpON8k9goGZJnAOPwei/NqJm9hx9+4/zelWdWtsDjzPd94vrQkBeMYCQr2RJREU4ps0lZlMHJDdIP9zInr7K9YeSnKa22c4UPKK3DeXzq/bs4pnKsPfAT2//v5aGNz8nM0BgazemcKymkiqbseSqM7JCz/NexugRPDRnVnClSDLXCh9s79oX6IHGGUDH+uMJwEK57R4E052Q6akwrvfHGw9tYYVE92Mk0m7UjPM5VD3uamEdQxmBrQUE+0klLe2uGNYXP0Ng+iAt7VGsHeBnHWI6tBx6JqwPoZybN4PQ1dKT+p75tofGgMRbXDbR/t0PkVDcIT6mHprgBkvWMd+u+xTQxNjmd9QNLa4HbunX3JGV4fMXhdIYNbeS62/v67tu/9k2nYuK1dyLr3/93R97j2ZJ+S2VTzdFcrtqAPzuOTEojrvF8i7msnjiegaIdw927F9aDIa30wRs4hnJsPXAvHCGSjpFtPEoMA8xUQKR3KjtNoimOKoAcIqKmUDhiVdupQ/NGQA+GyyVGKqlhs5MGRewV+ZAGW0/XbnG2U+QFCqyvrzqhtTaO0d1jDXnUottT0uA2etdihjfT3vH4Ye1anmPpT1miKQ0LPYoRnNxu7RM4pnIsFXjwvk9jTBuVAQS2hg8uIZTXE4ODEepx7KGUtITO5iR2VjgeXjDUQMTLvggoL+cqbDS95nQYelIW0GuBe4VIsUmdx917nz/K1yfyG/d8z9kf+p8uYFVlSCsNzN4Vb5esuBKHxZKElNm89tFHcsJ2niFNeuxERF1UrdfthBtudn/1bx5LcvFYKvDQ3K/YF/WO7yMB+PBm5YxNXCMzMxvHgCksz+ADITw0nUEsP1T9wugVhNmuzp52EDAl7J3GlVRiAANHHyHJMAQi11ornS8IX3t54+L11a2T7ruXhib8bGKZ8oUcBCqz7wXRyJj46Bix8dOOs3XuoIGm4rb7ueOYVjp2Cvz49utbQxtu2gOSUBpa0WSutGnvGQkVSoOyra0gHqYxSMU3L4oj+CyV7Dd1cfuFnp7kqJTjNxcnAi0wUFB7Wy1YwLlbX35odeukh7RSr7KjCtTyVrR5XIDoS5DBDN9wAW3aOo2oF3/wcAhY5qFU8+jG8GZIK53ZxjETwTGSqd5Z5Prw9RySWGqo/Yb99XRMMJbIRDCcvGjSTYie4BOoIUYi9drW1hqJAa2vJ21JKL/oQrBF2klx5GtJ4zPgtV9XILpynQnl9x5+5PZqp5We/bXrQ1O8x9qkmVIHzh0EJJuelXMdKErP1B/bNd6KgQiA4sd4rF7LmylK+k87eTd+9wPHhlw8Xh64wxhnbDbQpXzXrKQJFJvhT2RhD+2XRJY0sCtiYNALKgIQ+3S0Uyg8GxRuU9XaOet15bFzFFM67nmBgRIKsEs5IjDkQWWf0kpfPn6W/36KYn8njbD52AynJhFiq060lF8CwUMEU13mwgdNqRQf7P0gMZfGwx3/9cfrrQ7HxgO7970JkHvopZ2FH0AlH9iuAaWaRL+GB6clPpRSYuLfLa1aGR1HJ9VUVVrutNJwz9xFiZ6lp6b3LWH+bh+U/ZnCmi/npR9+qfV0/AP9llt/9z+9gRWVtWd/9eWhUZ4j+jqcPpyecGn3BuGovyA90BvbXSvyskIOhGGY9Ts+z2HrY5NWOjYeuJduO354LJhvSZAEn25RxSaykox3/KExz6AR6wSvhEgZxTPzCoGYFJGMtIuWSwqH6fvTM9tvGpGopY5dc3qf6ZccZTTpDWhE6DXK2rXT9Va9tysHOHNpaJrPhS7V+nV+CnVM2SeE2YQMvcAD+E4ztBfPJwhHzY6nTEV84rgQWsdCgTc+9PmtoWG2suOToKo1rAZ1svqJ1hNAnaHDJdhfWw4yG3HSKX1jD6y83mT6Eh43aOKsg/eD58VrLEpqU1m3HZAfEjPh9WgPBrqK4qSFeh/XOlzdhXe99/dO5MRrd0UGQmv4eyXUq2GI3ShPUhVSylRJGc1M7R14rVR12Waax/H+lsEyD3C+69aOBbl4LBR4QDbb8aJnKUgFWfgvPvAk8r3N0MBZ3IPmkSCsAGJYURl1krBYwvfbQdHMBWAZCtW2J9RzuF1pRCTjM18CIgd6fxSGPe6V+c9ykwM6f3Fja4XTSnhoHK20y9/TNElwA4mCeoSUhaZRdfF2r51Fmk3k6MzB9JA6cX8wocL3HQcv/MAV+IkPfW4gruRcKbTw6imPaSvE8bG6isMeVw+pTkFJYLjj3pyxaauCknv5qaXhoMq5Mm3BK+gSn/MYpcggnazt/1UHq+JwUYrPmKvYvPXQ+kqnlYZn8nz8jmashT72xdUywY2HuXxJ27SWNXjhpCP4Ld+dM+WXhNJPdWtrD5zQEjxAmYirbu360BibJI+iBlUCT6rHnO6pTB/KVDpI/dDZd4CERaZ4miAo87Xl+BHP8uHH60JtvyROFIcJtr52G16PNq62vMcnufNyPIfg5X23dhF2aZ+Trn/3rY8/s4sVlfXv/fj1oUEu1Gc+G2EUz721ndkPuDxHqfTuifkcs93zeEAQLU6Y9QcHz+DGzg08IHmgHrhfn9Ijm0HrTwSOub4yukSa/Cg7uKGZOWDVapMydRBxNOZIW5zwCjXUWXxlh21+l+MqKi8y/bbB5uGcSx1uGVmDxiODOSVua/F51ONO57NJ+2R8HUm/2nXSIgeXtNpFDzEOV1+1iK2BZEDEwmas4frNNFMY59Rx29f8OBOTlXx9APLAFHhj+yubQ1NtQZBlkKkKUksPPTJ01BveLWMXjf+z+GOSgNrIlEO9CjMKWbFV4FTRMEEJi2rNMiJmhRsHqVjdzk02dH7y4FyMCQeNR3B0/saJOE/AxeG/7z37g9cvYEXl9id/5LWhaa40jwFZYut2FaGYpddIYSTr3qgZhnAEkuxjhktC5OTP+cLaf7bzHB6QPDAF1vWDl+0LZvGrxGd4Qg+QJZRdM5CBKbegiYcIh+wxRuwcxkLn18MUg0EsaYmOpKEEpWaZO0Z/gcaGPAlLQyD13lDiMM2jN0UETG05Biex5/UEw99trLDsdw/vDK2wZ3UCXippOmeN7d64D3JSAkw3z9b5CvfG7l+RIZUWtsQ7ajUc46YDUnpg0+88EAV+fEgbDY1xwX5J9nrGfohcKOxhqIcrHAQv8Z5JNqg6a3yEAiliBsM4lNRzm95QoUCHiKyV1chclWMTljXbhh3X9gvfeYuCDlgTrYy/AolUZhrxyY7lB7jw8A9eX+3pd3rsFL5CCKVRH0SReQ5e3iL11KK0DLo02E8PeBCavYmRlX4AIngA8uTPf+nmeNMxKic0i7auVl8hiASNkKXokpZ9Im6J0DEIi1BcRb5Ue3qNJQojzW01csdaamKz4qcZYI45YZLEVO/GKGMqVVZ3VVJNw3h5Zwyj4W0j0ywFbm54nQOPt/fIbZzfu7q6ddJr//nfvolxrnBn7o+oP/eOUl4pWvpAJTlJaNrDjfnCzUfkBualwf3U+wg+N3y8eyC0dnEf5b574Cd2vnCZyktUOYtJTOQtbEs8G/eaOgtrC1SlxXW981gmB8631rbUTgcCQORsPcZ15ZY5VFZHALNLyKqqclsB7wNNwKrOnORqzp1OW7xJ8jqH1NXGrfVupd/qIP3B8yBEVuRbKPkQCnHYtCsSWbm5FwvTGJ2VoChORmvMGFgrJH9SHsCsovfVA2985CubetC/Otz5Bi1lOl9vKk55o/3kkrpJy9IDeywSU5+EeP1z63WDb9LxpdsJbyfr6nlaTpw2e2uCaH1WtrzZpiAAvwfx66cHz+l12G/GqWxVm8EOZZI962AcbeOjpaD5AnIWsvA+ePx1/bqVTit9z69cHz4utAjO2tL6Vx2NhOJ1Ww8dKUzAakH6RHPVU1sH7UO7baJvs+vD872vaaX76oGnYF8xBfsMYZXxHkuWCuMqUhI4bkxZCwPwkwPz6XWT4KrxqCTo4fGEXhillDJ2qZ5ZcgI9KJ1vm7Ii2+yPn5mxiLFoqKIyS7wiy429h28FBZjn6MNr2NQwcRlU/vHf/vGeeO1ey/7tN5+P8GqWWeh9Be17a3CjhyRSE+tWnDNcSlpiFKKk9NDqj1PMOOP+1qzfNwUeve/QG5+rPr+8kZ2tW1ZKeL8y8FprjGvinTjiUZCJ1KZiy+xCQlnkeeG5P98pnClim0Tu7AwaXhlz2J6LwpBEeUDC7iTN0LImUq5N2qvltc6ONXy/sMppJXzq0u7wyC9HKFbqX2gwSWYeVcUXsRXoUUM9mcdsIuu6M59z8CZDWqm7sH3fyMX754F7XEfCQQTEzXmnKtyM3wZZmALSjGya7i2sZ49WhBlYad6Jk4+sKMFhC1vHJQD1jXZdvvC3MpoFAnOscBojOk339r5DvLFhfmlQJHPudwJn4L0ys+l59CSiL2OFZX/9zZeG9tgjsqmOYmy0TlDaU2vYViYtK30zdp7+OvCTCG+ivLK9DOrzkFa6eF/SSvdFgR//8Be3Bkhyznplp9W7JKCFpIeMdJBISQHZcnqzTCmRIIy4WNrzswJEiGBLHtkdfPGMqfBOUWi4Xk9V1IETOaxNijGK1KOgrK9QTYt3lvkFTxtFBZeTK1kjbsYsjsF4+tzDP/iPVzitdGlvCEU/pA2pKdrEu7bI0+ilYIDbZmhURiG5qYcjL/6onaAxFtOJBuV94r6Qi4J7LBvbA2H10K1Xh8Y910liYTN2s3mWSUBwG1/YfAdKHTT3a9dzn0JaaDtomwRXppjSFRftauA6r8MJL51fG7jfRMBJ3M5b34e7gbhvg29ayol84L+xK7FLmxpDEl0Y0kr73Uqnlda/+5evIwgt2kBtCSzHyUEkOkpSLW900HZaHu8vpvPK/kfnYMfUZsKAybifv9dppXvugfv1WxeHO9kEqLy2PKBqdYG15ljCmSlmcLOsLp7ZPyvvVeEuTaq9RkO6sK8+aqgF0q5ULPSoZ9aivKji+qR5W2S/CnSHL6cxECArr9T3D28tGlwAZtDdEQWQpYHD1htfWe+3sdqyY1oGNFU5KKFU9kE4otNU8OmPkZqHORP6ZHGPnABbcUTm06sN76HcUw88Elf9gXwmpsUp1C5KsUZNKQXcqd7YNkJ6nTJSqNk2j6tNGgHhgc0aM22kBlVtuBGkFGbYgfq0sn4WUEm18dbTCfMcKMRUub4Im9SdArfJ65zd78zau7kLlILaJuBxD7qDr7/9a9+6um91+J5ffmVoh2cxQ2LuRYl60PQhtH1OtaT42Pfo1ZUpSM1UJLiddTB/WuOQlCGt9OEbuEdyTz1w33fbScMXC1iVF954/j1n0dekHRxGFmax7OXH80+NA5qH81M3dYxSZ7uA11EU6O4aFvRznkNju9C0YUnHQNbTWkz3JBKAFFuZkZV43Kzx1lFxKC+FSZO0/1py2T4nveaheK1rKz5aaf/2/qUxnNAmHvanWeNVtB62+uA6T3ewmSjpP9ChRI/TVHY/wvhXu5dxD+WeKfDgfS900K30YgZpw0NlChQt0dMnXg599Iqm2tsxU4mA1K5oZRAJ6qwXcKPMc8QxxjU5FBDg+Zt8DRGW4VzX914rLIZwFkvWZzPs8v39d8kbS+aJC5SYnxVBwJX7bECUcNicvOfsD/7uBayqDGmlIYS9Er/ZNzxDweip8iKWPYhyBI3wJZ9Em+a045nFzgeU6QV3w8PaTVz42W3cI7lnCjxc/mR51ONTiY5nOTlnbHVuBaNNvI3Di9H7STS/arWZafigMSA+Q6FDaRuRxgITsnLc/fTHnymVdq5WvC96zUmdarxbQgblvSrmuWJkh1F2CCRE93WYph5y4NcoNBsDrtz0F5/Y2HplZaff6R/af2lohM9OP5QMs9aQKI221xLIrB2twqqrTpx2X72qcpIu6jeL7Z+Ob15q+PO+e5VWuicKvPHhr2wNt3guFihH3vhP63PjV0F6EmWOuHGCWmfX92Wk+WvaKXC4trWu5brCG7sbTN8VOqMkNhrXppUkA2ZOOVDF1EV6MBfc5Iek5VWcPBEb+Owd58h0UrkDNxQItOwORYhQPAdtB9Lzt7rHVnj6nUt7w8PYQVpBDcCTThINyE74q8abyFQyGVU+NuGhs4t+JJ8EscyxxkdjFsP6/VPoH93GPRDBXZap3lm768NVn8OMbJlEK0GQ37UheA41rKLEqISbk8fqNWIWK2WLeBiICquS9vF1lQyzzk9PxgeQBNrEcUm8jjTqbO0h0zCXweOax4/7p0dFO+ND1kXLdA7385pvIFDNa+H9KDUWdq1pkKKtJmjf771Lv/R1e1e/b3VHK33XlbEvXuAzb/pH85wcUs/7oW9LAsx+KpXa+l+kjqKvTw8LiGeByZt3B9+CGx+9gbsod98D92tj2uicNEUMeeNI+DxJM+9T02ilaoney0mEEIWieFtPFxWnS3ZXoruHriZbPfPUwktVzRBJQK/KfZFontc37UMPXEP0FlzZNLYeDijjZydNaAz88XuKKyGgROhdwg1lY2i441G6Tp76cvfoShNaBwe6w+8SZZUKVrZVqFVisozPargDoHEtrqYSG7QZZ671TjR8Wd/GXZa7qsCT9xX5McP+3hED640fHXOuqDojcgQQqNVRIPFVmqfJGbf6gtzR9KwW1viautEIg6LUbm5c3PoIyzJDGTWtChi/QzJnTc2nPrmy+XXZlz4qrLIdBOV4gTgCDaRB0zAmptsRBjiXPbV9B3nu7Nb/eAGrKp+6dGNojiC0KpQGtD6U0kVYG6CVx7A1CY3tGdBj+J8u8bmnCfqsBVB9D775hQu4i3KXPfCZbSIRKUyNolo26gBrT+mARZNsAHfyrp+duipBiJYFyhDXa4fNw6EhvPIJwkdDIeal9ocnAsln51OuUO/9qtIQVSIuU0AFkvlOTqIg4/GmdLPcVEZSad/9TjKWbs1WA01yh+EEXfdzWGHZPzN4YZHX+VvcqANHEJOTkKBJ9Yin2MTAOOR6GqdMl9BH7fRwyCGtdBcJrbumwBsfeXNruPzhH8qAVbvvrnrFSUSzBx6RNfFtpGqzLUOwwjIfpBC8gjdgKky7nW0D5TWYnpXYqCSc62+dofdCVjVxNwIlaKQiqF/+XYS9CG2xQDkIrwXREcoUPG6gPIabRQB2S5HamhZdOPtf/fZzWFUZ66RVXhq/UnEjjJokmX6zmYRYOmMtLZ3hUKcdtCI05s3zi4ojSY+2if5dd41cvGsKPICH7fHTuqZy2IzjDJbqFk2ML/Qwc2WrEDktAlf64mIMtVWvgKwFinNxukDf2r02+MWO2YWRcX+mLH30pTJno+vXrPYi51HsOEgb8/yzKb5iu/GHowPpSYZWRJIQ3BWW59HkwSceDNurnVbqp7c6UHHzORb/oZEeooXWGi1pxmTOSLvC+vY+qDyhJ3ia0HRCuIv4hhc2cRfkrijwxkffvDhc2KZmngwJ+z2lmt3J82fe1RQ12Qs2ZvpR8dcJpWIFCTQJRxjN0kxIANp4KFAfVdJ4jhfbQXjaDk4iOTEUBGU1sZW99otXkiKCCCUm1ERIlbo5XmMnxSNzn0bEu0zk3HxxvX8Uy0F05+3hHQuW6di8hXetdFppYGCeN3X151ifXcTAJZKitw2VlCmm1TYupj11mJwcVnIfpcTWVm3gzN2ZVVRwh7LxEd1UHFyXaWY+7249Tdj409MhPpVM9P4SD1st6ZQT4tA41F7J1Il6+oYPIXwmZ+FQZSuDdarZnp6radI7GtfC7TLG0fIEXG2dRa8vHK8kB1M+mSaKayv3ycus3jguwj227S/WbtxZ0+hkSsTOUuq6pw36otz5utTh/HuDLXn3ravfsYsVlbXv+KXrGEcrlfSc1v52qE/kckWJDnubRgczVGWbursBpFlmhJYwJTV8PoPfv7O00p17YOm3h6s5F781kLKI1KlkBO0bEDS2Rvutog9FEko5myT/iKAtfQIyVZX+PFK7iT+rCW2MmMe07v/zdMkRRThkvzwVwRSOXRb9f+op4ZdBMLtchhZaDFoasPnVVVbef0sul/TgOYmBR8B+KYPH7zaGc652Wkn2L2V6LlFdSGnTplLPFujct/iHyuxBBaiU7C7h0cHue+de+I4UePS+w8VvTYlKTejWCbv04QZytCHt5+Etiue0f2XL0O/wpr68JAIYc8e2fi1kpTGD1QyO2+v1KrGo74jHEiftXEntw4yH0lNDdJYiKzbGuAIp7FapyFMBZryWNCRJDBKZ5SvTY7TxPxx9DAu+d6XTSr/1U68NzfsSf47hUqNkzcY9SgmuBiryB56pJBQ4jsbJ9I4GD5lmW/wefNP7n8MdyJ154HEaFxHUrp29KaanoNMj96PpiTsNxaciMN4QehTWLAdjmKcX1kjUZh+/91JjykDak9fy6sX00BG5a2Gy53Gzx5FKVOB2RXVmkxFstSm/Kw0Ng3n36AUgStO6CKJSXlAe1l08v0tEPfPVSKMxXaGgehBHK3YLq/1Wh/7hbmdooVKdpvG3BT8yVfdN31NhUVVdSg2lHcRTFh6GSXUvsXlg8eGoB1fuJK30jhV44yP7WxjfEJdWyaFcVLF4gXIqHxU6HVgzlasC0pSxTJ/E4zAlCMfTkEpaCCK6N6V622iDYmUrdyG8xkg/2QYN1M5DyBRv+rUWFlyIguWQmSFc0jo+CnBig32BAx3M41erh5w9s/SwQvwZ+dlD56w4+5EZGzNgzgtceHjrt1Z7+h3td5IumXte6zcItnluzjX7EdXWFrNr+ZMWIqvERxE7w7uybGD/oXdMLgreoWz81/1NTMQVikZoYNe4Me84iNtrB717LTKEqlhxoyapI7HIlF1EpbowcJC+8gdLNOIcWq5RghSKdE+5j3gyGhZEeDNJeGl62CTFHOzmzeftSLyqsmkXncEA++0lpr54Nme1gbNSt0ejrwk3+NvbmdcLv94e/d678Ob5Va6T7r7jb706PP2n+VxdKTXa0/pyQ0a1WluIrOyMMtcHW6PIciJt+tpwgNd1H1+PP/zoLt6mrOMdyMZHhzwWxtdZ8GrKtXnfMxiYM2e457UNiBRR7q/EgRktcMxwjXOtD/p+46Dtq8PK1yYwMY3+wtS30+Ttb+rcHxJOHvSbtr3/W1sbZ163S+sGYi7mRRKGzrQjI+TZiMhXAuaO5npaV4gzzZuc6sBhnaUgd781KAs3FAE8EsAwlyzmVs3wiNROl+3TIA0k/Y8kvTZu4exo+XewojIEcJeGR309GnhaGsy0JiJDQDcNXKZIRjkesrQ6odF//TkVR1BZC30K69Osos/gbco78sCDAt80BdYowE8PSZfSerVxw96gabwwu+5Tyg7DU2DmoaI1dZoX/8r6F760s3fl/InyIGd/5J+fe8uV/f4mv67p7fMDhfLcYOXfM/62FFuUbfkQtgmS2Q4GOY70FNaWMbGCmoWaUMreI6vuhb/9F28OjXgOSaxCm7YL74ro39o7o0zEk/3WwpkejS6gzqSi/FPoMQdkZ958CjeuvK1n8bY98MaH9enhhJsablGdG6mFFQV2+jY9vFwx4CH10kgn9zfumAus9eUSyHBq4Mtf/Jt/8UR6jlu/8vWf/Sqr67pPD/+uPvLe3784NN6U+qlvnQCtfJp2Rt/ZkSIi86bP+IQJ48ELrz89fN7Aqorgk0NLXAQzlbYwobFY8YZEw44t3TE8IpNF7mcAcH14bpGkfXzeLKqFPTUlf+RJrdsPfe/w8xrehrx9Emsdm3bfbTMwOpyukoMZJMmA6Hbcwf6xKg3tMTWrW+KvDXYYtr15UpX3nchXPvbNV4abfr6SX+NfyRpUAIfYK7NzkRr3xyNO7iH757DgHFZadNc/HaHMYhYCSATnibqs+YJKWM3CtowQQx08LywSjnoI6d6mvH0F7ofYLzxlXp8FZnb9fH2m0XteUki7E3SMJDgJpJd/GU60Sj0F1yujvJRbH/+mq0ND3HDwmxRJsp5lNFW2WR0iKQg2GyiB9QEWSa/L8MTTcZCcfaGxkHroh+qs+5Zvpqz2NWnqLNOkHow1t29X3okCv+a2iKxJRghG2sWmyhxmzjfEjHaplFKUWA3F0yDyxmCN8RAbSv9HWEGRXl8yyNLWmCNqzQP/SKvU0WMc6bG2e2pgXUO3i1WWfiwFHsWRr6Tho/ggBdPkOQOFwMJSfLTtxi8zb+yJAjJnXrk1LD3Qt81FvG0F3vuADAo8ncjPj8DC/jutTNZyTEronU+6TlpIYltHhQP3IUcgzrqO/26dOfM6VlD67uC1autiPCs/OdmAi5KoYrbNB4SYxRdSpzirb6ykQaQMzfF0hCCTA/KBdDKLYzH3wRquG+HOnJByhqoPVjYwd+3y9MCERMMxbv8G3qa8w0IOm7LTcZi4aUJcj7VGufep2D4sUh+uGG3sVmxbAOkoqJgchqx/5dZ5rKgoeb9cEh6YfTDLwAq/AhJgGZ5YRKPXVpmBxre/uDk0wgXmPREVbMULAZG/G79bOZbpbGMvKb6BFXBFIUeS2aStDa1y+Mmov9fxh1d28TblnSnwQxhrSfciuRXXbuWDFpl7wmNa31VL5PXJUjqX2OIySL+dMUEjepZufRsrKeubSVyJtljNOtQoygRAehDw9TRJFjrrjzd3sMKyhn7bSzWCE4DHv9N3FupKMDi2CaEhmg7sK7U4Z+/wvVdx8KA+uNZJLHXi6BLegbwjBd67JHv0wtMl+d8ko6iIrB9sHG3CullHBOfCzgXxNYM5vOeJD/4/l7FqovocA1l4ftwozRgiCXpjchFj+9qLqjVIlviEXL519ft2saKy9u2/uIXpxQNsz6gyEhS+ZlqWCd3qjVVVS5Zk2nlSZnodBE00eTPxDg6ZoczhIV3F73/0HYUy77gWeu+FgQ3WmrdUSKOL099mKBJrmbvIeth9BpT2P+rbonwW7zOe6ece++Cfv7hx8eZKzDBx9of+YHO4762KdqBHbWn13yKMZGIACYoxHH/vvgu3XsIqSw7oCHgMo5TiDQ2RcpMKlxmaSMtMMYiOMkLxwQ8RyoCMb9Bg6mWaB7d38A7lzkYj6cHzbWjvYbq0daUa8YPKyIz2MaxvNrmcJk6Jl3l7fMIRTCwxHDrnxYPH3/Xq2e0/28QpF+n3X3SGJV0ok4kRlTgXQs8RERZBGxHS2Jzd5VWOfc981y9e1DHn6mWn7hbC0GkpfUXbwYmBJBU1POy0C7cKzBPH4hHUEXQMArr8TmLfcj13Jhsf2b8+fFzIEN10lqRJr3VmDA0aJmZqVimTvBd15rHsU5mGaor8p137Pe3WLn7hQ3/hGk6hnP2h39sS7T7BdxIHAiYQjqKDKKmEFXYDbVkl6ZL+s7eufsd5rKoMxNVah+sDbD1nC2aT/ud4OEH2Ny/qYFaUbilGFlkMHaSz9VGRHArm3217C4lH2R2g89fhDuQuzIm19ryje52zyn533vEiLeT14BI54sr4HVZeRNVmTgJv+3mct4GD/uUnPvBnl3HKZOPiqxuCte3wsFLm+mJxBmQGpp00LBZfvTTV2/QZrLAMyrs9vmzeULFXRlrvcrQSNDPcG6spY+RDgulBYQ4ThB9VKRexMwGmZUe7bgd3KHeswHvvl93hPq84X8V60UB6FMt3iE8/433RbReSovPvknSY839BE3jdKaJaJpDk9uMf+NObZ7dvbuKUyBtf+eLl4bmfy5JIjzEi5z7dOYdKeS5Y2D1cJLz08OfaKs+HNXrfoQ23SPxRHzXCEHOlmb1tq5L8Szkgh7y38fDkgrP0yucZ74Tnc0T6Gn7vI9dwh3J3ppW91e3IOLTPtZENYrpnnoOeNLofW4o/pj15QCVxV0rPfE1kxaPBo4MOsnlm/+F/8vhP/atnccJlJK4gaz8WBmsSYSmbxuswo/AeUcLqTB/YwbyXDTGv3rHFP8nSdXil5se9I8V6j0Xsr05ziBWOJtKf7jM8dE4pAbGUjuuYKagrR9r7+D7cjXvCXZC9naFzqO4QjvBVJokqON6iTvHif6qCFtK6J7uAYLzAai49VLwvBcToeZxZe+WJ9//JZZxg6aR/hXl1DXgXnlRy+GWAENi62jTG/DnWvrLK3vfMd764JVPVlVc9Rh+ykE1K4WP01+iDID3r/bCdy803kBnq9JJh91eqleu6+k4G7x8ld21i972feeiKjrBACWlJy0UZ8yRu/8BJ0mHutt45QXVpI8Z+JLIQcQZzoRK5PDEaAbL92Pv/5PrZF04epD77Q//zlk4zRTi3LOEcKpepxUi6jgI1l1cM3s1bV79tByssPdNG4uCYKTdSNJn0bWLgaRfP7WoN7rRgQZhnDaIq9griCmWiiptYu3tI6K6+G0nk4BKyiMM+lP+7UkosjfGVM/LLuRlrWGbSamK9EFzOvkpWczFXYvtdWFtb/yeP/uTNp3FCZILOsHcZRaYoMnFSUFtJnXuXZBycLsMNnq44dP7OFy8Pjbhpv6T8HSVjjemLtNgus3YlMwovo4ptsqQjDxmfLdCWg5dw4+5431HuqgLvvf+RG8PFftp+mVHzaSLKzeb2UrSd3gIMN7SUx0TxGUSSbPCn4GWamgdFms5x7flufe3Vx1747GWcAFnr9OJg788bs2/LWIxRNNaVu8Vs1jZeJsnySeDTt17+tmtYUTk7EFfiBhGhY4UURMtCmzNhgiMS6A2fhUi1O4tY8ff0Nzvh9BjjZQ5D2uj3PnpXC2ju/vuBsf88xjrpkSUPhcvSSQUZdaTXiKbVKCRyKGMkDa0gmP6WeoAgHqohLcu5ZPvRn959+ThXb43edwgt6gyF2m7hJX7V7vlndLrYzdHIWGyzwnJ7bYTOyviV7RO2kB4VaNGMp5ls86xnk/iaOwqaUb6RKUokLdTp7jLustx1BR688O6guldqw4xfek3XKVIiNS3oWflmFdtICUFyAwv2guE2kiu9VXAOwKwg3Tv51u2z8upxjYu7Tq6zeE1qpypUfPQFsE/lZtl/wshdXXHiahwquFVQizTdyZZGEQzDVSDHCEUH1QzjdH6EorT5KSz+UAfmV/F7H76Guyz3wAMP8sb6S8M1v148bIzBkC5hRrLWbu0aclmb8DnZG1aoFUZ7bhTCo4syiUKrO5x+cx3yzx//qZvHKtX06A//wdZwsZuFDIHzBIFcfFOld1XEwI/AIKV3fRb9wQ5WWHrpXkHgNA1C4YjKZsBJLbeY1TZKgTVoQ+TM97ZL+SRyeF0v+/fkWdwTBR7TSqL9j8+XMzbTJOdQvfT8y5yJ5jEkj9bsUBgEMf6LZYYSA2ZdMZ4afrzy6E/dfA7HQCboPLDm7nyhRxTBJCfl/RCM1ebtQLfRr3ba6Hv+m63hYxM4hEqOamONUE4bN2qLNCK4WWFCvK4jgzaWDiOGMoxe5OrdJK6q3BsPjHHmjkeuDnd2A9Lqm4OL6b6czq/lp1GpFVVFCJcjLF5gcwZjrzUmtH/zdzLlDx/iaOtfPA4MdTfFaWNn8+qycBEz616mFrOV1ppS2tjuDZ9949e/dWVHG5199sXNvsc2f2vQ+DnoQ4rGwg0+m9N2mntphjVS3HXRXYebJdnrZM9AXN0j7zvKPVPgUab0RRBWBmfTq3IUCFNAEsMzbGcSBVLBDJPlwTIn4WAPKKrASuGIFMwU8NRc2lNDC/z9seYYD0jOXpyIq+c8UDiEx9yYx29lR0OMlEmPIQ7fBJexwrK/323BDWKD5iRjMlCV0TAJgdgaHUeiOydWs0tKBY6CWnIpNiDx8r3yvqPcUwXe++AjN4YbuMpYNljoae2hInxBW0UEhEZnKWGFxVCSBdxYyvuBbAoezQIZ8kEq1YgO+cH9h554YC++lje769GFVDL4qqqcieCy2GdjKfGyL79269f/6jWsqJx99mObUzji0Cxm6zRS1AfG0Nu6AwgnAkcx5K1628jVfB7aTNs4T8V6Kz8mt9vFjQ/f02dxTxV4OkGHneHu98RTSulPNBSqbZiioEH3l+GWEc+MCtgVJqd2Yh7Kjif1J6qR9CoxxcUH4YUf/dF/tjV8nOONiufM+hKJaesw0I4+YuEKvfHweQeDw0+D3D442J5sW9SKe5pWs5yX4C5zvj0iHJuENlSIjq1zSaJlheYb70RQSJ1gw4YvW7jHcs8VeEwrQbuXNOLbGXcwV7povLk39m8a/A383UXS+KYa+3qsG8qPBhqV08mT99sLj9B5itMKvC/OIpd5jDCX8AscAGZd5qVVJq7WvvuXn8U42mgSAjSvw4iaoCiPNFYwkJ4PuGmikuY75zp3WE2fawtRmDI/+1Vc//lP4x7LPVfg6SS3v/zS4Cw/Cx8CGE2GGWAsyifRkrmBT8ljhhR8CDxQaWmxbe2B5AMrm4rEhoANLxtflXr/pLt9Zns4+2a98YByEeM2+QxvjUAuhSKY7vWm7r+54tPkdC/aJxIPcxXAlGwsozcORCgcvlULBNsomSSVH8+n35ECEWk67nys79ci90WB93ae2huCkUsohGnk3BqPqRJ0QZjG8aPTlsvR1k6WGNhiwjiF63d6biJujf1cg0UunP2JPz2H+yADXN8cMoNb/J0OV+3Fb4KmSCVz2cBR3tigtOystPf9nl/ZGtrpHFiEUewefQCh9Ciuy3IorC0xcI2Vs7/agdp6fO9NcVLZwY2dXdwHuS8KPMreBx/95HBjN5gKGUVDd7hg/ENYyG04yWLGxNFcbdeeIHW0fJkHuU2V1pFPkQ2Ytl3Dly/gPsibBwfX2SE0rsstP2/A4zOy0DEZggbMprceu9TNW7/+zDWsqIzE1fCx7QCmOsz0pB7zNh5YZ4quesTRNYga/1WAsiSSS5piF/j8fUNC902BRznQIR+mhLeueopZUp3IUb3vVuILGSi68RyX5zuA2sIGJVzPBtYKq2bAe9xuE/dYHvmR/+XiyHxPN91jNpg35792dOcFV0G2FQOU41aHbZ/HCsuBYgxHzhEmW5tqyY9rDpYJ0m9qTUVlZaTofhrTPJBnMKZ5niEZgXH36VTd5bf7itA7kfuqwF/84OM3hna5Miml536pmdL+AWJ0SE39CtvNfktTrXHIfkbBiB+Ax7Ot59hpKnrdxD2UswN0lq57X3tSuzYascx5RV+j7gbbzs5kH7h669e+5dNYUZnSRn2/1dJOOhl1Gr9RaA0DccH6hxSOpQS6oHOpvkOYSU4rG7Hw+KUfJ6m7sX0N91HuqwJPJ7w9pDlEXs+cpzVdwuJwsDJ5KE5R6wErq2oqC9tY20mUUY89JGGOOSoqiyuzlMP09R63xtpBv40cl+ozqgUalrD6WrISke4N9XVSdVwwcAO3hzTdCsu+qr07GfOg1wmXjM/oMqmWWegDx31ecJBzj7Xn0hLBcImlk+Ikz+A+y31X4InQAl5qq476NIMRA49pXhRFzCKOUZo4NmfdsSXajPfUDLRNWWP3KOiwumnp+3tWVvnoD/+zcYaN5+qy6DDFaGGeVuN7e2aAQQ2aDMTVM7tYUTnz7Me2hmZ51h5otg/1VOsKwSxUM1FtC4vyu6ZX0fTHKLSLuqY7jL56v4irKvddgUfZ+9lHh1i4363t4u7Fvpe0kOphojAxZSxwBCSFwR1j46C9o1qp0OA6B93TFLX3SHRt/ZVyIruCJgsGlIqgnDutbNfsJ9g9u9+vdNqo1DtrJSd9TCprfhgHewchV+K7TTIfKENY58dDJEEMLAnfG8woGHt9/2BmPXkgCjyKTG+dZ0DqEJbBnT+AsHkz96MN2+NbNFYzl/ampuoazlphOYpxHNbfEwV+7MdevTyceTOhPbJj+W9CuCDOlSQLwJJRt1zsY5f3rj6zsm9XWH/2Y5eHhtj0nyzI0GD/pBJaHrhOUuch58ARQz5FsY0YJRtRajYsE6U6q0+/8iC8r13dA5Qnd75wfbj5C/bLNdaDXUhfi5x9nWmjzILEUn2q8QYDswIkvBxW9zJLPNFch5Vev/2Fp/auvPuuKcaY833zQF8dTvNkCQHGaVa8Vts72fQGOwsH7F57KRbMjVP4mN2v/Op7zmNFZSSuBuZ56DuDAitLIvuYEweR31ebmslf6SOoqUUFX0OmpU+Yke8RsTCpRP8u/M7krw5po+s/d0dvV7gTeWAeeBR5aP/5gk1iccbHliOhRzb4g+QoogqpzqCQx5HCZLtic54TqrsyhnazgVtrf/FJ3EV582CCeRtCiB+lj6XOW3MqIctfAxGz24V6ytff8vFm/wxWWA5UtkflNSWzASwx2s2azTtOFvb4YGr3r4p0zam40zp1gNY47Zh6dj5R+Thv1A4eoDxQBd57/1O7w8cVIuYMYnIbzbaO3+F71T1upJioFIAkWEWkraRFrglpC3nUfWkTd0kev/jqs8Oxt/JKyjnj+tlhiuOA47VZO4z7dt34doXVJa5stBG24LUEda5sICclxWw8+LT0COY5MxncxpW3TpYY5UE5A4dX9N7AP/7gNTxAeaAKPF3AwTjti06QVegdqzuuSgmDzxaRSJpCKfuGMgBzl4yAQjWCaaOINZFN3CU56PEiIbx/BrLw+2TUzy/UaFQyziqxJjf8ei+rPU3OvnZOBmpDgeRAEHGkmyjHRJoce35qcyyl7SQ3XRPFs86iB/3zeMDywBV4TCsNH5fTy/YxSMTJh6KFpr6sqqksbrCKTf7Uv0aaSWpQiXlhu+93V4isd03EFTZp5VtTYp0mvUDcHkiogJ4EYLppuIn+pVsfX+200dBoluoLsw7U/C6LAhoJr8kshLOF9RiUGJ+gdZRbkwkZlwyUxdUHRVxVeeAKPMrnt598aWiQG/YrhmySS6Rzgs83NIkzttrkgMs0PEziGwKKB1fmR2ofXVTLaX/HCmyDFfA+JCrWuLbUVnXyVDnkrb2qzP36IPTdW7/6nh2ssmi33b74vcRcQRa3kuqnrshOjIrMqzJQUZm4o7BzZXDj4wl3j8uEgcdCgUdZy7cH1GlK7EEJy5Xoags08vnqgrzIPUtOJl7NqpVxrOmEcrhN3KHc1mmOq9EQ0Nw4gi4x7vSz9wqscctOZ50yLc34q7v7cwqfJFl/9u9ctlLX3o17GdetRQlFGzsY3ML0w7IR1o0ki2jKtjSqjganpRIMihNZXXflOHjfUY6NAg9Q+sbQQjfG71rznj4PVmEZyl75ENu0biqmlA9weF6wwb4VEIXH2ukdeeBHf/TVrXGOK5SDIyYzaImVOkJDmiKT3NWk++Stj33zNayonH325c2hNbY1Xp9qy9P/iqOY0MZK/zm6kslI2jLm67yMVjnRoWclMjSTdvTS1Dd38bsfODYFNMdGgUcZknXPD632+vSj0M2CZghiKiVzL1UttEaVehhUMVaOoYS0wp4yBGuV35loJ9tSprbyGxB2BQkay85fISGLEeLqbcth1ZuXsMJygIMR0aAlpUwlVbOWtvQFtrLCPW7wDlPKqQ82mmW0GRNPokd8c4b6eE0YeKwUePDCu0NbvtQwzOUzOnv8KRVLAYNSIWouNd1bWHFtCS8/at+9Yw/82MU/ujw06blmoXI0hvJEfh9iwwk9VodkFZlG/fa01bXVJq5+9enhQU2IJrkORZ1xtCIbJePg/hNN5RUYLoOoB6nzh4gqsiJZM9RffdBpo7kcKwUepRuYVunwOTOurNlnOs7TA+OGlbF19pnW2I6UsaQTj5NkzMnHA6XyTA+9e2ceeBwq2E/jUqv39SKDqKu3+Kqd5keDwEr+Tb3jYbfH7R2strxCJBUophPkzJF6yDM3InPjn4o/fSJTfDWEoZOout8f7B+7Z3HsFHhMK/X9/qX60KZPXy/MiY4/GtKHda32NEWQlTeeaCWhITiC9IAdcPx79ic+cw5vU9ZwZluis5C0LPdgrrest4qssP726VfIq+kur7b3/fWt4WltRlzrwz77vmAVpy9m9AGTudN3UlABtw18KbMUKEgtHQPAVeP+/QOsd/5qcuwUeJQv7Pw7V4dGu5GxS4q2PR6smAECIQdMFeHoExZwcOwv4x0fthiuT/BO5NGL/+vWcMYtRUVh4vlCSU7Oy37ssydRgjZgjlvevfWxb7yGFZWRuBraadt+uTGUatTzmQn12y10SwbynduHSMJD8zy7jdVWmacD3MT+7WM58utYKvAoQxPuoK2QQcaFoPd1MqrsWEvovLB99pw8BygxxSytcW8vC9czcvC2xgXrOB8T0qE61J9O3Pn3I+/QLjHIK1UE4TJ6X6yw7Hf7Wz36zfF7zd0nktFSoIPikud1zL1EBmDmCyK8injY7SyLoe1pjm+N3DmO3neUY6vAY1ppaNirs6lkU1Wnbz6x+6GZLVExMuhpacUNgjma4mQCCHJDBo5yE1+jPHbxf7s87LdpntyRfSBjcKqP6pi5Xry/xaykdpPDsq67uvLeF922eB6x5u49CJrB3bDhDGepfJw0zFl/WzaLylBq8evEgeJO+ubB7/zMsX0Wx1aBR+nQXRqe3+fG75Y9qibUa13FFdMWBffA0SeWgmINuhR2EkASTlLR77DV1/Tq0Y2Lf7w5el9FW6LhaaQSXNNIiGes6KHzhecV5vf9rR2ssBx0/bYSmqg2uhlMVqPTwVBq8g7Z+ski+4H8qbvvVdR6AZ+7vDj853GM5Vgr8FQnLbgSRRbxPqTqirOYw6bgyXRRkEocagZtiS3/JBNt36dOcOHRn/zfvyqMHl/FchsHrzC8Jdwa56lqLrFGY7w0tWsarzdSGb3yenZWmrj6/l/fwvhS7mSLXTLMoFIfzgsH+qozsMwZBpt7O8RGs1nji0amwwiMa/jdn/k0jrEcawUepdPupaE1d8fv+bKy1gAjoGsslSYY9kUlOC7ElW+gJEQ8LsbDf/+xn/jjC0dd0+h5b+PM9WHjp/M4bhyEBkXbc7OcMzpU5n2N2Zo+doFb17DKMo31VVpiUa1Vc/7O52KYmWGw3yY04NMyLSSIEYmTodeA4tXCxvkmP9EfHP8JAwUnQB7b/tcXBr247jNxTMukslOWXHAlHp9wfveHbpv5LJeh6Mz6T4+s7u9lstMyuXGg+GSnB58bnv6TwwZPDwcaIfaGHSNjM//IcaqZyiA2CwIGWW/rE0NM226tcux75vtf3hpa4RNRWQWLL4SxR7SxcmCLZMVedIV45u6t/eglBGPNwNQX+giAp/qe3n4MPMkO/tELiwLfLXl8+99cH5Jx78n0S+Nx1aagqQroSuKrTQije+Qxel9VH2o+aHuo+bDHPtNPncogGnO+Eh5V0ZIuQLDh4/6GzYT2Y9TeqdModr/ysW84jxWVs3/t5c3+TVwfmvocVCVICVfIwFz8PT2unkVuvswHo6lTyOU5EoJnPyFTxWfYpx9X3e3f/Mq7B+b52M85duwhNGVIKVwSKYMXzMy66xqXFCZ6khhS6w+mlxhoXFI4ha5miZeTGpIF2CU+Vs8zBlyLcj3RuBQ/P/wk8dO7ZSq9rR6Ver//2oiz0yoHt2V7UN5NkhhteFTmeGAFHZoNsuAqyA17jmaXSxYCbuStEl20GASPbMZnf/kkKO8oJ0aBv7TzF14bHNWVSNzhUAXVnKoAdVz4Vg1knqHsB753KUp9mnW+ygckFAaTXcaCNcn5vSNEA7IGm6+TRT1CrLt6++/8J3+EFZXR+w6NsEV7jCimyDHS09PUYq4jtWjPzQ9FtO1chGUqCiKzPhC+1moBpFqAgYc4+J0XruGEyIlR4FHWu/Wd4WMvnK8XYAAINplPlSy0IiuhgsVEDisb/3YdyqterGJHa3kjXaWdKWDzXNjBzKt6HlFr8VjE740feVBzCh8X2d+XF5O0z0EIQI6R5rPNvbIAIJtSZobdjshnn1Y3cocZXtNgdwffghMkJ0qBp7TSNPBfolQS/hBy1g0wp1pK5bKcDqWMsbLXZD7Li9d4LBzuFDlgwakTcE5Y1EESWf6XVV9wSKf0CHLj1se/cRcrKmf+y5e3hrZ4NkZ0QEvUwXmtpL7EKBpeSFQzFZiPu31exNRu8Mlt+bOTZEhwFZ96/y5OkJwoBR7l8z//F0YYvdvESZOUuJZD+BDwSab87LSo7NIcgPC3LcJoCuKP8Lp23k6Jz8tL2yJDlYaflaBMYUwnWNnJ2SfpZZshyiGI62jmCKyT7cca5yYURsTAfAAAOKgk4I/Edhhf47F3EicMPHEKPEo/vtXBSeBpgcz1UlHzhzYapQ5DnJvoLBDxqVZqbaYvH5d0WhZ539DJo3seGJnZIuwjnxpEShQT+fHPYUXloR94+fLQJJvkD+aKGkFuo5gWAglqnXw6UbOjFYZnWSVR0fjRBWHhMfABrpw07zuK4ITK4x/88+tDSuBCaMwsz2efPWKwL1+ylDki16z5fvaMI73EWTKFKQtqqaUt0nSUNFTv6SeD7U2ag9vyfMM2ew8/9ND5u/k2iJMgI3F1sN+9OjTCRqTwXLnCPvY6e7aKNjVk38ZnVPL3JTVo7S5lWc0N27PqRyXe7T/1U+dxAuVEeuBR1t48eH76Mo9OIxYKVOtbBRSW4kKlKmAcA31OLQqUQQpwr+/7OWijhyXKNuXNA6bHldI7eT3YeOP2G9tYIZlyvv3a9aEJnlTlmzVKqBoxLTMIsTaF8bIV29iOhXjkwJQ08PZQCLdZaDON9e31Mk6onFgF3vvoX9qd8nWNBot2HN3TsJJm1yMobUgpBlzcPqF302Vy7L20+2l2Fu9EZKEZNVfCJJxvQenDId/3yHv/6UWsgJz9gf/2Qn8wKG+Pc+KKNNWEsxGFCFiToUIAY/izCVgsrpgZBjkVkiV7WcUltLvZ9gNGewUnKG00lxMLoUfZ2H594+Dgjc8MN/GUQVsNxGxwi9mHhLDMM7JcL+FsC8X9eKgeWgI9J0Tmuqi2svMYTc0qq7oNEJVa1j/zJWbDl6tdp9fW18++dpog9QSX8dAFHPTPDfd4IYpZChwWmYUybGu0z4FVcTUcyfYk8um9ypJJPJbGcoQa/OdAW+H2+ZMY+1JOtAKP8sQH/vSiSvcigmMmbOolFSZiUw2kGwpa96HyNjFrQuaw/bXsztPR0S98o6mD9lF2Al6DIlNaKNtGrKbt9fC3ny9jPS3x+CiM1XWaLa+B+o0h8gaJxmH8aLk26/lZXgreclzjoetFNU5xT04/VKXK58Jn0nsx1FQPTos2MZAAveo0N7Pkc8AUGwuOrm22n/2sXbiZagwztZLZq/2n/sbzOMFyYiE05fMf/vfG4YY3KjSOBH2kD5gDBB1vYZ1tm+h+7qRL8JvIe1qR+Vzfw4LqRj/EPXCpPJgPcfODeW4jIjqQy8k4W2qxijR5UFS21a7N4zoUj0b1rXG5Hdjaw4/BYyFIeEEx8VoSaV6LPCrKUS5AUYrM0juGIYrjdtMz6awFpTEyk/S+pQCZePeN6mAznz6pxM5xnYhiHm22BW6ehgkDT7wCjzI8jB1IIGSqptcni+bDtE9hnsH/mcKpTwCB8s6lmNrBRWLsMHtVqHeB1Hzv73glPWNndYWlkwXn7rID8kZySKNdQe7rv917xRWWa5O8RkBrbTjXkSFKL44mpcVzBmmnDA146rgPbyi0ZJ1fblY98djK/bxilfn5ceverykMH61F84iz/Ly5pWggjXV8vCTHfEIHsTcs2H79WBB0gqEz5VQo8Bc//JduDD3mk0Iv5NI5GcKORDueoRcfvAbB4aIIMsp9cPoOhFOICQZSkdzTYe5dUyS2L9fm5bg+AtG/lwvKCcyhTedEid1tP1c1qays+1Uya4EipNx2xRns+Cg3HvYq3jOl2qbLey3GSbUYmpmfDj0lWuFGvD9xqysVAcQXL1NFeSixKIyuAm2snMfox0nqPvU3ruEUyKlQ4FHWb+ul4W4a4icG0E8iaaKRMGx6+A5qC8QsQwqB6tEkyWyLNyUdRlZheYlunr+UfbLAPj22VjdWvWzeiRc1FOY6DVXt5YjCb/dyhYylmeA5zX02Kj6DsXmGeC2repga9892CyhOeCL1ftpSyAJyDa0E++xNTxivFUlIXguPoGVNgBj3wAIaUSV4IJJQOTVvujg1CmxpJbxUnmPrVWs4SiUMZFl7rT9tZiioX6xphnkazL1KnDZGNDktClc+9/JF6nS2ptDWY4GmZwJZNhi3QX5N5lchkvfLThyX5/GoJ6pRy0/zACrzZarF8Glxya57vD9Fxr40CFoUiyp6GLSHUqY1yhkjEedGnsOv37hIYXMoK7o8Hp43zUhkXsVv//hv4JTIqVHgUbq1Wy8Nz2g34JURmpFh4kONuDP9bdOjbG/hUehDAysfhsUmrVZrw+PU+bx40thy5m3h3tpRdGhtKkfmqQM/8xozPgD3kUCpCSzsRV+aCkVlj5djx9XEqC7eXipgX8BsUbZW9ZXtd0ijeM0lLHCirhwmPbnOCCyJSwnSMlODLNZAPkOdOO03d3CK5FQp8N7O+b2BEtlJDOpMtJROlzFVq4SEu6YaolXdhIRLqaQClbIGqjx+QYzSwAA1JZJQHj/t0QaBx9aKGJXHD0IIlWyr91lYWcYB4CH8Ns2rqxzpslC9psag9waWK8E3Gd/mDqzdfH4EwmLCfC0wPM7RkE/lGCQfwfsII5YuXrMSix5akM9+4EROBXFV5VQp8Chf+IW/fHXoIJ/2HuckljAeZu8ullzRwDfabJfWTRM+ivNaKhWaT/Fhn44je1YXsx0C6RmsA1e2WGe6nMcvPZq6KZkqckUWPQyoea5YQBzs11KUTqQ5ecGixhAfRYy1DZUuDz45nGRjpHJNh9XZ+F5UygDZPn4ps/0x866od6n0/Cok1oaz3dzvcQ2nTE6dAk/S647xLDV2BJrUSlj/ruSPZsfRmK5B6ZW5rzHUiA4+Lj4qxjNv0pflUrEtWu/pRwcdacXO6cgjJYMyJnrSTMl9PUtVICj9OINX5EipPHlthLgpaUxH20q5vRRSq8D9PBJQ88AyCx3y9j3lU08dBBk9boISbwc7No8vHG0UxNr4doVPXdrFKZNTqcBf/Oi/f2N4cNcyViWO1ixcsAyPVi/XJ+ESxQ2E1BLUqnB6nTQQ1aN2bUEB3xUs4UUqccY0kl8m86AFvxeLk2oUPTvvT8Iju0jx3gWSVo1JLk7zH7WvEGtarhXFKNJDzw44swEegDfAwtHLXKQ9pJ1bNdqWMFprpPBWfET14vrZg9983zWcQjmdHniQtTNvXhoe9+uHYiVniauDi45bFwHJHudvkCTxbiXzfRovDzQ55zAAmCsSc7+YIF+w07mB8g60VmmhOuUWHVhqR+OiEHniMnoqFCu8NDH2WK2oGmm2IK5bMt32nd9vDaUlDY+jmYjkRVsvDVdsQykZH3tbSFmepsJP4tvF9TSXhIPb3amdMPDUKvBIaA0u9SUNiJq52vCerhhtilLpmqPIwDyR5gu5JyHsDYVwpJuxWeOxzNFphaAVetMtd5Ia0TtU5rWYEhDKixZvmIYk4vPUf9LQkr/9bFq8ppRrUuZq3QnzjszL52QJoofi5nqrbCn1Nq0Ip7QND6DRcM4XFLIPEbPXW+HxZI7GzRhYLHENv/Njp3bCwFOrwKOsP7w/pZWEmBfuxJyR9fgI7cOvpI7TzIyFJcI0lN4Z8FiVgVhLHJVvsT/L+8hk6yHPLDHqRmrsiBY+0yjZvuPd9WTQtahGKKJmFClz78l7ts+aorGjZ2yf8WZojnCbsGSoDctYA2FfmN9jM2pyCnGrGiFwtoygtkUD73lfSrZ/nKD9dE8YeKoVeEor9befD8uvCCY5+kq6JXYGzAsNIOHFUfKrOGz2fROgdbUZnL6VwsihA0TaSnI7TtEIogPEfdkXURQ0gRoHhqUSre55Bo8JK/iJqGDRqMCq2D4MSRsT2KHSO3fl2NqSeSBbLWkYZ/aO9wut9+oX4ISX30tp2OmCTyVxVUWwAvLYT//J9UEBLtBNRiybcNF/ONSLoXAR6waMnvbtp+F2pmGcqoWm35mwHL4IZCDct3qc8XQci9bFjuOep7A6KNc+vg7GL69si8P7pVHw8xVUPx86GEautFVcS3q7HEZoiMbzxOV+AjIfeT1lG61DMckrax5Mch/V+hyiPblfXNe06W7/mz/2dTjlcqo9MEU7uRSJfWEHCEhcUaCPqQ0/NvNIasobK9XNvu3iHt3iNFsl3gFFqt+Ko1W/Ne2QMDcVsr0XndOuJU5sYsaIAfP4oA2Q0tlbqFuwaGDkSOvwbjOHM50043LEfu6BUSxHjT8iLCDkzntpcvRRps5tkyCPPJkyOOd+dp2rMdf2Sijwl37hL782dIUrmu/pDaoWIAQLXqVmQRzPRbpGDQ7WfLJpqnVYbVSGW6DxLQm/BVG8xaJk9nGNzjxdgTQWxo8h7o6bE1GieCXBcl3ZalSy48XjgQF2HH0eMbjy0CC4viu0MSLwgpBQXdV2qGN6f9CCOjQm6i8xcO9cA0MISXsUExMM27x2WtNGc1kJBR5l/aGDnaFLzKapOUzimGi8C6llZwVHhrOBcG38sVTAWFja6tUtRRU4sY1l3KD4AfToXKe6ggXqhtRCKG3UWdNTtbeJRrMJJCQ1qomv3fCwRmLOVE2LuxgsHTaSZJT4AK16GemqwdfH2kVowzG0QxxD0W2dBmc3oaL+YP/7sCKyMgrMOunGKYUTrB52+oyUUOjBtEUvrXuyjlUOAGnSHr6sVGqgxHsShVaF+fbtaAigWb5IhW5ujCx4xL9HVFdhLESC8H5DualY1bVKnawg70MRw3DLUEupAw88ovBalNg/qGQ/yCyNFrGz33Zag+Y+GytTjFazsTn/q6eduKqyMgo8ypc+cv7K8PFaMsljF+BrVsLrBdylioIVUuyYVTlRvEJUPnGN724q3iqeiOdHgdppQ/WIEIXHjbLgmQJ0sSLXGaKMS9A6pYzfinX20EQEScXQkpefseVRcCVsAQqiiPsqhwoL0NV4ezb6wfPMwKE6aThETiQeT6du8dmDg9s7WCFZKQU2URvMTcUynqmUPjKL2WaBmEaiptoxpMaPdICYaSVyjioul0DXxKqpgw0y5i4aK4sauSbOqhiif5uWptdzry5pCLy01OamMgMWHJPfnwiaAnLMZuGYXYxPGOepIZHcyJPl5RzRuMq41r31dM6eE+wVcmp6OIlgeAkSpqdbKe87imAF5bEXdq8PT/xC6yFMsUypmZ4YV/Yz5lWDGC1EmIsHjT2rCTS9UA5qUCpdFHx4+ogwOJdr9WJOMGnkq0exa2teTl22Bc+Z6aEgjLRujzaNlMfzc7ENLFrIFJITcp5K44vQ/bhSzpvXzLTdbGZPzYKVxPh9VVaPd2qbAkxDjdPk9P/wr5/6tNFcVtADD4QW9PnhY696CI20ReV5Io1BEU/1lIHx7GNJpfo0MW9lHd0BaiqWSGMHFOUE0u6niMEU4h1acrdIw5QKJoFHxrG/HnVRLLtqCSaPG8KISG7rhw7YkSEESzMYbhQmOaALdy6nn/nzvHYeEYeAhkaIPWyxgxWUlVTgvY+e3x2e/ZWihQ3TGzDWO2h2XeuIUtVKK2RFqGfqfR2xVHKclXlVReafGgOCVpjj5NqE483mEe9m+omKW5nq1JlgfGMmT+7HmwuFCesV5w64XS/D/CrSCkkYibB59TchtP2m/WFs4aECZMZMjyu6EQC8cvCbf/0aVlBWUoFHWX8EL2VaSSWH3GRntw5fPUN422ltph8LU9OTyEHi3CButIHQipYsaksM/XyNYoSTL86rEOAcBOCxYx1AYJ4086d+jU5khU4zly2lNtu2kZrt5bVlfjYQbqxNj5vnI0zP2LrlHgqEdjMpecfe5qnSDB8O9t/8cayorKwCT2kl7QN2kUkpPUS53MGlIh3C5C28n7UeWVLRUJWKBfa+f5eDhtzBG9SsHdQ3jWN3xg4FIJCjNkpGR9IogIGs8DzK3Y7IayvatFiZ1SOrXXivWr21ksTK27cUmbboIMssBWhGKSUS4LrGoAXZSOsosnZl1YirKoIVl8deuPni4DanF4ux5tcsu6ZiRb6S4DB747htr5q5mSBttBBZQPHHmsSSk1eqjZcSok/uN4W6/g6l8GLJOgGsBYMD/j48H0koQgMhDIYTUn3eG8tMk9Dz16GIRixsRsb2FrQk13jUvp+9nqWB3aG8pb00ktPFiJU2KRpd296exWv7/+CH340VlpX1wJQvfvT8kFbqLo/fE0WbBxOv7EFTXtmKFmWejoGIaX2XWf6XaZSpg3bKKWEy3xpoW0Nhg2W2M9QvwlKMenw4imbahg5Qqwr7tcXwwcpV8TjUJniMWmyGouXfdSoTj3sIeFztljtVprhK21TIwvReXHK9wXgVqegn9z//xjNYcVl5D0zZuPjHmwdnzmwPPW6reMQYO4yIe4tXm3pqM8JI7eXeMdbVUKyi9R6+n3qOloUefENfGf3jB1aPX3s0KSaUEswjPFR4VFO38HiBMprti17H/dp+2qbTyrURkbT3dPQ9z70nSoweqILHa84hFTGM78Hq+8v7/8MPfxqLLAp8lDz6k//i6cETPMnf+7g9pJ7O+Kcv2z+83/q0vK7Yx1vK/ldZd2i//X/LJvtvudnRO+wfseqr7vxVjrNun4cueT/WHrG1L9+fmmF93dptffhv/y3ufVDiz93GmV188vlT89rVRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUUWWWSRRRZZZJFFFllkkUXug/z/GIxil7NyFLcAAAAASUVORK5CYII=",Kb={class:"sticky top-0 z-40 flex h-14 flex-col border-b border-slate-200 bg-white transition-colors duration-200 dark:border-slate-800 dark:bg-[#0b1120]"},Xb={class:"flex h-full w-full items-center justify-between gap-4 px-3 md:px-4"},Jb={class:"flex items-center gap-3"},Zb=["title"],Qb=["src"],Yb={class:"flex min-w-0 flex-col gap-0.5"},e0={class:"flex items-center gap-1.5"},t0=["title"],n0=["title"],i0={class:"header-menu-container hidden items-center gap-0 md:flex"},r0=["onClick","onMouseenter"],a0={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[220px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top left"}},o0={key:0,class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},s0=["onMouseenter"],l0={type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5"},c0={class:"flex items-center gap-2.5"},u0={key:0,class:"absolute left-full top-0 z-50 ml-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200"},d0=["onClick"],f0={class:"flex items-center gap-2.5"},p0={key:0,class:"rounded bg-slate-100 px-1 py-0.5 text-[9px] font-mono text-slate-500 dark:bg-slate-700 dark:text-slate-400"},m0={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},h0=["onClick"],b0={class:"flex items-center gap-2.5"},g0={key:0,class:"text-blue-600 dark:text-blue-400"},v0={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},x0={class:"flex flex-shrink-0 items-center gap-1.5"},y0={key:0,class:"hidden items-center gap-2 lg:flex"},k0={class:"flex -space-x-1.5 overflow-hidden"},w0=["title"],_0={class:"drop-shadow-sm"},S0=["title"],C0={class:"hidden xl:block"},E0={class:"hidden sm:inline"},A0={class:"header-user-container relative flex-shrink-0"},T0=["title"],N0=["src","alt"],O0={key:1,class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 text-xs font-bold text-white"},M0={class:"hidden max-w-[140px] truncate text-sm font-medium text-slate-700 dark:text-slate-200 sm:inline"},D0={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},z0={class:"border-b border-slate-100 px-4 py-2 dark:border-slate-700/80"},I0={class:"truncate text-sm font-semibold text-slate-800 dark:text-slate-100"},R0={class:"header-more-container relative xl:hidden"},L0={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[210px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},B0={class:"flex items-center justify-between px-4 py-2"},lf=s.defineComponent({__name:"HeaderBar",props:{title:{default:"Untitled Document"},editable:{type:Boolean,default:!0},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},pageless:{type:Boolean,default:!1},outlineOpen:{type:Boolean,default:!1},showRuler:{type:Boolean,default:!0},focusMode:{type:Boolean,default:!1},currentUserId:{default:""},simulatorsActive:{type:Boolean,default:!1},userName:{default:""},userAvatar:{default:""}},emits:["back","update:title","toggle-star","toggle-simulators","export","share","menu-click"],setup(e,{emit:t}){const{setLocale:n,t:i}=ct(),{isDark:r}=So(),a=Wd(),o=e,l=t,c=s.ref(!1),u=s.ref(o.title),f=s.ref(null),m=s.ref(null),p=s.ref(!1);s.watch(()=>o.title,q=>{u.value=q});const h=async()=>{var q,O;c.value=!0,await s.nextTick(),(q=f.value)==null||q.focus(),(O=f.value)==null||O.select()},g=()=>{const q=u.value.trim();q&&q!==o.title&&l("update:title",q),u.value=o.title,c.value=!1},b=s.computed(()=>r.value?Wb:Gb),x=q=>q.split(" ").map(O=>O[0]).join("").slice(0,2).toUpperCase(),v=q=>{l("export",q),m.value=null},y=s.computed(()=>x(o.userName)||"?"),k=s.ref(!1),w=typeof navigator<"u"&&/mac/i.test(navigator.platform);function S(q){return w?`⌘${q}`:`Ctrl+${q.replace("⇧","Shift+")}`}const E=s.computed(()=>({File:{label:i("header.file"),items:[{label:i("header.new"),icon:Pc,sub:[{label:i("header.newDocument"),action:"new-doc",icon:Pc},{label:i("header.helpMeCreate"),action:"new-help-me-create",icon:zn},{label:i("header.fromTemplate"),action:"new-from-template",icon:mb}]},{label:i("header.open"),action:"open-doc",icon:rb},{label:i("header.makeACopy"),action:"duplicate",icon:Os},{label:"divider",divider:!0},{label:i("header.share"),action:"share",icon:jc},{label:i("header.email"),action:"email",icon:Ms},{label:i("header.download"),icon:eb,sub:[{label:i("header.docx"),action:"export:docx",badge:"DOCX",icon:gt},{label:i("header.pdf"),action:"export:pdf",badge:"PDF",icon:gt},{label:i("header.odt"),action:"export:odt",badge:"ODT",icon:gt},{label:i("header.txt"),action:"export:txt",badge:"TXT",icon:gt},{label:i("header.rtf"),action:"export:rtf",badge:"RTF",icon:gt},{label:i("header.htmlZip"),action:"export:html-zip",badge:"ZIP",icon:gt},{label:i("header.html"),action:"export:html",badge:"HTML",icon:gt},{label:i("header.markdown"),action:"export:markdown",badge:"MD",icon:gt}]},{label:"divider",divider:!0},{label:i("header.rename"),action:"rename",icon:Al},{label:i("header.move"),action:"move",icon:ib},{label:i("header.addToStarred"),action:"add-to-starred",icon:$c},{label:i("header.moveToTrash"),action:"trash",icon:mr},{label:"divider",divider:!0},{label:i("header.versionHistory"),action:"version-history",icon:Sl},{label:"divider",divider:!0},{label:i("header.details"),action:"details",icon:db},{label:i("header.security"),action:"security",icon:Fb},{label:"divider",divider:!0},{label:i("header.language"),icon:pb,sub:a.map(q=>({label:$d(q),action:`set-locale:${q}`}))},{label:i("header.pageSetup"),action:"page-setup",icon:Bb},{label:i("header.print"),action:"print",icon:nf}]},Edit:{label:i("header.edit"),items:[{label:i("header.undo"),action:"undo",shortcut:S("Z"),icon:sf},{label:i("header.redo"),action:"redo",shortcut:S("Y"),icon:rf},{label:"divider",divider:!0},{label:i("header.cut"),action:"cut",shortcut:S("X"),icon:Ib},{label:i("header.copy"),action:"copy",shortcut:S("C"),icon:Os},{label:i("header.paste"),action:"paste",shortcut:S("V"),icon:Bc},{label:i("header.pasteWithoutFormatting"),action:"paste-without-formatting",shortcut:S("⇧V"),icon:Bc},{label:"divider",divider:!0},{label:i("header.selectAll"),action:"select-all",shortcut:S("A"),icon:pr},{label:i("header.delete"),action:"delete",icon:mr},{label:"divider",divider:!0},{label:i("header.findAndReplace"),action:"find-replace",shortcut:S("⇧H"),icon:fr}]},View:{label:i("header.view"),items:[{label:i("header.showSidebar"),action:"toggle-left-sidebar",checked:o.outlineOpen,icon:Eb},{label:"divider",divider:!0},{label:i("header.focusMode"),action:"toggle-focus-mode",checked:o.focusMode,icon:xb},{label:i("header.showRuler"),action:"toggle-ruler",checked:o.showRuler,icon:Db}]},Insert:{label:i("header.insert"),items:[{label:i("header.meetingNotes"),action:"meeting-notes",icon:Cb},{label:i("header.emailDraft"),action:"email-draft",icon:Ms},{label:"divider",divider:!0},{label:i("header.image"),action:"insert-image",icon:cb},{label:i("header.table"),action:"insert-table",icon:of},{label:i("header.codeBlock"),action:"insert-code",icon:Qh},{label:i("header.horizontalLine"),action:"horizontal-line",icon:Ds},{label:"divider",divider:!0},{label:i("header.link"),action:"insert-link",shortcut:S("K"),icon:El},{label:"divider",divider:!0},{label:i("header.smartElements"),icon:zn,sub:[{label:i("header.dateChip"),action:"insert-date-chip",icon:_l},{label:i("header.peopleChip"),action:"insert-people-chip",icon:Ko},{label:i("header.fileChip"),action:"insert-file-chip",icon:gt},{label:i("header.dropdownChip"),action:"insert-dropdown-chip",icon:Xt},{label:i("header.locationChip"),action:"insert-location-chip",icon:vb}]},{label:"divider",divider:!0},{label:i("header.break"),icon:Lb,sub:[{label:i("header.pageBreak"),action:"insert-page-break",shortcut:i("header.pageBreakShortcut"),icon:Ds}]},{label:"divider",divider:!0},{label:i("header.header"),action:"insert-header",icon:Fc},{label:i("header.footer"),action:"insert-footer",icon:Hc},{label:i("header.footnote"),action:"insert-footnote",icon:Dn},{label:i("header.tableOfContents"),action:"insert-toc",icon:Dn},{label:"divider",divider:!0},{label:i("header.pageNumbers"),icon:Oa,sub:[{label:i("header.pageNumberInHeader"),action:"page-numbers-header",icon:Fc},{label:i("header.pageNumberInFooter"),action:"page-numbers-footer",icon:Hc}]}]},Format:{label:i("header.format"),items:[{label:i("header.bold"),action:"bold",icon:wl},{label:i("header.italic"),action:"italic",icon:Cl},{label:i("header.underline"),action:"underline",icon:Tl},{label:"divider",divider:!0},{label:i("header.heading1"),action:"heading1",icon:Jd},{label:i("header.heading2"),action:"heading2",icon:Zd},{label:i("header.heading3"),action:"heading3",icon:Qd},{label:"divider",divider:!0},{label:i("header.alignIndent"),icon:bb,sub:[{label:i("header.alignLeft"),action:"align-left",icon:pr},{label:i("header.alignCenter"),action:"align-center",icon:Is},{label:i("header.alignRight"),action:"align-right",icon:Rs},{label:i("header.alignJustify"),action:"align-justify",icon:Ls}]},{label:i("header.bulletsNumbering"),icon:Dn,sub:[{label:i("header.bulletList"),action:"bullet-list",icon:Dn},{label:i("header.numberedList"),action:"numbered-list",icon:ef},{label:i("header.taskList"),action:"task-list",icon:hb}]},{label:"divider",divider:!0},{label:i("header.pagelessFormat"),action:"toggle-pageless",checked:o.pageless,icon:Rb},{label:"divider",divider:!0},{label:i("header.clearFormatting"),action:"clear-formatting",icon:Ob}]},Tools:{label:i("header.tools"),items:[{label:i("header.spellCheck"),action:"spellcheck",icon:af},{label:i("header.wordCount"),action:"word-count",icon:Oa},{label:"divider",divider:!0},{label:i("header.preferences"),action:"preferences",icon:Vb}]},Extensions:{label:i("header.extensions"),items:[{label:i("header.manageExtensions"),action:"manage-extensions",icon:Tb}]},Help:{label:i("header.help"),items:[{label:i("header.keyboardShortcuts"),action:"keyboard-shortcuts",icon:fb},{label:"divider",divider:!0},{label:i("header.reportIssue"),action:"report-issue",icon:jh},{label:i("header.about"),action:"about",icon:Jh}]}})),D=s.computed(()=>Object.keys(E.value)),_=s.ref(null),C=q=>{const O=m.value!==q;m.value=O?q:null,_.value=null,p.value=O},N=s.ref(!1),I=()=>{N.value=!N.value},H=s.ref(!1),F=q=>{n(q),H.value=!1},M=s.ref(!1),j=()=>{M.value=!M.value},P=q=>{if(q.startsWith("export:")){const O=q.replace("export:","");v(O)}else if(q==="share")l("share"),m.value=null;else if(q==="add-to-starred")l("toggle-star"),m.value=null;else if(q==="rename")h(),m.value=null;else if(q.startsWith("set-locale:")){const O=q.replace("set-locale:","");F(O)}else l("menu-click",q);_.value=null,p.value=!1},W=q=>{const O=q.target;O.closest(".header-menu-container")||(m.value=null,_.value=null,p.value=!1),O.closest(".header-more-container")||(N.value=!1),O.closest(".header-user-container")||(M.value=!1)};function L(q){p.value&&m.value!==q&&(m.value=q,_.value=null)}function Y(q){m.value&&q.key==="Escape"&&(m.value=null,_.value=null,p.value=!1)}return s.onMounted(()=>{document.addEventListener("click",W,!0),document.addEventListener("keydown",Y)}),s.onUnmounted(()=>{document.removeEventListener("click",W,!0),document.removeEventListener("keydown",Y)}),(q,O)=>(s.openBlock(),s.createElementBlock("header",Kb,[s.createElementVNode("div",Xb,[s.createElementVNode("div",Jb,[s.createElementVNode("button",{type:"button",class:"flex h-9 cursor-pointer items-center justify-center hover:opacity-90 transition-opacity",title:s.unref(i)("header.backToDocuments"),onClick:O[0]||(O[0]=B=>l("back"))},[s.createElementVNode("img",{src:b.value,alt:"Docflow",class:"h-9 w-auto"},null,8,Qb)],8,Zb),s.createElementVNode("div",Yb,[s.createElementVNode("div",e0,[c.value?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,ref_key:"titleInputEl",ref:f,"onUpdate:modelValue":O[1]||(O[1]=B=>u.value=B),type:"text",class:"min-w-[150px] border-b-2 border-cyan-500 bg-transparent px-1 py-0 text-sm font-semibold text-slate-800 focus:outline-none dark:text-slate-100 md:min-w-[240px]",onBlur:g,onKeydown:s.withKeys(g,["enter"])},null,544)),[[s.vModelText,u.value]]):(s.openBlock(),s.createElementBlock("h1",{key:1,class:"max-w-[180px] cursor-text truncate rounded px-1 py-0 text-sm font-semibold text-slate-800 hover:bg-slate-50 dark:text-slate-100 dark:hover:bg-slate-800/60 md:max-w-[280px]",title:s.unref(i)("header.clickToRename"),onClick:O[2]||(O[2]=B=>void h())},s.toDisplayString(o.title),9,t0)),s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-400 transition-colors hover:text-amber-500",title:e.starred?s.unref(i)("header.unstarDocument"):s.unref(i)("header.starDocument"),onClick:O[3]||(O[3]=B=>l("toggle-star"))},[s.createVNode(s.unref($c),{class:s.normalizeClass(["h-4 w-4",e.starred?"fill-amber-400 text-amber-500":""])},null,8,["class"])],8,n0)]),s.createElementVNode("nav",i0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.value,B=>(s.openBlock(),s.createElementBlock("div",{key:B,class:"relative"},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex items-center gap-0.5 rounded px-2 py-0.5 text-[13px] transition-colors",m.value===B?"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300":"text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800"]),onClick:s.withModifiers(U=>C(B),["stop"]),onMouseenter:U=>L(B)},s.toDisplayString(E.value[B].label),43,r0),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[m.value===B?(s.openBlock(),s.createElementBlock("div",a0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(E.value[B].items,(U,oe)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:oe},[U.divider?(s.openBlock(),s.createElementBlock("div",o0)):U.sub?(s.openBlock(),s.createElementBlock("div",{key:1,class:"relative",onMouseenter:ne=>_.value=`${B}-${oe}`,onMouseleave:O[4]||(O[4]=ne=>_.value=null)},[s.createElementVNode("button",l0,[s.createElementVNode("span",c0,[U.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(U.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(U.label),1)]),s.createVNode(s.unref(Xt),{class:"h-3.5 w-3.5 -rotate-90 text-slate-400"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-100 ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"transition-all duration-75 ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-2"},{default:s.withCtx(()=>[_.value===`${B}-${oe}`?(s.openBlock(),s.createElementBlock("div",u0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U.sub,ne=>(s.openBlock(),s.createElementBlock("button",{key:ne.action,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(te=>P(ne.action),["stop"])},[s.createElementVNode("span",f0,[ne.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(ne.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(ne.label),1)]),ne.badge?(s.openBlock(),s.createElementBlock("span",p0,s.toDisplayString(ne.badge),1)):ne.shortcut?(s.openBlock(),s.createElementBlock("span",m0,s.toDisplayString(ne.shortcut),1)):s.createCommentVNode("",!0)],8,d0))),128))])):s.createCommentVNode("",!0)]),_:2},1024)],40,s0)):(s.openBlock(),s.createElementBlock("button",{key:2,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(ne=>P(U.action),["stop"])},[s.createElementVNode("span",b0,[U.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(U.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(U.label),1)]),U.checked?(s.openBlock(),s.createElementBlock("span",g0,[s.createVNode(s.unref(Na),{class:"h-3.5 w-3.5"})])):U.shortcut?(s.openBlock(),s.createElementBlock("span",v0,s.toDisplayString(U.shortcut),1)):s.createCommentVNode("",!0)],8,h0))],64))),128))])):s.createCommentVNode("",!0)]),_:2},1024)]))),128))])])]),s.createElementVNode("div",x0,[e.collaborators.length>0?(s.openBlock(),s.createElementBlock("div",y0,[s.createElementVNode("div",k0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.collaborators,B=>(s.openBlock(),s.createElementBlock("div",{key:B.userId,class:"flex h-7 w-7 flex-shrink-0 cursor-help items-center justify-center rounded-full border-2 border-white text-[10px] font-bold text-white dark:border-slate-900",style:s.normalizeStyle({backgroundColor:B.color}),title:`${B.name} ${B.userId===e.currentUserId?"(You)":""} ${B.isTyping?"is typing...":""}`},[s.createElementVNode("span",_0,s.toDisplayString(x(B.name)),1)],12,w0))),128))])])):s.createCommentVNode("",!0),s.renderSlot(q.$slots,"actions"),e.editable?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:s.normalizeClass(["hidden h-8 w-8 items-center justify-center rounded-md transition-all xl:flex",e.simulatorsActive?"animate-pulse bg-emerald-600 text-white hover:bg-emerald-700":"text-indigo-600 hover:bg-slate-100 dark:text-indigo-300 dark:hover:bg-slate-800"]),title:s.unref(i)("header.sandbox"),onClick:O[5]||(O[5]=B=>l("toggle-simulators"))},[s.createVNode(s.unref(Ko),{class:"h-[18px] w-[18px]"})],10,S0)):s.createCommentVNode("",!0),s.createElementVNode("div",C0,[s.createVNode(Bs)]),s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-[13px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:O[6]||(O[6]=B=>l("share"))},[s.createVNode(s.unref(jc),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",E0,s.toDisplayString(s.unref(i)("header.share")),1)]),s.createElementVNode("div",A0,[s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-full py-0.5 pl-0.5 pr-1.5 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",title:e.userName,onClick:s.withModifiers(j,["stop"])},[e.userAvatar&&!k.value?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.userAvatar,alt:e.userName,referrerpolicy:"no-referrer",class:"h-7 w-7 flex-shrink-0 rounded-full object-cover",onError:O[7]||(O[7]=B=>k.value=!0)},null,40,N0)):(s.openBlock(),s.createElementBlock("span",O0,s.toDisplayString(y.value),1)),s.createElementVNode("span",M0,s.toDisplayString(e.userName||s.unref(i)("header.account")),1),s.createVNode(s.unref(Xt),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],8,T0),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[M.value?(s.openBlock(),s.createElementBlock("div",D0,[s.createElementVNode("div",z0,[s.createElementVNode("p",I0,s.toDisplayString(e.userName||s.unref(i)("header.account")),1)]),s.renderSlot(q.$slots,"user-menu",{close:()=>M.value=!1})])):s.createCommentVNode("",!0)]),_:3})]),s.createElementVNode("div",R0,[s.createElementVNode("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800",title:"More",onClick:s.withModifiers(I,["stop"])},[s.createVNode(s.unref(Kd),{class:"h-[18px] w-[18px]"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[N.value?(s.openBlock(),s.createElementBlock("div",L0,[s.renderSlot(q.$slots,"overflow-actions",{close:()=>N.value=!1}),e.editable?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:O[8]||(O[8]=B=>{l("toggle-simulators"),N.value=!1})},[s.createVNode(s.unref(Ko),{class:"h-4 w-4 text-slate-400"}),s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.sandbox")),1)])):s.createCommentVNode("",!0),O[9]||(O[9]=s.createElementVNode("div",{class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},null,-1)),s.createElementVNode("div",B0,[s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.theme")),1),s.createVNode(Bs)])])):s.createCommentVNode("",!0)]),_:3})])])])]))}}),P0={class:"mb-3 grid grid-cols-10 gap-1.5"},F0=["title","onClick"],V0={class:"space-y-2"},U0=["title","onClick"],H0={class:"mt-3 border-t border-slate-100 pt-3 dark:border-slate-700"},q0={class:"mb-2 text-[10px] font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400"},j0={class:"flex items-center gap-2"},$0={class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 dark:border-slate-600"},Wc=s.defineComponent({__name:"ColorPickerDropdown",props:{isOpen:{type:Boolean},activeColor:{},defaultColor:{},label:{}},emits:["select","reset","close"],setup(e,{emit:t}){const n=e,i=t,r=[["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#ffffff"],["#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],["#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],["#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd"],["#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"],["#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79"],["#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"],["#5b0f00","#660000","#783f04","#7f6000","#274e13","#0c343d","#1c4587","#073763","#20124d","#4a1130"]],a=s.ref("#000000"),o=s.ref(null);s.watch(()=>n.isOpen,m=>{m&&(a.value=n.activeColor||"#000000")});function l(m){i("select",m)}function c(){i("reset")}function u(){i("select",a.value)}function f(m){m.target===m.currentTarget&&i("close")}return(m,p)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"color-picker-dropdown absolute left-0 top-full z-50 mt-1.5 w-[272px] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-slate-700 dark:bg-[#0e1525]",onClick:f},[s.createElementVNode("div",P0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r[0],h=>(s.openBlock(),s.createElementBlock("button",{key:h,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:h}),title:h,onClick:g=>l(h)},null,12,F0))),128))]),s.createElementVNode("div",V0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.slice(1),(h,g)=>(s.openBlock(),s.createElementBlock("div",{key:g,class:"grid grid-cols-10 gap-1.5"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h,b=>(s.openBlock(),s.createElementBlock("button",{key:b,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:b}),title:b,onClick:x=>l(b)},null,12,U0))),128))]))),128))]),s.createElementVNode("div",H0,[s.createElementVNode("div",q0,s.toDisplayString(m.$props.label||"Custom"),1),s.createElementVNode("div",j0,[s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-slate-50 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:hover:bg-slate-700",onClick:p[0]||(p[0]=h=>{var g;return(g=o.value)==null?void 0:g.click()})},[s.createVNode(s.unref(Bn),{class:"h-3.5 w-3.5 text-slate-600 dark:text-slate-300"})]),s.withDirectives(s.createElementVNode("input",{ref_key:"customInput",ref:o,"onUpdate:modelValue":p[1]||(p[1]=h=>a.value=h),type:"color",class:"sr-only",onChange:u},null,544),[[s.vModelText,a.value]]),s.createElementVNode("div",$0,[s.createElementVNode("div",{class:"h-4 w-4 rounded-full",style:s.normalizeStyle({backgroundColor:a.value})},null,4)]),s.createElementVNode("button",{type:"button",class:"ml-auto flex h-6 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:c},[s.createVNode(s.unref(Al),{class:"h-3 w-3"}),p[2]||(p[2]=s.createTextVNode(" Default ",-1))])])])])):s.createCommentVNode("",!0)}}),W0={id:"editor-toolbar-row",class:"docs-editor-toolbar w-full border-b border-slate-200 bg-white py-1.5 text-slate-600 shadow-sm dark:border-slate-800 dark:bg-[#0b1120] dark:text-slate-300"},G0={class:"flex min-h-9 w-full items-center gap-1 px-3 flex-nowrap"},K0=["title","aria-label","disabled"],X0=["title","aria-label","disabled"],J0=["title","aria-label"],Z0=["title","aria-label","disabled"],Q0=["title","aria-label"],Y0={class:"toolbar-dropdown relative flex-shrink-0"},eg=["title","aria-label","disabled"],tg={class:"truncate"},ng={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},ig=["disabled","onClick"],rg={class:"toolbar-dropdown relative flex-shrink-0"},ag=["title","aria-label","disabled"],og={class:"truncate"},sg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},lg=["onClick"],cg=["title","aria-label","disabled"],ug=["value","title","aria-label","disabled","onKeydown"],dg=["title","aria-label","disabled"],fg=["title","aria-label","disabled","onClick"],pg={key:1,class:"text-xs font-medium leading-none"},mg={key:0,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},hg={key:1,class:"toolbar-dropdown relative flex-shrink-0"},bg=["title","aria-label","disabled"],gg={key:2,class:"toolbar-dropdown relative flex-shrink-0"},vg=["title","aria-label","disabled"],xg={key:3,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},yg={key:4,class:"toolbar-dropdown relative flex-shrink-0"},kg=["title","aria-label","disabled"],wg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},_g=["disabled","onClick"],Sg={key:5,class:"toolbar-dropdown relative flex-shrink-0"},Cg=["title","aria-label","disabled"],Eg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},Ag=["disabled","onClick"],Tg={key:6,class:"toolbar-dropdown relative flex-shrink-0"},Ng=["title","aria-label","disabled"],Og={class:"hidden md:inline"},Mg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[190px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},Dg=["disabled","onClick"],zg=["title","aria-label"],Ig=["title","aria-label"],Rg=["title","aria-label"],Lg=["title","aria-label"],Bg=["title","aria-label"],Pg="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Fg="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",wt="docs-editor-toolbar__control inline-flex h-8 flex-shrink-0 items-center justify-center rounded-md p-1 text-slate-600 transition-all disabled:opacity-40 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",Vg="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Ug="text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",Gc=11,Hg=1,qg=400,cf=s.defineComponent({__name:"EditorToolbar",props:{actions:{},plugins:{},editor:{},activeSidebar:{}},emits:["toggle-sidebar","print","undo","redo","toggle-left-sidebar"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a={Bold:wl,Italic:Cl,Underline:Tl,Strikethrough:Hb,Heading1:Jd,Heading2:Zd,Heading3:Qd,Heading4:ob,Heading5:sb,Heading6:lb,List:Dn,ListOrdered:ef,CheckSquare:Ub,Quote:Ma,Link:Yd,Code:Yh,Image:ub,Table:of,AlignLeft:pr,AlignCenter:Is,AlignRight:Rs,AlignJustify:Ls,FileText:gt,Palette:Uc,Highlighter:Vc};function o(K){return K?a[K]??null:null}const l=s.computed(()=>{const K=[];for(const R of i.plugins??[])!R.toolbar||R.toolbar.length===0||K.push({pluginId:R.id,items:R.toolbar});return K}),c=s.ref(0);function u(){c.value++}s.watch(()=>i.editor,(K,R)=>{R&&R.off("transaction",u),K&&K.on("transaction",u)},{immediate:!0}),s.onUnmounted(()=>{i.editor&&i.editor.off("transaction",u)});function f(K){c.value;const R=i.editor;if(!R)return!1;switch(K.action){case"toggleBold":return R.isActive("bold");case"toggleItalic":return R.isActive("italic");case"toggleUnderline":return R.isActive("underline");case"toggleStrike":return R.isActive("strike");case"toggleHeading1":return R.isActive("heading",{level:1});case"toggleHeading2":return R.isActive("heading",{level:2});case"toggleHeading3":return R.isActive("heading",{level:3});case"toggleHeading4":return R.isActive("heading",{level:4});case"toggleHeading5":return R.isActive("heading",{level:5});case"toggleHeading6":return R.isActive("heading",{level:6});case"toggleBulletList":return R.isActive("bulletList");case"toggleOrderedList":return R.isActive("orderedList");case"toggleTaskList":return R.isActive("taskList");case"toggleBlockquote":return R.isActive("blockquote");case"toggleCodeBlock":return R.isActive("codeBlock");case"setLink":return R.isActive("link");case"alignLeft":return R.isActive({textAlign:"left"});case"alignCenter":return R.isActive({textAlign:"center"});case"alignRight":return R.isActive({textAlign:"right"});case"alignJustify":return R.isActive({textAlign:"justify"});default:return!1}}function m(K){if(!i.editor)return;const R=i.actions[K.action];if(typeof R=="function"){R(...K.args??[]),i.editor.commands.focus();return}const Q=i.editor.commands[K.action];typeof Q=="function"&&(Q(...K.args??[]),i.editor.commands.focus())}const p=s.computed(()=>{var K;return c.value,(K=i.editor)==null?void 0:K.getAttributes("textStyle").color}),h=s.computed(()=>{var R,Q;c.value;const K=(R=i.editor)==null?void 0:R.getAttributes("highlight");if(K!=null&&K.color)return K.color;if((Q=i.editor)!=null&&Q.isActive("highlight"))return"#ffff00"});function g(K,R){var Ie,$e,Ge;const Q=i.actions[K];if(typeof Q=="function")Q(R);else{const an=($e=(Ie=i.editor)==null?void 0:Ie.commands)==null?void 0:$e[K];typeof an=="function"&&an(R)}(Ge=i.editor)==null||Ge.commands.focus(),M.value=null}function b(K){var Q,Ie,$e,Ge;const R=(Q=i.editor)==null?void 0:Q.chain().focus();if(!R){M.value=null;return}K==="setTextColor"?(Ie=R.unsetColor)==null||Ie.call(R).run():K==="setHighlight"&&(($e=R.unsetHighlight)==null||$e.call(R).run()),(Ge=i.editor)==null||Ge.commands.focus(),M.value=null}const x=["toggleHeading1","toggleHeading2","toggleHeading3","toggleHeading4","toggleHeading5","toggleHeading6"],v=["alignLeft","alignCenter","alignRight","alignJustify"],y=["toggleBulletList","toggleOrderedList","toggleTaskList"],k=["setLink","insertImage","insertTable","toggleBlockquote","toggleCodeBlock","insertFootnote","insertPageBreak","setPageBreak","togglePageBreak","addPageBreak"],w=["setTextColor","setHighlight"],S=s.computed(()=>l.value.flatMap(K=>K.items)),E=s.computed(()=>S.value.filter(K=>v.includes(K.action))),D=s.computed(()=>S.value.filter(K=>y.includes(K.action))),_=s.computed(()=>S.value.filter(K=>k.includes(K.action))),C=s.computed(()=>S.value.filter(K=>w.includes(K.action))),N=s.computed(()=>C.value.find(K=>K.action==="setTextColor")),I=s.computed(()=>C.value.find(K=>K.action==="setHighlight")),H=s.computed(()=>S.value.filter(K=>!x.includes(K.action)&&!v.includes(K.action)&&!y.includes(K.action)&&!k.includes(K.action)&&!w.includes(K.action))),F=s.computed(()=>{c.value;const K=i.editor;if(K){if(K.isActive({textAlign:"center"}))return Is;if(K.isActive({textAlign:"right"}))return Rs;if(K.isActive({textAlign:"justify"}))return Ls}return pr}),M=s.ref(null);function j(K){M.value=M.value===K?null:K}function P(K){m(K),M.value=null}function W(K){K.target.closest(".toolbar-dropdown")||(M.value=null)}s.onMounted(()=>document.addEventListener("click",W,!0)),s.onUnmounted(()=>document.removeEventListener("click",W,!0));function L(K){return i.activeSidebar===K?Vg:Ug}const Y=s.computed(()=>{var K;return((K=i.plugins)==null?void 0:K.some(R=>R.id==="citation"))??!1}),q=s.computed(()=>{var K,R,Q;return!!((Q=(R=(K=i.editor)==null?void 0:K.storage)==null?void 0:R.editorContext)!=null&&Q.aiStream)});function O(){i.editor&&(i.editor.commands.undo(),i.editor.commands.focus()),r("undo")}function B(){i.editor&&(i.editor.commands.redo(),i.editor.commands.focus()),r("redo")}function U(){r("print")}const oe=s.computed(()=>[{value:"paragraph",label:n("toolbar.normalText")},{value:"heading-1",label:n("header.heading1")},{value:"heading-2",label:n("header.heading2")},{value:"heading-3",label:n("header.heading3")},{value:"heading-4",label:n("header.heading4")},{value:"heading-5",label:n("header.heading5")},{value:"heading-6",label:n("header.heading6")}]);function ne(K){const R=i.editor;if(R){if(K==="paragraph")R.commands.setParagraph();else{const Q=parseInt(K.replace("heading-",""),10),Ie=i.actions[`toggleHeading${Q}`];typeof Ie=="function"?Ie():R.commands.toggleHeading({level:Q})}R.commands.focus()}M.value=null}const te=s.computed(()=>{c.value;const K=i.editor;if(!K)return"paragraph";for(let R=1;R<=6;R++)if(K.isActive("heading",{level:R}))return`heading-${R}`;return"paragraph"}),ie=s.computed(()=>{var K;return((K=oe.value.find(R=>R.value===te.value))==null?void 0:K.label)??n("toolbar.normalText")}),X=[{value:"arial",label:"Arial"},{value:"inter",label:"Inter"},{value:"serif",label:"Serif"},{value:"mono",label:"Monospace"}],V=s.ref("arial"),$=s.computed(()=>{var K;return((K=X.find(R=>R.value===V.value))==null?void 0:K.label)??"Arial"});function re(K){var R;V.value=K,M.value=null,(R=i.editor)==null||R.commands.focus()}const se=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],Ce=s.computed(()=>{var Ie;c.value;const K=i.editor;if(!K)return Gc;const R=K.getAttributes("textStyle");if(R!=null&&R.fontSize){const $e=parseInt(R.fontSize,10);if(!isNaN($e))return $e}const Q=K.state.storedMarks;if(Q){for(const $e of Q)if($e.type.name==="textStyle"&&$e.attrs.fontSize){const Ge=parseInt($e.attrs.fontSize,10);if(!isNaN(Ge))return Ge}}if((Ie=K.view)!=null&&Ie.dom){const $e=parseFloat(getComputedStyle(K.view.dom).fontSize);if(!isNaN($e)){const Ge=Math.round($e);return se.reduce((vt,xt)=>Math.abs(xt-Ge)<Math.abs(vt-Ge)?xt:vt)}}return Gc});function Ne(K){if(!i.editor)return;const R=Ce.value,Q=se.indexOf(R);let Ie;Q>=0?Ie=se[Math.min(Math.max(Q+K,0),se.length-1)]:K<0?Ie=[...se].reverse().find(Ge=>Ge<R)??se[0]:Ie=se.find(Ge=>Ge>R)??R,i.editor.commands.setFontSize(`${Ie}px`),i.editor.commands.focus()}const de=s.ref(null);function ke(K){de.value=String(Ce.value),K.target.select()}function G(K){de.value=K.target.value}function At(K){if(!i.editor)return;const R=Math.min(Math.max(K,Hg),qg);i.editor.commands.setFontSize(`${R}px`)}function we(K){var Q;const R=parseInt(K.target.value,10);!isNaN(R)&&R!==Ce.value&&At(R),de.value=null,(Q=i.editor)==null||Q.commands.focus()}function Bt(K){var Q;de.value=null;const R=K.target;R.value=String(Ce.value),R.blur(),(Q=i.editor)==null||Q.commands.focus()}return(K,R)=>(s.openBlock(),s.createElementBlock("div",W0,[s.createElementVNode("div",G0,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:s.unref(n)("toolbar.undo"),"aria-label":s.unref(n)("toolbar.undo"),disabled:!e.editor,onMousedown:R[0]||(R[0]=s.withModifiers(()=>{},["prevent"])),onClick:O},[s.createVNode(s.unref(sf),{class:"h-[18px] w-[18px]"})],42,K0),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:s.unref(n)("toolbar.redo"),"aria-label":s.unref(n)("toolbar.redo"),disabled:!e.editor,onMousedown:R[1]||(R[1]=s.withModifiers(()=>{},["prevent"])),onClick:B},[s.createVNode(s.unref(rf),{class:"h-[18px] w-[18px]"})],42,X0),R[39]||(R[39]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:s.unref(n)("toolbar.print"),"aria-label":s.unref(n)("toolbar.print"),onMousedown:R[2]||(R[2]=s.withModifiers(()=>{},["prevent"])),onClick:U},[s.createVNode(s.unref(nf),{class:"h-[18px] w-[18px]"})],42,J0),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:s.unref(n)("toolbar.spelling"),"aria-label":s.unref(n)("toolbar.spelling"),disabled:!e.editor,onMousedown:R[3]||(R[3]=s.withModifiers(()=>{},["prevent"]))},[s.createVNode(s.unref(af),{class:"h-[18px] w-[18px]"})],42,Z0),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"px-2 text-xs"]),title:s.unref(n)("toolbar.zoom"),"aria-label":s.unref(n)("toolbar.zoom"),onMousedown:R[4]||(R[4]=s.withModifiers(()=>{},["prevent"]))},s.toDisplayString(s.unref(n)("toolbar.zoom")),43,Q0),R[40]||(R[40]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("div",Y0,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-[116px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.paragraphStyle"),"aria-label":s.unref(n)("toolbar.paragraphStyle"),disabled:!e.editor,onMousedown:R[5]||(R[5]=s.withModifiers(()=>{},["prevent"])),onClick:R[6]||(R[6]=s.withModifiers(Q=>j("heading"),["stop"]))},[s.createElementVNode("span",tg,s.toDisplayString(ie.value),1),s.createVNode(s.unref(Xt),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,eg),M.value==="heading"?(s.openBlock(),s.createElementBlock("div",ng,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(oe.value,Q=>(s.openBlock(),s.createElementBlock("button",{key:Q.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",te.value===Q.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:R[7]||(R[7]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>ne(Q.value)},s.toDisplayString(Q.label),43,ig))),128))])):s.createCommentVNode("",!0)]),s.createElementVNode("div",rg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-[100px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.fontFamily"),"aria-label":s.unref(n)("toolbar.fontFamily"),disabled:!e.editor,onMousedown:R[8]||(R[8]=s.withModifiers(()=>{},["prevent"])),onClick:R[9]||(R[9]=s.withModifiers(Q=>j("font"),["stop"]))},[s.createElementVNode("span",og,s.toDisplayString($.value),1),s.createVNode(s.unref(Xt),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,ag),M.value==="font"?(s.openBlock(),s.createElementBlock("div",sg,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(X,Q=>s.createElementVNode("button",{key:Q.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",V.value===Q.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),onMousedown:R[10]||(R[10]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>re(Q.value)},s.toDisplayString(Q.label),43,lg)),64))])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-7 text-sm"]),title:s.unref(n)("toolbar.decreaseFontSize"),"aria-label":s.unref(n)("toolbar.decreaseFontSize"),disabled:!e.editor,onMousedown:R[11]||(R[11]=s.withModifiers(Q=>Ne(-1),["prevent"]))},[s.createVNode(s.unref(Ds),{class:"h-3.5 w-3.5"})],42,cg),s.createElementVNode("input",{type:"text",inputmode:"numeric",class:"h-8 w-8 flex-shrink-0 rounded border border-transparent bg-transparent text-center text-xs text-slate-700 outline-none transition hover:border-slate-300 focus:border-cyan-400 focus:bg-white disabled:opacity-40 dark:text-slate-200 dark:hover:border-slate-600 dark:focus:bg-slate-800",value:de.value??String(Ce.value),title:s.unref(n)("toolbar.fontSize"),"aria-label":s.unref(n)("toolbar.fontSize"),disabled:!e.editor,onFocus:ke,onInput:G,onKeydown:[R[12]||(R[12]=s.withKeys(s.withModifiers(Q=>Q.target.blur(),["prevent"]),["enter"])),s.withKeys(s.withModifiers(Bt,["prevent"]),["esc"])],onBlur:we},null,40,ug),s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-7 text-sm"]),title:s.unref(n)("toolbar.increaseFontSize"),"aria-label":s.unref(n)("toolbar.increaseFontSize"),disabled:!e.editor,onMousedown:R[13]||(R[13]=s.withModifiers(Q=>Ne(1),["prevent"]))},[s.createVNode(s.unref(Bn),{class:"h-3.5 w-3.5"})],42,dg),R[41]||(R[41]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(H.value,Q=>(s.openBlock(),s.createElementBlock("button",{key:Q.id,type:"button",title:Q.label??Q.id,"aria-label":Q.label??Q.id,class:s.normalizeClass(["docs-editor-toolbar__button inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md p-1 transition-all disabled:opacity-40",f(Q)?Pg:Fg]),disabled:!e.editor,onMousedown:R[14]||(R[14]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>m(Q)},[o(Q.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(Q.iconComponent)),{key:0,class:"h-[18px] w-[18px]"})):Q.label?(s.openBlock(),s.createElementBlock("span",pg,s.toDisplayString(Q.label.charAt(0)),1)):s.createCommentVNode("",!0)],42,fg))),128)),C.value.length?(s.openBlock(),s.createElementBlock("span",mg)):s.createCommentVNode("",!0),N.value?(s.openBlock(),s.createElementBlock("div",hg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:N.value.label??"Text color","aria-label":N.value.label??"Text color",disabled:!e.editor,onMousedown:R[15]||(R[15]=s.withModifiers(()=>{},["prevent"])),onClick:R[16]||(R[16]=s.withModifiers(Q=>j("textColor"),["stop"]))},[s.createVNode(s.unref(Uc),{class:"h-[18px] w-[18px]"})],42,bg),s.createVNode(Wc,{"is-open":M.value==="textColor","active-color":p.value,label:"Custom",onSelect:R[17]||(R[17]=Q=>g("setTextColor",Q)),onReset:R[18]||(R[18]=Q=>b("setTextColor")),onClose:R[19]||(R[19]=Q=>M.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),I.value?(s.openBlock(),s.createElementBlock("div",gg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"w-8"]),title:I.value.label??"Highlight","aria-label":I.value.label??"Highlight",disabled:!e.editor,onMousedown:R[20]||(R[20]=s.withModifiers(()=>{},["prevent"])),onClick:R[21]||(R[21]=s.withModifiers(Q=>j("highlight"),["stop"]))},[s.createVNode(s.unref(Vc),{class:"h-[18px] w-[18px]"})],42,vg),s.createVNode(Wc,{"is-open":M.value==="highlight","active-color":h.value,label:"Custom",onSelect:R[22]||(R[22]=Q=>g("setHighlight",Q)),onReset:R[23]||(R[23]=Q=>b("setHighlight")),onClose:R[24]||(R[24]=Q=>M.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),D.value.length||E.value.length||_.value.length?(s.openBlock(),s.createElementBlock("span",xg)):s.createCommentVNode("",!0),D.value.length?(s.openBlock(),s.createElementBlock("div",yg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.lists"),"aria-label":s.unref(n)("toolbar.lists"),disabled:!e.editor,onMousedown:R[25]||(R[25]=s.withModifiers(()=>{},["prevent"])),onClick:R[26]||(R[26]=s.withModifiers(Q=>j("lists"),["stop"]))},[s.createVNode(s.unref(Dn),{class:"h-[18px] w-[18px]"}),s.createVNode(s.unref(Xt),{class:"h-3 w-3 text-slate-400"})],42,kg),M.value==="lists"?(s.openBlock(),s.createElementBlock("div",wg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.value,Q=>(s.openBlock(),s.createElementBlock("button",{key:Q.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(Q)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:R[27]||(R[27]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>P(Q)},[o(Q.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(Q.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(Q.label??Q.id),1)],42,_g))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),E.value.length?(s.openBlock(),s.createElementBlock("div",Sg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.alignment"),"aria-label":s.unref(n)("toolbar.alignment"),disabled:!e.editor,onMousedown:R[28]||(R[28]=s.withModifiers(()=>{},["prevent"])),onClick:R[29]||(R[29]=s.withModifiers(Q=>j("align"),["stop"]))},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(F.value),{class:"h-[18px] w-[18px]"})),s.createVNode(s.unref(Xt),{class:"h-3 w-3 text-slate-400"})],42,Cg),M.value==="align"?(s.openBlock(),s.createElementBlock("div",Eg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(E.value,Q=>(s.openBlock(),s.createElementBlock("button",{key:Q.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(Q)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:R[30]||(R[30]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>P(Q)},[o(Q.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(Q.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(Q.label??Q.id),1)],42,Ag))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),_.value.length?(s.openBlock(),s.createElementBlock("div",Tg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([wt,"gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.insert"),"aria-label":s.unref(n)("toolbar.insert"),disabled:!e.editor,onMousedown:R[31]||(R[31]=s.withModifiers(()=>{},["prevent"])),onClick:R[32]||(R[32]=s.withModifiers(Q=>j("insert"),["stop"]))},[s.createVNode(s.unref(Bn),{class:"h-4 w-4"}),s.createElementVNode("span",Og,s.toDisplayString(s.unref(n)("toolbar.insert")),1),s.createVNode(s.unref(Xt),{class:"h-3 w-3 text-slate-400"})],42,Ng),M.value==="insert"?(s.openBlock(),s.createElementBlock("div",Mg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(_.value,Q=>(s.openBlock(),s.createElementBlock("button",{key:Q.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(Q)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:R[33]||(R[33]=s.withModifiers(()=>{},["prevent"])),onClick:Ie=>P(Q)},[o(Q.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(Q.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(Q.label??Q.id),1)],42,Dg))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),R[42]||(R[42]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all relative",L("comments")]),title:s.unref(n)("toolbar.comments"),"aria-label":s.unref(n)("toolbar.comments"),onClick:R[34]||(R[34]=Q=>r("toggle-sidebar","comments"))},[s.createVNode(s.unref(tf),{class:"h-[18px] w-[18px]"})],10,zg),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",L("history")]),title:s.unref(n)("toolbar.history"),"aria-label":s.unref(n)("toolbar.history"),onClick:R[35]||(R[35]=Q=>r("toggle-sidebar","history"))},[s.createVNode(s.unref(Sl),{class:"h-[18px] w-[18px]"})],10,Ig),q.value?(s.openBlock(),s.createElementBlock("button",{key:7,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",L("ai")]),title:s.unref(n)("toolbar.ai"),"aria-label":s.unref(n)("toolbar.ai"),onClick:R[36]||(R[36]=Q=>r("toggle-sidebar","ai"))},[s.createVNode(s.unref(zn),{class:"h-[18px] w-[18px]"})],10,Rg)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",L("toc")]),title:s.unref(n)("toolbar.tableOfContents"),"aria-label":s.unref(n)("toolbar.tableOfContents"),onClick:R[37]||(R[37]=Q=>r("toggle-sidebar","toc"))},[s.createVNode(s.unref(gt),{class:"h-[18px] w-[18px]"})],10,Lg),Y.value?(s.openBlock(),s.createElementBlock("button",{key:8,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",L("references")]),title:s.unref(n)("toolbar.references"),"aria-label":s.unref(n)("toolbar.references"),onClick:R[38]||(R[38]=Q=>r("toggle-sidebar","references"))},[s.createVNode(s.unref(Ns),{class:"h-[18px] w-[18px]"})],10,Bg)):s.createCommentVNode("",!0)])]))}}),jg={key:0,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-cyan-600 dark:text-cyan-400"},$g=["title"],Wg=["disabled"],Gg=["onClick"],Kg={key:0,class:"relative"},Xg={key:0,class:"absolute left-0 top-full z-10 mt-1 flex min-w-44 flex-col rounded-xl border border-slate-200 bg-white p-1 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]"},Jg=["onClick"],Kc="bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold",Zg="text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white",Qg=s.defineComponent({__name:"BubbleMenu",props:{visible:{type:Boolean},actions:{},position:{},editor:{}},setup(e){const t=e,n=s.ref(0),i=s.ref(!1);function r(){n.value++}s.watch(()=>t.editor,(b,x)=>{x&&x.off("transaction",r),b&&b.on("transaction",r)},{immediate:!0}),s.onUnmounted(()=>{t.editor&&t.editor.off("transaction",r)}),s.watch(n,()=>{i.value=!1});const a=s.computed(()=>{var b,x,v,y;return n.value,[{id:"bold",label:"Bold",action:"toggleBold",icon:wl,active:(b=t.editor)==null?void 0:b.isActive("bold")},{id:"italic",label:"Italic",action:"toggleItalic",icon:Cl,active:(x=t.editor)==null?void 0:x.isActive("italic")},{id:"underline",label:"Underline",action:"toggleUnderline",icon:Tl,active:(v=t.editor)==null?void 0:v.isActive("underline")},{id:"link",label:"Link",action:"setLink",icon:Yd,active:(y=t.editor)==null?void 0:y.isActive("link")}]}),o=s.computed(()=>{var b,x,v;return n.value,!!((v=(x=(b=t.editor)==null?void 0:b.storage)==null?void 0:x.editorContext)!=null&&v.aiStream)}),l=s.computed(()=>{var b,x,v;return n.value,((v=(x=(b=t.editor)==null?void 0:b.storage)==null?void 0:x.ai)==null?void 0:v.preview)??null}),c=[{id:"rewrite",label:"Rewrite",action:"rewrite"},{id:"summarize",label:"Summarize",action:"summarize"},{id:"grammar",label:"Fix grammar",action:"grammar"},{id:"tone",label:"Make formal",action:"tone",prompt:"make it more formal"},{id:"translate",label:"Translate to English",action:"translate",prompt:"translate to English"},{id:"expand",label:"Expand",action:"expand"},{id:"shorten",label:"Shorten",action:"shorten"}];function u(){var b;return((b=t.editor)==null?void 0:b.commands)??null}function f(b){var x;i.value=!1,(x=u())==null||x.aiTransform({action:b.action,...b.prompt?{prompt:b.prompt}:{}})}function m(){var b;(b=u())==null||b.aiAccept()}function p(){var b;(b=u())==null||b.aiReject()}const h=s.computed(()=>t.position?{top:`${t.position.top}px`,left:`${t.position.left}px`}:{});function g(b){var v,y,k,w,S;if(b==="setLink"){if((v=t.editor)!=null&&v.isActive("link")){t.editor.chain().focus().unsetLink().run();return}const E=typeof window<"u"?window.prompt("Enter link URL:","https://"):null;if(E){const D=t.actions[b];typeof D=="function"?D({href:E,target:"_blank"}):(w=(k=(y=t.editor)==null?void 0:y.chain().focus()).setLink)==null||w.call(k,{href:E,target:"_blank"}).run()}return}const x=t.actions[b];if(typeof x=="function")x();else if(t.editor){const E=t.editor.chain().focus();(S=E[b])==null||S.call(E).run()}}return(b,x)=>e.visible?(s.openBlock(),s.createElementBlock("div",{key:0,"data-testid":"bubble-menu",class:"docs-editor-bubble-menu fixed z-50 flex gap-1 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]",style:s.normalizeStyle(h.value),onMousedown:x[1]||(x[1]=s.withModifiers(()=>{},["prevent"]))},[l.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[l.value.status==="streaming"?(s.openBlock(),s.createElementBlock("span",jg,[s.createVNode(s.unref(gb),{class:"h-3.5 w-3.5 animate-spin"}),x[2]||(x[2]=s.createElementVNode("span",null,"AI writing…",-1))])):l.value.status==="error"?(s.openBlock(),s.createElementBlock("span",{key:1,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-red-600 dark:text-red-400",title:l.value.error},[s.createVNode(s.unref(Kh),{class:"h-3.5 w-3.5"}),x[3]||(x[3]=s.createElementVNode("span",null,"AI error",-1))],8,$g)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",disabled:l.value.status!=="done",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",l.value.status!=="done"?"cursor-not-allowed text-slate-300 dark:text-slate-600":"text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-500/10"]),title:"Accept (Enter)",onClick:m},[s.createVNode(s.unref(Na),{class:"h-3.5 w-3.5"}),x[4]||(x[4]=s.createElementVNode("span",null,"Accept",-1))],10,Wg),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all","text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10"]),title:"Reject (Esc)",onClick:p},[s.createVNode(s.unref(qt),{class:"h-3.5 w-3.5"}),x[5]||(x[5]=s.createElementVNode("span",null,"Reject",-1))])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.value,v=>(s.openBlock(),s.createElementBlock("button",{key:v.id,type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",v.active?Kc:Zg]),onClick:y=>g(v.action)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.icon),{class:"h-3.5 w-3.5"})),s.createElementVNode("span",null,s.toDisplayString(v.label),1)],10,Gg))),128)),o.value?(s.openBlock(),s.createElementBlock("div",Kg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",i.value?Kc:"text-cyan-600 hover:bg-cyan-50 dark:text-cyan-400 dark:hover:bg-cyan-500/10"]),onClick:x[0]||(x[0]=v=>i.value=!i.value)},[s.createVNode(s.unref(zn),{class:"h-3.5 w-3.5"}),x[6]||(x[6]=s.createElementVNode("span",null,"AI",-1))],2),i.value?(s.openBlock(),s.createElementBlock("div",Xg,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(c,v=>s.createElementVNode("button",{key:v.id,type:"button",class:"flex items-center gap-2 rounded-lg px-3 py-1.5 text-left text-xs font-semibold text-slate-600 transition-all hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/5 dark:hover:text-white",onClick:y=>f(v)},[s.createElementVNode("span",null,s.toDisplayString(v.label),1)],8,Jg)),64))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64))],36)):s.createCommentVNode("",!0)}}),uf=kl(Qg,[["__scopeId","data-v-e75fb4f8"]]),Yg={id:"editor-footer-row",class:"flex h-9 flex-shrink-0 items-center justify-between border-t border-slate-200 bg-white px-4 font-sans text-[11px] text-slate-400 dark:border-slate-800 dark:bg-[#0b1120]"},ev={class:"flex items-center gap-2"},tv={class:"flex items-center gap-1 font-bold"},nv={key:0,class:"relative mr-1 flex h-2 w-2"},iv={key:1,class:"relative mr-1 flex h-2 w-2"},rv={key:2,class:"font-mono text-[10px] uppercase tracking-wide text-emerald-600 dark:text-cyan-400"},av={key:3,class:"font-mono text-[10px] uppercase tracking-wide text-amber-600 dark:text-amber-500"},ov={class:"flex items-center gap-1.5 font-sans text-[11px] font-medium text-slate-500 dark:text-slate-400"},sv={key:0,class:"animate-pulse font-semibold text-cyan-600 dark:text-cyan-400"},lv={key:1,class:"font-semibold text-amber-600 dark:text-amber-500"},cv={key:2,class:"flex items-center gap-1"},uv={class:"rounded bg-slate-100 px-1.5 py-0.5 font-mono text-[10px] text-slate-700 dark:bg-white/5 dark:text-slate-300"},dv={class:"flex items-center gap-3 font-semibold text-slate-400 dark:text-slate-500"},fv=["value","title","aria-label"],pv=["value"],mv={key:0,class:"font-medium text-slate-500 dark:text-slate-400"},hv={key:1},bv={class:"font-mono text-slate-600 dark:text-slate-300"},gv={class:"font-mono text-slate-600 dark:text-slate-300"},vv={class:"font-mono text-slate-600 dark:text-slate-300"},xv={class:"font-mono text-slate-600 dark:text-slate-300"},df=s.defineComponent({__name:"StatusBar",props:{connectionState:{default:"connected"},savingStatus:{default:"saved"},lastSaved:{default:void 0},wordCount:{default:0},charCount:{default:0},pageCount:{default:1},currentPage:{default:1},pageSize:{default:"a4"},pageSizes:{default:()=>[]},pageless:{type:Boolean,default:!1}},emits:["update:pageSize"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.computed(()=>i.lastSaved?new Date(i.lastSaved).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):n("statusBar.never")),o=s.computed(()=>{var l,c;return((c=(l=i.pageSizes)==null?void 0:l.find(u=>u.id===i.pageSize))==null?void 0:c.name)??i.pageSize.toUpperCase()});return(l,c)=>(s.openBlock(),s.createElementBlock("footer",Yg,[s.createElementVNode("div",ev,[s.createElementVNode("span",tv,[e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",nv,[...c[1]||(c[1]=[s.createElementVNode("span",{class:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"},null,-1),s.createElementVNode("span",{class:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"},null,-1)])])):(s.openBlock(),s.createElementBlock("span",iv,[...c[2]||(c[2]=[s.createElementVNode("span",{class:"h-2 w-2 animate-spin rounded-full border border-amber-500 border-t-transparent"},null,-1)])])),e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",rv,s.toDisplayString(s.unref(n)("statusBar.liveSyncActive")),1)):(s.openBlock(),s.createElementBlock("span",av,s.toDisplayString(s.unref(n)("statusBar.connecting")),1))]),c[3]||(c[3]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"|",-1)),s.createElementVNode("span",ov,[s.createVNode(s.unref(Nb),{class:s.normalizeClass(["h-3 w-3",e.savingStatus==="saving"?"animate-spin text-cyan-500":"text-emerald-500"])},null,8,["class"]),e.savingStatus==="saving"?(s.openBlock(),s.createElementBlock("span",sv,s.toDisplayString(s.unref(n)("statusBar.saving")),1)):e.savingStatus==="offline"?(s.openBlock(),s.createElementBlock("span",lv,s.toDisplayString(s.unref(n)("statusBar.offline")),1)):(s.openBlock(),s.createElementBlock("span",cv,[s.createElementVNode("span",null,s.toDisplayString(s.unref(n)("statusBar.lastSavedAt")),1),s.createElementVNode("strong",uv,s.toDisplayString(a.value),1)]))])]),s.createElementVNode("div",dv,[s.createElementVNode("select",{value:e.pageSize,title:o.value,class:"h-6 cursor-pointer rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] font-medium text-slate-600 outline-none hover:border-slate-300 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300","aria-label":s.unref(n)("statusBar.pageSize"),onChange:c[0]||(c[0]=u=>r("update:pageSize",u.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.pageSizes,u=>(s.openBlock(),s.createElementBlock("option",{key:u.id,value:u.id},s.toDisplayString(u.name),9,pv))),128))],40,fv),c[4]||(c[4]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),e.pageless?(s.openBlock(),s.createElementBlock("span",mv,s.toDisplayString(s.unref(n)("statusBar.pageless")),1)):(s.openBlock(),s.createElementBlock("span",hv,[s.createTextVNode(s.toDisplayString(s.unref(n)("statusBar.page"))+" ",1),s.createElementVNode("strong",bv,s.toDisplayString(e.currentPage),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.of"))+" ",1),s.createElementVNode("strong",gv,s.toDisplayString(e.pageCount),1)])),c[5]||(c[5]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",vv,s.toDisplayString(e.wordCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.words")),1)]),c[6]||(c[6]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",xv,s.toDisplayString(e.charCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.characters")),1)])])]))}}),yv={class:"docs-editor-ruler relative h-6 w-full flex-shrink-0 overflow-hidden border-b border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e]"},kv={class:"absolute inset-x-0 top-2.5 h-full"},wv={key:0,class:"absolute -top-2 left-0.5 text-[9px] text-slate-400"},_v=s.defineComponent({__name:"RulerBar",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var o,l;return{pageWidth:((o=t.layoutOptions)==null?void 0:o.pageWidth)??794,margins:((l=t.layoutOptions)==null?void 0:l.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const o=Math.floor(n.value.pageWidth/48);return Array.from({length:o+1},(l,c)=>c*48)}),r=s.computed(()=>`${n.value.margins.left}px`),a=s.computed(()=>`${n.value.pageWidth-n.value.margins.right}px`);return(o,l)=>(s.openBlock(),s.createElementBlock("div",yv,[s.createElementVNode("div",{class:"absolute inset-y-0 mx-auto h-full",style:s.normalizeStyle({width:`${n.value.pageWidth}px`,left:"50%",transform:"translateX(-50%)"})},[s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:r.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:a.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",kv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,c=>(s.openBlock(),s.createElementBlock("div",{key:c,class:s.normalizeClass(["absolute top-0 border-l border-slate-300 dark:border-slate-600",c%96===0?"h-3":"h-1.5"]),style:s.normalizeStyle({left:`${c}px`})},[c%96===0&&c>0?(s.openBlock(),s.createElementBlock("span",wv,s.toDisplayString(c/96),1)):s.createCommentVNode("",!0)],6))),128))])],4)]))}}),Sv={class:"relative h-full w-full"},Cv={key:0,class:"absolute -top-2 right-3 text-[9px] text-slate-400"},Ev=s.defineComponent({__name:"VerticalRuler",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var r,a;return{pageHeight:((r=t.layoutOptions)==null?void 0:r.pageHeight)??1123,margins:((a=t.layoutOptions)==null?void 0:a.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const r=Math.floor(n.value.pageHeight/48);return Array.from({length:r+1},(a,o)=>o*48)});return(r,a)=>(s.openBlock(),s.createElementBlock("div",{class:"docs-editor-vertical-ruler sticky top-0 hidden w-6 flex-shrink-0 border-r border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e] lg:block",style:s.normalizeStyle({minHeight:`${n.value.pageHeight}px`})},[s.createElementVNode("div",Sv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:s.normalizeClass(["absolute right-0 border-t border-slate-300 dark:border-slate-600",o%96===0?"w-3":"w-1.5"]),style:s.normalizeStyle({top:`${o}px`})},[o%96===0&&o>0?(s.openBlock(),s.createElementBlock("span",Cv,s.toDisplayString(o/96),1)):s.createCommentVNode("",!0)],6))),128))])],4))}}),Av={class:"toc-sidebar flex h-full w-80 flex-shrink-0 flex-col border-r border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},Tv={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},Nv={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},Ov={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},Mv=["title"],Dv={key:0,class:"px-4 pb-2 pt-3"},zv={class:"relative flex items-center"},Iv=["placeholder"],Rv={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},Lv={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},Bv={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},Pv={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},Fv={class:"mt-1.5 max-w-[200px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},Vv={class:"mt-5 w-full space-y-2 px-4 font-sans"},Uv={class:"mb-1.5 block text-left text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},Hv=["onClick"],qv={class:"flex items-center gap-1.5"},jv={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},$v={class:"text-xs font-semibold"},Wv={class:"mt-1 text-[10px] text-slate-400"},Gv={key:2,class:"space-y-1 font-sans"},Kv={class:"mb-2.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},Xv={class:"relative ml-1.5 space-y-1.5 border-l border-slate-100 pl-1.5 dark:border-white/5"},Jv=["onClick"],Zv={class:"flex min-w-0 flex-1 items-center gap-2"},Qv={class:"border-t border-slate-200 bg-slate-50/50 p-3.5 text-[10px] leading-relaxed text-slate-400 dark:border-white/5 dark:bg-slate-900/30 dark:text-slate-500"},Yv={class:"flex items-start gap-1.5"},e1=60,ff=s.defineComponent({__name:"TOCSidebar",props:{editor:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref([]),o=s.ref(""),l=s.ref(null);let c=null;function u(){c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,f()},e1)}function f(){if(!n.editor)return;const v=[];n.editor.state.doc.descendants((y,k)=>{if(y.type.name==="heading"){const w=y.attrs.level;if(w===1||w===2||w===3){const S=y.textContent.trim();v.push({id:`heading-${k}`,text:S||r("sidebars.toc.untitledHeading").replace("{level}",String(w)),level:w,pos:k})}}return!0}),a.value=v}function m(){const v=n.editor;if(!v)return;const{from:y}=v.state.selection,k=v.state.doc.resolve(Math.max(0,y-1));for(let w=k.depth;w>0;w--){const S=k.node(w);if(S&&S.type.name==="heading"){l.value=`heading-${k.before(w+1)-1}`;return}}l.value=null}s.onMounted(()=>{var v,y;f(),m(),(v=n.editor)==null||v.on("update",u),(y=n.editor)==null||y.on("selectionUpdate",m)}),s.onUnmounted(()=>{var v,y;(v=n.editor)==null||v.off("update",u),(y=n.editor)==null||y.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null)}),s.watch(()=>n.editor,(v,y)=>{y==null||y.off("update",u),y==null||y.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null),f(),m(),v==null||v.on("update",u),v==null||v.on("selectionUpdate",m)});const p=s.computed(()=>a.value.filter(v=>v.text.toLowerCase().includes(o.value.toLowerCase())));function h(v){n.editor&&(n.editor.chain().focus().setTextSelection(v.pos).run(),l.value=v.id,setTimeout(()=>{var w;const y=document.querySelector(".docs-editor-scroll");if(!y)return;const k=y.querySelectorAll(".ProseMirror h1, .ProseMirror h2, .ProseMirror h3");for(const S of Array.from(k))if(((w=S.textContent)==null?void 0:w.trim())===v.text){S.scrollIntoView({behavior:"smooth",block:"center"});return}},50))}function g(v){if(!n.editor)return;const y=r(v===1?"header.heading1":v===2?"header.heading2":"header.heading3"),k=r("sidebars.toc.newSection"),w=r("sidebars.toc.startWriting");n.editor.chain().focus().insertContent(`<h${v}>${k.replace("{tag}",y)}</h${v}><p>${w}</p>`).run()}function b(v,y){const k="group w-full flex items-center justify-between rounded-lg p-1.5 text-left transition-all relative",w="bg-cyan-500/10 text-cyan-600 dark:text-cyan-400",S="text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-white/5";return v===1?[k,y?w:S,"pl-0 font-bold text-xs text-slate-800 dark:text-slate-200"]:v===2?[k,y?w:S,"pl-3.5 font-semibold text-[11px] text-slate-600 dark:text-slate-300"]:[k,y?w:S,"pl-6 text-[10px] text-slate-400 dark:text-slate-400"]}function x(v){return v===1?"bg-cyan-500":v===2?"bg-emerald-500":"bg-amber-500"}return(v,y)=>(s.openBlock(),s.createElementBlock("div",Av,[s.createElementVNode("div",Tv,[s.createElementVNode("div",null,[s.createElementVNode("h3",Nv,[s.createVNode(s.unref(Dn),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.title")),1)]),s.createElementVNode("p",Ov,s.toDisplayString(s.unref(r)("sidebars.toc.empty")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.toc.closeOutline"),onClick:y[0]||(y[0]=k=>i("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,Mv)]),a.value.length>0?(s.openBlock(),s.createElementBlock("div",Dv,[s.createElementVNode("div",zv,[s.createVNode(s.unref(fr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[1]||(y[1]=k=>o.value=k),type:"text",placeholder:s.unref(r)("sidebars.toc.searchHeadings"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,Iv),[[s.vModelText,o.value]]),o.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:y[2]||(y[2]=k=>o.value="")},[s.createVNode(s.unref(qt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),s.createElementVNode("div",Rv,[a.value.length===0?(s.openBlock(),s.createElementBlock("div",Lv,[s.createElementVNode("div",Bv,[s.createVNode(s.unref(Dn),{class:"h-6 w-6"})]),s.createElementVNode("h4",Pv,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadings")),1),s.createElementVNode("p",Fv,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadingsDescription")),1),s.createElementVNode("div",Vv,[s.createElementVNode("span",Uv,s.toDisplayString(s.unref(r)("sidebars.toc.quickInsert")),1),(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList([1,2,3],k=>s.createElementVNode("button",{key:k,type:"button",class:"flex w-full items-center justify-between rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-[11px] font-semibold text-slate-700 transition-all hover:bg-slate-100 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:w=>g(k)},[s.createElementVNode("span",qv,[s.createVNode(s.unref(Oa),{class:s.normalizeClass(["h-3 w-3",k===1?"text-cyan-500":k===2?"text-emerald-500":"text-amber-500"])},null,8,["class"]),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.headingLevel").replace("{level}",String(k))),1)]),s.createVNode(s.unref(Bn),{class:"h-3.5 w-3.5 text-slate-400"})],8,Hv)),64))])])):p.value.length===0?(s.openBlock(),s.createElementBlock("div",jv,[s.createVNode(s.unref(fr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",$v,s.toDisplayString(s.unref(r)("sidebars.toc.noMatchingHeaders")),1),s.createElementVNode("p",Wv,s.toDisplayString(s.unref(r)("sidebars.toc.tryDifferentTerm")),1)])):(s.openBlock(),s.createElementBlock("div",Gv,[s.createElementVNode("span",Kv,s.toDisplayString(s.unref(r)("sidebars.toc.outlineLayout")),1),s.createElementVNode("div",Xv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(p.value,k=>(s.openBlock(),s.createElementBlock("button",{key:k.id,type:"button",class:s.normalizeClass(b(k.level,l.value===k.id)),onClick:w=>h(k)},[s.createElementVNode("div",Zv,[s.createElementVNode("span",{class:s.normalizeClass(["h-1.5 w-1.5 shrink-0 rounded-full transition-all",[x(k.level),l.value===k.id?"scale-125 opacity-100":"opacity-40 group-hover:scale-110 group-hover:opacity-100"]])},null,2),s.createElementVNode("span",{class:s.normalizeClass(["flex-1 truncate leading-tight",l.value===k.id?"text-cyan-600 dark:text-cyan-400":""])},s.toDisplayString(k.text),3)]),s.createVNode(s.unref(Wh),{class:s.normalizeClass(["h-3 w-3 shrink-0 text-cyan-500 opacity-0 transition-opacity group-hover:opacity-100",l.value===k.id?"opacity-100 text-cyan-600 dark:text-cyan-400":""])},null,8,["class"])],10,Jv))),128))])]))]),s.createElementVNode("div",Qv,[s.createElementVNode("div",Yv,[s.createVNode(s.unref(Sb),{class:"mt-0.5 h-3.5 w-3.5 shrink-0 text-cyan-500"}),s.createElementVNode("p",null,s.toDisplayString(s.unref(r)("sidebars.toc.outlineSync")),1)])])]))}}),t1={class:"references-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},n1={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},i1={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},r1={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},a1=["title"],o1={class:"border-b border-slate-100 px-4 pb-3 pt-3 dark:border-white/5"},s1={class:"mb-1.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},l1=["value"],c1=["value"],u1={class:"flex items-center gap-2 px-4 pb-2 pt-3"},d1={class:"relative flex flex-1 items-center"},f1=["placeholder"],p1=["title"],m1={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},h1={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},b1={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},g1={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},v1={class:"mt-1.5 max-w-[220px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},x1={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},y1={class:"text-xs font-semibold"},k1={key:2,class:"space-y-2 font-sans"},w1={class:"min-w-0 flex-1"},_1=["title"],S1={class:"mt-0.5 truncate text-[10px] text-slate-500 dark:text-slate-400"},C1={key:0},E1={key:1},A1={key:2},T1={class:"mt-1.5 inline-block rounded bg-slate-200/70 px-1.5 py-0.5 text-[9px] font-mono uppercase tracking-wide text-slate-500 dark:bg-white/10 dark:text-slate-400"},N1={class:"mt-2.5 flex items-center gap-1.5"},O1=["onClick"],M1=["title","onClick"],D1=["title","onClick"],z1={key:0,class:"border-t border-slate-200 dark:border-white/5"},I1={key:0,class:"space-y-3 px-4 pb-4"},R1={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},L1={class:"flex items-center gap-1.5"},B1=["placeholder"],P1=["disabled","title"],F1={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},V1=["disabled"],U1={key:0,class:"text-[10px] leading-relaxed text-slate-500 dark:text-slate-400"},H1={class:"flex items-center gap-2 border-b border-slate-100 px-4 py-3 dark:border-white/5"},q1=["title"],j1={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},$1={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},W1={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},G1=["value"],K1={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},X1={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},J1={class:"space-y-2"},Z1=["onUpdate:modelValue","placeholder"],Q1=["onUpdate:modelValue","placeholder"],Y1=["onClick"],ex={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},tx={key:0},nx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},ix={key:1,class:"grid grid-cols-2 gap-2"},rx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},ax={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},ox={key:2,class:"grid grid-cols-3 gap-2"},sx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},lx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},cx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},ux={key:3},dx={key:4},fx={class:"flex items-center gap-2 pt-1.5"},px=["disabled"],mx=s.defineComponent({__name:"ReferencesSidebar",props:{sources:{},activeStyle:{},pickerMode:{type:Boolean,default:!1},availableStyles:{default:()=>[{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)"},{id:"chicago-author-date",name:"Chicago (author-date)"},{id:"apa",name:"APA"},{id:"modern-language-association",name:"MLA"}]},canImport:{type:Boolean,default:!1},importing:{type:Boolean,default:!1},importMessage:{default:""}},emits:["close","insert","create","update","remove","update:style","import-doi","import-bibliography"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref(""),o=["book","article-journal","chapter","webpage","report","thesis","document"];function l(X){const V=X.author??[];if(V.length===0)return r("sidebars.references.anonymous");const $=V[0],re=$.family??$.literal??"";return V.length>1?`${re} ${r("sidebars.references.etAl")}`:re}function c(X){var $,re;const V=(re=($=X.issued)==null?void 0:$["date-parts"])==null?void 0:re[0];return V!=null&&V[0]?String(V[0]):""}function u(X){const V=`sidebars.references.types.${X}`,$=r(V);return $===V?X:$}const f=s.computed(()=>{const X=a.value.trim().toLowerCase();return X?n.sources.filter(V=>[V.title,V["container-title"],V.publisher,V.DOI,V.URL,...(V.author??[]).map(re=>`${re.family??""} ${re.given??""} ${re.literal??""}`)].filter(Boolean).join(" ").toLowerCase().includes(X)):n.sources}),m=s.ref("list"),p=s.ref(null),h=s.ref("book"),g=s.ref(""),b=s.ref([{family:"",given:""}]),x=s.ref(""),v=s.ref(""),y=s.ref(""),k=s.ref(""),w=s.ref(""),S=s.ref(""),E=s.ref(""),D=s.ref(""),_=s.ref("");function C(){h.value="book",g.value="",b.value=[{family:"",given:""}],x.value="",v.value="",y.value="",k.value="",w.value="",S.value="",E.value="",D.value="",_.value=""}function N(){p.value=null,C(),m.value="form"}function I(X){p.value=X.id,h.value=X.type||"book",g.value=X.title??"",b.value=(X.author??[]).filter($=>!$.literal).map($=>({family:$.family??"",given:$.given??""}));const V=(X.author??[]).find($=>$.literal);b.value.length===0&&(b.value=[{family:(V==null?void 0:V.literal)??"",given:""}]),x.value=c(X),v.value=X.publisher??"",y.value=X["publisher-place"]??"",k.value=X["container-title"]??"",w.value=X.volume??"",S.value=X.issue??"",E.value=X.page??"",D.value=X.DOI??"",_.value=X.URL??"",m.value="form"}function H(){b.value.push({family:"",given:""})}function F(X){b.value.splice(X,1),b.value.length===0&&b.value.push({family:"",given:""})}const M=s.computed(()=>["book","chapter","report","thesis","document"].includes(h.value)),j=s.computed(()=>["article-journal","chapter"].includes(h.value)),P=s.computed(()=>["article-journal","chapter"].includes(h.value)),W=s.computed(()=>["webpage","report"].includes(h.value)),L=s.computed(()=>g.value.trim().length>0);function Y(){const X=b.value.filter(re=>re.family.trim()||re.given.trim()).map(re=>({family:re.family.trim(),given:re.given.trim()})),V=parseInt(x.value,10),$={id:p.value??crypto.randomUUID(),type:h.value,title:g.value.trim()};return X.length>0&&($.author=X),Number.isFinite(V)&&($.issued={"date-parts":[[V]]}),v.value.trim()&&($.publisher=v.value.trim()),y.value.trim()&&($["publisher-place"]=y.value.trim()),k.value.trim()&&($["container-title"]=k.value.trim()),w.value.trim()&&($.volume=w.value.trim()),S.value.trim()&&($.issue=S.value.trim()),E.value.trim()&&($.page=E.value.trim()),D.value.trim()&&($.DOI=D.value.trim()),_.value.trim()&&($.URL=_.value.trim()),$}function q(){if(!L.value)return;const X=Y();p.value?i("update",X):i("create",X),m.value="list"}function O(X){window.confirm(r("sidebars.references.confirmDelete").replace("{title}",X.title??X.id))&&i("remove",X.id)}const B=s.ref(!1),U=s.ref(""),oe=s.ref(null);function ne(){const X=U.value.trim();!X||n.importing||(i("import-doi",X),U.value="")}function te(){var X;n.importing||(X=oe.value)==null||X.click()}async function ie(X){var Ce;const V=X.target,$=(Ce=V.files)==null?void 0:Ce[0];if(V.value="",!$)return;const re=/\.ris$/i.test($.name)?"ris":"bibtex",se=await $.text();i("import-bibliography",{format:re,text:se})}return(X,V)=>(s.openBlock(),s.createElementBlock("div",t1,[s.createElementVNode("div",n1,[s.createElementVNode("div",null,[s.createElementVNode("h3",i1,[s.createVNode(s.unref(Ns),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.title")),1)]),s.createElementVNode("p",r1,s.toDisplayString(s.unref(r)("sidebars.references.subtitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.close"),onClick:V[0]||(V[0]=$=>i("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,a1)]),m.value==="list"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",o1,[s.createElementVNode("label",s1,s.toDisplayString(s.unref(r)("sidebars.references.citationStyle")),1),s.createElementVNode("select",{value:e.activeStyle,class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onChange:V[1]||(V[1]=$=>i("update:style",$.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.availableStyles,$=>(s.openBlock(),s.createElementBlock("option",{key:$.id,value:$.id},s.toDisplayString($.name),9,c1))),128))],40,l1)]),s.createElementVNode("div",u1,[s.createElementVNode("div",d1,[s.createVNode(s.unref(fr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[2]||(V[2]=$=>a.value=$),type:"text",placeholder:s.unref(r)("sidebars.references.searchSources"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,f1),[[s.vModelText,a.value]]),a.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:V[3]||(V[3]=$=>a.value="")},[s.createVNode(s.unref(qt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-xl bg-blue-600 text-white shadow transition-colors hover:bg-blue-700",title:s.unref(r)("sidebars.references.addSource"),onClick:N},[s.createVNode(s.unref(Bn),{class:"h-4 w-4"})],8,p1)]),s.createElementVNode("div",m1,[e.sources.length===0?(s.openBlock(),s.createElementBlock("div",h1,[s.createElementVNode("div",b1,[s.createVNode(s.unref(Ns),{class:"h-6 w-6"})]),s.createElementVNode("h4",g1,s.toDisplayString(s.unref(r)("sidebars.references.noSources")),1),s.createElementVNode("p",v1,s.toDisplayString(s.unref(r)("sidebars.references.noSourcesDescription")),1),s.createElementVNode("button",{type:"button",class:"mt-5 flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-[11px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:N},[s.createVNode(s.unref(Bn),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.addSource")),1)])])):f.value.length===0?(s.openBlock(),s.createElementBlock("div",x1,[s.createVNode(s.unref(fr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",y1,s.toDisplayString(s.unref(r)("sidebars.references.noMatchingSources")),1)])):(s.openBlock(),s.createElementBlock("div",k1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.value,$=>(s.openBlock(),s.createElementBlock("div",{key:$.id,class:"group rounded-xl border border-slate-200/80 bg-slate-50/60 p-3 transition-all hover:border-slate-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"},[s.createElementVNode("div",w1,[s.createElementVNode("p",{class:"truncate text-xs font-semibold text-slate-800 dark:text-slate-200",title:$.title},s.toDisplayString($.title),9,_1),s.createElementVNode("p",S1,[s.createTextVNode(s.toDisplayString(l($)),1),c($)?(s.openBlock(),s.createElementBlock("span",C1," ("+s.toDisplayString(c($))+")",1)):s.createCommentVNode("",!0),$["container-title"]?(s.openBlock(),s.createElementBlock("span",E1," · "+s.toDisplayString($["container-title"]),1)):$.publisher?(s.openBlock(),s.createElementBlock("span",A1," · "+s.toDisplayString($.publisher),1)):s.createCommentVNode("",!0)]),s.createElementVNode("span",T1,s.toDisplayString(u($.type)),1)]),s.createElementVNode("div",N1,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex flex-1 items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-[10px] font-semibold transition-colors",e.pickerMode?"bg-blue-600 text-white hover:bg-blue-700":"bg-slate-200/80 text-slate-700 hover:bg-blue-600 hover:text-white dark:bg-white/10 dark:text-slate-300 dark:hover:bg-blue-600"]),onClick:re=>i("insert",$.id)},[s.createVNode(s.unref(Ma),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.cite")),1)],10,O1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",title:s.unref(r)("sidebars.references.edit"),onClick:re=>I($)},[s.createVNode(s.unref(Al),{class:"h-3.5 w-3.5"})],8,M1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",title:s.unref(r)("sidebars.references.delete"),onClick:re=>O($)},[s.createVNode(s.unref(mr),{class:"h-3.5 w-3.5"})],8,D1)])]))),128))]))]),e.canImport?(s.openBlock(),s.createElementBlock("div",z1,[s.createElementVNode("button",{type:"button",class:"flex w-full items-center justify-between px-4 py-2.5 text-[10px] font-bold uppercase tracking-widest text-slate-400 transition-colors hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",onClick:V[4]||(V[4]=$=>B.value=!B.value)},[s.createElementVNode("span",null,s.toDisplayString(s.unref(r)("sidebars.references.import.title")),1),s.createVNode(s.unref(Xt),{class:s.normalizeClass(["h-3.5 w-3.5 transition-transform",B.value?"rotate-180":""])},null,8,["class"])]),B.value?(s.openBlock(),s.createElementBlock("div",I1,[s.createElementVNode("div",null,[s.createElementVNode("label",R1,s.toDisplayString(s.unref(r)("sidebars.references.import.fromDoi")),1),s.createElementVNode("div",L1,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[5]||(V[5]=$=>U.value=$),type:"text",placeholder:s.unref(r)("sidebars.references.import.doiPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onKeydown:s.withKeys(ne,["enter"])},null,40,B1),[[s.vModelText,U.value]]),s.createElementVNode("button",{type:"button",disabled:e.importing||!U.value.trim(),class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg bg-blue-600 text-white transition-colors hover:bg-blue-700 disabled:opacity-40",title:s.unref(r)("sidebars.references.import.importDoi"),onClick:ne},[s.createVNode(s.unref(Xd),{class:"h-3.5 w-3.5"})],8,P1)])]),s.createElementVNode("div",null,[s.createElementVNode("label",F1,s.toDisplayString(s.unref(r)("sidebars.references.import.fromFile")),1),s.createElementVNode("button",{type:"button",disabled:e.importing,class:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-slate-300 px-3 py-2 text-[11px] font-semibold text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-600 disabled:opacity-40 dark:border-white/15 dark:text-slate-400 dark:hover:border-blue-500 dark:hover:text-blue-400",onClick:te},[s.createVNode(s.unref(nb),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(e.importing?s.unref(r)("sidebars.references.import.importing"):s.unref(r)("sidebars.references.import.pickFile")),1)],8,V1),s.createElementVNode("input",{ref_key:"bibFileInput",ref:oe,type:"file",accept:".bib,.ris,application/x-bibtex,text/plain",class:"hidden",onChange:ie},null,544)]),e.importMessage?(s.openBlock(),s.createElementBlock("p",U1,s.toDisplayString(e.importMessage),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",H1,[s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.back"),onClick:V[6]||(V[6]=$=>m.value="list")},[s.createVNode(s.unref($h),{class:"h-4 w-4"})],8,q1),s.createElementVNode("h4",j1,s.toDisplayString(p.value?s.unref(r)("sidebars.references.editSource"):s.unref(r)("sidebars.references.addSource")),1)]),s.createElementVNode("div",$1,[s.createElementVNode("form",{class:"space-y-3.5",onSubmit:s.withModifiers(q,["prevent"])},[s.createElementVNode("div",null,[s.createElementVNode("label",W1,s.toDisplayString(s.unref(r)("sidebars.references.form.type")),1),s.withDirectives(s.createElementVNode("select",{"onUpdate:modelValue":V[7]||(V[7]=$=>h.value=$),class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(o,$=>s.createElementVNode("option",{key:$,value:$},s.toDisplayString(u($)),9,G1)),64))],512),[[s.vModelSelect,h.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",K1,s.toDisplayString(s.unref(r)("sidebars.references.form.title"))+" *",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[8]||(V[8]=$=>g.value=$),type:"text",required:"",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,g.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",X1,s.toDisplayString(s.unref(r)("sidebars.references.form.authors")),1),s.createElementVNode("div",J1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(b.value,($,re)=>(s.openBlock(),s.createElementBlock("div",{key:re,class:"flex items-center gap-1.5"},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":se=>$.family=se,type:"text",placeholder:s.unref(r)("sidebars.references.form.familyName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Z1),[[s.vModelText,$.family]]),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":se=>$.given=se,type:"text",placeholder:s.unref(r)("sidebars.references.form.givenName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Q1),[[s.vModelText,$.given]]),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg text-slate-400 hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",onClick:se=>F(re)},[s.createVNode(s.unref(qt),{class:"h-3.5 w-3.5"})],8,Y1)]))),128))]),s.createElementVNode("button",{type:"button",class:"mt-1.5 flex items-center gap-1 text-[10px] font-semibold text-blue-600 hover:text-blue-700 dark:text-blue-400",onClick:H},[s.createVNode(s.unref(Bn),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.form.addAuthor")),1)])]),s.createElementVNode("div",null,[s.createElementVNode("label",ex,s.toDisplayString(s.unref(r)("sidebars.references.form.year")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[9]||(V[9]=$=>x.value=$),type:"number",min:"0",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,x.value]])]),j.value?(s.openBlock(),s.createElementBlock("div",tx,[s.createElementVNode("label",nx,s.toDisplayString(h.value==="chapter"?s.unref(r)("sidebars.references.form.bookTitle"):s.unref(r)("sidebars.references.form.journal")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[10]||(V[10]=$=>k.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,k.value]])])):s.createCommentVNode("",!0),M.value?(s.openBlock(),s.createElementBlock("div",ix,[s.createElementVNode("div",null,[s.createElementVNode("label",rx,s.toDisplayString(s.unref(r)("sidebars.references.form.publisher")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[11]||(V[11]=$=>v.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,v.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",ax,s.toDisplayString(s.unref(r)("sidebars.references.form.publisherPlace")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[12]||(V[12]=$=>y.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,y.value]])])])):s.createCommentVNode("",!0),P.value?(s.openBlock(),s.createElementBlock("div",ox,[s.createElementVNode("div",null,[s.createElementVNode("label",sx,s.toDisplayString(s.unref(r)("sidebars.references.form.volume")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[13]||(V[13]=$=>w.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,w.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",lx,s.toDisplayString(s.unref(r)("sidebars.references.form.issue")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[14]||(V[14]=$=>S.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,S.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",cx,s.toDisplayString(s.unref(r)("sidebars.references.form.pages")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[15]||(V[15]=$=>E.value=$),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,E.value]])])])):s.createCommentVNode("",!0),h.value==="article-journal"?(s.openBlock(),s.createElementBlock("div",ux,[V[19]||(V[19]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"DOI",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[16]||(V[16]=$=>D.value=$),type:"text",placeholder:"10.xxxx/xxxxx",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,D.value]])])):s.createCommentVNode("",!0),W.value?(s.openBlock(),s.createElementBlock("div",dx,[V[20]||(V[20]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"URL",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":V[17]||(V[17]=$=>_.value=$),type:"url",placeholder:"https://…",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,_.value]])])):s.createCommentVNode("",!0),s.createElementVNode("div",fx,[s.createElementVNode("button",{type:"submit",disabled:!L.value,class:"flex-1 rounded-lg bg-blue-600 px-4 py-2 text-xs font-semibold text-white shadow transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-40"},s.toDisplayString(p.value?s.unref(r)("sidebars.references.form.save"):s.unref(r)("sidebars.references.form.create")),9,px),s.createElementVNode("button",{type:"button",class:"rounded-lg border border-slate-200 px-4 py-2 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 dark:border-white/10 dark:text-slate-300 dark:hover:bg-white/5",onClick:V[18]||(V[18]=$=>m.value="list")},s.toDisplayString(s.unref(r)("sidebars.references.form.cancel")),1)])],32)])],64))]))}});function nt(e){this.content=e}nt.prototype={constructor:nt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),a=i.content.slice();return r==-1?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new nt(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new nt(n)},addToStart:function(e,t){return new nt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new nt(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),a=i.find(e);return r.splice(a==-1?r.length:a,0,t,n),new nt(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=nt.from(e),e.size?new nt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=nt.from(e),e.size?new nt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=nt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};nt.from=function(e){if(e instanceof nt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new nt(t)};function pf(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(i),a=t.child(i);if(r==a){n+=r.nodeSize;continue}if(!r.sameMarkup(a))return n;if(r.isText&&r.text!=a.text){let o=r.text,l=a.text,c=0;for(;o[c]==l[c];c++)n++;return c&&c<o.length&&c<l.length&&bf(o.charCodeAt(c-1))&&hf(o.charCodeAt(c))&&n--,n}if(r.content.size||a.content.size){let o=pf(r.content,a.content,n+1);if(o!=null)return o}n+=r.nodeSize}}function mf(e,t,n,i){for(let r=e.childCount,a=t.childCount;;){if(r==0||a==0)return r==a?null:{a:n,b:i};let o=e.child(--r),l=t.child(--a),c=o.nodeSize;if(o==l){n-=c,i-=c;continue}if(!o.sameMarkup(l))return{a:n,b:i};if(o.isText&&o.text!=l.text){let u=o.text,f=l.text,m=u.length,p=f.length;for(;m>0&&p>0&&u[m-1]==f[p-1];)m--,p--,n--,i--;return m&&p&&m<u.length&&bf(u.charCodeAt(m-1))&&hf(u.charCodeAt(m))&&(n++,i++),{a:n,b:i}}if(o.content.size||l.content.size){let u=mf(o.content,l.content,n-1,i-1);if(u)return u}n-=c,i-=c}}function hf(e){return e>=56320&&e<57344}function bf(e){return e>=55296&&e<56320}class J{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;i<t.length;i++)this.size+=t[i].nodeSize}nodesBetween(t,n,i,r=0,a){for(let o=0,l=0;l<n;o++){let c=this.content[o],u=l+c.nodeSize;if(u>t&&i(c,r+l,a||null,o)!==!1&&c.content.size){let f=l+1;c.nodesBetween(Math.max(0,t-f),Math.min(c.content.size,n-f),i,r+f)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,r){let a="",o=!0;return this.nodesBetween(t,n,(l,c)=>{let u=l.isText?l.text.slice(Math.max(t,c)-c,n-c):l.isLeaf?r?typeof r=="function"?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(o?o=!1:a+=i),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,r=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),a=1);a<t.content.length;a++)r.push(t.content[a]);return new J(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let i=[],r=0;if(n>t)for(let a=0,o=0;o<n;a++){let l=this.content[a],c=o+l.nodeSize;c>t&&((o<t||c>n)&&(l.isText?l=l.cut(Math.max(0,t-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,t-o-1),Math.min(l.content.size,n-o-1))),i.push(l),r+=l.nodeSize),o=c}return new J(i,r)}cutByIndex(t,n){return t==n?J.empty:t==0&&n==this.content.length?this:new J(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let r=this.content.slice(),a=this.size+n.nodeSize-i.nodeSize;return r[t]=n,new J(r,a)}addToStart(t){return new J([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new J(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,i=0;n<this.content.length;n++){let r=this.content[n];t(r,i,n),i+=r.nodeSize}}findDiffStart(t,n=0){return pf(this,t,n)}findDiffEnd(t,n=this.size,i=t.size){return mf(this,t,n,i)}findIndex(t){if(t==0)return ia(0,t);if(t==this.size)return ia(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let r=this.child(n),a=i+r.nodeSize;if(a>=t)return a==t?ia(n+1,a):ia(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return J.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return J.empty;let n,i=0;for(let r=0;r<t.length;r++){let a=t[r];i+=a.nodeSize,r&&a.isText&&t[r-1].sameMarkup(a)?(n||(n=t.slice(0,r)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new J(n||t,i)}static from(t){if(!t)return J.empty;if(t instanceof J)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new J([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Xo={index:0,offset:0};function ia(e,t){return Xo.index=e,Xo.offset=t,Xo}function Da(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!Da(e[i],t[i]))return!1}else{for(let i in e)if(!(i in t)||!Da(e[i],t[i]))return!1;for(let i in t)if(!(i in e))return!1}return!0}let ze=class Ps{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,i=!1;for(let r=0;r<t.length;r++){let a=t[r];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,r));else{if(a.type.excludes(this.type))return t;!i&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),i=!0),n&&n.push(a)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Da(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let i=t.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(n[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ps.none;if(t instanceof Ps)return[t];let n=t.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};ze.none=[];class hr extends Error{}class ae{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=vf(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new ae(i,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(gf(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(J.fromJSON(t,n.content),i,r)}static maxOpen(t,n=!0){let i=0,r=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)i++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new ae(t,i,r)}}ae.empty=new ae(J.empty,0,0);function gf(e,t,n){let{index:i,offset:r}=e.findIndex(t),a=e.maybeChild(i),{index:o,offset:l}=e.findIndex(n);if(r==t||a.isText){if(l!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(gf(a.content,t-r-1,n-r-1)))}function vf(e,t,n,i,r,a){let{index:o,offset:l}=e.findIndex(t),c=e.maybeChild(o);if(l==t||c.isText)return a&&i<=0&&r<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=vf(c.content,t-l-1,n,o==0?i-1:0,o==e.childCount-1?r-1:0,c);return u&&e.replaceChild(o,c.copy(u))}function hx(e,t,n){if(n.openStart>e.depth)throw new hr("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new hr("Inconsistent open depths");return xf(e,t,n,0)}function xf(e,t,n,i){let r=e.index(i),a=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){let o=xf(e,t,n,i+1);return a.copy(a.content.replaceChild(r,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==i&&t.depth==i){let o=e.parent,l=o.content;return ai(o,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:o,end:l}=bx(n,e);return ai(a,kf(e,o,l,t,i))}else return ai(a,za(e,t,i))}function yf(e,t){if(!t.type.compatibleContent(e.type))throw new hr("Cannot join "+t.type.name+" onto "+e.type.name)}function Fs(e,t,n){let i=e.node(n);return yf(i,t.node(n)),i}function ri(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function nr(e,t,n,i){let r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ri(e.nodeAfter,i),a++));for(let l=a;l<o;l++)ri(r.child(l),i);t&&t.depth==n&&t.textOffset&&ri(t.nodeBefore,i)}function ai(e,t){if(!e.type.validContent(t))throw new hr("Invalid content for node "+e.type.name);return e.copy(t)}function kf(e,t,n,i,r){let a=e.depth>r&&Fs(e,t,r+1),o=i.depth>r&&Fs(n,i,r+1),l=[];return nr(null,e,r,l),a&&o&&t.index(r)==n.index(r)?(yf(a,o),ri(ai(a,kf(e,t,n,i,r+1)),l)):(a&&ri(ai(a,za(e,t,r+1)),l),nr(t,n,r,l),o&&ri(ai(o,za(n,i,r+1)),l)),nr(i,null,r,l),new J(l)}function za(e,t,n){let i=[];if(nr(null,e,n,i),e.depth>n){let r=Fs(e,t,n+1);ri(ai(r,za(e,t,n+1)),i)}return nr(t,null,n,i),new J(i)}function bx(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)r=t.node(a).copy(J.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class br{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=t.child(n);return i?t.child(n).cut(i):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)r+=i.child(a).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return ze.none;if(this.textOffset)return t.child(n).marks;let i=t.maybeChild(n-1),r=t.maybeChild(n);if(!i){let l=i;i=r,r=l}let a=i.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!r||!a[o].isInSet(r.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=t.parent.maybeChild(t.index());for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);i>=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new Ia(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],r=0,a=n;for(let o=t;;){let{index:l,offset:c}=o.content.findIndex(a),u=a-c;if(i.push(o,l,r+c),!u||(o=o.child(l),o.isText))break;a=u-1,r+=c+1}return new br(n,i,a)}static resolveCached(t,n){let i=Xc.get(t);if(i)for(let a=0;a<i.elts.length;a++){let o=i.elts[a];if(o.pos==n)return o}else Xc.set(t,i=new gx);let r=i.elts[i.i]=br.resolve(t,n);return i.i=(i.i+1)%vx,r}}class gx{constructor(){this.elts=[],this.i=0}}const vx=12,Xc=new WeakMap;class Ia{constructor(t,n,i){this.$from=t,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const xx=Object.create(null);let oi=class Vs{constructor(t,n,i,r=ze.none){this.type=t,this.attrs=n,this.marks=r,this.content=i||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,i,r=0){this.content.nodesBetween(t,n,i,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,i,r){return this.content.textBetween(t,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,i){return this.type==t&&Da(this.attrs,n||t.defaultAttrs||xx)&&ze.sameSet(this.marks,i||ze.none)}copy(t=null){return t==this.content?this:new Vs(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Vs(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,i=!1){if(t==n)return ae.empty;let r=this.resolve(t),a=this.resolve(n),o=i?0:r.sharedDepth(n),l=r.start(o),u=r.node(o).content.cut(r.pos-l,a.pos-l);return new ae(u,r.depth-o,a.depth-o)}replace(t,n,i){return hx(this.resolve(t),this.resolve(n),i)}nodeAt(t){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(i),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:i}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(t);if(i<t)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(t){return br.resolveCached(this,t)}resolveNoCache(t){return br.resolve(this,t)}rangeHasMark(t,n,i){let r=!1;return n>t&&this.nodesBetween(t,n,a=>(i.isInSet(a.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),wf(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=J.empty,r=0,a=i.childCount){let o=this.contentMatchAt(t).matchFragment(i,r,a),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=r;c<a;c++)if(!this.type.allowsMarks(i.child(c).marks))return!1;return!0}canReplaceWith(t,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let a=this.contentMatchAt(t).matchType(i),o=a&&a.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=ze.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),t=i.addToSet(t)}if(!ze.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let r=J.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,r,i);return a.type.checkAttrs(a.attrs),a}};oi.prototype.text=void 0;class Ra extends oi{constructor(t,n,i,r){if(super(t,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Ra(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ra(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function wf(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ci{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new yx(t,n);if(i.next==null)return ci.empty;let r=_f(i);i.next&&i.err("Unexpected trailing text");let a=Ax(Ex(r));return Tx(a,i),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,i=t.childCount){let r=this;for(let a=n;r&&a<i;a++)r=r.matchType(t.child(a).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let i=0;i<t.next.length;i++)if(this.next[n].type==t.next[i].type)return!0;return!1}fillBefore(t,n=!1,i=0){let r=[this];function a(o,l){let c=o.matchFragment(t,i);if(c&&(!n||c.validEnd))return J.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:m}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(m)==-1){r.push(m);let p=a(m,l.concat(f));if(p)return p}}return null}return a(this,[])}findWrapping(t){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==t)return this.wrapCache[i+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),a=r.match;if(a.matchType(t)){let o=[];for(let l=r;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:l,next:c}=a.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!r.type||c.validEnd)&&(i.push({match:l.contentMatch,type:l,via:r}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let r=0;r<i.next.length;r++)t.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),t.map((i,r)=>{let a=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)a+=(o?", ":"")+i.next[o].type.name+"->"+t.indexOf(i.next[o].next);return a}).join(`
|
|
593
593
|
`)}}ci.empty=new ci(!0);class yx{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function _f(e){let t=[];do t.push(kx(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function kx(e){let t=[];do t.push(wx(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function wx(e){let t=Cx(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=_x(e,t);else break;return t}function Jc(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function _x(e,t){let n=Jc(e),i=n;return e.eat(",")&&(e.next!="}"?i=Jc(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Sx(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let r=[];for(let a in n){let o=n[a];o.isInGroup(t)&&r.push(o)}return r.length==0&&e.err("No node type or group '"+t+"' found"),r}function Cx(e){if(e.eat("(")){let t=_f(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Sx(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Ex(e){let t=[[]];return r(a(e,0),n()),t;function n(){return t.push([])-1}function i(o,l,c){let u={term:c,to:l};return t[o].push(u),u}function r(o,l){o.forEach(c=>c.to=l)}function a(o,l){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(a(u,l)),[]);if(o.type=="seq")for(let c=0;;c++){let u=a(o.exprs[c],l);if(c==o.exprs.length-1)return u;r(u,l=n())}else if(o.type=="star"){let c=n();return i(l,c),r(a(o.expr,c),c),[i(c)]}else if(o.type=="plus"){let c=n();return r(a(o.expr,l),c),r(a(o.expr,c),c),[i(c)]}else{if(o.type=="opt")return[i(l)].concat(a(o.expr,l));if(o.type=="range"){let c=l;for(let u=0;u<o.min;u++){let f=n();r(a(o.expr,c),f),c=f}if(o.max==-1)r(a(o.expr,c),c);else for(let u=o.min;u<o.max;u++){let f=n();i(c,f),r(a(o.expr,c),f),c=f}return[i(c)]}else{if(o.type=="name")return[i(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Sf(e,t){return t-e}function Zc(e,t){let n=[];return i(t),n.sort(Sf);function i(r){let a=e[r];if(a.length==1&&!a[0].term)return i(a[0].to);n.push(r);for(let o=0;o<a.length;o++){let{term:l,to:c}=a[o];!l&&n.indexOf(c)==-1&&i(c)}}}function Ax(e){let t=Object.create(null);return n(Zc(e,0));function n(i){let r=[];i.forEach(o=>{e[o].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let f=0;f<r.length;f++)r[f][0]==l&&(u=r[f][1]);Zc(e,c).forEach(f=>{u||r.push([l,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let a=t[i.join(",")]=new ci(i.indexOf(e.length-1)>-1);for(let o=0;o<r.length;o++){let l=r[o][1].sort(Sf);a.next.push({type:r[o][0],next:t[l.join(",")]||n(l)})}return a}}function Tx(e,t){for(let n=0,i=[e];n<i.length;n++){let r=i[n],a=!r.validEnd,o=[];for(let l=0;l<r.next.length;l++){let{type:c,next:u}=r.next[l];o.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),i.indexOf(u)==-1&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Cf(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function Ef(e,t){let n=Object.create(null);for(let i in e){let r=t&&t[i];if(r===void 0){let a=e[i];if(a.hasDefault)r=a.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function Af(e,t,n,i){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${i}`);for(let r in e)e[r].validate&&e[r].validate(t[r])}function Tf(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new Ox(e,i,t[i]);return n}let Qc=class Nf{constructor(t,n,i){this.name=t,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=Tf(t,i.attrs),this.defaultAttrs=Cf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ci.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Ef(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new oi(this,this.computeAttrs(t),J.from(n),ze.setFrom(i))}createChecked(t=null,n,i){return n=J.from(n),this.checkContent(n),new oi(this,this.computeAttrs(t),n,ze.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let r=this.contentMatch.matchFragment(n),a=r&&r.fillBefore(J.empty,!0);return a?new oi(this,t,n.append(a),ze.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i<t.childCount;i++)if(!this.allowsMarks(t.child(i).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Af(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let i=0;i<t.length;i++)this.allowsMarkType(t[i].type)?n&&n.push(t[i]):n||(n=t.slice(0,i));return n?n.length?n:ze.none:t}static compile(t,n){let i=Object.create(null);t.forEach((a,o)=>i[a]=new Nf(a,n,o));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Nx(e,t,n){let i=n.split("|");return r=>{let a=r===null?"null":typeof r;if(i.indexOf(a)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${a}`)}}class Ox{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Nx(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Co{constructor(t,n,i,r){this.name=t,this.rank=n,this.schema=i,this.spec=r,this.attrs=Tf(t,r.attrs),this.excluded=null;let a=Cf(this.attrs);this.instance=a?new ze(this,a):null}create(t=null){return!t&&this.instance?this.instance:new ze(this,Ef(this.attrs,t))}static compile(t,n){let i=Object.create(null),r=0;return t.forEach((a,o)=>i[a]=new Co(a,r++,n,o)),i}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Af(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Of{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=nt.from(t.nodes),n.marks=nt.from(t.marks||{}),this.nodes=Qc.compile(this.spec.nodes,this),this.marks=Co.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let a=this.nodes[r],o=a.spec.content||"",l=a.spec.marks;if(a.contentMatch=i[o]||(i[o]=ci.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=l=="_"?null:l?Yc(this,l.split(" ")):l==""||!a.inlineContent?[]:null}for(let r in this.marks){let a=this.marks[r],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:Yc(this,o.split(" "))}this.nodeFromJSON=r=>oi.fromJSON(this,r),this.markFromJSON=r=>ze.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Qc){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,r)}text(t,n){let i=this.nodes.text;return new Ra(i,i.defaultAttrs,t,ze.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Yc(e,t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],a=e.marks[r],o=a;if(a)n.push(a);else for(let l in e.marks){let c=e.marks[l];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&n.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function Mx(e){return e.tag!=null}function Dx(e){return e.style!=null}let ir=class Us{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(Mx(r))this.tags.push(r);else if(Dx(r)){let a=/[^=]*/.exec(r.style)[0];i.indexOf(a)<0&&i.push(a),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let a=t.nodes[r.node];return a.contentMatch.matchType(a)})}parse(t,n={}){let i=new tu(this,n,!1);return i.addAll(t,ze.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new tu(this,n,!0);return i.addAll(t,ze.none,n.from,n.to),ae.maxOpen(i.finish())}matchTag(t,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let a=this.tags[r];if(Rx(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(t);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(t,n,i,r){for(let a=r?this.styles.indexOf(r)+1:0;a<this.styles.length;a++){let o=this.styles[a],l=o.style;if(!(l.indexOf(t)!=0||o.context&&!i.matchesContext(o.context)||l.length>t.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(o.getAttrs){let c=o.getAttrs(n);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(t){let n=[];function i(r){let a=r.priority==null?50:r.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<a)break}n.splice(o,0,r)}for(let r in t.marks){let a=t.marks[r].spec.parseDOM;a&&a.forEach(o=>{i(o=nu(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in t.nodes){let a=t.nodes[r].spec.parseDOM;a&&a.forEach(o=>{i(o=nu(o)),o.node||o.ignore||o.mark||(o.node=r)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Us(t,Us.schemaRules(t)))}};const Mf={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Df={ol:!0,ul:!0},gr=1,Hs=2,rr=4;function eu(e,t,n){return t!=null?(t?gr:0)|(t==="full"?Hs:0):e&&e.whitespace=="pre"?gr|Hs:n&~rr}class ra{constructor(t,n,i,r,a,o){this.type=t,this.attrs=n,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=ze.none,this.match=a||(o&rr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(t.type))?(this.match=i,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&gr)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let a=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-r[0].length))}}let n=J.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Mf.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class tu{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,a,o=eu(null,n.preserveWhitespace,0)|(i?rr:0);r?a=new ra(r.type,r.attrs,ze.none,!0,n.topMatch||r.type.contentMatch,o):i?a=new ra(null,null,ze.none,!0,null,o):a=new ra(t.schema.topNodeType,null,ze.none,!0,null,o),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,r=this.top,a=r.options&Hs?"full":this.localPreserveWS||(r.options&gr)>0,{schema:o}=this.parser;if(a==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(a)if(a==="full")i=i.replace(/\r\n?/g,`
|
|
594
594
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[c]&&this.insertNode(o.text(l[c]),n,!/\S/.test(l[c]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=r.content[r.content.length-1],c=t.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),n,!/\S/.test(i)),this.findInText(t)}else this.findInside(t)}addElement(t,n,i){let r=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),l;Df.hasOwnProperty(o)&&this.parser.normalizeLists&&Ix(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,i));e:if(c?c.ignore:zx.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let u,f=this.needsBlock;if(Mf.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let m=c&&c.skip?n:this.readStyles(t,n);m&&this.addAll(t,m),u&&this.sync(a),this.needsBlock=f}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,c,u,c.consuming===!1?l:void 0)}this.localPreserveWS=r}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
595
|
-
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let i=t.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let a=this.parser.matchedStyles[r],o=i.getPropertyValue(a);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(a,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,i,r){let a,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let c=this.enter(o,n.attrs||null,i,n.preserveWhitespace);c&&(a=!0,i=c)}else{let c=this.parser.schema.marks[n.mark];i=i.concat(c.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,i,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,i),this.findAround(t,c,!1)}a&&this.sync(l)&&this.open--}addAll(t,n,i,r){let a=i||0;for(let o=i?t.childNodes[i]:t.firstChild,l=r==null?null:t.childNodes[r];o!=l;o=o.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(o,n);this.findAtPoint(t,a)}findPlace(t,n,i){let r,a;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(t);if(u&&(!r||r.length>u.length+l)&&(r=u,a=c,!u.length))break;if(c.solid){if(i)break;l+=2}}if(!r)return null;this.sync(a);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n,i){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let r=this.findPlace(t,n,i);if(r){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let o=ze.none;for(let l of r.concat(t.marks))(a.type?a.type.allowsMarkType(l.type):iu(l.type,t.type))&&(o=l.addToSet(o));return a.content.push(t.mark(o)),!0}return!1}enter(t,n,i,r){let a=this.findPlace(t.create(n),i,!1);return a&&(a=this.enterInner(t,n,i,!0,r)),a}enterInner(t,n,i,r=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let l=eu(t,a,o.options);o.options&rr&&o.content.length==0&&(l|=rr);let c=ze.none;return i=i.filter(u=>(o.type?o.type.allowsMarkType(u.type):iu(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new ra(t,n,c,r,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=gr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)t+=i[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==t&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,i){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=(l,c)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;c>=a;c--)if(o(l-1,c))return!0;return!1}else{let f=c>0||c==0&&r?this.nodes[c].type:i&&c>=a?i.node(c-a).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function Ix(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Df.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function Rx(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function nu(e){let t={};for(let n in e)t[n]=e[n];return t}function iu(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let a=[],o=l=>{a.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:f}=l.edge(c);if(u==t||a.indexOf(f)<0&&o(f))return!0}};if(o(r.contentMatch))return!0}}class Ri{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},i){i||(i=aa(n).createDocumentFragment());let r=i,a=[];return t.forEach(o=>{if(a.length||o.marks.length){let l=0,c=0;for(;l<a.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(a[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<a.length;)r=a.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],f=this.serializeMark(u,o.isInline,n);f&&(a.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(o,n))}),i}serializeNodeInner(t,n){if(t.isText)return aa(n).createTextNode(t.text);let{dom:i,contentDOM:r}=ka(aa(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return i}serializeNode(t,n={}){let i=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let a=this.serializeMark(t.marks[r],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(i),i=a.dom)}return i}serializeMark(t,n,i={}){let r=this.marks[t.type.name];return r&&ka(aa(i),r(t,n),null,t.attrs)}static renderSpec(t,n,i=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:ka(t,n,i,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ri(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=ru(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return ru(t.marks)}}function ru(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function aa(e){return e.document||window.document}const au=new WeakMap;function Lx(e){let t=au.get(e);return t===void 0&&au.set(e,t=Bx(e)),t}function Bx(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(e),t}function ka(e,t,n,i){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let r=t[0],a;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(a=Lx(i))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));let l,c=n?e.createElementNS(n,r):e.createElement(r),u=t[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let m in u)if(u[m]!=null){let p=m.indexOf(" ");p>0?c.setAttributeNS(m.slice(0,p),m.slice(p+1),u[m]):m=="style"&&c.style?c.style.cssText=u[m]:c.setAttribute(m,u[m])}}for(let m=f;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof p=="string")c.appendChild(e.createTextNode(p));else{let{dom:h,contentDOM:g}=ka(e,p,n,i);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}function zf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={PROCESSOR_VERSION:"1.4.61",error:function(e){throw typeof Error>"u"?new Error("citeproc-js error: "+e):"citeproc-js error: "+e},debug:function(e){typeof console>"u"?dump("CSL: "+e+`
|
|
595
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let i=t.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let a=this.parser.matchedStyles[r],o=i.getPropertyValue(a);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(a,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,i,r){let a,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let c=this.enter(o,n.attrs||null,i,n.preserveWhitespace);c&&(a=!0,i=c)}else{let c=this.parser.schema.marks[n.mark];i=i.concat(c.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,i,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,i),this.findAround(t,c,!1)}a&&this.sync(l)&&this.open--}addAll(t,n,i,r){let a=i||0;for(let o=i?t.childNodes[i]:t.firstChild,l=r==null?null:t.childNodes[r];o!=l;o=o.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(o,n);this.findAtPoint(t,a)}findPlace(t,n,i){let r,a;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(t);if(u&&(!r||r.length>u.length+l)&&(r=u,a=c,!u.length))break;if(c.solid){if(i)break;l+=2}}if(!r)return null;this.sync(a);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n,i){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let r=this.findPlace(t,n,i);if(r){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let o=ze.none;for(let l of r.concat(t.marks))(a.type?a.type.allowsMarkType(l.type):iu(l.type,t.type))&&(o=l.addToSet(o));return a.content.push(t.mark(o)),!0}return!1}enter(t,n,i,r){let a=this.findPlace(t.create(n),i,!1);return a&&(a=this.enterInner(t,n,i,!0,r)),a}enterInner(t,n,i,r=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let l=eu(t,a,o.options);o.options&rr&&o.content.length==0&&(l|=rr);let c=ze.none;return i=i.filter(u=>(o.type?o.type.allowsMarkType(u.type):iu(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new ra(t,n,c,r,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=gr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)t+=i[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==t&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,i){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=(l,c)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;c>=a;c--)if(o(l-1,c))return!0;return!1}else{let f=c>0||c==0&&r?this.nodes[c].type:i&&c>=a?i.node(c-a).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function Ix(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Df.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function Rx(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function nu(e){let t={};for(let n in e)t[n]=e[n];return t}function iu(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let a=[],o=l=>{a.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:f}=l.edge(c);if(u==t||a.indexOf(f)<0&&o(f))return!0}};if(o(r.contentMatch))return!0}}class Ri{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},i){i||(i=aa(n).createDocumentFragment());let r=i,a=[];return t.forEach(o=>{if(a.length||o.marks.length){let l=0,c=0;for(;l<a.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(a[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<a.length;)r=a.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],f=this.serializeMark(u,o.isInline,n);f&&(a.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(o,n))}),i}serializeNodeInner(t,n){if(t.isText)return aa(n).createTextNode(t.text);let{dom:i,contentDOM:r}=ka(aa(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return i}serializeNode(t,n={}){let i=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let a=this.serializeMark(t.marks[r],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(i),i=a.dom)}return i}serializeMark(t,n,i={}){let r=this.marks[t.type.name];return r&&ka(aa(i),r(t,n),null,t.attrs)}static renderSpec(t,n,i=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:ka(t,n,i,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ri(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=ru(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return ru(t.marks)}}function ru(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function aa(e){return e.document||window.document}const au=new WeakMap;function Lx(e){let t=au.get(e);return t===void 0&&au.set(e,t=Bx(e)),t}function Bx(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(e),t}function ka(e,t,n,i){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let r=t[0],a;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(a=Lx(i))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));let l,c=n?e.createElementNS(n,r):e.createElement(r),u=t[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let m in u)if(u[m]!=null){let p=m.indexOf(" ");p>0?c.setAttributeNS(m.slice(0,p),m.slice(p+1),u[m]):m=="style"&&c.style?c.style.cssText=u[m]:c.setAttribute(m,u[m])}}for(let m=f;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof p=="string")c.appendChild(e.createTextNode(p));else{let{dom:h,contentDOM:g}=ka(e,p,n,i);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const zf=65535,If=Math.pow(2,16);function Px(e,t){return e+t*If}function ou(e){return e&zf}function Fx(e){return(e-(e&zf))/If}const Rf=1,Lf=2,wa=4,Bf=8;class qs{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&Bf)>0}get deletedBefore(){return(this.delInfo&(Rf|wa))>0}get deletedAfter(){return(this.delInfo&(Lf|wa))>0}get deletedAcross(){return(this.delInfo&wa)>0}}class Tt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Tt.empty)return Tt.empty}recover(t){let n=0,i=ou(t);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+Fx(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,i){let r=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[l+a],f=this.ranges[l+o],m=c+u;if(t<=m){let p=u?t==c?-1:t==m?1:n:n,h=c+r+(p<0?0:f);if(i)return h;let g=t==(n<0?c:m)?null:Px(l/3,t-c),b=t==c?Lf:t==m?Rf:wa;return(n<0?t!=c:t!=m)&&(b|=Bf),new qs(h,b,g)}r+=f-u}return i?t+r:new qs(t+r,0,null)}touches(t,n){let i=0,r=ou(n),a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[l+a],f=c+u;if(t<=f&&l==r*3)return!0;i+=this.ranges[l+o]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,a=0;r<this.ranges.length;r+=3){let o=this.ranges[r],l=o-(this.inverted?a:0),c=o+(this.inverted?0:a),u=this.ranges[r+n],f=this.ranges[r+i];t(l,l+u,c,c+f),a+=f-u}}invert(){return new Tt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Tt.empty:new Tt(t<0?[0,-t,0]:[0,0,t])}}Tt.empty=new Tt([]);class La{constructor(t,n,i=0,r=t?t.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new La(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,i=this._maps.length;n<t._maps.length;n++){let r=t.getMirror(n);this.appendMap(t._maps[n],r!=null&&r<n?i+r:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,i=this._maps.length+t._maps.length;n>=0;n--){let r=t.getMirror(n);this.appendMap(t._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let t=new La;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;i<this.to;i++)t=this._maps[i].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,i){let r=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],l=o.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(a);if(c!=null&&c>a&&c<this.to){a=c,t=this._maps[c].recover(l.recover);continue}}r|=l.delInfo,t=l.pos}return i?t:new qs(t,r,null)}}const Jo=Object.create(null);class ut{getMap(){return Tt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=Jo[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Jo)throw new RangeError("Duplicate use of step JSON ID "+t);return Jo[t]=n,n.prototype.jsonID=t,n}}class We{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new We(t,null)}static fail(t){return new We(null,t)}static fromReplace(t,n,i,r){try{return We.ok(t.replace(n,i,r))}catch(a){if(a instanceof hr)return We.fail(a.message);throw a}}}function Ol(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let a=e.child(r);a.content.size&&(a=a.copy(Ol(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return J.fromArray(i)}class In extends ut{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=t.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new ae(Ol(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),r),n.openStart,n.openEnd);return We.fromReplace(t,this.from,this.to,a)}invert(){return new Jt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new In(n.pos,i.pos,this.mark)}merge(t){return t instanceof In&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new In(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new In(n.from,n.to,t.markFromJSON(n.mark))}}ut.jsonID("addMark",In);class Jt extends ut{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new ae(Ol(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return We.fromReplace(t,this.from,this.to,i)}invert(){return new In(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Jt(n.pos,i.pos,this.mark)}merge(t){return t instanceof Jt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Jt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jt(n.from,n.to,t.markFromJSON(n.mark))}}ut.jsonID("removeMark",Jt);class Rn extends ut{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new Rn(this.pos,n.marks[r]);return new Rn(this.pos,this.mark)}}return new ui(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Rn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Rn(n.pos,t.markFromJSON(n.mark))}}ut.jsonID("addNodeMark",Rn);class ui extends ut{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Rn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ui(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ui(n.pos,t.markFromJSON(n.mark))}}ut.jsonID("removeNodeMark",ui);class qe extends ut{constructor(t,n,i,r=!1){super(),this.from=t,this.to=n,this.slice=i,this.structure=r}apply(t){return this.structure&&js(t,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tt([this.from,this.to-this.from,this.slice.size])}invert(t){return new qe(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),i=this.from==this.to&&qe.MAP_BIAS<0?n:t.mapResult(this.from,1);return i.deletedAcross&&n.deletedAcross?null:new qe(i.pos,Math.max(i.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof qe)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new qe(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new qe(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qe(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}qe.MAP_BIAS=1;ut.jsonID("replace",qe);class Ke extends ut{constructor(t,n,i,r,a,o,l=!1){super(),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=l}apply(t){if(this.structure&&(js(t,this.from,this.gapFrom)||js(t,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return We.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?We.fromReplace(t,this.from,this.to,i):We.fail("Content does not fit in gap")}getMap(){return new Tt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?i.pos:t.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||a>i.pos?null:new Ke(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}ut.jsonID("replaceAround",Ke);function js(e,t,n){let i=e.resolve(t),r=n-t,a=i.depth;for(;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0){let o=i.node(a).maybeChild(i.indexAfter(a));for(;r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}}return!1}function Vx(e,t,n,i){let r=[],a=[],o,l;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let m=c.marks;if(!i.isInSet(m)&&f.type.allowsMarkType(i.type)){let p=Math.max(u,t),h=Math.min(u+c.nodeSize,n),g=i.addToSet(m);for(let b=0;b<m.length;b++)m[b].isInSet(g)||(o&&o.to==p&&o.mark.eq(m[b])?o.to=h:r.push(o=new Jt(p,h,m[b])));l&&l.to==p?l.to=h:a.push(l=new In(p,h,i))}}),r.forEach(c=>e.step(c)),a.forEach(c=>e.step(c))}function Ux(e,t,n,i){let r=[],a=0;e.doc.nodesBetween(t,n,(o,l)=>{if(!o.isInline)return;a++;let c=null;if(i instanceof Co){let u=o.marks,f;for(;f=i.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else i?i.isInSet(o.marks)&&(c=[i]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,n);for(let f=0;f<c.length;f++){let m=c[f],p;for(let h=0;h<r.length;h++){let g=r[h];g.step==a-1&&m.eq(r[h].style)&&(p=g)}p?(p.to=u,p.step=a):r.push({style:m,from:Math.max(l,t),to:u,step:a})}}}),r.forEach(o=>e.step(new Jt(o.from,o.to,o.style)))}function Ml(e,t,n,i=n.contentMatch,r=!0){let a=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c<a.childCount;c++){let u=a.child(c),f=l+u.nodeSize,m=i.matchType(u.type);if(!m)o.push(new qe(l,f,ae.empty));else{i=m;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new Jt(l,f,u.marks[p]));if(r&&u.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,g;for(;p=h.exec(u.text);)g||(g=new ae(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new qe(l+p.index,l+p.index+p[0].length,g))}}l=f}if(!i.validEnd){let c=i.fillBefore(J.empty,!0);e.replace(l,l,new ae(c,0,0))}for(let c=o.length-1;c>=0;c--)e.step(o[c])}function Hx(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Li(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,r=0,a=0;;--i){let o=e.$from.node(i),l=e.$from.index(i)+r,c=e.$to.indexAfter(i)-a;if(i<e.depth&&o.canReplace(l,c,n))return i;if(i==0||o.type.spec.isolating||!Hx(o,l,c))break;l&&(r=1),c<o.childCount&&(a=1)}return null}function qx(e,t,n){let{$from:i,$to:r,depth:a}=t,o=i.before(a+1),l=r.after(a+1),c=o,u=l,f=J.empty,m=0;for(let g=a,b=!1;g>n;g--)b||i.index(g)>0?(b=!0,f=J.from(i.node(g).copy(f)),m++):c--;let p=J.empty,h=0;for(let g=a,b=!1;g>n;g--)b||r.after(g+1)<r.end(g)?(b=!0,p=J.from(r.node(g).copy(p)),h++):u++;e.step(new Ke(c,u,o,l,new ae(f.append(p),m,h),f.size-m,!0))}function Dl(e,t,n=null,i=e){let r=jx(e,t),a=r&&$x(i,t);return a?r.map(su).concat({type:t,attrs:n}).concat(a.map(su)):null}function su(e){return{type:e,attrs:null}}function jx(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.contentMatchAt(i).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(i,r,o)?a:null}function $x(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.child(i),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let c=(o.length?o[o.length-1]:t).contentMatch;for(let u=i;c&&u<r;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:o}function Wx(e,t,n){let i=J.empty;for(let o=n.length-1;o>=0;o--){if(i.size){let l=n[o].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=J.from(n[o].type.create(n[o].attrs,i))}let r=t.start,a=t.end;e.step(new Ke(r,a,r,a,new ae(i,0,0),n.length,!0))}function Gx(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(o,l)=>{let c=typeof r=="function"?r(o):r;if(o.isTextblock&&!o.hasMarkup(i,c)&&Kx(e.doc,e.mapping.slice(a).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",g=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!g?u=!1:!h&&g&&(u=!0)}u===!1&&Ff(e,o,l,a),Ml(e,e.mapping.slice(a).map(l,1),i,void 0,u===null);let f=e.mapping.slice(a),m=f.map(l,1),p=f.map(l+o.nodeSize,1);return e.step(new Ke(m,p,m+1,p-1,new ae(J.from(i.create(c,null,o.marks)),0,0),1,!0)),u===!0&&Pf(e,o,l,a),!1}})}function Pf(e,t,n,i){t.forEach((r,a)=>{if(r.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(r.text);){let c=e.mapping.slice(i).map(n+1+a+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function Ff(e,t,n,i){t.forEach((r,a)=>{if(r.type==r.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(n+1+a);e.replaceWith(o,o+1,t.type.schema.text(`
|
|
596
|
+
`))}})}function Kx(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function Xx(e,t,n,i,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let o=n.create(i,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ke(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(J.from(o),0,0),1,!0))}function vn(e,t,n=1,i){let r=e.resolve(t),a=r.depth-n,o=i&&i[i.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!o.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=n-2;u>a;u--,f--){let m=r.node(u),p=r.index(u);if(m.type.spec.isolating)return!1;let h=m.content.cutByIndex(p,m.childCount),g=i&&i[f+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=i&&i[f]||m;if(!m.canReplace(p+1,m.childCount)||!b.type.validContent(h))return!1}let l=r.indexAfter(a),c=i&&i[0];return r.node(a).canReplaceWith(l,l,c?c.type:r.node(a+1).type)}function Jx(e,t,n=1,i){let r=e.doc.resolve(t),a=J.empty,o=J.empty;for(let l=r.depth,c=r.depth-n,u=n-1;l>c;l--,u--){a=J.from(r.node(l).copy(a));let f=i&&i[u];o=J.from(f?f.type.create(f.attrs,o):r.node(l).copy(o))}e.step(new qe(t,t,new ae(a.append(o),n,n),!0))}function Un(e,t){let n=e.resolve(t),i=n.index();return Vf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Zx(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),o=a.type==i?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Vf(e,t){return!!(e&&t&&!e.isLeaf&&Zx(e,t))}function Eo(e,t,n=-1){let i=e.resolve(t);for(let r=i.depth;;r--){let a,o,l=i.index(r);if(r==i.depth?(a=i.nodeBefore,o=i.nodeAfter):n>0?(a=i.node(r+1),l++,o=i.node(r).maybeChild(l)):(a=i.node(r).maybeChild(l-1),o=i.node(r+1)),a&&!a.isTextblock&&Vf(a,o)&&i.node(r).canReplace(l,l+1))return t;if(r==0)break;t=n<0?i.before(r):i.after(r)}}function Qx(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(r&&o.inlineContent){let f=o.whitespace=="pre",m=!!o.contentMatch.matchType(r);f&&!m?i=!1:!f&&m&&(i=!0)}let l=e.steps.length;if(i===!1){let f=e.doc.resolve(t+n);Ff(e,f.node(),f.before(),l)}o.inlineContent&&Ml(e,t+n-1,o,a.node().contentMatchAt(a.index()),i==null);let c=e.mapping.slice(l),u=c.map(t-n);if(e.step(new qe(u,c.map(t+n,-1),ae.empty,!0)),i===!0){let f=e.doc.resolve(u);Pf(e,f.node(),f.before(),e.steps.length)}return e}function Yx(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let a=i.indexAfter(r);if(i.node(r).canReplaceWith(a,a,n))return i.after(r+1);if(a<i.node(r).childCount)return null}return null}function ey(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let o=i.depth;o>=0;o--){let l=o==i.depth?0:i.pos<=(i.start(o+1)+i.end(o+1))/2?-1:1,c=i.index(o)+(l>0?1:0),u=i.node(o),f=!1;if(a==1)f=u.canReplace(c,c,r);else{let m=u.contentMatchAt(c).findWrapping(r.firstChild.type);f=m&&u.canReplaceWith(c,c,m[0])}if(f)return l==0?i.pos:l<0?i.before(o+1):i.after(o+1)}return null}function Ao(e,t,n=t,i=ae.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),a=e.resolve(n);return Uf(r,a,i)?new qe(t,n,i):new ty(r,a,i).fit()}function Uf(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ty{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=J.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=J.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;let a=this.placed,o=i.depth,l=r.depth;for(;o&&l&&a.childCount==1;)a=a.firstChild.content,o--,l--;let c=new ae(a,o,l);return t>-1?new Ke(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new qe(i.pos,r.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<t;i++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=i){t=i;break}n=a.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let r,a=null;i?(a=Zo(this.unplaced.content,i-1).firstChild,r=a.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],f,m=null;if(n==1&&(o?u.matchType(o.type)||(m=u.fillBefore(J.from(o),!1)):a&&c.compatibleContent(a.type)))return{sliceDepth:i,frontierDepth:l,parent:a,inject:m};if(n==2&&o&&(f=u.findWrapping(o.type)))return{sliceDepth:i,frontierDepth:l,parent:a,wrap:f};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=Zo(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=Zo(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(Yi(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new ae(Yi(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let b=0;b<a.length;b++)this.openFrontierNode(a[b]);let o=this.unplaced,l=i?i.content:o.content,c=o.openStart-t,u=0,f=[],{match:m,type:p}=this.frontier[n];if(r){for(let b=0;b<r.childCount;b++)f.push(r.child(b));m=m.matchFragment(r)}let h=l.size+t-(o.content.size-o.openEnd);for(;u<l.childCount;){let b=l.child(u),x=m.matchType(b.type);if(!x)break;u++,(u>1||c==0||b.content.size)&&(m=x,f.push(Hf(b.mark(p.allowedMarks(b.marks)),u==1?c:0,u==l.childCount?h:-1)))}let g=u==l.childCount;g||(h=-1),this.placed=er(this.placed,n,J.from(f)),this.frontier[n].match=m,g&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=l;b<h;b++){let v=x.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),x=v.content}this.unplaced=g?t==0?ae.empty:new ae(Yi(o.content,t-1,1),t-1,h<0?o.openEnd:t-1):new ae(Yi(o.content,t,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Qo(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=Qo(t,n,r,i,a);if(o){for(let l=n-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],f=Qo(t,l,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:o,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=er(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let r=t.node(i),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(i));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=er(this.placed,this.depth,J.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=er(this.placed,this.frontier.length,n))}}function Yi(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Yi(e.firstChild.content,t-1,n)))}function er(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(er(e.lastChild.content,t-1,n)))}function Zo(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Hf(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,Hf(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(J.empty,!0)))),e.copy(i)}function Qo(e,t,n,i,r){let a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let l=i.fillBefore(a.content,!0,o);return l&&!ny(n,a.content,o)?l:null}function ny(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}function iy(e){return e.spec.defining||e.spec.definingForContent}function ry(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(Uf(r,a,i))return e.step(new qe(t,n,i));let o=jf(r,a);o[o.length-1]==0&&o.pop();let l=-(r.depth+1);o.unshift(l);for(let p=r.depth,h=r.pos-1;p>0;p--,h--){let g=r.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?l=p:r.before(p)==h&&o.splice(1,0,-p)}let c=o.indexOf(l),u=[],f=i.openStart;for(let p=i.content,h=0;;h++){let g=p.firstChild;if(u.push(g),h==i.openStart)break;p=g.content}for(let p=f-1;p>=0;p--){let h=u[p],g=iy(h.type);if(g&&!h.sameMarkup(r.node(Math.abs(l)-1)))f=p;else if(g||!h.type.isTextblock)break}for(let p=i.openStart;p>=0;p--){let h=(p+f+1)%(i.openStart+1),g=u[h];if(g)for(let b=0;b<o.length;b++){let x=o[(b+c)%o.length],v=!0;x<0&&(v=!1,x=-x);let y=r.node(x-1),k=r.index(x-1);if(y.canReplaceWith(k,k,g.type,g.marks))return e.replace(r.before(x),v?a.after(x):n,new ae(qf(i.content,0,i.openStart,h),h,i.openEnd))}}let m=e.steps.length;for(let p=o.length-1;p>=0&&(e.replace(t,n,i),!(e.steps.length>m));p--){let h=o[p];h<0||(t=r.before(h),n=a.after(h))}}function qf(e,t,n,i,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(qf(a.content,t+1,n,i,a)))}if(t>i){let a=r.contentMatchAt(0),o=a.fillBefore(e).append(e);e=o.append(a.matchFragment(o).fillBefore(J.empty,!0))}return e}function ay(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=Yx(e.doc,t,i.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(J.from(i),0,0))}function oy(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let o=i.sharedDepth(n),l=!1;for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);for(let c=r.depth;c>o;c--)r.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);for(let c=r.depth;c>0&&n==r.start(c);c--)n=r.before(c);i=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=jf(i,r);for(let o=0;o<a.length;o++){let l=a[o],c=o==a.length-1;if(c&&l==0||i.node(l).type.contentMatch.validEnd)return e.delete(i.start(l),r.end(l));if(l>0&&(c||i.node(l-1).canReplace(i.index(l-1),r.indexAfter(l-1))))return e.delete(i.before(l),r.after(l))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}function jf(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let r=i;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Ai extends ut{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at attribute step's position");let i=Object.create(null);for(let a in n.attrs)i[a]=n.attrs[a];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(r),0,n.isLeaf?0:1))}getMap(){return Tt.empty}invert(t){return new Ai(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ai(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ai(n.pos,n.attr,n.value)}}ut.jsonID("attr",Ai);class vr extends ut{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return We.ok(i)}getMap(){return Tt.empty}invert(t){return new vr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vr(n.attr,n.value)}}ut.jsonID("docAttr",vr);let Ni=class extends Error{};Ni=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ni.prototype=Object.create(Error.prototype);Ni.prototype.constructor=Ni;Ni.prototype.name="TransformError";class $f{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new La}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ni(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,o,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=ae.empty){let r=Ao(this.doc,t,n,i);return r&&this.step(r),this}replaceWith(t,n,i){return this.replace(t,n,new ae(J.from(i),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return ry(this,t,n,i),this}replaceRangeWith(t,n,i){return ay(this,t,n,i),this}deleteRange(t,n){return oy(this,t,n),this}lift(t,n){return qx(this,t,n),this}join(t,n=1){return Qx(this,t,n),this}wrap(t,n){return Wx(this,t,n),this}setBlockType(t,n=t,i,r=null){return Gx(this,t,n,i,r),this}setNodeMarkup(t,n,i=null,r){return Xx(this,t,n,i,r),this}setNodeAttribute(t,n,i){return this.step(new Ai(t,n,i)),this}setDocAttribute(t,n){return this.step(new vr(t,n)),this}addNodeMark(t,n){return this.step(new Rn(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof ze)n.isInSet(i.marks)&&this.step(new ui(t,n));else{let r=i.marks,a,o=[];for(;a=n.isInSet(r);)o.push(new ui(t,a)),r=a.removeFromSet(r);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,n=1,i){return Jx(this,t,n,i),this}addMark(t,n,i){return Vx(this,t,n,i),this}removeMark(t,n,i){return Ux(this,t,n,i),this}clearIncompatible(t,n,i){return Ml(this,t,n,i),this}}const Yo=Object.create(null);class ge{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Wf(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let i=n.content.lastChild,r=null;for(let l=0;l<n.openEnd;l++)r=i,i=i.lastChild;let a=t.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:u}=o[l],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(u.pos),l?ae.empty:n),l==0&&uu(t,a,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let i=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:o,$to:l}=r[a],c=t.mapping.slice(i),u=c.map(o.pos),f=c.map(l.pos);a?t.deleteRange(u,f):(t.replaceRangeWith(u,f,n),uu(t,i,n.isInline?-1:1))}}static findFrom(t,n,i=!1){let r=t.parent.inlineContent?new he(t):Si(t.node(0),t.parent,t.pos,t.index(),n,i);if(r)return r;for(let a=t.depth-1;a>=0;a--){let o=n<0?Si(t.node(0),t.node(a),t.before(a+1),t.index(a),n,i):Si(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,i);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ot(t.node(0))}static atStart(t){return Si(t,t,0,0,1)||new Ot(t)}static atEnd(t){return Si(t,t,t.content.size,t.childCount,-1)||new Ot(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Yo[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Yo)throw new RangeError("Duplicate use of selection JSON ID "+t);return Yo[t]=n,n.prototype.jsonID=t,n}getBookmark(){return he.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class Wf{constructor(t,n){this.$from=t,this.$to=n}}let lu=!1;function cu(e){!lu&&!e.parent.inlineContent&&(lu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class he extends ge{constructor(t,n=t){cu(t),cu(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return ge.near(i);let r=t.resolve(n.map(this.anchor));return new he(r.parent.inlineContent?r:i,i)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof he&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new To(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new he(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let r=t.resolve(n);return new this(r,i==n?r:t.resolve(i))}static between(t,n,i){let r=t.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let a=ge.findFrom(n,i,!0)||ge.findFrom(n,-i,!0);if(a)n=a.$head;else return ge.near(n,i)}return t.parent.inlineContent||(r==0?t=n:(t=(ge.findFrom(t,-i,!0)||ge.findFrom(t,i,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new he(t,n)}}ge.jsonID("text",he);class To{constructor(t,n){this.anchor=t,this.head=n}map(t){return new To(t.map(this.anchor),t.map(this.head))}resolve(t){return he.between(t.resolve(this.anchor),t.resolve(this.head))}}class pe extends ge{constructor(t){let n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);super(t,i),this.node=n}map(t,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return i?ge.near(a):new pe(a)}content(){return new ae(J.from(this.node),0,0)}eq(t){return t instanceof pe&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zl(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(t.resolve(n.anchor))}static create(t,n){return new pe(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}pe.prototype.visible=!1;ge.jsonID("node",pe);class zl{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:i}=t.mapResult(this.anchor);return n?new To(i,i):new zl(i)}resolve(t){let n=t.resolve(this.anchor),i=n.nodeAfter;return i&&pe.isSelectable(i)?new pe(n):ge.near(n)}}class Ot extends ge{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let i=ge.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ot(t)}map(t){return new Ot(t)}eq(t){return t instanceof Ot}getBookmark(){return sy}}ge.jsonID("all",Ot);const sy={map(){return this},resolve(e){return new Ot(e)}};function Si(e,t,n,i,r,a=!1){if(t.inlineContent)return he.create(e,n);for(let o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){let l=t.child(o);if(l.isAtom){if(!a&&pe.isSelectable(l))return pe.create(e,n-(r<0?l.nodeSize:0))}else{let c=Si(e,l,n+r,r<0?l.childCount:0,r,a);if(c)return c}n+=l.nodeSize*r}return null}function uu(e,t,n){let i=e.steps.length-1;if(i<t)return;let r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;let a=e.mapping.maps[i],o;a.forEach((l,c,u,f)=>{o==null&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}function du(e,t){return!t||!e?e:e.bind(t)}class oa{constructor(t,n,i){this.name=t,this.init=du(n.init,i),this.apply=du(n.apply,i)}}new oa("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new oa("selection",{init(e,t){return e.selection||ge.atStart(t.doc)},apply(e){return e.selection}}),new oa("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new oa("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function Gf(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):i=="handleDOMEvents"&&(r=Gf(r,t,{})),n[i]=r}return n}class dt{constructor(t){this.spec=t,this.props={},t.props&&Gf(t.props,this,this.props),this.key=t.key?t.key.key:Kf("plugin")}getState(t){return t[this.key]}}const es=Object.create(null);function Kf(e){return e in es?e+"$"+ ++es[e]:(es[e]=0,e+"$")}class at{constructor(t="key"){this.key=Kf(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const pi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Xf=function(e,t,n,i){return n&&(fu(e,t,n,i,-1)||fu(e,t,n,i,1))},ly=/^(img|br|input|textarea|hr)$/i;function fu(e,t,n,i,r){for(var a;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Ba(e))){let o=e.parentNode;if(!o||o.nodeType!=1||Il(e)||ly.test(e.nodeName)||e.contentEditable=="false")return!1;t=pi(e)+(r<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(r<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=o,t=r<0?Ba(e):0}else return!1}}function Ba(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cy(e,t,n){for(let i=t==0,r=t==Ba(e);i||r;){if(e==n)return!0;let a=pi(e);if(e=e.parentNode,!e)return!1;i=i&&a==0,r=r&&a==Ba(e)}}function Il(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Jf=function(e){return e.focusNode&&Xf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Zf(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Yt=typeof navigator<"u"?navigator:null,pu=typeof document<"u"?document:null,Hn=Yt&&Yt.userAgent||"",$s=/Edge\/(\d+)/.exec(Hn),Qf=/MSIE \d/.exec(Hn),Ws=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hn),Nr=!!(Qf||Ws||$s),Yf=Qf?document.documentMode:Ws?+Ws[1]:$s?+$s[1]:0,No=!Nr&&/gecko\/(\d+)/i.test(Hn);No&&+(/Firefox\/(\d+)/.exec(Hn)||[0,0])[1];const Gs=!Nr&&/Chrome\/(\d+)/.exec(Hn),xn=!!Gs,ep=Gs?+Gs[1]:0,mi=!Nr&&!!Yt&&/Apple Computer/.test(Yt.vendor),Rl=mi&&(/Mobile\/\w+/.test(Hn)||!!Yt&&Yt.maxTouchPoints>2),Lt=Rl||(Yt?/Mac/.test(Yt.platform):!1),tp=Yt?/Win/.test(Yt.platform):!1,Or=/Android \d/.test(Hn),Ll=!!pu&&"webkitFontSmoothing"in pu.documentElement.style,uy=Ll?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function dy(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=i.resolve(o),c,u;if(Jf(n)){for(c=o;r&&!r.node;)r=r.parent;let m=r.node;if(r&&m.isAtom&&pe.isSelectable(m)&&r.parent&&!(m.isInline&&cy(n.focusNode,n.focusOffset,r.dom))){let p=r.posBefore;u=new pe(o==p?l:i.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=o,p=o;for(let h=0;h<n.rangeCount;h++){let g=n.getRangeAt(h);m=Math.min(m,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(m<0)return null;[c,o]=p==e.state.selection.anchor?[p,m]:[m,p],l=i.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let f=i.resolve(c);if(!u){let m=t=="pointer"||e.state.selection.head<l.pos&&!a?1:-1;u=ip(e,f,l,m)}return u}function np(e){return e.editable?e.hasFocus():hy(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Bl(e,t=!1){let n=e.state.selection;if(my(e,n),!np(e))return;let i=e.input.mouseDown;if(!t&&xn&&i){let r=e.domSelectionRange(),a=e.domObserver.currentSelection;if(r.anchorNode&&a.anchorNode&&Xf(r.anchorNode,r.anchorOffset,a.anchorNode,a.anchorOffset)&&i.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)py(e);else{let{anchor:r,head:a}=n,o,l;mu&&!(n instanceof he)&&(n.$from.parent.inlineContent||(o=hu(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=hu(e,n.to))),e.docView.setSelection(r,a,e,t),mu&&(o&&bu(o),l&&bu(l)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&fy(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const mu=mi||xn&&ep<63;function hu(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,a=i?n.childNodes[i-1]:null;if(mi&&r&&r.contentEditable=="false")return ts(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return ts(r);if(a)return ts(a)}}function ts(e){return e.contentEditable="true",mi&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function bu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function fy(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!np(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function py(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.collapse(n.parentNode,pi(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&Nr&&Yf<=11&&(n.disabled=!0,n.disabled=!1)}function my(e,t){if(t instanceof pe){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(gu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else gu(e)}function gu(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ip(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||he.between(t,n,i)}function hy(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Ks(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&ge.findFrom(a,t)}function Tn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function vu(e,t,n){let i=e.state.selection;if(i instanceof he)if(n.indexOf("s")>-1){let{$head:r}=i,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return Tn(e,new he(i.$anchor,o))}else if(i.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=Ks(e.state,t);return r&&r instanceof pe?Tn(e,r):!1}else if(!(Lt&&n.indexOf("m")>-1)){let r=i.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,o;if(!a||a.isText)return!1;let l=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?pe.isSelectable(a)?Tn(e,new pe(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Ll?Tn(e,new he(e.state.doc.resolve(t<0?l:l+a.nodeSize))):!1:!1}}else return!1;else{if(i instanceof pe&&i.node.isInline)return Tn(e,new he(t>0?i.$to:i.$from));{let r=Ks(e.state,t);return r?Tn(e,r):!1}}}function Pa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ar(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ki(e,t){return t<0?by(e):gy(e)}function by(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,a,o=!1;for(No&&n.nodeType==1&&i<Pa(n)&&ar(n.childNodes[i],-1)&&(o=!0);;)if(i>0){if(n.nodeType!=1)break;{let l=n.childNodes[i-1];if(ar(l,-1))r=n,a=--i;else if(l.nodeType==3)n=l,i=n.nodeValue.length;else break}}else{if(rp(n))break;{let l=n.previousSibling;for(;l&&ar(l,-1);)r=n.parentNode,a=pi(l),l=l.previousSibling;if(l)n=l,i=Pa(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}o?Xs(e,n,i):r&&Xs(e,r,a)}function gy(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r=Pa(n),a,o;for(;;)if(i<r){if(n.nodeType!=1)break;let l=n.childNodes[i];if(ar(l,1))a=n,o=++i;else break}else{if(rp(n))break;{let l=n.nextSibling;for(;l&&ar(l,1);)a=l.parentNode,o=pi(l)+1,l=l.nextSibling;if(l)n=l,i=0,r=Pa(n);else{if(n=n.parentNode,n==e.dom)break;i=r=0}}}a&&Xs(e,a,o)}function rp(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function vy(e,t){for(;e&&t==e.childNodes.length&&!Il(e);)t=pi(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function xy(e,t){for(;e&&!t&&!Il(e);)t=pi(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Xs(e,t,n){if(t.nodeType!=3){let a,o;(o=vy(t,n))?(t=o,n=0):(a=xy(t,n))&&(t=a,n=a.nodeValue.length)}let i=e.domSelection();if(!i)return;if(Jf(i)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&Bl(e)},50)}function xu(e,t){let n=e.state.doc.resolve(t);if(!(xn||tp)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function yu(e,t,n){let i=e.state.selection;if(i instanceof he&&!i.empty||n.indexOf("s")>-1||Lt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=Ks(e.state,t);if(o&&o instanceof pe)return Tn(e,o)}if(!r.parent.inlineContent){let o=t<0?r:a,l=i instanceof Ot?ge.near(o,t):ge.findFrom(o,t);return l?Tn(e,l):!1}return!1}function ku(e,t){if(!(e.state.selection instanceof he))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let o=e.state.tr;return t<0?o.delete(n.pos-a.nodeSize,n.pos):o.delete(n.pos,n.pos+a.nodeSize),e.dispatch(o),!0}return!1}function wu(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function yy(e){if(!mi||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let i=t.firstChild;wu(e,i,"true"),setTimeout(()=>wu(e,i,"false"),20)}return!1}function ky(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function wy(e,t){let n=t.keyCode,i=ky(t);if(n==8||Lt&&n==72&&i=="c")return ku(e,-1)||ki(e,-1);if(n==46&&!t.shiftKey||Lt&&n==68&&i=="c")return ku(e,1)||ki(e,1);if(n==13||n==27)return!0;if(n==37||Lt&&n==66&&i=="c"){let r=n==37?xu(e,e.state.selection.from)=="ltr"?-1:1:-1;return vu(e,r,i)||ki(e,r)}else if(n==39||Lt&&n==70&&i=="c"){let r=n==39?xu(e,e.state.selection.from)=="ltr"?1:-1:1;return vu(e,r,i)||ki(e,r)}else{if(n==38||Lt&&n==80&&i=="c")return yu(e,-1,i)||ki(e,-1);if(n==40||Lt&&n==78&&i=="c")return yy(e)||yu(e,1,i)||ki(e,1);if(i==(Lt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ap(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:i,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,a--;let h=i.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),i=h.content}let o=e.someProp("clipboardSerializer")||Ri.fromSchema(e.state.schema),l=dp(),c=l.createElement("div");c.appendChild(o.serializeFragment(i,{document:l}));let u=c.firstChild,f,m=0;for(;u&&u.nodeType==1&&(f=up[u.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let g=l.createElement(f[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),m++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${m?` -${m}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
|
|
597
|
+
|
|
598
|
+
`);return{dom:c,text:p,slice:t}}function op(e,t,n,i,r){let a=r.parent.type.spec.code,o,l;if(!n&&!t)return null;let c=!!t&&(i||a||!n);if(c){if(e.someProp("transformPastedText",p=>{t=p(t,a||i,e)}),a)return l=new ae(J.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
599
|
+
`))),0,0),e.someProp("transformPasted",p=>{l=p(l,e,!0)}),l;let m=e.someProp("clipboardTextParser",p=>p(t,r,i,e));if(m)l=m;else{let p=r.marks(),{schema:h}=e.state,g=Ri.fromSchema(h);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let x=o.appendChild(document.createElement("p"));b&&x.appendChild(g.serializeNode(h.text(b,p)))})}}else e.someProp("transformPastedHTML",m=>{n=m(n,e)}),o=Ey(n),Ll&&Ay(o);let u=o&&o.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let m=+f[3];m>0;m--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||ir.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!_y.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)l=Ty(_u(l,+f[1],+f[2]),f[4]);else if(l=ae.maxOpen(Sy(l.content,r),!0),l.openStart||l.openEnd){let m=0,p=0;for(let h=l.content.firstChild;m<l.openStart&&!h.type.spec.isolating;m++,h=h.firstChild);for(let h=l.content.lastChild;p<l.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);l=_u(l,m,p)}return e.someProp("transformPasted",m=>{l=m(l,e,c)}),l}const _y=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Sy(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,o=[];if(e.forEach(l=>{if(!o)return;let c=r.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&a.length&&lp(c,a,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=cp(o[o.length-1],a.length));let f=sp(l,c);o.push(f),r=r.matchType(f.type),a=c}}),o)return J.from(o)}return e}function sp(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,J.from(e));return e}function lp(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=lp(e,t,n,i.lastChild,r+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(J.from(sp(n,e,r+1))))}}function cp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,cp(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(J.empty,!0);return e.copy(n.append(i))}function Js(e,t,n,i,r,a){let o=t<0?e.firstChild:e.lastChild,l=o.content;return e.childCount>1&&(a=0),r<i-1&&(l=Js(l,t,n,i,r+1,a)),r>=n&&(l=t<0?o.contentMatchAt(0).fillBefore(l,a<=r).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function _u(e,t,n){return t<e.openStart&&(e=new ae(Js(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(Js(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const up={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Su=null;function dp(){return Su||(Su=document.implementation.createHTMLDocument("title"))}let ns=null;function Cy(e){let t=window.trustedTypes;return t?(ns||(ns=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),ns.createHTML(e)):e}function Ey(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=dp().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e),r;if((r=i&&up[i[1].toLowerCase()])&&(e=r.map(a=>"<"+a+">").join("")+e+r.map(a=>"</"+a+">").reverse().join("")),n.innerHTML=Cy(e),r)for(let a=0;a<r.length;a++)n=n.querySelector(r[a])||n;return n}function Ay(e){let t=e.querySelectorAll(xn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}function Ty(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:o}=e;for(let l=i.length-2;l>=0;l-=2){let c=n.nodes[i[l]];if(!c||c.hasRequiredAttrs())break;r=J.from(c.create(i[l+1],r)),a++,o++}return new ae(r,a,o)}const jt={},Mt={};function gn(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Mt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!hp(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Or&&xn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Rl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",r=>r(e,Zf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||wy(e,n)?n.preventDefault():gn(e,"key")};Mt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Mt.keypress=(e,t)=>{let n=t;if(hp(e)||!n.charCode||n.ctrlKey&&!n.altKey||Lt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof he)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",o=>o(e,i.$from.pos,i.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function Mr(e){return{left:e.clientX,top:e.clientY}}function Ny(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function Pl(e,t,n,i,r){if(i==-1)return!1;let a=e.state.doc.resolve(i);for(let o=a.depth+1;o>0;o--)if(e.someProp(t,l=>o>a.depth?l(e,n,a.nodeAfter,a.before(o),r,!0):l(e,n,a.node(o),a.before(o),r,!1)))return!0;return!1}function Dr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function Oy(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&pe.isSelectable(i)?(Dr(e,new pe(n)),!0):!1}function My(e,t){if(t==-1)return!1;let n=e.state.selection,i,r;n instanceof pe&&(i=n.node);let a=e.state.doc.resolve(t);for(let o=a.depth+1;o>0;o--){let l=o>a.depth?a.nodeAfter:a.node(o);if(pe.isSelectable(l)){i&&n.$from.depth>0&&o>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(o);break}}return r!=null?(Dr(e,pe.create(e.state.doc,r)),!0):!1}function Dy(e,t,n,i,r){return Pl(e,"handleClickOn",t,n,i)||e.someProp("handleClick",a=>a(e,t,i))||(r?My(e,n):Oy(e,n))}function zy(e,t,n,i){return Pl(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",r=>r(e,t,i))}function Iy(e,t,n,i){return Pl(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",r=>r(e,t,i))||Ry(e,n,i)}function Ry(e,t,n){if(n.button!=0)return!1;let i=fp(e,t,!0),r=e.state.doc;return i?(Dr(e,i),i instanceof he&&r.eq(e.state.doc)&&(e.input.mouseDown=new By(e,i)),!0):!1}function fp(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?he.create(i,0,i.content.size):null;let r=i.resolve(t);for(let a=r.depth+1;a>0;a--){let o=a>r.depth?r.nodeAfter:r.node(a),l=r.before(a);if(o.inlineContent)return he.create(i,l+1,l+1+o.content.size);if(n&&pe.isSelectable(o))return pe.create(i,l)}return null}function Fl(e){return Fa(e)}const pp=Lt?"metaKey":"ctrlKey";jt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Fl(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&Ny(n,e.input.lastClick)&&!n[pp]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Mr(n));o&&(a=="singleClick"?e.input.mouseDown=new Ly(e,o,n,!!i):(a=="doubleClick"?zy:Iy)(e,o.pos,o.inside,n)?n.preventDefault():gn(e,"pointer"))};class mp{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Ly extends mp{constructor(t,n,i,r){super(t),this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[pp],this.allowDefault=i.shiftKey;let a,o;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),o=n.inside;else{let f=t.state.doc.resolve(n.pos);a=f.parent,o=f.depth?f.before():0}const l=r?null:i.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof pe&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&No&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),gn(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Bl(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Mr(t))),this.updateAllowDefault(t),this.allowDefault||!n?gn(this.view,"pointer"):Dy(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||mi&&this.mightDrag&&!this.mightDrag.node.isAtom||xn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Dr(this.view,ge.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):gn(this.view,"pointer")}move(t){this.updateAllowDefault(t),gn(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class By extends mp{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),gn(this.view,"pointer");let n=this.view.posAtCoords(Mr(t)),i=n&&fp(this.view,n.inside,!1);if(!i)return;let{doc:r}=this.view.state,a=this.startSelection,[o,l]=i.from<a.from?[a.to,i.from]:[a.from,i.to];Dr(this.view,he.create(r,o,l))}}jt.touchstart=e=>{e.input.lastTouch=Date.now(),Fl(e),gn(e,"pointer")};jt.touchmove=e=>{e.input.lastTouch=Date.now(),gn(e,"pointer")};jt.contextmenu=e=>Fl(e);function hp(e,t){return e.composing?!0:mi&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Py=Or?5e3:-1;Mt.compositionstart=Mt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof he&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||xn&&tp&&Fy(e)))e.markCursor=e.state.storedMarks||n.marks(),Fa(e,!0),e.markCursor=null;else if(Fa(e,!t.selection.empty),No&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let r=i.focusNode,a=i.focusOffset;r&&r.nodeType==1&&a!=0;){let o=a<0?r.lastChild:r.childNodes[a-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else r=o,a=-1}}e.input.composing=!0}bp(e,Py)};function Fy(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Mt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,bp(e,20))};function bp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Fa(e),t))}function Vy(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Fa(e,t=!1){if(!(Or&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Vy(e),t||e.docView&&e.docView.dirty){let n=dy(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Uy(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const xr=Nr&&Yf<15||Rl&&uy<604;jt.copy=Mt.cut=(e,t)=>{let n=t,i=e.state.selection,r=n.type=="cut";if(i.empty)return;let a=xr?null:n.clipboardData,o=i.content(),{dom:l,text:c}=ap(e,o);a?(n.preventDefault(),a.clearData(),a.setData("text/html",l.innerHTML),a.setData("text/plain",c)):Uy(e,l),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Hy(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function qy(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Zs(e,i.value,null,r,t):Zs(e,i.textContent,i.innerHTML,r,t)},50)}function Zs(e,t,n,i,r){let a=op(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,r,a||ae.empty)))return!0;if(!a)return!1;let o=Hy(a),l=o?e.state.tr.replaceSelectionWith(o,i):e.state.tr.replaceSelection(a);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function gp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Mt.paste=(e,t)=>{let n=t;if(e.composing&&!Or)return;let i=xr?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&Zs(e,gp(i),i.getData("text/html"),r,n)?n.preventDefault():qy(e,n)};class jy{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const $y=Lt?"altKey":"ctrlKey";function vp(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[$y]}jt.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(Mr(n)),o;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof pe?r.to-1:r.to))){if(i&&i.mightDrag)o=pe.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=e.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=e.docView&&(o=pe.create(e.state.doc,m.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:u,slice:f}=ap(e,l);(!n.dataTransfer.files.length||!xn||ep>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xr?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",xr||n.dataTransfer.setData("text/plain",u),e.dragging=new jy(f,vp(e,n),o)};jt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Mt.dragover=Mt.dragenter=(e,t)=>t.preventDefault();Mt.drop=(e,t)=>{try{Wy(e,t,e.dragging)}finally{e.dragging=null}};function Wy(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Mr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=op(e,gp(t.dataTransfer),xr?null:t.dataTransfer.getData("text/html"),!1,r);let o=!!(n&&vp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let l=a?ey(e.state.doc,r.pos,a):r.pos;l==null&&(l=r.pos);let c=e.state.tr;if(o){let{node:h}=n;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,m=c.doc;if(f?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(m))return;let p=c.doc.resolve(u);if(f&&pe.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new pe(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,x,v)=>h=v),c.setSelection(ip(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}jt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Bl(e)},20))};jt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};jt.beforeinput=(e,t)=>{if(xn&&Or&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,Zf(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Mt)jt[e]=Mt[e];function yr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Va{constructor(t,n){this.toDOM=t,this.spec=n||si,this.side=this.spec.side||0}map(t,n,i,r){let{pos:a,deleted:o}=t.mapResult(n.from+r,this.side<0?-1:1);return o?null:new ot(a-i,a-i,this)}valid(){return!0}eq(t){return this==t||t instanceof Va&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&yr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pn{constructor(t,n){this.attrs=t,this.spec=n||si}map(t,n,i,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,o=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return a>=o?null:new ot(a,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Pn&&yr(this.attrs,t.attrs)&&yr(this.spec,t.spec)}static is(t){return t.type instanceof Pn}destroy(){}}class Vl{constructor(t,n){this.attrs=t,this.spec=n||si}map(t,n,i,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let o=t.mapResult(n.to+r,-1);return o.deleted||o.pos<=a.pos?null:new ot(a.pos-i,o.pos-i,this)}valid(t,n){let{index:i,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(i)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof Vl&&yr(this.attrs,t.attrs)&&yr(this.spec,t.spec)}destroy(){}}class ot{constructor(t,n,i){this.from=t,this.to=n,this.type=i}copy(t,n){return new ot(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,i){return this.type.map(t,this,n,i)}static widget(t,n,i){return new ot(t,t,new Va(n,i))}static inline(t,n,i,r){return new ot(t,n,new Pn(i,r))}static node(t,n,i,r){return new ot(t,n,new Vl(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pn}get widget(){return this.type instanceof Va}}const Ci=[],si={};class Ve{constructor(t,n){this.local=t.length?t:Ci,this.children=n.length?n:Ci}static create(t,n){return n.length?Ua(n,t,0,si):bt}find(t,n,i){let r=[];return this.findInner(t??0,n??1e9,r,0,i),r}findInner(t,n,i,r,a){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=t&&(!a||a(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let l=this.children[o]+1;this.children[o+2].findInner(t-l,n-l,i,r+l,a)}}map(t,n,i){return this==bt||t.maps.length==0?this:this.mapInner(t,n,0,0,i||si)}mapInner(t,n,i,r,a){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,i,r);c&&c.type.valid(n,c)?(o||(o=[])).push(c):a.onRemove&&a.onRemove(this.local[l].spec)}return this.children.length?Gy(this.children,o||[],t,n,i,r,a):o?new Ve(o.sort(li),Ci):bt}add(t,n){return n.length?this==bt?Ve.create(t,n):this.addInner(t,n,0):this}addInner(t,n,i){let r,a=0;t.forEach((l,c)=>{let u=c+i,f;if(f=yp(n,l,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<c;)a+=3;r[a]==c?r[a+2]=r[a+2].addInner(l,f,u+1):r.splice(a,0,c,c+l.nodeSize,Ua(f,l,u+1,si)),a+=3}});let o=xp(a?kp(n):n,-i);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||o.splice(l--,1);return new Ve(o.length?this.local.concat(o).sort(li):this.local,r||this.children)}remove(t){return t.length==0||this==bt?this:this.removeInner(t,0)}removeInner(t,n){let i=this.children,r=this.local;for(let a=0;a<i.length;a+=3){let o,l=i[a]+n,c=i[a+1]+n;for(let f=0,m;f<t.length;f++)(m=t[f])&&m.from>l&&m.to<c&&(t[f]=null,(o||(o=[])).push(m));if(!o)continue;i==this.children&&(i=this.children.slice());let u=i[a+2].removeInner(o,l+1);u!=bt?i[a+2]=u:(i.splice(a,3),a-=3)}if(r.length){for(let a=0,o;a<t.length;a++)if(o=t[a])for(let l=0;l<r.length;l++)r[l].eq(o,n)&&(r==this.local&&(r=this.local.slice()),r.splice(l--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new Ve(r,i):bt}forChild(t,n){if(this==bt)return this;if(n.isLeaf)return Ve.empty;let i,r;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(i=this.children[l+2]);break}let a=t+1,o=a+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>a&&c.type instanceof Pn){let u=Math.max(a,c.from)-a,f=Math.min(o,c.to)-a;u<f&&(r||(r=[])).push(c.copy(u,f))}}if(r){let l=new Ve(r.sort(li),Ci);return i?new Yn([l,i]):l}return i||bt}eq(t){if(this==t)return!0;if(!(t instanceof Ve)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return Ul(this.localsInner(t))}localsInner(t){if(this==bt)return Ci;if(t.inlineContent||!this.local.some(Pn.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Pn||n.push(this.local[i]);return n}forEachSet(t){t(this)}}Ve.empty=new Ve([],[]);Ve.removeOverlap=Ul;const bt=Ve.empty;class Yn{constructor(t){this.members=t}map(t,n){const i=this.members.map(r=>r.map(t,n,si));return Yn.from(i)}forChild(t,n){if(n.isLeaf)return Ve.empty;let i=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=bt&&(a instanceof Yn?i=i.concat(a.members):i.push(a))}return Yn.from(i)}eq(t){if(!(t instanceof Yn)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,i=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{i&&(n=n.slice(),i=!1);for(let o=0;o<a.length;o++)n.push(a[o])}}return n?Ul(i?n:n.sort(li)):Ci}static from(t){switch(t.length){case 0:return bt;case 1:return t[0];default:return new Yn(t.every(n=>n instanceof Ve)?t:t.reduce((n,i)=>n.concat(i instanceof Ve?i:i.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Gy(e,t,n,i,r,a,o){let l=e.slice();for(let u=0,f=a;u<n.maps.length;u++){let m=0;n.maps[u].forEach((p,h,g,b)=>{let x=b-g-(h-p);for(let v=0;v<l.length;v+=3){let y=l[v+1];if(y<0||p>y+f-m)continue;let k=l[v]+f-m;h>=k?l[v+1]=p<=k?-2:-1:p>=f&&x&&(l[v]+=x,l[v+1]+=x)}m+=x}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){c=!0,l[u+1]=-1;continue}let f=n.map(e[u]+a),m=f-r;if(m<0||m>=i.content.size){c=!0;continue}let p=n.map(e[u+1]+a,-1),h=p-r,{index:g,offset:b}=i.content.findIndex(m),x=i.maybeChild(g);if(x&&b==m&&b+x.nodeSize==h){let v=l[u+2].mapInner(n,x,f+1,e[u]+a+1,o);v!=bt?(l[u]=m,l[u+1]=h,l[u+2]=v):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=Ky(l,e,t,n,r,a,o),f=Ua(u,i,0,o);t=f.local;for(let m=0;m<l.length;m+=3)l[m+1]<0&&(l.splice(m,3),m-=3);for(let m=0,p=0;m<f.children.length;m+=3){let h=f.children[m];for(;p<l.length&&l[p]<h;)p+=3;l.splice(p,0,f.children[m],f.children[m+1],f.children[m+2])}}return new Ve(t.sort(li),l)}function xp(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new ot(r.from+t,r.to+t,r.type))}return n}function Ky(e,t,n,i,r,a,o){function l(c,u){for(let f=0;f<c.local.length;f++){let m=c.local[f].map(i,r,u);m?n.push(m):o.onRemove&&o.onRemove(c.local[f].spec)}for(let f=0;f<c.children.length;f+=3)l(c.children[f+2],c.children[f]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+a+1);return n}function yp(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let a=0,o;a<e.length;a++)(o=e[a])&&o.from>n&&o.to<i&&((r||(r=[])).push(o),e[a]=null);return r}function kp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Ua(e,t,n,i){let r=[],a=!1;t.forEach((l,c)=>{let u=yp(e,l,c+n);if(u){a=!0;let f=Ua(u,l,n+c+1,i);f!=bt&&r.push(c,c+l.nodeSize,f)}});let o=xp(a?kp(e):e,-n).sort(li);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(i.onRemove&&i.onRemove(o[l].spec),o.splice(l--,1));return o.length||r.length?new Ve(o,r):bt}function li(e,t){return e.from-t.from||e.to-t.to}function Ul(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==i.from){a.to!=i.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,i.to),Cu(t,r+1,a.copy(i.to,a.to)));continue}else{a.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,a.from),Cu(t,r,i.copy(a.from,i.to)));break}}}return t}function Cu(e,t,n){for(;t<e.length&&li(n,e[t])>0;)t++;e.splice(t,0,n)}var Fn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ha={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Xy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Jy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var it=0;it<10;it++)Fn[48+it]=Fn[96+it]=String(it);for(var it=1;it<=24;it++)Fn[it+111]="F"+it;for(var it=65;it<=90;it++)Fn[it]=String.fromCharCode(it+32),Ha[it]=String.fromCharCode(it);for(var is in Fn)Ha.hasOwnProperty(is)||(Ha[is]=Fn[is]);function Zy(e){var t=Xy&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Jy&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ha:Fn)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Qy=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Yy=typeof navigator<"u"&&/Win/.test(navigator.platform);function ek(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))Qy?o=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),o&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function tk(e){let t=Object.create(null);for(let n in e)t[ek(n)]=e[n];return t}function rs(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function nk(e){let t=tk(e);return function(n,i){let r=Zy(i),a,o=t[rs(r,i)];if(o&&o(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let l=t[rs(r,i,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(Yy&&i.ctrlKey&&i.altKey)&&(a=Fn[i.keyCode])&&a!=r){let l=t[rs(a,i)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Hl=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function wp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const _p=(e,t,n)=>{let i=wp(e,n);if(!i)return!1;let r=ql(i);if(!r){let o=i.blockRange(),l=o&&Li(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let a=r.nodeBefore;if(Dp(e,r,t,-1))return!0;if(i.parent.content.size==0&&(Oi(a,"end")||pe.isSelectable(a)))for(let o=i.depth;;o--){let l=Ao(e.doc,i.before(o),i.after(o),ae.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(Oi(a,"end")?ge.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):pe.create(c.doc,r.pos-a.nodeSize)),t(c.scrollIntoView())}return!0}if(o==1||i.node(o-1).childCount>1)break}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},ik=(e,t,n)=>{let i=wp(e,n);if(!i)return!1;let r=ql(i);return r?Sp(e,r,t):!1},rk=(e,t,n)=>{let i=Ep(e,n);if(!i)return!1;let r=jl(i);return r?Sp(e,r,t):!1};function Sp(e,t,n){let i=t.nodeBefore,r=i,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let u=Ao(e.doc,a,c,ae.empty);if(!u||u.from!=a||u instanceof qe&&u.slice.size>=c-a)return!1;if(n){let f=e.tr.step(u);f.setSelection(he.create(f.doc,a)),n(f.scrollIntoView())}return!0}function Oi(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const Cp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;a=ql(i)}let o=a&&a.nodeBefore;return!o||!pe.isSelectable(o)?!1:(t&&t(e.tr.setSelection(pe.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function ql(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ep(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Ap=(e,t,n)=>{let i=Ep(e,n);if(!i)return!1;let r=jl(i);if(!r)return!1;let a=r.nodeAfter;if(Dp(e,r,t,1))return!0;if(i.parent.content.size==0&&(Oi(a,"start")||pe.isSelectable(a))){let o=Ao(e.doc,i.before(),i.after(),ae.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(Oi(a,"start")?ge.findFrom(l.doc.resolve(l.mapping.map(r.pos)),1):pe.create(l.doc,l.mapping.map(r.pos))),t(l.scrollIntoView())}return!0}}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},Tp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;a=jl(i)}let o=a&&a.nodeAfter;return!o||!pe.isSelectable(o)?!1:(t&&t(e.tr.setSelection(pe.create(e.doc,a.pos)).scrollIntoView()),!0)};function jl(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const ak=(e,t)=>{let n=e.selection,i=n instanceof pe,r;if(i){if(n.node.isTextblock||!Un(e.doc,n.from))return!1;r=n.from}else if(r=Eo(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);i&&a.setSelection(pe.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},ok=(e,t)=>{let n=e.selection,i;if(n instanceof pe){if(n.node.isTextblock||!Un(e.doc,n.to))return!1;i=n.to}else if(i=Eo(e.doc,n.to,1),i==null)return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},sk=(e,t)=>{let{$from:n,$to:i}=e.selection,r=n.blockRange(i),a=r&&Li(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},Np=(e,t)=>{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(`
|
|
600
|
+
`).scrollIntoView()),!0)};function $l(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const lk=(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),a=n.indexAfter(-1),o=$l(r.contentMatchAt(a));if(!o||!r.canReplaceWith(a,a,o))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(ge.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},Op=(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof Ot||i.parent.inlineContent||r.parent.inlineContent)return!1;let a=$l(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let o=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,l=e.tr.insert(o,a.createAndFill());l.setSelection(he.create(l.doc,o+1)),t(l.scrollIntoView())}return!0},Mp=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(vn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let i=n.blockRange(),r=i&&Li(i);return r==null?!1:(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)};function ck(e){return(t,n)=>{let{$from:i,$to:r}=t.selection;if(t.selection instanceof pe&&t.selection.node.isBlock)return!i.parentOffset||!vn(t.doc,i.pos)?!1:(n&&n(t.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let a=[],o,l,c=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){c=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),l=$l(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),a.unshift(c&&l?{type:l}:null),o=h;break}else{if(h==1)return!1;a.unshift(null)}let f=t.tr;(t.selection instanceof he||t.selection instanceof Ot)&&f.deleteSelection();let m=f.mapping.map(i.pos),p=vn(f.doc,m,a.length,a);if(p||(a[0]=l?{type:l}:null,p=vn(f.doc,m,a.length,a)),!p)return!1;if(f.split(m,a.length,a),!c&&u&&i.node(o).type!=l){let h=f.mapping.map(i.before(o)),g=f.doc.resolve(h);l&&i.node(o-1).canReplaceWith(g.index(),g.index()+1,l)&&f.setNodeMarkup(f.mapping.map(i.before(o)),l)}return n&&n(f.scrollIntoView()),!0}}const uk=ck(),dk=(e,t)=>{let{$from:n,to:i}=e.selection,r,a=n.sharedDepth(i);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(pe.create(e.doc,r))),!0)};function fk(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,a=t.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Un(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Dp(e,t,n,i){let r=t.nodeBefore,a=t.nodeAfter,o,l,c=r.type.spec.isolating||a.type.spec.isolating;if(!c&&fk(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&l.matchType(o[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,g=J.empty;for(let v=o.length-1;v>=0;v--)g=J.from(o[v].create(null,g));g=J.from(r.copy(g));let b=e.tr.step(new Ke(t.pos-1,h,t.pos,h,new ae(g,1,0),o.length,!0)),x=b.doc.resolve(h+2*o.length);x.nodeAfter&&x.nodeAfter.type==r.type&&Un(b.doc,x.pos)&&b.join(x.pos),n(b.scrollIntoView())}return!0}let f=a.type.spec.isolating||i>0&&c?null:ge.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),p=m&&Li(m);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(m,p).scrollIntoView()),!0;if(u&&Oi(a,"start",!0)&&Oi(r,"end")){let h=r,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=a,x=1;for(;!b.isTextblock;b=b.firstChild)x++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let v=J.empty;for(let k=g.length-1;k>=0;k--)v=J.from(g[k].copy(v));let y=e.tr.step(new Ke(t.pos-g.length,t.pos+a.nodeSize,t.pos+x,t.pos+a.nodeSize-x,new ae(v,g.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function zp(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(he.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const pk=zp(-1),mk=zp(1);function hk(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a),l=o&&Dl(o,e,t);return l?(i&&i(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Eu(e,t=null){return function(n,i){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[a];n.doc.nodesBetween(o,l,(c,u)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)r=!0;else{let f=n.doc.resolve(u),m=f.index();r=f.parent.canReplaceWith(m,m+1,e)}})}if(!r)return!1;if(i){let a=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];a.setBlockType(l,c,e,t)}i(a.scrollIntoView())}return!0}}function Wl(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}Wl(Hl,_p,Cp);Wl(Hl,Ap,Tp);Wl(Np,Op,Mp,uk);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function bk(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a);if(!o)return!1;let l=i?n.tr:null;return gk(l,o,e,t)?(i&&i(l.scrollIntoView()),!0):!1}}function gk(e,t,n,i=null){let r=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);a=new Ia(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new Ia(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let l=Dl(a,n,i,t);return l?(e&&vk(e,t,l,r,n),!0):!1}function vk(e,t,n,i,r){let a=J.empty;for(let f=n.length-1;f>=0;f--)a=J.from(n[f].type.create(n[f].attrs,a));e.step(new Ke(t.start-(i?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let o=0;for(let f=0;f<n.length;f++)n[f].type==r&&(o=f+1);let l=n.length-o,c=t.start+n.length-(i?2:0),u=t.parent;for(let f=t.startIndex,m=t.endIndex,p=!0;f<m;f++,p=!1)!p&&vn(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=u.child(f).nodeSize;return e}function xk(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==e);return a?n?i.node(a.depth-1).type==e?yk(t,n,e,a):kk(t,n,a):!0:!1}}function yk(e,t,n,i){let r=e.tr,a=i.end,o=i.$to.end(i.depth);a<o&&(r.step(new Ke(a-1,o,a,o,new ae(J.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new Ia(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=Li(i);if(l==null)return!1;r.lift(i,l);let c=r.doc.resolve(r.mapping.map(a,-1)-1);return Un(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),t(r.scrollIntoView()),!0}function kk(e,t,n){let i=e.tr,r=n.parent;for(let h=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)h-=r.child(g).nodeSize,i.delete(h-1,h+1);let a=i.doc.resolve(n.start),o=a.nodeAfter;if(i.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==r.childCount,u=a.node(-1),f=a.index(-1);if(!u.canReplace(f+(l?0:1),f+1,o.content.append(c?J.empty:J.from(r))))return!1;let m=a.pos,p=m+o.nodeSize;return i.step(new Ke(m-(l?1:0),p+(c?1:0),m+1,p-1,new ae((l?J.empty:J.from(r.copy(J.empty))).append(c?J.empty:J.from(r.copy(J.empty))),l?0:1,c?0:1),l?0:1)),t(i.scrollIntoView()),!0}function wk(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let l=a.parent,c=l.child(o-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==l.type,f=J.from(u?e.create():null),m=new ae(J.from(e.create(null,J.from(l.type.create(null,f)))),u?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Ke(p-(u?3:1),h,p,h,m,1,!0)).scrollIntoView())}return!0}}function Ip(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,a=n.storedMarks,n}}}class _k{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:i}=this,{view:r}=n,{tr:a}=i,o=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...f)=>{const m=c(...f)(o);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l=[],c=!!t,u=t||a.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(p=>p===!0)),m={...Object.fromEntries(Object.entries(i).map(([p,h])=>[p,(...b)=>{const x=this.buildProps(u,n),v=h(...b)(x);return l.push(v),m}])),run:f};return m}createCan(t){const{rawCommands:n,state:i}=this,r=!1,a=t||i.tr,o=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...o,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l={tr:t,editor:r,view:o,state:Ip({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(i).map(([c,u])=>[c,(...f)=>u(...f)(l)]))}};return l}}function st(e,t,n){return e.config[t]===void 0&&e.parent?st(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?st(e.parent,t,n):null}):e.config[t]}function Sk(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),i=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:i}}function rt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Be(...e){return e.filter(t=>!!t).reduce((t,n)=>{const i={...t};return Object.entries(n).forEach(([r,a])=>{if(!i[r]){i[r]=a;return}if(r==="class"){const l=a?String(a).split(" "):[],c=i[r]?i[r].split(" "):[],u=l.filter(f=>!c.includes(f));i[r]=[...c,...u].join(" ")}else if(r==="style"){const l=a?a.split(";").map(f=>f.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;c.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),l.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),i[r]=Array.from(u.entries()).map(([f,m])=>`${f}: ${m}`).join("; ")}else i[r]=a}),i},{})}function Ck(e){return typeof e=="function"}function Qe(e,t=void 0,...n){return Ck(e)?t?e.bind(t)(...n):e(...n):e}function Rp(e,t){const n=Ri.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Ek(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class Gl{constructor(t){this.find=t.find,this.handler=t.handler}}function Ak(e){return Object.prototype.toString.call(e).slice(8,-1)}function sa(e){return Ak(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Oo(e,t){const n={...e};return sa(e)&&sa(t)&&Object.keys(t).forEach(i=>{sa(t[i])&&sa(e[i])?n[i]=Oo(e[i],t[i]):n[i]=t[i]}),n}class St{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new St(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new St(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:i}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),t.view.dispatch(i),!0}return!1}}class Tk{constructor(t){this.find=t.find,this.handler=t.handler}}class je{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new je(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new je({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}}function Nk(e,t,n){const{from:i,to:r}=t,{blockSeparator:a=`
|
|
601
|
+
|
|
602
|
+
`,textSerializers:o={}}=n||{};let l="";return e.nodesBetween(i,r,(c,u,f,m)=>{var p;c.isBlock&&u>i&&(l+=a);const h=o==null?void 0:o[c.type.name];if(h)return f&&(l+=h({node:c,pos:u,parent:f,index:m,range:t})),!1;c.isText&&(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(i,u)-u,r-u))}),l}function Ok(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const Mk=je.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dt({key:new at("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:r}=t,{ranges:a}=r,o=Math.min(...a.map(f=>f.$from.pos)),l=Math.max(...a.map(f=>f.$to.pos)),c=Ok(n);return Nk(i,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Dk=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),zk=(e=!1)=>({commands:t})=>t.setContent("",e),Ik=()=>({state:e,tr:t,dispatch:n})=>{const{selection:i}=t,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:o})=>{e.doc.nodesBetween(a.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:f}=t,m=u.resolve(f.map(c)),p=u.resolve(f.map(c+l.nodeSize)),h=m.blockRange(p);if(!h)return;const g=Li(h);if(l.type.isTextblock){const{defaultType:b}=m.parent.contentMatchAt(m.index());t.setNodeMarkup(h.start,b)}(g||g===0)&&t.lift(h,g)})}),!0},Rk=e=>t=>e(t),Lk=()=>({state:e,dispatch:t})=>Op(e,t),Bk=(e,t)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);const o=i.mapping.map(t);return i.insert(o,a.content),i.setSelection(new he(i.doc.resolve(Math.max(o-1,0)))),!0},Pk=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,i=n.$anchor.node();if(i.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(t){const l=r.before(a),c=r.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},Fk=e=>({tr:t,state:n,dispatch:i})=>{const r=rt(e,n.schema),a=t.selection.$anchor;for(let o=a.depth;o>0;o-=1)if(a.node(o).type===r){if(i){const c=a.before(o),u=a.after(o);t.delete(c,u).scrollIntoView()}return!0}return!1},Vk=e=>({tr:t,dispatch:n})=>{const{from:i,to:r}=e;return n&&t.delete(i,r),!0},Uk=()=>({state:e,dispatch:t})=>Hl(e,t),Hk=()=>({commands:e})=>e.keyboardShortcut("Enter"),qk=()=>({state:e,dispatch:t})=>lk(e,t);function qa(e,t,n={strict:!0}){const i=Object.keys(t);return i.length?i.every(r=>n.strict?t[r]===e[r]:Ek(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Lp(e,t,n={}){return e.find(i=>i.type===t&&qa(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function Au(e,t,n={}){return!!Lp(e,t,n)}function Kl(e,t,n){var i;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===t)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!Lp([...r.node.marks],t,n)))return;let o=r.index,l=e.start()+r.offset,c=o+1,u=l+r.node.nodeSize;for(;o>0&&Au([...e.parent.child(o-1).marks],t,n);)o-=1,l-=e.parent.child(o).nodeSize;for(;c<e.parent.childCount&&Au([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:l,to:u}}function qn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const jk=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const a=qn(e,i.schema),{doc:o,selection:l}=n,{$from:c,from:u,to:f}=l;if(r){const m=Kl(c,a,t);if(m&&m.from<=u&&m.to>=f){const p=he.create(o,m.from,m.to);n.setSelection(p)}}return!0},$k=e=>t=>{const n=typeof e=="function"?e(t):e;for(let i=0;i<n.length;i+=1)if(n[i](t))return!0;return!1};function Bp(e){return e instanceof he}function ti(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Wk(e,t=null){if(!t)return null;const n=ge.atStart(e),i=ge.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return i;const r=n.from,a=i.to;return t==="all"?he.create(e,ti(0,r,a),ti(e.content.size,r,a)):he.create(e,ti(t,r,a),ti(t,r,a))}function Tu(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Gk(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const Kk=(e=null,t={})=>({editor:n,view:i,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const o=()=>{(ja()||Tu())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),Gk()&&!ja()&&!Tu()&&i.dom.focus({preventScroll:!0}))})};if(i.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!Bp(n.state.selection))return o(),!0;const l=Wk(r.doc,e)||n.state.selection,c=n.state.selection.eq(l);return a&&(c||r.setSelection(l),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),o()),!0},Xk=(e,t)=>n=>e.every((i,r)=>t(i,{...n,index:r})),Jk=(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Pp=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const i=t[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?e.removeChild(i):i.nodeType===1&&Pp(i)}return e};function la(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return Pp(n)}function Mi(e,t,n){if(e instanceof oi||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};const i=typeof e=="object"&&e!==null,r=typeof e=="string";if(i)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Mi("",t,n)}if(r){if(n.errorOnInvalidContent){let o=!1,l="";const c=new Of({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?ir.fromSchema(c).parseSlice(la(e),n.parseOptions):ir.fromSchema(c).parse(la(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=ir.fromSchema(t);return n.slice?a.parseSlice(la(e),n.parseOptions).content:a.parse(la(e),n.parseOptions)}return Mi("",t,n)}function Zk(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}const Qk=e=>!("type"in e),Yk=(e,t,n)=>({tr:i,dispatch:r,editor:a})=>{var o;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=x=>{a.emit("contentError",{editor:a,error:x,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Mi(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(x){c(x)}try{l=Mi(t,a.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:a.options.enableContentCheck})}catch(x){return c(x),!1}let{from:f,to:m}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if((Qk(l)?l:[l]).forEach(x=>{x.check(),p=p?x.isText&&x.marks.length===0:!1,h=h?x.isBlock:!1}),f===m&&h){const{parent:x}=i.doc.resolve(f);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(f-=1,m+=1)}let b;if(p){if(Array.isArray(t))b=t.map(x=>x.text||"").join("");else if(t instanceof J){let x="";t.forEach(v=>{v.text&&(x+=v.text)}),b=x}else typeof t=="object"&&t&&t.text?b=t.text:b=t;i.insertText(b,f,m)}else b=l,i.replaceWith(f,m,b);n.updateSelection&&Zk(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:f,text:b})}return!0},e2=()=>({state:e,dispatch:t})=>ak(e,t),t2=()=>({state:e,dispatch:t})=>ok(e,t),n2=()=>({state:e,dispatch:t})=>_p(e,t),i2=()=>({state:e,dispatch:t})=>Ap(e,t),r2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Eo(e.doc,e.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},a2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Eo(e.doc,e.selection.$from.pos,1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},o2=()=>({state:e,dispatch:t})=>ik(e,t),s2=()=>({state:e,dispatch:t})=>rk(e,t);function Fp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function l2(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))ja()||Fp()?o=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const c2=e=>({editor:t,view:n,tr:i,dispatch:r})=>{const a=l2(e).split(/-(?!$)/),o=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,l))});return c==null||c.steps.forEach(u=>{const f=u.map(i.mapping);f&&r&&i.maybeStep(f)}),!0};function Xl(e,t,n={}){const{from:i,to:r,empty:a}=e.selection,o=t?rt(t,e.schema):null,l=[];e.doc.nodesBetween(i,r,(m,p)=>{if(m.isText)return;const h=Math.max(i,p),g=Math.min(r,p+m.nodeSize);l.push({node:m,from:h,to:g})});const c=r-i,u=l.filter(m=>o?o.name===m.node.type.name:!0).filter(m=>qa(m.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((m,p)=>m+p.to-p.from,0)>=c}const u2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return Xl(n,r,t)?sk(n,i):!1},d2=()=>({state:e,dispatch:t})=>Mp(e,t),f2=e=>({state:t,dispatch:n})=>{const i=rt(e,t.schema);return xk(i)(t,n)},p2=()=>({state:e,dispatch:t})=>Np(e,t);function Jl(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Nu(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((i,r)=>(n.includes(r)||(i[r]=e[r]),i),{})}const m2=(e,t)=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=Jl(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=rt(e,i.schema)),l==="mark"&&(o=qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{i.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{a&&a===u.type&&n.setNodeMarkup(f,void 0,Nu(u.attrs,t)),o&&u.marks.length&&u.marks.forEach(m=>{o===m.type&&n.addMark(f,f+u.nodeSize,o.create(Nu(m.attrs,t)))})})}),!0):!1},h2=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),b2=()=>({tr:e,dispatch:t})=>{if(t){const n=new Ot(e.doc);e.setSelection(n)}return!0},g2=()=>({state:e,dispatch:t})=>Cp(e,t),v2=()=>({state:e,dispatch:t})=>Tp(e,t),x2=()=>({state:e,dispatch:t})=>dk(e,t),y2=()=>({state:e,dispatch:t})=>mk(e,t),k2=()=>({state:e,dispatch:t})=>pk(e,t);function w2(e,t,n={},i={}){return Mi(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const _2=(e,t=!1,n={},i={})=>({editor:r,tr:a,dispatch:o,commands:l})=>{var c,u;const{doc:f}=a;if(n.preserveWhitespace!=="full"){const m=w2(e,r.schema,n,{errorOnInvalidContent:(c=i.errorOnInvalidContent)!==null&&c!==void 0?c:r.options.enableContentCheck});return o&&a.replaceWith(0,f.content.size,m).setMeta("preventUpdate",!t),!0}return o&&a.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:f.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function Vp(e,t){const n=qn(t,e.schema),{from:i,to:r,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,r,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function S2(e,t){const n=new $f(e);return t.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function C2(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function E2(e,t,n){const i=[];return e.nodesBetween(t.from,t.to,(r,a)=>{n(r)&&i.push({node:r,pos:a})}),i}function Up(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}function Zl(e){return t=>Up(t.$from,e)}function A2(e,t){const n=rt(t,e.schema),{from:i,to:r}=e.selection,a=[];e.doc.nodesBetween(i,r,l=>{a.push(l)});const o=a.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function T2(e,t){const n=Jl(typeof t=="string"?t:t.name,e.schema);return n==="node"?A2(e,t):n==="mark"?Vp(e,t):{}}function N2(e,t=JSON.stringify){const n={};return e.filter(i=>{const r=t(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function O2(e){const t=N2(e);return t.length===1?t:t.filter((n,i)=>!t.filter((a,o)=>o!==i).some(a=>n.oldRange.from>=a.oldRange.from&&n.oldRange.to<=a.oldRange.to&&n.newRange.from>=a.newRange.from&&n.newRange.to<=a.newRange.to))}function M2(e){const{mapping:t,steps:n}=e,i=[];return t.maps.forEach((r,a)=>{const o=[];if(r.ranges.length)r.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=n[a];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const u=t.slice(a).map(l,-1),f=t.slice(a).map(c),m=t.invert().map(u,-1),p=t.invert().map(f);i.push({oldRange:{from:m,to:p},newRange:{from:u,to:f}})})}),O2(i)}function Ql(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),o=Kl(a,r.type);o&&i.push({mark:r,...o})}):n.nodesBetween(e,t,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(o=>({from:a,to:a+r.nodeSize,mark:o})))}),i}function _a(e,t,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=e.find(a=>a.type===t&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function D2(e,t,n={}){const{empty:i,ranges:r}=e.selection,a=t?qn(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(m=>a?a.name===m.type.name:!0).find(m=>qa(m.attrs,n,{strict:!1}));let o=0;const l=[];if(r.forEach(({$from:m,$to:p})=>{const h=m.pos,g=p.pos;e.doc.nodesBetween(h,g,(b,x)=>{if(!b.isText&&!b.marks.length)return;const v=Math.max(h,x),y=Math.min(g,x+b.nodeSize),k=y-v;o+=k,l.push(...b.marks.map(w=>({mark:w,from:v,to:y})))})}),o===0)return!1;const c=l.filter(m=>a?a.name===m.mark.type.name:!0).filter(m=>qa(m.mark.attrs,n,{strict:!1})).reduce((m,p)=>m+p.to-p.from,0),u=l.filter(m=>a?m.mark.type!==a&&m.mark.type.excludes(a):!0).reduce((m,p)=>m+p.to-p.from,0);return(c>0?c+u:c)>=o}function Ou(e,t){const{nodeExtensions:n}=Sk(t),i=n.find(o=>o.name===e);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=Qe(st(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function Yl(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((i=e.text)!==null&&i!==void 0?i:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(Yl(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function z2(e,t,n){var i;const{selection:r}=t;let a=null;if(Bp(r)&&(a=r.$cursor),a){const l=(i=e.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:o}=r;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(f,m,p)=>{if(u)return!1;if(f.isInline){const h=!p||p.type.allowsMarkType(n),g=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));u=h&&g}return!u}),u})}const I2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:o,ranges:l}=a,c=qn(e,i.schema);if(r)if(o){const u=Vp(i,c);n.addStoredMark(c.create({...u,...t}))}else l.forEach(u=>{const f=u.$from.pos,m=u.$to.pos;i.doc.nodesBetween(f,m,(p,h)=>{const g=Math.max(h,f),b=Math.min(h+p.nodeSize,m);p.marks.find(v=>v.type===c)?p.marks.forEach(v=>{c===v.type&&n.addMark(g,b,c.create({...v.attrs,...t}))}):n.addMark(g,b,c.create(t))})});return z2(i,n,c)},R2=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),L2=(e,t={})=>({state:n,dispatch:i,chain:r})=>{const a=rt(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:l})=>Eu(a,{...o,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Eu(a,{...o,...t})(l,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},B2=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,r=ti(e,0,i.content.size),a=pe.create(i,r);t.setSelection(a)}return!0},P2=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,o=he.atStart(i).from,l=he.atEnd(i).to,c=ti(r,o,l),u=ti(a,o,l),f=he.create(i,c,u);t.setSelection(f)}return!0},F2=e=>({state:t,dispatch:n})=>{const i=rt(e,t.schema);return wk(i)(t,n)};function Mu(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter(r=>t==null?void 0:t.includes(r.type.name));e.tr.ensureMarks(i)}}const V2=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:o}=t,{$from:l,$to:c}=a,u=r.extensionManager.attributes,f=_a(u,l.node().type.name,l.node().attrs);if(a instanceof pe&&a.node.isBlock)return!l.parentOffset||!vn(o,l.pos)?!1:(i&&(e&&Mu(n,r.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:C2(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=m&&p?[{type:p,attrs:f}]:void 0,g=vn(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!g&&vn(t.doc,t.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(g=!0,h=p?[{type:p,attrs:f}]:void 0),i){if(g&&(a instanceof he&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),p&&!m&&!l.parentOffset&&l.parent.type!==p)){const b=t.mapping.map(l.before()),x=t.doc.resolve(b);l.node(-1).canReplaceWith(x.index(),x.index()+1,p)&&t.setNodeMarkup(t.mapping.map(l.before()),p)}e&&Mu(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return g},U2=(e,t={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var o;const l=rt(e,i.schema),{$from:c,$to:u}=i.selection,f=i.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(u))return!1;const m=c.node(-1);if(m.type!==l)return!1;const p=a.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let v=J.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let _=c.depth-y;_>=c.depth-3;_-=1)v=J.from(c.node(_).copy(v));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,w={..._a(p,c.node().type.name,c.node().attrs),...t},S=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(w))||void 0;v=v.append(J.from(l.createAndFill(null,S)||void 0));const E=c.before(c.depth-(y-1));n.replace(E,c.after(-k),new ae(v,4-y,0));let D=-1;n.doc.nodesBetween(E,n.doc.content.size,(_,C)=>{if(D>-1)return!1;_.isTextblock&&_.content.size===0&&(D=C+1)}),D>-1&&n.setSelection(he.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const h=u.pos===c.end()?m.contentMatchAt(0).defaultType:null,g={..._a(p,m.type.name,m.attrs),...t},b={..._a(p,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const x=h?[{type:l,attrs:g},{type:h,attrs:b}]:[{type:l,attrs:g}];if(!vn(n.doc,c.pos,2))return!1;if(r){const{selection:v,storedMarks:y}=i,{splittableMarks:k}=a.extensionManager,w=y||v.$to.parentOffset&&v.$from.marks();if(n.split(c.pos,2,x).scrollIntoView(),!w||!r)return!0;const S=w.filter(E=>k.includes(E.type.name));n.ensureMarks(S)}return!0},as=(e,t)=>{const n=Zl(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Un(e.doc,n.pos)&&e.join(n.pos),!0},ss=(e,t)=>{const n=Zl(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Un(e.doc,i)&&e.join(i),!0},H2=(e,t,n,i={})=>({editor:r,tr:a,state:o,dispatch:l,chain:c,commands:u,can:f})=>{const{extensions:m,splittableMarks:p}=r.extensionManager,h=rt(e,o.schema),g=rt(t,o.schema),{selection:b,storedMarks:x}=o,{$from:v,$to:y}=b,k=v.blockRange(y),w=x||b.$to.parentOffset&&b.$from.marks();if(!k)return!1;const S=Zl(E=>Ou(E.type.name,m))(b);if(k.depth>=1&&S&&k.depth-S.depth<=1){if(S.node.type===h)return u.liftListItem(g);if(Ou(S.node.type.name,m)&&h.validContent(S.node.content)&&l)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>as(a,h)).command(()=>ss(a,h)).run()}return!n||!w||!l?c().command(()=>f().wrapInList(h,i)?!0:u.clearNodes()).wrapInList(h,i).command(()=>as(a,h)).command(()=>ss(a,h)).run():c().command(()=>{const E=f().wrapInList(h,i),D=w.filter(_=>p.includes(_.type.name));return a.ensureMarks(D),E?!0:u.clearNodes()}).wrapInList(h,i).command(()=>as(a,h)).command(()=>ss(a,h)).run()},q2=(e,t={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,o=qn(e,i.schema);return D2(i,o,t)?r.unsetMark(o,{extendEmptyMarkRange:a}):r.setMark(o,t)},j2=(e,t,n={})=>({state:i,commands:r})=>{const a=rt(e,i.schema),o=rt(t,i.schema),l=Xl(i,a,n);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),l?r.setNode(o,c):r.setNode(a,{...c,...n})},$2=(e,t={})=>({state:n,commands:i})=>{const r=rt(e,n.schema);return Xl(n,r,t)?i.lift(r):i.wrapIn(r,t)},W2=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const o=e.tr,l=a.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(a.text){const c=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,e.schema.text(a.text,c))}else o.delete(a.from,a.to)}return!0}}return!1},G2=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:r}=n;return i||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},K2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=qn(e,i.schema),{$from:u,empty:f,ranges:m}=l;if(!r)return!0;if(f&&o){let{from:p,to:h}=l;const g=(a=u.marks().find(x=>x.type===c))===null||a===void 0?void 0:a.attrs,b=Kl(u,c,g);b&&(p=b.from,h=b.to),n.removeMark(p,h,c)}else m.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},X2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=Jl(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=rt(e,i.schema)),l==="mark"&&(o=qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;let m,p,h,g;n.selection.empty?i.doc.nodesBetween(u,f,(b,x)=>{a&&a===b.type&&(h=Math.max(x,u),g=Math.min(x+b.nodeSize,f),m=x,p=b)}):i.doc.nodesBetween(u,f,(b,x)=>{x<u&&a&&a===b.type&&(h=Math.max(x,u),g=Math.min(x+b.nodeSize,f),m=x,p=b),x>=u&&x<=f&&(a&&a===b.type&&n.setNodeMarkup(x,void 0,{...b.attrs,...t}),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type){const y=Math.max(x,u),k=Math.min(x+b.nodeSize,f);n.addMark(y,k,o.create({...v.attrs,...t}))}}))}),p&&(m!==void 0&&n.setNodeMarkup(m,void 0,{...p.attrs,...t}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&n.addMark(h,g,o.create({...b.attrs,...t}))}))}),!0):!1},J2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return hk(r,t)(n,i)},Z2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return bk(r,t)(n,i)};var Q2=Object.freeze({__proto__:null,blur:Dk,clearContent:zk,clearNodes:Ik,command:Rk,createParagraphNear:Lk,cut:Bk,deleteCurrentNode:Pk,deleteNode:Fk,deleteRange:Vk,deleteSelection:Uk,enter:Hk,exitCode:qk,extendMarkRange:jk,first:$k,focus:Kk,forEach:Xk,insertContent:Jk,insertContentAt:Yk,joinBackward:n2,joinDown:t2,joinForward:i2,joinItemBackward:r2,joinItemForward:a2,joinTextblockBackward:o2,joinTextblockForward:s2,joinUp:e2,keyboardShortcut:c2,lift:u2,liftEmptyBlock:d2,liftListItem:f2,newlineInCode:p2,resetAttributes:m2,scrollIntoView:h2,selectAll:b2,selectNodeBackward:g2,selectNodeForward:v2,selectParentNode:x2,selectTextblockEnd:y2,selectTextblockStart:k2,setContent:_2,setMark:I2,setMeta:R2,setNode:L2,setNodeSelection:B2,setTextSelection:P2,sinkListItem:F2,splitBlock:V2,splitListItem:U2,toggleList:H2,toggleMark:q2,toggleNode:j2,toggleWrap:$2,undoInputRule:W2,unsetAllMarks:G2,unsetMark:K2,updateAttributes:X2,wrapIn:J2,wrapInList:Z2});const Y2=je.create({name:"commands",addCommands(){return{...Q2}}}),ew=je.create({name:"drop",addProseMirrorPlugins(){return[new dt({key:new at("tiptapDrop"),props:{handleDrop:(e,t,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:i})}}})]}}),tw=je.create({name:"editable",addProseMirrorPlugins(){return[new dt({key:new at("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Hp=new at("focusEvents"),nw=je.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new dt({key:Hp,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),iw=je.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:f,$anchor:m}=c,{pos:p,parent:h}=m,g=m.parent.isTextblock&&p>0?l.doc.resolve(p-1):m,b=g.parent.type.spec.isolating,x=m.pos-m.parentOffset,v=b&&g.parent.childCount===1?x===m.pos:ge.atStart(u).from===p;return!f||!h.type.isTextblock||h.textContent.length||!v||v&&m.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ja()||Fp()?a:r},addProseMirrorPlugins(){return[new dt({key:new at("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const i=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),r=e.some(b=>b.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:o,to:l}=t.selection,c=ge.atStart(t.doc).from,u=ge.atEnd(t.doc).to;if(a||!(o===c&&l===u)||!Yl(n.doc))return;const p=n.tr,h=Ip({state:n,transaction:p}),{commands:g}=new _k({editor:this.editor,state:h});if(g.clearNodes(),!!p.steps.length)return p}})]}}),rw=je.create({name:"paste",addProseMirrorPlugins(){return[new dt({key:new at("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),aw=je.create({name:"tabindex",addProseMirrorPlugins(){return[new dt({key:new at("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ow=Object.freeze({__proto__:null,ClipboardTextSerializer:Mk,Commands:Y2,Drop:ew,Editable:tw,FocusEvents:nw,Keymap:iw,Paste:rw,Tabindex:aw,focusEventsPluginKey:Hp});function sw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i})=>{const r=Qe(e.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=t,o=i[i.length-1],l=i[0];if(o){const c=l.search(/\S/),u=n.from+l.indexOf(o),f=u+o.length;if(Ql(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(b=>b===e.type&&b!==h.mark.type)).filter(h=>h.to>u).length)return null;f<n.to&&a.delete(f,n.to),u>n.from&&a.delete(n.from+c,u);const p=n.from+c+o.length;a.addMark(n.from+c,p,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function lw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i})=>{const r=Qe(e.getAttributes,void 0,i)||{},{tr:a}=t,o=n.from;let l=n.to;const c=e.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let f=o+u;f>l?f=l:l=f+i[1].length;const m=i[0][i[0].length-1];a.insertText(m,o+i[0].length-1),a.replaceWith(f,l,c)}else if(i[0]){const u=e.type.isInline?o:o-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(o),a.mapping.map(l))}a.scrollIntoView()}})}function cw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i,chain:r})=>{const a=Qe(e.getAttributes,void 0,i)||{},o=t.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),u=c&&Dl(c,e.type,a);if(!u)return null;if(o.wrap(c,u),e.keepMarks&&e.editor){const{selection:m,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,g=p||m.$to.parentOffset&&m.$from.marks();if(g){const b=g.filter(x=>h.includes(x.type.name));o.ensureMarks(b)}}if(e.keepAttributes){const m=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(m,a).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Un(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,f))&&o.join(n.from-1)}})}let Se=class Qs{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Qs(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Qs(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}};function qp(e){return new Tk({find:e.find,handler:({state:t,range:n,match:i,pasteEvent:r})=>{const a=Qe(e.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:o}=t,l=i[i.length-1],c=i[0];let u=n.to;if(l){const f=c.search(/\S/),m=n.from+c.indexOf(l),p=m+l.length;if(Ql(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(x=>x===e.type&&x!==g.mark.type)).filter(g=>g.to>m).length)return null;p<n.to&&o.delete(p,n.to),m>n.from&&o.delete(n.from+f,m),u=n.from+f+l.length,o.addMark(n.from+f,u,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}const uw=St.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),dw=Se.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Be(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),fw=/^\s*(\[([( |x])?\])\s$/,pw=Se.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:i})=>{const r=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),u=()=>{var f,m;l.ariaLabel=((m=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||m===void 0?void 0:m.call(f,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return u(),a.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",f=>f.preventDefault()),l.addEventListener("change",f=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=f.target;i.isEditable&&typeof n=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g==null?void 0:g.attrs,checked:m}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,m])=>{r.setAttribute(f,m)}),r.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,a.append(l,o),r.append(a,c),Object.entries(t).forEach(([f,m])=>{r.setAttribute(f,m)}),{dom:r,contentDOM:c,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,l.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[cw({find:fw,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),mw=je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),hw="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",bw="ελ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",Ys="numeric",el="ascii",tl="alpha",or="asciinumeric",tr="alphanumeric",nl="domain",jp="emoji",gw="scheme",vw="slashscheme",ls="whitespace";function xw(e,t){return e in t||(t[e]=[]),t[e]}function ni(e,t,n){t[Ys]&&(t[or]=!0,t[tr]=!0),t[el]&&(t[or]=!0,t[tl]=!0),t[or]&&(t[tr]=!0),t[tl]&&(t[tr]=!0),t[tr]&&(t[nl]=!0),t[jp]&&(t[nl]=!0);for(const i in t){const r=xw(i,n);r.indexOf(e)<0&&r.push(e)}}function yw(e,t){const n={};for(const i in t)t[i].indexOf(e)>=0&&(n[i]=!0);return n}function _t(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}_t.groups={};_t.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let i=0;i<t.jr.length;i++){const r=t.jr[i][0],a=t.jr[i][1];if(a&&r.test(e))return a}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,i){for(let r=0;r<e.length;r++)this.tt(e[r],t,n,i)},tr(e,t,n,i){i=i||_t.groups;let r;return t&&t.j?r=t:(r=new _t(t),n&&i&&ni(t,n,i)),this.jr.push([e,r]),r},ts(e,t,n,i){let r=this;const a=e.length;if(!a)return r;for(let o=0;o<a-1;o++)r=r.tt(e[o]);return r.tt(e[a-1],t,n,i)},tt(e,t,n,i){i=i||_t.groups;const r=this;if(t&&t.j)return r.j[e]=t,t;const a=t;let o,l=r.go(e);if(l?(o=new _t,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new _t,a){if(i)if(o.t&&typeof o.t=="string"){const c=Object.assign(yw(o.t,i),n);ni(a,c,i)}else n&&ni(a,n,i);o.t=a}return r.j[e]=o,o}};const xe=(e,t,n,i,r)=>e.ta(t,n,i,r),Ue=(e,t,n,i,r)=>e.tr(t,n,i,r),Du=(e,t,n,i,r)=>e.ts(t,n,i,r),ee=(e,t,n,i,r)=>e.tt(t,n,i,r),mn="WORD",il="UWORD",$p="ASCIINUMERICAL",Wp="ALPHANUMERICAL",kr="LOCALHOST",rl="TLD",al="UTLD",Sa="SCHEME",Ei="SLASH_SCHEME",ec="NUM",ol="WS",tc="NL",sr="OPENBRACE",lr="CLOSEBRACE",$a="OPENBRACKET",Wa="CLOSEBRACKET",Ga="OPENPAREN",Ka="CLOSEPAREN",Xa="OPENANGLEBRACKET",Ja="CLOSEANGLEBRACKET",Za="FULLWIDTHLEFTPAREN",Qa="FULLWIDTHRIGHTPAREN",Ya="LEFTCORNERBRACKET",eo="RIGHTCORNERBRACKET",to="LEFTWHITECORNERBRACKET",no="RIGHTWHITECORNERBRACKET",io="FULLWIDTHLESSTHAN",ro="FULLWIDTHGREATERTHAN",ao="AMPERSAND",oo="APOSTROPHE",so="ASTERISK",Nn="AT",lo="BACKSLASH",co="BACKTICK",uo="CARET",ii="COLON",nc="COMMA",fo="DOLLAR",Gt="DOT",po="EQUALS",ic="EXCLAMATION",Rt="HYPHEN",cr="PERCENT",mo="PIPE",ho="PLUS",bo="POUND",ur="QUERY",rc="QUOTE",Gp="FULLWIDTHMIDDLEDOT",ac="SEMI",Kt="SLASH",dr="TILDE",go="UNDERSCORE",Kp="EMOJI",vo="SYM";var Xp=Object.freeze({__proto__:null,ALPHANUMERICAL:Wp,AMPERSAND:ao,APOSTROPHE:oo,ASCIINUMERICAL:$p,ASTERISK:so,AT:Nn,BACKSLASH:lo,BACKTICK:co,CARET:uo,CLOSEANGLEBRACKET:Ja,CLOSEBRACE:lr,CLOSEBRACKET:Wa,CLOSEPAREN:Ka,COLON:ii,COMMA:nc,DOLLAR:fo,DOT:Gt,EMOJI:Kp,EQUALS:po,EXCLAMATION:ic,FULLWIDTHGREATERTHAN:ro,FULLWIDTHLEFTPAREN:Za,FULLWIDTHLESSTHAN:io,FULLWIDTHMIDDLEDOT:Gp,FULLWIDTHRIGHTPAREN:Qa,HYPHEN:Rt,LEFTCORNERBRACKET:Ya,LEFTWHITECORNERBRACKET:to,LOCALHOST:kr,NL:tc,NUM:ec,OPENANGLEBRACKET:Xa,OPENBRACE:sr,OPENBRACKET:$a,OPENPAREN:Ga,PERCENT:cr,PIPE:mo,PLUS:ho,POUND:bo,QUERY:ur,QUOTE:rc,RIGHTCORNERBRACKET:eo,RIGHTWHITECORNERBRACKET:no,SCHEME:Sa,SEMI:ac,SLASH:Kt,SLASH_SCHEME:Ei,SYM:vo,TILDE:dr,TLD:rl,UNDERSCORE:go,UTLD:al,UWORD:il,WORD:mn,WS:ol});const fn=/[a-z]/,Xi=new RegExp("\\p{L}","u"),cs=new RegExp("\\p{Emoji}","u"),pn=/\d/,us=/\s/,zu="\r",ds=`
|
|
603
|
+
`,kw="️",ww="",fs="";let ca=null,ua=null;function _w(e=[]){const t={};_t.groups=t;const n=new _t;ca==null&&(ca=Iu(hw)),ua==null&&(ua=Iu(bw)),ee(n,"'",oo),ee(n,"{",sr),ee(n,"}",lr),ee(n,"[",$a),ee(n,"]",Wa),ee(n,"(",Ga),ee(n,")",Ka),ee(n,"<",Xa),ee(n,">",Ja),ee(n,"(",Za),ee(n,")",Qa),ee(n,"「",Ya),ee(n,"」",eo),ee(n,"『",to),ee(n,"』",no),ee(n,"<",io),ee(n,">",ro),ee(n,"&",ao),ee(n,"*",so),ee(n,"@",Nn),ee(n,"`",co),ee(n,"^",uo),ee(n,":",ii),ee(n,",",nc),ee(n,"$",fo),ee(n,".",Gt),ee(n,"=",po),ee(n,"!",ic),ee(n,"-",Rt),ee(n,"%",cr),ee(n,"|",mo),ee(n,"+",ho),ee(n,"#",bo),ee(n,"?",ur),ee(n,'"',rc),ee(n,"/",Kt),ee(n,";",ac),ee(n,"~",dr),ee(n,"_",go),ee(n,"\\",lo),ee(n,"・",Gp);const i=Ue(n,pn,ec,{[Ys]:!0});Ue(i,pn,i);const r=Ue(i,fn,$p,{[or]:!0}),a=Ue(i,Xi,Wp,{[tr]:!0}),o=Ue(n,fn,mn,{[el]:!0});Ue(o,pn,r),Ue(o,fn,o),Ue(r,pn,r),Ue(r,fn,r);const l=Ue(n,Xi,il,{[tl]:!0});Ue(l,fn),Ue(l,pn,a),Ue(l,Xi,l),Ue(a,pn,a),Ue(a,fn),Ue(a,Xi,a);const c=ee(n,ds,tc,{[ls]:!0}),u=ee(n,zu,ol,{[ls]:!0}),f=Ue(n,us,ol,{[ls]:!0});ee(n,fs,f),ee(u,ds,c),ee(u,fs,f),Ue(u,us,f),ee(f,zu),ee(f,ds),Ue(f,us,f),ee(f,fs,f);const m=Ue(n,cs,Kp,{[jp]:!0});ee(m,"#"),Ue(m,cs,m),ee(m,kw,m);const p=ee(m,ww);ee(p,"#"),Ue(p,cs,m);const h=[[fn,o],[pn,r]],g=[[fn,null],[Xi,l],[pn,a]];for(let b=0;b<ca.length;b++)An(n,ca[b],rl,mn,h);for(let b=0;b<ua.length;b++)An(n,ua[b],al,il,g);ni(rl,{tld:!0,ascii:!0},t),ni(al,{utld:!0,alpha:!0},t),An(n,"file",Sa,mn,h),An(n,"mailto",Sa,mn,h),An(n,"http",Ei,mn,h),An(n,"https",Ei,mn,h),An(n,"ftp",Ei,mn,h),An(n,"ftps",Ei,mn,h),ni(Sa,{scheme:!0,ascii:!0},t),ni(Ei,{slashscheme:!0,ascii:!0},t),e=e.sort((b,x)=>b[0]>x[0]?1:-1);for(let b=0;b<e.length;b++){const x=e[b][0],y=e[b][1]?{[gw]:!0}:{[vw]:!0};x.indexOf("-")>=0?y[nl]=!0:fn.test(x)?pn.test(x)?y[or]=!0:y[el]=!0:y[Ys]=!0,Du(n,x,x,y)}return Du(n,"localhost",kr,{ascii:!0}),n.jd=new _t(vo),{start:n,tokens:Object.assign({groups:t},Xp)}}function Jp(e,t){const n=Sw(t.replace(/[A-Z]/g,l=>l.toLowerCase())),i=n.length,r=[];let a=0,o=0;for(;o<i;){let l=e,c=null,u=0,f=null,m=-1,p=-1;for(;o<i&&(c=l.go(n[o]));)l=c,l.accepts()?(m=0,p=0,f=l):m>=0&&(m+=n[o].length,p++),u+=n[o].length,a+=n[o].length,o++;a-=m,o-=p,u-=m,r.push({t:f.t,v:t.slice(a-u,a),s:a-u,e:a})}return r}function Sw(e){const t=[],n=e.length;let i=0;for(;i<n;){let r=e.charCodeAt(i),a,o=r<55296||r>56319||i+1===n||(a=e.charCodeAt(i+1))<56320||a>57343?e[i]:e.slice(i,i+2);t.push(o),i+=o.length}return t}function An(e,t,n,i,r){let a;const o=t.length;for(let l=0;l<o-1;l++){const c=t[l];e.j[c]?a=e.j[c]:(a=new _t(i),a.jr=r.slice(),e.j[c]=a),e=a}return a=new _t(n),a.jr=r.slice(),e.j[t[o-1]]=a,a}function Iu(e){const t=[],n=[];let i=0,r="0123456789";for(;i<e.length;){let a=0;for(;r.indexOf(e[i+a])>=0;)a++;if(a>0){t.push(n.join(""));for(let o=parseInt(e.substring(i,i+a),10);o>0;o--)n.pop();i+=a}else n.push(e[i]),i++}return t}const wr={defaultProtocol:"http",events:null,format:Ru,formatHref:Ru,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oc(e,t=null){let n=Object.assign({},wr);e&&(n=Object.assign(n,e instanceof oc?e.o:e));const i=n.ignoreTags,r=[];for(let a=0;a<i.length;a++)r.push(i[a].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=r}oc.prototype={o:wr,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const i=t!=null;let r=this.o[e];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:wr[e],typeof r=="function"&&i&&(r=r(t,n))):typeof r=="function"&&i&&(r=r(t,n.t,n)),r)},getObj(e,t,n){let i=this.o[e];return typeof i=="function"&&t!=null&&(i=i(t,n.t,n)),i},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function Ru(e){return e}function Zp(e,t){this.t="token",this.v=e,this.tk=t}Zp.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),i=e.get("format",t,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=wr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),i=e.get("formatHref",n,this),r=e.get("tagName",n,t),a=this.toFormattedString(e),o={},l=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),m=e.getObj("events",n,t);return o.href=i,l&&(o.class=l),c&&(o.target=c),u&&(o.rel=u),f&&Object.assign(o,f),{tagName:r,attributes:o,content:a,eventListeners:m}}};function Mo(e,t){class n extends Zp{constructor(r,a){super(r,a),this.t=e}}for(const i in t)n.prototype[i]=t[i];return n.t=e,n}const Cw=Mo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Lu=Mo("text"),Ew=Mo("nl"),da=Mo("url",{isLink:!0,toHref(e=wr.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==kr&&e[1].t===ii}}),It=e=>new _t(e);function Aw({groups:e}){const t=e.domain.concat([ao,so,Nn,lo,co,uo,fo,po,Rt,ec,cr,mo,ho,bo,Kt,vo,dr,go]),n=[oo,ii,nc,Gt,ic,cr,ur,rc,ac,Xa,Ja,sr,lr,Wa,$a,Ga,Ka,Za,Qa,Ya,eo,to,no,io,ro],i=[ao,oo,so,lo,co,uo,fo,po,Rt,sr,lr,cr,mo,ho,bo,ur,Kt,vo,dr,go],r=It(),a=ee(r,dr);xe(a,i,a),xe(a,e.domain,a);const o=It(),l=It(),c=It();xe(r,e.domain,o),xe(r,e.scheme,l),xe(r,e.slashscheme,c),xe(o,i,a),xe(o,e.domain,o);const u=ee(o,Nn);ee(a,Nn,u),ee(l,Nn,u),ee(c,Nn,u);const f=ee(a,Gt);xe(f,i,a),xe(f,e.domain,a);const m=It();xe(u,e.domain,m),xe(m,e.domain,m);const p=ee(m,Gt);xe(p,e.domain,m);const h=It(Cw);xe(p,e.tld,h),xe(p,e.utld,h),ee(u,kr,h);const g=ee(m,Rt);ee(g,Rt,g),xe(g,e.domain,m),xe(h,e.domain,m),ee(h,Gt,p),ee(h,Rt,g);const b=ee(o,Rt),x=ee(o,Gt);ee(b,Rt,b),xe(b,e.domain,o),xe(x,i,a),xe(x,e.domain,o);const v=It(da);xe(x,e.tld,v),xe(x,e.utld,v),xe(v,e.domain,o),xe(v,i,a),ee(v,Gt,x),ee(v,Rt,b),ee(v,Nn,u);const y=ee(v,ii),k=It(da);xe(y,e.numeric,k);const w=It(da),S=It();xe(w,t,w),xe(w,n,S),xe(S,t,w),xe(S,n,S),ee(v,Kt,w),ee(k,Kt,w);const E=ee(l,ii),D=ee(c,ii),_=ee(D,Kt),C=ee(_,Kt);xe(l,e.domain,o),ee(l,Gt,x),ee(l,Rt,b),xe(c,e.domain,o),ee(c,Gt,x),ee(c,Rt,b),xe(E,e.domain,w),ee(E,Kt,w),ee(E,ur,w),xe(C,e.domain,w),xe(C,t,w),ee(C,Kt,w);const N=[[sr,lr],[$a,Wa],[Ga,Ka],[Xa,Ja],[Za,Qa],[Ya,eo],[to,no],[io,ro]];for(let I=0;I<N.length;I++){const[H,F]=N[I],M=ee(w,H);ee(S,H,M);const j=It(da);xe(M,t,j);const P=It();xe(M,n,P),ee(M,F,w),xe(j,t,j),xe(j,n,P),xe(P,t,j),xe(P,n,P),ee(j,F,w),ee(P,F,w)}return ee(r,kr,v),ee(r,tc,Ew),{start:r,tokens:Xp}}function Tw(e,t,n){let i=n.length,r=0,a=[],o=[];for(;r<i;){let l=e,c=null,u=null,f=0,m=null,p=-1;for(;r<i&&!(c=l.go(n[r].t));)o.push(n[r++]);for(;r<i&&(u=c||l.go(n[r].t));)c=null,l=u,l.accepts()?(p=0,m=l):p>=0&&p++,r++,f++;if(p<0)r-=f,r<i&&(o.push(n[r]),r++);else{o.length>0&&(a.push(ps(Lu,t,o)),o=[]),r-=p,f-=p;const h=m.t,g=n.slice(r-f,r);a.push(ps(h,t,g))}}return o.length>0&&a.push(ps(Lu,t,o)),a}function ps(e,t,n){const i=n[0].s,r=n[n.length-1].e,a=t.slice(i,r);return new e(a,n)}const Nw=typeof console<"u"&&console&&console.warn||(()=>{}),Ow="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Pe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Mw(){return _t.groups={},Pe.scanner=null,Pe.parser=null,Pe.tokenQueue=[],Pe.pluginQueue=[],Pe.customSchemes=[],Pe.initialized=!1,Pe}function Bu(e,t=!1){if(Pe.initialized&&Nw(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Ow}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
604
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
605
|
+
2. Cannot start or end with "-"
|
|
606
|
+
3. "-" cannot repeat`);Pe.customSchemes.push([e,t])}function Dw(){Pe.scanner=_w(Pe.customSchemes);for(let e=0;e<Pe.tokenQueue.length;e++)Pe.tokenQueue[e][1]({scanner:Pe.scanner});Pe.parser=Aw(Pe.scanner.tokens);for(let e=0;e<Pe.pluginQueue.length;e++)Pe.pluginQueue[e][1]({scanner:Pe.scanner,parser:Pe.parser});return Pe.initialized=!0,Pe}function sc(e){return Pe.initialized||Dw(),Tw(Pe.parser.start,e,Jp(Pe.scanner.start,e))}sc.scan=Jp;function Qp(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const i=new oc(n),r=sc(e),a=[];for(let o=0;o<r.length;o++){const l=r[o];l.isLink&&(!t||l.t===t)&&i.check(l)&&a.push(l.toFormattedObject(i))}return a}const lc="[\0- -\u2029 ]",zw=new RegExp(lc),Iw=new RegExp(`${lc}$`),Rw=new RegExp(lc,"g");function Lw(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function Bw(e){return new dt({key:new at("autolink"),appendTransaction:(t,n,i)=>{const r=t.some(u=>u.docChanged)&&!n.doc.eq(i.doc),a=t.some(u=>u.getMeta("preventAutolink"));if(!r||a)return;const{tr:o}=i,l=S2(n.doc,[...t]);if(M2(l).forEach(({newRange:u})=>{const f=E2(i.doc,u,h=>h.isTextblock);let m,p;if(f.length>1)m=f[0],p=i.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(f.length){const h=i.doc.textBetween(u.from,u.to," "," ");if(!Iw.test(h))return;m=f[0],p=i.doc.textBetween(m.pos,u.to,void 0," ")}if(m&&p){const h=p.split(zw).filter(Boolean);if(h.length<=0)return!1;const g=h[h.length-1],b=m.pos+p.lastIndexOf(g);if(!g)return!1;const x=sc(g).map(v=>v.toObject(e.defaultProtocol));if(!Lw(x))return!1;x.filter(v=>v.isLink).map(v=>({...v,from:b+v.start+1,to:b+v.end+1})).filter(v=>i.schema.marks.code?!i.doc.rangeHasMark(v.from,v.to,i.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{Ql(v.from,v.to,i.doc).some(y=>y.mark.type===e.type)||o.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function Pw(e){return new dt({key:new at("handleClickLink"),props:{handleClick:(t,n,i)=>{var r,a;if(i.button!==0||!t.editable)return!1;let o=i.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;const c=T2(t.state,e.type.name),u=i.target,f=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:c.href,m=(a=u==null?void 0:u.target)!==null&&a!==void 0?a:c.target;return u&&f?(window.open(f,m),!0):!1}}})}function Fw(e){return new dt({key:new at("handlePasteLink"),props:{handlePaste:(t,n,i)=>{const{state:r}=t,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";i.content.forEach(u=>{l+=u.textContent});const c=Qp(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function Zn(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!e||e.replace(Rw,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Vw=St.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(e=>{if(typeof e=="string"){Bu(e);return}Bu(e.scheme,e.optionalSlashes)})},onDestroy(){Mw()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Zn(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.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:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Zn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Zn(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Be(this.options.HTMLAttributes,e),0]:["a",Be(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Zn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Zn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[qp({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:i}=this.options,r=Qp(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!Zn(o,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(a=>t.push({text:a.value,data:{href:a.href},index:a.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Bw({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!Zn(r,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(Pw({type:this.type})),this.options.linkOnPaste&&e.push(Fw({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),Uw=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Hw=Se.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Be(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[lw({find:Uw,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});let sl,ll;if(typeof WeakMap<"u"){let e=new WeakMap;sl=t=>e.get(t),ll=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;sl=i=>{for(let r=0;r<e.length;r+=2)if(e[r]==i)return e[r+1]},ll=(i,r)=>(n==10&&(n=0),e[n++]=i,e[n++]=r)}var He=class{constructor(e,t,n,i){this.width=e,this.height=t,this.map=n,this.problems=i}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const i=t%this.width,r=t/this.width|0;let a=i+1,o=r+1;for(let l=1;a<this.width&&this.map[t+l]==n;l++)a++;for(let l=1;o<this.height&&this.map[t+this.width*l]==n;l++)o++;return{left:i,top:r,right:a,bottom:o}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:i,right:r,top:a,bottom:o}=this.findCell(e);return t=="horiz"?(n<0?i==0:r==this.width)?null:this.map[a*this.width+(n<0?i-1:r)]:(n<0?a==0:o==this.height)?null:this.map[i+this.width*(n<0?a-1:o)]}rectBetween(e,t){const{left:n,right:i,top:r,bottom:a}=this.findCell(e),{left:o,right:l,top:c,bottom:u}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(i,l),bottom:Math.max(a,u)}}cellsInRect(e){const t=[],n={};for(let i=e.top;i<e.bottom;i++)for(let r=e.left;r<e.right;r++){const a=i*this.width+r,o=this.map[a];n[o]||(n[o]=!0,!(r==e.left&&r&&this.map[a-1]==o||i==e.top&&i&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let i=0,r=0;;i++){const a=r+n.child(i).nodeSize;if(i==e){let o=t+e*this.width;const l=(e+1)*this.width;for(;o<l&&this.map[o]<r;)o++;return o==l?a-1:this.map[o]}r=a}}static get(e){return sl(e)||ll(e,qw(e))}};function qw(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=jw(e),n=e.childCount,i=[];let r=0,a=null;const o=[];for(let u=0,f=t*n;u<f;u++)i[u]=0;for(let u=0,f=0;u<n;u++){const m=e.child(u);f++;for(let g=0;;g++){for(;r<i.length&&i[r]!=0;)r++;if(g==m.childCount)break;const b=m.child(g),{colspan:x,rowspan:v,colwidth:y}=b.attrs;for(let k=0;k<v;k++){if(k+u>=n){(a||(a=[])).push({type:"overlong_rowspan",pos:f,n:v-k});break}const w=r+k*t;for(let S=0;S<x;S++){i[w+S]==0?i[w+S]=f:(a||(a=[])).push({type:"collision",row:u,pos:f,n:x-S});const E=y&&y[S];if(E){const D=(w+S)%t*2,_=o[D];_==null||_!=E&&o[D+1]==1?(o[D]=E,o[D+1]=1):_==E&&o[D+1]++}}}r+=x,f+=b.nodeSize}const p=(u+1)*t;let h=0;for(;r<p;)i[r++]==0&&h++;h&&(a||(a=[])).push({type:"missing",row:u,n:h}),f++}(t===0||n===0)&&(a||(a=[])).push({type:"zero_sized"});const l=new He(t,n,i,a);let c=!1;for(let u=0;!c&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(c=!0);return c&&$w(l,o,e),l}function jw(e){let t=-1,n=!1;for(let i=0;i<e.childCount;i++){const r=e.child(i);let a=0;if(n)for(let o=0;o<i;o++){const l=e.child(o);for(let c=0;c<l.childCount;c++){const u=l.child(c);o+u.attrs.rowspan>i&&(a+=u.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const l=r.child(o);a+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function $w(e,t,n){e.problems||(e.problems=[]);const i={};for(let r=0;r<e.map.length;r++){const a=e.map[r];if(i[a])continue;i[a]=!0;const o=n.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let l=null;const c=o.attrs;for(let u=0;u<c.colspan;u++){const f=t[(r+u)%e.width*2];f!=null&&(!c.colwidth||c.colwidth[u]!=f)&&((l||(l=Ww(c)))[u]=f)}l&&e.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:l})}}function Ww(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function lt(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const i=e.nodes[n],r=i.spec.tableRole;r&&(t[r]=i)}}return t}const Mn=new at("selectingCells");function di(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Gw(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function $t(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Do(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=di(t.$head)||Kw(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Kw(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function cl(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function Xw(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function cc(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Yp(e,t,n){const i=e.node(-1),r=He.get(i),a=e.start(-1),o=r.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function fi(e,t,n=1){const i={...e,colspan:e.colspan-n};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(t,n),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function em(e,t,n=1){const i={...e,colspan:e.colspan+n};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<n;r++)i.colwidth.splice(t,0,0)}return i}function Jw(e,t,n){const i=lt(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=i)return!1;return!0}var Le=class hn extends ge{constructor(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=r.cellsInRect(o).filter(f=>f!=n.pos-a);c.unshift(n.pos-a);const u=c.map(f=>{const m=i.nodeAt(f);if(!m)throw new RangeError(`No cell with offset ${f} found`);const p=a+f+1;return new Wf(l.resolve(p),l.resolve(p+m.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){const i=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(cl(i)&&cl(r)&&cc(i,r)){const a=this.$anchorCell.node(-1)!=i.node(-1);return a&&this.isRowSelection()?hn.rowSelection(i,r):a&&this.isColSelection()?hn.colSelection(i,r):new hn(i,r)}return he.between(i,r)}content(){const t=this.$anchorCell.node(-1),n=He.get(t),i=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),a={},o=[];for(let c=r.top;c<r.bottom;c++){const u=[];for(let f=c*n.width+r.left,m=r.left;m<r.right;m++,f++){const p=n.map[f];if(a[p])continue;a[p]=!0;const h=n.findCell(p);let g=t.nodeAt(p);if(!g)throw new RangeError(`No cell with offset ${p} found`);const b=r.left-h.left,x=h.right-r.right;if(b>0||x>0){let v=g.attrs;if(b>0&&(v=fi(v,0,b)),x>0&&(v=fi(v,v.colspan-x,x)),h.left<r.left){if(g=g.type.createAndFill(v),!g)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else g=g.type.create(v,g.content)}if(h.top<r.top||h.bottom>r.bottom){const v={...g.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?g=g.type.createAndFill(v):g=g.type.create(v,g.content)}u.push(g)}o.push(t.child(c).copy(J.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?t:o;return new ae(J.from(l),1,1)}replace(t,n=ae.empty){const i=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:l,$to:c}=r[o],u=t.mapping.slice(i);t.replace(u.map(l.pos),u.map(c.pos),o?ae.empty:n)}const a=ge.findFrom(t.doc.resolve(t.mapping.slice(i).map(this.to)),-1);a&&t.setSelection(a)}replaceWith(t,n){this.replace(t,new ae(J.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),i=He.get(n),r=this.$anchorCell.start(-1),a=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<a.length;o++)t(n.nodeAt(a[o]),r+a[o])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const i=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.top<=l.top?(o.top>0&&(t=c.resolve(a+r.map[o.left])),l.bottom<r.height&&(n=c.resolve(a+r.map[r.width*(r.height-1)+l.right-1]))):(l.top>0&&(n=c.resolve(a+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(a+r.map[r.width*(r.height-1)+o.right-1]))),new hn(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=He.get(t),i=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-i),a=n.colCount(this.$headCell.pos-i);if(Math.min(r,a)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,l=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(t){return t instanceof hn&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.left<=l.left?(o.left>0&&(t=c.resolve(a+r.map[o.top*r.width])),l.right<r.width&&(n=c.resolve(a+r.map[r.width*(l.top+1)-1]))):(l.left>0&&(n=c.resolve(a+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(a+r.map[r.width*(o.top+1)-1]))),new hn(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new hn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){return new hn(t.resolve(n),t.resolve(i))}getBookmark(){return new Zw(this.$anchorCell.pos,this.$headCell.pos)}};Le.prototype.visible=!1;ge.jsonID("cell",Le);var Zw=class tm{constructor(t,n){this.anchor=t,this.head=n}map(t){return new tm(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),i=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&cc(n,i)?new Le(n,i):ge.near(i,1)}};function Qw(e){if(!(e.selection instanceof Le))return null;const t=[];return e.selection.forEachCell((n,i)=>{t.push(ot.node(i,i+n.nodeSize,{class:"selectedCell"}))}),Ve.create(e.doc,t)}function Yw({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,i=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let a=t.depth;a>=0&&!(t.before(a+1)>t.start(a));a--,i--);return n==i&&/row|table/.test(e.node(r).type.spec.tableRole)}function e_({$from:e,$to:t}){let n,i;for(let r=e.depth;r>0;r--){const a=e.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}for(let r=t.depth;r>0;r--){const a=t.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){i=a;break}}return n!==i&&t.parentOffset===0}function t_(e,t,n){const i=(t||e).selection,r=(t||e).doc;let a,o;if(i instanceof pe&&(o=i.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=Le.create(r,i.from);else if(o=="row"){const l=r.resolve(i.from+1);a=Le.rowSelection(l,l)}else if(!n){const l=He.get(i.node),c=i.from+1,u=c+l.map[l.width*l.height-1];a=Le.create(r,c+1,u)}}else i instanceof he&&Yw(i)?a=he.create(r,i.from):i instanceof he&&e_(i)&&(a=he.create(r,i.$from.start(),i.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}const n_=new at("fix-tables");function nm(e,t,n,i){const r=e.childCount,a=t.childCount;e:for(let o=0,l=0;o<a;o++){const c=t.child(o);for(let u=l,f=Math.min(r,o+3);u<f;u++)if(e.child(u)==c){l=u+1,n+=c.nodeSize;continue e}i(c,n),l<r&&e.child(l).sameMarkup(c)?nm(e.child(l),c,n+1,i):c.nodesBetween(0,c.content.size,i,n+1),n+=c.nodeSize}}function im(e,t){let n;const i=(r,a)=>{r.type.spec.tableRole=="table"&&(n=i_(e,r,a,n))};return t?t.doc!=e.doc&&nm(t.doc,e.doc,0,i):e.doc.descendants(i),n}function i_(e,t,n,i){const r=He.get(t);if(!r.problems)return i;i||(i=e.tr);const a=[];for(let c=0;c<r.height;c++)a.push(0);for(let c=0;c<r.problems.length;c++){const u=r.problems[c];if(u.type=="collision"){const f=t.nodeAt(u.pos);if(!f)continue;const m=f.attrs;for(let p=0;p<m.rowspan;p++)a[u.row+p]+=u.n;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,fi(m,m.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const f=i.mapping.map(n);i.delete(f,f+t.nodeSize)}}let o,l;for(let c=0;c<a.length;c++)a[c]&&(o==null&&(o=c),l=c);for(let c=0,u=n+1;c<r.height;c++){const f=t.child(c),m=u+f.nodeSize,p=a[c];if(p>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);const g=[];for(let x=0;x<p;x++){const v=lt(e.schema)[h].createAndFill();v&&g.push(v)}const b=(c==0||o==c-1)&&l==c?u+1:m-1;i.insert(i.mapping.map(b),g)}u=m}return i.setMeta(n_,{fixTables:!0})}function en(e){const t=e.selection,n=Do(e),i=n.node(-1),r=n.start(-1),a=He.get(i);return{...t instanceof Le?a.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):a.findCell(n.pos-r),tableStart:r,map:a,table:i}}function rm(e,{map:t,tableStart:n,table:i},r){let a=r>0?-1:0;Jw(t,i,r+a)&&(a=r==0||r==t.width?null:0);for(let o=0;o<t.height;o++){const l=o*t.width+r;if(r>0&&r<t.width&&t.map[l-1]==t.map[l]){const c=t.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(n+c),null,em(u.attrs,r-t.colCount(c))),o+=u.attrs.rowspan-1}else{const c=a==null?lt(i.type.schema).cell:i.nodeAt(t.map[l+a]).type,u=t.positionAt(o,r,i);e.insert(e.mapping.map(n+u),c.createAndFill())}}return e}function r_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(rm(e.tr,n,n.left))}return!0}function a_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(rm(e.tr,n,n.right))}return!0}function o_(e,{map:t,table:n,tableStart:i},r){const a=e.mapping.maps.length;for(let o=0;o<t.height;){const l=o*t.width+r,c=t.map[l],u=n.nodeAt(c),f=u.attrs;if(r>0&&t.map[l-1]==c||r<t.width-1&&t.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,fi(f,r-t.colCount(c)));else{const m=e.mapping.slice(a).map(i+c);e.delete(m,m+u.nodeSize)}o+=f.rowspan}}function s_(e,t){if(!$t(e))return!1;if(t){const n=en(e),i=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;o_(i,n,r),r!=n.left;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=He.get(a)}t(i)}return!0}function l_(e,t,n){var i;const r=lt(t.type.schema).header_cell;for(let a=0;a<e.width;a++)if(((i=t.nodeAt(e.map[a+n*e.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function am(e,{map:t,tableStart:n,table:i},r){let a=n;for(let u=0;u<r;u++)a+=i.child(u).nodeSize;const o=[];let l=r>0?-1:0;l_(t,i,r+l)&&(l=r==0||r==t.height?null:0);for(let u=0,f=t.width*r;u<t.width;u++,f++)if(r>0&&r<t.height&&t.map[f]==t.map[f-t.width]){const m=t.map[f],p=i.nodeAt(m).attrs;e.setNodeMarkup(n+m,null,{...p,rowspan:p.rowspan+1}),u+=p.colspan-1}else{var c;const m=l==null?lt(i.type.schema).cell:(c=i.nodeAt(t.map[f+l*t.width]))===null||c===void 0?void 0:c.type,p=m==null?void 0:m.createAndFill();p&&o.push(p)}return e.insert(a,lt(i.type.schema).row.create(null,o)),e}function c_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(am(e.tr,n,n.top))}return!0}function u_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(am(e.tr,n,n.bottom))}return!0}function d_(e,{map:t,table:n,tableStart:i},r){let a=0;for(let u=0;u<r;u++)a+=n.child(u).nodeSize;const o=a+n.child(r).nodeSize,l=e.mapping.maps.length;e.delete(a+i,o+i);const c=new Set;for(let u=0,f=r*t.width;u<t.width;u++,f++){const m=t.map[f];if(!c.has(m)){if(c.add(m),r>0&&m==t.map[f-t.width]){const p=n.nodeAt(m).attrs;e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p,rowspan:p.rowspan-1}),u+=p.colspan-1}else if(r<t.height&&m==t.map[f+t.width]){const p=n.nodeAt(m),h=p.attrs,g=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),b=t.positionAt(r+1,u,n);e.insert(e.mapping.slice(l).map(i+b),g),u+=h.colspan-1}}}}function f_(e,t){if(!$t(e))return!1;if(t){const n=en(e),i=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;d_(i,n,r),r!=n.top;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=He.get(n.table)}t(i)}return!0}function Pu(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function p_({width:e,height:t,map:n},i){let r=i.top*e+i.left,a=r,o=(i.bottom-1)*e+i.left,l=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&n[a]==n[a-1]||i.right<e&&n[l]==n[l+1])return!0;a+=e,l+=e}for(let c=i.left;c<i.right;c++){if(i.top>0&&n[r]==n[r-e]||i.bottom<t&&n[o]==n[o+e])return!0;r++,o++}return!1}function Fu(e,t){const n=e.selection;if(!(n instanceof Le)||n.$anchorCell.pos==n.$headCell.pos)return!1;const i=en(e),{map:r}=i;if(p_(r,i))return!1;if(t){const a=e.tr,o={};let l=J.empty,c,u;for(let f=i.top;f<i.bottom;f++)for(let m=i.left;m<i.right;m++){const p=r.map[f*r.width+m],h=i.table.nodeAt(p);if(!(o[p]||!h))if(o[p]=!0,c==null)c=p,u=h;else{Pu(h)||(l=l.append(h.content));const g=a.mapping.map(p+i.tableStart);a.delete(g,g+h.nodeSize)}}if(c==null||u==null)return!0;if(a.setNodeMarkup(c+i.tableStart,null,{...em(u.attrs,u.attrs.colspan,i.right-i.left-u.attrs.colspan),rowspan:i.bottom-i.top}),l.size>0){const f=c+1+u.content.size,m=Pu(u)?c+1:f;a.replaceWith(m+i.tableStart,f+i.tableStart,l)}a.setSelection(new Le(a.doc.resolve(c+i.tableStart))),t(a)}return!0}function Vu(e,t){const n=lt(e.schema);return m_(({node:i})=>n[i.type.spec.tableRole])(e,t)}function m_(e){return(t,n)=>{const i=t.selection;let r,a;if(i instanceof Le){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{var o;if(r=Gw(i.$from),!r)return!1;a=(o=di(i.$from))===null||o===void 0?void 0:o.pos}if(r==null||a==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(n){let l=r.attrs;const c=[],u=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=en(t),m=t.tr;for(let h=0;h<f.right-f.left;h++)c.push(u?{...l,colwidth:u&&u[h]?[u[h]]:null}:l);let p;for(let h=f.top;h<f.bottom;h++){let g=f.map.positionAt(h,f.left,f.table);h==f.top&&(g+=r.nodeSize);for(let b=f.left,x=0;b<f.right;b++,x++)b==f.left&&h==f.top||m.insert(p=m.mapping.map(g+f.tableStart,1),e({node:r,row:h,col:b}).createAndFill(c[x]))}m.setNodeMarkup(a,e({node:r,row:f.top,col:f.left}),c[0]),i instanceof Le&&m.setSelection(new Le(m.doc.resolve(i.$anchorCell.pos),p?m.doc.resolve(p):void 0)),n(m)}return!0}}function h_(e,t){return function(n,i){if(!$t(n))return!1;const r=Do(n);if(r.nodeAfter.attrs[e]===t)return!1;if(i){const a=n.tr;n.selection instanceof Le?n.selection.forEachCell((o,l)=>{o.attrs[e]!==t&&a.setNodeMarkup(l,null,{...o.attrs,[e]:t})}):a.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),i(a)}return!0}}function b_(e){return function(t,n){if(!$t(t))return!1;if(n){const i=lt(t.schema),r=en(t),a=t.tr,o=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),l=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)l[c].type==i.header_cell&&a.setNodeMarkup(r.tableStart+o[c],i.cell,l[c].attrs);if(a.steps.length===0)for(let c=0;c<o.length;c++)a.setNodeMarkup(r.tableStart+o[c],i.header_cell,l[c].attrs);n(a)}return!0}}function Uu(e,t,n){const i=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<i.length;r++){const a=t.table.nodeAt(i[r]);if(a&&a.type!==n.header_cell)return!1}return!0}function _r(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?b_(e):function(n,i){if(!$t(n))return!1;if(i){const r=lt(n.schema),a=en(n),o=n.tr,l=Uu("row",a,r),c=Uu("column",a,r),u=(e==="column"?l:e==="row"&&c)?1:0,f=e=="column"?{left:0,top:u,right:1,bottom:a.map.height}:e=="row"?{left:u,top:0,right:a.map.width,bottom:1}:a,m=e=="column"?c?r.cell:r.header_cell:e=="row"?l?r.cell:r.header_cell:r.cell;a.map.cellsInRect(f).forEach(p=>{const h=p+a.tableStart,g=o.doc.nodeAt(h);g&&o.setNodeMarkup(h,m,g.attrs)}),i(o)}return!0}}_r("row",{useDeprecatedLogic:!0});_r("column",{useDeprecatedLogic:!0});const g_=_r("cell",{useDeprecatedLogic:!0});function v_(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let i=e.index(-1)-1,r=e.before();i>=0;i--){const a=e.node(-1).child(i),o=a.lastChild;if(o)return r-1-o.nodeSize;r-=a.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let i=e.indexAfter(-1),r=e.after();i<n.childCount;i++){const a=n.child(i);if(a.childCount)return r+1;r+=a.nodeSize}}return null}function Hu(e){return function(t,n){if(!$t(t))return!1;const i=v_(Do(t),e);if(i==null)return!1;if(n){const r=t.doc.resolve(i);n(t.tr.setSelection(he.between(r,Xw(r))).scrollIntoView())}return!0}}function x_(e,t){const n=e.selection.$anchor;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(i),n.after(i)).scrollIntoView()),!0;return!1}function fa(e,t){const n=e.selection;if(!(n instanceof Le))return!1;if(t){const i=e.tr,r=lt(e.schema).cell.createAndFill().content;n.forEachCell((a,o)=>{a.content.eq(r)||i.replace(i.mapping.map(o+1),i.mapping.map(o+a.nodeSize-1),new ae(r,0,0))}),i.docChanged&&t(i)}return!0}function y_(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:i}=e;for(;t.childCount==1&&(n>0&&i>0||t.child(0).type.spec.tableRole=="table");)n--,i--,t=t.child(0).content;const r=t.child(0),a=r.type.spec.tableRole,o=r.type.schema,l=[];if(a=="row")for(let c=0;c<t.childCount;c++){let u=t.child(c).content;const f=c?0:Math.max(0,n-1),m=c<t.childCount-1?0:Math.max(0,i-1);(f||m)&&(u=ul(lt(o).row,new ae(u,f,m)).content),l.push(u)}else if(a=="cell"||a=="header_cell")l.push(n||i?ul(lt(o).row,new ae(t,n,i)).content:t);else return null;return k_(o,l)}function k_(e,t){const n=[];for(let r=0;r<t.length;r++){const a=t[r];for(let o=a.childCount-1;o>=0;o--){const{rowspan:l,colspan:c}=a.child(o).attrs;for(let u=r;u<r+l;u++)n[u]=(n[u]||0)+c}}let i=0;for(let r=0;r<n.length;r++)i=Math.max(i,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(J.empty),n[r]<i){const a=lt(e).cell.createAndFill(),o=[];for(let l=n[r];l<i;l++)o.push(a);t[r]=t[r].append(J.from(o))}return{height:t.length,width:i,rows:t}}function ul(e,t){const n=e.createAndFill();return new $f(n).replace(0,n.content.size,t).doc}function w_({width:e,height:t,rows:n},i,r){if(e!=i){const a=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],u=[];for(let f=a[l]||0,m=0;f<i;m++){let p=c.child(m%c.childCount);f+p.attrs.colspan>i&&(p=p.type.createChecked(fi(p.attrs,p.attrs.colspan,f+p.attrs.colspan-i),p.content)),u.push(p),f+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)a[l+h]=(a[l+h]||0)+p.attrs.colspan}o.push(J.from(u))}n=o,e=i}if(t!=r){const a=[];for(let o=0,l=0;o<r;o++,l++){const c=[],u=n[l%t];for(let f=0;f<u.childCount;f++){let m=u.child(f);o+m.attrs.rowspan>r&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,r-m.attrs.rowspan)},m.content)),c.push(m)}a.push(J.from(c))}n=a,t=r}return{width:e,height:t,rows:n}}function __(e,t,n,i,r,a,o){const l=e.doc.type.schema,c=lt(l);let u,f;if(r>t.width)for(let m=0,p=0;m<t.height;m++){const h=n.child(m);p+=h.nodeSize;const g=[];let b;h.lastChild==null||h.lastChild.type==c.cell?b=u||(u=c.cell.createAndFill()):b=f||(f=c.header_cell.createAndFill());for(let x=t.width;x<r;x++)g.push(b);e.insert(e.mapping.slice(o).map(p-1+i),g)}if(a>t.height){const m=[];for(let g=0,b=(t.height-1)*t.width;g<Math.max(t.width,r);g++){const x=g>=t.width?!1:n.nodeAt(t.map[b+g]).type==c.header_cell;m.push(x?f||(f=c.header_cell.createAndFill()):u||(u=c.cell.createAndFill()))}const p=c.row.create(null,J.from(m)),h=[];for(let g=t.height;g<a;g++)h.push(p);e.insert(e.mapping.slice(o).map(i+n.nodeSize-2),h)}return!!(u||f)}function qu(e,t,n,i,r,a,o,l){if(o==0||o==t.height)return!1;let c=!1;for(let u=r;u<a;u++){const f=o*t.width+u,m=t.map[f];if(t.map[f-t.width]==m){c=!0;const p=n.nodeAt(m),{top:h,left:g}=t.findCell(m);e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p.attrs,rowspan:o-h}),e.insert(e.mapping.slice(l).map(t.positionAt(o,g,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-o})),u+=p.attrs.colspan-1}}return c}function ju(e,t,n,i,r,a,o,l){if(o==0||o==t.width)return!1;let c=!1;for(let u=r;u<a;u++){const f=u*t.width+o,m=t.map[f];if(t.map[f-1]==m){c=!0;const p=n.nodeAt(m),h=t.colCount(m),g=e.mapping.slice(l).map(m+i);e.setNodeMarkup(g,null,fi(p.attrs,o-h,p.attrs.colspan-(o-h))),e.insert(g+p.nodeSize,p.type.createAndFill(fi(p.attrs,0,o-h))),u+=p.attrs.rowspan-1}}return c}function $u(e,t,n,i,r){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw new Error("No table found");let o=He.get(a);const{top:l,left:c}=i,u=c+r.width,f=l+r.height,m=e.tr;let p=0;function h(){if(a=n?m.doc.nodeAt(n-1):m.doc,!a)throw new Error("No table found");o=He.get(a),p=m.mapping.maps.length}__(m,o,a,n,u,f,p)&&h(),qu(m,o,a,n,c,u,l,p)&&h(),qu(m,o,a,n,c,u,f,p)&&h(),ju(m,o,a,n,l,f,c,p)&&h(),ju(m,o,a,n,l,f,u,p)&&h();for(let g=l;g<f;g++){const b=o.positionAt(g,c,a),x=o.positionAt(g,u,a);m.replace(m.mapping.slice(p).map(b+n),m.mapping.slice(p).map(x+n),new ae(r.rows[g-l],0,0))}h(),m.setSelection(new Le(m.doc.resolve(n+o.positionAt(l,c,a)),m.doc.resolve(n+o.positionAt(f-1,u-1,a)))),t(m)}const S_=nk({ArrowLeft:pa("horiz",-1),ArrowRight:pa("horiz",1),ArrowUp:pa("vert",-1),ArrowDown:pa("vert",1),"Shift-ArrowLeft":ma("horiz",-1),"Shift-ArrowRight":ma("horiz",1),"Shift-ArrowUp":ma("vert",-1),"Shift-ArrowDown":ma("vert",1),Backspace:fa,"Mod-Backspace":fa,Delete:fa,"Mod-Delete":fa});function Ca(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function pa(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;if(a instanceof Le)return Ca(n,i,ge.near(a.$headCell,t));if(e!="horiz"&&!a.empty)return!1;const o=om(r,e,t);if(o==null)return!1;if(e=="horiz")return Ca(n,i,ge.near(n.doc.resolve(a.head+t),t));{const l=n.doc.resolve(o),c=Yp(l,e,t);let u;return c?u=ge.near(c,1):t<0?u=ge.near(n.doc.resolve(l.before(-1)),-1):u=ge.near(n.doc.resolve(l.after(-1)),1),Ca(n,i,u)}}}function ma(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;let o;if(a instanceof Le)o=a;else{const c=om(r,e,t);if(c==null)return!1;o=new Le(n.doc.resolve(c))}const l=Yp(o.$headCell,e,t);return l?Ca(n,i,new Le(o.$anchorCell,l)):!1}}function C_(e,t){const n=e.state.doc,i=di(n.resolve(t));return i?(e.dispatch(e.state.tr.setSelection(new Le(i))),!0):!1}function E_(e,t,n){if(!$t(e.state))return!1;let i=y_(n);const r=e.state.selection;if(r instanceof Le){i||(i={width:1,height:1,rows:[J.from(ul(lt(e.state.schema).cell,n))]});const a=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),l=He.get(a).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return i=w_(i,l.right-l.left,l.bottom-l.top),$u(e.state,e.dispatch,o,l,i),!0}else if(i){const a=Do(e.state),o=a.start(-1);return $u(e.state,e.dispatch,o,He.get(a.node(-1)).findCell(a.pos-o),i),!0}else return!1}function A_(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const i=Wu(e,t.target);let r;if(t.shiftKey&&e.state.selection instanceof Le)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&(r=di(e.state.selection.$anchor))!=null&&((n=ms(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)a(r,t),t.preventDefault();else if(!i)return;function a(c,u){let f=ms(e,u);const m=Mn.getState(e.state)==null;if(!f||!cc(c,f))if(m)f=c;else return;const p=new Le(c,f);if(m||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);m&&h.setMeta(Mn,c.pos),e.dispatch(h)}}function o(){e.root.removeEventListener("mouseup",o),e.root.removeEventListener("dragstart",o),e.root.removeEventListener("mousemove",l),Mn.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Mn,-1))}function l(c){const u=c,f=Mn.getState(e.state);let m;if(f!=null)m=e.state.doc.resolve(f);else if(Wu(e,u.target)!=i&&(m=ms(e,t),!m))return o();m&&a(m,u)}e.root.addEventListener("mouseup",o),e.root.addEventListener("dragstart",o),e.root.addEventListener("mousemove",l)}function om(e,t,n){if(!(e.state.selection instanceof he))return null;const{$head:i}=e.state.selection;for(let r=i.depth-1;r>=0;r--){const a=i.node(r);if((n<0?i.index(r):i.indexAfter(r))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const o=i.before(r),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?o:null}}return null}function Wu(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function ms(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:i,pos:r}=n;return i>=0&&di(e.state.doc.resolve(i))||di(e.state.doc.resolve(r))}var T_=class{constructor(t,n){this.node=t,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")),dl(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,dl(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function dl(e,t,n,i,r,a){let o=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let m=0,p=0;m<u.childCount;m++){const{colspan:h,colwidth:g}=u.child(m).attrs;for(let b=0;b<h;b++,p++){const x=r==p?a:g&&g[b],v=x?x+"px":"";if(o+=x||i,x||(l=!1),c)c.style.width!=v&&(c.style.width=v),c=c.nextSibling;else{const y=document.createElement("col");y.style.width=v,t.appendChild(y)}}}for(;c;){var f;const m=c.nextSibling;(f=c.parentNode)===null||f===void 0||f.removeChild(c),c=m}l?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const Nt=new at("tableColumnResizing");function N_({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:i=T_,lastColumnResizable:r=!0}={}){const a=new dt({key:Nt,state:{init(o,l){var c;const u=(c=a.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,f=lt(l.schema).table.name;return i&&u&&(u[f]=(m,p)=>new i(m,n,p)),new O_(-1,!1)},apply(o,l){return l.apply(o)}},props:{attributes:o=>{const l=Nt.getState(o);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,l)=>{M_(o,l,e,r)},mouseleave:o=>{D_(o)},mousedown:(o,l)=>{z_(o,l,t,n)}},decorations:o=>{const l=Nt.getState(o);if(l&&l.activeHandle>-1)return P_(o,l.activeHandle)},nodeViews:{}}});return a}var O_=class Ea{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,i=t.getMeta(Nt);if(i&&i.setHandle!=null)return new Ea(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new Ea(n.activeHandle,i.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return cl(t.doc.resolve(r))||(r=-1),new Ea(r,n.dragging)}return n}};function M_(e,t,n,i){if(!e.editable)return;const r=Nt.getState(e.state);if(r&&!r.dragging){const a=R_(t.target);let o=-1;if(a){const{left:l,right:c}=a.getBoundingClientRect();t.clientX-l<=n?o=Gu(e,t,"left",n):c-t.clientX<=n&&(o=Gu(e,t,"right",n))}if(o!=r.activeHandle){if(!i&&o!==-1){const l=e.state.doc.resolve(o),c=l.node(-1),u=He.get(c),f=l.start(-1);if(u.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==u.width-1)return}sm(e,o)}}}function D_(e){if(!e.editable)return;const t=Nt.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&sm(e,-1)}function z_(e,t,n,i){var r;if(!e.editable)return!1;const a=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,o=Nt.getState(e.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const l=e.state.doc.nodeAt(o.activeHandle),c=I_(e,o.activeHandle,l.attrs);e.dispatch(e.state.tr.setMeta(Nt,{setDragging:{startX:t.clientX,startWidth:c}}));function u(m){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",f);const p=Nt.getState(e.state);p!=null&&p.dragging&&(L_(e,p.activeHandle,Ku(p.dragging,m,n)),e.dispatch(e.state.tr.setMeta(Nt,{setDragging:null})))}function f(m){if(!m.which)return u(m);const p=Nt.getState(e.state);if(p&&p.dragging){const h=Ku(p.dragging,m,n);Xu(e,p.activeHandle,h,i)}}return Xu(e,o.activeHandle,c,i),a.addEventListener("mouseup",u),a.addEventListener("mousemove",f),t.preventDefault(),!0}function I_(e,t,{colspan:n,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const a=e.domAtPos(t);let o=a.node.childNodes[a.offset].offsetWidth,l=n;if(i)for(let c=0;c<n;c++)i[c]&&(o-=i[c],l--);return o/l}function R_(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function Gu(e,t,n,i){const r=n=="right"?-i:i,a=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!a)return-1;const{pos:o}=a,l=di(e.state.doc.resolve(o));if(!l)return-1;if(n=="right")return l.pos;const c=He.get(l.node(-1)),u=l.start(-1),f=c.map.indexOf(l.pos-u);return f%c.width==0?-1:u+c.map[f-1]}function Ku(e,t,n){const i=t.clientX-e.startX;return Math.max(n,e.startWidth+i)}function sm(e,t){e.dispatch(e.state.tr.setMeta(Nt,{setHandle:t}))}function L_(e,t,n){const i=e.state.doc.resolve(t),r=i.node(-1),a=He.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let u=0;u<a.height;u++){const f=u*a.width+l;if(u&&a.map[f]==a.map[f-a.width])continue;const m=a.map[f],p=r.nodeAt(m).attrs,h=p.colspan==1?0:l-a.colCount(m);if(p.colwidth&&p.colwidth[h]==n)continue;const g=p.colwidth?p.colwidth.slice():B_(p.colspan);g[h]=n,c.setNodeMarkup(o+m,null,{...p,colwidth:g})}c.docChanged&&e.dispatch(c)}function Xu(e,t,n,i){const r=e.state.doc.resolve(t),a=r.node(-1),o=r.start(-1),l=He.get(a).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=e.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&dl(a,c.firstChild,c,i,l,n)}function B_(e){return Array(e).fill(0)}function P_(e,t){const n=[],i=e.doc.resolve(t),r=i.node(-1);if(!r)return Ve.empty;const a=He.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const f=l+u*a.width;if((l==a.width-1||a.map[f]!=a.map[f+1])&&(u==0||a.map[f]!=a.map[f-a.width])){var c;const m=a.map[f],p=o+m+r.nodeAt(m).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=Nt.getState(e))===null||c===void 0)&&c.dragging&&n.push(ot.node(o+m,o+m+r.nodeAt(m).nodeSize,{class:"column-resize-dragging"})),n.push(ot.widget(p,h))}}return Ve.create(e.doc,n)}function F_({allowTableNodeSelection:e=!1}={}){return new dt({key:Mn,state:{init(){return null},apply(t,n){const i=t.getMeta(Mn);if(i!=null)return i==-1?null:i;if(n==null||!t.docChanged)return n;const{deleted:r,pos:a}=t.mapping.mapResult(n);return r?null:a}},props:{decorations:Qw,handleDOMEvents:{mousedown:A_},createSelectionBetween(t){return Mn.getState(t.state)!=null?t.state.selection:null},handleTripleClick:C_,handleKeyDown:S_,handlePaste:E_},appendTransaction(t,n,i){return t_(i,im(i,n),e)}})}function fl(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function Ju(e,t,n,i,r,a){var o;let l=0,c=!0,u=t.firstChild;const f=e.firstChild;if(f!==null)for(let m=0,p=0;m<f.childCount;m+=1){const{colspan:h,colwidth:g}=f.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const x=r===p?a:g&&g[b],v=x?`${x}px`:"";if(l+=x||i,x||(c=!1),u){if(u.style.width!==v){const[y,k]=fl(i,x);u.style.setProperty(y,k)}u=u.nextSibling}else{const y=document.createElement("col"),[k,w]=fl(i,x);y.style.setProperty(k,w),t.appendChild(y)}}}for(;u;){const m=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=m}c?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class V_{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ju(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,Ju(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function U_(e,t,n,i){let r=0,a=!0;const o=[],l=e.firstChild;if(!l)return{};for(let m=0,p=0;m<l.childCount;m+=1){const{colspan:h,colwidth:g}=l.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const x=n===p?i:g&&g[b];r+=x||t,x||(a=!1);const[v,y]=fl(t,x);o.push(["col",{style:`${v}: ${y}`}])}}const c=a?`${r}px`:"",u=a?"":`${r}px`;return{colgroup:["colgroup",{},...o],tableWidth:c,tableMinWidth:u}}function Zu(e,t){return e.createAndFill()}function H_(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const i=e.nodes[n];i.spec.tableRole&&(t[i.spec.tableRole]=i)}),e.cached.tableNodeTypes=t,t}function q_(e,t,n,i,r){const a=H_(e),o=[],l=[];for(let u=0;u<n;u+=1){const f=Zu(a.cell);if(f&&l.push(f),i){const m=Zu(a.header_cell);m&&o.push(m)}}const c=[];for(let u=0;u<t;u+=1)c.push(a.row.createChecked(null,i&&u===0?o:l));return a.table.createChecked(null,c)}function j_(e){return e instanceof Le}const ha=({editor:e})=>{const{selection:t}=e.state;if(!j_(t))return!1;let n=0;const i=Up(t.ranges[0].$from,a=>a.type.name==="table");return i==null||i.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},$_=Se.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:V_,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:i,tableMinWidth:r}=U_(e,this.options.cellMinWidth),a=["table",Be(this.options.HTMLAttributes,t,{style:i?`width: ${i}`:`min-width: ${r}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:i,dispatch:r,editor:a})=>{const o=q_(a.schema,e,t,n);if(r){const l=i.selection.from+1;i.replaceSelectionWith(o).scrollIntoView().setSelection(he.near(i.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>r_(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>a_(e,t),deleteColumn:()=>({state:e,dispatch:t})=>s_(e,t),addRowBefore:()=>({state:e,dispatch:t})=>c_(e,t),addRowAfter:()=>({state:e,dispatch:t})=>u_(e,t),deleteRow:()=>({state:e,dispatch:t})=>f_(e,t),deleteTable:()=>({state:e,dispatch:t})=>x_(e,t),mergeCells:()=>({state:e,dispatch:t})=>Fu(e,t),splitCell:()=>({state:e,dispatch:t})=>Vu(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>_r("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>_r("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>g_(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Fu(e,t)?!0:Vu(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:i})=>h_(e,t)(n,i),goToNextCell:()=>({state:e,dispatch:t})=>Hu(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Hu(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&im(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const i=Le.create(t.doc,e.anchorCell,e.headCell);t.setSelection(i)}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:ha,"Mod-Backspace":ha,Delete:ha,"Mod-Delete":ha}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[N_({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],F_({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Qe(st(e,"tableRole",t))}}}),W_=Se.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Be(this.options.HTMLAttributes,e),0]}}),G_=Se.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Be(this.options.HTMLAttributes,e),0]}}),K_=Se.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Be(this.options.HTMLAttributes,e),0]}}),X_=je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new dt({key:new at("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,r=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((o,l)=>{const c=i>=l&&i<=l+o.nodeSize,u=!o.isLeaf&&Yl(o);if((c||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const m=ot.node(l,l+o.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:c}):this.options.placeholder});r.push(m)}return this.options.includeChildren}),Ve.create(e,r)}}})]}}),J_=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var i,r;const a=n.getAttribute("style"),o=(r=(i=n.parentElement)===null||i===void 0?void 0:i.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${o};${a}`)})};St.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&J_(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,i)=>{if(n.isTextblock)return!0;n.marks.filter(r=>r.type===this.type).some(r=>Object.values(r.attrs).some(a=>!!a))||e.removeMark(i,i+n.nodeSize,this.type)}),!0}}}});const Z_=je.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Q_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Y_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,e3=St.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[sw({find:Q_,type:this.type})]},addPasteRules(){return[qp({find:Y_,type:this.type})]}});function lm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={PROCESSOR_VERSION:"1.4.61",error:function(e){throw typeof Error>"u"?new Error("citeproc-js error: "+e):"citeproc-js error: "+e},debug:function(e){typeof console>"u"?dump("CSL: "+e+`
|
|
596
607
|
`):console.log("citeproc-js warning: "+e)},toLocaleUpperCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleUpperCase(t)}catch{e=e.toUpperCase()}return e},toLocaleLowerCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleLowerCase(t)}catch{e=e.toLowerCase()}return e},LOCATOR_LABELS_REGEXP:new RegExp("^((vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\\.)\\s+(.*)"),STATUTE_SUBDIV_PLAIN_REGEX:/(?:(?:^| )(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_PLAIN_REGEX_FRONT:/(?:^\s*[.,;]*\s*(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_STRINGS:{"vrs.":"verse","sv.":"sub-verbo","subpara.":"subparagraph","op.":"opus","subch.":"subchapter","add.":"addendum","amend.":"amendment","annot.":"annotation","app.":"appendix","art.":"article","bibliog.":"bibliography","bk.":"book","ch.":"chapter","cl.":"clause","col.":"column","cmt.":"comment","dec.":"decision","dept.":"department","ex.":"example","fig.":"figure","fld.":"field","fol.":"folio","n.":"note","hypo.":"hypothetical","illus.":"illustration","intro.":"introduction","l.":"line","no.":"issue","p.":"page","pp.":"page","para.":"paragraph","pt.":"part","pmbl.":"preamble","princ.":"principle","pub.":"publication","r.":"rule","rn.":"randnummer","sched.":"schedule","sec.":"section","ser.":"series,","subdiv.":"subdivision","subsec.":"subsection","supp.":"supplement","tbl.":"table","tit.":"title","vol.":"volume"},STATUTE_SUBDIV_STRINGS_REVERSE:{verse:"vrs.","sub-verbo":"sv.","sub verbo":"sv.",subparagraph:"subpara.",opus:"op.",subchapter:"subch.",addendum:"add.",amendment:"amend.",annotation:"annot.",appendix:"app.",article:"art.",bibliography:"bibliog.",book:"bk.",chapter:"ch.",clause:"cl.",column:"col.",comment:"cmt.",decision:"dec.",department:"dept.",example:"ex.",figure:"fig.",field:"fld.",folio:"fol.",note:"n.",hypothetical:"hypo.",illustration:"illus.",introduction:"intro.",line:"l.",issue:"no.",page:"p.",paragraph:"para.",part:"pt.",preamble:"pmbl.",principle:"princ.",publication:"pub.",rule:"r.",randnummer:"rn.",schedule:"sched.",section:"sec.","series,":"ser.",subdivision:"subdiv.",subsection:"subsec.",supplement:"supp.",table:"tbl.",title:"tit.",volume:"vol."},LOCATOR_LABELS_MAP:{vrs:"verse",sv:"sub-verbo",subpara:"subparagraph",op:"opus",subch:"subchapter",add:"addendum",amend:"amendment",annot:"annotation",app:"appendix",art:"article",bibliog:"bibliography",bk:"book",ch:"chapter",cl:"clause",col:"column",cmt:"comment",dec:"decision",dept:"department",ex:"example",fig:"figure",fld:"field",fol:"folio",n:"note",hypo:"hypothetical",illus:"illustration",intro:"introduction",l:"line",no:"issue",p:"page",pp:"page",para:"paragraph",pt:"part",pmbl:"preamble",princ:"principle",pub:"publication",r:"rule",rn:"randnummer",sched:"schedule",sec:"section",ser:"series,",subdiv:"subdivision",subsec:"subsection",supp:"supplement",tbl:"table",tit:"title",vol:"volume"},MODULE_MACROS:{"juris-pretitle":!0,"juris-title":!0,"juris-pretitle-short":!0,"juris-title-short":!0,"juris-main":!0,"juris-main-short":!0,"juris-tail":!0,"juris-tail-short":!0,"juris-locator":!0},MODULE_TYPES:{legal_case:!0,legislation:!0,bill:!0,hearing:!0,gazette:!0,report:!0,regulation:!0,standard:!0,patent:!0,locator:!0},checkNestedBrace:function(e){e.opt.xclass==="note"?(this.depth=0,this.update=function(n){for(var n=n||"",i=n.split(/([\(\)])/),r=1,a=i.length;r<a;r+=2)i[r]==="("?(this.depth%2===1&&(i[r]="["),this.depth+=1):i[r]===")"&&(this.depth%2===0&&(i[r]="]"),this.depth-=1);var o=i.join("");return o}):this.update=function(t){return t}},MULTI_FIELDS:["event","publisher","publisher-place","event-place","title","container-title","collection-title","authority","genre","title-short","medium","country","jurisdiction","archive","archive-place"],LangPrefsMap:{title:"titles","title-short":"titles",event:"titles",genre:"titles",medium:"titles","container-title":"journals","collection-title":"titles",archive:"journals",publisher:"publishers",authority:"publishers","publisher-place":"places","event-place":"places","archive-place":"places",jurisdiction:"places",number:"places",edition:"places",issue:"places",volume:"places"},AbbreviationSegments:function(){this["container-title"]={},this["collection-title"]={},this["institution-entire"]={},this["institution-part"]={},this.nickname={},this.number={},this.title={},this.place={},this.hereinafter={},this.classic={},this["container-phrase"]={},this["title-phrase"]={}},getAbbrevsDomain:function(e,t,n){var i=null;if(e.opt.availableAbbrevDomains&&t&&t!=="default"){var r=e.locale[e.opt.lang].opts["jurisdiction-preference"],a=null;if(e.locale[n]&&(a=e.locale[n].opts["jurisdiction-preference"]),a){for(var o=a.length-1;o>-1;o--)if(e.opt.availableAbbrevDomains[t].indexOf(a[o])>-1){i=a[o];break}}if(!i&&r){for(var o=r.length-1;o>-1;o--)if(e.opt.availableAbbrevDomains[t].indexOf(r[o])>-1){i=r[o];break}}}return i},FIELD_CATEGORY_REMAP:{title:"title","container-title":"container-title","collection-title":"collection-title",country:"place",number:"number",place:"place",archive:"container-title","title-short":"title",genre:"title",event:"title",medium:"title","archive-place":"place","publisher-place":"place","event-place":"place",jurisdiction:"place","language-name":"place","language-name-original":"place","call-number":"number","chapter-number":"number","collection-number":"number",edition:"number",page:"number",issue:"number",locator:"number","locator-extra":"number","number-of-pages":"number","number-of-volumes":"number",volume:"number","citation-number":"number",publisher:"institution-part"},parseLocator:function(e){if(this.opt.development_extensions.locator_date_and_revision&&e.locator){e.locator=""+e.locator;var t=e.locator.indexOf("|");if(t>-1){var n=e.locator;e.locator=n.slice(0,t),n=n.slice(t+1);var i=n.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*/);i&&(e["locator-date"]=this.fun.dateparser.parseDateToObject(i[1]),n=n.slice(i[1].length)),e["locator-extra"]=n.replace(/^\s+/,"").replace(/\s+$/,"")}}return e.locator&&(e.locator=(""+e.locator).replace(/\s+$/,"")),e},normalizeLocaleStr:function(e){if(e){var t=e.split("-");return t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),t.join("-")}},parseNoteFieldHacks:function(e,t,n){if(typeof e.note=="string"){for(var i=[],r=e.note.split(`
|
|
597
608
|
`),a=0,o=r.length;a<o;a++){var l=r[a],i=[],c=l.match(d.NOTE_FIELDS_REGEXP);if(c){for(var u=l.split(d.NOTE_FIELDS_REGEXP),f=0,m=u.length-1;f<m;f++)i.push(u[f]),i.push(c[f]);i.push(u[u.length-1]);for(var f=1,m=i.length;f<m&&!(i[f-1].trim()&&(a>0||f>1)&&!i[f-1].match(d.NOTE_FIELD_REGEXP));f+=2)i[f]=`
|
|
598
609
|
`+i[f].slice(2,-1).trim()+`
|
|
@@ -641,14 +652,38 @@
|
|
|
641
652
|
`},"@display/block":function(e,t){return`
|
|
642
653
|
`+t},"@display/left-margin":function(e,t){return t},"@display/right-inline":function(e,t){return t},"@display/indent":function(e,t){return`
|
|
643
654
|
`+t},"@showid/true":function(e,t,n){return t},"@URL/true":function(e,t){return t},"@DOI/true":function(e,t){return t}};d.Output.Formats=new d.Output.Formats;d.Registry=function(e){this.debug=!1,this.state=e,this.registry={},this.reflist=[],this.refhash={},this.namereg=new d.Registry.NameReg(e),this.citationreg=new d.Registry.CitationReg(e),this.authorstrings={},this.masterMap={},this.mylist=[],this.myhash={},this.deletes=[],this.inserts=[],this.uncited={},this.refreshes={},this.akeys={},this.oldseq={},this.return_data={},this.ambigcites={},this.ambigresets={},this.sorter=new d.Registry.Comparifier(e,"bibliography_sort"),this.getSortedIds=function(){for(var t=[],n=0,i=this.reflist.length;n<i;n+=1)t.push(""+this.reflist[n].id);return t},this.getSortedRegistryItems=function(){for(var t=[],n=0,i=this.reflist.length;n<i;n+=1)t.push(this.reflist[n]);return t}};d.Registry.prototype.init=function(e,t){var n,i;if(this.oldseq={},t){this.uncited={};for(var n=0,i=e.length;n<i;n+=1)this.myhash[e[n]]||this.mylist.push(""+e[n]),this.uncited[e[n]]=!0,this.myhash[e[n]]=!0}else{for(var r in this.uncited)e.push(r);var a={};for(n=e.length-1;n>-1;n+=-1)a[e[n]]?e=e.slice(0,n).concat(e.slice(n+1)):a[e[n]]=!0;this.mylist=e,this.myhash=a}this.refreshes={},this.touched={},this.ambigsTouched={},this.ambigresets={}};d.Registry.prototype.dopurge=function(e){for(var t=this.mylist.length-1;t>-1;t+=-1)this.citationreg.citationsByItemId&&(!this.citationreg.citationsByItemId||!this.citationreg.citationsByItemId[this.mylist[t]])&&!e[this.mylist[t]]&&(delete this.myhash[this.mylist[t]],delete this.uncited[this.mylist[t]],this.mylist=this.mylist.slice(0,t).concat(this.mylist.slice(t+1)));this.dodeletes(this.myhash)};d.Registry.prototype.dodeletes=function(e){var t,n,i,r,a,o,l,c,u;if(typeof e=="string"){var n=e;e={},e[n]=!0}for(var n in this.registry)if(!e[n]){if(this.uncited[n])continue;t=this.namereg.delitems(n);for(l in t)this.refreshes[l]=!0;for(i=this.registry[n].ambig,c=this.ambigcites[i].indexOf(n),c>-1&&(o=this.ambigcites[i].slice(),this.ambigcites[i]=o.slice(0,c).concat(o.slice(c+1,o.length)),this.ambigresets[i]=this.ambigcites[i].length),a=this.ambigcites[i].length,r=0;r<a;r+=1)u=""+this.ambigcites[i][r],this.refreshes[u]=!0;if(this.registry[n].siblings){if(this.registry[n].siblings.length==1){var f=this.registry[n].siblings[0];this.registry[f].siblings&&(this.registry[f].siblings.pop(),this.registry[f].master=!0)}else if(this.registry[n].siblings.length>1){var m=[n];if(this.registry[n].master){var p=this.registry[n].siblings[0],h=this.registry[p];h.master=!0,m.push(p)}for(var g=[],b=this.registry[n].siblings.length-1;b>-1;b+=-1){var x=this.registry[n].siblings.pop();m.indexOf(x)===-1&&g.push(x)}for(var b=g.length-1;b>-1;b+=-1)this.registry[n].siblings.push(g[b])}}for(var v=this.reflist.length-1;v>-1;v--)this.reflist[v].id===n&&(this.reflist=this.reflist.slice(0,v).concat(this.reflist.slice(v+1)));delete this.registry[n],delete this.refhash[n],this.return_data.bibchange=!0}};d.Registry.prototype.doinserts=function(e){var t,n,i,r,a,o,l;typeof e=="string"&&(e=[e]);for(var o=0,l=e.length;o<l;o+=1)t=e[o],this.registry[t]||(n=this.state.retrieveItem(t),i=d.getAmbiguousCite.call(this.state,n),this.ambigsTouched[i]=!0,n.legislation_id||(this.akeys[i]=!0),r={id:""+t,seq:0,offset:0,sortkeys:!1,ambig:!1,rendered:!1,disambig:!1,ref:n,newItem:!0},this.registry[t]=r,this.citationreg.citationsByItemId&&this.citationreg.citationsByItemId[t]&&(this.registry[t]["first-reference-note-number"]=this.citationreg.citationsByItemId[t][0].properties.noteIndex),a=d.getAmbigConfig.call(this.state),this.registerAmbigToken(i,t,a),this.touched[t]=!0,this.return_data.bibchange=!0)};d.Registry.prototype.rebuildlist=function(e){var t,n,i,r;if(e)for(this.reflist=[],t=this.mylist.length,n=0;n<t;n+=1)i=this.mylist[n],r=this.registry[i],this.reflist.push(r),this.oldseq[i]=this.registry[i].seq,this.registry[i].seq=n+1;else for(this.reflist_inserts=[],t=this.mylist.length,n=0;n<t;n+=1)i=this.mylist[n],r=this.registry[i],r.newItem&&this.reflist_inserts.push(r),this.oldseq[i]=this.registry[i].seq,this.registry[i].seq=n+1};d.Registry.prototype.dorefreshes=function(){var e,t,n,i,r;for(var e in this.refreshes)if(t=this.registry[e],!!t){t.sortkeys=void 0,n=this.state.refetchItem(e);var i=t.ambig;typeof i>"u"&&(this.state.tmp.disambig_settings=!1,i=d.getAmbiguousCite.call(this.state,n),r=d.getAmbigConfig.call(this.state),this.registerAmbigToken(i,e,r));for(var a in this.ambigresets)if(this.ambigresets[a]===1){var o=this.ambigcites[i][0],n=this.state.refetchItem(o);this.registry[o].disambig=new d.AmbigConfig,this.state.tmp.disambig_settings=!1;var i=d.getAmbiguousCite.call(this.state,n),r=d.getAmbigConfig.call(this.state);this.registerAmbigToken(i,o,r)}this.state.tmp.taintedItemIDs[e]=!0,this.ambigsTouched[i]=!0,n.legislation_id||(this.akeys[i]=!0),this.touched[e]=!0}};d.Registry.prototype.setdisambigs=function(){for(var e in this.ambigsTouched)this.state.disambiguate.run(e);this.ambigsTouched={},this.akeys={}};d.Registry.prototype.renumber=function(){var e,t,n;for(this.state.bibliography_sort.opt.citation_number_sort_direction===d.DESCENDING&&(this.state.bibliography_sort.tmp.citation_number_map={}),e=this.reflist.length,t=0;t<e;t+=1)n=this.reflist[t],n.seq=t+1,this.state.bibliography_sort.opt.citation_number_sort_direction===d.DESCENDING&&(this.state.bibliography_sort.tmp.citation_number_map[n.seq]=this.reflist.length-n.seq+1),this.state.opt.update_mode===d.NUMERIC&&n.seq!=this.oldseq[n.id]&&(this.state.tmp.taintedItemIDs[n.id]=!0),n.seq!=this.oldseq[n.id]&&(this.return_data.bibchange=!0)};d.Registry.prototype.setsortkeys=function(){for(var e,t=0,n=this.mylist.length;t<n;t+=1){var e=this.mylist[t];(this.touched[e]||this.state.tmp.taintedItemIDs[e]||!this.registry[e].sortkeys)&&(this.registry[e].sortkeys=d.getSortKeys.call(this.state,this.state.retrieveItem(e),"bibliography_sort"))}};d.Registry.prototype._insertItem=function(e,t){return t.splice(this._locationOf(e,t)+1,0,e),t};d.Registry.prototype._locationOf=function(e,t,n,i){if(t.length===0)return-1;n=n||0,i=i||t.length;var r=n+i>>1,a=this.sorter.compareKeys(e,t[r]);if(i-n<=1)return a==-1?r-1:r;switch(a){case-1:return this._locationOf(e,t,n,r);case 0:return r;case 1:return this._locationOf(e,t,r,i)}};d.Registry.prototype.sorttokens=function(e){var t,n,i,r;if(!e){for(this.reflist_inserts=[],t=this.mylist.length,r=0;r<t;r+=1)n=this.mylist[r],i=this.registry[n],i.newItem&&this.reflist_inserts.push(i);for(var a in this.state.tmp.taintedItemIDs)if(this.registry[a]&&!this.registry[a].newItem)for(var o=this.reflist.length-1;o>-1;o--)this.reflist[o].id===a&&(this.reflist_inserts.push(this.reflist[o]),this.reflist=this.reflist.slice(0,o).concat(this.reflist.slice(o+1)));for(var o=0,l=this.reflist_inserts.length;o<l;o++){var i=this.reflist_inserts[o];delete i.newItem,this.reflist=this._insertItem(i,this.reflist)}for(r=0;r<t;r+=1)n=this.mylist[r],i=this.registry[n],this.registry[n].seq=r+1}};d.Registry.Comparifier=function(e,t){var n,i,r,a,o=d.getSortCompare.call(e,e.opt["default-locale-sort"]);n=e[t].opt.sort_directions,this.compareKeys=function(l,c){for(i=l.sortkeys?l.sortkeys.length:0,r=0;r<i;r+=1){var u=0;if(l.sortkeys[r]===c.sortkeys[r]?u=0:typeof l.sortkeys[r]>"u"?u=n[r][1]:typeof c.sortkeys[r]>"u"?u=n[r][0]:u=o(l.sortkeys[r],c.sortkeys[r]),0<u)return n[r][1];if(0>u)return n[r][0]}return l.seq>c.seq?1:l.seq<c.seq?-1:0},a=this.compareKeys,this.compareCompositeKeys=function(l,c){return a(l[1],c[1])}};d.Registry.prototype.compareRegistryTokens=function(e,t){return e.seq>t.seq?1:e.seq<t.seq?-1:0};d.Registry.prototype.registerAmbigToken=function(e,t,n){if(this.registry[t]||d.debug("Warning: unregistered item: itemID=("+t+"), akey=("+e+")"),this.registry[t]&&this.registry[t].disambig&&this.registry[t].disambig.names)for(var i=0,r=n.names.length;i<r;i+=1){var a=n.names[i],o=this.registry[t].disambig.names[i];if(a!==o)this.state.tmp.taintedItemIDs[t]=!0;else if(n.givens[i])for(var l=0,c=n.givens[i].length;l<c;l+=1){var u=n.givens[i][l],f=this.registry[t].disambig.givens[i][l];u!==f&&(this.state.tmp.taintedItemIDs[t]=!0)}}this.ambigcites[e]||(this.ambigcites[e]=[]),this.ambigcites[e].indexOf(""+t)===-1&&this.ambigcites[e].push(""+t),this.registry[t].ambig=e,this.registry[t].disambig=d.cloneAmbigConfig(n)};d.getSortKeys=function(e,t){var n,i,r,a,o,l;for(n=this.tmp.area,i=this.tmp.root,r=this.tmp.extension,a=d.Util.Sort.strip_prepositions,this.tmp.area=t,this.tmp.root=t.indexOf("_")>-1?t.slice(0,-5):t,this.tmp.extension="_sort",this.tmp.disambig_override=!0,this.tmp.disambig_request=!1,this.tmp.suppress_decorations=!0,d.getCite.call(this,e),this.tmp.suppress_decorations=!1,this.tmp.disambig_override=!1,o=this[t].keys.length,l=0;l<o;l+=1)this[t].keys[l]=a(this[t].keys[l]);return this.tmp.area=n,this.tmp.root=i,this.tmp.extension=r,this[t].keys};d.Registry.NameReg=function(e){var t,n,i,r,a,o,l,c,u,f,m,p;this.state=e,this.namereg={},this.nameind={},this.nameindpkeys={},this.itemkeyreg={},l=function(h){return h||(h=""),h.replace(/\./g," ").replace(/\s+/g," ").replace(/\s+$/,"")},c=function(h,g,b){t=l(b.family),h.opt["demote-non-dropping-particle"]==="never"&&b["non-dropping-particle"]&&b.family&&(t=`${t} ${b["non-dropping-particle"]}`),i=l(b.given);var x=i.match(/[,\!]* ([^,]+)$/);x&&x[1]===x[1].toLowerCase()&&(i=i.replace(/[,\!]* [^,]+$/,"")),n=d.Util.Names.initializeWith(h,i,"%s"),h.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&(t=""+g+t)},u=function(h,g,b,x,v,y){var k;if(e.tmp.area.slice(0,12)==="bibliography"&&!v)return typeof y=="string"?1:2;var w=e.nameOutput.getName(g,"locale-translit",!0);g=w.name,c(this.state,""+h,g),k=2,r=e.opt["disambiguate-add-givenname"],a=e.citation.opt["givenname-disambiguation-rule"];var S=a;if(a==="by-cite"&&(a="all-names"),v==="short"?k=0:typeof y=="string"&&(k=1),typeof this.namereg[t]>"u"||typeof this.namereg[t].ikey[n]>"u")return k;if(S==="by-cite"&&k<=x)return x;if(!r||typeof a=="string"&&a.slice(0,12)==="primary-name"&&b>0||(!a||a==="all-names"||a==="primary-name"?(this.namereg[t].count>1&&(k=1),(this.namereg[t].ikey&&this.namereg[t].ikey[n].count>1||this.namereg[t].count>1&&typeof y!="string")&&(k=2)):(a==="all-names-with-initials"||a==="primary-name-with-initials")&&(this.namereg[t].count>1?k=1:k=0),e.registry.registry[h]))return k;if(v=="short")return 0;if(typeof y=="string")return 1},f=function(h){var g,b,x,v,y;(typeof h=="string"||typeof h=="number")&&(h=[""+h]);var k={};for(b=h.length,g=0;g<b;g+=1)if(v=""+h[g],!!this.nameind[v]){for(y in this.nameind[v])if(this.nameind[v].hasOwnProperty(y)){var w=y.split("::");if(t=w[0],n=w[1],i=w[2],typeof this.namereg[t]>"u")continue;if(o=this.namereg[t].items,i&&this.namereg[t].ikey[n]&&this.namereg[t].ikey[n].skey[i]&&(p=this.namereg[t].ikey[n].skey[i].items,x=p.indexOf(""+v),x>-1&&(this.namereg[t].ikey[n].skey[i].items=p.slice(0,x).concat(p.slice([x+1]))),this.namereg[t].ikey[n].skey[i].items.length===0&&(delete this.namereg[t].ikey[n].skey[i],this.namereg[t].ikey[n].count+=-1,this.namereg[t].ikey[n].count<2)))for(var S=0,E=this.namereg[t].ikey[n].items.length;S<E;S+=1)e.tmp.taintedItemIDs[this.namereg[t].ikey[n].items[S]]=!0;if(n&&this.namereg[t].ikey[n]&&(x=this.namereg[t].ikey[n].items.indexOf(""+v),x>-1&&(o=this.namereg[t].ikey[n].items.slice(),this.namereg[t].ikey[n].items=o.slice(0,x).concat(o.slice([x+1]))),this.namereg[t].ikey[n].items.length===0&&(delete this.namereg[t].ikey[n],this.namereg[t].count+=-1,this.namereg[t].count<2)))for(var S=0,E=this.namereg[t].items.length;S<E;S+=1)e.tmp.taintedItemIDs[this.namereg[t].items[S]]=!0;t&&(x=this.namereg[t].items.indexOf(""+v),x>-1&&(o=this.namereg[t].items.slice(),this.namereg[t].items=o.slice(0,x).concat(o.slice([x+1],o.length))),this.namereg[t].items.length<2&&delete this.namereg[t]),delete this.nameind[v][y]}delete this.nameind[v],delete this.nameindpkeys[v]}return k},m=function(h,g,b){var x,v,y=e.nameOutput.getName(g,"locale-translit",!0);if(g=y.name,!(e.citation.opt["givenname-disambiguation-rule"]&&e.citation.opt["givenname-disambiguation-rule"].slice(0,8)==="primary-"&&b!==0)){if(c(this.state,""+h,g),t&&(typeof this.namereg[t]>"u"?(this.namereg[t]={},this.namereg[t].count=0,this.namereg[t].ikey={},this.namereg[t].items=[h]):this.namereg[t].items.indexOf(h)===-1&&this.namereg[t].items.push(h)),t&&n)if(typeof this.namereg[t].ikey[n]>"u"){if(this.namereg[t].ikey[n]={},this.namereg[t].ikey[n].count=0,this.namereg[t].ikey[n].skey={},this.namereg[t].ikey[n].items=[h],this.namereg[t].count+=1,this.namereg[t].count===2)for(var x=0,v=this.namereg[t].items.length;x<v;x+=1)e.tmp.taintedItemIDs[this.namereg[t].items[x]]=!0}else this.namereg[t].ikey[n].items.indexOf(h)===-1&&this.namereg[t].ikey[n].items.push(h);if(t&&n&&i)if(typeof this.namereg[t].ikey[n].skey[i]>"u"){if(this.namereg[t].ikey[n].skey[i]={},this.namereg[t].ikey[n].skey[i].items=[h],this.namereg[t].ikey[n].count+=1,this.namereg[t].ikey[n].count===2)for(var x=0,v=this.namereg[t].ikey[n].items.length;x<v;x+=1)e.tmp.taintedItemIDs[this.namereg[t].ikey[n].items[x]]=!0}else this.namereg[t].ikey[n].skey[i].items.indexOf(h)===-1&&this.namereg[t].ikey[n].skey[i].items.push(h);typeof this.nameind[h]>"u"&&(this.nameind[h]={},this.nameindpkeys[h]={}),t&&(this.nameind[h][t+"::"+n+"::"+i]=!0,this.nameindpkeys[h][t]=this.namereg[t])}},this.addname=m,this.delitems=f,this.evalname=u};d.Registry.CitationReg=function(){this.citationById={},this.citationByIndex=[]};d.Disambiguation=function(e){this.state=e,this.sys=this.state.sys,this.registry=e.registry.registry,this.ambigcites=e.registry.ambigcites,this.configModes(),this.debug=!1};d.Disambiguation.prototype.run=function(e){this.modes.length&&(this.debug&&this.state.sys.print("[A] === RUN ==="),this.akey=e,this.initVars(e)&&this.runDisambig())};d.Disambiguation.prototype.runDisambig=function(){var e;for(this.debug&&this.state.sys.print("[C] === runDisambig() ==="),this.initGivens=!0;this.lists.length;){for(this.gnameset=0,this.gname=0,this.clashes=[1,0];this.lists[0][1].length;)this.listpos=0,this.base||(this.base=this.lists[0][0]),e=this.incrementDisambig(),this.scanItems(this.lists[0]),this.evalScan(e);this.lists=this.lists.slice(1)}};d.Disambiguation.prototype.scanItems=function(e){var t,n,i;this.debug&&this.state.sys.print("[2] === scanItems() ==="),this.Item=e[1][0],this.ItemCite=d.getAmbiguousCite.call(this.state,this.Item,this.base,!0),this.scanlist=e[1],this.partners=[],this.partners.push(this.Item),this.nonpartners=[];for(var r=0,t=1,n=e[1].length;t<n;t+=1){i=e[1][t];var a=d.getAmbiguousCite.call(this.state,i,this.base,!0);this.debug&&t>1&&this.state.sys.print(" -----------"),this.ItemCite===a?(this.debug&&(this.state.sys.print(" [CLASH]--> "+this.Item.id+": "+this.ItemCite),this.state.sys.print(" "+i.id+": "+a)),r+=1,this.partners.push(i)):(this.debug&&(this.state.sys.print(" [clear]--> "+this.Item.id+": "+this.ItemCite),this.state.sys.print(" "+i.id+": "+a)),this.nonpartners.push(i))}this.clashes[0]=this.clashes[1],this.clashes[1]=r};d.Disambiguation.prototype.evalScan=function(e){this[this.modes[this.modeindex]](e),e&&(this.modeindex<this.modes.length-1?this.modeindex+=1:this.lists[this.listpos+1]=[this.base,[]])};d.Disambiguation.prototype.disNames=function(e){var t,n;if(this.debug&&this.state.sys.print("[3] == disNames() =="),this.clashes[1]===0&&this.nonpartners.length===1)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [a]: lone partner, one nonpartner"),this.state.sys.print(" registering "+this.partners[0].id+" and "+this.nonpartners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase),this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,[]];else if(this.clashes[1]===0)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [b]: lone partner, unknown number of remaining nonpartners"),this.state.sys.print(" registering "+this.partners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,this.nonpartners],this.nonpartners.length&&(this.initGivens=!0);else if(this.nonpartners.length===1)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [c]: lone nonpartner, unknown number of partners remaining"),this.state.sys.print(" registering "+this.nonpartners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,this.partners];else if(this.clashes[1]<this.clashes[0])this.captureStepToBase(),this.debug&&this.state.sys.print(" ** RESOLUTION [d]: better result, but no entries safe to register"),this.lists[this.listpos]=[this.betterbase,this.partners],this.lists.push([this.betterbase,this.nonpartners]);else if(this.debug&&this.state.sys.print(" ** RESOLUTION [e]: no improvement, and clashes remain"),e&&(this.lists[this.listpos]=[this.betterbase,this.nonpartners],this.lists.push([this.betterbase,this.partners]),this.modeindex===this.modes.length-1)){this.debug&&this.state.sys.print(" (registering clashing entries because we've run out of options)");for(var t=0,n=this.partners.length;t<n;t+=1)this.state.registry.registerAmbigToken(this.akey,""+this.partners[t].id,this.betterbase);this.lists[this.listpos]=[this.betterbase,[]]}};d.Disambiguation.prototype.disExtraText=function(){this.debug&&this.state.sys.print("[3] === disExtraText ==");var e=!1;if(this.clashes[1]===0&&this.nonpartners.length<2&&(e=!0),!e&&(!this.base.disambiguate||this.state.tmp.disambiguate_count!==this.state.tmp.disambiguate_maxMax))if(this.modeindex=0,this.base.disambiguate=this.state.tmp.disambiguate_count,this.betterbase.disambiguate=this.state.tmp.disambiguate_count,this.base.disambiguate)this.disNames();else{this.initGivens=!0,this.base.disambiguate=1;for(var t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0}else if(e||this.state.tmp.disambiguate_count===this.state.tmp.disambiguate_maxMax)if(e||this.modeindex===this.modes.length-1){for(var i=this.lists[this.listpos][0],t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0,this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][t].id,i);this.lists[this.listpos]=[this.betterbase,[]]}else{this.modeindex=this.modes.length-1;var i=this.lists[this.listpos][0];i.disambiguate=!0;for(var t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0,this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][t].id,i)}};d.Disambiguation.prototype.disYears=function(){var e,t,n,i;this.debug&&this.state.sys.print("[3] === disYears =="),n=[];var r=this.lists[this.listpos][0];if(this.clashes[1])for(var a=0,o=this.state.registry.mylist.length;a<o;a+=1)for(var l=this.state.registry.mylist[a],c=0,u=this.lists[this.listpos][1].length;c<u;c+=1){var i=this.lists[this.listpos][1][c];if(i.id==l){n.push(this.registry[i.id]);break}}n.sort(this.state.registry.sorter.compareKeys);for(var e=0,t=n.length;e<t;e+=1){r.year_suffix=""+e;var f=this.state.registry.registry[n[e].id].disambig;this.state.registry.registerAmbigToken(this.akey,""+n[e].id,r),d.ambigConfigDiff(f,r)&&(this.state.tmp.taintedItemIDs[n[e].id]=!0)}this.lists[this.listpos]=[this.betterbase,[]]};d.Disambiguation.prototype.incrementDisambig=function(){if(this.debug&&this.state.sys.print(`
|
|
644
|
-
[1] === incrementDisambig() ===`),this.initGivens)return this.initGivens=!1,!1;var e=!1,t=!0;if(this.modes[this.modeindex]==="disNames"){t=!1,typeof this.givensMax!="number"&&(t=!0);var n=!1;typeof this.namesMax!="number"&&(n=!0),typeof this.givensMax=="number"&&(this.base.givens.length&&this.base.givens[this.gnameset][this.gname]<this.givensMax?this.base.givens[this.gnameset][this.gname]+=1:t=!0),typeof this.namesMax=="number"&&t&&(this.state.opt["disambiguate-add-names"]?(n=!1,this.gname<this.namesMax?(this.base.names[this.gnameset]+=1,this.gname+=1):n=!0):n=!0),typeof this.namesetsMax=="number"&&n&&this.gnameset<this.namesetsMax&&(this.gnameset+=1,this.base.names[this.gnameset]=1,this.gname=0),this.debug&&(this.state.sys.print(" ------------------"),this.state.sys.print(" incremented values"),this.state.sys.print(" ------------------"),this.state.sys.print(" | gnameset: "+this.gnameset),this.state.sys.print(" | gname: "+this.gname),this.state.sys.print(" | names value: "+this.base.names[this.gnameset]),this.base.givens.length?this.state.sys.print(" | givens value: "+this.base.givens[this.gnameset][this.gname]):this.state.sys.print(" | givens value: nil"),this.state.sys.print(" | namesetsMax: "+this.namesetsMax),this.state.sys.print(" | namesMax: "+this.namesMax),this.state.sys.print(" | givensMax: "+this.givensMax)),(typeof this.namesetsMax!="number"||this.namesetsMax===-1||this.gnameset===this.namesetsMax)&&(!this.state.opt["disambiguate-add-names"]||typeof this.namesMax!="number"||this.gname===this.namesMax)&&(typeof this.givensMax!="number"||typeof this.base.givens[this.gnameset]>"u"||typeof this.base.givens[this.gnameset][this.gname]>"u"||this.base.givens[this.gnameset][this.gname]===this.givensMax)&&(e=!0,this.debug&&this.state.sys.print(" MAXED"))}else this.modes[this.modeindex]==="disExtraText"&&(this.base.disambiguate+=1,this.betterbase.disambiguate+=1);return e};d.Disambiguation.prototype.initVars=function(e){var a,o,t,n,i;if(this.debug&&this.state.sys.print("[B] === initVars() ==="),this.lists=[],this.base=!1,this.betterbase=!1,this.akey=e,this.maxNamesByItemId={},n=[],t=this.ambigcites[e],!t||!t.length)return!1;var r=this.state.refetchItem(""+t[0]);if(this.getCiteData(r),this.base=d.getAmbigConfig.call(this.state),t&&t.length>1){n.push([this.maxNamesByItemId[r.id],r]);for(var a=1,o=t.length;a<o;a+=1)r=this.state.refetchItem(""+t[a]),this.getCiteData(r,this.base),n.push([this.maxNamesByItemId[r.id],r]);n.sort(function(l,c){return l[0]>c[0]?1:l[0]<c[0]?-1:l[1].id>c[1].id?1:l[1].id<c[1].id?-1:0}),i=[];for(var a=0,o=n.length;a<o;a+=1)i.push(n[a][1]);this.lists.push([this.base,i]),this.Item=this.lists[0][1][0]}else this.Item=this.state.refetchItem(""+t[0]);this.modeindex=0;var a,o;return this.state.citation.opt["disambiguate-add-names"],this.namesMax=this.maxNamesByItemId[this.Item.id][0],this.padBase(this.base),this.padBase(this.betterbase),this.base.year_suffix=!1,this.base.disambiguate=!1,this.betterbase.year_suffix=!1,this.betterbase.disambiguate=!1,this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.state.opt["disambiguate-add-givenname"]&&(this.givensMax=2),!0};d.Disambiguation.prototype.padBase=function(e){for(var t=0,n=e.names.length;t<n;t+=1){e.givens[t]||(e.givens[t]=[]);for(var i=0,r=e.names[t];i<r;i+=1)e.givens[t][i]||(e.givens[t][i]=0)}};d.Disambiguation.prototype.configModes=function(){var e,t;this.modes=[],e=this.state.opt["disambiguate-add-givenname"],t=this.state.citation.opt["givenname-disambiguation-rule"],(this.state.opt["disambiguate-add-names"]||e&&t==="by-cite")&&this.modes.push("disNames"),this.state.opt.development_extensions.prioritize_disambiguate_condition?(this.state.opt.has_disambiguate&&this.modes.push("disExtraText"),this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears")):(this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears"),this.state.opt.has_disambiguate&&this.modes.push("disExtraText"))};d.Disambiguation.prototype.getCiteData=function(e,t){if(!this.maxNamesByItemId[e.id]){d.getAmbiguousCite.call(this.state,e,t),t=d.getAmbigConfig.call(this.state),this.maxNamesByItemId[e.id]=d.getMaxVals.call(this.state),this.state.registry.registry[e.id].disambig.givens=this.state.tmp.disambig_settings.givens.slice();for(var n=0,i=this.state.registry.registry[e.id].disambig.givens.length;n<i;n+=1)this.state.registry.registry[e.id].disambig.givens[n]=this.state.tmp.disambig_settings.givens[n].slice();this.namesetsMax=this.state.registry.registry[e.id].disambig.names.length-1,this.base||(this.base=t,this.betterbase=d.cloneAmbigConfig(t)),t.names.length<this.base.names.length&&(this.base=t);for(var n=0,i=t.names.length;n<i;n+=1)t.names[n]>this.base.names[n]&&(this.base.givens[n]=t.givens[n].slice(),this.base.names[n]=t.names[n],this.betterbase.names=this.base.names.slice(),this.betterbase.givens=this.base.givens.slice(),this.padBase(this.base),this.padBase(this.betterbase));this.betterbase.givens=this.base.givens.slice();for(var r=0,a=this.base.givens.length;r<a;r+=1)this.betterbase.givens[r]=this.base.givens[r].slice()}};d.Disambiguation.prototype.captureStepToBase=function(){this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.base.givens&&this.base.givens.length&&typeof this.base.givens[this.gnameset][this.gname]<"u"&&(this.betterbase.givens.length<this.base.givens.length&&(this.betterbase.givens=JSON.parse(JSON.stringify(this.base.givens))),this.betterbase.givens[this.gnameset][this.gname]=this.base.givens[this.gnameset][this.gname]),this.betterbase.names[this.gnameset]=this.base.names[this.gnameset]};d.Engine.prototype.getJurisdictionList=function(e){for(var t=[],n=e.split(":"),i=n.length;i>0;i--){var r=n.slice(0,i).join(":");if(t.push(r),this.opt.jurisdiction_fallbacks[r]){var a=this.opt.jurisdiction_fallbacks[r];t.push(a)}}return t.indexOf("us")===-1&&t.push("us"),t};d.Engine.prototype.loadStyleModule=function(e,t,n){var i=null;this.juris[e]={};var r=d.setupXml(t);r.addMissingNameNodes(r.dataObj),r.addInstitutionNodes(r.dataObj),r.insertPublisherAndPlace(r.dataObj),r.flagDateMacros(r.dataObj);for(var m=r.getNodesByName(r.dataObj,"law-module"),a=0,o=m.length;a<o;a++){var l=r.getAttributeValue(m[a],"types");if(l){this.juris[e].types={},l=l.split(/\s+/);for(var c=0,u=l.length;c<u;c++)this.juris[e].types[l[c]]=!0}n||(i=r.getAttributeValue(m[a],"fallback"),i&&e!=="us"&&(this.opt.jurisdiction_fallbacks[e]=i))}var f=this.opt.lang?this.opt.lang:this.opt["default-locale"][0];d.SET_COURT_CLASSES(this,f,r,r.dataObj),this.juris[e].types||(this.juris[e].types=d.MODULE_TYPES);for(var m=r.getNodesByName(r.dataObj,"macro"),a=0,o=m.length;a<o;a++){var p=r.getAttributeValue(m[a],"name");if(!d.MODULE_MACROS[p]){d.debug('CSL: skipping non-modular macro name "'+p+'" in module context');continue}this.juris[e][p]=[],this.buildTokenLists(m[a],this.juris[e][p]),this.configureTokenList(this.juris[e][p])}return i};d.Engine.prototype.retrieveAllStyleModules=function(e){var t={},n=this.locale[this.opt.lang].opts["jurisdiction-preference"];n=n||[],n=[""].concat(n);for(var i=n.length-1;i>-1;i--)for(var r=n[i],a=0,o=e.length;a<o;a++){var l=e[a];if(!this.opt.jurisdictions_seen[l]){var c=this.sys.retrieveStyleModule(l,r);(!c&&!r||c)&&(this.opt.jurisdictions_seen[l]=!0),c&&(t[l]=c)}}return t};d.ParticleList=function(){var e=[[[0,1],null]],t=[[[0,3],null]],n=[[null,[0,1]]],i=[[null,[0,2]]],r=[[null,[0,3]]],a=[[null,[0,1]],[[0,1],null]],o=[[null,[0,2]],[[0,2],null]],l=[[[0,1],null],[null,[0,1]]],c=[[[0,2],null],[null,[0,2]]],u=[[[0,3],null],[null,[0,3]]],f=[[null,[0,2]],[[0,1],[1,2]]],m=[["'s",n],["'s-",n],["'t",n],["a",n],["aan 't",i],["aan de",i],["aan den",i],["aan der",i],["aan het",i],["aan t",i],["aan",n],["ad-",a],["adh-",a],["af",a],["al",a],["al-",a],["am de",i],["am",n],["an-",a],["ar-",a],["as-",a],["ash-",a],["at-",a],["ath-",a],["auf dem",c],["auf den",c],["auf der",c],["auf ter",i],["auf",l],["aus 'm",c],["aus dem",c],["aus den",c],["aus der",c],["aus m",c],["aus",l],["aus'm",c],["az-",a],["aš-",a],["aḍ-",a],["aḏ-",a],["aṣ-",a],["aṭ-",a],["aṯ-",a],["aẓ-",a],["ben",n],["bij 't",i],["bij de",i],["bij den",i],["bij het",i],["bij t",i],["bij",n],["bin",n],["boven d",i],["boven d'",i],["d",n],["d'",a],["da",a],["dal",n],["dal'",n],["dall'",n],["dalla",n],["das",a],["de die le",r],["de die",i],["de l",i],["de l'",i],["de la",f],["de las",f],["de le",i],["de li",o],["de van der",r],["de",a],["de'",a],["deca",n],["degli",a],["dei",a],["del",a],["dela",e],["dell'",a],["della",a],["delle",a],["dello",a],["den",a],["der",a],["des",a],["di",a],["die le",i],["do",n],["don",n],["dos",a],["du",a],["ed-",a],["edh-",a],["el",a],["el-",a],["en-",a],["er-",a],["es-",a],["esh-",a],["et-",a],["eth-",a],["ez-",a],["eš-",a],["eḍ-",a],["eḏ-",a],["eṣ-",a],["eṭ-",a],["eṯ-",a],["eẓ-",a],["het",n],["i",n],["il",e],["im",n],["in 't",i],["in de",i],["in den",i],["in der",o],["in het",i],["in t",i],["in",n],["l",n],["l'",n],["la",n],["las",n],["le",n],["les",a],["lo",a],["los",n],["lou",n],["of",n],["onder 't",i],["onder de",i],["onder den",i],["onder het",i],["onder t",i],["onder",n],["op 't",i],["op de",o],["op den",i],["op der",i],["op gen",i],["op het",i],["op t",i],["op ten",i],["op",n],["over 't",i],["over de",i],["over den",i],["over het",i],["over t",i],["over",n],["s",n],["s'",n],["sen",e],["t",n],["te",n],["ten",n],["ter",n],["tho",n],["thoe",n],["thor",n],["to",n],["toe",n],["tot",n],["uijt 't",i],["uijt de",i],["uijt den",i],["uijt te de",r],["uijt ten",i],["uijt",n],["uit 't",i],["uit de",i],["uit den",i],["uit het",i],["uit t",i],["uit te de",r],["uit ten",i],["uit",n],["unter",n],["v",n],["v.",n],["v.d.",n],["van 't",i],["van de l",r],["van de l'",r],["van de",i],["van de",i],["van den",i],["van der",i],["van gen",i],["van het",i],["van la",i],["van t",i],["van ter",i],["van van de",r],["van",a],["vander",n],["vd",n],["ver",n],["vom und zum",t],["vom",a],["von 't",i],["von dem",c],["von den",c],["von der",c],["von t",i],["von und zu",u],["von zu",c],["von",l],["voor 't",i],["voor de",i],["voor den",i],["voor in 't",r],["voor in t",r],["voor",n],["vor der",c],["vor",l],["z",e],["ze",e],["zu",l],["zum",a],["zur",a]];return m}();d.parseParticles=function(){function e(i,r,a){var o=i;i=i;var l=[],c,u;r?(i=i.split("").reverse().join(""),c=d.PARTICLE_GIVEN_REGEXP):c=d.PARTICLE_FAMILY_REGEXP;for(var f=i.match(c);f;){var m=r?f[1].split("").reverse().join(""):f[1],p=f?m:!1,p=p?m.replace(/^[-\'\u02bb\u2019\s]*(.).*$/,"$1"):!1;if(u=p?p.toUpperCase()!==p:!1,!u)break;r?(l.push(o.slice(m.length*-1)),o=o.slice(0,m.length*-1)):(l.push(o.slice(0,m.length)),o=o.slice(m.length)),i=f[2],f=i.match(c)}if(r){i=i.split("").reverse().join(""),l.reverse();for(var h=1,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h-1]+=" ");for(var h=0,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h]=l[h].slice(1));i=o.slice(0,i.length)}else i=o.slice(i.length*-1);return[u,i,l]}function t(i){var r=i.slice(-1);return i=i.trim(),r===" "&&["'","’"].indexOf(i.slice(-1))>-1&&(i+=" "),i}function n(i){if(!i.suffix&&i.given){var r=i.given.match(/(\s*,!*\s*)/);if(r){var a=i.given.indexOf(r[1]),o=i.given.slice(a+r[1].length),l=i.given.slice(a,a+r[1].length).replace(/\s*/g,"");o.replace(/\./g,"")==="et al"&&!i["dropping-particle"]?(i["dropping-particle"]=o,i["comma-dropping-particle"]=","):(l.length===2&&(i["comma-suffix"]=!0),i.suffix=o),i.given=i.given.slice(0,a)}}}return function(i){var l=e(i.family),r=l[1],a=l[2];i.family=r;var o=t(a.join(""));o&&(i["non-dropping-particle"]=o),n(i);var l=e(i.given,!0),c=l[1],u=l[2];i.given=c;var f=u.join("").trim();f&&(i["dropping-particle"]=f)}}();var Px=d;const Fx=zf(Px),If=65535,Rf=Math.pow(2,16);function Vx(e,t){return e+t*Rf}function ou(e){return e&If}function Ux(e){return(e-(e&If))/Rf}const Lf=1,Bf=2,wa=4,Pf=8;class qs{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&Pf)>0}get deletedBefore(){return(this.delInfo&(Lf|wa))>0}get deletedAfter(){return(this.delInfo&(Bf|wa))>0}get deletedAcross(){return(this.delInfo&wa)>0}}class Tt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Tt.empty)return Tt.empty}recover(t){let n=0,i=ou(t);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+Ux(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,i){let r=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[l+a],f=this.ranges[l+o],m=c+u;if(t<=m){let p=u?t==c?-1:t==m?1:n:n,h=c+r+(p<0?0:f);if(i)return h;let g=t==(n<0?c:m)?null:Vx(l/3,t-c),b=t==c?Bf:t==m?Lf:wa;return(n<0?t!=c:t!=m)&&(b|=Pf),new qs(h,b,g)}r+=f-u}return i?t+r:new qs(t+r,0,null)}touches(t,n){let i=0,r=ou(n),a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[l+a],f=c+u;if(t<=f&&l==r*3)return!0;i+=this.ranges[l+o]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,a=0;r<this.ranges.length;r+=3){let o=this.ranges[r],l=o-(this.inverted?a:0),c=o+(this.inverted?0:a),u=this.ranges[r+n],f=this.ranges[r+i];t(l,l+u,c,c+f),a+=f-u}}invert(){return new Tt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Tt.empty:new Tt(t<0?[0,-t,0]:[0,0,t])}}Tt.empty=new Tt([]);class La{constructor(t,n,i=0,r=t?t.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new La(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,i=this._maps.length;n<t._maps.length;n++){let r=t.getMirror(n);this.appendMap(t._maps[n],r!=null&&r<n?i+r:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,i=this._maps.length+t._maps.length;n>=0;n--){let r=t.getMirror(n);this.appendMap(t._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let t=new La;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;i<this.to;i++)t=this._maps[i].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,i){let r=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],l=o.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(a);if(c!=null&&c>a&&c<this.to){a=c,t=this._maps[c].recover(l.recover);continue}}r|=l.delInfo,t=l.pos}return i?t:new qs(t,r,null)}}const Jo=Object.create(null);class ut{getMap(){return Tt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=Jo[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Jo)throw new RangeError("Duplicate use of step JSON ID "+t);return Jo[t]=n,n.prototype.jsonID=t,n}}class We{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new We(t,null)}static fail(t){return new We(null,t)}static fromReplace(t,n,i,r){try{return We.ok(t.replace(n,i,r))}catch(a){if(a instanceof hr)return We.fail(a.message);throw a}}}function Ol(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let a=e.child(r);a.content.size&&(a=a.copy(Ol(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return J.fromArray(i)}class In extends ut{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=t.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new ae(Ol(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),r),n.openStart,n.openEnd);return We.fromReplace(t,this.from,this.to,a)}invert(){return new Jt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new In(n.pos,i.pos,this.mark)}merge(t){return t instanceof In&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new In(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new In(n.from,n.to,t.markFromJSON(n.mark))}}ut.jsonID("addMark",In);class Jt extends ut{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new ae(Ol(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return We.fromReplace(t,this.from,this.to,i)}invert(){return new In(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Jt(n.pos,i.pos,this.mark)}merge(t){return t instanceof Jt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Jt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jt(n.from,n.to,t.markFromJSON(n.mark))}}ut.jsonID("removeMark",Jt);class Rn extends ut{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new Rn(this.pos,n.marks[r]);return new Rn(this.pos,this.mark)}}return new ui(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Rn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Rn(n.pos,t.markFromJSON(n.mark))}}ut.jsonID("addNodeMark",Rn);class ui extends ut{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Rn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ui(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ui(n.pos,t.markFromJSON(n.mark))}}ut.jsonID("removeNodeMark",ui);class qe extends ut{constructor(t,n,i,r=!1){super(),this.from=t,this.to=n,this.slice=i,this.structure=r}apply(t){return this.structure&&js(t,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tt([this.from,this.to-this.from,this.slice.size])}invert(t){return new qe(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),i=this.from==this.to&&qe.MAP_BIAS<0?n:t.mapResult(this.from,1);return i.deletedAcross&&n.deletedAcross?null:new qe(i.pos,Math.max(i.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof qe)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new qe(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new qe(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qe(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}qe.MAP_BIAS=1;ut.jsonID("replace",qe);class Ke extends ut{constructor(t,n,i,r,a,o,l=!1){super(),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=l}apply(t){if(this.structure&&(js(t,this.from,this.gapFrom)||js(t,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return We.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?We.fromReplace(t,this.from,this.to,i):We.fail("Content does not fit in gap")}getMap(){return new Tt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?i.pos:t.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||a>i.pos?null:new Ke(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}ut.jsonID("replaceAround",Ke);function js(e,t,n){let i=e.resolve(t),r=n-t,a=i.depth;for(;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0){let o=i.node(a).maybeChild(i.indexAfter(a));for(;r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}}return!1}function Hx(e,t,n,i){let r=[],a=[],o,l;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let m=c.marks;if(!i.isInSet(m)&&f.type.allowsMarkType(i.type)){let p=Math.max(u,t),h=Math.min(u+c.nodeSize,n),g=i.addToSet(m);for(let b=0;b<m.length;b++)m[b].isInSet(g)||(o&&o.to==p&&o.mark.eq(m[b])?o.to=h:r.push(o=new Jt(p,h,m[b])));l&&l.to==p?l.to=h:a.push(l=new In(p,h,i))}}),r.forEach(c=>e.step(c)),a.forEach(c=>e.step(c))}function qx(e,t,n,i){let r=[],a=0;e.doc.nodesBetween(t,n,(o,l)=>{if(!o.isInline)return;a++;let c=null;if(i instanceof Co){let u=o.marks,f;for(;f=i.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else i?i.isInSet(o.marks)&&(c=[i]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,n);for(let f=0;f<c.length;f++){let m=c[f],p;for(let h=0;h<r.length;h++){let g=r[h];g.step==a-1&&m.eq(r[h].style)&&(p=g)}p?(p.to=u,p.step=a):r.push({style:m,from:Math.max(l,t),to:u,step:a})}}}),r.forEach(o=>e.step(new Jt(o.from,o.to,o.style)))}function Ml(e,t,n,i=n.contentMatch,r=!0){let a=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c<a.childCount;c++){let u=a.child(c),f=l+u.nodeSize,m=i.matchType(u.type);if(!m)o.push(new qe(l,f,ae.empty));else{i=m;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new Jt(l,f,u.marks[p]));if(r&&u.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,g;for(;p=h.exec(u.text);)g||(g=new ae(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new qe(l+p.index,l+p.index+p[0].length,g))}}l=f}if(!i.validEnd){let c=i.fillBefore(J.empty,!0);e.replace(l,l,new ae(c,0,0))}for(let c=o.length-1;c>=0;c--)e.step(o[c])}function jx(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Li(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,r=0,a=0;;--i){let o=e.$from.node(i),l=e.$from.index(i)+r,c=e.$to.indexAfter(i)-a;if(i<e.depth&&o.canReplace(l,c,n))return i;if(i==0||o.type.spec.isolating||!jx(o,l,c))break;l&&(r=1),c<o.childCount&&(a=1)}return null}function $x(e,t,n){let{$from:i,$to:r,depth:a}=t,o=i.before(a+1),l=r.after(a+1),c=o,u=l,f=J.empty,m=0;for(let g=a,b=!1;g>n;g--)b||i.index(g)>0?(b=!0,f=J.from(i.node(g).copy(f)),m++):c--;let p=J.empty,h=0;for(let g=a,b=!1;g>n;g--)b||r.after(g+1)<r.end(g)?(b=!0,p=J.from(r.node(g).copy(p)),h++):u++;e.step(new Ke(c,u,o,l,new ae(f.append(p),m,h),f.size-m,!0))}function Dl(e,t,n=null,i=e){let r=Wx(e,t),a=r&&Gx(i,t);return a?r.map(su).concat({type:t,attrs:n}).concat(a.map(su)):null}function su(e){return{type:e,attrs:null}}function Wx(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.contentMatchAt(i).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(i,r,o)?a:null}function Gx(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.child(i),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let c=(o.length?o[o.length-1]:t).contentMatch;for(let u=i;c&&u<r;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:o}function Kx(e,t,n){let i=J.empty;for(let o=n.length-1;o>=0;o--){if(i.size){let l=n[o].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=J.from(n[o].type.create(n[o].attrs,i))}let r=t.start,a=t.end;e.step(new Ke(r,a,r,a,new ae(i,0,0),n.length,!0))}function Xx(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(o,l)=>{let c=typeof r=="function"?r(o):r;if(o.isTextblock&&!o.hasMarkup(i,c)&&Jx(e.doc,e.mapping.slice(a).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",g=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!g?u=!1:!h&&g&&(u=!0)}u===!1&&Vf(e,o,l,a),Ml(e,e.mapping.slice(a).map(l,1),i,void 0,u===null);let f=e.mapping.slice(a),m=f.map(l,1),p=f.map(l+o.nodeSize,1);return e.step(new Ke(m,p,m+1,p-1,new ae(J.from(i.create(c,null,o.marks)),0,0),1,!0)),u===!0&&Ff(e,o,l,a),!1}})}function Ff(e,t,n,i){t.forEach((r,a)=>{if(r.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(r.text);){let c=e.mapping.slice(i).map(n+1+a+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function Vf(e,t,n,i){t.forEach((r,a)=>{if(r.type==r.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(n+1+a);e.replaceWith(o,o+1,t.type.schema.text(`
|
|
645
|
-
`))}})}function Jx(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function Zx(e,t,n,i,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let o=n.create(i,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ke(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(J.from(o),0,0),1,!0))}function vn(e,t,n=1,i){let r=e.resolve(t),a=r.depth-n,o=i&&i[i.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!o.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=n-2;u>a;u--,f--){let m=r.node(u),p=r.index(u);if(m.type.spec.isolating)return!1;let h=m.content.cutByIndex(p,m.childCount),g=i&&i[f+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=i&&i[f]||m;if(!m.canReplace(p+1,m.childCount)||!b.type.validContent(h))return!1}let l=r.indexAfter(a),c=i&&i[0];return r.node(a).canReplaceWith(l,l,c?c.type:r.node(a+1).type)}function Qx(e,t,n=1,i){let r=e.doc.resolve(t),a=J.empty,o=J.empty;for(let l=r.depth,c=r.depth-n,u=n-1;l>c;l--,u--){a=J.from(r.node(l).copy(a));let f=i&&i[u];o=J.from(f?f.type.create(f.attrs,o):r.node(l).copy(o))}e.step(new qe(t,t,new ae(a.append(o),n,n),!0))}function Un(e,t){let n=e.resolve(t),i=n.index();return Uf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Yx(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),o=a.type==i?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Uf(e,t){return!!(e&&t&&!e.isLeaf&&Yx(e,t))}function Eo(e,t,n=-1){let i=e.resolve(t);for(let r=i.depth;;r--){let a,o,l=i.index(r);if(r==i.depth?(a=i.nodeBefore,o=i.nodeAfter):n>0?(a=i.node(r+1),l++,o=i.node(r).maybeChild(l)):(a=i.node(r).maybeChild(l-1),o=i.node(r+1)),a&&!a.isTextblock&&Uf(a,o)&&i.node(r).canReplace(l,l+1))return t;if(r==0)break;t=n<0?i.before(r):i.after(r)}}function ey(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(r&&o.inlineContent){let f=o.whitespace=="pre",m=!!o.contentMatch.matchType(r);f&&!m?i=!1:!f&&m&&(i=!0)}let l=e.steps.length;if(i===!1){let f=e.doc.resolve(t+n);Vf(e,f.node(),f.before(),l)}o.inlineContent&&Ml(e,t+n-1,o,a.node().contentMatchAt(a.index()),i==null);let c=e.mapping.slice(l),u=c.map(t-n);if(e.step(new qe(u,c.map(t+n,-1),ae.empty,!0)),i===!0){let f=e.doc.resolve(u);Ff(e,f.node(),f.before(),e.steps.length)}return e}function ty(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let a=i.indexAfter(r);if(i.node(r).canReplaceWith(a,a,n))return i.after(r+1);if(a<i.node(r).childCount)return null}return null}function ny(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let o=i.depth;o>=0;o--){let l=o==i.depth?0:i.pos<=(i.start(o+1)+i.end(o+1))/2?-1:1,c=i.index(o)+(l>0?1:0),u=i.node(o),f=!1;if(a==1)f=u.canReplace(c,c,r);else{let m=u.contentMatchAt(c).findWrapping(r.firstChild.type);f=m&&u.canReplaceWith(c,c,m[0])}if(f)return l==0?i.pos:l<0?i.before(o+1):i.after(o+1)}return null}function Ao(e,t,n=t,i=ae.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),a=e.resolve(n);return Hf(r,a,i)?new qe(t,n,i):new iy(r,a,i).fit()}function Hf(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class iy{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=J.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=J.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;let a=this.placed,o=i.depth,l=r.depth;for(;o&&l&&a.childCount==1;)a=a.firstChild.content,o--,l--;let c=new ae(a,o,l);return t>-1?new Ke(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new qe(i.pos,r.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<t;i++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=i){t=i;break}n=a.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let r,a=null;i?(a=Zo(this.unplaced.content,i-1).firstChild,r=a.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],f,m=null;if(n==1&&(o?u.matchType(o.type)||(m=u.fillBefore(J.from(o),!1)):a&&c.compatibleContent(a.type)))return{sliceDepth:i,frontierDepth:l,parent:a,inject:m};if(n==2&&o&&(f=u.findWrapping(o.type)))return{sliceDepth:i,frontierDepth:l,parent:a,wrap:f};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=Zo(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=Zo(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(Yi(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new ae(Yi(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let b=0;b<a.length;b++)this.openFrontierNode(a[b]);let o=this.unplaced,l=i?i.content:o.content,c=o.openStart-t,u=0,f=[],{match:m,type:p}=this.frontier[n];if(r){for(let b=0;b<r.childCount;b++)f.push(r.child(b));m=m.matchFragment(r)}let h=l.size+t-(o.content.size-o.openEnd);for(;u<l.childCount;){let b=l.child(u),x=m.matchType(b.type);if(!x)break;u++,(u>1||c==0||b.content.size)&&(m=x,f.push(qf(b.mark(p.allowedMarks(b.marks)),u==1?c:0,u==l.childCount?h:-1)))}let g=u==l.childCount;g||(h=-1),this.placed=er(this.placed,n,J.from(f)),this.frontier[n].match=m,g&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=l;b<h;b++){let v=x.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),x=v.content}this.unplaced=g?t==0?ae.empty:new ae(Yi(o.content,t-1,1),t-1,h<0?o.openEnd:t-1):new ae(Yi(o.content,t,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Qo(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=Qo(t,n,r,i,a);if(o){for(let l=n-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],f=Qo(t,l,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:o,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=er(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let r=t.node(i),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(i));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=er(this.placed,this.depth,J.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=er(this.placed,this.frontier.length,n))}}function Yi(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Yi(e.firstChild.content,t-1,n)))}function er(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(er(e.lastChild.content,t-1,n)))}function Zo(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function qf(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,qf(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(J.empty,!0)))),e.copy(i)}function Qo(e,t,n,i,r){let a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let l=i.fillBefore(a.content,!0,o);return l&&!ry(n,a.content,o)?l:null}function ry(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}function ay(e){return e.spec.defining||e.spec.definingForContent}function oy(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(Hf(r,a,i))return e.step(new qe(t,n,i));let o=$f(r,a);o[o.length-1]==0&&o.pop();let l=-(r.depth+1);o.unshift(l);for(let p=r.depth,h=r.pos-1;p>0;p--,h--){let g=r.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?l=p:r.before(p)==h&&o.splice(1,0,-p)}let c=o.indexOf(l),u=[],f=i.openStart;for(let p=i.content,h=0;;h++){let g=p.firstChild;if(u.push(g),h==i.openStart)break;p=g.content}for(let p=f-1;p>=0;p--){let h=u[p],g=ay(h.type);if(g&&!h.sameMarkup(r.node(Math.abs(l)-1)))f=p;else if(g||!h.type.isTextblock)break}for(let p=i.openStart;p>=0;p--){let h=(p+f+1)%(i.openStart+1),g=u[h];if(g)for(let b=0;b<o.length;b++){let x=o[(b+c)%o.length],v=!0;x<0&&(v=!1,x=-x);let y=r.node(x-1),k=r.index(x-1);if(y.canReplaceWith(k,k,g.type,g.marks))return e.replace(r.before(x),v?a.after(x):n,new ae(jf(i.content,0,i.openStart,h),h,i.openEnd))}}let m=e.steps.length;for(let p=o.length-1;p>=0&&(e.replace(t,n,i),!(e.steps.length>m));p--){let h=o[p];h<0||(t=r.before(h),n=a.after(h))}}function jf(e,t,n,i,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(jf(a.content,t+1,n,i,a)))}if(t>i){let a=r.contentMatchAt(0),o=a.fillBefore(e).append(e);e=o.append(a.matchFragment(o).fillBefore(J.empty,!0))}return e}function sy(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=ty(e.doc,t,i.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(J.from(i),0,0))}function ly(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let o=i.sharedDepth(n),l=!1;for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);for(let c=r.depth;c>o;c--)r.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);for(let c=r.depth;c>0&&n==r.start(c);c--)n=r.before(c);i=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=$f(i,r);for(let o=0;o<a.length;o++){let l=a[o],c=o==a.length-1;if(c&&l==0||i.node(l).type.contentMatch.validEnd)return e.delete(i.start(l),r.end(l));if(l>0&&(c||i.node(l-1).canReplace(i.index(l-1),r.indexAfter(l-1))))return e.delete(i.before(l),r.after(l))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}function $f(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let r=i;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Ai extends ut{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return We.fail("No node at attribute step's position");let i=Object.create(null);for(let a in n.attrs)i[a]=n.attrs[a];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return We.fromReplace(t,this.pos,this.pos+1,new ae(J.from(r),0,n.isLeaf?0:1))}getMap(){return Tt.empty}invert(t){return new Ai(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ai(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ai(n.pos,n.attr,n.value)}}ut.jsonID("attr",Ai);class vr extends ut{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return We.ok(i)}getMap(){return Tt.empty}invert(t){return new vr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vr(n.attr,n.value)}}ut.jsonID("docAttr",vr);let Ni=class extends Error{};Ni=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ni.prototype=Object.create(Error.prototype);Ni.prototype.constructor=Ni;Ni.prototype.name="TransformError";class Wf{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new La}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ni(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,o,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=ae.empty){let r=Ao(this.doc,t,n,i);return r&&this.step(r),this}replaceWith(t,n,i){return this.replace(t,n,new ae(J.from(i),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return oy(this,t,n,i),this}replaceRangeWith(t,n,i){return sy(this,t,n,i),this}deleteRange(t,n){return ly(this,t,n),this}lift(t,n){return $x(this,t,n),this}join(t,n=1){return ey(this,t,n),this}wrap(t,n){return Kx(this,t,n),this}setBlockType(t,n=t,i,r=null){return Xx(this,t,n,i,r),this}setNodeMarkup(t,n,i=null,r){return Zx(this,t,n,i,r),this}setNodeAttribute(t,n,i){return this.step(new Ai(t,n,i)),this}setDocAttribute(t,n){return this.step(new vr(t,n)),this}addNodeMark(t,n){return this.step(new Rn(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof ze)n.isInSet(i.marks)&&this.step(new ui(t,n));else{let r=i.marks,a,o=[];for(;a=n.isInSet(r);)o.push(new ui(t,a)),r=a.removeFromSet(r);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,n=1,i){return Qx(this,t,n,i),this}addMark(t,n,i){return Hx(this,t,n,i),this}removeMark(t,n,i){return qx(this,t,n,i),this}clearIncompatible(t,n,i){return Ml(this,t,n,i),this}}const Yo=Object.create(null);class ge{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Gf(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let i=n.content.lastChild,r=null;for(let l=0;l<n.openEnd;l++)r=i,i=i.lastChild;let a=t.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:u}=o[l],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(u.pos),l?ae.empty:n),l==0&&uu(t,a,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let i=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:o,$to:l}=r[a],c=t.mapping.slice(i),u=c.map(o.pos),f=c.map(l.pos);a?t.deleteRange(u,f):(t.replaceRangeWith(u,f,n),uu(t,i,n.isInline?-1:1))}}static findFrom(t,n,i=!1){let r=t.parent.inlineContent?new he(t):Si(t.node(0),t.parent,t.pos,t.index(),n,i);if(r)return r;for(let a=t.depth-1;a>=0;a--){let o=n<0?Si(t.node(0),t.node(a),t.before(a+1),t.index(a),n,i):Si(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,i);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ot(t.node(0))}static atStart(t){return Si(t,t,0,0,1)||new Ot(t)}static atEnd(t){return Si(t,t,t.content.size,t.childCount,-1)||new Ot(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Yo[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Yo)throw new RangeError("Duplicate use of selection JSON ID "+t);return Yo[t]=n,n.prototype.jsonID=t,n}getBookmark(){return he.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class Gf{constructor(t,n){this.$from=t,this.$to=n}}let lu=!1;function cu(e){!lu&&!e.parent.inlineContent&&(lu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class he extends ge{constructor(t,n=t){cu(t),cu(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return ge.near(i);let r=t.resolve(n.map(this.anchor));return new he(r.parent.inlineContent?r:i,i)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof he&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new To(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new he(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let r=t.resolve(n);return new this(r,i==n?r:t.resolve(i))}static between(t,n,i){let r=t.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let a=ge.findFrom(n,i,!0)||ge.findFrom(n,-i,!0);if(a)n=a.$head;else return ge.near(n,i)}return t.parent.inlineContent||(r==0?t=n:(t=(ge.findFrom(t,-i,!0)||ge.findFrom(t,i,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new he(t,n)}}ge.jsonID("text",he);class To{constructor(t,n){this.anchor=t,this.head=n}map(t){return new To(t.map(this.anchor),t.map(this.head))}resolve(t){return he.between(t.resolve(this.anchor),t.resolve(this.head))}}class pe extends ge{constructor(t){let n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);super(t,i),this.node=n}map(t,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return i?ge.near(a):new pe(a)}content(){return new ae(J.from(this.node),0,0)}eq(t){return t instanceof pe&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zl(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(t.resolve(n.anchor))}static create(t,n){return new pe(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}pe.prototype.visible=!1;ge.jsonID("node",pe);class zl{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:i}=t.mapResult(this.anchor);return n?new To(i,i):new zl(i)}resolve(t){let n=t.resolve(this.anchor),i=n.nodeAfter;return i&&pe.isSelectable(i)?new pe(n):ge.near(n)}}class Ot extends ge{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let i=ge.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ot(t)}map(t){return new Ot(t)}eq(t){return t instanceof Ot}getBookmark(){return cy}}ge.jsonID("all",Ot);const cy={map(){return this},resolve(e){return new Ot(e)}};function Si(e,t,n,i,r,a=!1){if(t.inlineContent)return he.create(e,n);for(let o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){let l=t.child(o);if(l.isAtom){if(!a&&pe.isSelectable(l))return pe.create(e,n-(r<0?l.nodeSize:0))}else{let c=Si(e,l,n+r,r<0?l.childCount:0,r,a);if(c)return c}n+=l.nodeSize*r}return null}function uu(e,t,n){let i=e.steps.length-1;if(i<t)return;let r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;let a=e.mapping.maps[i],o;a.forEach((l,c,u,f)=>{o==null&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}function du(e,t){return!t||!e?e:e.bind(t)}class oa{constructor(t,n,i){this.name=t,this.init=du(n.init,i),this.apply=du(n.apply,i)}}new oa("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new oa("selection",{init(e,t){return e.selection||ge.atStart(t.doc)},apply(e){return e.selection}}),new oa("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new oa("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function Kf(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):i=="handleDOMEvents"&&(r=Kf(r,t,{})),n[i]=r}return n}class dt{constructor(t){this.spec=t,this.props={},t.props&&Kf(t.props,this,this.props),this.key=t.key?t.key.key:Xf("plugin")}getState(t){return t[this.key]}}const es=Object.create(null);function Xf(e){return e in es?e+"$"+ ++es[e]:(es[e]=0,e+"$")}class at{constructor(t="key"){this.key=Xf(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const pi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Jf=function(e,t,n,i){return n&&(fu(e,t,n,i,-1)||fu(e,t,n,i,1))},uy=/^(img|br|input|textarea|hr)$/i;function fu(e,t,n,i,r){for(var a;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Ba(e))){let o=e.parentNode;if(!o||o.nodeType!=1||Il(e)||uy.test(e.nodeName)||e.contentEditable=="false")return!1;t=pi(e)+(r<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(r<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=o,t=r<0?Ba(e):0}else return!1}}function Ba(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function dy(e,t,n){for(let i=t==0,r=t==Ba(e);i||r;){if(e==n)return!0;let a=pi(e);if(e=e.parentNode,!e)return!1;i=i&&a==0,r=r&&a==Ba(e)}}function Il(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Zf=function(e){return e.focusNode&&Jf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Qf(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Yt=typeof navigator<"u"?navigator:null,pu=typeof document<"u"?document:null,Hn=Yt&&Yt.userAgent||"",$s=/Edge\/(\d+)/.exec(Hn),Yf=/MSIE \d/.exec(Hn),Ws=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hn),Nr=!!(Yf||Ws||$s),ep=Yf?document.documentMode:Ws?+Ws[1]:$s?+$s[1]:0,No=!Nr&&/gecko\/(\d+)/i.test(Hn);No&&+(/Firefox\/(\d+)/.exec(Hn)||[0,0])[1];const Gs=!Nr&&/Chrome\/(\d+)/.exec(Hn),xn=!!Gs,tp=Gs?+Gs[1]:0,mi=!Nr&&!!Yt&&/Apple Computer/.test(Yt.vendor),Rl=mi&&(/Mobile\/\w+/.test(Hn)||!!Yt&&Yt.maxTouchPoints>2),Lt=Rl||(Yt?/Mac/.test(Yt.platform):!1),np=Yt?/Win/.test(Yt.platform):!1,Or=/Android \d/.test(Hn),Ll=!!pu&&"webkitFontSmoothing"in pu.documentElement.style,fy=Ll?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function py(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=i.resolve(o),c,u;if(Zf(n)){for(c=o;r&&!r.node;)r=r.parent;let m=r.node;if(r&&m.isAtom&&pe.isSelectable(m)&&r.parent&&!(m.isInline&&dy(n.focusNode,n.focusOffset,r.dom))){let p=r.posBefore;u=new pe(o==p?l:i.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=o,p=o;for(let h=0;h<n.rangeCount;h++){let g=n.getRangeAt(h);m=Math.min(m,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(m<0)return null;[c,o]=p==e.state.selection.anchor?[p,m]:[m,p],l=i.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let f=i.resolve(c);if(!u){let m=t=="pointer"||e.state.selection.head<l.pos&&!a?1:-1;u=rp(e,f,l,m)}return u}function ip(e){return e.editable?e.hasFocus():gy(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Bl(e,t=!1){let n=e.state.selection;if(by(e,n),!ip(e))return;let i=e.input.mouseDown;if(!t&&xn&&i){let r=e.domSelectionRange(),a=e.domObserver.currentSelection;if(r.anchorNode&&a.anchorNode&&Jf(r.anchorNode,r.anchorOffset,a.anchorNode,a.anchorOffset)&&i.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)hy(e);else{let{anchor:r,head:a}=n,o,l;mu&&!(n instanceof he)&&(n.$from.parent.inlineContent||(o=hu(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=hu(e,n.to))),e.docView.setSelection(r,a,e,t),mu&&(o&&bu(o),l&&bu(l)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&my(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const mu=mi||xn&&tp<63;function hu(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,a=i?n.childNodes[i-1]:null;if(mi&&r&&r.contentEditable=="false")return ts(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return ts(r);if(a)return ts(a)}}function ts(e){return e.contentEditable="true",mi&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function bu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function my(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!ip(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function hy(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.collapse(n.parentNode,pi(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&Nr&&ep<=11&&(n.disabled=!0,n.disabled=!1)}function by(e,t){if(t instanceof pe){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(gu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else gu(e)}function gu(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function rp(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||he.between(t,n,i)}function gy(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Ks(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&ge.findFrom(a,t)}function Tn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function vu(e,t,n){let i=e.state.selection;if(i instanceof he)if(n.indexOf("s")>-1){let{$head:r}=i,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return Tn(e,new he(i.$anchor,o))}else if(i.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=Ks(e.state,t);return r&&r instanceof pe?Tn(e,r):!1}else if(!(Lt&&n.indexOf("m")>-1)){let r=i.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,o;if(!a||a.isText)return!1;let l=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?pe.isSelectable(a)?Tn(e,new pe(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Ll?Tn(e,new he(e.state.doc.resolve(t<0?l:l+a.nodeSize))):!1:!1}}else return!1;else{if(i instanceof pe&&i.node.isInline)return Tn(e,new he(t>0?i.$to:i.$from));{let r=Ks(e.state,t);return r?Tn(e,r):!1}}}function Pa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ar(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ki(e,t){return t<0?vy(e):xy(e)}function vy(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,a,o=!1;for(No&&n.nodeType==1&&i<Pa(n)&&ar(n.childNodes[i],-1)&&(o=!0);;)if(i>0){if(n.nodeType!=1)break;{let l=n.childNodes[i-1];if(ar(l,-1))r=n,a=--i;else if(l.nodeType==3)n=l,i=n.nodeValue.length;else break}}else{if(ap(n))break;{let l=n.previousSibling;for(;l&&ar(l,-1);)r=n.parentNode,a=pi(l),l=l.previousSibling;if(l)n=l,i=Pa(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}o?Xs(e,n,i):r&&Xs(e,r,a)}function xy(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r=Pa(n),a,o;for(;;)if(i<r){if(n.nodeType!=1)break;let l=n.childNodes[i];if(ar(l,1))a=n,o=++i;else break}else{if(ap(n))break;{let l=n.nextSibling;for(;l&&ar(l,1);)a=l.parentNode,o=pi(l)+1,l=l.nextSibling;if(l)n=l,i=0,r=Pa(n);else{if(n=n.parentNode,n==e.dom)break;i=r=0}}}a&&Xs(e,a,o)}function ap(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function yy(e,t){for(;e&&t==e.childNodes.length&&!Il(e);)t=pi(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function ky(e,t){for(;e&&!t&&!Il(e);)t=pi(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Xs(e,t,n){if(t.nodeType!=3){let a,o;(o=yy(t,n))?(t=o,n=0):(a=ky(t,n))&&(t=a,n=a.nodeValue.length)}let i=e.domSelection();if(!i)return;if(Zf(i)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&Bl(e)},50)}function xu(e,t){let n=e.state.doc.resolve(t);if(!(xn||np)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function yu(e,t,n){let i=e.state.selection;if(i instanceof he&&!i.empty||n.indexOf("s")>-1||Lt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=Ks(e.state,t);if(o&&o instanceof pe)return Tn(e,o)}if(!r.parent.inlineContent){let o=t<0?r:a,l=i instanceof Ot?ge.near(o,t):ge.findFrom(o,t);return l?Tn(e,l):!1}return!1}function ku(e,t){if(!(e.state.selection instanceof he))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let o=e.state.tr;return t<0?o.delete(n.pos-a.nodeSize,n.pos):o.delete(n.pos,n.pos+a.nodeSize),e.dispatch(o),!0}return!1}function wu(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wy(e){if(!mi||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let i=t.firstChild;wu(e,i,"true"),setTimeout(()=>wu(e,i,"false"),20)}return!1}function _y(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function Sy(e,t){let n=t.keyCode,i=_y(t);if(n==8||Lt&&n==72&&i=="c")return ku(e,-1)||ki(e,-1);if(n==46&&!t.shiftKey||Lt&&n==68&&i=="c")return ku(e,1)||ki(e,1);if(n==13||n==27)return!0;if(n==37||Lt&&n==66&&i=="c"){let r=n==37?xu(e,e.state.selection.from)=="ltr"?-1:1:-1;return vu(e,r,i)||ki(e,r)}else if(n==39||Lt&&n==70&&i=="c"){let r=n==39?xu(e,e.state.selection.from)=="ltr"?1:-1:1;return vu(e,r,i)||ki(e,r)}else{if(n==38||Lt&&n==80&&i=="c")return yu(e,-1,i)||ki(e,-1);if(n==40||Lt&&n==78&&i=="c")return wy(e)||yu(e,1,i)||ki(e,1);if(i==(Lt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function op(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:i,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,a--;let h=i.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),i=h.content}let o=e.someProp("clipboardSerializer")||Ri.fromSchema(e.state.schema),l=fp(),c=l.createElement("div");c.appendChild(o.serializeFragment(i,{document:l}));let u=c.firstChild,f,m=0;for(;u&&u.nodeType==1&&(f=dp[u.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let g=l.createElement(f[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),m++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${m?` -${m}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
`))),0,0),e.someProp("transformPasted",p=>{l=p(l,e,!0)}),l;let m=e.someProp("clipboardTextParser",p=>p(t,r,i,e));if(m)l=m;else{let p=r.marks(),{schema:h}=e.state,g=Ri.fromSchema(h);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let x=o.appendChild(document.createElement("p"));b&&x.appendChild(g.serializeNode(h.text(b,p)))})}}else e.someProp("transformPastedHTML",m=>{n=m(n,e)}),o=Ty(n),Ll&&Ny(o);let u=o&&o.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let m=+f[3];m>0;m--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||ir.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Cy.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)l=Oy(_u(l,+f[1],+f[2]),f[4]);else if(l=ae.maxOpen(Ey(l.content,r),!0),l.openStart||l.openEnd){let m=0,p=0;for(let h=l.content.firstChild;m<l.openStart&&!h.type.spec.isolating;m++,h=h.firstChild);for(let h=l.content.lastChild;p<l.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);l=_u(l,m,p)}return e.someProp("transformPasted",m=>{l=m(l,e,c)}),l}const Cy=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ey(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,o=[];if(e.forEach(l=>{if(!o)return;let c=r.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&a.length&&cp(c,a,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=up(o[o.length-1],a.length));let f=lp(l,c);o.push(f),r=r.matchType(f.type),a=c}}),o)return J.from(o)}return e}function lp(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,J.from(e));return e}function cp(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=cp(e,t,n,i.lastChild,r+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(J.from(lp(n,e,r+1))))}}function up(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,up(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(J.empty,!0);return e.copy(n.append(i))}function Js(e,t,n,i,r,a){let o=t<0?e.firstChild:e.lastChild,l=o.content;return e.childCount>1&&(a=0),r<i-1&&(l=Js(l,t,n,i,r+1,a)),r>=n&&(l=t<0?o.contentMatchAt(0).fillBefore(l,a<=r).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function _u(e,t,n){return t<e.openStart&&(e=new ae(Js(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(Js(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const dp={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Su=null;function fp(){return Su||(Su=document.implementation.createHTMLDocument("title"))}let ns=null;function Ay(e){let t=window.trustedTypes;return t?(ns||(ns=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),ns.createHTML(e)):e}function Ty(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=fp().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e),r;if((r=i&&dp[i[1].toLowerCase()])&&(e=r.map(a=>"<"+a+">").join("")+e+r.map(a=>"</"+a+">").reverse().join("")),n.innerHTML=Ay(e),r)for(let a=0;a<r.length;a++)n=n.querySelector(r[a])||n;return n}function Ny(e){let t=e.querySelectorAll(xn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}function Oy(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:o}=e;for(let l=i.length-2;l>=0;l-=2){let c=n.nodes[i[l]];if(!c||c.hasRequiredAttrs())break;r=J.from(c.create(i[l+1],r)),a++,o++}return new ae(r,a,o)}const jt={},Mt={};function gn(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Mt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!bp(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Or&&xn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Rl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",r=>r(e,Qf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||Sy(e,n)?n.preventDefault():gn(e,"key")};Mt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Mt.keypress=(e,t)=>{let n=t;if(bp(e)||!n.charCode||n.ctrlKey&&!n.altKey||Lt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof he)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",o=>o(e,i.$from.pos,i.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function Mr(e){return{left:e.clientX,top:e.clientY}}function My(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function Pl(e,t,n,i,r){if(i==-1)return!1;let a=e.state.doc.resolve(i);for(let o=a.depth+1;o>0;o--)if(e.someProp(t,l=>o>a.depth?l(e,n,a.nodeAfter,a.before(o),r,!0):l(e,n,a.node(o),a.before(o),r,!1)))return!0;return!1}function Dr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function Dy(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&pe.isSelectable(i)?(Dr(e,new pe(n)),!0):!1}function zy(e,t){if(t==-1)return!1;let n=e.state.selection,i,r;n instanceof pe&&(i=n.node);let a=e.state.doc.resolve(t);for(let o=a.depth+1;o>0;o--){let l=o>a.depth?a.nodeAfter:a.node(o);if(pe.isSelectable(l)){i&&n.$from.depth>0&&o>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(o);break}}return r!=null?(Dr(e,pe.create(e.state.doc,r)),!0):!1}function Iy(e,t,n,i,r){return Pl(e,"handleClickOn",t,n,i)||e.someProp("handleClick",a=>a(e,t,i))||(r?zy(e,n):Dy(e,n))}function Ry(e,t,n,i){return Pl(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",r=>r(e,t,i))}function Ly(e,t,n,i){return Pl(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",r=>r(e,t,i))||By(e,n,i)}function By(e,t,n){if(n.button!=0)return!1;let i=pp(e,t,!0),r=e.state.doc;return i?(Dr(e,i),i instanceof he&&r.eq(e.state.doc)&&(e.input.mouseDown=new Fy(e,i)),!0):!1}function pp(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?he.create(i,0,i.content.size):null;let r=i.resolve(t);for(let a=r.depth+1;a>0;a--){let o=a>r.depth?r.nodeAfter:r.node(a),l=r.before(a);if(o.inlineContent)return he.create(i,l+1,l+1+o.content.size);if(n&&pe.isSelectable(o))return pe.create(i,l)}return null}function Fl(e){return Fa(e)}const mp=Lt?"metaKey":"ctrlKey";jt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Fl(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&My(n,e.input.lastClick)&&!n[mp]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Mr(n));o&&(a=="singleClick"?e.input.mouseDown=new Py(e,o,n,!!i):(a=="doubleClick"?Ry:Ly)(e,o.pos,o.inside,n)?n.preventDefault():gn(e,"pointer"))};class hp{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Py extends hp{constructor(t,n,i,r){super(t),this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[mp],this.allowDefault=i.shiftKey;let a,o;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),o=n.inside;else{let f=t.state.doc.resolve(n.pos);a=f.parent,o=f.depth?f.before():0}const l=r?null:i.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof pe&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&No&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),gn(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Bl(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Mr(t))),this.updateAllowDefault(t),this.allowDefault||!n?gn(this.view,"pointer"):Iy(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||mi&&this.mightDrag&&!this.mightDrag.node.isAtom||xn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Dr(this.view,ge.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):gn(this.view,"pointer")}move(t){this.updateAllowDefault(t),gn(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class Fy extends hp{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),gn(this.view,"pointer");let n=this.view.posAtCoords(Mr(t)),i=n&&pp(this.view,n.inside,!1);if(!i)return;let{doc:r}=this.view.state,a=this.startSelection,[o,l]=i.from<a.from?[a.to,i.from]:[a.from,i.to];Dr(this.view,he.create(r,o,l))}}jt.touchstart=e=>{e.input.lastTouch=Date.now(),Fl(e),gn(e,"pointer")};jt.touchmove=e=>{e.input.lastTouch=Date.now(),gn(e,"pointer")};jt.contextmenu=e=>Fl(e);function bp(e,t){return e.composing?!0:mi&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Vy=Or?5e3:-1;Mt.compositionstart=Mt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof he&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||xn&&np&&Uy(e)))e.markCursor=e.state.storedMarks||n.marks(),Fa(e,!0),e.markCursor=null;else if(Fa(e,!t.selection.empty),No&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let r=i.focusNode,a=i.focusOffset;r&&r.nodeType==1&&a!=0;){let o=a<0?r.lastChild:r.childNodes[a-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else r=o,a=-1}}e.input.composing=!0}gp(e,Vy)};function Uy(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Mt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,gp(e,20))};function gp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Fa(e),t))}function Hy(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Fa(e,t=!1){if(!(Or&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Hy(e),t||e.docView&&e.docView.dirty){let n=py(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function qy(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const xr=Nr&&ep<15||Rl&&fy<604;jt.copy=Mt.cut=(e,t)=>{let n=t,i=e.state.selection,r=n.type=="cut";if(i.empty)return;let a=xr?null:n.clipboardData,o=i.content(),{dom:l,text:c}=op(e,o);a?(n.preventDefault(),a.clearData(),a.setData("text/html",l.innerHTML),a.setData("text/plain",c)):qy(e,l),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function jy(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function $y(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Zs(e,i.value,null,r,t):Zs(e,i.textContent,i.innerHTML,r,t)},50)}function Zs(e,t,n,i,r){let a=sp(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,r,a||ae.empty)))return!0;if(!a)return!1;let o=jy(a),l=o?e.state.tr.replaceSelectionWith(o,i):e.state.tr.replaceSelection(a);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function vp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Mt.paste=(e,t)=>{let n=t;if(e.composing&&!Or)return;let i=xr?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&Zs(e,vp(i),i.getData("text/html"),r,n)?n.preventDefault():$y(e,n)};class Wy{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const Gy=Lt?"altKey":"ctrlKey";function xp(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[Gy]}jt.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(Mr(n)),o;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof pe?r.to-1:r.to))){if(i&&i.mightDrag)o=pe.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=e.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=e.docView&&(o=pe.create(e.state.doc,m.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:u,slice:f}=op(e,l);(!n.dataTransfer.files.length||!xn||tp>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xr?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",xr||n.dataTransfer.setData("text/plain",u),e.dragging=new Wy(f,xp(e,n),o)};jt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Mt.dragover=Mt.dragenter=(e,t)=>t.preventDefault();Mt.drop=(e,t)=>{try{Ky(e,t,e.dragging)}finally{e.dragging=null}};function Ky(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Mr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=sp(e,vp(t.dataTransfer),xr?null:t.dataTransfer.getData("text/html"),!1,r);let o=!!(n&&xp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let l=a?ny(e.state.doc,r.pos,a):r.pos;l==null&&(l=r.pos);let c=e.state.tr;if(o){let{node:h}=n;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,m=c.doc;if(f?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(m))return;let p=c.doc.resolve(u);if(f&&pe.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new pe(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,x,v)=>h=v),c.setSelection(rp(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}jt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Bl(e)},20))};jt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};jt.beforeinput=(e,t)=>{if(xn&&Or&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,Qf(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Mt)jt[e]=Mt[e];function yr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Va{constructor(t,n){this.toDOM=t,this.spec=n||si,this.side=this.spec.side||0}map(t,n,i,r){let{pos:a,deleted:o}=t.mapResult(n.from+r,this.side<0?-1:1);return o?null:new ot(a-i,a-i,this)}valid(){return!0}eq(t){return this==t||t instanceof Va&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&yr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pn{constructor(t,n){this.attrs=t,this.spec=n||si}map(t,n,i,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,o=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return a>=o?null:new ot(a,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Pn&&yr(this.attrs,t.attrs)&&yr(this.spec,t.spec)}static is(t){return t.type instanceof Pn}destroy(){}}class Vl{constructor(t,n){this.attrs=t,this.spec=n||si}map(t,n,i,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let o=t.mapResult(n.to+r,-1);return o.deleted||o.pos<=a.pos?null:new ot(a.pos-i,o.pos-i,this)}valid(t,n){let{index:i,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(i)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof Vl&&yr(this.attrs,t.attrs)&&yr(this.spec,t.spec)}destroy(){}}class ot{constructor(t,n,i){this.from=t,this.to=n,this.type=i}copy(t,n){return new ot(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,i){return this.type.map(t,this,n,i)}static widget(t,n,i){return new ot(t,t,new Va(n,i))}static inline(t,n,i,r){return new ot(t,n,new Pn(i,r))}static node(t,n,i,r){return new ot(t,n,new Vl(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pn}get widget(){return this.type instanceof Va}}const Ci=[],si={};class Ve{constructor(t,n){this.local=t.length?t:Ci,this.children=n.length?n:Ci}static create(t,n){return n.length?Ua(n,t,0,si):bt}find(t,n,i){let r=[];return this.findInner(t??0,n??1e9,r,0,i),r}findInner(t,n,i,r,a){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=t&&(!a||a(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let l=this.children[o]+1;this.children[o+2].findInner(t-l,n-l,i,r+l,a)}}map(t,n,i){return this==bt||t.maps.length==0?this:this.mapInner(t,n,0,0,i||si)}mapInner(t,n,i,r,a){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,i,r);c&&c.type.valid(n,c)?(o||(o=[])).push(c):a.onRemove&&a.onRemove(this.local[l].spec)}return this.children.length?Xy(this.children,o||[],t,n,i,r,a):o?new Ve(o.sort(li),Ci):bt}add(t,n){return n.length?this==bt?Ve.create(t,n):this.addInner(t,n,0):this}addInner(t,n,i){let r,a=0;t.forEach((l,c)=>{let u=c+i,f;if(f=kp(n,l,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<c;)a+=3;r[a]==c?r[a+2]=r[a+2].addInner(l,f,u+1):r.splice(a,0,c,c+l.nodeSize,Ua(f,l,u+1,si)),a+=3}});let o=yp(a?wp(n):n,-i);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||o.splice(l--,1);return new Ve(o.length?this.local.concat(o).sort(li):this.local,r||this.children)}remove(t){return t.length==0||this==bt?this:this.removeInner(t,0)}removeInner(t,n){let i=this.children,r=this.local;for(let a=0;a<i.length;a+=3){let o,l=i[a]+n,c=i[a+1]+n;for(let f=0,m;f<t.length;f++)(m=t[f])&&m.from>l&&m.to<c&&(t[f]=null,(o||(o=[])).push(m));if(!o)continue;i==this.children&&(i=this.children.slice());let u=i[a+2].removeInner(o,l+1);u!=bt?i[a+2]=u:(i.splice(a,3),a-=3)}if(r.length){for(let a=0,o;a<t.length;a++)if(o=t[a])for(let l=0;l<r.length;l++)r[l].eq(o,n)&&(r==this.local&&(r=this.local.slice()),r.splice(l--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new Ve(r,i):bt}forChild(t,n){if(this==bt)return this;if(n.isLeaf)return Ve.empty;let i,r;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(i=this.children[l+2]);break}let a=t+1,o=a+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>a&&c.type instanceof Pn){let u=Math.max(a,c.from)-a,f=Math.min(o,c.to)-a;u<f&&(r||(r=[])).push(c.copy(u,f))}}if(r){let l=new Ve(r.sort(li),Ci);return i?new Yn([l,i]):l}return i||bt}eq(t){if(this==t)return!0;if(!(t instanceof Ve)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return Ul(this.localsInner(t))}localsInner(t){if(this==bt)return Ci;if(t.inlineContent||!this.local.some(Pn.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Pn||n.push(this.local[i]);return n}forEachSet(t){t(this)}}Ve.empty=new Ve([],[]);Ve.removeOverlap=Ul;const bt=Ve.empty;class Yn{constructor(t){this.members=t}map(t,n){const i=this.members.map(r=>r.map(t,n,si));return Yn.from(i)}forChild(t,n){if(n.isLeaf)return Ve.empty;let i=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=bt&&(a instanceof Yn?i=i.concat(a.members):i.push(a))}return Yn.from(i)}eq(t){if(!(t instanceof Yn)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,i=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{i&&(n=n.slice(),i=!1);for(let o=0;o<a.length;o++)n.push(a[o])}}return n?Ul(i?n:n.sort(li)):Ci}static from(t){switch(t.length){case 0:return bt;case 1:return t[0];default:return new Yn(t.every(n=>n instanceof Ve)?t:t.reduce((n,i)=>n.concat(i instanceof Ve?i:i.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Xy(e,t,n,i,r,a,o){let l=e.slice();for(let u=0,f=a;u<n.maps.length;u++){let m=0;n.maps[u].forEach((p,h,g,b)=>{let x=b-g-(h-p);for(let v=0;v<l.length;v+=3){let y=l[v+1];if(y<0||p>y+f-m)continue;let k=l[v]+f-m;h>=k?l[v+1]=p<=k?-2:-1:p>=f&&x&&(l[v]+=x,l[v+1]+=x)}m+=x}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){c=!0,l[u+1]=-1;continue}let f=n.map(e[u]+a),m=f-r;if(m<0||m>=i.content.size){c=!0;continue}let p=n.map(e[u+1]+a,-1),h=p-r,{index:g,offset:b}=i.content.findIndex(m),x=i.maybeChild(g);if(x&&b==m&&b+x.nodeSize==h){let v=l[u+2].mapInner(n,x,f+1,e[u]+a+1,o);v!=bt?(l[u]=m,l[u+1]=h,l[u+2]=v):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=Jy(l,e,t,n,r,a,o),f=Ua(u,i,0,o);t=f.local;for(let m=0;m<l.length;m+=3)l[m+1]<0&&(l.splice(m,3),m-=3);for(let m=0,p=0;m<f.children.length;m+=3){let h=f.children[m];for(;p<l.length&&l[p]<h;)p+=3;l.splice(p,0,f.children[m],f.children[m+1],f.children[m+2])}}return new Ve(t.sort(li),l)}function yp(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new ot(r.from+t,r.to+t,r.type))}return n}function Jy(e,t,n,i,r,a,o){function l(c,u){for(let f=0;f<c.local.length;f++){let m=c.local[f].map(i,r,u);m?n.push(m):o.onRemove&&o.onRemove(c.local[f].spec)}for(let f=0;f<c.children.length;f+=3)l(c.children[f+2],c.children[f]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+a+1);return n}function kp(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let a=0,o;a<e.length;a++)(o=e[a])&&o.from>n&&o.to<i&&((r||(r=[])).push(o),e[a]=null);return r}function wp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Ua(e,t,n,i){let r=[],a=!1;t.forEach((l,c)=>{let u=kp(e,l,c+n);if(u){a=!0;let f=Ua(u,l,n+c+1,i);f!=bt&&r.push(c,c+l.nodeSize,f)}});let o=yp(a?wp(e):e,-n).sort(li);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(i.onRemove&&i.onRemove(o[l].spec),o.splice(l--,1));return o.length||r.length?new Ve(o,r):bt}function li(e,t){return e.from-t.from||e.to-t.to}function Ul(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==i.from){a.to!=i.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,i.to),Cu(t,r+1,a.copy(i.to,a.to)));continue}else{a.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,a.from),Cu(t,r,i.copy(a.from,i.to)));break}}}return t}function Cu(e,t,n){for(;t<e.length&&li(n,e[t])>0;)t++;e.splice(t,0,n)}var Fn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ha={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Zy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Qy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var it=0;it<10;it++)Fn[48+it]=Fn[96+it]=String(it);for(var it=1;it<=24;it++)Fn[it+111]="F"+it;for(var it=65;it<=90;it++)Fn[it]=String.fromCharCode(it+32),Ha[it]=String.fromCharCode(it);for(var is in Fn)Ha.hasOwnProperty(is)||(Ha[is]=Fn[is]);function Yy(e){var t=Zy&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Qy&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ha:Fn)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const ek=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),tk=typeof navigator<"u"&&/Win/.test(navigator.platform);function nk(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))ek?o=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),o&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function ik(e){let t=Object.create(null);for(let n in e)t[nk(n)]=e[n];return t}function rs(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function rk(e){let t=ik(e);return function(n,i){let r=Yy(i),a,o=t[rs(r,i)];if(o&&o(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let l=t[rs(r,i,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(tk&&i.ctrlKey&&i.altKey)&&(a=Fn[i.keyCode])&&a!=r){let l=t[rs(a,i)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Hl=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function _p(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Sp=(e,t,n)=>{let i=_p(e,n);if(!i)return!1;let r=ql(i);if(!r){let o=i.blockRange(),l=o&&Li(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let a=r.nodeBefore;if(zp(e,r,t,-1))return!0;if(i.parent.content.size==0&&(Oi(a,"end")||pe.isSelectable(a)))for(let o=i.depth;;o--){let l=Ao(e.doc,i.before(o),i.after(o),ae.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(Oi(a,"end")?ge.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):pe.create(c.doc,r.pos-a.nodeSize)),t(c.scrollIntoView())}return!0}if(o==1||i.node(o-1).childCount>1)break}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},ak=(e,t,n)=>{let i=_p(e,n);if(!i)return!1;let r=ql(i);return r?Cp(e,r,t):!1},ok=(e,t,n)=>{let i=Ap(e,n);if(!i)return!1;let r=jl(i);return r?Cp(e,r,t):!1};function Cp(e,t,n){let i=t.nodeBefore,r=i,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let u=Ao(e.doc,a,c,ae.empty);if(!u||u.from!=a||u instanceof qe&&u.slice.size>=c-a)return!1;if(n){let f=e.tr.step(u);f.setSelection(he.create(f.doc,a)),n(f.scrollIntoView())}return!0}function Oi(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const Ep=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;a=ql(i)}let o=a&&a.nodeBefore;return!o||!pe.isSelectable(o)?!1:(t&&t(e.tr.setSelection(pe.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function ql(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ap(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Tp=(e,t,n)=>{let i=Ap(e,n);if(!i)return!1;let r=jl(i);if(!r)return!1;let a=r.nodeAfter;if(zp(e,r,t,1))return!0;if(i.parent.content.size==0&&(Oi(a,"start")||pe.isSelectable(a))){let o=Ao(e.doc,i.before(),i.after(),ae.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(Oi(a,"start")?ge.findFrom(l.doc.resolve(l.mapping.map(r.pos)),1):pe.create(l.doc,l.mapping.map(r.pos))),t(l.scrollIntoView())}return!0}}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},Np=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;a=jl(i)}let o=a&&a.nodeAfter;return!o||!pe.isSelectable(o)?!1:(t&&t(e.tr.setSelection(pe.create(e.doc,a.pos)).scrollIntoView()),!0)};function jl(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const sk=(e,t)=>{let n=e.selection,i=n instanceof pe,r;if(i){if(n.node.isTextblock||!Un(e.doc,n.from))return!1;r=n.from}else if(r=Eo(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);i&&a.setSelection(pe.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},lk=(e,t)=>{let n=e.selection,i;if(n instanceof pe){if(n.node.isTextblock||!Un(e.doc,n.to))return!1;i=n.to}else if(i=Eo(e.doc,n.to,1),i==null)return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},ck=(e,t)=>{let{$from:n,$to:i}=e.selection,r=n.blockRange(i),a=r&&Li(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},Op=(e,t)=>{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(`
|
|
649
|
-
`).scrollIntoView()),!0)};function $l(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const uk=(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),a=n.indexAfter(-1),o=$l(r.contentMatchAt(a));if(!o||!r.canReplaceWith(a,a,o))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(ge.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},Mp=(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof Ot||i.parent.inlineContent||r.parent.inlineContent)return!1;let a=$l(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let o=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,l=e.tr.insert(o,a.createAndFill());l.setSelection(he.create(l.doc,o+1)),t(l.scrollIntoView())}return!0},Dp=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(vn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let i=n.blockRange(),r=i&&Li(i);return r==null?!1:(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)};function dk(e){return(t,n)=>{let{$from:i,$to:r}=t.selection;if(t.selection instanceof pe&&t.selection.node.isBlock)return!i.parentOffset||!vn(t.doc,i.pos)?!1:(n&&n(t.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let a=[],o,l,c=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){c=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),l=$l(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),a.unshift(c&&l?{type:l}:null),o=h;break}else{if(h==1)return!1;a.unshift(null)}let f=t.tr;(t.selection instanceof he||t.selection instanceof Ot)&&f.deleteSelection();let m=f.mapping.map(i.pos),p=vn(f.doc,m,a.length,a);if(p||(a[0]=l?{type:l}:null,p=vn(f.doc,m,a.length,a)),!p)return!1;if(f.split(m,a.length,a),!c&&u&&i.node(o).type!=l){let h=f.mapping.map(i.before(o)),g=f.doc.resolve(h);l&&i.node(o-1).canReplaceWith(g.index(),g.index()+1,l)&&f.setNodeMarkup(f.mapping.map(i.before(o)),l)}return n&&n(f.scrollIntoView()),!0}}const fk=dk(),pk=(e,t)=>{let{$from:n,to:i}=e.selection,r,a=n.sharedDepth(i);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(pe.create(e.doc,r))),!0)};function mk(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,a=t.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Un(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function zp(e,t,n,i){let r=t.nodeBefore,a=t.nodeAfter,o,l,c=r.type.spec.isolating||a.type.spec.isolating;if(!c&&mk(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&l.matchType(o[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,g=J.empty;for(let v=o.length-1;v>=0;v--)g=J.from(o[v].create(null,g));g=J.from(r.copy(g));let b=e.tr.step(new Ke(t.pos-1,h,t.pos,h,new ae(g,1,0),o.length,!0)),x=b.doc.resolve(h+2*o.length);x.nodeAfter&&x.nodeAfter.type==r.type&&Un(b.doc,x.pos)&&b.join(x.pos),n(b.scrollIntoView())}return!0}let f=a.type.spec.isolating||i>0&&c?null:ge.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),p=m&&Li(m);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(m,p).scrollIntoView()),!0;if(u&&Oi(a,"start",!0)&&Oi(r,"end")){let h=r,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=a,x=1;for(;!b.isTextblock;b=b.firstChild)x++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let v=J.empty;for(let k=g.length-1;k>=0;k--)v=J.from(g[k].copy(v));let y=e.tr.step(new Ke(t.pos-g.length,t.pos+a.nodeSize,t.pos+x,t.pos+a.nodeSize-x,new ae(v,g.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function Ip(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(he.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const hk=Ip(-1),bk=Ip(1);function gk(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a),l=o&&Dl(o,e,t);return l?(i&&i(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Eu(e,t=null){return function(n,i){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[a];n.doc.nodesBetween(o,l,(c,u)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)r=!0;else{let f=n.doc.resolve(u),m=f.index();r=f.parent.canReplaceWith(m,m+1,e)}})}if(!r)return!1;if(i){let a=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];a.setBlockType(l,c,e,t)}i(a.scrollIntoView())}return!0}}function Wl(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}Wl(Hl,Sp,Ep);Wl(Hl,Tp,Np);Wl(Op,Mp,Dp,fk);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function vk(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a);if(!o)return!1;let l=i?n.tr:null;return xk(l,o,e,t)?(i&&i(l.scrollIntoView()),!0):!1}}function xk(e,t,n,i=null){let r=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);a=new Ia(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new Ia(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let l=Dl(a,n,i,t);return l?(e&&yk(e,t,l,r,n),!0):!1}function yk(e,t,n,i,r){let a=J.empty;for(let f=n.length-1;f>=0;f--)a=J.from(n[f].type.create(n[f].attrs,a));e.step(new Ke(t.start-(i?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let o=0;for(let f=0;f<n.length;f++)n[f].type==r&&(o=f+1);let l=n.length-o,c=t.start+n.length-(i?2:0),u=t.parent;for(let f=t.startIndex,m=t.endIndex,p=!0;f<m;f++,p=!1)!p&&vn(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=u.child(f).nodeSize;return e}function kk(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==e);return a?n?i.node(a.depth-1).type==e?wk(t,n,e,a):_k(t,n,a):!0:!1}}function wk(e,t,n,i){let r=e.tr,a=i.end,o=i.$to.end(i.depth);a<o&&(r.step(new Ke(a-1,o,a,o,new ae(J.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new Ia(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=Li(i);if(l==null)return!1;r.lift(i,l);let c=r.doc.resolve(r.mapping.map(a,-1)-1);return Un(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),t(r.scrollIntoView()),!0}function _k(e,t,n){let i=e.tr,r=n.parent;for(let h=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)h-=r.child(g).nodeSize,i.delete(h-1,h+1);let a=i.doc.resolve(n.start),o=a.nodeAfter;if(i.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==r.childCount,u=a.node(-1),f=a.index(-1);if(!u.canReplace(f+(l?0:1),f+1,o.content.append(c?J.empty:J.from(r))))return!1;let m=a.pos,p=m+o.nodeSize;return i.step(new Ke(m-(l?1:0),p+(c?1:0),m+1,p-1,new ae((l?J.empty:J.from(r.copy(J.empty))).append(c?J.empty:J.from(r.copy(J.empty))),l?0:1,c?0:1),l?0:1)),t(i.scrollIntoView()),!0}function Sk(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let l=a.parent,c=l.child(o-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==l.type,f=J.from(u?e.create():null),m=new ae(J.from(e.create(null,J.from(l.type.create(null,f)))),u?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Ke(p-(u?3:1),h,p,h,m,1,!0)).scrollIntoView())}return!0}}function Rp(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,a=n.storedMarks,n}}}class Ck{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:i}=this,{view:r}=n,{tr:a}=i,o=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...f)=>{const m=c(...f)(o);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l=[],c=!!t,u=t||a.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(p=>p===!0)),m={...Object.fromEntries(Object.entries(i).map(([p,h])=>[p,(...b)=>{const x=this.buildProps(u,n),v=h(...b)(x);return l.push(v),m}])),run:f};return m}createCan(t){const{rawCommands:n,state:i}=this,r=!1,a=t||i.tr,o=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...o,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l={tr:t,editor:r,view:o,state:Rp({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(i).map(([c,u])=>[c,(...f)=>u(...f)(l)]))}};return l}}function st(e,t,n){return e.config[t]===void 0&&e.parent?st(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?st(e.parent,t,n):null}):e.config[t]}function Ek(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),i=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:i}}function rt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Be(...e){return e.filter(t=>!!t).reduce((t,n)=>{const i={...t};return Object.entries(n).forEach(([r,a])=>{if(!i[r]){i[r]=a;return}if(r==="class"){const l=a?String(a).split(" "):[],c=i[r]?i[r].split(" "):[],u=l.filter(f=>!c.includes(f));i[r]=[...c,...u].join(" ")}else if(r==="style"){const l=a?a.split(";").map(f=>f.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;c.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),l.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),i[r]=Array.from(u.entries()).map(([f,m])=>`${f}: ${m}`).join("; ")}else i[r]=a}),i},{})}function Ak(e){return typeof e=="function"}function Qe(e,t=void 0,...n){return Ak(e)?t?e.bind(t)(...n):e(...n):e}function Lp(e,t){const n=Ri.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Tk(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class Gl{constructor(t){this.find=t.find,this.handler=t.handler}}function Nk(e){return Object.prototype.toString.call(e).slice(8,-1)}function sa(e){return Nk(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Oo(e,t){const n={...e};return sa(e)&&sa(t)&&Object.keys(t).forEach(i=>{sa(t[i])&&sa(e[i])?n[i]=Oo(e[i],t[i]):n[i]=t[i]}),n}class St{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new St(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new St(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:i}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),t.view.dispatch(i),!0}return!1}}class Ok{constructor(t){this.find=t.find,this.handler=t.handler}}class je{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new je(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new je({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}}function Mk(e,t,n){const{from:i,to:r}=t,{blockSeparator:a=`
|
|
650
|
-
|
|
651
|
-
`,textSerializers:o={}}=n||{};let l="";return e.nodesBetween(i,r,(c,u,f,m)=>{var p;c.isBlock&&u>i&&(l+=a);const h=o==null?void 0:o[c.type.name];if(h)return f&&(l+=h({node:c,pos:u,parent:f,index:m,range:t})),!1;c.isText&&(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(i,u)-u,r-u))}),l}function Dk(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const zk=je.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dt({key:new at("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:r}=t,{ranges:a}=r,o=Math.min(...a.map(f=>f.$from.pos)),l=Math.max(...a.map(f=>f.$to.pos)),c=Dk(n);return Mk(i,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Ik=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Rk=(e=!1)=>({commands:t})=>t.setContent("",e),Lk=()=>({state:e,tr:t,dispatch:n})=>{const{selection:i}=t,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:o})=>{e.doc.nodesBetween(a.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:f}=t,m=u.resolve(f.map(c)),p=u.resolve(f.map(c+l.nodeSize)),h=m.blockRange(p);if(!h)return;const g=Li(h);if(l.type.isTextblock){const{defaultType:b}=m.parent.contentMatchAt(m.index());t.setNodeMarkup(h.start,b)}(g||g===0)&&t.lift(h,g)})}),!0},Bk=e=>t=>e(t),Pk=()=>({state:e,dispatch:t})=>Mp(e,t),Fk=(e,t)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);const o=i.mapping.map(t);return i.insert(o,a.content),i.setSelection(new he(i.doc.resolve(Math.max(o-1,0)))),!0},Vk=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,i=n.$anchor.node();if(i.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(t){const l=r.before(a),c=r.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},Uk=e=>({tr:t,state:n,dispatch:i})=>{const r=rt(e,n.schema),a=t.selection.$anchor;for(let o=a.depth;o>0;o-=1)if(a.node(o).type===r){if(i){const c=a.before(o),u=a.after(o);t.delete(c,u).scrollIntoView()}return!0}return!1},Hk=e=>({tr:t,dispatch:n})=>{const{from:i,to:r}=e;return n&&t.delete(i,r),!0},qk=()=>({state:e,dispatch:t})=>Hl(e,t),jk=()=>({commands:e})=>e.keyboardShortcut("Enter"),$k=()=>({state:e,dispatch:t})=>uk(e,t);function qa(e,t,n={strict:!0}){const i=Object.keys(t);return i.length?i.every(r=>n.strict?t[r]===e[r]:Tk(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Bp(e,t,n={}){return e.find(i=>i.type===t&&qa(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function Au(e,t,n={}){return!!Bp(e,t,n)}function Kl(e,t,n){var i;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===t)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!Bp([...r.node.marks],t,n)))return;let o=r.index,l=e.start()+r.offset,c=o+1,u=l+r.node.nodeSize;for(;o>0&&Au([...e.parent.child(o-1).marks],t,n);)o-=1,l-=e.parent.child(o).nodeSize;for(;c<e.parent.childCount&&Au([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:l,to:u}}function qn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Wk=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const a=qn(e,i.schema),{doc:o,selection:l}=n,{$from:c,from:u,to:f}=l;if(r){const m=Kl(c,a,t);if(m&&m.from<=u&&m.to>=f){const p=he.create(o,m.from,m.to);n.setSelection(p)}}return!0},Gk=e=>t=>{const n=typeof e=="function"?e(t):e;for(let i=0;i<n.length;i+=1)if(n[i](t))return!0;return!1};function Pp(e){return e instanceof he}function ti(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Kk(e,t=null){if(!t)return null;const n=ge.atStart(e),i=ge.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return i;const r=n.from,a=i.to;return t==="all"?he.create(e,ti(0,r,a),ti(e.content.size,r,a)):he.create(e,ti(t,r,a),ti(t,r,a))}function Tu(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Xk(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const Jk=(e=null,t={})=>({editor:n,view:i,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const o=()=>{(ja()||Tu())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),Xk()&&!ja()&&!Tu()&&i.dom.focus({preventScroll:!0}))})};if(i.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!Pp(n.state.selection))return o(),!0;const l=Kk(r.doc,e)||n.state.selection,c=n.state.selection.eq(l);return a&&(c||r.setSelection(l),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),o()),!0},Zk=(e,t)=>n=>e.every((i,r)=>t(i,{...n,index:r})),Qk=(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Fp=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const i=t[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?e.removeChild(i):i.nodeType===1&&Fp(i)}return e};function la(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return Fp(n)}function Mi(e,t,n){if(e instanceof oi||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};const i=typeof e=="object"&&e!==null,r=typeof e=="string";if(i)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Mi("",t,n)}if(r){if(n.errorOnInvalidContent){let o=!1,l="";const c=new Of({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?ir.fromSchema(c).parseSlice(la(e),n.parseOptions):ir.fromSchema(c).parse(la(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=ir.fromSchema(t);return n.slice?a.parseSlice(la(e),n.parseOptions).content:a.parse(la(e),n.parseOptions)}return Mi("",t,n)}function Yk(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}const e2=e=>!("type"in e),t2=(e,t,n)=>({tr:i,dispatch:r,editor:a})=>{var o;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=x=>{a.emit("contentError",{editor:a,error:x,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Mi(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(x){c(x)}try{l=Mi(t,a.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:a.options.enableContentCheck})}catch(x){return c(x),!1}let{from:f,to:m}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if((e2(l)?l:[l]).forEach(x=>{x.check(),p=p?x.isText&&x.marks.length===0:!1,h=h?x.isBlock:!1}),f===m&&h){const{parent:x}=i.doc.resolve(f);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(f-=1,m+=1)}let b;if(p){if(Array.isArray(t))b=t.map(x=>x.text||"").join("");else if(t instanceof J){let x="";t.forEach(v=>{v.text&&(x+=v.text)}),b=x}else typeof t=="object"&&t&&t.text?b=t.text:b=t;i.insertText(b,f,m)}else b=l,i.replaceWith(f,m,b);n.updateSelection&&Yk(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:f,text:b})}return!0},n2=()=>({state:e,dispatch:t})=>sk(e,t),i2=()=>({state:e,dispatch:t})=>lk(e,t),r2=()=>({state:e,dispatch:t})=>Sp(e,t),a2=()=>({state:e,dispatch:t})=>Tp(e,t),o2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Eo(e.doc,e.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},s2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Eo(e.doc,e.selection.$from.pos,1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},l2=()=>({state:e,dispatch:t})=>ak(e,t),c2=()=>({state:e,dispatch:t})=>ok(e,t);function Vp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function u2(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))ja()||Vp()?o=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const d2=e=>({editor:t,view:n,tr:i,dispatch:r})=>{const a=u2(e).split(/-(?!$)/),o=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,l))});return c==null||c.steps.forEach(u=>{const f=u.map(i.mapping);f&&r&&i.maybeStep(f)}),!0};function Xl(e,t,n={}){const{from:i,to:r,empty:a}=e.selection,o=t?rt(t,e.schema):null,l=[];e.doc.nodesBetween(i,r,(m,p)=>{if(m.isText)return;const h=Math.max(i,p),g=Math.min(r,p+m.nodeSize);l.push({node:m,from:h,to:g})});const c=r-i,u=l.filter(m=>o?o.name===m.node.type.name:!0).filter(m=>qa(m.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((m,p)=>m+p.to-p.from,0)>=c}const f2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return Xl(n,r,t)?ck(n,i):!1},p2=()=>({state:e,dispatch:t})=>Dp(e,t),m2=e=>({state:t,dispatch:n})=>{const i=rt(e,t.schema);return kk(i)(t,n)},h2=()=>({state:e,dispatch:t})=>Op(e,t);function Jl(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Nu(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((i,r)=>(n.includes(r)||(i[r]=e[r]),i),{})}const b2=(e,t)=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=Jl(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=rt(e,i.schema)),l==="mark"&&(o=qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{i.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{a&&a===u.type&&n.setNodeMarkup(f,void 0,Nu(u.attrs,t)),o&&u.marks.length&&u.marks.forEach(m=>{o===m.type&&n.addMark(f,f+u.nodeSize,o.create(Nu(m.attrs,t)))})})}),!0):!1},g2=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),v2=()=>({tr:e,dispatch:t})=>{if(t){const n=new Ot(e.doc);e.setSelection(n)}return!0},x2=()=>({state:e,dispatch:t})=>Ep(e,t),y2=()=>({state:e,dispatch:t})=>Np(e,t),k2=()=>({state:e,dispatch:t})=>pk(e,t),w2=()=>({state:e,dispatch:t})=>bk(e,t),_2=()=>({state:e,dispatch:t})=>hk(e,t);function S2(e,t,n={},i={}){return Mi(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const C2=(e,t=!1,n={},i={})=>({editor:r,tr:a,dispatch:o,commands:l})=>{var c,u;const{doc:f}=a;if(n.preserveWhitespace!=="full"){const m=S2(e,r.schema,n,{errorOnInvalidContent:(c=i.errorOnInvalidContent)!==null&&c!==void 0?c:r.options.enableContentCheck});return o&&a.replaceWith(0,f.content.size,m).setMeta("preventUpdate",!t),!0}return o&&a.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:f.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function Up(e,t){const n=qn(t,e.schema),{from:i,to:r,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,r,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function E2(e,t){const n=new Wf(e);return t.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function A2(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function T2(e,t,n){const i=[];return e.nodesBetween(t.from,t.to,(r,a)=>{n(r)&&i.push({node:r,pos:a})}),i}function Hp(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}function Zl(e){return t=>Hp(t.$from,e)}function N2(e,t){const n=rt(t,e.schema),{from:i,to:r}=e.selection,a=[];e.doc.nodesBetween(i,r,l=>{a.push(l)});const o=a.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function O2(e,t){const n=Jl(typeof t=="string"?t:t.name,e.schema);return n==="node"?N2(e,t):n==="mark"?Up(e,t):{}}function M2(e,t=JSON.stringify){const n={};return e.filter(i=>{const r=t(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function D2(e){const t=M2(e);return t.length===1?t:t.filter((n,i)=>!t.filter((a,o)=>o!==i).some(a=>n.oldRange.from>=a.oldRange.from&&n.oldRange.to<=a.oldRange.to&&n.newRange.from>=a.newRange.from&&n.newRange.to<=a.newRange.to))}function z2(e){const{mapping:t,steps:n}=e,i=[];return t.maps.forEach((r,a)=>{const o=[];if(r.ranges.length)r.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=n[a];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const u=t.slice(a).map(l,-1),f=t.slice(a).map(c),m=t.invert().map(u,-1),p=t.invert().map(f);i.push({oldRange:{from:m,to:p},newRange:{from:u,to:f}})})}),D2(i)}function Ql(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),o=Kl(a,r.type);o&&i.push({mark:r,...o})}):n.nodesBetween(e,t,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(o=>({from:a,to:a+r.nodeSize,mark:o})))}),i}function _a(e,t,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=e.find(a=>a.type===t&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function I2(e,t,n={}){const{empty:i,ranges:r}=e.selection,a=t?qn(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(m=>a?a.name===m.type.name:!0).find(m=>qa(m.attrs,n,{strict:!1}));let o=0;const l=[];if(r.forEach(({$from:m,$to:p})=>{const h=m.pos,g=p.pos;e.doc.nodesBetween(h,g,(b,x)=>{if(!b.isText&&!b.marks.length)return;const v=Math.max(h,x),y=Math.min(g,x+b.nodeSize),k=y-v;o+=k,l.push(...b.marks.map(w=>({mark:w,from:v,to:y})))})}),o===0)return!1;const c=l.filter(m=>a?a.name===m.mark.type.name:!0).filter(m=>qa(m.mark.attrs,n,{strict:!1})).reduce((m,p)=>m+p.to-p.from,0),u=l.filter(m=>a?m.mark.type!==a&&m.mark.type.excludes(a):!0).reduce((m,p)=>m+p.to-p.from,0);return(c>0?c+u:c)>=o}function Ou(e,t){const{nodeExtensions:n}=Ek(t),i=n.find(o=>o.name===e);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=Qe(st(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function Yl(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((i=e.text)!==null&&i!==void 0?i:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(Yl(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function R2(e,t,n){var i;const{selection:r}=t;let a=null;if(Pp(r)&&(a=r.$cursor),a){const l=(i=e.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:o}=r;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(f,m,p)=>{if(u)return!1;if(f.isInline){const h=!p||p.type.allowsMarkType(n),g=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));u=h&&g}return!u}),u})}const L2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:o,ranges:l}=a,c=qn(e,i.schema);if(r)if(o){const u=Up(i,c);n.addStoredMark(c.create({...u,...t}))}else l.forEach(u=>{const f=u.$from.pos,m=u.$to.pos;i.doc.nodesBetween(f,m,(p,h)=>{const g=Math.max(h,f),b=Math.min(h+p.nodeSize,m);p.marks.find(v=>v.type===c)?p.marks.forEach(v=>{c===v.type&&n.addMark(g,b,c.create({...v.attrs,...t}))}):n.addMark(g,b,c.create(t))})});return R2(i,n,c)},B2=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),P2=(e,t={})=>({state:n,dispatch:i,chain:r})=>{const a=rt(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:l})=>Eu(a,{...o,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Eu(a,{...o,...t})(l,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},F2=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,r=ti(e,0,i.content.size),a=pe.create(i,r);t.setSelection(a)}return!0},V2=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,o=he.atStart(i).from,l=he.atEnd(i).to,c=ti(r,o,l),u=ti(a,o,l),f=he.create(i,c,u);t.setSelection(f)}return!0},U2=e=>({state:t,dispatch:n})=>{const i=rt(e,t.schema);return Sk(i)(t,n)};function Mu(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter(r=>t==null?void 0:t.includes(r.type.name));e.tr.ensureMarks(i)}}const H2=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:o}=t,{$from:l,$to:c}=a,u=r.extensionManager.attributes,f=_a(u,l.node().type.name,l.node().attrs);if(a instanceof pe&&a.node.isBlock)return!l.parentOffset||!vn(o,l.pos)?!1:(i&&(e&&Mu(n,r.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:A2(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=m&&p?[{type:p,attrs:f}]:void 0,g=vn(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!g&&vn(t.doc,t.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(g=!0,h=p?[{type:p,attrs:f}]:void 0),i){if(g&&(a instanceof he&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),p&&!m&&!l.parentOffset&&l.parent.type!==p)){const b=t.mapping.map(l.before()),x=t.doc.resolve(b);l.node(-1).canReplaceWith(x.index(),x.index()+1,p)&&t.setNodeMarkup(t.mapping.map(l.before()),p)}e&&Mu(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return g},q2=(e,t={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var o;const l=rt(e,i.schema),{$from:c,$to:u}=i.selection,f=i.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(u))return!1;const m=c.node(-1);if(m.type!==l)return!1;const p=a.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let v=J.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let _=c.depth-y;_>=c.depth-3;_-=1)v=J.from(c.node(_).copy(v));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,w={..._a(p,c.node().type.name,c.node().attrs),...t},S=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(w))||void 0;v=v.append(J.from(l.createAndFill(null,S)||void 0));const E=c.before(c.depth-(y-1));n.replace(E,c.after(-k),new ae(v,4-y,0));let D=-1;n.doc.nodesBetween(E,n.doc.content.size,(_,C)=>{if(D>-1)return!1;_.isTextblock&&_.content.size===0&&(D=C+1)}),D>-1&&n.setSelection(he.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const h=u.pos===c.end()?m.contentMatchAt(0).defaultType:null,g={..._a(p,m.type.name,m.attrs),...t},b={..._a(p,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const x=h?[{type:l,attrs:g},{type:h,attrs:b}]:[{type:l,attrs:g}];if(!vn(n.doc,c.pos,2))return!1;if(r){const{selection:v,storedMarks:y}=i,{splittableMarks:k}=a.extensionManager,w=y||v.$to.parentOffset&&v.$from.marks();if(n.split(c.pos,2,x).scrollIntoView(),!w||!r)return!0;const S=w.filter(E=>k.includes(E.type.name));n.ensureMarks(S)}return!0},as=(e,t)=>{const n=Zl(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Un(e.doc,n.pos)&&e.join(n.pos),!0},ss=(e,t)=>{const n=Zl(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Un(e.doc,i)&&e.join(i),!0},j2=(e,t,n,i={})=>({editor:r,tr:a,state:o,dispatch:l,chain:c,commands:u,can:f})=>{const{extensions:m,splittableMarks:p}=r.extensionManager,h=rt(e,o.schema),g=rt(t,o.schema),{selection:b,storedMarks:x}=o,{$from:v,$to:y}=b,k=v.blockRange(y),w=x||b.$to.parentOffset&&b.$from.marks();if(!k)return!1;const S=Zl(E=>Ou(E.type.name,m))(b);if(k.depth>=1&&S&&k.depth-S.depth<=1){if(S.node.type===h)return u.liftListItem(g);if(Ou(S.node.type.name,m)&&h.validContent(S.node.content)&&l)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>as(a,h)).command(()=>ss(a,h)).run()}return!n||!w||!l?c().command(()=>f().wrapInList(h,i)?!0:u.clearNodes()).wrapInList(h,i).command(()=>as(a,h)).command(()=>ss(a,h)).run():c().command(()=>{const E=f().wrapInList(h,i),D=w.filter(_=>p.includes(_.type.name));return a.ensureMarks(D),E?!0:u.clearNodes()}).wrapInList(h,i).command(()=>as(a,h)).command(()=>ss(a,h)).run()},$2=(e,t={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,o=qn(e,i.schema);return I2(i,o,t)?r.unsetMark(o,{extendEmptyMarkRange:a}):r.setMark(o,t)},W2=(e,t,n={})=>({state:i,commands:r})=>{const a=rt(e,i.schema),o=rt(t,i.schema),l=Xl(i,a,n);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),l?r.setNode(o,c):r.setNode(a,{...c,...n})},G2=(e,t={})=>({state:n,commands:i})=>{const r=rt(e,n.schema);return Xl(n,r,t)?i.lift(r):i.wrapIn(r,t)},K2=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const o=e.tr,l=a.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(a.text){const c=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,e.schema.text(a.text,c))}else o.delete(a.from,a.to)}return!0}}return!1},X2=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:r}=n;return i||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},J2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=qn(e,i.schema),{$from:u,empty:f,ranges:m}=l;if(!r)return!0;if(f&&o){let{from:p,to:h}=l;const g=(a=u.marks().find(x=>x.type===c))===null||a===void 0?void 0:a.attrs,b=Kl(u,c,g);b&&(p=b.from,h=b.to),n.removeMark(p,h,c)}else m.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},Z2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=Jl(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=rt(e,i.schema)),l==="mark"&&(o=qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;let m,p,h,g;n.selection.empty?i.doc.nodesBetween(u,f,(b,x)=>{a&&a===b.type&&(h=Math.max(x,u),g=Math.min(x+b.nodeSize,f),m=x,p=b)}):i.doc.nodesBetween(u,f,(b,x)=>{x<u&&a&&a===b.type&&(h=Math.max(x,u),g=Math.min(x+b.nodeSize,f),m=x,p=b),x>=u&&x<=f&&(a&&a===b.type&&n.setNodeMarkup(x,void 0,{...b.attrs,...t}),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type){const y=Math.max(x,u),k=Math.min(x+b.nodeSize,f);n.addMark(y,k,o.create({...v.attrs,...t}))}}))}),p&&(m!==void 0&&n.setNodeMarkup(m,void 0,{...p.attrs,...t}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&n.addMark(h,g,o.create({...b.attrs,...t}))}))}),!0):!1},Q2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return gk(r,t)(n,i)},Y2=(e,t={})=>({state:n,dispatch:i})=>{const r=rt(e,n.schema);return vk(r,t)(n,i)};var ew=Object.freeze({__proto__:null,blur:Ik,clearContent:Rk,clearNodes:Lk,command:Bk,createParagraphNear:Pk,cut:Fk,deleteCurrentNode:Vk,deleteNode:Uk,deleteRange:Hk,deleteSelection:qk,enter:jk,exitCode:$k,extendMarkRange:Wk,first:Gk,focus:Jk,forEach:Zk,insertContent:Qk,insertContentAt:t2,joinBackward:r2,joinDown:i2,joinForward:a2,joinItemBackward:o2,joinItemForward:s2,joinTextblockBackward:l2,joinTextblockForward:c2,joinUp:n2,keyboardShortcut:d2,lift:f2,liftEmptyBlock:p2,liftListItem:m2,newlineInCode:h2,resetAttributes:b2,scrollIntoView:g2,selectAll:v2,selectNodeBackward:x2,selectNodeForward:y2,selectParentNode:k2,selectTextblockEnd:w2,selectTextblockStart:_2,setContent:C2,setMark:L2,setMeta:B2,setNode:P2,setNodeSelection:F2,setTextSelection:V2,sinkListItem:U2,splitBlock:H2,splitListItem:q2,toggleList:j2,toggleMark:$2,toggleNode:W2,toggleWrap:G2,undoInputRule:K2,unsetAllMarks:X2,unsetMark:J2,updateAttributes:Z2,wrapIn:Q2,wrapInList:Y2});const tw=je.create({name:"commands",addCommands(){return{...ew}}}),nw=je.create({name:"drop",addProseMirrorPlugins(){return[new dt({key:new at("tiptapDrop"),props:{handleDrop:(e,t,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:i})}}})]}}),iw=je.create({name:"editable",addProseMirrorPlugins(){return[new dt({key:new at("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qp=new at("focusEvents"),rw=je.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new dt({key:qp,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),aw=je.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:f,$anchor:m}=c,{pos:p,parent:h}=m,g=m.parent.isTextblock&&p>0?l.doc.resolve(p-1):m,b=g.parent.type.spec.isolating,x=m.pos-m.parentOffset,v=b&&g.parent.childCount===1?x===m.pos:ge.atStart(u).from===p;return!f||!h.type.isTextblock||h.textContent.length||!v||v&&m.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ja()||Vp()?a:r},addProseMirrorPlugins(){return[new dt({key:new at("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const i=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),r=e.some(b=>b.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:o,to:l}=t.selection,c=ge.atStart(t.doc).from,u=ge.atEnd(t.doc).to;if(a||!(o===c&&l===u)||!Yl(n.doc))return;const p=n.tr,h=Rp({state:n,transaction:p}),{commands:g}=new Ck({editor:this.editor,state:h});if(g.clearNodes(),!!p.steps.length)return p}})]}}),ow=je.create({name:"paste",addProseMirrorPlugins(){return[new dt({key:new at("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),sw=je.create({name:"tabindex",addProseMirrorPlugins(){return[new dt({key:new at("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var lw=Object.freeze({__proto__:null,ClipboardTextSerializer:zk,Commands:tw,Drop:nw,Editable:iw,FocusEvents:rw,Keymap:aw,Paste:ow,Tabindex:sw,focusEventsPluginKey:qp});function cw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i})=>{const r=Qe(e.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=t,o=i[i.length-1],l=i[0];if(o){const c=l.search(/\S/),u=n.from+l.indexOf(o),f=u+o.length;if(Ql(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(b=>b===e.type&&b!==h.mark.type)).filter(h=>h.to>u).length)return null;f<n.to&&a.delete(f,n.to),u>n.from&&a.delete(n.from+c,u);const p=n.from+c+o.length;a.addMark(n.from+c,p,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function uw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i})=>{const r=Qe(e.getAttributes,void 0,i)||{},{tr:a}=t,o=n.from;let l=n.to;const c=e.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let f=o+u;f>l?f=l:l=f+i[1].length;const m=i[0][i[0].length-1];a.insertText(m,o+i[0].length-1),a.replaceWith(f,l,c)}else if(i[0]){const u=e.type.isInline?o:o-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(o),a.mapping.map(l))}a.scrollIntoView()}})}function dw(e){return new Gl({find:e.find,handler:({state:t,range:n,match:i,chain:r})=>{const a=Qe(e.getAttributes,void 0,i)||{},o=t.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),u=c&&Dl(c,e.type,a);if(!u)return null;if(o.wrap(c,u),e.keepMarks&&e.editor){const{selection:m,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,g=p||m.$to.parentOffset&&m.$from.marks();if(g){const b=g.filter(x=>h.includes(x.type.name));o.ensureMarks(b)}}if(e.keepAttributes){const m=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(m,a).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Un(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,f))&&o.join(n.from-1)}})}let Se=class Qs{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(st(this,"addOptions",{name:this.name}))),this.storage=Qe(st(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Qs(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Oo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Qs(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(st(n,"addOptions",{name:n.name})),n.storage=Qe(st(n,"addStorage",{name:n.name,options:n.options})),n}};function jp(e){return new Ok({find:e.find,handler:({state:t,range:n,match:i,pasteEvent:r})=>{const a=Qe(e.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:o}=t,l=i[i.length-1],c=i[0];let u=n.to;if(l){const f=c.search(/\S/),m=n.from+c.indexOf(l),p=m+l.length;if(Ql(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(x=>x===e.type&&x!==g.mark.type)).filter(g=>g.to>m).length)return null;p<n.to&&o.delete(p,n.to),m>n.from&&o.delete(n.from+f,m),u=n.from+f+l.length,o.addMark(n.from+f,u,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}var fw=`<?xml version="1.0" encoding="utf-8"?>
|
|
655
|
+
[1] === incrementDisambig() ===`),this.initGivens)return this.initGivens=!1,!1;var e=!1,t=!0;if(this.modes[this.modeindex]==="disNames"){t=!1,typeof this.givensMax!="number"&&(t=!0);var n=!1;typeof this.namesMax!="number"&&(n=!0),typeof this.givensMax=="number"&&(this.base.givens.length&&this.base.givens[this.gnameset][this.gname]<this.givensMax?this.base.givens[this.gnameset][this.gname]+=1:t=!0),typeof this.namesMax=="number"&&t&&(this.state.opt["disambiguate-add-names"]?(n=!1,this.gname<this.namesMax?(this.base.names[this.gnameset]+=1,this.gname+=1):n=!0):n=!0),typeof this.namesetsMax=="number"&&n&&this.gnameset<this.namesetsMax&&(this.gnameset+=1,this.base.names[this.gnameset]=1,this.gname=0),this.debug&&(this.state.sys.print(" ------------------"),this.state.sys.print(" incremented values"),this.state.sys.print(" ------------------"),this.state.sys.print(" | gnameset: "+this.gnameset),this.state.sys.print(" | gname: "+this.gname),this.state.sys.print(" | names value: "+this.base.names[this.gnameset]),this.base.givens.length?this.state.sys.print(" | givens value: "+this.base.givens[this.gnameset][this.gname]):this.state.sys.print(" | givens value: nil"),this.state.sys.print(" | namesetsMax: "+this.namesetsMax),this.state.sys.print(" | namesMax: "+this.namesMax),this.state.sys.print(" | givensMax: "+this.givensMax)),(typeof this.namesetsMax!="number"||this.namesetsMax===-1||this.gnameset===this.namesetsMax)&&(!this.state.opt["disambiguate-add-names"]||typeof this.namesMax!="number"||this.gname===this.namesMax)&&(typeof this.givensMax!="number"||typeof this.base.givens[this.gnameset]>"u"||typeof this.base.givens[this.gnameset][this.gname]>"u"||this.base.givens[this.gnameset][this.gname]===this.givensMax)&&(e=!0,this.debug&&this.state.sys.print(" MAXED"))}else this.modes[this.modeindex]==="disExtraText"&&(this.base.disambiguate+=1,this.betterbase.disambiguate+=1);return e};d.Disambiguation.prototype.initVars=function(e){var a,o,t,n,i;if(this.debug&&this.state.sys.print("[B] === initVars() ==="),this.lists=[],this.base=!1,this.betterbase=!1,this.akey=e,this.maxNamesByItemId={},n=[],t=this.ambigcites[e],!t||!t.length)return!1;var r=this.state.refetchItem(""+t[0]);if(this.getCiteData(r),this.base=d.getAmbigConfig.call(this.state),t&&t.length>1){n.push([this.maxNamesByItemId[r.id],r]);for(var a=1,o=t.length;a<o;a+=1)r=this.state.refetchItem(""+t[a]),this.getCiteData(r,this.base),n.push([this.maxNamesByItemId[r.id],r]);n.sort(function(l,c){return l[0]>c[0]?1:l[0]<c[0]?-1:l[1].id>c[1].id?1:l[1].id<c[1].id?-1:0}),i=[];for(var a=0,o=n.length;a<o;a+=1)i.push(n[a][1]);this.lists.push([this.base,i]),this.Item=this.lists[0][1][0]}else this.Item=this.state.refetchItem(""+t[0]);this.modeindex=0;var a,o;return this.state.citation.opt["disambiguate-add-names"],this.namesMax=this.maxNamesByItemId[this.Item.id][0],this.padBase(this.base),this.padBase(this.betterbase),this.base.year_suffix=!1,this.base.disambiguate=!1,this.betterbase.year_suffix=!1,this.betterbase.disambiguate=!1,this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.state.opt["disambiguate-add-givenname"]&&(this.givensMax=2),!0};d.Disambiguation.prototype.padBase=function(e){for(var t=0,n=e.names.length;t<n;t+=1){e.givens[t]||(e.givens[t]=[]);for(var i=0,r=e.names[t];i<r;i+=1)e.givens[t][i]||(e.givens[t][i]=0)}};d.Disambiguation.prototype.configModes=function(){var e,t;this.modes=[],e=this.state.opt["disambiguate-add-givenname"],t=this.state.citation.opt["givenname-disambiguation-rule"],(this.state.opt["disambiguate-add-names"]||e&&t==="by-cite")&&this.modes.push("disNames"),this.state.opt.development_extensions.prioritize_disambiguate_condition?(this.state.opt.has_disambiguate&&this.modes.push("disExtraText"),this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears")):(this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears"),this.state.opt.has_disambiguate&&this.modes.push("disExtraText"))};d.Disambiguation.prototype.getCiteData=function(e,t){if(!this.maxNamesByItemId[e.id]){d.getAmbiguousCite.call(this.state,e,t),t=d.getAmbigConfig.call(this.state),this.maxNamesByItemId[e.id]=d.getMaxVals.call(this.state),this.state.registry.registry[e.id].disambig.givens=this.state.tmp.disambig_settings.givens.slice();for(var n=0,i=this.state.registry.registry[e.id].disambig.givens.length;n<i;n+=1)this.state.registry.registry[e.id].disambig.givens[n]=this.state.tmp.disambig_settings.givens[n].slice();this.namesetsMax=this.state.registry.registry[e.id].disambig.names.length-1,this.base||(this.base=t,this.betterbase=d.cloneAmbigConfig(t)),t.names.length<this.base.names.length&&(this.base=t);for(var n=0,i=t.names.length;n<i;n+=1)t.names[n]>this.base.names[n]&&(this.base.givens[n]=t.givens[n].slice(),this.base.names[n]=t.names[n],this.betterbase.names=this.base.names.slice(),this.betterbase.givens=this.base.givens.slice(),this.padBase(this.base),this.padBase(this.betterbase));this.betterbase.givens=this.base.givens.slice();for(var r=0,a=this.base.givens.length;r<a;r+=1)this.betterbase.givens[r]=this.base.givens[r].slice()}};d.Disambiguation.prototype.captureStepToBase=function(){this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.base.givens&&this.base.givens.length&&typeof this.base.givens[this.gnameset][this.gname]<"u"&&(this.betterbase.givens.length<this.base.givens.length&&(this.betterbase.givens=JSON.parse(JSON.stringify(this.base.givens))),this.betterbase.givens[this.gnameset][this.gname]=this.base.givens[this.gnameset][this.gname]),this.betterbase.names[this.gnameset]=this.base.names[this.gnameset]};d.Engine.prototype.getJurisdictionList=function(e){for(var t=[],n=e.split(":"),i=n.length;i>0;i--){var r=n.slice(0,i).join(":");if(t.push(r),this.opt.jurisdiction_fallbacks[r]){var a=this.opt.jurisdiction_fallbacks[r];t.push(a)}}return t.indexOf("us")===-1&&t.push("us"),t};d.Engine.prototype.loadStyleModule=function(e,t,n){var i=null;this.juris[e]={};var r=d.setupXml(t);r.addMissingNameNodes(r.dataObj),r.addInstitutionNodes(r.dataObj),r.insertPublisherAndPlace(r.dataObj),r.flagDateMacros(r.dataObj);for(var m=r.getNodesByName(r.dataObj,"law-module"),a=0,o=m.length;a<o;a++){var l=r.getAttributeValue(m[a],"types");if(l){this.juris[e].types={},l=l.split(/\s+/);for(var c=0,u=l.length;c<u;c++)this.juris[e].types[l[c]]=!0}n||(i=r.getAttributeValue(m[a],"fallback"),i&&e!=="us"&&(this.opt.jurisdiction_fallbacks[e]=i))}var f=this.opt.lang?this.opt.lang:this.opt["default-locale"][0];d.SET_COURT_CLASSES(this,f,r,r.dataObj),this.juris[e].types||(this.juris[e].types=d.MODULE_TYPES);for(var m=r.getNodesByName(r.dataObj,"macro"),a=0,o=m.length;a<o;a++){var p=r.getAttributeValue(m[a],"name");if(!d.MODULE_MACROS[p]){d.debug('CSL: skipping non-modular macro name "'+p+'" in module context');continue}this.juris[e][p]=[],this.buildTokenLists(m[a],this.juris[e][p]),this.configureTokenList(this.juris[e][p])}return i};d.Engine.prototype.retrieveAllStyleModules=function(e){var t={},n=this.locale[this.opt.lang].opts["jurisdiction-preference"];n=n||[],n=[""].concat(n);for(var i=n.length-1;i>-1;i--)for(var r=n[i],a=0,o=e.length;a<o;a++){var l=e[a];if(!this.opt.jurisdictions_seen[l]){var c=this.sys.retrieveStyleModule(l,r);(!c&&!r||c)&&(this.opt.jurisdictions_seen[l]=!0),c&&(t[l]=c)}}return t};d.ParticleList=function(){var e=[[[0,1],null]],t=[[[0,3],null]],n=[[null,[0,1]]],i=[[null,[0,2]]],r=[[null,[0,3]]],a=[[null,[0,1]],[[0,1],null]],o=[[null,[0,2]],[[0,2],null]],l=[[[0,1],null],[null,[0,1]]],c=[[[0,2],null],[null,[0,2]]],u=[[[0,3],null],[null,[0,3]]],f=[[null,[0,2]],[[0,1],[1,2]]],m=[["'s",n],["'s-",n],["'t",n],["a",n],["aan 't",i],["aan de",i],["aan den",i],["aan der",i],["aan het",i],["aan t",i],["aan",n],["ad-",a],["adh-",a],["af",a],["al",a],["al-",a],["am de",i],["am",n],["an-",a],["ar-",a],["as-",a],["ash-",a],["at-",a],["ath-",a],["auf dem",c],["auf den",c],["auf der",c],["auf ter",i],["auf",l],["aus 'm",c],["aus dem",c],["aus den",c],["aus der",c],["aus m",c],["aus",l],["aus'm",c],["az-",a],["aš-",a],["aḍ-",a],["aḏ-",a],["aṣ-",a],["aṭ-",a],["aṯ-",a],["aẓ-",a],["ben",n],["bij 't",i],["bij de",i],["bij den",i],["bij het",i],["bij t",i],["bij",n],["bin",n],["boven d",i],["boven d'",i],["d",n],["d'",a],["da",a],["dal",n],["dal'",n],["dall'",n],["dalla",n],["das",a],["de die le",r],["de die",i],["de l",i],["de l'",i],["de la",f],["de las",f],["de le",i],["de li",o],["de van der",r],["de",a],["de'",a],["deca",n],["degli",a],["dei",a],["del",a],["dela",e],["dell'",a],["della",a],["delle",a],["dello",a],["den",a],["der",a],["des",a],["di",a],["die le",i],["do",n],["don",n],["dos",a],["du",a],["ed-",a],["edh-",a],["el",a],["el-",a],["en-",a],["er-",a],["es-",a],["esh-",a],["et-",a],["eth-",a],["ez-",a],["eš-",a],["eḍ-",a],["eḏ-",a],["eṣ-",a],["eṭ-",a],["eṯ-",a],["eẓ-",a],["het",n],["i",n],["il",e],["im",n],["in 't",i],["in de",i],["in den",i],["in der",o],["in het",i],["in t",i],["in",n],["l",n],["l'",n],["la",n],["las",n],["le",n],["les",a],["lo",a],["los",n],["lou",n],["of",n],["onder 't",i],["onder de",i],["onder den",i],["onder het",i],["onder t",i],["onder",n],["op 't",i],["op de",o],["op den",i],["op der",i],["op gen",i],["op het",i],["op t",i],["op ten",i],["op",n],["over 't",i],["over de",i],["over den",i],["over het",i],["over t",i],["over",n],["s",n],["s'",n],["sen",e],["t",n],["te",n],["ten",n],["ter",n],["tho",n],["thoe",n],["thor",n],["to",n],["toe",n],["tot",n],["uijt 't",i],["uijt de",i],["uijt den",i],["uijt te de",r],["uijt ten",i],["uijt",n],["uit 't",i],["uit de",i],["uit den",i],["uit het",i],["uit t",i],["uit te de",r],["uit ten",i],["uit",n],["unter",n],["v",n],["v.",n],["v.d.",n],["van 't",i],["van de l",r],["van de l'",r],["van de",i],["van de",i],["van den",i],["van der",i],["van gen",i],["van het",i],["van la",i],["van t",i],["van ter",i],["van van de",r],["van",a],["vander",n],["vd",n],["ver",n],["vom und zum",t],["vom",a],["von 't",i],["von dem",c],["von den",c],["von der",c],["von t",i],["von und zu",u],["von zu",c],["von",l],["voor 't",i],["voor de",i],["voor den",i],["voor in 't",r],["voor in t",r],["voor",n],["vor der",c],["vor",l],["z",e],["ze",e],["zu",l],["zum",a],["zur",a]];return m}();d.parseParticles=function(){function e(i,r,a){var o=i;i=i;var l=[],c,u;r?(i=i.split("").reverse().join(""),c=d.PARTICLE_GIVEN_REGEXP):c=d.PARTICLE_FAMILY_REGEXP;for(var f=i.match(c);f;){var m=r?f[1].split("").reverse().join(""):f[1],p=f?m:!1,p=p?m.replace(/^[-\'\u02bb\u2019\s]*(.).*$/,"$1"):!1;if(u=p?p.toUpperCase()!==p:!1,!u)break;r?(l.push(o.slice(m.length*-1)),o=o.slice(0,m.length*-1)):(l.push(o.slice(0,m.length)),o=o.slice(m.length)),i=f[2],f=i.match(c)}if(r){i=i.split("").reverse().join(""),l.reverse();for(var h=1,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h-1]+=" ");for(var h=0,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h]=l[h].slice(1));i=o.slice(0,i.length)}else i=o.slice(i.length*-1);return[u,i,l]}function t(i){var r=i.slice(-1);return i=i.trim(),r===" "&&["'","’"].indexOf(i.slice(-1))>-1&&(i+=" "),i}function n(i){if(!i.suffix&&i.given){var r=i.given.match(/(\s*,!*\s*)/);if(r){var a=i.given.indexOf(r[1]),o=i.given.slice(a+r[1].length),l=i.given.slice(a,a+r[1].length).replace(/\s*/g,"");o.replace(/\./g,"")==="et al"&&!i["dropping-particle"]?(i["dropping-particle"]=o,i["comma-dropping-particle"]=","):(l.length===2&&(i["comma-suffix"]=!0),i.suffix=o),i.given=i.given.slice(0,a)}}}return function(i){var l=e(i.family),r=l[1],a=l[2];i.family=r;var o=t(a.join(""));o&&(i["non-dropping-particle"]=o),n(i);var l=e(i.given,!0),c=l[1],u=l[2];i.given=c;var f=u.join("").trim();f&&(i["dropping-particle"]=f)}}();var t3=d;const n3=lm(t3),Qu={};function i3(e){let t=Qu[e];if(t)return t;t=Qu[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t[i]="%"+("0"+i.toString(16).toUpperCase()).slice(-2)}return t}function Di(e,t){typeof t!="string"&&(t=Di.defaultChars);const n=i3(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(i){let r="";for(let a=0,o=i.length;a<o;a+=3){const l=parseInt(i.slice(a+1,a+3),16);if(l<128){r+=n[l];continue}if((l&224)===192&&a+3<o){const c=parseInt(i.slice(a+4,a+6),16);if((c&192)===128){const u=l<<6&1984|c&63;u<128?r+="��":r+=String.fromCharCode(u),a+=3;continue}}if((l&240)===224&&a+6<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16);if((c&192)===128&&(u&192)===128){const f=l<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?r+="���":r+=String.fromCharCode(f),a+=6;continue}}if((l&248)===240&&a+9<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16),f=parseInt(i.slice(a+10,a+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let m=l<<18&1835008|c<<12&258048|u<<6&4032|f&63;m<65536||m>1114111?r+="����":(m-=65536,r+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),a+=9;continue}}r+="�"}return r})}Di.defaultChars=";/?:@&=+$,#";Di.componentChars="";const Yu={};function r3(e){let t=Yu[e];if(t)return t;t=Yu[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function zr(e,t,n){typeof t!="string"&&(n=t,t=zr.defaultChars),typeof n>"u"&&(n=!0);const i=r3(t);let r="";for(let a=0,o=e.length;a<o;a++){const l=e.charCodeAt(a);if(n&&l===37&&a+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){r+=e.slice(a,a+3),a+=2;continue}if(l<128){r+=i[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<o){const c=e.charCodeAt(a+1);if(c>=56320&&c<=57343){r+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[a])}return r}zr.defaultChars=";/?:@&=+$,-_.!~*'()#";zr.componentChars="-_.!~*'()";function uc(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function xo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const a3=/^([a-z0-9.+-]+:)/i,o3=/:[0-9]*$/,s3=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l3=["<",">",'"',"`"," ","\r",`
|
|
656
|
+
`," "],c3=["{","}","|","\\","^","`"].concat(l3),u3=["'"].concat(c3),ed=["%","/","?",";","#"].concat(u3),td=["/","?","#"],d3=255,nd=/^[+a-z0-9A-Z_-]{0,63}$/,f3=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,id={javascript:!0,"javascript:":!0},rd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dc(e,t){if(e&&e instanceof xo)return e;const n=new xo;return n.parse(e,t),n}xo.prototype.parse=function(e,t){let n,i,r,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const u=s3.exec(a);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=a3.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=a.substr(0,2)==="//",r&&!(o&&id[o])&&(a=a.substr(2),this.slashes=!0)),!id[o]&&(r||o&&!rd[o])){let u=-1;for(let g=0;g<td.length;g++)i=a.indexOf(td[g]),i!==-1&&(u===-1||i<u)&&(u=i);let f,m;u===-1?m=a.lastIndexOf("@"):m=a.lastIndexOf("@",u),m!==-1&&(f=a.slice(0,m),a=a.slice(m+1),this.auth=f),u=-1;for(let g=0;g<ed.length;g++)i=a.indexOf(ed[g]),i!==-1&&(u===-1||i<u)&&(u=i);u===-1&&(u=a.length),a[u-1]===":"&&u--;const p=a.slice(0,u);a=a.slice(u),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const g=this.hostname.split(/\./);for(let b=0,x=g.length;b<x;b++){const v=g[b];if(v&&!v.match(nd)){let y="";for(let k=0,w=v.length;k<w;k++)v.charCodeAt(k)>127?y+="x":y+=v[k];if(!y.match(nd)){const k=g.slice(0,b),w=g.slice(b+1),S=v.match(f3);S&&(k.push(S[1]),w.unshift(S[2])),w.length&&(a=w.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>d3&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));const c=a.indexOf("?");return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),rd[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xo.prototype.parseHost=function(e){let t=o3.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const p3=Object.freeze(Object.defineProperty({__proto__:null,decode:Di,encode:zr,format:uc,parse:dc},Symbol.toStringTag,{value:"Module"})),cm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,um=/[\0-\x1F\x7F-\x9F]/,m3=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,fc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,dm=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,fm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,h3=Object.freeze(Object.defineProperty({__proto__:null,Any:cm,Cc:um,Cf:m3,P:fc,S:dm,Z:fm},Symbol.toStringTag,{value:"Module"})),b3=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),g3=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var hs;const v3=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),x3=(hs=String.fromCodePoint)!==null&&hs!==void 0?hs:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function y3(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=v3.get(e))!==null&&t!==void 0?t:e}var Ze;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ze||(Ze={}));const k3=32;var Ln;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ln||(Ln={}));function pl(e){return e>=Ze.ZERO&&e<=Ze.NINE}function w3(e){return e>=Ze.UPPER_A&&e<=Ze.UPPER_F||e>=Ze.LOWER_A&&e<=Ze.LOWER_F}function _3(e){return e>=Ze.UPPER_A&&e<=Ze.UPPER_Z||e>=Ze.LOWER_A&&e<=Ze.LOWER_Z||pl(e)}function S3(e){return e===Ze.EQUALS||_3(e)}var Je;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Je||(Je={}));var bn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(bn||(bn={}));class C3{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Je.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bn.Strict}startEntity(t){this.decodeMode=t,this.state=Je.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Je.EntityStart:return t.charCodeAt(n)===Ze.NUM?(this.state=Je.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Je.NamedEntity,this.stateNamedEntity(t,n));case Je.NumericStart:return this.stateNumericStart(t,n);case Je.NumericDecimal:return this.stateNumericDecimal(t,n);case Je.NumericHex:return this.stateNumericHex(t,n);case Je.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|k3)===Ze.LOWER_X?(this.state=Je.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Je.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const a=i-n;this.result=this.result*Math.pow(r,a)+parseInt(t.substr(n,a),r),this.consumed+=a}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(pl(r)||w3(r))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(pl(r))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ze.SEMI)this.consumed+=1;else if(this.decodeMode===bn.Strict)return 0;return this.emitCodePoint(y3(this.result),this.consumed),this.errors&&(t!==Ze.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let r=i[this.treeIndex],a=(r&Ln.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=E3(i,r,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===bn.Attribute&&(a===0||S3(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],a=(r&Ln.VALUE_LENGTH)>>14,a!==0){if(o===Ze.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Ln.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Ln.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Je.NamedEntity:return this.result!==0&&(this.decodeMode!==bn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Je.NumericDecimal:return this.emitNumericEntity(0,2);case Je.NumericHex:return this.emitNumericEntity(0,3);case Je.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Je.EntityStart:return 0}}}function pm(e){let t="";const n=new C3(e,i=>t+=x3(i));return function(r,a){let o=0,l=0;for(;(l=r.indexOf("&",l))>=0;){t+=r.slice(o,l),n.startEntity(a);const u=n.write(r,l+1);if(u<0){o=l+n.end();break}o=l+u,l=u===0?o+1:o}const c=t+r.slice(o);return t="",c}}function E3(e,t,n,i){const r=(t&Ln.BRANCH_LENGTH)>>7,a=t&Ln.JUMP_TABLE;if(r===0)return a!==0&&i===a?n:-1;if(a){const c=i-a;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(u<i)o=c+1;else if(u>i)l=c-1;else return e[c+r]}return-1}const mm=pm(b3);pm(g3);function A3(e,t=bn.Legacy){return mm(e,t)}function T3(e){return mm(e,bn.Strict)}function N3(e){return Object.prototype.toString.call(e)}function pc(e){return N3(e)==="[object String]"}const O3=Object.prototype.hasOwnProperty;function M3(e,t){return O3.call(e,t)}function zo(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(i){e[i]=n[i]})}}),e}function hm(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function mc(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Sr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const bm=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,D3=/&([a-z#][a-z0-9]{1,31});/gi,z3=new RegExp(bm.source+"|"+D3.source,"gi"),I3=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function R3(e,t){if(t.charCodeAt(0)===35&&I3.test(t)){const i=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return mc(i)?Sr(i):e}const n=A3(e);return n!==e?n:e}function L3(e){return e.indexOf("\\")<0?e:e.replace(bm,"$1")}function zi(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(z3,function(t,n,i){return n||R3(t,i)})}const B3=/[&<>"]/,P3=/[&<>"]/g,F3={"&":"&","<":"<",">":">",'"':"""};function V3(e){return F3[e]}function Vn(e){return B3.test(e)?e.replace(P3,V3):e}const U3=/[.?*+^$[\]\\(){}|-]/g;function H3(e){return e.replace(U3,"\\$&")}function Re(e){switch(e){case 9:case 32:return!0}return!1}function Cr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function gm(e){return fc.test(e)||dm.test(e)}function Er(e){return gm(Sr(e))}function Ar(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Io(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function ad(e){return e===32||e===9||e===10||e===13}function Ro(e){let t=0;for(;t<e.length&&ad(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&ad(e.charCodeAt(n));n--);return e.slice(t,n+1)}const q3={mdurl:p3,ucmicro:h3},j3=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:hm,asciiTrim:Ro,assign:zo,escapeHtml:Vn,escapeRE:H3,fromCodePoint:Sr,has:M3,isMdAsciiPunct:Ar,isPunctChar:gm,isPunctCharCode:Er,isSpace:Re,isString:pc,isValidEntityCode:mc,isWhiteSpace:Cr,lib:q3,normalizeReference:Io,unescapeAll:zi,unescapeMd:L3},Symbol.toStringTag,{value:"Module"}));function $3(e,t,n){let i,r,a,o;const l=e.posMax,c=e.pos;for(e.pos=t+1,i=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(i--,i===0)){r=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)i++;else if(n)return e.pos=c,-1}}let u=-1;return r&&(u=e.pos),e.pos=c,u}function W3(e,t,n){let i,r=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(i=e.charCodeAt(r),i===10||i===60)return a;if(i===62)return a.pos=r+1,a.str=zi(e.slice(t+1,r)),a.ok=!0,a;if(i===92&&r+1<n){r+=2;continue}r++}return a}let o=0;for(;r<n&&(i=e.charCodeAt(r),!(i===32||i<32||i===127));){if(i===92&&r+1<n){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(i===40&&(o++,o>32))return a;if(i===41){if(o===0)break;o--}r++}return t===r||o!==0||(a.str=zi(e.slice(t,r)),a.pos=r,a.ok=!0),a}function G3(e,t,n,i){let r,a=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)o.str=i.str,o.marker=i.marker;else{if(a>=n)return o;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return o;t++,a++,l===40&&(l=41),o.marker=l}for(;a<n;){if(r=e.charCodeAt(a),r===o.marker)return o.pos=a+1,o.str+=zi(e.slice(t,a)),o.ok=!0,o;if(r===40&&o.marker===41)return o;r===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=zi(e.slice(t,a)),o}const K3=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:W3,parseLinkLabel:$3,parseLinkTitle:G3},Symbol.toStringTag,{value:"Module"})),tn={};tn.code_inline=function(e,t,n,i,r){const a=e[t];return"<code"+r.renderAttrs(a)+">"+Vn(a.content)+"</code>"};tn.code_block=function(e,t,n,i,r){const a=e[t];return"<pre"+r.renderAttrs(a)+"><code>"+Vn(e[t].content)+`</code></pre>
|
|
657
|
+
`};tn.fence=function(e,t,n,i,r){const a=e[t],o=a.info?zi(a.info).trim():"";let l="",c="";if(o){const f=o.split(/(\s+)/g);l=f[0],c=f.slice(2).join("")}let u;if(n.highlight?u=n.highlight(a.content,l,c)||Vn(a.content):u=Vn(a.content),u.indexOf("<pre")===0)return u+`
|
|
658
|
+
`;if(o){const f=a.attrIndex("class"),m=a.attrs?a.attrs.slice():[];f<0?m.push(["class",n.langPrefix+l]):(m[f]=m[f].slice(),m[f][1]+=" "+n.langPrefix+l);const p={attrs:m};return`<pre><code${r.renderAttrs(p)}>${u}</code></pre>
|
|
659
|
+
`}return`<pre><code${r.renderAttrs(a)}>${u}</code></pre>
|
|
660
|
+
`};tn.image=function(e,t,n,i,r){const a=e[t];return a.attrs[a.attrIndex("alt")][1]=r.renderInlineAsText(a.children,n,i),r.renderToken(e,t,n)};tn.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
661
|
+
`:`<br>
|
|
662
|
+
`};tn.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
663
|
+
`:`<br>
|
|
664
|
+
`:`
|
|
665
|
+
`};tn.text=function(e,t){return Vn(e[t].content)};tn.html_block=function(e,t){return e[t].content};tn.html_inline=function(e,t){return e[t].content};function Bi(){this.rules=zo({},tn)}Bi.prototype.renderAttrs=function(t){let n,i,r;if(!t.attrs)return"";for(r="",n=0,i=t.attrs.length;n<i;n++)r+=" "+Vn(t.attrs[n][0])+'="'+Vn(t.attrs[n][1])+'"';return r};Bi.prototype.renderToken=function(t,n,i){const r=t[n];let a="";if(r.hidden)return"";r.block&&r.nesting!==-1&&n&&t[n-1].hidden&&(a+=`
|
|
666
|
+
`),a+=(r.nesting===-1?"</":"<")+r.tag,a+=this.renderAttrs(r),r.nesting===0&&i.xhtmlOut&&(a+=" /");let o=!1;if(r.block&&(o=!0,r.nesting===1&&n+1<t.length)){const l=t[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===r.tag)&&(o=!1)}return a+=o?`>
|
|
667
|
+
`:">",a};Bi.prototype.renderInline=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t)}return i};Bi.prototype.renderInlineAsText=function(e,t,n){let i="";for(let r=0,a=e.length;r<a;r++)switch(e[r].type){case"text":i+=e[r].content;break;case"image":i+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":i+=e[r].content;break;case"softbreak":case"hardbreak":i+=`
|
|
668
|
+
`;break}return i};Bi.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;l==="inline"?i+=this.renderInline(e[a].children,t,n):typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t,n)}return i};function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Ct.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})};Ct.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null};Ct.prototype.before=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};Ct.prototype.after=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};Ct.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null};Ct.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n};Ct.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Ct.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n};Ct.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Wt(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Wt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1};Wt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Wt.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r};Wt.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i};Wt.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function vm(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}vm.prototype.Token=Wt;const X3=/\r\n?|\n/g,J3=/\0/g;function Z3(e){let t;t=e.src.replace(X3,`
|
|
669
|
+
`),t=t.replace(J3,"�"),e.src=t}function Q3(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Y3(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function e4(e){return/^<a[>\s]/i.test(e)}function t4(e){return/^<\/a\s*>/i.test(e)}function n4(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,a=0;for(let o=r.length-1;o>=0;o--){const l=r[o];if(l.type==="link_close"){for(o--;r[o].level!==l.level&&r[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(e4(l.content)&&a>0&&a--,t4(l.content)&&a++),!(a>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let u=e.md.linkify.match(c);const f=[];let m=l.level,p=0;u.length>0&&u[0].index===0&&o>0&&r[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;h<u.length;h++){const g=u[h].url,b=e.md.normalizeLink(g);if(!e.md.validateLink(b))continue;let x=u[h].text;u[h].schema?u[h].schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText("mailto:"+x).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText("http://"+x).replace(/^http:\/\//,"");const v=u[h].index;if(v>p){const S=new e.Token("text","",0);S.content=c.slice(p,v),S.level=m,f.push(S)}const y=new e.Token("link_open","a",1);y.attrs=[["href",b]],y.level=m++,y.markup="linkify",y.info="auto",f.push(y);const k=new e.Token("text","",0);k.content=x,k.level=m,f.push(k);const w=new e.Token("link_close","a",-1);w.level=--m,w.markup="linkify",w.info="auto",f.push(w),p=u[h].lastIndex}if(p<c.length){const h=new e.Token("text","",0);h.content=c.slice(p),h.level=m,f.push(h)}t[n].children=r=hm(r,o,f)}}}}const xm=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,i4=/\((c|tm|r)\)/i,r4=/\((c|tm|r)\)/ig,a4={c:"©",r:"®",tm:"™"};function o4(e,t){return a4[t.toLowerCase()]}function s4(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(r4,o4)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function l4(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&xm.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function c4(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(i4.test(e.tokens[t].content)&&s4(e.tokens[t].children),xm.test(e.tokens[t].content)&&l4(e.tokens[t].children))}const u4=/['"]/,od=/['"]/g,sd="’";function ba(e,t,n,i){e[t]||(e[t]=[]),e[t].push({pos:n,ch:i})}function d4(e,t){let n="",i=0;t.sort((r,a)=>r.pos-a.pos);for(let r=0;r<t.length;r++){const a=t[r];n+=e.slice(i,a.pos)+a.ch,i=a.pos+1}return n+e.slice(i)}function f4(e,t){let n;const i=[],r={};for(let a=0;a<e.length;a++){const o=e[a],l=e[a].level;for(n=i.length-1;n>=0&&!(i[n].level<=l);n--);if(i.length=n+1,o.type!=="text")continue;const c=o.content;let u=0;const f=c.length;e:for(;u<f;){od.lastIndex=u;const m=od.exec(c);if(!m)break;let p=!0,h=!0;u=m.index+1;const g=m[0]==="'";let b=32;if(m.index-1>=0)b=c.charCodeAt(m.index-1);else for(n=a-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){b=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(u<f)x=c.charCodeAt(u);else for(n=a+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const v=Ar(b)||Er(b),y=Ar(x)||Er(x),k=Cr(b),w=Cr(x);if(w?p=!1:y&&(k||v||(p=!1)),k?h=!1:v&&(w||y||(h=!1)),x===34&&m[0]==='"'&&b>=48&&b<=57&&(h=p=!1),p&&h&&(p=v,h=y),!p&&!h){g&&ba(r,a,m.index,sd);continue}if(h)for(n=i.length-1;n>=0;n--){let S=i[n];if(i[n].level<l)break;if(S.single===g&&i[n].level===l){S=i[n];let E,D;g?(E=t.md.options.quotes[2],D=t.md.options.quotes[3]):(E=t.md.options.quotes[0],D=t.md.options.quotes[1]),ba(r,a,m.index,D),ba(r,S.token,S.pos,E),i.length=n;continue e}}p?i.push({token:a,pos:m.index,single:g,level:l}):h&&g&&ba(r,a,m.index,sd)}}Object.keys(r).forEach(function(a){e[a].content=d4(e[a].content,r[a])})}function p4(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!u4.test(e.tokens[t].content)||f4(e.tokens[t].children,e)}function m4(e){let t,n;const i=e.tokens,r=i.length;for(let a=0;a<r;a++){if(i[a].type!=="inline")continue;const o=i[a].children,l=o.length;for(t=0;t<l;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<l;t++)o[t].type==="text"&&t+1<l&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const bs=[["normalize",Z3],["block",Q3],["inline",Y3],["linkify",n4],["replacements",c4],["smartquotes",p4],["text_join",m4]];function hc(){this.ruler=new Ct;for(let e=0;e<bs.length;e++)this.ruler.push(bs[e][0],bs[e][1])}hc.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)};hc.prototype.State=vm;function nn(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let a=0,o=0,l=0,c=0,u=r.length,f=!1;o<u;o++){const m=r.charCodeAt(o);if(!f)if(Re(m)){l++,m===9?c+=4-c%4:c++;continue}else f=!0;(m===10||o===u-1)&&(m!==10&&o++,this.bMarks.push(a),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),f=!1,l=0,c=0,a=o+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}nn.prototype.push=function(e,t,n){const i=new Wt(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i};nn.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};nn.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};nn.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Re(i))break}return t};nn.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Re(this.src.charCodeAt(--t)))return t+1;return t};nn.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t};nn.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t};nn.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const a=new Array(n-t);for(let o=0,l=t;l<n;l++,o++){let c=0;const u=this.bMarks[l];let f=u,m;for(l+1<n||r?m=this.eMarks[l]+1:m=this.eMarks[l];f<m&&c<i;){const p=this.src.charCodeAt(f);if(Re(p))p===9?c+=4-(c+this.bsCount[l])%4:c++;else if(f-u<this.tShift[l])c++;else break;f++}c>i?a[o]=new Array(c-i+1).join(" ")+this.src.slice(f,m):a[o]=this.src.slice(f,m)}return a.join("")};nn.prototype.Token=Wt;const h4=65536;function gs(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function ld(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),a=!1,o=0,l="";for(;i<n;)r===124&&(a?(l+=e.substring(o,i-1),o=i):(t.push(l+e.substring(o,i)),l="",o=i+1)),a=r===92,i++,r=e.charCodeAt(i);return t.push(l+e.substring(o)),t}function b4(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let a=e.bMarks[r]+e.tShift[r];if(a>=e.eMarks[r])return!1;const o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[r])return!1;const l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Re(l)||o===45&&Re(l))return!1;for(;a<e.eMarks[r];){const w=e.src.charCodeAt(a);if(w!==124&&w!==45&&w!==58&&!Re(w))return!1;a++}let c=gs(e,t+1),u=c.split("|");const f=[];for(let w=0;w<u.length;w++){const S=u[w].trim();if(!S){if(w===0||w===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?f.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=gs(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=ld(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const m=u.length;if(m===0||m!==f.length)return!1;if(i)return!0;const p=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),b=[t,0];g.map=b;const x=e.push("thead_open","thead",1);x.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let w=0;w<u.length;w++){const S=e.push("th_open","th",1);f[w]&&(S.attrs=[["style","text-align:"+f[w]]]);const E=e.push("inline","",0);E.content=u[w].trim(),E.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,k=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let w=!1;for(let E=0,D=h.length;E<D;E++)if(h[E](e,r,n,!0)){w=!0;break}if(w||(c=gs(e,r).trim(),!c)||e.sCount[r]-e.blkIndent>=4||(u=ld(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=m-u.length,k>h4))break;if(r===t+2){const E=e.push("tbody_open","tbody",1);E.map=y=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[r,r+1];for(let E=0;E<m;E++){const D=e.push("td_open","td",1);f[E]&&(D.attrs=[["style","text-align:"+f[E]]]);const _=e.push("inline","",0);_.content=u[E]?u[E].trim():"",_.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=r),e.push("table_close","table",-1),b[1]=r,e.parentType=p,e.line=r,!0}function g4(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const a=e.push("code_block","code",0);return a.content=e.getLines(t,r,4+e.blkIndent,!1)+`
|
|
670
|
+
`,a.map=[t,e.line],!0}function v4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>a)return!1;const o=e.src.charCodeAt(r);if(o!==126&&o!==96)return!1;let l=r;r=e.skipChars(r,o);let c=r-l;if(c<3)return!1;const u=e.src.slice(l,r),f=e.src.slice(r,a);if(o===96&&f.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let m=t,p=!1;for(;m++,!(m>=n||(r=l=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],r<a&&e.sCount[m]<e.blkIndent));)if(e.src.charCodeAt(r)===o&&!(e.sCount[m]-e.blkIndent>=4)&&(r=e.skipChars(r,o),!(r-l<c)&&(r=e.skipSpaces(r),!(r<a)))){p=!0;break}c=e.sCount[t],e.line=m+(p?1:0);const h=e.push("fence","code",0);return h.info=f,h.content=e.getLines(t+1,m,c,!0),h.markup=u,h.map=[t,e.line],!0}function x4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const l=[],c=[],u=[],f=[],m=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let h=!1,g;for(g=t;g<n;g++){const k=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],a=e.eMarks[g],r>=a)break;if(e.src.charCodeAt(r++)===62&&!k){let S=e.sCount[g]+1,E,D;e.src.charCodeAt(r)===32?(r++,S++,D=!1,E=!0):e.src.charCodeAt(r)===9?(E=!0,(e.bsCount[g]+S)%4===3?(r++,S++,D=!1):D=!0):E=!1;let _=S;for(l.push(e.bMarks[g]),e.bMarks[g]=r;r<a;){const C=e.src.charCodeAt(r);if(Re(C))C===9?_+=4-(_+e.bsCount[g]+(D?1:0))%4:_++;else break;r++}h=r>=a,c.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(E?1:0),u.push(e.sCount[g]),e.sCount[g]=_-S,f.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(h)break;let w=!1;for(let S=0,E=m.length;S<E;S++)if(m[S](e,g,n,!0)){w=!0;break}if(w){e.lineMax=g,e.blkIndent!==0&&(l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]=-1}const b=e.blkIndent;e.blkIndent=0;const x=e.push("blockquote_open","blockquote",1);x.markup=">";const v=[t,0];x.map=v,e.md.block.tokenize(e,t,g);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=o,e.parentType=p,v[1]=e.line;for(let k=0;k<f.length;k++)e.bMarks[k+t]=l[k],e.tShift[k+t]=f[k],e.sCount[k+t]=u[k],e.bsCount[k+t]=c[k];return e.blkIndent=b,!0}function y4(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;a<r;){const u=e.src.charCodeAt(a++);if(u!==o&&!Re(u))return!1;u===o&&l++}if(l<3)return!1;if(i)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(l+1).join(String.fromCharCode(o)),!0}function cd(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const a=e.src.charCodeAt(i);if(!Re(a))return-1}return i}function ud(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let a=e.src.charCodeAt(r++);if(a<48||a>57)return-1;for(;;){if(r>=i)return-1;if(a=e.src.charCodeAt(r++),a>=48&&a<=57){if(r-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return r<i&&(a=e.src.charCodeAt(r),!Re(a))?-1:r}function k4(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function w4(e,t,n,i){let r,a,o,l,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;i&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let m,p,h;if((h=ud(e,c))>=0){if(m=!0,o=e.bMarks[c]+e.tShift[c],p=Number(e.src.slice(o,h-1)),f&&p!==1)return!1}else if((h=cd(e,c))>=0)m=!1;else return!1;if(f&&e.skipSpaces(h)>=e.eMarks[c])return!1;if(i)return!0;const g=e.src.charCodeAt(h-1),b=e.tokens.length;m?(l=e.push("ordered_list_open","ol",1),p!==1&&(l.attrs=[["start",p]])):l=e.push("bullet_list_open","ul",1);const x=[c,0];l.map=x,l.markup=String.fromCharCode(g);let v=!1;const y=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";c<n;){a=h,r=e.eMarks[c];const w=e.sCount[c]+h-(e.bMarks[c]+e.tShift[c]);let S=w;for(;a<r;){const j=e.src.charCodeAt(a);if(j===9)S+=4-(S+e.bsCount[c])%4;else if(j===32)S++;else break;a++}const E=a;let D;E>=r?D=1:D=S-w,D>4&&(D=1);const _=w+D;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(g);const C=[c,0];l.map=C,m&&(l.info=e.src.slice(o,h-1));const N=e.tight,I=e.tShift[c],H=e.sCount[c],F=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=_,e.tight=!0,e.tShift[c]=E-e.bMarks[c],e.sCount[c]=S,E>=r&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=F,e.tShift[c]=I,e.sCount[c]=H,e.tight=N,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(g),c=e.line,C[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let M=!1;for(let j=0,P=y.length;j<P;j++)if(y[j](e,c,n,!0)){M=!0;break}if(M)break;if(m){if(h=ud(e,c),h<0)break;o=e.bMarks[c]+e.tShift[c]}else if(h=cd(e,c),h<0)break;if(g!==e.src.charCodeAt(h-1))break}return m?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(g),x[1]=c,e.line=c,e.parentType=k,u&&k4(e,b),!0}function _4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function l(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let w=!1;if(e.sCount[y]-e.blkIndent>3&&(w=!0),e.sCount[y]<0&&(w=!0),!w){const D=e.md.block.ruler.getRules("reference"),_=e.parentType;e.parentType="reference";let C=!1;for(let N=0,I=D.length;N<I;N++)if(D[N](e,y,k,!0)){C=!0;break}if(e.parentType=_,C)return null}const S=e.bMarks[y]+e.tShift[y],E=e.eMarks[y];return e.src.slice(S,E+1)}let c=e.src.slice(r,a+1);a=c.length;let u=-1;for(r=1;r<a;r++){const y=c.charCodeAt(r);if(y===91)return!1;if(y===93){u=r;break}else if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(y===92&&(r++,r<a&&c.charCodeAt(r)===10)){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(r=u+2;r<a;r++){const y=c.charCodeAt(r);if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Re(y))break}const f=e.md.helpers.parseLinkDestination(c,r,a);if(!f.ok)return!1;const m=e.md.normalizeLink(f.str);if(!e.md.validateLink(m))return!1;r=f.pos;const p=r,h=o,g=r;for(;r<a;r++){const y=c.charCodeAt(r);if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Re(y))break}let b=e.md.helpers.parseLinkTitle(c,r,a);for(;b.can_continue;){const y=l(o);if(y===null)break;c+=y,r=a,a=c.length,o++,b=e.md.helpers.parseLinkTitle(c,r,a,b)}let x;for(r<a&&g!==r&&b.ok?(x=b.str,r=b.pos):(x="",r=p,o=h);r<a;){const y=c.charCodeAt(r);if(!Re(y))break;r++}if(r<a&&c.charCodeAt(r)!==10&&x)for(x="",r=p,o=h;r<a;){const y=c.charCodeAt(r);if(!Re(y))break;r++}if(r<a&&c.charCodeAt(r)!==10)return!1;const v=Io(c.slice(1,u));return v?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:x,href:m}),e.line=o),!0):!1}const S4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],C4="[a-zA-Z_:][a-zA-Z0-9:._-]*",E4="[^\"'=<>`\\x00-\\x20]+",A4="'[^']*'",T4='"[^"]*"',N4="(?:"+E4+"|"+A4+"|"+T4+")",O4="(?:\\s+"+C4+"(?:\\s*=\\s*"+N4+")?)",ym="<[A-Za-z][A-Za-z0-9\\-]*"+O4+"*\\s*\\/?>",km="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",M4="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",D4="<[?][\\s\\S]*?[?]>",z4="<![A-Za-z][^>]*>",I4="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",R4=new RegExp("^(?:"+ym+"|"+km+"|"+M4+"|"+D4+"|"+z4+"|"+I4+")"),L4=new RegExp("^(?:"+ym+"|"+km+")"),Qn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+S4.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(L4.source+"\\s*$"),/^$/,!1]];function B4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let o=e.src.slice(r,a),l=0;for(;l<Qn.length&&!Qn[l][0].test(o);l++);if(l===Qn.length)return!1;if(i)return Qn[l][2];let c=t+1;const u=Qn[l][1].test("");if(!Qn[l][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(r=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(r,a),Qn[l][1].test(o)){o.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function P4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(r);if(o!==35||r>=a)return!1;let l=1;for(o=e.src.charCodeAt(++r);o===35&&r<a&&l<=6;)l++,o=e.src.charCodeAt(++r);if(l>6||r<a&&!Re(o))return!1;if(i)return!0;a=e.skipSpacesBack(a,r);const c=e.skipCharsBack(a,35,r);c>r&&Re(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;const u=e.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[t,e.line];const f=e.push("inline","",0);f.content=Ro(e.src.slice(r,a)),f.map=[t,e.line],f.children=[];const m=e.push("heading_close","h"+String(l),-1);return m.markup="########".slice(0,l),!0}function F4(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let a=0,o,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let h=e.bMarks[l]+e.tShift[l];const g=e.eMarks[l];if(h<g&&(o=e.src.charCodeAt(h),(o===45||o===61)&&(h=e.skipChars(h,o),h=e.skipSpaces(h),h>=g))){a=o===61?1:2;break}}if(e.sCount[l]<0)continue;let p=!1;for(let h=0,g=i.length;h<g;h++)if(i[h](e,l,n,!0)){p=!0;break}if(p)break}if(!a)return e.parentType=r,!1;const c=Ro(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const u=e.push("heading_open","h"+String(a),1);u.markup=String.fromCharCode(o),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const m=e.push("heading_close","h"+String(a),-1);return m.markup=String.fromCharCode(o),e.parentType=r,!0}function V4(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let a=t+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let u=!1;for(let f=0,m=i.length;f<m;f++)if(i[f](e,a,n,!0)){u=!0;break}if(u)break}const o=Ro(e.getLines(t,a,e.blkIndent,!1));e.line=a;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const ga=[["table",b4,["paragraph","reference"]],["code",g4],["fence",v4,["paragraph","reference","blockquote","list"]],["blockquote",x4,["paragraph","reference","blockquote","list"]],["hr",y4,["paragraph","reference","blockquote","list"]],["list",w4,["paragraph","reference","blockquote"]],["reference",_4],["html_block",B4,["paragraph","reference","blockquote"]],["heading",P4,["paragraph","reference","blockquote"]],["lheading",F4],["paragraph",V4]];function Lo(){this.ruler=new Ct;for(let e=0;e<ga.length;e++)this.ruler.push(ga[e][0],ga[e][1],{alt:(ga[e][2]||[]).slice()})}Lo.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,a=e.md.options.maxNesting;let o=t,l=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<r;f++)if(u=i[f](e,o,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),o=e.line,o<n&&e.isEmpty(o)&&(l=!0,o++,e.line=o)}};Lo.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)};Lo.prototype.State=nn;function Ir(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ir.prototype.pushPending=function(){const e=new Wt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ir.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Wt(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Ir.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const x=this.src.charCodeAt(e-2);r=(x&64512)===55296?65536+(x-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===i;)a++;const o=a-e;let l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){const x=this.src.charCodeAt(a+1);l=(x&64512)===56320?65536+(l-55296<<10)+(x-56320):65533}else(l&64512)===56320&&(l=65533);const c=Ar(r)||Er(r),u=Ar(l)||Er(l),f=Cr(r),m=Cr(l),p=!m&&(!u||f||c),h=!f&&(!c||m||u);return{can_open:p&&(t||!h||c),can_close:h&&(t||!p||u),length:o}};Ir.prototype.Token=Wt;function U4(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function H4(e,t){let n=e.pos;for(;n<e.posMax&&!U4(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const q4=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function j4(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(q4);if(!r)return!1;const a=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let l=o.url;if(l.length<=a.length)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const m=e.push("text","",0);m.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-a.length,!0}function $4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let a=i-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Re(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const bc=[];for(let e=0;e<256;e++)bc.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){bc[e.charCodeAt(0)]=1});function W4(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Re(r));)n++;return e.pos=n,!0}let a=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}const o="\\"+a;if(!t){const l=e.push("text_special","",0);r<256&&bc[r]!==0?l.content=a:l.content=o,l.markup=o,l.info="escape"}return e.pos=n+1,!0}function G4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const a=e.posMax;for(;n<a&&e.src.charCodeAt(n)===96;)n++;const o=e.src.slice(r,n),l=o.length;if(e.backticksScanned&&(e.backticks[l]||0)<=r)return t||(e.pending+=o),e.pos+=l,!0;let c=n,u;for(;(u=e.src.indexOf("`",c))!==-1;){for(c=u+1;c<a&&e.src.charCodeAt(c)===96;)c++;const f=c-u;if(f===l){if(!t){const m=e.push("code_inline","code",0);m.markup=o,m.content=e.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[f]=u}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0}function K4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let a=r.length;const o=String.fromCharCode(i);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=o,a--);for(let c=0;c<a;c+=2)l=e.push("text","",0),l.content=o+o,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function dd(e,t){let n;const i=[],r=t.length;for(let a=0;a<r;a++){const o=t[a];if(o.marker!==126||o.end===-1)continue;const l=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&i.push(l.token-1)}for(;i.length;){const a=i.pop();let o=a+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,a!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[a],e.tokens[a]=n)}}function X4(e){const t=e.tokens_meta,n=e.tokens_meta.length;dd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&dd(e,t[i].delimiters)}const wm={tokenize:K4,postProcess:X4};function J4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let a=0;a<r.length;a++){const o=e.push("text","",0);o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function fd(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const a=t[r.end],o=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===a.token+1,l=String.fromCharCode(r.marker),c=e.tokens[r.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?l+l:l,c.content="";const u=e.tokens[a.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function Z4(e){const t=e.tokens_meta,n=e.tokens_meta.length;fd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&fd(e,t[i].delimiters)}const _m={tokenize:J4,postProcess:Z4};function Q4(e,t){let n,i,r,a,o="",l="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,m=e.posMax,p=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let g=h+1;if(g<m&&e.src.charCodeAt(g)===40){for(u=!1,g++;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);if(g>=m)return!1;if(c=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(o=e.md.normalizeLink(r.str),e.md.validateLink(o)?g=r.pos:o="",c=g;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<m&&c!==g&&r.ok)for(l=r.str,g=r.pos;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);}(g>=m||e.src.charCodeAt(g)!==41)&&(u=!0),g++}if(u){if(typeof e.env.references>"u")return!1;if(g<m&&e.src.charCodeAt(g)===91?(c=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?i=e.src.slice(c,g++):g=h+1):g=h+1,i||(i=e.src.slice(p,h)),a=e.env.references[Io(i)],!a)return e.pos=f,!1;o=a.href,l=a.title}if(!t){e.pos=p,e.posMax=h;const b=e.push("link_open","a",1),x=[["href",o]];b.attrs=x,l&&x.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=m,!0}function Y4(e,t){let n,i,r,a,o,l,c,u,f="";const m=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(a=g+1,a<p&&e.src.charCodeAt(a)===40){for(a++;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);if(a>=p)return!1;for(u=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f=""),u=a;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<p&&u!==a&&l.ok)for(c=l.str,a=l.pos;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);else c="";if(a>=p||e.src.charCodeAt(a)!==41)return e.pos=m,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<p&&e.src.charCodeAt(a)===91?(u=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?r=e.src.slice(u,a++):a=g+1):a=g+1,r||(r=e.src.slice(h,g)),o=e.env.references[Io(r)],!o)return e.pos=m,!1;f=o.href,c=o.title}if(!t){i=e.src.slice(h,g);const b=[];e.md.inline.parse(i,e.md,e.env,b);const x=e.push("image","img",0),v=[["src",f],["alt",""]];x.attrs=v,x.children=b,x.content=i,c&&v.push(["title",c])}return e.pos=a,e.posMax=p,!0}const eS=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,tS=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const a=e.src.slice(i+1,n);if(tS.test(a)){const o=e.md.normalizeLink(a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}if(eS.test(a)){const o=e.md.normalizeLink("mailto:"+a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}return!1}function iS(e){return/^<a[>\s]/i.test(e)}function rS(e){return/^<\/a\s*>/i.test(e)}function aS(e){const t=e|32;return t>=97&&t<=122}function oS(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!aS(r))return!1;const a=e.src.slice(i).match(R4);if(!a)return!1;if(!t){const o=e.push("html_inline","",0);o.content=a[0],iS(o.content)&&e.linkLevel++,rS(o.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}const sS=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,lS=/^&([a-z][a-z0-9]{1,31});/i;function cS(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const a=e.src.slice(n).match(sS);if(a){if(!t){const o=a[1][0].toLowerCase()==="x"?parseInt(a[1].slice(1),16):parseInt(a[1],10),l=e.push("text_special","",0);l.content=mc(o)?Sr(o):Sr(65533),l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}else{const a=e.src.slice(n).match(lS);if(a){const o=T3(a[0]);if(o!==a[0]){if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}}return!1}function pd(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const a=[];for(let o=0;o<n;o++){const l=e[o];if(a.push(0),(e[i].marker!==l.marker||r!==l.token-1)&&(i=o),r=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[l.marker][(l.open?3:0)+l.length%3];let u=i-a[i]-1,f=u;for(;u>c;u-=a[u]+1){const m=e[u];if(m.marker===l.marker&&m.open&&m.end<0){let p=!1;if((m.close||l.open)&&(m.length+l.length)%3===0&&(m.length%3!==0||l.length%3!==0)&&(p=!0),!p){const h=u>0&&!e[u-1].open?a[u-1]+1:0;a[o]=o-u+h,a[u]=h,l.open=!1,m.end=o,m.close=!1,f=-1,r=-2;break}}}f!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function uS(e){const t=e.tokens_meta,n=e.tokens_meta.length;pd(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&pd(t[i].delimiters)}function dS(e){let t,n,i=0;const r=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<a&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const vs=[["text",H4],["linkify",j4],["newline",$4],["escape",W4],["backticks",G4],["strikethrough",wm.tokenize],["emphasis",_m.tokenize],["link",Q4],["image",Y4],["autolink",nS],["html_inline",oS],["entity",cS]],xs=[["balance_pairs",uS],["strikethrough",wm.postProcess],["emphasis",_m.postProcess],["fragments_join",dS]];function Rr(){this.ruler=new Ct;for(let e=0;e<vs.length;e++)this.ruler.push(vs[e][0],vs[e][1]);this.ruler2=new Ct;for(let e=0;e<xs.length;e++)this.ruler2.push(xs[e][0],xs[e][1])}Rr.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,a=e.cache;if(typeof a[t]<"u"){e.pos=a[t];return}let o=!1;if(e.level<r){for(let l=0;l<i;l++)if(e.level++,o=n[l](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos};Rr.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const a=e.pos;let o=!1;if(e.level<r){for(let l=0;l<n;l++)if(o=t[l](e,!1),o){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Rr.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const a=this.ruler2.getRules(""),o=a.length;for(let l=0;l<o;l++)a[l](r)};Rr.prototype.State=Ir;function fS(e){const t={};e=e||{},t.src_Any=cm.source,t.src_Cc=um.source,t.src_Z=fm.source,t.src_P=fc.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ml(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Bo(e){return Object.prototype.toString.call(e)}function pS(e){return Bo(e)==="[object String]"}function mS(e){return Bo(e)==="[object Object]"}function hS(e){return Bo(e)==="[object RegExp]"}function md(e){return Bo(e)==="[object Function]"}function bS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Sm={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function gS(e){return Object.keys(e||{}).reduce(function(t,n){return t||Sm.hasOwnProperty(n)},!1)}const vS={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},xS="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",yS="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function kS(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function hd(){return function(e,t){t.normalize(e)}}function yo(e){const t=e.re=fS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(xS),n.push(t.src_xn),t.src_tlds=n.join("|");function i(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(i(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(i(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(i(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function a(l,c){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+c)}Object.keys(e.__schemas__).forEach(function(l){const c=e.__schemas__[l];if(c===null)return;const u={validate:null,link:null};if(e.__compiled__[l]=u,mS(c)){hS(c.validate)?u.validate=kS(c.validate):md(c.validate)?u.validate=c.validate:a(l,c),md(c.normalize)?u.normalize=c.normalize:c.normalize?a(l,c):u.normalize=hd();return}if(pS(c)){r.push(l);return}a(l,c)}),r.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:hd()};const o=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(bS).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function Cm(e,t,n,i){const r=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}function Dt(e,t){if(!(this instanceof Dt))return new Dt(e,t);t||gS(e)&&(t=e,e={}),this.__opts__=ml({},Sm,t),this.__schemas__=ml({},vS,e),this.__compiled__={},this.__tlds__=yS,this.__tlds_replaced__=!1,this.re={},yo(this)}Dt.prototype.add=function(t,n){return this.__schemas__[t]=n,yo(this),this};Dt.prototype.set=function(t){return this.__opts__=ml(this.__opts__,t),this};Dt.prototype.test=function(t){if(!t.length)return!1;let n,i;if(this.re.schema_test.test(t)){for(i=this.re.schema_search,i.lastIndex=0;(n=i.exec(t))!==null;)if(this.testSchemaAt(t,n[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Dt.prototype.pretest=function(t){return this.re.pretest.test(t)};Dt.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0};Dt.prototype.match=function(t){const n=[],i=[],r=[],a=[];let o,l,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(t))!==null;)l=this.testSchemaAt(t,o[2],c.lastIndex),l&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)a.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const f=[0,0,0];let m=0;for(;;){const p=[i[f[0]],a[f[1]],r[f[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?f[0]++:h===p[1]?f[1]++:f[2]++,h.index<m)continue;const g=new Cm(t,h.schema,h.index,h.lastIndex);this.__compiled__[g.schema].normalize(g,this),n.push(g),m=h.lastIndex}return n.length?n:null};Dt.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);if(!i)return null;const r=new Cm(t,n[2],n.index+n[1].length,n.index+n[0].length+i);return this.__compiled__[r.schema].normalize(r,this),r};Dt.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,a){return i!==a[r-1]}).reverse(),yo(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,yo(this),this)};Dt.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Dt.prototype.onCompile=function(){};const Ti=2147483647,Zt=36,gc=1,Tr=26,wS=38,_S=700,Em=72,Am=128,Tm="-",SS=/^xn--/,CS=/[^\0-\x7F]/,ES=/[\x2E\u3002\uFF0E\uFF61]/g,AS={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ys=Zt-gc,Qt=Math.floor,ks=String.fromCharCode;function On(e){throw new RangeError(AS[e])}function TS(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Nm(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(ES,".");const r=e.split("."),a=TS(r,t).join(".");return i+a}function Om(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const a=e.charCodeAt(n++);(a&64512)==56320?t.push(((r&1023)<<10)+(a&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const NS=e=>String.fromCodePoint(...e),OS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Zt},bd=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Mm=function(e,t,n){let i=0;for(e=n?Qt(e/_S):e>>1,e+=Qt(e/t);e>ys*Tr>>1;i+=Zt)e=Qt(e/ys);return Qt(i+(ys+1)*e/(e+wS))},Dm=function(e){const t=[],n=e.length;let i=0,r=Am,a=Em,o=e.lastIndexOf(Tm);o<0&&(o=0);for(let l=0;l<o;++l)e.charCodeAt(l)>=128&&On("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const c=i;for(let f=1,m=Zt;;m+=Zt){l>=n&&On("invalid-input");const p=OS(e.charCodeAt(l++));p>=Zt&&On("invalid-input"),p>Qt((Ti-i)/f)&&On("overflow"),i+=p*f;const h=m<=a?gc:m>=a+Tr?Tr:m-a;if(p<h)break;const g=Zt-h;f>Qt(Ti/g)&&On("overflow"),f*=g}const u=t.length+1;a=Mm(i-c,u,c==0),Qt(i/u)>Ti-r&&On("overflow"),r+=Qt(i/u),i%=u,t.splice(i++,0,r)}return String.fromCodePoint(...t)},zm=function(e){const t=[];e=Om(e);const n=e.length;let i=Am,r=0,a=Em;for(const c of e)c<128&&t.push(ks(c));const o=t.length;let l=o;for(o&&t.push(Tm);l<n;){let c=Ti;for(const f of e)f>=i&&f<c&&(c=f);const u=l+1;c-i>Qt((Ti-r)/u)&&On("overflow"),r+=(c-i)*u,i=c;for(const f of e)if(f<i&&++r>Ti&&On("overflow"),f===i){let m=r;for(let p=Zt;;p+=Zt){const h=p<=a?gc:p>=a+Tr?Tr:p-a;if(m<h)break;const g=m-h,b=Zt-h;t.push(ks(bd(h+g%b,0))),m=Qt(g/b)}t.push(ks(bd(m,0))),a=Mm(r,u,l===o),r=0,++l}++r,++i}return t.join("")},MS=function(e){return Nm(e,function(t){return SS.test(t)?Dm(t.slice(4).toLowerCase()):t})},DS=function(e){return Nm(e,function(t){return CS.test(t)?"xn--"+zm(t):t})},Im={version:"2.3.1",ucs2:{decode:Om,encode:NS},decode:Dm,encode:zm,toASCII:DS,toUnicode:MS},zS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},IS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},RS={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},LS={default:zS,zero:IS,commonmark:RS},BS=/^(vbscript|javascript|file|data):/,PS=/^data:image\/(gif|png|jpeg|webp);/;function FS(e){const t=e.trim().toLowerCase();return BS.test(t)?PS.test(t):!0}const Rm=["http:","https:","mailto:"];function VS(e){const t=dc(e,!0);if(t.hostname&&(!t.protocol||Rm.indexOf(t.protocol)>=0))try{t.hostname=Im.toASCII(t.hostname)}catch{}return zr(uc(t))}function US(e){const t=dc(e,!0);if(t.hostname&&(!t.protocol||Rm.indexOf(t.protocol)>=0))try{t.hostname=Im.toUnicode(t.hostname)}catch{}return Di(uc(t),Di.defaultChars+"%")}function Et(e,t){if(!(this instanceof Et))return new Et(e,t);t||pc(e)||(t=e||{},e="default"),this.inline=new Rr,this.block=new Lo,this.core=new hc,this.renderer=new Bi,this.linkify=new Dt,this.validateLink=FS,this.normalizeLink=VS,this.normalizeLinkText=US,this.utils=j3,this.helpers=zo({},K3),this.options={},this.configure(e),t&&this.set(t)}Et.prototype.set=function(e){return zo(this.options,e),this};Et.prototype.configure=function(e){const t=this;if(pc(e)){const n=e;if(e=LS[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Et.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Et.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Et.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Et.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Et.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Et.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Et.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const HS=new Of({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function qS(e,t){if(e.isText&&t.isText&&ze.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class jS{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:ze.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),i=n.content,r=i[i.length-1],a=this.schema.text(t,n.marks),o;r&&(o=qS(r,a))?i[i.length-1]=o:i.push(a)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let i=t[n],r=this.tokenHandlers[i.type];if(!r)throw new Error("Token type `"+i.type+"` not supported by Markdown parser");r(this,i,t,n)}}addNode(t,n,i){let r=this.top(),a=t.createAndFill(n,i,r?r.marks:[]);return a?(this.push(a),a):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:ze.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function Ji(e,t,n,i){return e.getAttrs?e.getAttrs(t,n,i):e.attrs instanceof Function?e.attrs(t):e.attrs}function ws(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function gd(e){return e[e.length-1]==`
|
|
671
|
+
`?e.slice(0,e.length-1):e}function _s(){}function $S(e,t){let n=Object.create(null);for(let i in t){let r=t[i];if(r.block){let a=e.nodeType(r.block);ws(r,i)?n[i]=(o,l,c,u)=>{o.openNode(a,Ji(r,l,c,u)),o.addText(gd(l.content)),o.closeNode()}:(n[i+"_open"]=(o,l,c,u)=>o.openNode(a,Ji(r,l,c,u)),n[i+"_close"]=o=>o.closeNode())}else if(r.node){let a=e.nodeType(r.node);n[i]=(o,l,c,u)=>o.addNode(a,Ji(r,l,c,u))}else if(r.mark){let a=e.marks[r.mark];ws(r,i)?n[i]=(o,l,c,u)=>{o.openMark(a.create(Ji(r,l,c,u))),o.addText(gd(l.content)),o.closeMark(a)}:(n[i+"_open"]=(o,l,c,u)=>o.openMark(a.create(Ji(r,l,c,u))),n[i+"_close"]=o=>o.closeMark(a))}else if(r.ignore)ws(r,i)?n[i]=_s:(n[i+"_open"]=_s,n[i+"_close"]=_s);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(r))}return n.text=(i,r)=>i.addText(r.content),n.inline=(i,r)=>i.parseTokens(r.children),n.softbreak=n.softbreak||(i=>i.addText(" ")),n}let WS=class{constructor(t,n,i){this.schema=t,this.tokenizer=n,this.tokens=i,this.tokenHandlers=$S(t,i)}parse(t,n={}){let i=new jS(this.schema,this.tokenHandlers),r;i.parseTokens(this.tokenizer.parse(t,n));do r=i.closeNode();while(i.stack.length);return r||this.schema.topNodeType.createAndFill()}};function vd(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new WS(HS,Et("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:vd(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:vd(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const GS={open:"",close:"",mixable:!0};let KS=class{constructor(t,n,i={}){this.nodes=t,this.marks=n,this.options=i}serialize(t,n={}){n=Object.assign({},this.options,n);let i=new Lm(this.nodes,this.marks,n);return i.renderContent(t),i.out}};const rn=new KS({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),i=n?n.sort().slice(-1)[0]+"`":"```";e.write(i+(t.attrs.params||"")+`
|
|
672
|
+
`),e.text(t.textContent,!1),e.write(`
|
|
673
|
+
`),e.write(i),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){var n;let i=(n=t.attrs.order)!==null&&n!==void 0?n:1,r=String(i+t.childCount-1).length,a=e.repeat(" ",r+2);e.renderList(t,a,o=>{let l=String(i+o);return e.repeat(" ",r-l.length)+l+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(`\\
|
|
674
|
+
`);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,i){return e.inAutolink=XS(t,n,i),e.inAutolink?"<":"["},close(e,t,n,i){let{inAutolink:r}=e;return e.inAutolink=void 0,r?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,i){return xd(n.child(i),-1)},close(e,t,n,i){return xd(n.child(i-1),1)},escape:!1}});function xd(e,t){let n=/`+/g,i,r=0;if(e.isText)for(;i=n.exec(e.text);)r=Math.max(r,i[0].length);let a=r>0&&t>0?" `":"`";for(let o=0;o<r;o++)a+="`";return r>0&&t<0&&(a+=" "),a}function XS(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let i=t.child(n);return!i.isText||i.text!=e.attrs.href||i.marks[i.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let Lm=class{constructor(t,n,i){this.nodes=t,this.marks=n,this.options=i,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
675
|
+
`),t>1){let n=this.delim,i=/\s+$/.exec(n);i&&(n=n.slice(0,n.length-i[0].length));for(let r=1;r<t;r++)this.out+=n+`
|
|
676
|
+
`}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=GS}return n}wrapBlock(t,n,i,r){let a=this.delim;this.write(n??t),this.delim+=t,r(),this.delim=a,this.closeBlock(i)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
677
|
+
`)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let i=t.split(`
|
|
678
|
+
`);for(let r=0;r<i.length;r++)this.write(),!n&&i[r][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(i[r],this.atBlockStart):i[r],r!=i.length-1&&(this.out+=`
|
|
679
|
+
`)}render(t,n,i){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,i);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,i,r)=>this.render(n,t,r))}renderInline(t,n=!0){this.atBlockStart=n;let i=[],r="",a=(o,l,c)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(b=>{if(c+1==t.childCount)return!1;let x=t.child(c+1);return b.isInSet(x.marks)&&(!x.isText||/\S/.test(x.text))}));let f=r;if(r="",o&&o.isText&&u.some(b=>{let x=this.getMark(b.type.name);return x&&x.expelEnclosingWhitespace&&!b.isInSet(i)})){let[b,x,v]=/^(\s*)(.*)$/m.exec(o.text);x&&(f+=x,o=v?o.withText(v):null,o||(u=i))}if(o&&o.isText&&u.some(b=>{let x=this.getMark(b.type.name);return x&&x.expelEnclosingWhitespace&&!this.isMarkAhead(t,c+1,b)})){let[b,x,v]=/^(.*?)(\s*)$/m.exec(o.text);v&&(r=v,o=x?o.withText(x):null,o||(u=i))}let m=u.length?u[u.length-1]:null,p=m&&this.getMark(m.type.name).escape===!1,h=u.length-(p?1:0);e:for(let b=0;b<h;b++){let x=u[b];if(!this.getMark(x.type.name).mixable)break;for(let v=0;v<i.length;v++){let y=i[v];if(!this.getMark(y.type.name).mixable)break;if(x.eq(y)){b>v?u=u.slice(0,v).concat(x).concat(u.slice(v,b)).concat(u.slice(b+1,h)):v>b&&(u=u.slice(0,b).concat(u.slice(b+1,v)).concat(x).concat(u.slice(v,h)));continue e}}}let g=0;for(;g<Math.min(i.length,h)&&u[g].eq(i[g]);)++g;for(;g<i.length;)this.text(this.markString(i.pop(),!1,t,c),!1);if(f&&this.text(f),o){for(;i.length<h;){let b=u[i.length];i.push(b),this.text(this.markString(b,!0,t,c),!1),this.atBlockStart=!1}p&&o.isText?this.text(this.markString(m,!0,t,c)+o.text+this.markString(m,!1,t,c+1),!1):this.render(o,t,c),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(a),a(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,i){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,a=this.inTightList;this.inTightList=r,t.forEach((o,l,c)=>{c&&r&&this.flushClose(1),this.wrapBlock(n,i(c),t,()=>this.render(o,t,c))}),this.inTightList=a}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(i,r)=>i=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?i:"\\"+i),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let i="";for(let r=0;r<n;r++)i+=t;return i}markString(t,n,i,r){let a=this.getMark(t.type.name),o=n?a.open:a.close;return typeof o=="string"?o:o(this,t,i,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,i){for(;;n++){if(n>=t.childCount)return!1;let r=t.child(n);if(r.type.name!=this.options.hardBreakNodeName)return i.isInSet(r.marks);n++}}};var hl=!0,Bm=!1,Pm=!1,JS=function(e,t){t&&(hl=!t.enabled,Bm=!!t.label,Pm=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)QS(i,r)&&(YS(i[r],n.Token),yd(i[r-2],"class","task-list-item"+(hl?"":" enabled")),yd(i[ZS(i,r-2)],"class","contains-task-list"))})};function yd(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function ZS(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function QS(e,t){return rC(e[t])&&aC(e[t-1])&&oC(e[t-2])&&sC(e[t])}function YS(e,t){if(e.children.unshift(eC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Bm)if(Pm){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(iC(e.content,n,t))}else e.children.unshift(tC(t)),e.children.push(nC(t))}function eC(e,t){var n=new t("html_inline","",0),i=hl?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function tC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function nC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function iC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function rC(e){return e.type==="inline"}function aC(e){return e.type==="paragraph_open"}function oC(e){return e.type==="list_item_open"}function sC(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const lC=lm(JS);var cC=Object.defineProperty,uC=(e,t,n)=>t in e?cC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ko=(e,t,n)=>(uC(e,typeof t!="symbol"?t+"":t,n),n);const dC=je.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:i,commands:r}=n;function a(o){if(!i.isActive(o))return!1;const l=i.getAttributes(o);return r.updateAttributes(o,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(o=>a(o))}}}}}),kd=Et();function Fm(e,t){return kd.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new kd.inline.State(e,null,null,[]).scanDelims(t,!0)}function Vm(e,t,n,i){let r=e.substring(0,n)+e.substring(n+t.length);return r=r.substring(0,n+i)+t+r.substring(n+i),r}function fC(e,t,n,i){let r=n,a=e;for(;r<i&&!Fm(a,r).can_open;)a=Vm(a,t,r,1),r++;return{text:a,from:r,to:i}}function pC(e,t,n,i){let r=i,a=e;for(;r>n&&!Fm(a,r).can_close;)a=Vm(a,t,r,-1),r--;return{text:a,from:n,to:r}}function mC(e,t,n,i){let r={text:e,from:n,to:i};return r=fC(r.text,t,r.from,r.to),r=pC(r.text,t,r.from,r.to),r.to-r.from<t.length+1&&(r.text=r.text.substring(0,r.from)+r.text.substring(r.to+t.length)),r.text}class hC extends Lm{constructor(t,n,i){super(t,n,i??{}),ko(this,"inTable",!1),this.inlines=[]}render(t,n,i){super.render(t,n,i);const r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!==null&&r!==void 0&&r.end){const{delimiter:a,start:o,end:l}=this.normalizeInline(r);this.out=mC(this.out,a,o,l),this.inlines.pop()}}markString(t,n,i,r){const a=this.marks[t.type.name];if(a.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:a.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,n,i,r)}normalizeInline(t){let{start:n,end:i}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const Um=St.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,i;return this.editor.storage.markdown.options.html?(n=(i=wd(t))===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,i;return this.editor.storage.markdown.options.html&&(n=(i=wd(t))===null||i===void 0?void 0:i[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function wd(e){const t=e.type.schema,n=t.text(" ",[e]),r=Rp(J.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function vc(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function bC(e){return e==null?void 0:e.replace(/</g,"<").replace(/>/g,">")}function gC(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function vC(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Po=Se.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(xC(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function xC(e,t){const n=e.type.schema,i=Rp(J.from(e),n);return e.isBlock&&(t instanceof J||t.type.name===n.topNodeType.name)?yC(i):i}function yC(e){const n=vc(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
680
|
+
${n.innerHTML}
|
|
681
|
+
`:`
|
|
682
|
+
`,n.outerHTML}const kC=Se.create({name:"blockquote"}),wC=kC.extend({addStorage(){return{markdown:{serialize:rn.nodes.blockquote,parse:{}}}}}),_C=Se.create({name:"bulletList"}),Hm=_C.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),SC=Se.create({name:"codeBlock"}),CC=SC.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
|
|
683
|
+
`),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),EC=Se.create({name:"hardBreak"}),qm=EC.extend({addStorage(){return{markdown:{serialize(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(e.inTable?Po.storage.markdown.serialize.call(this,e,t,n):`\\
|
|
684
|
+
`);return}},parse:{}}}}}),AC=Se.create({name:"heading"}),TC=AC.extend({addStorage(){return{markdown:{serialize:rn.nodes.heading,parse:{}}}}}),NC=Se.create({name:"horizontalRule"}),OC=NC.extend({addStorage(){return{markdown:{serialize:rn.nodes.horizontal_rule,parse:{}}}}}),MC=Se.create({name:"image"}),DC=MC.extend({addStorage(){return{markdown:{serialize:rn.nodes.image,parse:{}}}}}),zC=Se.create({name:"listItem"}),IC=zC.extend({addStorage(){return{markdown:{serialize:rn.nodes.list_item,parse:{}}}}}),RC=Se.create({name:"orderedList"});function LC(e,t,n){let i=0;for(;n-i>0&&t.child(n-i-1).type.name===e.type.name;i++);return i}const BC=RC.extend({addStorage(){return{markdown:{serialize(e,t,n,i){const r=t.attrs.start||1,a=String(r+t.childCount-1).length,o=e.repeat(" ",a+2),c=LC(t,n,i)%2?") ":". ";e.renderList(t,o,u=>{const f=String(r+u);return e.repeat(" ",a-f.length)+f+c})},parse:{}}}}}),PC=Se.create({name:"paragraph"}),FC=PC.extend({addStorage(){return{markdown:{serialize:rn.nodes.paragraph,parse:{}}}}});function Ss(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const VC=Se.create({name:"table"}),UC=VC.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!HC(t)){Po.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((i,r,a)=>{if(e.write("| "),i.forEach((o,l,c)=>{c&&e.write(" | ");const u=o.firstChild;u.textContent.trim()&&e.renderInline(u)}),e.write(" |"),e.ensureNewLine(),!a){const o=Array.from({length:i.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function _d(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function HC(e){const t=Ss(e),n=t[0],i=t.slice(1);return!(Ss(n).some(r=>r.type.name!=="tableHeader"||_d(r)||r.childCount>1)||i.some(r=>Ss(r).some(a=>a.type.name==="tableHeader"||_d(a)||a.childCount>1)))}const qC=Se.create({name:"taskItem"}),jC=qC.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),$C=Se.create({name:"taskList"}),WC=$C.extend({addStorage(){return{markdown:{serialize:Hm.storage.markdown.serialize,parse:{setup(e){e.use(lC)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),GC=Se.create({name:"text"}),KC=GC.extend({addStorage(){return{markdown:{serialize(e,t){e.text(bC(t.text))},parse:{}}}}}),XC=St.create({name:"bold"}),JC=XC.extend({addStorage(){return{markdown:{serialize:rn.marks.strong,parse:{}}}}}),ZC=St.create({name:"code"}),QC=ZC.extend({addStorage(){return{markdown:{serialize:rn.marks.code,parse:{}}}}}),YC=St.create({name:"italic"}),eE=YC.extend({addStorage(){return{markdown:{serialize:rn.marks.em,parse:{}}}}}),tE=St.create({name:"link"}),nE=tE.extend({addStorage(){return{markdown:{serialize:rn.marks.link,parse:{}}}}}),iE=St.create({name:"strike"}),rE=iE.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),aE=[wC,Hm,CC,qm,TC,OC,Po,DC,IC,BC,FC,UC,jC,WC,KC,JC,QC,Um,eE,nE,rE];function wo(e){var t,n;const i=(t=e.storage)===null||t===void 0?void 0:t.markdown,r=(n=aE.find(a=>a.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return i||r?{...r,...i}:null}class oE{constructor(t){ko(this,"editor",null),this.editor=t}serialize(t){const n=new hC(this.nodes,this.marks,{hardBreakNodeName:qm.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Po)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(Um)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=wo(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const i=(n=wo(t))===null||n===void 0?void 0:n.serialize;return i?{...i,open:typeof i.open=="function"?i.open.bind({editor:this.editor,options:t.options}):i.open,close:typeof i.close=="function"?i.close.bind({editor:this.editor,options:t.options}):i.close}:null}}class sE{constructor(t,n){ko(this,"editor",null),ko(this,"md",null);let{html:i,linkify:r,breaks:a}=n;this.editor=t,this.md=this.withPatchedRenderer(Et({html:i,linkify:r,breaks:a}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=wo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},this.md)});const i=this.md.render(t),r=vc(i);return this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=wo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},r)}),this.normalizeDOM(r,{inline:n,content:t}),r.innerHTML}return t}normalizeDOM(t,n){let{inline:i,content:r}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(a=>{var o;((o=a.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!a.closest("pre")&&(a.nextSibling.textContent=a.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(t,r),t}normalizeBlocks(t){const i=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var a;return(a=r.spec.parseDOM)===null||a===void 0?void 0:a.map(o=>o.tag)}).flat().filter(Boolean).join(",");i&&[...t.querySelectorAll(i)].forEach(r=>{r.parentElement.matches("p")&&gC(r)})}normalizeInline(t,n){var i;if((i=t.firstElementChild)!==null&&i!==void 0&&i.matches("p")){var r,a,o,l;const c=t.firstElementChild,{nextElementSibling:u}=c,f=(r=(a=n.match(/^\s+/))===null||a===void 0?void 0:a[0])!==null&&r!==void 0?r:"",m=u?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${m}`;return}vC(c),t.innerHTML=`${f}${t.innerHTML}${m}`}}withPatchedRenderer(t){const n=i=>function(){const r=i(...arguments);return r===`
|
|
685
|
+
`?r:r[r.length-1]===`
|
|
686
|
+
`?r.slice(0,-1):r};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const lE=je.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new dt({key:new at("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const i=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ir.fromSchema(this.editor.schema).parseSlice(vc(i),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),cE=je.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=ow.Commands.config.addCommands();return{setContent:(t,n,i)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n,i)(r),insertContentAt:(t,n,i)=>r=>e.insertContentAt(t,r.editor.storage.markdown.parser.parse(n,{inline:!0}),i)(r)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new sE(this.editor,this.options),serializer:new oE(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[dC.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),lE.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});_e.definePlugin({id:"formatting",tiptapExtensions:[uw],toolbar:[{id:"bold",label:"Bold",action:"toggleBold",iconComponent:"Bold"},{id:"italic",label:"Italic",action:"toggleItalic",iconComponent:"Italic"},{id:"underline",label:"Underline",action:"toggleUnderline",iconComponent:"Underline"},{id:"strike",label:"Strikethrough",action:"toggleStrike",iconComponent:"Strikethrough"}]});function wi(e){return t=>t.commands.toggleHeading({level:e})}_e.definePlugin({id:"headings",toolbar:[{id:"heading-1",label:"Heading 1",action:"toggleHeading1",iconComponent:"Heading1"},{id:"heading-2",label:"Heading 2",action:"toggleHeading2",iconComponent:"Heading2"},{id:"heading-3",label:"Heading 3",action:"toggleHeading3",iconComponent:"Heading3"},{id:"heading-4",label:"Heading 4",action:"toggleHeading4",iconComponent:"Heading4"},{id:"heading-5",label:"Heading 5",action:"toggleHeading5",iconComponent:"Heading5"},{id:"heading-6",label:"Heading 6",action:"toggleHeading6",iconComponent:"Heading6"}],slashCommands:[{name:"Heading 1",command:"toggleHeading1"},{name:"Heading 2",command:"toggleHeading2"},{name:"Heading 3",command:"toggleHeading3"}],commands:{toggleHeading1:wi(1),toggleHeading2:wi(2),toggleHeading3:wi(3),toggleHeading4:wi(4),toggleHeading5:wi(5),toggleHeading6:wi(6)}});_e.definePlugin({id:"lists",tiptapExtensions:[dw,pw.configure({nested:!0})],toolbar:[{id:"bullet-list",label:"Bullet List",action:"toggleBulletList",iconComponent:"List"},{id:"ordered-list",label:"Ordered List",action:"toggleOrderedList",iconComponent:"ListOrdered"},{id:"task-list",label:"Task List",action:"toggleTaskList",iconComponent:"CheckSquare"}],slashCommands:[{name:"Bullet List",command:"toggleBulletList"},{name:"Ordered List",command:"toggleOrderedList"},{name:"Task List",command:"toggleTaskList"}]});function va(e){return t=>t.commands.setTextAlign(e)}_e.definePlugin({id:"alignment",tiptapExtensions:[mw.configure({types:["heading","paragraph"]})],toolbar:[{id:"align-left",label:"Align Left",action:"alignLeft",iconComponent:"AlignLeft"},{id:"align-center",label:"Align Center",action:"alignCenter",iconComponent:"AlignCenter"},{id:"align-right",label:"Align Right",action:"alignRight",iconComponent:"AlignRight"},{id:"align-justify",label:"Align Justify",action:"alignJustify",iconComponent:"AlignJustify"}],commands:{alignLeft:va("left"),alignCenter:va("center"),alignRight:va("right"),alignJustify:va("justify")}});_e.definePlugin({id:"link",tiptapExtensions:[Vw.configure({openOnClick:!0})],toolbar:[{id:"set-link",label:"Link",action:"setLink",iconComponent:"Link"}],slashCommands:[{name:"Link",command:"setLink"}],commands:{setLink:(e,...t)=>{if(e.isActive("link"))return e.chain().focus().unsetLink().run();const n=t[0],i=(n==null?void 0:n.href)??(typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter link URL:","https://"):null);return i?e.chain().focus().setLink({href:i,target:"_blank"}).run():!1}}});function uE(){return typeof document>"u"?Promise.resolve(null):new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept="image/*";const n=()=>t.remove();t.onchange=()=>{var r;const i=((r=t.files)==null?void 0:r[0])??null;n(),e(i)},t.oncancel=()=>{n(),e(null)},document.body.appendChild(t),t.click()})}_e.definePlugin({id:"image",tiptapExtensions:[Hw],toolbar:[{id:"insert-image",label:"Image",action:"insertImage",iconComponent:"Image"}],slashCommands:[{name:"Image",command:"insertImage"}],commands:{insertImage:(e,...t)=>{const n=t[0];if(n!=null&&n.src)return e.commands.setImage({src:n.src,alt:n.alt,title:n.title});const i=e.storage.editorContext,r=i==null?void 0:i.onImageUpload;if(r)return uE().then(async a=>{if(a)try{const o=await r(a);o!=null&&o.src&&e.commands.setImage({src:o.src,alt:o.alt,title:o.title})}catch(o){console.error("[image] upload failed:",o)}}),!0;if(typeof window<"u"&&typeof window.prompt=="function"){const a=window.prompt("Enter image URL:","https://");return a?e.commands.setImage({src:a}):!1}return!1}}});var dE=$_.extend({renderHTML({node:e,HTMLAttributes:t}){let n=0;const i=e.firstChild;i&&i.forEach(c=>{n+=c.attrs.colspan||1});const r=[];let a=0,o=!1;if(n>0)for(let c=0;c<n;c++){let u=null;if(i){let f=0;i.forEach(m=>{const p=m.attrs.colspan||1;if(c>=f&&c<f+p){const h=m.attrs.colwidth;if(h&&Array.isArray(h)){const g=c-f,b=h[g];typeof b=="number"&&b>0&&(u=b)}}f+=p})}u&&(a+=u,o=!0),r.push(["col",u?{style:`width: ${u}px !important`,width:String(u)}:{}])}const l=Be(t);if(o&&a>0){const c=l.style||"";l.style=c?`${c}; width: ${a}px !important`:`width: ${a}px !important`}return["table",l,["colgroup",...r],["tbody",0]]}}),fE=G_.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}}),pE=K_.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}});_e.definePlugin({id:"table",tiptapExtensions:[dE.configure({resizable:!1}),W_,fE,pE],toolbar:[{id:"insert-table",label:"Insert Table",action:"insertTable",args:[{rows:3,cols:3,withHeaderRow:!0}],iconComponent:"Table"}],slashCommands:[{name:"Table",command:"insertTable"}]});_e.definePlugin({id:"blockquote",toolbar:[{id:"blockquote",label:"Blockquote",action:"toggleBlockquote",iconComponent:"Quote"}],slashCommands:[{name:"Blockquote",command:"toggleBlockquote"}]});_e.definePlugin({id:"code-block",toolbar:[{id:"code-block",label:"Code Block",action:"toggleCodeBlock",iconComponent:"Code"}],slashCommands:[{name:"Code Block",command:"toggleCodeBlock"}]});function mE(e={}){return _e.definePlugin({id:"placeholder",tiptapExtensions:[X_.configure({placeholder:e.placeholder??"Start writing…"})]})}mE();var hE=Se.create({name:"pageBreak",group:"block",selectable:!1,draggable:!1,parseHTML(){return[{tag:'div[data-page-break="true"]'}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-page-break":"true","data-node-type":"pageBreak",class:"docs-editor-page-break"}),["span",{class:"docs-editor-page-break__label"},"Page break"]]},addNodeView(){return()=>{const e=document.createElement("div");e.className="docs-editor-page-break",e.setAttribute("data-page-break","true"),e.setAttribute("data-node-type","pageBreak"),e.setAttribute("contenteditable","false");const t=document.createElement("div");t.className="docs-editor-page-break__inner";const n=document.createElement("div");n.className="docs-editor-page-break__line";const i=document.createElement("span");return i.className="docs-editor-page-break__label-text",i.textContent="Page break",t.appendChild(n),t.appendChild(i),e.appendChild(t),{dom:e,contentDOM:void 0}}}});_e.definePlugin({id:"pageBreak",tiptapExtensions:[hE],toolbar:[{id:"insert-page-break",label:"Page Break",action:"insertPageBreak",iconComponent:"FileText"}],slashCommands:[{name:"Page Break",command:"insertPageBreak"}],commands:{insertPageBreak:e=>e.chain().focus().insertContent([{type:"pageBreak"},{type:"paragraph"}]).run()}});var bE=Se.create({name:"footnote",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{content:{default:"",parseHTML:e=>e.getAttribute("data-footnote-content")??"",renderHTML:e=>({"data-footnote-content":e.content})},citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>e.citationId?{"data-citation-id":e.citationId}:{}},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-footnote-source-id"),renderHTML:e=>e.sourceId?{"data-footnote-source-id":e.sourceId}:{}},locator:{default:"",parseHTML:e=>e.getAttribute("data-footnote-locator")??"",renderHTML:e=>e.locator?{"data-footnote-locator":e.locator}:{}}}},parseHTML(){return[{tag:'span[data-node-type="footnote"]'}]},renderHTML({HTMLAttributes:e}){return["span",Be(e,{"data-node-type":"footnote",class:"docs-footnote-ref"}),"1"]},addNodeView(){return e=>{const t=e.node??e,n=t&&typeof t=="object"&&"attrs"in t?t.attrs:{},i=document.createElement("span");return i.className="docs-footnote-ref",i.setAttribute("data-node-type","footnote"),i.setAttribute("data-footnote-content",String(n.content??"")),n.sourceId&&(i.setAttribute("data-footnote-source-id",String(n.sourceId)),i.setAttribute("data-citation-id",String(n.citationId??"")),n.locator&&i.setAttribute("data-footnote-locator",String(n.locator))),i.textContent="1",{dom:i,update(r){try{const a=(r==null?void 0:r.attrs)??{};i.setAttribute("data-footnote-content",String(a.content??"")),a.sourceId?(i.setAttribute("data-footnote-source-id",String(a.sourceId)),i.setAttribute("data-citation-id",String(a.citationId??"")),a.locator&&i.setAttribute("data-footnote-locator",String(a.locator))):(i.removeAttribute("data-footnote-source-id"),i.removeAttribute("data-citation-id"),i.removeAttribute("data-footnote-locator"))}catch{}return!0}}}}});_e.definePlugin({id:"footnote",tiptapExtensions:[bE],toolbar:[{id:"insert-footnote",label:"Catatan Kaki",action:"insertFootnote",iconComponent:"FileText"}],slashCommands:[{name:"Catatan Kaki",command:"insertFootnote"}],commands:{insertFootnote:(e,...t)=>{const n=t[0];return e.chain().focus().insertContent({type:"footnote",attrs:{content:(n==null?void 0:n.content)??""}}).run()}}});function jm(e){const t=[];return e.descendants((n,i)=>{if(n.type.name==="heading"){const r=n.attrs.level;(r===1||r===2||r===3)&&t.push({level:r,text:n.textContent.trim(),pos:i})}return!0}),t}function gE(e){return jm(e.state.doc)}function $m(e){let t=[];try{const i=e.view.dom.querySelector("[data-rm-pagination]");i&&(t=Array.from(i.querySelectorAll(".rm-page-break .breaker")).filter(r=>r instanceof HTMLElement))}catch{}if(t.length===0)return()=>null;const n=e.view.dom;return i=>{try{const a=e.view.coordsAtPos(i).top-n.getBoundingClientRect().top+n.scrollTop;let o=1;for(const l of t){if(a<l.offsetTop)return o;o++}return o}catch{return null}}}function vE(e,t,n){const i=e.nodes.tocEntry;return t.length===0?[i.create({level:1,pos:0})]:t.map(r=>{const a=[];r.text&&a.push(e.text(r.text));const o=n(r.pos);return o!==null&&a.push(e.nodes.tocPageNum.create({page:o})),i.create({level:r.level,pos:r.pos},a)})}function xE(e){const t=gE(e);if(t.length===0)return[{type:"tocEntry",attrs:{level:1,pos:0}}];const n=$m(e);return t.map(i=>{const r=[];i.text&&r.push({type:"text",text:i.text});const a=n(i.pos);return a!==null&&r.push({type:"tocPageNum",attrs:{page:a}}),{type:"tocEntry",attrs:{level:i.level,pos:i.pos},...r.length>0?{content:r}:{}}})}function Wm(e,t){const n=e.schema.nodes.toc;if(!n)return!1;const i=[];if(t.doc.descendants((a,o)=>a.type.name==="toc"?(i.push({pos:o,nodeSize:a.nodeSize}),!1):!0),i.length===0)return!1;const r=vE(e.schema,jm(t.doc),$m(e));for(const a of i.reverse())t.replaceWith(a.pos,a.pos+a.nodeSize,n.create(null,r));return!0}function Gm(e){const t=e.state.tr;return Wm(e,t)?(e.view.dispatch(t),!0):!1}var yE=je.create({name:"tocCommands",addCommands(){return{insertToc:()=>({editor:e,chain:t})=>t().focus().insertContent({type:"toc",content:xE(e)}).run(),refreshToc:()=>({editor:e,tr:t})=>Wm(e,t)}}}),kE=Se.create({name:"tocPageNum",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{page:{default:null,parseHTML:e=>Number(e.textContent)||null,renderHTML:e=>e.page?{"data-page":e.page}:{}}}},parseHTML(){return[{tag:"span[data-toc-page]"}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-toc-page":"",class:"docs-toc__page"}),String(e.attrs.page??"")]}}),wE=Se.create({name:"tocEntry",content:"inline*",defining:!0,addAttributes(){return{level:{default:1,parseHTML:e=>Number(e.getAttribute("data-level")??1),renderHTML:e=>({"data-level":e.level})},pos:{default:0,parseHTML:e=>Number(e.getAttribute("data-pos")??0),renderHTML:e=>({"data-pos":e.pos})}}},parseHTML(){return[{tag:"p[data-toc-entry]"}]},renderHTML({HTMLAttributes:e}){return["p",Be(e,{"data-toc-entry":"",class:"docs-toc__entry"}),0]}}),_E=Se.create({name:"toc",group:"block",content:"tocEntry+",defining:!0,parseHTML(){return[{tag:"div[data-toc]"}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-toc":"",class:"docs-toc"}),0]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-toc",n.setAttribute("data-toc","");const i=document.createElement("div");i.className="docs-toc__chrome",i.contentEditable="false";const r=document.createElement("span");r.className="docs-toc__caption",r.textContent="Table of contents";const a=document.createElement("button");a.type="button",a.className="docs-toc__refresh",a.title="Refresh table of contents",a.textContent="⟳",i.appendChild(r),i.appendChild(a);const o=document.createElement("div");o.className="docs-toc__entries",n.appendChild(i),n.appendChild(o);const l=u=>{u.preventDefault(),Gm(t)},c=u=>{var h,g;const f=(g=(h=u.target)==null?void 0:h.closest)==null?void 0:g.call(h,"[data-toc-entry]");if(!f)return;const m=Number(f.getAttribute("data-pos")??0),p=Math.min(Math.max(0,m),t.state.doc.content.size);t.chain().focus().setTextSelection(p).scrollIntoView().run()};return a.addEventListener("click",l),n.addEventListener("click",c),{dom:n,contentDOM:o,update(u){var f;return((f=u==null?void 0:u.type)==null?void 0:f.name)==="toc"},destroy(){a.removeEventListener("click",l),n.removeEventListener("click",c)}}}}});_e.definePlugin({id:"toc",tiptapExtensions:[kE,wE,_E,yE],slashCommands:[{name:"Table of contents",description:"Daftar isi",command:"insertToc"}],commands:{insertToc:e=>e.commands.insertToc(),refreshToc:e=>Gm(e)}});_e.definePlugin({id:"font-size",tiptapExtensions:[_e.FontSizeExtension],commands:{setFontSize:(e,...t)=>{const n=t[0]||"16px";return n==="16px"?e.commands.unsetFontSize():e.commands.setFontSize(n),e.commands.focus(),!0}}});_e.definePlugin({id:"text-color",tiptapExtensions:[Z_],toolbar:[{id:"text-color",label:"Text Color",action:"setTextColor",iconComponent:"Palette"}],commands:{setTextColor:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetColor().run():e.chain().focus().setColor(n).run():!1}}});var SE=e3.extend({parseHTML(){return[{tag:"mark"},{tag:"span",style:"background-color"}]},renderHTML({HTMLAttributes:e}){return["mark",Be(this.options.HTMLAttributes,e),0]}});_e.definePlugin({id:"highlight",tiptapExtensions:[SE.configure({multicolor:!0})],toolbar:[{id:"highlight",label:"Highlight",action:"setHighlight",iconComponent:"Highlighter"}],commands:{setHighlight:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetHighlight().run():e.chain().focus().toggleHighlight({color:n}).run():e.chain().focus().toggleHighlight().run()}}});var CE=`<?xml version="1.0" encoding="utf-8"?>
|
|
652
687
|
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" initialize-with=". " page-range-format="chicago-16" version="1.0">
|
|
653
688
|
<!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
|
|
654
689
|
<info>
|
|
@@ -6654,7 +6689,7 @@
|
|
|
6654
6689
|
</layout>
|
|
6655
6690
|
</bibliography>
|
|
6656
6691
|
</style>
|
|
6657
|
-
`,
|
|
6692
|
+
`,EE=CE,AE=`<?xml version="1.0" encoding="utf-8"?>
|
|
6658
6693
|
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" initialize-with=". " page-range-format="chicago-16" version="1.0">
|
|
6659
6694
|
<!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
|
|
6660
6695
|
<info>
|
|
@@ -10870,7 +10905,7 @@
|
|
|
10870
10905
|
</layout>
|
|
10871
10906
|
</bibliography>
|
|
10872
10907
|
</style>
|
|
10873
|
-
`,
|
|
10908
|
+
`,TE=AE,NE=`<?xml version="1.0" encoding="utf-8"?>
|
|
10874
10909
|
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" demote-non-dropping-particle="never" initialize-with=". " names-delimiter=", " page-range-format="expanded" version="1.0">
|
|
10875
10910
|
<!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
|
|
10876
10911
|
<info>
|
|
@@ -13143,7 +13178,7 @@
|
|
|
13143
13178
|
</layout>
|
|
13144
13179
|
</bibliography>
|
|
13145
13180
|
</style>
|
|
13146
|
-
`,
|
|
13181
|
+
`,OE=NE,ME=`<?xml version="1.0" encoding="utf-8"?>
|
|
13147
13182
|
<style xmlns="http://purl.org/net/xbiblio/csl" and="text" class="in-text" demote-non-dropping-particle="never" initialize-with=". " page-range-format="minimal-two" version="1.0">
|
|
13148
13183
|
<!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
|
|
13149
13184
|
<info>
|
|
@@ -14327,7 +14362,7 @@
|
|
|
14327
14362
|
</layout>
|
|
14328
14363
|
</bibliography>
|
|
14329
14364
|
</style>
|
|
14330
|
-
`,
|
|
14365
|
+
`,DE=ME,zE=`<?xml version="1.0" encoding="utf-8"?>
|
|
14331
14366
|
<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="en-US">
|
|
14332
14367
|
<!-- The abbreviations in this file follow the recommendations of The Chicago Manual of Style, 18th ed. (2024), sec. 10.48 (cited hereafter as CMOS), unless stated otherwise. -->
|
|
14333
14368
|
<!-- Additional abbreviations are from:
|
|
@@ -15191,50 +15226,15 @@
|
|
|
15191
15226
|
<term name="season-04">Winter</term>
|
|
15192
15227
|
</terms>
|
|
15193
15228
|
</locale>
|
|
15194
|
-
`,
|
|
15195
|
-
`);return t===this.lastSignature?!1:(this.lastSignature=t,this.clusters=new Map(e.map(n=>[n.citationId,n.attrs])),this.order=e.map(n=>n.citationId),this.recompute(),this.emitChange(),!0)}renderCluster(e){return this.rendered.get(e)??""}getBibliography(){return this.bibliography}emitChange(){for(const e of this.listeners)e()}recompute(){const e=ca[this.style],t=new Fx.Engine({retrieveLocale:()=>_w,retrieveItem:a=>this.sources.get(a)},e.xml,"en-US"),n=new Map,i=[];let r=0;for(const a of this.order){const o=this.clusters.get(a);if(!(o!=null&&o.sourceId)||!this.sources.has(o.sourceId)){n.set(a,"");continue}r+=1;try{const[,l]=t.processCitationCluster({citationID:a,citationItems:[{id:o.sourceId,locator:o.locator||void 0,label:o.label||void 0,prefix:o.prefix||void 0,suffix:o.suffix||void 0,"suppress-author":o.mode==="suppress-author"||void 0,"author-only":o.mode==="author-only"||void 0}],properties:{noteIndex:e.category==="note"?r:0}},i,[]);i.push([a,r]);for(const[,c,u]of l??[])n.set(u,zu(c));n.has(a)||n.set(a,"")}catch{n.set(a,"")}}this.rendered=n;try{const a=t.makeBibliography();this.bibliography=a?a[1].map(o=>zu(o).trim()):[]}catch{this.bibliography=[]}}};function Iu(e){const t=e.storage.citation;return(t==null?void 0:t.engine)??null}var Ew=Se.create({name:"bibliography",group:"block",selectable:!0,draggable:!0,atom:!0,parseHTML(){return[{tag:'div[data-node-type="bibliography"]'}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-node-type":"bibliography",class:"docs-bibliography"})]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-bibliography",n.setAttribute("data-node-type","bibliography");const i=()=>{const o=Iu(t),l=(o==null?void 0:o.getBibliography())??[];if(n.innerHTML="",l.length===0){const f=document.createElement("p");f.className="docs-bibliography__empty",f.textContent="Bibliography",n.appendChild(f);return}const c=document.createElement("h2");c.className="docs-bibliography__heading",c.textContent="Bibliography",n.appendChild(c);const u=document.createElement("div");u.className="docs-bibliography__entries";for(const f of l){const m=document.createElement("p");m.className="docs-bibliography__entry",m.innerHTML=f,u.appendChild(m)}n.appendChild(u)};i();const r=Iu(t),a=r==null?void 0:r.onChange(i);return{dom:n,update(o){var l;return((l=o==null?void 0:o.type)==null?void 0:l.name)==="bibliography"},destroy(){a==null||a()}}}}});function Wp(e,t){const n=$p();return e.isNoteStyle()?{type:"footnote",attrs:{content:"",sourceId:t.sourceId,locator:t.locator??"",citationId:n}}:{type:"citation",attrs:{citationId:n,sourceId:t.sourceId,locator:t.locator??""}}}function Di(e){return e.storage.citation?e.storage.citation.engine??null:null}var Aw=je.create({name:"citation",addStorage(){return{engine:null}},onUpdate(){var r,a;const e=this.editor,t=Di(e);if(!t)return;{const o=new Set,l=[];if(e.state.doc.descendants((c,u)=>{if(c.type.name==="citation"||c.type.name==="footnote"&&c.attrs.sourceId){const f=c.attrs.citationId;f&&(o.has(f)?l.push({pos:u,attrs:{...c.attrs}}):o.add(f))}return!0}),l.length>0){const c=e.state.tr;for(const{pos:u,attrs:f}of l)c.setNodeMarkup(u,void 0,{...f,citationId:$p()});e.view.dispatch(c);return}}const n=[];if(e.state.doc.descendants((o,l)=>((o.type.name==="citation"||o.type.name==="footnote"&&o.attrs.sourceId)&&n.push({citationId:o.attrs.citationId??`anon-${l}`,attrs:{sourceId:o.attrs.sourceId??null,locator:o.attrs.locator||"",label:o.attrs.label||"page",mode:o.attrs.mode||"normal",prefix:o.attrs.prefix||"",suffix:o.attrs.suffix||""}}),!0)),t.syncCitations(n)){const o=e.storage.editorContext;(a=(r=o==null?void 0:o.citation)==null?void 0:r.onSourcesChange)==null||a.call(r,t.getCitedSourceIds())}}}),Tw=Se.create({name:"citation",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>({"data-citation-id":e.citationId})},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-citation-source-id"),renderHTML:e=>({"data-citation-source-id":e.sourceId})},locator:{default:"",parseHTML:e=>e.getAttribute("data-citation-locator")??"",renderHTML:e=>({"data-citation-locator":e.locator})},label:{default:"page",parseHTML:e=>e.getAttribute("data-citation-label")??"page",renderHTML:e=>({"data-citation-label":e.label})},mode:{default:"normal",parseHTML:e=>e.getAttribute("data-citation-mode")??"normal",renderHTML:e=>({"data-citation-mode":e.mode})},prefix:{default:""},suffix:{default:""}}},parseHTML(){return[{tag:'span[data-node-type="citation"]'}]},renderHTML({HTMLAttributes:e}){return["span",Be(e,{"data-node-type":"citation",class:"docs-citation"}),""]},addNodeView(){return e=>{const t=e.editor,n=e.node??e,i=document.createElement("span");i.className="docs-citation",i.setAttribute("data-node-type","citation");const r=()=>{const l=Di(t),c=n.attrs.citationId,u=l&&c?l.renderCluster(c):"";u?(i.innerHTML=u,i.classList.remove("docs-citation--missing")):(i.textContent="[?]",i.classList.add("docs-citation--missing")),i.setAttribute("data-citation-id",String(n.attrs.citationId??"")),i.setAttribute("data-citation-source-id",String(n.attrs.sourceId??""))};r();const a=Di(t),o=a==null?void 0:a.onChange(r);return{dom:i,update(l){var c;if(((c=l==null?void 0:l.type)==null?void 0:c.name)!=="citation")return!1;try{Object.assign(n.attrs,l.attrs),r()}catch{}return!0},destroy(){o==null||o()}}}}});function Ru(e,t,n){const i=Wp(t,n);return i.type==="footnote"&&!e.schema.nodes.footnote?!1:e.chain().focus().insertContent({type:i.type,attrs:i.attrs}).run()}_e.definePlugin({id:"citation",tiptapExtensions:[Aw,Tw,Ew],toolbar:[{id:"insert-citation",label:"Citation",action:"insertCitation",iconComponent:"Quote"}],slashCommands:[{name:"Citation",command:"insertCitation"},{name:"Bibliography",command:"insertBibliography"}],commands:{insertCitation:(e,...t)=>{var o;const n=Di(e);if(!n)return console.warn("[citation] no citation engine — inject the CitationPort to enable citations"),!1;const i=t[0];if(i!=null&&i.sourceId)return Ru(e,n,{sourceId:i.sourceId,locator:i.locator});const r=e.storage.editorContext,a=(o=r==null?void 0:r.citation)==null?void 0:o.onSourceRequest;return a?(a().then(l=>{l&&Ru(e,n,{sourceId:l})}),!0):!1},insertBibliography:e=>{let t=!1;return e.state.doc.descendants(n=>(n.type.name==="bibliography"&&(t=!0),!t)),t?!1:e.chain().focus().insertContent({type:"bibliography"}).run()},setCitationStyle:(e,...t)=>{const n=Di(e),i=t[0];return!n||!i?!1:(n.setStyle(i),!0)}},hooks:{onInit(e){const t=e.storage.editorContext,n=t==null?void 0:t.citation;if(!n)return;const i=typeof n.sources=="function"?n.sources():n.sources,r=new Cw({sources:i,style:n.style});e.storage.citation.engine=r},onDestroy(e){e.storage.citation.engine=null}}});const Nw=St.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Ow=Se.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Be(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Mw=/^\s*(\[([( |x])?\])\s$/,Dw=Se.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:i})=>{const r=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),u=()=>{var f,m;l.ariaLabel=((m=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||m===void 0?void 0:m.call(f,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return u(),a.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",f=>f.preventDefault()),l.addEventListener("change",f=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=f.target;i.isEditable&&typeof n=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g==null?void 0:g.attrs,checked:m}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,m])=>{r.setAttribute(f,m)}),r.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,a.append(l,o),r.append(a,c),Object.entries(t).forEach(([f,m])=>{r.setAttribute(f,m)}),{dom:r,contentDOM:c,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,l.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[dw({find:Mw,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),zw=je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Iw="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Rw="ελ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",Ys="numeric",el="ascii",tl="alpha",or="asciinumeric",tr="alphanumeric",nl="domain",Gp="emoji",Lw="scheme",Bw="slashscheme",ls="whitespace";function Pw(e,t){return e in t||(t[e]=[]),t[e]}function ni(e,t,n){t[Ys]&&(t[or]=!0,t[tr]=!0),t[el]&&(t[or]=!0,t[tl]=!0),t[or]&&(t[tr]=!0),t[tl]&&(t[tr]=!0),t[tr]&&(t[nl]=!0),t[Gp]&&(t[nl]=!0);for(const i in t){const r=Pw(i,n);r.indexOf(e)<0&&r.push(e)}}function Fw(e,t){const n={};for(const i in t)t[i].indexOf(e)>=0&&(n[i]=!0);return n}function _t(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}_t.groups={};_t.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let i=0;i<t.jr.length;i++){const r=t.jr[i][0],a=t.jr[i][1];if(a&&r.test(e))return a}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,i){for(let r=0;r<e.length;r++)this.tt(e[r],t,n,i)},tr(e,t,n,i){i=i||_t.groups;let r;return t&&t.j?r=t:(r=new _t(t),n&&i&&ni(t,n,i)),this.jr.push([e,r]),r},ts(e,t,n,i){let r=this;const a=e.length;if(!a)return r;for(let o=0;o<a-1;o++)r=r.tt(e[o]);return r.tt(e[a-1],t,n,i)},tt(e,t,n,i){i=i||_t.groups;const r=this;if(t&&t.j)return r.j[e]=t,t;const a=t;let o,l=r.go(e);if(l?(o=new _t,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new _t,a){if(i)if(o.t&&typeof o.t=="string"){const c=Object.assign(Fw(o.t,i),n);ni(a,c,i)}else n&&ni(a,n,i);o.t=a}return r.j[e]=o,o}};const xe=(e,t,n,i,r)=>e.ta(t,n,i,r),Ue=(e,t,n,i,r)=>e.tr(t,n,i,r),Lu=(e,t,n,i,r)=>e.ts(t,n,i,r),ee=(e,t,n,i,r)=>e.tt(t,n,i,r),mn="WORD",il="UWORD",Kp="ASCIINUMERICAL",Xp="ALPHANUMERICAL",kr="LOCALHOST",rl="TLD",al="UTLD",Sa="SCHEME",Ei="SLASH_SCHEME",ec="NUM",ol="WS",tc="NL",sr="OPENBRACE",lr="CLOSEBRACE",$a="OPENBRACKET",Wa="CLOSEBRACKET",Ga="OPENPAREN",Ka="CLOSEPAREN",Xa="OPENANGLEBRACKET",Ja="CLOSEANGLEBRACKET",Za="FULLWIDTHLEFTPAREN",Qa="FULLWIDTHRIGHTPAREN",Ya="LEFTCORNERBRACKET",eo="RIGHTCORNERBRACKET",to="LEFTWHITECORNERBRACKET",no="RIGHTWHITECORNERBRACKET",io="FULLWIDTHLESSTHAN",ro="FULLWIDTHGREATERTHAN",ao="AMPERSAND",oo="APOSTROPHE",so="ASTERISK",Nn="AT",lo="BACKSLASH",co="BACKTICK",uo="CARET",ii="COLON",nc="COMMA",fo="DOLLAR",Gt="DOT",po="EQUALS",ic="EXCLAMATION",Rt="HYPHEN",cr="PERCENT",mo="PIPE",ho="PLUS",bo="POUND",ur="QUERY",rc="QUOTE",Jp="FULLWIDTHMIDDLEDOT",ac="SEMI",Kt="SLASH",dr="TILDE",go="UNDERSCORE",Zp="EMOJI",vo="SYM";var Qp=Object.freeze({__proto__:null,ALPHANUMERICAL:Xp,AMPERSAND:ao,APOSTROPHE:oo,ASCIINUMERICAL:Kp,ASTERISK:so,AT:Nn,BACKSLASH:lo,BACKTICK:co,CARET:uo,CLOSEANGLEBRACKET:Ja,CLOSEBRACE:lr,CLOSEBRACKET:Wa,CLOSEPAREN:Ka,COLON:ii,COMMA:nc,DOLLAR:fo,DOT:Gt,EMOJI:Zp,EQUALS:po,EXCLAMATION:ic,FULLWIDTHGREATERTHAN:ro,FULLWIDTHLEFTPAREN:Za,FULLWIDTHLESSTHAN:io,FULLWIDTHMIDDLEDOT:Jp,FULLWIDTHRIGHTPAREN:Qa,HYPHEN:Rt,LEFTCORNERBRACKET:Ya,LEFTWHITECORNERBRACKET:to,LOCALHOST:kr,NL:tc,NUM:ec,OPENANGLEBRACKET:Xa,OPENBRACE:sr,OPENBRACKET:$a,OPENPAREN:Ga,PERCENT:cr,PIPE:mo,PLUS:ho,POUND:bo,QUERY:ur,QUOTE:rc,RIGHTCORNERBRACKET:eo,RIGHTWHITECORNERBRACKET:no,SCHEME:Sa,SEMI:ac,SLASH:Kt,SLASH_SCHEME:Ei,SYM:vo,TILDE:dr,TLD:rl,UNDERSCORE:go,UTLD:al,UWORD:il,WORD:mn,WS:ol});const fn=/[a-z]/,Xi=new RegExp("\\p{L}","u"),cs=new RegExp("\\p{Emoji}","u"),pn=/\d/,us=/\s/,Bu="\r",ds=`
|
|
15196
|
-
`,Vw="️",Uw="",fs="";let ua=null,da=null;function Hw(e=[]){const t={};_t.groups=t;const n=new _t;ua==null&&(ua=Pu(Iw)),da==null&&(da=Pu(Rw)),ee(n,"'",oo),ee(n,"{",sr),ee(n,"}",lr),ee(n,"[",$a),ee(n,"]",Wa),ee(n,"(",Ga),ee(n,")",Ka),ee(n,"<",Xa),ee(n,">",Ja),ee(n,"(",Za),ee(n,")",Qa),ee(n,"「",Ya),ee(n,"」",eo),ee(n,"『",to),ee(n,"』",no),ee(n,"<",io),ee(n,">",ro),ee(n,"&",ao),ee(n,"*",so),ee(n,"@",Nn),ee(n,"`",co),ee(n,"^",uo),ee(n,":",ii),ee(n,",",nc),ee(n,"$",fo),ee(n,".",Gt),ee(n,"=",po),ee(n,"!",ic),ee(n,"-",Rt),ee(n,"%",cr),ee(n,"|",mo),ee(n,"+",ho),ee(n,"#",bo),ee(n,"?",ur),ee(n,'"',rc),ee(n,"/",Kt),ee(n,";",ac),ee(n,"~",dr),ee(n,"_",go),ee(n,"\\",lo),ee(n,"・",Jp);const i=Ue(n,pn,ec,{[Ys]:!0});Ue(i,pn,i);const r=Ue(i,fn,Kp,{[or]:!0}),a=Ue(i,Xi,Xp,{[tr]:!0}),o=Ue(n,fn,mn,{[el]:!0});Ue(o,pn,r),Ue(o,fn,o),Ue(r,pn,r),Ue(r,fn,r);const l=Ue(n,Xi,il,{[tl]:!0});Ue(l,fn),Ue(l,pn,a),Ue(l,Xi,l),Ue(a,pn,a),Ue(a,fn),Ue(a,Xi,a);const c=ee(n,ds,tc,{[ls]:!0}),u=ee(n,Bu,ol,{[ls]:!0}),f=Ue(n,us,ol,{[ls]:!0});ee(n,fs,f),ee(u,ds,c),ee(u,fs,f),Ue(u,us,f),ee(f,Bu),ee(f,ds),Ue(f,us,f),ee(f,fs,f);const m=Ue(n,cs,Zp,{[Gp]:!0});ee(m,"#"),Ue(m,cs,m),ee(m,Vw,m);const p=ee(m,Uw);ee(p,"#"),Ue(p,cs,m);const h=[[fn,o],[pn,r]],g=[[fn,null],[Xi,l],[pn,a]];for(let b=0;b<ua.length;b++)An(n,ua[b],rl,mn,h);for(let b=0;b<da.length;b++)An(n,da[b],al,il,g);ni(rl,{tld:!0,ascii:!0},t),ni(al,{utld:!0,alpha:!0},t),An(n,"file",Sa,mn,h),An(n,"mailto",Sa,mn,h),An(n,"http",Ei,mn,h),An(n,"https",Ei,mn,h),An(n,"ftp",Ei,mn,h),An(n,"ftps",Ei,mn,h),ni(Sa,{scheme:!0,ascii:!0},t),ni(Ei,{slashscheme:!0,ascii:!0},t),e=e.sort((b,x)=>b[0]>x[0]?1:-1);for(let b=0;b<e.length;b++){const x=e[b][0],y=e[b][1]?{[Lw]:!0}:{[Bw]:!0};x.indexOf("-")>=0?y[nl]=!0:fn.test(x)?pn.test(x)?y[or]=!0:y[el]=!0:y[Ys]=!0,Lu(n,x,x,y)}return Lu(n,"localhost",kr,{ascii:!0}),n.jd=new _t(vo),{start:n,tokens:Object.assign({groups:t},Qp)}}function Yp(e,t){const n=qw(t.replace(/[A-Z]/g,l=>l.toLowerCase())),i=n.length,r=[];let a=0,o=0;for(;o<i;){let l=e,c=null,u=0,f=null,m=-1,p=-1;for(;o<i&&(c=l.go(n[o]));)l=c,l.accepts()?(m=0,p=0,f=l):m>=0&&(m+=n[o].length,p++),u+=n[o].length,a+=n[o].length,o++;a-=m,o-=p,u-=m,r.push({t:f.t,v:t.slice(a-u,a),s:a-u,e:a})}return r}function qw(e){const t=[],n=e.length;let i=0;for(;i<n;){let r=e.charCodeAt(i),a,o=r<55296||r>56319||i+1===n||(a=e.charCodeAt(i+1))<56320||a>57343?e[i]:e.slice(i,i+2);t.push(o),i+=o.length}return t}function An(e,t,n,i,r){let a;const o=t.length;for(let l=0;l<o-1;l++){const c=t[l];e.j[c]?a=e.j[c]:(a=new _t(i),a.jr=r.slice(),e.j[c]=a),e=a}return a=new _t(n),a.jr=r.slice(),e.j[t[o-1]]=a,a}function Pu(e){const t=[],n=[];let i=0,r="0123456789";for(;i<e.length;){let a=0;for(;r.indexOf(e[i+a])>=0;)a++;if(a>0){t.push(n.join(""));for(let o=parseInt(e.substring(i,i+a),10);o>0;o--)n.pop();i+=a}else n.push(e[i]),i++}return t}const wr={defaultProtocol:"http",events:null,format:Fu,formatHref:Fu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oc(e,t=null){let n=Object.assign({},wr);e&&(n=Object.assign(n,e instanceof oc?e.o:e));const i=n.ignoreTags,r=[];for(let a=0;a<i.length;a++)r.push(i[a].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=r}oc.prototype={o:wr,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const i=t!=null;let r=this.o[e];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:wr[e],typeof r=="function"&&i&&(r=r(t,n))):typeof r=="function"&&i&&(r=r(t,n.t,n)),r)},getObj(e,t,n){let i=this.o[e];return typeof i=="function"&&t!=null&&(i=i(t,n.t,n)),i},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function Fu(e){return e}function em(e,t){this.t="token",this.v=e,this.tk=t}em.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),i=e.get("format",t,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=wr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),i=e.get("formatHref",n,this),r=e.get("tagName",n,t),a=this.toFormattedString(e),o={},l=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),m=e.getObj("events",n,t);return o.href=i,l&&(o.class=l),c&&(o.target=c),u&&(o.rel=u),f&&Object.assign(o,f),{tagName:r,attributes:o,content:a,eventListeners:m}}};function Mo(e,t){class n extends em{constructor(r,a){super(r,a),this.t=e}}for(const i in t)n.prototype[i]=t[i];return n.t=e,n}const jw=Mo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Vu=Mo("text"),$w=Mo("nl"),fa=Mo("url",{isLink:!0,toHref(e=wr.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==kr&&e[1].t===ii}}),It=e=>new _t(e);function Ww({groups:e}){const t=e.domain.concat([ao,so,Nn,lo,co,uo,fo,po,Rt,ec,cr,mo,ho,bo,Kt,vo,dr,go]),n=[oo,ii,nc,Gt,ic,cr,ur,rc,ac,Xa,Ja,sr,lr,Wa,$a,Ga,Ka,Za,Qa,Ya,eo,to,no,io,ro],i=[ao,oo,so,lo,co,uo,fo,po,Rt,sr,lr,cr,mo,ho,bo,ur,Kt,vo,dr,go],r=It(),a=ee(r,dr);xe(a,i,a),xe(a,e.domain,a);const o=It(),l=It(),c=It();xe(r,e.domain,o),xe(r,e.scheme,l),xe(r,e.slashscheme,c),xe(o,i,a),xe(o,e.domain,o);const u=ee(o,Nn);ee(a,Nn,u),ee(l,Nn,u),ee(c,Nn,u);const f=ee(a,Gt);xe(f,i,a),xe(f,e.domain,a);const m=It();xe(u,e.domain,m),xe(m,e.domain,m);const p=ee(m,Gt);xe(p,e.domain,m);const h=It(jw);xe(p,e.tld,h),xe(p,e.utld,h),ee(u,kr,h);const g=ee(m,Rt);ee(g,Rt,g),xe(g,e.domain,m),xe(h,e.domain,m),ee(h,Gt,p),ee(h,Rt,g);const b=ee(o,Rt),x=ee(o,Gt);ee(b,Rt,b),xe(b,e.domain,o),xe(x,i,a),xe(x,e.domain,o);const v=It(fa);xe(x,e.tld,v),xe(x,e.utld,v),xe(v,e.domain,o),xe(v,i,a),ee(v,Gt,x),ee(v,Rt,b),ee(v,Nn,u);const y=ee(v,ii),k=It(fa);xe(y,e.numeric,k);const w=It(fa),S=It();xe(w,t,w),xe(w,n,S),xe(S,t,w),xe(S,n,S),ee(v,Kt,w),ee(k,Kt,w);const E=ee(l,ii),D=ee(c,ii),_=ee(D,Kt),C=ee(_,Kt);xe(l,e.domain,o),ee(l,Gt,x),ee(l,Rt,b),xe(c,e.domain,o),ee(c,Gt,x),ee(c,Rt,b),xe(E,e.domain,w),ee(E,Kt,w),ee(E,ur,w),xe(C,e.domain,w),xe(C,t,w),ee(C,Kt,w);const N=[[sr,lr],[$a,Wa],[Ga,Ka],[Xa,Ja],[Za,Qa],[Ya,eo],[to,no],[io,ro]];for(let I=0;I<N.length;I++){const[H,F]=N[I],M=ee(w,H);ee(S,H,M);const j=It(fa);xe(M,t,j);const P=It();xe(M,n,P),ee(M,F,w),xe(j,t,j),xe(j,n,P),xe(P,t,j),xe(P,n,P),ee(j,F,w),ee(P,F,w)}return ee(r,kr,v),ee(r,tc,$w),{start:r,tokens:Qp}}function Gw(e,t,n){let i=n.length,r=0,a=[],o=[];for(;r<i;){let l=e,c=null,u=null,f=0,m=null,p=-1;for(;r<i&&!(c=l.go(n[r].t));)o.push(n[r++]);for(;r<i&&(u=c||l.go(n[r].t));)c=null,l=u,l.accepts()?(p=0,m=l):p>=0&&p++,r++,f++;if(p<0)r-=f,r<i&&(o.push(n[r]),r++);else{o.length>0&&(a.push(ps(Vu,t,o)),o=[]),r-=p,f-=p;const h=m.t,g=n.slice(r-f,r);a.push(ps(h,t,g))}}return o.length>0&&a.push(ps(Vu,t,o)),a}function ps(e,t,n){const i=n[0].s,r=n[n.length-1].e,a=t.slice(i,r);return new e(a,n)}const Kw=typeof console<"u"&&console&&console.warn||(()=>{}),Xw="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Pe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Jw(){return _t.groups={},Pe.scanner=null,Pe.parser=null,Pe.tokenQueue=[],Pe.pluginQueue=[],Pe.customSchemes=[],Pe.initialized=!1,Pe}function Uu(e,t=!1){if(Pe.initialized&&Kw(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Xw}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
15197
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
15198
|
-
2. Cannot start or end with "-"
|
|
15199
|
-
3. "-" cannot repeat`);Pe.customSchemes.push([e,t])}function Zw(){Pe.scanner=Hw(Pe.customSchemes);for(let e=0;e<Pe.tokenQueue.length;e++)Pe.tokenQueue[e][1]({scanner:Pe.scanner});Pe.parser=Ww(Pe.scanner.tokens);for(let e=0;e<Pe.pluginQueue.length;e++)Pe.pluginQueue[e][1]({scanner:Pe.scanner,parser:Pe.parser});return Pe.initialized=!0,Pe}function sc(e){return Pe.initialized||Zw(),Gw(Pe.parser.start,e,Yp(Pe.scanner.start,e))}sc.scan=Yp;function tm(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const i=new oc(n),r=sc(e),a=[];for(let o=0;o<r.length;o++){const l=r[o];l.isLink&&(!t||l.t===t)&&i.check(l)&&a.push(l.toFormattedObject(i))}return a}const lc="[\0- -\u2029 ]",Qw=new RegExp(lc),Yw=new RegExp(`${lc}$`),e_=new RegExp(lc,"g");function t_(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function n_(e){return new dt({key:new at("autolink"),appendTransaction:(t,n,i)=>{const r=t.some(u=>u.docChanged)&&!n.doc.eq(i.doc),a=t.some(u=>u.getMeta("preventAutolink"));if(!r||a)return;const{tr:o}=i,l=E2(n.doc,[...t]);if(z2(l).forEach(({newRange:u})=>{const f=T2(i.doc,u,h=>h.isTextblock);let m,p;if(f.length>1)m=f[0],p=i.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(f.length){const h=i.doc.textBetween(u.from,u.to," "," ");if(!Yw.test(h))return;m=f[0],p=i.doc.textBetween(m.pos,u.to,void 0," ")}if(m&&p){const h=p.split(Qw).filter(Boolean);if(h.length<=0)return!1;const g=h[h.length-1],b=m.pos+p.lastIndexOf(g);if(!g)return!1;const x=sc(g).map(v=>v.toObject(e.defaultProtocol));if(!t_(x))return!1;x.filter(v=>v.isLink).map(v=>({...v,from:b+v.start+1,to:b+v.end+1})).filter(v=>i.schema.marks.code?!i.doc.rangeHasMark(v.from,v.to,i.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{Ql(v.from,v.to,i.doc).some(y=>y.mark.type===e.type)||o.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function i_(e){return new dt({key:new at("handleClickLink"),props:{handleClick:(t,n,i)=>{var r,a;if(i.button!==0||!t.editable)return!1;let o=i.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;const c=O2(t.state,e.type.name),u=i.target,f=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:c.href,m=(a=u==null?void 0:u.target)!==null&&a!==void 0?a:c.target;return u&&f?(window.open(f,m),!0):!1}}})}function r_(e){return new dt({key:new at("handlePasteLink"),props:{handlePaste:(t,n,i)=>{const{state:r}=t,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";i.content.forEach(u=>{l+=u.textContent});const c=tm(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function Zn(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!e||e.replace(e_,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const a_=St.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(e=>{if(typeof e=="string"){Uu(e);return}Uu(e.scheme,e.optionalSlashes)})},onDestroy(){Jw()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Zn(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.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:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Zn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Zn(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Be(this.options.HTMLAttributes,e),0]:["a",Be(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Zn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Zn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[jp({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:i}=this.options,r=tm(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!Zn(o,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(a=>t.push({text:a.value,data:{href:a.href},index:a.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(n_({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!Zn(r,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(i_({type:this.type})),this.options.linkOnPaste&&e.push(r_({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),o_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,s_=Se.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Be(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[uw({find:o_,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});let sl,ll;if(typeof WeakMap<"u"){let e=new WeakMap;sl=t=>e.get(t),ll=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;sl=i=>{for(let r=0;r<e.length;r+=2)if(e[r]==i)return e[r+1]},ll=(i,r)=>(n==10&&(n=0),e[n++]=i,e[n++]=r)}var He=class{constructor(e,t,n,i){this.width=e,this.height=t,this.map=n,this.problems=i}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const i=t%this.width,r=t/this.width|0;let a=i+1,o=r+1;for(let l=1;a<this.width&&this.map[t+l]==n;l++)a++;for(let l=1;o<this.height&&this.map[t+this.width*l]==n;l++)o++;return{left:i,top:r,right:a,bottom:o}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:i,right:r,top:a,bottom:o}=this.findCell(e);return t=="horiz"?(n<0?i==0:r==this.width)?null:this.map[a*this.width+(n<0?i-1:r)]:(n<0?a==0:o==this.height)?null:this.map[i+this.width*(n<0?a-1:o)]}rectBetween(e,t){const{left:n,right:i,top:r,bottom:a}=this.findCell(e),{left:o,right:l,top:c,bottom:u}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(i,l),bottom:Math.max(a,u)}}cellsInRect(e){const t=[],n={};for(let i=e.top;i<e.bottom;i++)for(let r=e.left;r<e.right;r++){const a=i*this.width+r,o=this.map[a];n[o]||(n[o]=!0,!(r==e.left&&r&&this.map[a-1]==o||i==e.top&&i&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let i=0,r=0;;i++){const a=r+n.child(i).nodeSize;if(i==e){let o=t+e*this.width;const l=(e+1)*this.width;for(;o<l&&this.map[o]<r;)o++;return o==l?a-1:this.map[o]}r=a}}static get(e){return sl(e)||ll(e,l_(e))}};function l_(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=c_(e),n=e.childCount,i=[];let r=0,a=null;const o=[];for(let u=0,f=t*n;u<f;u++)i[u]=0;for(let u=0,f=0;u<n;u++){const m=e.child(u);f++;for(let g=0;;g++){for(;r<i.length&&i[r]!=0;)r++;if(g==m.childCount)break;const b=m.child(g),{colspan:x,rowspan:v,colwidth:y}=b.attrs;for(let k=0;k<v;k++){if(k+u>=n){(a||(a=[])).push({type:"overlong_rowspan",pos:f,n:v-k});break}const w=r+k*t;for(let S=0;S<x;S++){i[w+S]==0?i[w+S]=f:(a||(a=[])).push({type:"collision",row:u,pos:f,n:x-S});const E=y&&y[S];if(E){const D=(w+S)%t*2,_=o[D];_==null||_!=E&&o[D+1]==1?(o[D]=E,o[D+1]=1):_==E&&o[D+1]++}}}r+=x,f+=b.nodeSize}const p=(u+1)*t;let h=0;for(;r<p;)i[r++]==0&&h++;h&&(a||(a=[])).push({type:"missing",row:u,n:h}),f++}(t===0||n===0)&&(a||(a=[])).push({type:"zero_sized"});const l=new He(t,n,i,a);let c=!1;for(let u=0;!c&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(c=!0);return c&&u_(l,o,e),l}function c_(e){let t=-1,n=!1;for(let i=0;i<e.childCount;i++){const r=e.child(i);let a=0;if(n)for(let o=0;o<i;o++){const l=e.child(o);for(let c=0;c<l.childCount;c++){const u=l.child(c);o+u.attrs.rowspan>i&&(a+=u.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const l=r.child(o);a+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function u_(e,t,n){e.problems||(e.problems=[]);const i={};for(let r=0;r<e.map.length;r++){const a=e.map[r];if(i[a])continue;i[a]=!0;const o=n.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let l=null;const c=o.attrs;for(let u=0;u<c.colspan;u++){const f=t[(r+u)%e.width*2];f!=null&&(!c.colwidth||c.colwidth[u]!=f)&&((l||(l=d_(c)))[u]=f)}l&&e.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:l})}}function d_(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function lt(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const i=e.nodes[n],r=i.spec.tableRole;r&&(t[r]=i)}}return t}const Mn=new at("selectingCells");function di(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function f_(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function $t(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Do(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=di(t.$head)||p_(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function p_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function cl(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function m_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function cc(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function nm(e,t,n){const i=e.node(-1),r=He.get(i),a=e.start(-1),o=r.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function fi(e,t,n=1){const i={...e,colspan:e.colspan-n};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(t,n),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function im(e,t,n=1){const i={...e,colspan:e.colspan+n};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<n;r++)i.colwidth.splice(t,0,0)}return i}function h_(e,t,n){const i=lt(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=i)return!1;return!0}var Le=class hn extends ge{constructor(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=r.cellsInRect(o).filter(f=>f!=n.pos-a);c.unshift(n.pos-a);const u=c.map(f=>{const m=i.nodeAt(f);if(!m)throw new RangeError(`No cell with offset ${f} found`);const p=a+f+1;return new Gf(l.resolve(p),l.resolve(p+m.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){const i=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(cl(i)&&cl(r)&&cc(i,r)){const a=this.$anchorCell.node(-1)!=i.node(-1);return a&&this.isRowSelection()?hn.rowSelection(i,r):a&&this.isColSelection()?hn.colSelection(i,r):new hn(i,r)}return he.between(i,r)}content(){const t=this.$anchorCell.node(-1),n=He.get(t),i=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),a={},o=[];for(let c=r.top;c<r.bottom;c++){const u=[];for(let f=c*n.width+r.left,m=r.left;m<r.right;m++,f++){const p=n.map[f];if(a[p])continue;a[p]=!0;const h=n.findCell(p);let g=t.nodeAt(p);if(!g)throw new RangeError(`No cell with offset ${p} found`);const b=r.left-h.left,x=h.right-r.right;if(b>0||x>0){let v=g.attrs;if(b>0&&(v=fi(v,0,b)),x>0&&(v=fi(v,v.colspan-x,x)),h.left<r.left){if(g=g.type.createAndFill(v),!g)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else g=g.type.create(v,g.content)}if(h.top<r.top||h.bottom>r.bottom){const v={...g.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?g=g.type.createAndFill(v):g=g.type.create(v,g.content)}u.push(g)}o.push(t.child(c).copy(J.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?t:o;return new ae(J.from(l),1,1)}replace(t,n=ae.empty){const i=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:l,$to:c}=r[o],u=t.mapping.slice(i);t.replace(u.map(l.pos),u.map(c.pos),o?ae.empty:n)}const a=ge.findFrom(t.doc.resolve(t.mapping.slice(i).map(this.to)),-1);a&&t.setSelection(a)}replaceWith(t,n){this.replace(t,new ae(J.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),i=He.get(n),r=this.$anchorCell.start(-1),a=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<a.length;o++)t(n.nodeAt(a[o]),r+a[o])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const i=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.top<=l.top?(o.top>0&&(t=c.resolve(a+r.map[o.left])),l.bottom<r.height&&(n=c.resolve(a+r.map[r.width*(r.height-1)+l.right-1]))):(l.top>0&&(n=c.resolve(a+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(a+r.map[r.width*(r.height-1)+o.right-1]))),new hn(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=He.get(t),i=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-i),a=n.colCount(this.$headCell.pos-i);if(Math.min(r,a)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,l=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(t){return t instanceof hn&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const i=t.node(-1),r=He.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.left<=l.left?(o.left>0&&(t=c.resolve(a+r.map[o.top*r.width])),l.right<r.width&&(n=c.resolve(a+r.map[r.width*(l.top+1)-1]))):(l.left>0&&(n=c.resolve(a+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(a+r.map[r.width*(o.top+1)-1]))),new hn(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new hn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){return new hn(t.resolve(n),t.resolve(i))}getBookmark(){return new b_(this.$anchorCell.pos,this.$headCell.pos)}};Le.prototype.visible=!1;ge.jsonID("cell",Le);var b_=class rm{constructor(t,n){this.anchor=t,this.head=n}map(t){return new rm(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),i=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&cc(n,i)?new Le(n,i):ge.near(i,1)}};function g_(e){if(!(e.selection instanceof Le))return null;const t=[];return e.selection.forEachCell((n,i)=>{t.push(ot.node(i,i+n.nodeSize,{class:"selectedCell"}))}),Ve.create(e.doc,t)}function v_({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,i=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let a=t.depth;a>=0&&!(t.before(a+1)>t.start(a));a--,i--);return n==i&&/row|table/.test(e.node(r).type.spec.tableRole)}function x_({$from:e,$to:t}){let n,i;for(let r=e.depth;r>0;r--){const a=e.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}for(let r=t.depth;r>0;r--){const a=t.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){i=a;break}}return n!==i&&t.parentOffset===0}function y_(e,t,n){const i=(t||e).selection,r=(t||e).doc;let a,o;if(i instanceof pe&&(o=i.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=Le.create(r,i.from);else if(o=="row"){const l=r.resolve(i.from+1);a=Le.rowSelection(l,l)}else if(!n){const l=He.get(i.node),c=i.from+1,u=c+l.map[l.width*l.height-1];a=Le.create(r,c+1,u)}}else i instanceof he&&v_(i)?a=he.create(r,i.from):i instanceof he&&x_(i)&&(a=he.create(r,i.$from.start(),i.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}const k_=new at("fix-tables");function am(e,t,n,i){const r=e.childCount,a=t.childCount;e:for(let o=0,l=0;o<a;o++){const c=t.child(o);for(let u=l,f=Math.min(r,o+3);u<f;u++)if(e.child(u)==c){l=u+1,n+=c.nodeSize;continue e}i(c,n),l<r&&e.child(l).sameMarkup(c)?am(e.child(l),c,n+1,i):c.nodesBetween(0,c.content.size,i,n+1),n+=c.nodeSize}}function om(e,t){let n;const i=(r,a)=>{r.type.spec.tableRole=="table"&&(n=w_(e,r,a,n))};return t?t.doc!=e.doc&&am(t.doc,e.doc,0,i):e.doc.descendants(i),n}function w_(e,t,n,i){const r=He.get(t);if(!r.problems)return i;i||(i=e.tr);const a=[];for(let c=0;c<r.height;c++)a.push(0);for(let c=0;c<r.problems.length;c++){const u=r.problems[c];if(u.type=="collision"){const f=t.nodeAt(u.pos);if(!f)continue;const m=f.attrs;for(let p=0;p<m.rowspan;p++)a[u.row+p]+=u.n;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,fi(m,m.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const f=i.mapping.map(n);i.delete(f,f+t.nodeSize)}}let o,l;for(let c=0;c<a.length;c++)a[c]&&(o==null&&(o=c),l=c);for(let c=0,u=n+1;c<r.height;c++){const f=t.child(c),m=u+f.nodeSize,p=a[c];if(p>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);const g=[];for(let x=0;x<p;x++){const v=lt(e.schema)[h].createAndFill();v&&g.push(v)}const b=(c==0||o==c-1)&&l==c?u+1:m-1;i.insert(i.mapping.map(b),g)}u=m}return i.setMeta(k_,{fixTables:!0})}function en(e){const t=e.selection,n=Do(e),i=n.node(-1),r=n.start(-1),a=He.get(i);return{...t instanceof Le?a.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):a.findCell(n.pos-r),tableStart:r,map:a,table:i}}function sm(e,{map:t,tableStart:n,table:i},r){let a=r>0?-1:0;h_(t,i,r+a)&&(a=r==0||r==t.width?null:0);for(let o=0;o<t.height;o++){const l=o*t.width+r;if(r>0&&r<t.width&&t.map[l-1]==t.map[l]){const c=t.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(n+c),null,im(u.attrs,r-t.colCount(c))),o+=u.attrs.rowspan-1}else{const c=a==null?lt(i.type.schema).cell:i.nodeAt(t.map[l+a]).type,u=t.positionAt(o,r,i);e.insert(e.mapping.map(n+u),c.createAndFill())}}return e}function __(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(sm(e.tr,n,n.left))}return!0}function S_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(sm(e.tr,n,n.right))}return!0}function C_(e,{map:t,table:n,tableStart:i},r){const a=e.mapping.maps.length;for(let o=0;o<t.height;){const l=o*t.width+r,c=t.map[l],u=n.nodeAt(c),f=u.attrs;if(r>0&&t.map[l-1]==c||r<t.width-1&&t.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,fi(f,r-t.colCount(c)));else{const m=e.mapping.slice(a).map(i+c);e.delete(m,m+u.nodeSize)}o+=f.rowspan}}function E_(e,t){if(!$t(e))return!1;if(t){const n=en(e),i=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;C_(i,n,r),r!=n.left;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=He.get(a)}t(i)}return!0}function A_(e,t,n){var i;const r=lt(t.type.schema).header_cell;for(let a=0;a<e.width;a++)if(((i=t.nodeAt(e.map[a+n*e.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function lm(e,{map:t,tableStart:n,table:i},r){let a=n;for(let u=0;u<r;u++)a+=i.child(u).nodeSize;const o=[];let l=r>0?-1:0;A_(t,i,r+l)&&(l=r==0||r==t.height?null:0);for(let u=0,f=t.width*r;u<t.width;u++,f++)if(r>0&&r<t.height&&t.map[f]==t.map[f-t.width]){const m=t.map[f],p=i.nodeAt(m).attrs;e.setNodeMarkup(n+m,null,{...p,rowspan:p.rowspan+1}),u+=p.colspan-1}else{var c;const m=l==null?lt(i.type.schema).cell:(c=i.nodeAt(t.map[f+l*t.width]))===null||c===void 0?void 0:c.type,p=m==null?void 0:m.createAndFill();p&&o.push(p)}return e.insert(a,lt(i.type.schema).row.create(null,o)),e}function T_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(lm(e.tr,n,n.top))}return!0}function N_(e,t){if(!$t(e))return!1;if(t){const n=en(e);t(lm(e.tr,n,n.bottom))}return!0}function O_(e,{map:t,table:n,tableStart:i},r){let a=0;for(let u=0;u<r;u++)a+=n.child(u).nodeSize;const o=a+n.child(r).nodeSize,l=e.mapping.maps.length;e.delete(a+i,o+i);const c=new Set;for(let u=0,f=r*t.width;u<t.width;u++,f++){const m=t.map[f];if(!c.has(m)){if(c.add(m),r>0&&m==t.map[f-t.width]){const p=n.nodeAt(m).attrs;e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p,rowspan:p.rowspan-1}),u+=p.colspan-1}else if(r<t.height&&m==t.map[f+t.width]){const p=n.nodeAt(m),h=p.attrs,g=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),b=t.positionAt(r+1,u,n);e.insert(e.mapping.slice(l).map(i+b),g),u+=h.colspan-1}}}}function M_(e,t){if(!$t(e))return!1;if(t){const n=en(e),i=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;O_(i,n,r),r!=n.top;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=He.get(n.table)}t(i)}return!0}function Hu(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function D_({width:e,height:t,map:n},i){let r=i.top*e+i.left,a=r,o=(i.bottom-1)*e+i.left,l=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&n[a]==n[a-1]||i.right<e&&n[l]==n[l+1])return!0;a+=e,l+=e}for(let c=i.left;c<i.right;c++){if(i.top>0&&n[r]==n[r-e]||i.bottom<t&&n[o]==n[o+e])return!0;r++,o++}return!1}function qu(e,t){const n=e.selection;if(!(n instanceof Le)||n.$anchorCell.pos==n.$headCell.pos)return!1;const i=en(e),{map:r}=i;if(D_(r,i))return!1;if(t){const a=e.tr,o={};let l=J.empty,c,u;for(let f=i.top;f<i.bottom;f++)for(let m=i.left;m<i.right;m++){const p=r.map[f*r.width+m],h=i.table.nodeAt(p);if(!(o[p]||!h))if(o[p]=!0,c==null)c=p,u=h;else{Hu(h)||(l=l.append(h.content));const g=a.mapping.map(p+i.tableStart);a.delete(g,g+h.nodeSize)}}if(c==null||u==null)return!0;if(a.setNodeMarkup(c+i.tableStart,null,{...im(u.attrs,u.attrs.colspan,i.right-i.left-u.attrs.colspan),rowspan:i.bottom-i.top}),l.size>0){const f=c+1+u.content.size,m=Hu(u)?c+1:f;a.replaceWith(m+i.tableStart,f+i.tableStart,l)}a.setSelection(new Le(a.doc.resolve(c+i.tableStart))),t(a)}return!0}function ju(e,t){const n=lt(e.schema);return z_(({node:i})=>n[i.type.spec.tableRole])(e,t)}function z_(e){return(t,n)=>{const i=t.selection;let r,a;if(i instanceof Le){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{var o;if(r=f_(i.$from),!r)return!1;a=(o=di(i.$from))===null||o===void 0?void 0:o.pos}if(r==null||a==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(n){let l=r.attrs;const c=[],u=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=en(t),m=t.tr;for(let h=0;h<f.right-f.left;h++)c.push(u?{...l,colwidth:u&&u[h]?[u[h]]:null}:l);let p;for(let h=f.top;h<f.bottom;h++){let g=f.map.positionAt(h,f.left,f.table);h==f.top&&(g+=r.nodeSize);for(let b=f.left,x=0;b<f.right;b++,x++)b==f.left&&h==f.top||m.insert(p=m.mapping.map(g+f.tableStart,1),e({node:r,row:h,col:b}).createAndFill(c[x]))}m.setNodeMarkup(a,e({node:r,row:f.top,col:f.left}),c[0]),i instanceof Le&&m.setSelection(new Le(m.doc.resolve(i.$anchorCell.pos),p?m.doc.resolve(p):void 0)),n(m)}return!0}}function I_(e,t){return function(n,i){if(!$t(n))return!1;const r=Do(n);if(r.nodeAfter.attrs[e]===t)return!1;if(i){const a=n.tr;n.selection instanceof Le?n.selection.forEachCell((o,l)=>{o.attrs[e]!==t&&a.setNodeMarkup(l,null,{...o.attrs,[e]:t})}):a.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),i(a)}return!0}}function R_(e){return function(t,n){if(!$t(t))return!1;if(n){const i=lt(t.schema),r=en(t),a=t.tr,o=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),l=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)l[c].type==i.header_cell&&a.setNodeMarkup(r.tableStart+o[c],i.cell,l[c].attrs);if(a.steps.length===0)for(let c=0;c<o.length;c++)a.setNodeMarkup(r.tableStart+o[c],i.header_cell,l[c].attrs);n(a)}return!0}}function $u(e,t,n){const i=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<i.length;r++){const a=t.table.nodeAt(i[r]);if(a&&a.type!==n.header_cell)return!1}return!0}function _r(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?R_(e):function(n,i){if(!$t(n))return!1;if(i){const r=lt(n.schema),a=en(n),o=n.tr,l=$u("row",a,r),c=$u("column",a,r),u=(e==="column"?l:e==="row"&&c)?1:0,f=e=="column"?{left:0,top:u,right:1,bottom:a.map.height}:e=="row"?{left:u,top:0,right:a.map.width,bottom:1}:a,m=e=="column"?c?r.cell:r.header_cell:e=="row"?l?r.cell:r.header_cell:r.cell;a.map.cellsInRect(f).forEach(p=>{const h=p+a.tableStart,g=o.doc.nodeAt(h);g&&o.setNodeMarkup(h,m,g.attrs)}),i(o)}return!0}}_r("row",{useDeprecatedLogic:!0});_r("column",{useDeprecatedLogic:!0});const L_=_r("cell",{useDeprecatedLogic:!0});function B_(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let i=e.index(-1)-1,r=e.before();i>=0;i--){const a=e.node(-1).child(i),o=a.lastChild;if(o)return r-1-o.nodeSize;r-=a.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let i=e.indexAfter(-1),r=e.after();i<n.childCount;i++){const a=n.child(i);if(a.childCount)return r+1;r+=a.nodeSize}}return null}function Wu(e){return function(t,n){if(!$t(t))return!1;const i=B_(Do(t),e);if(i==null)return!1;if(n){const r=t.doc.resolve(i);n(t.tr.setSelection(he.between(r,m_(r))).scrollIntoView())}return!0}}function P_(e,t){const n=e.selection.$anchor;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(i),n.after(i)).scrollIntoView()),!0;return!1}function pa(e,t){const n=e.selection;if(!(n instanceof Le))return!1;if(t){const i=e.tr,r=lt(e.schema).cell.createAndFill().content;n.forEachCell((a,o)=>{a.content.eq(r)||i.replace(i.mapping.map(o+1),i.mapping.map(o+a.nodeSize-1),new ae(r,0,0))}),i.docChanged&&t(i)}return!0}function F_(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:i}=e;for(;t.childCount==1&&(n>0&&i>0||t.child(0).type.spec.tableRole=="table");)n--,i--,t=t.child(0).content;const r=t.child(0),a=r.type.spec.tableRole,o=r.type.schema,l=[];if(a=="row")for(let c=0;c<t.childCount;c++){let u=t.child(c).content;const f=c?0:Math.max(0,n-1),m=c<t.childCount-1?0:Math.max(0,i-1);(f||m)&&(u=ul(lt(o).row,new ae(u,f,m)).content),l.push(u)}else if(a=="cell"||a=="header_cell")l.push(n||i?ul(lt(o).row,new ae(t,n,i)).content:t);else return null;return V_(o,l)}function V_(e,t){const n=[];for(let r=0;r<t.length;r++){const a=t[r];for(let o=a.childCount-1;o>=0;o--){const{rowspan:l,colspan:c}=a.child(o).attrs;for(let u=r;u<r+l;u++)n[u]=(n[u]||0)+c}}let i=0;for(let r=0;r<n.length;r++)i=Math.max(i,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(J.empty),n[r]<i){const a=lt(e).cell.createAndFill(),o=[];for(let l=n[r];l<i;l++)o.push(a);t[r]=t[r].append(J.from(o))}return{height:t.length,width:i,rows:t}}function ul(e,t){const n=e.createAndFill();return new Wf(n).replace(0,n.content.size,t).doc}function U_({width:e,height:t,rows:n},i,r){if(e!=i){const a=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],u=[];for(let f=a[l]||0,m=0;f<i;m++){let p=c.child(m%c.childCount);f+p.attrs.colspan>i&&(p=p.type.createChecked(fi(p.attrs,p.attrs.colspan,f+p.attrs.colspan-i),p.content)),u.push(p),f+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)a[l+h]=(a[l+h]||0)+p.attrs.colspan}o.push(J.from(u))}n=o,e=i}if(t!=r){const a=[];for(let o=0,l=0;o<r;o++,l++){const c=[],u=n[l%t];for(let f=0;f<u.childCount;f++){let m=u.child(f);o+m.attrs.rowspan>r&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,r-m.attrs.rowspan)},m.content)),c.push(m)}a.push(J.from(c))}n=a,t=r}return{width:e,height:t,rows:n}}function H_(e,t,n,i,r,a,o){const l=e.doc.type.schema,c=lt(l);let u,f;if(r>t.width)for(let m=0,p=0;m<t.height;m++){const h=n.child(m);p+=h.nodeSize;const g=[];let b;h.lastChild==null||h.lastChild.type==c.cell?b=u||(u=c.cell.createAndFill()):b=f||(f=c.header_cell.createAndFill());for(let x=t.width;x<r;x++)g.push(b);e.insert(e.mapping.slice(o).map(p-1+i),g)}if(a>t.height){const m=[];for(let g=0,b=(t.height-1)*t.width;g<Math.max(t.width,r);g++){const x=g>=t.width?!1:n.nodeAt(t.map[b+g]).type==c.header_cell;m.push(x?f||(f=c.header_cell.createAndFill()):u||(u=c.cell.createAndFill()))}const p=c.row.create(null,J.from(m)),h=[];for(let g=t.height;g<a;g++)h.push(p);e.insert(e.mapping.slice(o).map(i+n.nodeSize-2),h)}return!!(u||f)}function Gu(e,t,n,i,r,a,o,l){if(o==0||o==t.height)return!1;let c=!1;for(let u=r;u<a;u++){const f=o*t.width+u,m=t.map[f];if(t.map[f-t.width]==m){c=!0;const p=n.nodeAt(m),{top:h,left:g}=t.findCell(m);e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p.attrs,rowspan:o-h}),e.insert(e.mapping.slice(l).map(t.positionAt(o,g,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-o})),u+=p.attrs.colspan-1}}return c}function Ku(e,t,n,i,r,a,o,l){if(o==0||o==t.width)return!1;let c=!1;for(let u=r;u<a;u++){const f=u*t.width+o,m=t.map[f];if(t.map[f-1]==m){c=!0;const p=n.nodeAt(m),h=t.colCount(m),g=e.mapping.slice(l).map(m+i);e.setNodeMarkup(g,null,fi(p.attrs,o-h,p.attrs.colspan-(o-h))),e.insert(g+p.nodeSize,p.type.createAndFill(fi(p.attrs,0,o-h))),u+=p.attrs.rowspan-1}}return c}function Xu(e,t,n,i,r){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw new Error("No table found");let o=He.get(a);const{top:l,left:c}=i,u=c+r.width,f=l+r.height,m=e.tr;let p=0;function h(){if(a=n?m.doc.nodeAt(n-1):m.doc,!a)throw new Error("No table found");o=He.get(a),p=m.mapping.maps.length}H_(m,o,a,n,u,f,p)&&h(),Gu(m,o,a,n,c,u,l,p)&&h(),Gu(m,o,a,n,c,u,f,p)&&h(),Ku(m,o,a,n,l,f,c,p)&&h(),Ku(m,o,a,n,l,f,u,p)&&h();for(let g=l;g<f;g++){const b=o.positionAt(g,c,a),x=o.positionAt(g,u,a);m.replace(m.mapping.slice(p).map(b+n),m.mapping.slice(p).map(x+n),new ae(r.rows[g-l],0,0))}h(),m.setSelection(new Le(m.doc.resolve(n+o.positionAt(l,c,a)),m.doc.resolve(n+o.positionAt(f-1,u-1,a)))),t(m)}const q_=rk({ArrowLeft:ma("horiz",-1),ArrowRight:ma("horiz",1),ArrowUp:ma("vert",-1),ArrowDown:ma("vert",1),"Shift-ArrowLeft":ha("horiz",-1),"Shift-ArrowRight":ha("horiz",1),"Shift-ArrowUp":ha("vert",-1),"Shift-ArrowDown":ha("vert",1),Backspace:pa,"Mod-Backspace":pa,Delete:pa,"Mod-Delete":pa});function Ca(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function ma(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;if(a instanceof Le)return Ca(n,i,ge.near(a.$headCell,t));if(e!="horiz"&&!a.empty)return!1;const o=cm(r,e,t);if(o==null)return!1;if(e=="horiz")return Ca(n,i,ge.near(n.doc.resolve(a.head+t),t));{const l=n.doc.resolve(o),c=nm(l,e,t);let u;return c?u=ge.near(c,1):t<0?u=ge.near(n.doc.resolve(l.before(-1)),-1):u=ge.near(n.doc.resolve(l.after(-1)),1),Ca(n,i,u)}}}function ha(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;let o;if(a instanceof Le)o=a;else{const c=cm(r,e,t);if(c==null)return!1;o=new Le(n.doc.resolve(c))}const l=nm(o.$headCell,e,t);return l?Ca(n,i,new Le(o.$anchorCell,l)):!1}}function j_(e,t){const n=e.state.doc,i=di(n.resolve(t));return i?(e.dispatch(e.state.tr.setSelection(new Le(i))),!0):!1}function $_(e,t,n){if(!$t(e.state))return!1;let i=F_(n);const r=e.state.selection;if(r instanceof Le){i||(i={width:1,height:1,rows:[J.from(ul(lt(e.state.schema).cell,n))]});const a=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),l=He.get(a).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return i=U_(i,l.right-l.left,l.bottom-l.top),Xu(e.state,e.dispatch,o,l,i),!0}else if(i){const a=Do(e.state),o=a.start(-1);return Xu(e.state,e.dispatch,o,He.get(a.node(-1)).findCell(a.pos-o),i),!0}else return!1}function W_(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const i=Ju(e,t.target);let r;if(t.shiftKey&&e.state.selection instanceof Le)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&(r=di(e.state.selection.$anchor))!=null&&((n=ms(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)a(r,t),t.preventDefault();else if(!i)return;function a(c,u){let f=ms(e,u);const m=Mn.getState(e.state)==null;if(!f||!cc(c,f))if(m)f=c;else return;const p=new Le(c,f);if(m||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);m&&h.setMeta(Mn,c.pos),e.dispatch(h)}}function o(){e.root.removeEventListener("mouseup",o),e.root.removeEventListener("dragstart",o),e.root.removeEventListener("mousemove",l),Mn.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Mn,-1))}function l(c){const u=c,f=Mn.getState(e.state);let m;if(f!=null)m=e.state.doc.resolve(f);else if(Ju(e,u.target)!=i&&(m=ms(e,t),!m))return o();m&&a(m,u)}e.root.addEventListener("mouseup",o),e.root.addEventListener("dragstart",o),e.root.addEventListener("mousemove",l)}function cm(e,t,n){if(!(e.state.selection instanceof he))return null;const{$head:i}=e.state.selection;for(let r=i.depth-1;r>=0;r--){const a=i.node(r);if((n<0?i.index(r):i.indexAfter(r))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const o=i.before(r),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?o:null}}return null}function Ju(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function ms(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:i,pos:r}=n;return i>=0&&di(e.state.doc.resolve(i))||di(e.state.doc.resolve(r))}var G_=class{constructor(t,n){this.node=t,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")),dl(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,dl(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function dl(e,t,n,i,r,a){let o=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let m=0,p=0;m<u.childCount;m++){const{colspan:h,colwidth:g}=u.child(m).attrs;for(let b=0;b<h;b++,p++){const x=r==p?a:g&&g[b],v=x?x+"px":"";if(o+=x||i,x||(l=!1),c)c.style.width!=v&&(c.style.width=v),c=c.nextSibling;else{const y=document.createElement("col");y.style.width=v,t.appendChild(y)}}}for(;c;){var f;const m=c.nextSibling;(f=c.parentNode)===null||f===void 0||f.removeChild(c),c=m}l?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const Nt=new at("tableColumnResizing");function K_({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:i=G_,lastColumnResizable:r=!0}={}){const a=new dt({key:Nt,state:{init(o,l){var c;const u=(c=a.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,f=lt(l.schema).table.name;return i&&u&&(u[f]=(m,p)=>new i(m,n,p)),new X_(-1,!1)},apply(o,l){return l.apply(o)}},props:{attributes:o=>{const l=Nt.getState(o);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,l)=>{J_(o,l,e,r)},mouseleave:o=>{Z_(o)},mousedown:(o,l)=>{Q_(o,l,t,n)}},decorations:o=>{const l=Nt.getState(o);if(l&&l.activeHandle>-1)return i3(o,l.activeHandle)},nodeViews:{}}});return a}var X_=class Ea{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,i=t.getMeta(Nt);if(i&&i.setHandle!=null)return new Ea(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new Ea(n.activeHandle,i.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return cl(t.doc.resolve(r))||(r=-1),new Ea(r,n.dragging)}return n}};function J_(e,t,n,i){if(!e.editable)return;const r=Nt.getState(e.state);if(r&&!r.dragging){const a=e3(t.target);let o=-1;if(a){const{left:l,right:c}=a.getBoundingClientRect();t.clientX-l<=n?o=Zu(e,t,"left",n):c-t.clientX<=n&&(o=Zu(e,t,"right",n))}if(o!=r.activeHandle){if(!i&&o!==-1){const l=e.state.doc.resolve(o),c=l.node(-1),u=He.get(c),f=l.start(-1);if(u.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==u.width-1)return}um(e,o)}}}function Z_(e){if(!e.editable)return;const t=Nt.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&um(e,-1)}function Q_(e,t,n,i){var r;if(!e.editable)return!1;const a=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,o=Nt.getState(e.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const l=e.state.doc.nodeAt(o.activeHandle),c=Y_(e,o.activeHandle,l.attrs);e.dispatch(e.state.tr.setMeta(Nt,{setDragging:{startX:t.clientX,startWidth:c}}));function u(m){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",f);const p=Nt.getState(e.state);p!=null&&p.dragging&&(t3(e,p.activeHandle,Qu(p.dragging,m,n)),e.dispatch(e.state.tr.setMeta(Nt,{setDragging:null})))}function f(m){if(!m.which)return u(m);const p=Nt.getState(e.state);if(p&&p.dragging){const h=Qu(p.dragging,m,n);Yu(e,p.activeHandle,h,i)}}return Yu(e,o.activeHandle,c,i),a.addEventListener("mouseup",u),a.addEventListener("mousemove",f),t.preventDefault(),!0}function Y_(e,t,{colspan:n,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const a=e.domAtPos(t);let o=a.node.childNodes[a.offset].offsetWidth,l=n;if(i)for(let c=0;c<n;c++)i[c]&&(o-=i[c],l--);return o/l}function e3(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function Zu(e,t,n,i){const r=n=="right"?-i:i,a=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!a)return-1;const{pos:o}=a,l=di(e.state.doc.resolve(o));if(!l)return-1;if(n=="right")return l.pos;const c=He.get(l.node(-1)),u=l.start(-1),f=c.map.indexOf(l.pos-u);return f%c.width==0?-1:u+c.map[f-1]}function Qu(e,t,n){const i=t.clientX-e.startX;return Math.max(n,e.startWidth+i)}function um(e,t){e.dispatch(e.state.tr.setMeta(Nt,{setHandle:t}))}function t3(e,t,n){const i=e.state.doc.resolve(t),r=i.node(-1),a=He.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let u=0;u<a.height;u++){const f=u*a.width+l;if(u&&a.map[f]==a.map[f-a.width])continue;const m=a.map[f],p=r.nodeAt(m).attrs,h=p.colspan==1?0:l-a.colCount(m);if(p.colwidth&&p.colwidth[h]==n)continue;const g=p.colwidth?p.colwidth.slice():n3(p.colspan);g[h]=n,c.setNodeMarkup(o+m,null,{...p,colwidth:g})}c.docChanged&&e.dispatch(c)}function Yu(e,t,n,i){const r=e.state.doc.resolve(t),a=r.node(-1),o=r.start(-1),l=He.get(a).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=e.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&dl(a,c.firstChild,c,i,l,n)}function n3(e){return Array(e).fill(0)}function i3(e,t){const n=[],i=e.doc.resolve(t),r=i.node(-1);if(!r)return Ve.empty;const a=He.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const f=l+u*a.width;if((l==a.width-1||a.map[f]!=a.map[f+1])&&(u==0||a.map[f]!=a.map[f-a.width])){var c;const m=a.map[f],p=o+m+r.nodeAt(m).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=Nt.getState(e))===null||c===void 0)&&c.dragging&&n.push(ot.node(o+m,o+m+r.nodeAt(m).nodeSize,{class:"column-resize-dragging"})),n.push(ot.widget(p,h))}}return Ve.create(e.doc,n)}function r3({allowTableNodeSelection:e=!1}={}){return new dt({key:Mn,state:{init(){return null},apply(t,n){const i=t.getMeta(Mn);if(i!=null)return i==-1?null:i;if(n==null||!t.docChanged)return n;const{deleted:r,pos:a}=t.mapping.mapResult(n);return r?null:a}},props:{decorations:g_,handleDOMEvents:{mousedown:W_},createSelectionBetween(t){return Mn.getState(t.state)!=null?t.state.selection:null},handleTripleClick:j_,handleKeyDown:q_,handlePaste:$_},appendTransaction(t,n,i){return y_(i,om(i,n),e)}})}function fl(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ed(e,t,n,i,r,a){var o;let l=0,c=!0,u=t.firstChild;const f=e.firstChild;if(f!==null)for(let m=0,p=0;m<f.childCount;m+=1){const{colspan:h,colwidth:g}=f.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const x=r===p?a:g&&g[b],v=x?`${x}px`:"";if(l+=x||i,x||(c=!1),u){if(u.style.width!==v){const[y,k]=fl(i,x);u.style.setProperty(y,k)}u=u.nextSibling}else{const y=document.createElement("col"),[k,w]=fl(i,x);y.style.setProperty(k,w),t.appendChild(y)}}}for(;u;){const m=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=m}c?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class a3{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ed(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,ed(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function o3(e,t,n,i){let r=0,a=!0;const o=[],l=e.firstChild;if(!l)return{};for(let m=0,p=0;m<l.childCount;m+=1){const{colspan:h,colwidth:g}=l.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const x=n===p?i:g&&g[b];r+=x||t,x||(a=!1);const[v,y]=fl(t,x);o.push(["col",{style:`${v}: ${y}`}])}}const c=a?`${r}px`:"",u=a?"":`${r}px`;return{colgroup:["colgroup",{},...o],tableWidth:c,tableMinWidth:u}}function td(e,t){return e.createAndFill()}function s3(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const i=e.nodes[n];i.spec.tableRole&&(t[i.spec.tableRole]=i)}),e.cached.tableNodeTypes=t,t}function l3(e,t,n,i,r){const a=s3(e),o=[],l=[];for(let u=0;u<n;u+=1){const f=td(a.cell);if(f&&l.push(f),i){const m=td(a.header_cell);m&&o.push(m)}}const c=[];for(let u=0;u<t;u+=1)c.push(a.row.createChecked(null,i&&u===0?o:l));return a.table.createChecked(null,c)}function c3(e){return e instanceof Le}const ba=({editor:e})=>{const{selection:t}=e.state;if(!c3(t))return!1;let n=0;const i=Hp(t.ranges[0].$from,a=>a.type.name==="table");return i==null||i.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},u3=Se.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:a3,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:i,tableMinWidth:r}=o3(e,this.options.cellMinWidth),a=["table",Be(this.options.HTMLAttributes,t,{style:i?`width: ${i}`:`min-width: ${r}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:i,dispatch:r,editor:a})=>{const o=l3(a.schema,e,t,n);if(r){const l=i.selection.from+1;i.replaceSelectionWith(o).scrollIntoView().setSelection(he.near(i.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>__(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>S_(e,t),deleteColumn:()=>({state:e,dispatch:t})=>E_(e,t),addRowBefore:()=>({state:e,dispatch:t})=>T_(e,t),addRowAfter:()=>({state:e,dispatch:t})=>N_(e,t),deleteRow:()=>({state:e,dispatch:t})=>M_(e,t),deleteTable:()=>({state:e,dispatch:t})=>P_(e,t),mergeCells:()=>({state:e,dispatch:t})=>qu(e,t),splitCell:()=>({state:e,dispatch:t})=>ju(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>_r("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>_r("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>L_(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>qu(e,t)?!0:ju(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:i})=>I_(e,t)(n,i),goToNextCell:()=>({state:e,dispatch:t})=>Wu(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Wu(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&om(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const i=Le.create(t.doc,e.anchorCell,e.headCell);t.setSelection(i)}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:ba,"Mod-Backspace":ba,Delete:ba,"Mod-Delete":ba}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[K_({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],r3({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Qe(st(e,"tableRole",t))}}}),d3=Se.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Be(this.options.HTMLAttributes,e),0]}}),f3=Se.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Be(this.options.HTMLAttributes,e),0]}}),p3=Se.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Be(this.options.HTMLAttributes,e),0]}}),m3=je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new dt({key:new at("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,r=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((o,l)=>{const c=i>=l&&i<=l+o.nodeSize,u=!o.isLeaf&&Yl(o);if((c||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const m=ot.node(l,l+o.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:c}):this.options.placeholder});r.push(m)}return this.options.includeChildren}),Ve.create(e,r)}}})]}}),h3=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var i,r;const a=n.getAttribute("style"),o=(r=(i=n.parentElement)===null||i===void 0?void 0:i.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${o};${a}`)})};St.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&h3(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,i)=>{if(n.isTextblock)return!0;n.marks.filter(r=>r.type===this.type).some(r=>Object.values(r.attrs).some(a=>!!a))||e.removeMark(i,i+n.nodeSize,this.type)}),!0}}}});const b3=je.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),g3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,v3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,x3=St.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",Be(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[cw({find:g3,type:this.type})]},addPasteRules(){return[jp({find:v3,type:this.type})]}}),nd={};function y3(e){let t=nd[e];if(t)return t;t=nd[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t[i]="%"+("0"+i.toString(16).toUpperCase()).slice(-2)}return t}function zi(e,t){typeof t!="string"&&(t=zi.defaultChars);const n=y3(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(i){let r="";for(let a=0,o=i.length;a<o;a+=3){const l=parseInt(i.slice(a+1,a+3),16);if(l<128){r+=n[l];continue}if((l&224)===192&&a+3<o){const c=parseInt(i.slice(a+4,a+6),16);if((c&192)===128){const u=l<<6&1984|c&63;u<128?r+="��":r+=String.fromCharCode(u),a+=3;continue}}if((l&240)===224&&a+6<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16);if((c&192)===128&&(u&192)===128){const f=l<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?r+="���":r+=String.fromCharCode(f),a+=6;continue}}if((l&248)===240&&a+9<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16),f=parseInt(i.slice(a+10,a+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let m=l<<18&1835008|c<<12&258048|u<<6&4032|f&63;m<65536||m>1114111?r+="����":(m-=65536,r+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),a+=9;continue}}r+="�"}return r})}zi.defaultChars=";/?:@&=+$,#";zi.componentChars="";const id={};function k3(e){let t=id[e];if(t)return t;t=id[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function zr(e,t,n){typeof t!="string"&&(n=t,t=zr.defaultChars),typeof n>"u"&&(n=!0);const i=k3(t);let r="";for(let a=0,o=e.length;a<o;a++){const l=e.charCodeAt(a);if(n&&l===37&&a+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){r+=e.slice(a,a+3),a+=2;continue}if(l<128){r+=i[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<o){const c=e.charCodeAt(a+1);if(c>=56320&&c<=57343){r+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[a])}return r}zr.defaultChars=";/?:@&=+$,-_.!~*'()#";zr.componentChars="-_.!~*'()";function uc(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function xo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const w3=/^([a-z0-9.+-]+:)/i,_3=/:[0-9]*$/,S3=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C3=["<",">",'"',"`"," ","\r",`
|
|
15200
|
-
`," "],E3=["{","}","|","\\","^","`"].concat(C3),A3=["'"].concat(E3),rd=["%","/","?",";","#"].concat(A3),ad=["/","?","#"],T3=255,od=/^[+a-z0-9A-Z_-]{0,63}$/,N3=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sd={javascript:!0,"javascript:":!0},ld={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dc(e,t){if(e&&e instanceof xo)return e;const n=new xo;return n.parse(e,t),n}xo.prototype.parse=function(e,t){let n,i,r,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const u=S3.exec(a);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=w3.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=a.substr(0,2)==="//",r&&!(o&&sd[o])&&(a=a.substr(2),this.slashes=!0)),!sd[o]&&(r||o&&!ld[o])){let u=-1;for(let g=0;g<ad.length;g++)i=a.indexOf(ad[g]),i!==-1&&(u===-1||i<u)&&(u=i);let f,m;u===-1?m=a.lastIndexOf("@"):m=a.lastIndexOf("@",u),m!==-1&&(f=a.slice(0,m),a=a.slice(m+1),this.auth=f),u=-1;for(let g=0;g<rd.length;g++)i=a.indexOf(rd[g]),i!==-1&&(u===-1||i<u)&&(u=i);u===-1&&(u=a.length),a[u-1]===":"&&u--;const p=a.slice(0,u);a=a.slice(u),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const g=this.hostname.split(/\./);for(let b=0,x=g.length;b<x;b++){const v=g[b];if(v&&!v.match(od)){let y="";for(let k=0,w=v.length;k<w;k++)v.charCodeAt(k)>127?y+="x":y+=v[k];if(!y.match(od)){const k=g.slice(0,b),w=g.slice(b+1),S=v.match(N3);S&&(k.push(S[1]),w.unshift(S[2])),w.length&&(a=w.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>T3&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));const c=a.indexOf("?");return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),ld[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xo.prototype.parseHost=function(e){let t=_3.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const O3=Object.freeze(Object.defineProperty({__proto__:null,decode:zi,encode:zr,format:uc,parse:dc},Symbol.toStringTag,{value:"Module"})),dm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,fm=/[\0-\x1F\x7F-\x9F]/,M3=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,fc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,pm=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,mm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,D3=Object.freeze(Object.defineProperty({__proto__:null,Any:dm,Cc:fm,Cf:M3,P:fc,S:pm,Z:mm},Symbol.toStringTag,{value:"Module"})),z3=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),I3=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var hs;const R3=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),L3=(hs=String.fromCodePoint)!==null&&hs!==void 0?hs:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function B3(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=R3.get(e))!==null&&t!==void 0?t:e}var Ze;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ze||(Ze={}));const P3=32;var Ln;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ln||(Ln={}));function pl(e){return e>=Ze.ZERO&&e<=Ze.NINE}function F3(e){return e>=Ze.UPPER_A&&e<=Ze.UPPER_F||e>=Ze.LOWER_A&&e<=Ze.LOWER_F}function V3(e){return e>=Ze.UPPER_A&&e<=Ze.UPPER_Z||e>=Ze.LOWER_A&&e<=Ze.LOWER_Z||pl(e)}function U3(e){return e===Ze.EQUALS||V3(e)}var Je;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Je||(Je={}));var bn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(bn||(bn={}));class H3{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Je.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bn.Strict}startEntity(t){this.decodeMode=t,this.state=Je.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Je.EntityStart:return t.charCodeAt(n)===Ze.NUM?(this.state=Je.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Je.NamedEntity,this.stateNamedEntity(t,n));case Je.NumericStart:return this.stateNumericStart(t,n);case Je.NumericDecimal:return this.stateNumericDecimal(t,n);case Je.NumericHex:return this.stateNumericHex(t,n);case Je.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|P3)===Ze.LOWER_X?(this.state=Je.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Je.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const a=i-n;this.result=this.result*Math.pow(r,a)+parseInt(t.substr(n,a),r),this.consumed+=a}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(pl(r)||F3(r))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(pl(r))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ze.SEMI)this.consumed+=1;else if(this.decodeMode===bn.Strict)return 0;return this.emitCodePoint(B3(this.result),this.consumed),this.errors&&(t!==Ze.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let r=i[this.treeIndex],a=(r&Ln.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=q3(i,r,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===bn.Attribute&&(a===0||U3(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],a=(r&Ln.VALUE_LENGTH)>>14,a!==0){if(o===Ze.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Ln.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Ln.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Je.NamedEntity:return this.result!==0&&(this.decodeMode!==bn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Je.NumericDecimal:return this.emitNumericEntity(0,2);case Je.NumericHex:return this.emitNumericEntity(0,3);case Je.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Je.EntityStart:return 0}}}function hm(e){let t="";const n=new H3(e,i=>t+=L3(i));return function(r,a){let o=0,l=0;for(;(l=r.indexOf("&",l))>=0;){t+=r.slice(o,l),n.startEntity(a);const u=n.write(r,l+1);if(u<0){o=l+n.end();break}o=l+u,l=u===0?o+1:o}const c=t+r.slice(o);return t="",c}}function q3(e,t,n,i){const r=(t&Ln.BRANCH_LENGTH)>>7,a=t&Ln.JUMP_TABLE;if(r===0)return a!==0&&i===a?n:-1;if(a){const c=i-a;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(u<i)o=c+1;else if(u>i)l=c-1;else return e[c+r]}return-1}const bm=hm(z3);hm(I3);function j3(e,t=bn.Legacy){return bm(e,t)}function $3(e){return bm(e,bn.Strict)}function W3(e){return Object.prototype.toString.call(e)}function pc(e){return W3(e)==="[object String]"}const G3=Object.prototype.hasOwnProperty;function K3(e,t){return G3.call(e,t)}function zo(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(i){e[i]=n[i]})}}),e}function gm(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function mc(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Sr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const vm=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,X3=/&([a-z#][a-z0-9]{1,31});/gi,J3=new RegExp(vm.source+"|"+X3.source,"gi"),Z3=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Q3(e,t){if(t.charCodeAt(0)===35&&Z3.test(t)){const i=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return mc(i)?Sr(i):e}const n=j3(e);return n!==e?n:e}function Y3(e){return e.indexOf("\\")<0?e:e.replace(vm,"$1")}function Ii(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(J3,function(t,n,i){return n||Q3(t,i)})}const e4=/[&<>"]/,t4=/[&<>"]/g,n4={"&":"&","<":"<",">":">",'"':"""};function i4(e){return n4[e]}function Vn(e){return e4.test(e)?e.replace(t4,i4):e}const r4=/[.?*+^$[\]\\(){}|-]/g;function a4(e){return e.replace(r4,"\\$&")}function Re(e){switch(e){case 9:case 32:return!0}return!1}function Cr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function xm(e){return fc.test(e)||pm.test(e)}function Er(e){return xm(Sr(e))}function Ar(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Io(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function cd(e){return e===32||e===9||e===10||e===13}function Ro(e){let t=0;for(;t<e.length&&cd(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&cd(e.charCodeAt(n));n--);return e.slice(t,n+1)}const o4={mdurl:O3,ucmicro:D3},s4=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:gm,asciiTrim:Ro,assign:zo,escapeHtml:Vn,escapeRE:a4,fromCodePoint:Sr,has:K3,isMdAsciiPunct:Ar,isPunctChar:xm,isPunctCharCode:Er,isSpace:Re,isString:pc,isValidEntityCode:mc,isWhiteSpace:Cr,lib:o4,normalizeReference:Io,unescapeAll:Ii,unescapeMd:Y3},Symbol.toStringTag,{value:"Module"}));function l4(e,t,n){let i,r,a,o;const l=e.posMax,c=e.pos;for(e.pos=t+1,i=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(i--,i===0)){r=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)i++;else if(n)return e.pos=c,-1}}let u=-1;return r&&(u=e.pos),e.pos=c,u}function c4(e,t,n){let i,r=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(i=e.charCodeAt(r),i===10||i===60)return a;if(i===62)return a.pos=r+1,a.str=Ii(e.slice(t+1,r)),a.ok=!0,a;if(i===92&&r+1<n){r+=2;continue}r++}return a}let o=0;for(;r<n&&(i=e.charCodeAt(r),!(i===32||i<32||i===127));){if(i===92&&r+1<n){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(i===40&&(o++,o>32))return a;if(i===41){if(o===0)break;o--}r++}return t===r||o!==0||(a.str=Ii(e.slice(t,r)),a.pos=r,a.ok=!0),a}function u4(e,t,n,i){let r,a=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)o.str=i.str,o.marker=i.marker;else{if(a>=n)return o;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return o;t++,a++,l===40&&(l=41),o.marker=l}for(;a<n;){if(r=e.charCodeAt(a),r===o.marker)return o.pos=a+1,o.str+=Ii(e.slice(t,a)),o.ok=!0,o;if(r===40&&o.marker===41)return o;r===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Ii(e.slice(t,a)),o}const d4=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:c4,parseLinkLabel:l4,parseLinkTitle:u4},Symbol.toStringTag,{value:"Module"})),tn={};tn.code_inline=function(e,t,n,i,r){const a=e[t];return"<code"+r.renderAttrs(a)+">"+Vn(a.content)+"</code>"};tn.code_block=function(e,t,n,i,r){const a=e[t];return"<pre"+r.renderAttrs(a)+"><code>"+Vn(e[t].content)+`</code></pre>
|
|
15201
|
-
`};tn.fence=function(e,t,n,i,r){const a=e[t],o=a.info?Ii(a.info).trim():"";let l="",c="";if(o){const f=o.split(/(\s+)/g);l=f[0],c=f.slice(2).join("")}let u;if(n.highlight?u=n.highlight(a.content,l,c)||Vn(a.content):u=Vn(a.content),u.indexOf("<pre")===0)return u+`
|
|
15202
|
-
`;if(o){const f=a.attrIndex("class"),m=a.attrs?a.attrs.slice():[];f<0?m.push(["class",n.langPrefix+l]):(m[f]=m[f].slice(),m[f][1]+=" "+n.langPrefix+l);const p={attrs:m};return`<pre><code${r.renderAttrs(p)}>${u}</code></pre>
|
|
15203
|
-
`}return`<pre><code${r.renderAttrs(a)}>${u}</code></pre>
|
|
15204
|
-
`};tn.image=function(e,t,n,i,r){const a=e[t];return a.attrs[a.attrIndex("alt")][1]=r.renderInlineAsText(a.children,n,i),r.renderToken(e,t,n)};tn.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
15205
|
-
`:`<br>
|
|
15206
|
-
`};tn.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
15207
|
-
`:`<br>
|
|
15208
|
-
`:`
|
|
15209
|
-
`};tn.text=function(e,t){return Vn(e[t].content)};tn.html_block=function(e,t){return e[t].content};tn.html_inline=function(e,t){return e[t].content};function Bi(){this.rules=zo({},tn)}Bi.prototype.renderAttrs=function(t){let n,i,r;if(!t.attrs)return"";for(r="",n=0,i=t.attrs.length;n<i;n++)r+=" "+Vn(t.attrs[n][0])+'="'+Vn(t.attrs[n][1])+'"';return r};Bi.prototype.renderToken=function(t,n,i){const r=t[n];let a="";if(r.hidden)return"";r.block&&r.nesting!==-1&&n&&t[n-1].hidden&&(a+=`
|
|
15210
|
-
`),a+=(r.nesting===-1?"</":"<")+r.tag,a+=this.renderAttrs(r),r.nesting===0&&i.xhtmlOut&&(a+=" /");let o=!1;if(r.block&&(o=!0,r.nesting===1&&n+1<t.length)){const l=t[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===r.tag)&&(o=!1)}return a+=o?`>
|
|
15211
|
-
`:">",a};Bi.prototype.renderInline=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t)}return i};Bi.prototype.renderInlineAsText=function(e,t,n){let i="";for(let r=0,a=e.length;r<a;r++)switch(e[r].type){case"text":i+=e[r].content;break;case"image":i+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":i+=e[r].content;break;case"softbreak":case"hardbreak":i+=`
|
|
15212
|
-
`;break}return i};Bi.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;l==="inline"?i+=this.renderInline(e[a].children,t,n):typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t,n)}return i};function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Ct.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})};Ct.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null};Ct.prototype.before=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};Ct.prototype.after=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};Ct.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null};Ct.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n};Ct.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Ct.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n};Ct.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Wt(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Wt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1};Wt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Wt.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r};Wt.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i};Wt.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function ym(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}ym.prototype.Token=Wt;const f4=/\r\n?|\n/g,p4=/\0/g;function m4(e){let t;t=e.src.replace(f4,`
|
|
15213
|
-
`),t=t.replace(p4,"�"),e.src=t}function h4(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function b4(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function g4(e){return/^<a[>\s]/i.test(e)}function v4(e){return/^<\/a\s*>/i.test(e)}function x4(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,a=0;for(let o=r.length-1;o>=0;o--){const l=r[o];if(l.type==="link_close"){for(o--;r[o].level!==l.level&&r[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(g4(l.content)&&a>0&&a--,v4(l.content)&&a++),!(a>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let u=e.md.linkify.match(c);const f=[];let m=l.level,p=0;u.length>0&&u[0].index===0&&o>0&&r[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;h<u.length;h++){const g=u[h].url,b=e.md.normalizeLink(g);if(!e.md.validateLink(b))continue;let x=u[h].text;u[h].schema?u[h].schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText("mailto:"+x).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText("http://"+x).replace(/^http:\/\//,"");const v=u[h].index;if(v>p){const S=new e.Token("text","",0);S.content=c.slice(p,v),S.level=m,f.push(S)}const y=new e.Token("link_open","a",1);y.attrs=[["href",b]],y.level=m++,y.markup="linkify",y.info="auto",f.push(y);const k=new e.Token("text","",0);k.content=x,k.level=m,f.push(k);const w=new e.Token("link_close","a",-1);w.level=--m,w.markup="linkify",w.info="auto",f.push(w),p=u[h].lastIndex}if(p<c.length){const h=new e.Token("text","",0);h.content=c.slice(p),h.level=m,f.push(h)}t[n].children=r=gm(r,o,f)}}}}const km=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,y4=/\((c|tm|r)\)/i,k4=/\((c|tm|r)\)/ig,w4={c:"©",r:"®",tm:"™"};function _4(e,t){return w4[t.toLowerCase()]}function S4(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(k4,_4)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function C4(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&km.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function E4(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(y4.test(e.tokens[t].content)&&S4(e.tokens[t].children),km.test(e.tokens[t].content)&&C4(e.tokens[t].children))}const A4=/['"]/,ud=/['"]/g,dd="’";function ga(e,t,n,i){e[t]||(e[t]=[]),e[t].push({pos:n,ch:i})}function T4(e,t){let n="",i=0;t.sort((r,a)=>r.pos-a.pos);for(let r=0;r<t.length;r++){const a=t[r];n+=e.slice(i,a.pos)+a.ch,i=a.pos+1}return n+e.slice(i)}function N4(e,t){let n;const i=[],r={};for(let a=0;a<e.length;a++){const o=e[a],l=e[a].level;for(n=i.length-1;n>=0&&!(i[n].level<=l);n--);if(i.length=n+1,o.type!=="text")continue;const c=o.content;let u=0;const f=c.length;e:for(;u<f;){ud.lastIndex=u;const m=ud.exec(c);if(!m)break;let p=!0,h=!0;u=m.index+1;const g=m[0]==="'";let b=32;if(m.index-1>=0)b=c.charCodeAt(m.index-1);else for(n=a-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){b=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(u<f)x=c.charCodeAt(u);else for(n=a+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const v=Ar(b)||Er(b),y=Ar(x)||Er(x),k=Cr(b),w=Cr(x);if(w?p=!1:y&&(k||v||(p=!1)),k?h=!1:v&&(w||y||(h=!1)),x===34&&m[0]==='"'&&b>=48&&b<=57&&(h=p=!1),p&&h&&(p=v,h=y),!p&&!h){g&&ga(r,a,m.index,dd);continue}if(h)for(n=i.length-1;n>=0;n--){let S=i[n];if(i[n].level<l)break;if(S.single===g&&i[n].level===l){S=i[n];let E,D;g?(E=t.md.options.quotes[2],D=t.md.options.quotes[3]):(E=t.md.options.quotes[0],D=t.md.options.quotes[1]),ga(r,a,m.index,D),ga(r,S.token,S.pos,E),i.length=n;continue e}}p?i.push({token:a,pos:m.index,single:g,level:l}):h&&g&&ga(r,a,m.index,dd)}}Object.keys(r).forEach(function(a){e[a].content=T4(e[a].content,r[a])})}function O4(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!A4.test(e.tokens[t].content)||N4(e.tokens[t].children,e)}function M4(e){let t,n;const i=e.tokens,r=i.length;for(let a=0;a<r;a++){if(i[a].type!=="inline")continue;const o=i[a].children,l=o.length;for(t=0;t<l;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<l;t++)o[t].type==="text"&&t+1<l&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const bs=[["normalize",m4],["block",h4],["inline",b4],["linkify",x4],["replacements",E4],["smartquotes",O4],["text_join",M4]];function hc(){this.ruler=new Ct;for(let e=0;e<bs.length;e++)this.ruler.push(bs[e][0],bs[e][1])}hc.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)};hc.prototype.State=ym;function nn(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let a=0,o=0,l=0,c=0,u=r.length,f=!1;o<u;o++){const m=r.charCodeAt(o);if(!f)if(Re(m)){l++,m===9?c+=4-c%4:c++;continue}else f=!0;(m===10||o===u-1)&&(m!==10&&o++,this.bMarks.push(a),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),f=!1,l=0,c=0,a=o+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}nn.prototype.push=function(e,t,n){const i=new Wt(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i};nn.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};nn.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};nn.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Re(i))break}return t};nn.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Re(this.src.charCodeAt(--t)))return t+1;return t};nn.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t};nn.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t};nn.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const a=new Array(n-t);for(let o=0,l=t;l<n;l++,o++){let c=0;const u=this.bMarks[l];let f=u,m;for(l+1<n||r?m=this.eMarks[l]+1:m=this.eMarks[l];f<m&&c<i;){const p=this.src.charCodeAt(f);if(Re(p))p===9?c+=4-(c+this.bsCount[l])%4:c++;else if(f-u<this.tShift[l])c++;else break;f++}c>i?a[o]=new Array(c-i+1).join(" ")+this.src.slice(f,m):a[o]=this.src.slice(f,m)}return a.join("")};nn.prototype.Token=Wt;const D4=65536;function gs(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function fd(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),a=!1,o=0,l="";for(;i<n;)r===124&&(a?(l+=e.substring(o,i-1),o=i):(t.push(l+e.substring(o,i)),l="",o=i+1)),a=r===92,i++,r=e.charCodeAt(i);return t.push(l+e.substring(o)),t}function z4(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let a=e.bMarks[r]+e.tShift[r];if(a>=e.eMarks[r])return!1;const o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[r])return!1;const l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Re(l)||o===45&&Re(l))return!1;for(;a<e.eMarks[r];){const w=e.src.charCodeAt(a);if(w!==124&&w!==45&&w!==58&&!Re(w))return!1;a++}let c=gs(e,t+1),u=c.split("|");const f=[];for(let w=0;w<u.length;w++){const S=u[w].trim();if(!S){if(w===0||w===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?f.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=gs(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=fd(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const m=u.length;if(m===0||m!==f.length)return!1;if(i)return!0;const p=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),b=[t,0];g.map=b;const x=e.push("thead_open","thead",1);x.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let w=0;w<u.length;w++){const S=e.push("th_open","th",1);f[w]&&(S.attrs=[["style","text-align:"+f[w]]]);const E=e.push("inline","",0);E.content=u[w].trim(),E.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,k=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let w=!1;for(let E=0,D=h.length;E<D;E++)if(h[E](e,r,n,!0)){w=!0;break}if(w||(c=gs(e,r).trim(),!c)||e.sCount[r]-e.blkIndent>=4||(u=fd(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=m-u.length,k>D4))break;if(r===t+2){const E=e.push("tbody_open","tbody",1);E.map=y=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[r,r+1];for(let E=0;E<m;E++){const D=e.push("td_open","td",1);f[E]&&(D.attrs=[["style","text-align:"+f[E]]]);const _=e.push("inline","",0);_.content=u[E]?u[E].trim():"",_.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=r),e.push("table_close","table",-1),b[1]=r,e.parentType=p,e.line=r,!0}function I4(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const a=e.push("code_block","code",0);return a.content=e.getLines(t,r,4+e.blkIndent,!1)+`
|
|
15214
|
-
`,a.map=[t,e.line],!0}function R4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>a)return!1;const o=e.src.charCodeAt(r);if(o!==126&&o!==96)return!1;let l=r;r=e.skipChars(r,o);let c=r-l;if(c<3)return!1;const u=e.src.slice(l,r),f=e.src.slice(r,a);if(o===96&&f.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let m=t,p=!1;for(;m++,!(m>=n||(r=l=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],r<a&&e.sCount[m]<e.blkIndent));)if(e.src.charCodeAt(r)===o&&!(e.sCount[m]-e.blkIndent>=4)&&(r=e.skipChars(r,o),!(r-l<c)&&(r=e.skipSpaces(r),!(r<a)))){p=!0;break}c=e.sCount[t],e.line=m+(p?1:0);const h=e.push("fence","code",0);return h.info=f,h.content=e.getLines(t+1,m,c,!0),h.markup=u,h.map=[t,e.line],!0}function L4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const l=[],c=[],u=[],f=[],m=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let h=!1,g;for(g=t;g<n;g++){const k=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],a=e.eMarks[g],r>=a)break;if(e.src.charCodeAt(r++)===62&&!k){let S=e.sCount[g]+1,E,D;e.src.charCodeAt(r)===32?(r++,S++,D=!1,E=!0):e.src.charCodeAt(r)===9?(E=!0,(e.bsCount[g]+S)%4===3?(r++,S++,D=!1):D=!0):E=!1;let _=S;for(l.push(e.bMarks[g]),e.bMarks[g]=r;r<a;){const C=e.src.charCodeAt(r);if(Re(C))C===9?_+=4-(_+e.bsCount[g]+(D?1:0))%4:_++;else break;r++}h=r>=a,c.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(E?1:0),u.push(e.sCount[g]),e.sCount[g]=_-S,f.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(h)break;let w=!1;for(let S=0,E=m.length;S<E;S++)if(m[S](e,g,n,!0)){w=!0;break}if(w){e.lineMax=g,e.blkIndent!==0&&(l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]=-1}const b=e.blkIndent;e.blkIndent=0;const x=e.push("blockquote_open","blockquote",1);x.markup=">";const v=[t,0];x.map=v,e.md.block.tokenize(e,t,g);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=o,e.parentType=p,v[1]=e.line;for(let k=0;k<f.length;k++)e.bMarks[k+t]=l[k],e.tShift[k+t]=f[k],e.sCount[k+t]=u[k],e.bsCount[k+t]=c[k];return e.blkIndent=b,!0}function B4(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;a<r;){const u=e.src.charCodeAt(a++);if(u!==o&&!Re(u))return!1;u===o&&l++}if(l<3)return!1;if(i)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(l+1).join(String.fromCharCode(o)),!0}function pd(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const a=e.src.charCodeAt(i);if(!Re(a))return-1}return i}function md(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let a=e.src.charCodeAt(r++);if(a<48||a>57)return-1;for(;;){if(r>=i)return-1;if(a=e.src.charCodeAt(r++),a>=48&&a<=57){if(r-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return r<i&&(a=e.src.charCodeAt(r),!Re(a))?-1:r}function P4(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function F4(e,t,n,i){let r,a,o,l,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;i&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let m,p,h;if((h=md(e,c))>=0){if(m=!0,o=e.bMarks[c]+e.tShift[c],p=Number(e.src.slice(o,h-1)),f&&p!==1)return!1}else if((h=pd(e,c))>=0)m=!1;else return!1;if(f&&e.skipSpaces(h)>=e.eMarks[c])return!1;if(i)return!0;const g=e.src.charCodeAt(h-1),b=e.tokens.length;m?(l=e.push("ordered_list_open","ol",1),p!==1&&(l.attrs=[["start",p]])):l=e.push("bullet_list_open","ul",1);const x=[c,0];l.map=x,l.markup=String.fromCharCode(g);let v=!1;const y=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";c<n;){a=h,r=e.eMarks[c];const w=e.sCount[c]+h-(e.bMarks[c]+e.tShift[c]);let S=w;for(;a<r;){const j=e.src.charCodeAt(a);if(j===9)S+=4-(S+e.bsCount[c])%4;else if(j===32)S++;else break;a++}const E=a;let D;E>=r?D=1:D=S-w,D>4&&(D=1);const _=w+D;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(g);const C=[c,0];l.map=C,m&&(l.info=e.src.slice(o,h-1));const N=e.tight,I=e.tShift[c],H=e.sCount[c],F=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=_,e.tight=!0,e.tShift[c]=E-e.bMarks[c],e.sCount[c]=S,E>=r&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=F,e.tShift[c]=I,e.sCount[c]=H,e.tight=N,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(g),c=e.line,C[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let M=!1;for(let j=0,P=y.length;j<P;j++)if(y[j](e,c,n,!0)){M=!0;break}if(M)break;if(m){if(h=md(e,c),h<0)break;o=e.bMarks[c]+e.tShift[c]}else if(h=pd(e,c),h<0)break;if(g!==e.src.charCodeAt(h-1))break}return m?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(g),x[1]=c,e.line=c,e.parentType=k,u&&P4(e,b),!0}function V4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function l(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let w=!1;if(e.sCount[y]-e.blkIndent>3&&(w=!0),e.sCount[y]<0&&(w=!0),!w){const D=e.md.block.ruler.getRules("reference"),_=e.parentType;e.parentType="reference";let C=!1;for(let N=0,I=D.length;N<I;N++)if(D[N](e,y,k,!0)){C=!0;break}if(e.parentType=_,C)return null}const S=e.bMarks[y]+e.tShift[y],E=e.eMarks[y];return e.src.slice(S,E+1)}let c=e.src.slice(r,a+1);a=c.length;let u=-1;for(r=1;r<a;r++){const y=c.charCodeAt(r);if(y===91)return!1;if(y===93){u=r;break}else if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(y===92&&(r++,r<a&&c.charCodeAt(r)===10)){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(r=u+2;r<a;r++){const y=c.charCodeAt(r);if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Re(y))break}const f=e.md.helpers.parseLinkDestination(c,r,a);if(!f.ok)return!1;const m=e.md.normalizeLink(f.str);if(!e.md.validateLink(m))return!1;r=f.pos;const p=r,h=o,g=r;for(;r<a;r++){const y=c.charCodeAt(r);if(y===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Re(y))break}let b=e.md.helpers.parseLinkTitle(c,r,a);for(;b.can_continue;){const y=l(o);if(y===null)break;c+=y,r=a,a=c.length,o++,b=e.md.helpers.parseLinkTitle(c,r,a,b)}let x;for(r<a&&g!==r&&b.ok?(x=b.str,r=b.pos):(x="",r=p,o=h);r<a;){const y=c.charCodeAt(r);if(!Re(y))break;r++}if(r<a&&c.charCodeAt(r)!==10&&x)for(x="",r=p,o=h;r<a;){const y=c.charCodeAt(r);if(!Re(y))break;r++}if(r<a&&c.charCodeAt(r)!==10)return!1;const v=Io(c.slice(1,u));return v?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:x,href:m}),e.line=o),!0):!1}const U4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],H4="[a-zA-Z_:][a-zA-Z0-9:._-]*",q4="[^\"'=<>`\\x00-\\x20]+",j4="'[^']*'",$4='"[^"]*"',W4="(?:"+q4+"|"+j4+"|"+$4+")",G4="(?:\\s+"+H4+"(?:\\s*=\\s*"+W4+")?)",wm="<[A-Za-z][A-Za-z0-9\\-]*"+G4+"*\\s*\\/?>",_m="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",K4="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",X4="<[?][\\s\\S]*?[?]>",J4="<![A-Za-z][^>]*>",Z4="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Q4=new RegExp("^(?:"+wm+"|"+_m+"|"+K4+"|"+X4+"|"+J4+"|"+Z4+")"),Y4=new RegExp("^(?:"+wm+"|"+_m+")"),Qn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U4.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Y4.source+"\\s*$"),/^$/,!1]];function eS(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let o=e.src.slice(r,a),l=0;for(;l<Qn.length&&!Qn[l][0].test(o);l++);if(l===Qn.length)return!1;if(i)return Qn[l][2];let c=t+1;const u=Qn[l][1].test("");if(!Qn[l][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(r=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(r,a),Qn[l][1].test(o)){o.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function tS(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(r);if(o!==35||r>=a)return!1;let l=1;for(o=e.src.charCodeAt(++r);o===35&&r<a&&l<=6;)l++,o=e.src.charCodeAt(++r);if(l>6||r<a&&!Re(o))return!1;if(i)return!0;a=e.skipSpacesBack(a,r);const c=e.skipCharsBack(a,35,r);c>r&&Re(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;const u=e.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[t,e.line];const f=e.push("inline","",0);f.content=Ro(e.src.slice(r,a)),f.map=[t,e.line],f.children=[];const m=e.push("heading_close","h"+String(l),-1);return m.markup="########".slice(0,l),!0}function nS(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let a=0,o,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let h=e.bMarks[l]+e.tShift[l];const g=e.eMarks[l];if(h<g&&(o=e.src.charCodeAt(h),(o===45||o===61)&&(h=e.skipChars(h,o),h=e.skipSpaces(h),h>=g))){a=o===61?1:2;break}}if(e.sCount[l]<0)continue;let p=!1;for(let h=0,g=i.length;h<g;h++)if(i[h](e,l,n,!0)){p=!0;break}if(p)break}if(!a)return e.parentType=r,!1;const c=Ro(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const u=e.push("heading_open","h"+String(a),1);u.markup=String.fromCharCode(o),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const m=e.push("heading_close","h"+String(a),-1);return m.markup=String.fromCharCode(o),e.parentType=r,!0}function iS(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let a=t+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let u=!1;for(let f=0,m=i.length;f<m;f++)if(i[f](e,a,n,!0)){u=!0;break}if(u)break}const o=Ro(e.getLines(t,a,e.blkIndent,!1));e.line=a;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const va=[["table",z4,["paragraph","reference"]],["code",I4],["fence",R4,["paragraph","reference","blockquote","list"]],["blockquote",L4,["paragraph","reference","blockquote","list"]],["hr",B4,["paragraph","reference","blockquote","list"]],["list",F4,["paragraph","reference","blockquote"]],["reference",V4],["html_block",eS,["paragraph","reference","blockquote"]],["heading",tS,["paragraph","reference","blockquote"]],["lheading",nS],["paragraph",iS]];function Lo(){this.ruler=new Ct;for(let e=0;e<va.length;e++)this.ruler.push(va[e][0],va[e][1],{alt:(va[e][2]||[]).slice()})}Lo.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,a=e.md.options.maxNesting;let o=t,l=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<r;f++)if(u=i[f](e,o,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),o=e.line,o<n&&e.isEmpty(o)&&(l=!0,o++,e.line=o)}};Lo.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)};Lo.prototype.State=nn;function Ir(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ir.prototype.pushPending=function(){const e=new Wt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ir.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Wt(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Ir.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const x=this.src.charCodeAt(e-2);r=(x&64512)===55296?65536+(x-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===i;)a++;const o=a-e;let l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){const x=this.src.charCodeAt(a+1);l=(x&64512)===56320?65536+(l-55296<<10)+(x-56320):65533}else(l&64512)===56320&&(l=65533);const c=Ar(r)||Er(r),u=Ar(l)||Er(l),f=Cr(r),m=Cr(l),p=!m&&(!u||f||c),h=!f&&(!c||m||u);return{can_open:p&&(t||!h||c),can_close:h&&(t||!p||u),length:o}};Ir.prototype.Token=Wt;function rS(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function aS(e,t){let n=e.pos;for(;n<e.posMax&&!rS(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const oS=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function sS(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(oS);if(!r)return!1;const a=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let l=o.url;if(l.length<=a.length)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const m=e.push("text","",0);m.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-a.length,!0}function lS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let a=i-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Re(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const bc=[];for(let e=0;e<256;e++)bc.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){bc[e.charCodeAt(0)]=1});function cS(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Re(r));)n++;return e.pos=n,!0}let a=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}const o="\\"+a;if(!t){const l=e.push("text_special","",0);r<256&&bc[r]!==0?l.content=a:l.content=o,l.markup=o,l.info="escape"}return e.pos=n+1,!0}function uS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const a=e.posMax;for(;n<a&&e.src.charCodeAt(n)===96;)n++;const o=e.src.slice(r,n),l=o.length;if(e.backticksScanned&&(e.backticks[l]||0)<=r)return t||(e.pending+=o),e.pos+=l,!0;let c=n,u;for(;(u=e.src.indexOf("`",c))!==-1;){for(c=u+1;c<a&&e.src.charCodeAt(c)===96;)c++;const f=c-u;if(f===l){if(!t){const m=e.push("code_inline","code",0);m.markup=o,m.content=e.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[f]=u}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0}function dS(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let a=r.length;const o=String.fromCharCode(i);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=o,a--);for(let c=0;c<a;c+=2)l=e.push("text","",0),l.content=o+o,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function hd(e,t){let n;const i=[],r=t.length;for(let a=0;a<r;a++){const o=t[a];if(o.marker!==126||o.end===-1)continue;const l=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&i.push(l.token-1)}for(;i.length;){const a=i.pop();let o=a+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,a!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[a],e.tokens[a]=n)}}function fS(e){const t=e.tokens_meta,n=e.tokens_meta.length;hd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&hd(e,t[i].delimiters)}const Sm={tokenize:dS,postProcess:fS};function pS(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let a=0;a<r.length;a++){const o=e.push("text","",0);o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function bd(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const a=t[r.end],o=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===a.token+1,l=String.fromCharCode(r.marker),c=e.tokens[r.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?l+l:l,c.content="";const u=e.tokens[a.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function mS(e){const t=e.tokens_meta,n=e.tokens_meta.length;bd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&bd(e,t[i].delimiters)}const Cm={tokenize:pS,postProcess:mS};function hS(e,t){let n,i,r,a,o="",l="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,m=e.posMax,p=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let g=h+1;if(g<m&&e.src.charCodeAt(g)===40){for(u=!1,g++;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);if(g>=m)return!1;if(c=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(o=e.md.normalizeLink(r.str),e.md.validateLink(o)?g=r.pos:o="",c=g;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<m&&c!==g&&r.ok)for(l=r.str,g=r.pos;g<m&&(n=e.src.charCodeAt(g),!(!Re(n)&&n!==10));g++);}(g>=m||e.src.charCodeAt(g)!==41)&&(u=!0),g++}if(u){if(typeof e.env.references>"u")return!1;if(g<m&&e.src.charCodeAt(g)===91?(c=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?i=e.src.slice(c,g++):g=h+1):g=h+1,i||(i=e.src.slice(p,h)),a=e.env.references[Io(i)],!a)return e.pos=f,!1;o=a.href,l=a.title}if(!t){e.pos=p,e.posMax=h;const b=e.push("link_open","a",1),x=[["href",o]];b.attrs=x,l&&x.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=m,!0}function bS(e,t){let n,i,r,a,o,l,c,u,f="";const m=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(a=g+1,a<p&&e.src.charCodeAt(a)===40){for(a++;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);if(a>=p)return!1;for(u=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f=""),u=a;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<p&&u!==a&&l.ok)for(c=l.str,a=l.pos;a<p&&(n=e.src.charCodeAt(a),!(!Re(n)&&n!==10));a++);else c="";if(a>=p||e.src.charCodeAt(a)!==41)return e.pos=m,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<p&&e.src.charCodeAt(a)===91?(u=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?r=e.src.slice(u,a++):a=g+1):a=g+1,r||(r=e.src.slice(h,g)),o=e.env.references[Io(r)],!o)return e.pos=m,!1;f=o.href,c=o.title}if(!t){i=e.src.slice(h,g);const b=[];e.md.inline.parse(i,e.md,e.env,b);const x=e.push("image","img",0),v=[["src",f],["alt",""]];x.attrs=v,x.children=b,x.content=i,c&&v.push(["title",c])}return e.pos=a,e.posMax=p,!0}const gS=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,vS=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function xS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const a=e.src.slice(i+1,n);if(vS.test(a)){const o=e.md.normalizeLink(a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}if(gS.test(a)){const o=e.md.normalizeLink("mailto:"+a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}return!1}function yS(e){return/^<a[>\s]/i.test(e)}function kS(e){return/^<\/a\s*>/i.test(e)}function wS(e){const t=e|32;return t>=97&&t<=122}function _S(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!wS(r))return!1;const a=e.src.slice(i).match(Q4);if(!a)return!1;if(!t){const o=e.push("html_inline","",0);o.content=a[0],yS(o.content)&&e.linkLevel++,kS(o.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}const SS=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,CS=/^&([a-z][a-z0-9]{1,31});/i;function ES(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const a=e.src.slice(n).match(SS);if(a){if(!t){const o=a[1][0].toLowerCase()==="x"?parseInt(a[1].slice(1),16):parseInt(a[1],10),l=e.push("text_special","",0);l.content=mc(o)?Sr(o):Sr(65533),l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}else{const a=e.src.slice(n).match(CS);if(a){const o=$3(a[0]);if(o!==a[0]){if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}}return!1}function gd(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const a=[];for(let o=0;o<n;o++){const l=e[o];if(a.push(0),(e[i].marker!==l.marker||r!==l.token-1)&&(i=o),r=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[l.marker][(l.open?3:0)+l.length%3];let u=i-a[i]-1,f=u;for(;u>c;u-=a[u]+1){const m=e[u];if(m.marker===l.marker&&m.open&&m.end<0){let p=!1;if((m.close||l.open)&&(m.length+l.length)%3===0&&(m.length%3!==0||l.length%3!==0)&&(p=!0),!p){const h=u>0&&!e[u-1].open?a[u-1]+1:0;a[o]=o-u+h,a[u]=h,l.open=!1,m.end=o,m.close=!1,f=-1,r=-2;break}}}f!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function AS(e){const t=e.tokens_meta,n=e.tokens_meta.length;gd(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&gd(t[i].delimiters)}function TS(e){let t,n,i=0;const r=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<a&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const vs=[["text",aS],["linkify",sS],["newline",lS],["escape",cS],["backticks",uS],["strikethrough",Sm.tokenize],["emphasis",Cm.tokenize],["link",hS],["image",bS],["autolink",xS],["html_inline",_S],["entity",ES]],xs=[["balance_pairs",AS],["strikethrough",Sm.postProcess],["emphasis",Cm.postProcess],["fragments_join",TS]];function Rr(){this.ruler=new Ct;for(let e=0;e<vs.length;e++)this.ruler.push(vs[e][0],vs[e][1]);this.ruler2=new Ct;for(let e=0;e<xs.length;e++)this.ruler2.push(xs[e][0],xs[e][1])}Rr.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,a=e.cache;if(typeof a[t]<"u"){e.pos=a[t];return}let o=!1;if(e.level<r){for(let l=0;l<i;l++)if(e.level++,o=n[l](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos};Rr.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const a=e.pos;let o=!1;if(e.level<r){for(let l=0;l<n;l++)if(o=t[l](e,!1),o){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Rr.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const a=this.ruler2.getRules(""),o=a.length;for(let l=0;l<o;l++)a[l](r)};Rr.prototype.State=Ir;function NS(e){const t={};e=e||{},t.src_Any=dm.source,t.src_Cc=fm.source,t.src_Z=mm.source,t.src_P=fc.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ml(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Bo(e){return Object.prototype.toString.call(e)}function OS(e){return Bo(e)==="[object String]"}function MS(e){return Bo(e)==="[object Object]"}function DS(e){return Bo(e)==="[object RegExp]"}function vd(e){return Bo(e)==="[object Function]"}function zS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Em={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function IS(e){return Object.keys(e||{}).reduce(function(t,n){return t||Em.hasOwnProperty(n)},!1)}const RS={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},LS="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",BS="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function PS(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function xd(){return function(e,t){t.normalize(e)}}function yo(e){const t=e.re=NS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(LS),n.push(t.src_xn),t.src_tlds=n.join("|");function i(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(i(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(i(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(i(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function a(l,c){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+c)}Object.keys(e.__schemas__).forEach(function(l){const c=e.__schemas__[l];if(c===null)return;const u={validate:null,link:null};if(e.__compiled__[l]=u,MS(c)){DS(c.validate)?u.validate=PS(c.validate):vd(c.validate)?u.validate=c.validate:a(l,c),vd(c.normalize)?u.normalize=c.normalize:c.normalize?a(l,c):u.normalize=xd();return}if(OS(c)){r.push(l);return}a(l,c)}),r.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:xd()};const o=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(zS).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function Am(e,t,n,i){const r=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}function Dt(e,t){if(!(this instanceof Dt))return new Dt(e,t);t||IS(e)&&(t=e,e={}),this.__opts__=ml({},Em,t),this.__schemas__=ml({},RS,e),this.__compiled__={},this.__tlds__=BS,this.__tlds_replaced__=!1,this.re={},yo(this)}Dt.prototype.add=function(t,n){return this.__schemas__[t]=n,yo(this),this};Dt.prototype.set=function(t){return this.__opts__=ml(this.__opts__,t),this};Dt.prototype.test=function(t){if(!t.length)return!1;let n,i;if(this.re.schema_test.test(t)){for(i=this.re.schema_search,i.lastIndex=0;(n=i.exec(t))!==null;)if(this.testSchemaAt(t,n[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Dt.prototype.pretest=function(t){return this.re.pretest.test(t)};Dt.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0};Dt.prototype.match=function(t){const n=[],i=[],r=[],a=[];let o,l,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(t))!==null;)l=this.testSchemaAt(t,o[2],c.lastIndex),l&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)a.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const f=[0,0,0];let m=0;for(;;){const p=[i[f[0]],a[f[1]],r[f[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?f[0]++:h===p[1]?f[1]++:f[2]++,h.index<m)continue;const g=new Am(t,h.schema,h.index,h.lastIndex);this.__compiled__[g.schema].normalize(g,this),n.push(g),m=h.lastIndex}return n.length?n:null};Dt.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);if(!i)return null;const r=new Am(t,n[2],n.index+n[1].length,n.index+n[0].length+i);return this.__compiled__[r.schema].normalize(r,this),r};Dt.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,a){return i!==a[r-1]}).reverse(),yo(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,yo(this),this)};Dt.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Dt.prototype.onCompile=function(){};const Ti=2147483647,Zt=36,gc=1,Tr=26,FS=38,VS=700,Tm=72,Nm=128,Om="-",US=/^xn--/,HS=/[^\0-\x7F]/,qS=/[\x2E\u3002\uFF0E\uFF61]/g,jS={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ys=Zt-gc,Qt=Math.floor,ks=String.fromCharCode;function On(e){throw new RangeError(jS[e])}function $S(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Mm(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(qS,".");const r=e.split("."),a=$S(r,t).join(".");return i+a}function Dm(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const a=e.charCodeAt(n++);(a&64512)==56320?t.push(((r&1023)<<10)+(a&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const WS=e=>String.fromCodePoint(...e),GS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Zt},yd=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},zm=function(e,t,n){let i=0;for(e=n?Qt(e/VS):e>>1,e+=Qt(e/t);e>ys*Tr>>1;i+=Zt)e=Qt(e/ys);return Qt(i+(ys+1)*e/(e+FS))},Im=function(e){const t=[],n=e.length;let i=0,r=Nm,a=Tm,o=e.lastIndexOf(Om);o<0&&(o=0);for(let l=0;l<o;++l)e.charCodeAt(l)>=128&&On("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const c=i;for(let f=1,m=Zt;;m+=Zt){l>=n&&On("invalid-input");const p=GS(e.charCodeAt(l++));p>=Zt&&On("invalid-input"),p>Qt((Ti-i)/f)&&On("overflow"),i+=p*f;const h=m<=a?gc:m>=a+Tr?Tr:m-a;if(p<h)break;const g=Zt-h;f>Qt(Ti/g)&&On("overflow"),f*=g}const u=t.length+1;a=zm(i-c,u,c==0),Qt(i/u)>Ti-r&&On("overflow"),r+=Qt(i/u),i%=u,t.splice(i++,0,r)}return String.fromCodePoint(...t)},Rm=function(e){const t=[];e=Dm(e);const n=e.length;let i=Nm,r=0,a=Tm;for(const c of e)c<128&&t.push(ks(c));const o=t.length;let l=o;for(o&&t.push(Om);l<n;){let c=Ti;for(const f of e)f>=i&&f<c&&(c=f);const u=l+1;c-i>Qt((Ti-r)/u)&&On("overflow"),r+=(c-i)*u,i=c;for(const f of e)if(f<i&&++r>Ti&&On("overflow"),f===i){let m=r;for(let p=Zt;;p+=Zt){const h=p<=a?gc:p>=a+Tr?Tr:p-a;if(m<h)break;const g=m-h,b=Zt-h;t.push(ks(yd(h+g%b,0))),m=Qt(g/b)}t.push(ks(yd(m,0))),a=zm(r,u,l===o),r=0,++l}++r,++i}return t.join("")},KS=function(e){return Mm(e,function(t){return US.test(t)?Im(t.slice(4).toLowerCase()):t})},XS=function(e){return Mm(e,function(t){return HS.test(t)?"xn--"+Rm(t):t})},Lm={version:"2.3.1",ucs2:{decode:Dm,encode:WS},decode:Im,encode:Rm,toASCII:XS,toUnicode:KS},JS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},ZS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},QS={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},YS={default:JS,zero:ZS,commonmark:QS},eC=/^(vbscript|javascript|file|data):/,tC=/^data:image\/(gif|png|jpeg|webp);/;function nC(e){const t=e.trim().toLowerCase();return eC.test(t)?tC.test(t):!0}const Bm=["http:","https:","mailto:"];function iC(e){const t=dc(e,!0);if(t.hostname&&(!t.protocol||Bm.indexOf(t.protocol)>=0))try{t.hostname=Lm.toASCII(t.hostname)}catch{}return zr(uc(t))}function rC(e){const t=dc(e,!0);if(t.hostname&&(!t.protocol||Bm.indexOf(t.protocol)>=0))try{t.hostname=Lm.toUnicode(t.hostname)}catch{}return zi(uc(t),zi.defaultChars+"%")}function Et(e,t){if(!(this instanceof Et))return new Et(e,t);t||pc(e)||(t=e||{},e="default"),this.inline=new Rr,this.block=new Lo,this.core=new hc,this.renderer=new Bi,this.linkify=new Dt,this.validateLink=nC,this.normalizeLink=iC,this.normalizeLinkText=rC,this.utils=s4,this.helpers=zo({},d4),this.options={},this.configure(e),t&&this.set(t)}Et.prototype.set=function(e){return zo(this.options,e),this};Et.prototype.configure=function(e){const t=this;if(pc(e)){const n=e;if(e=YS[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Et.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Et.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Et.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Et.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Et.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Et.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Et.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const aC=new Of({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function oC(e,t){if(e.isText&&t.isText&&ze.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class sC{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:ze.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),i=n.content,r=i[i.length-1],a=this.schema.text(t,n.marks),o;r&&(o=oC(r,a))?i[i.length-1]=o:i.push(a)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let i=t[n],r=this.tokenHandlers[i.type];if(!r)throw new Error("Token type `"+i.type+"` not supported by Markdown parser");r(this,i,t,n)}}addNode(t,n,i){let r=this.top(),a=t.createAndFill(n,i,r?r.marks:[]);return a?(this.push(a),a):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:ze.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function Ji(e,t,n,i){return e.getAttrs?e.getAttrs(t,n,i):e.attrs instanceof Function?e.attrs(t):e.attrs}function ws(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function kd(e){return e[e.length-1]==`
|
|
15215
|
-
`?e.slice(0,e.length-1):e}function _s(){}function lC(e,t){let n=Object.create(null);for(let i in t){let r=t[i];if(r.block){let a=e.nodeType(r.block);ws(r,i)?n[i]=(o,l,c,u)=>{o.openNode(a,Ji(r,l,c,u)),o.addText(kd(l.content)),o.closeNode()}:(n[i+"_open"]=(o,l,c,u)=>o.openNode(a,Ji(r,l,c,u)),n[i+"_close"]=o=>o.closeNode())}else if(r.node){let a=e.nodeType(r.node);n[i]=(o,l,c,u)=>o.addNode(a,Ji(r,l,c,u))}else if(r.mark){let a=e.marks[r.mark];ws(r,i)?n[i]=(o,l,c,u)=>{o.openMark(a.create(Ji(r,l,c,u))),o.addText(kd(l.content)),o.closeMark(a)}:(n[i+"_open"]=(o,l,c,u)=>o.openMark(a.create(Ji(r,l,c,u))),n[i+"_close"]=o=>o.closeMark(a))}else if(r.ignore)ws(r,i)?n[i]=_s:(n[i+"_open"]=_s,n[i+"_close"]=_s);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(r))}return n.text=(i,r)=>i.addText(r.content),n.inline=(i,r)=>i.parseTokens(r.children),n.softbreak=n.softbreak||(i=>i.addText(" ")),n}let cC=class{constructor(t,n,i){this.schema=t,this.tokenizer=n,this.tokens=i,this.tokenHandlers=lC(t,i)}parse(t,n={}){let i=new sC(this.schema,this.tokenHandlers),r;i.parseTokens(this.tokenizer.parse(t,n));do r=i.closeNode();while(i.stack.length);return r||this.schema.topNodeType.createAndFill()}};function wd(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new cC(aC,Et("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:wd(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:wd(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const uC={open:"",close:"",mixable:!0};let dC=class{constructor(t,n,i={}){this.nodes=t,this.marks=n,this.options=i}serialize(t,n={}){n=Object.assign({},this.options,n);let i=new Pm(this.nodes,this.marks,n);return i.renderContent(t),i.out}};const rn=new dC({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),i=n?n.sort().slice(-1)[0]+"`":"```";e.write(i+(t.attrs.params||"")+`
|
|
15216
|
-
`),e.text(t.textContent,!1),e.write(`
|
|
15217
|
-
`),e.write(i),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){var n;let i=(n=t.attrs.order)!==null&&n!==void 0?n:1,r=String(i+t.childCount-1).length,a=e.repeat(" ",r+2);e.renderList(t,a,o=>{let l=String(i+o);return e.repeat(" ",r-l.length)+l+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(`\\
|
|
15218
|
-
`);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,i){return e.inAutolink=fC(t,n,i),e.inAutolink?"<":"["},close(e,t,n,i){let{inAutolink:r}=e;return e.inAutolink=void 0,r?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,i){return _d(n.child(i),-1)},close(e,t,n,i){return _d(n.child(i-1),1)},escape:!1}});function _d(e,t){let n=/`+/g,i,r=0;if(e.isText)for(;i=n.exec(e.text);)r=Math.max(r,i[0].length);let a=r>0&&t>0?" `":"`";for(let o=0;o<r;o++)a+="`";return r>0&&t<0&&(a+=" "),a}function fC(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let i=t.child(n);return!i.isText||i.text!=e.attrs.href||i.marks[i.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let Pm=class{constructor(t,n,i){this.nodes=t,this.marks=n,this.options=i,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
15219
|
-
`),t>1){let n=this.delim,i=/\s+$/.exec(n);i&&(n=n.slice(0,n.length-i[0].length));for(let r=1;r<t;r++)this.out+=n+`
|
|
15220
|
-
`}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=uC}return n}wrapBlock(t,n,i,r){let a=this.delim;this.write(n??t),this.delim+=t,r(),this.delim=a,this.closeBlock(i)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
15221
|
-
`)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let i=t.split(`
|
|
15222
|
-
`);for(let r=0;r<i.length;r++)this.write(),!n&&i[r][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(i[r],this.atBlockStart):i[r],r!=i.length-1&&(this.out+=`
|
|
15223
|
-
`)}render(t,n,i){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,i);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,i,r)=>this.render(n,t,r))}renderInline(t,n=!0){this.atBlockStart=n;let i=[],r="",a=(o,l,c)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(b=>{if(c+1==t.childCount)return!1;let x=t.child(c+1);return b.isInSet(x.marks)&&(!x.isText||/\S/.test(x.text))}));let f=r;if(r="",o&&o.isText&&u.some(b=>{let x=this.getMark(b.type.name);return x&&x.expelEnclosingWhitespace&&!b.isInSet(i)})){let[b,x,v]=/^(\s*)(.*)$/m.exec(o.text);x&&(f+=x,o=v?o.withText(v):null,o||(u=i))}if(o&&o.isText&&u.some(b=>{let x=this.getMark(b.type.name);return x&&x.expelEnclosingWhitespace&&!this.isMarkAhead(t,c+1,b)})){let[b,x,v]=/^(.*?)(\s*)$/m.exec(o.text);v&&(r=v,o=x?o.withText(x):null,o||(u=i))}let m=u.length?u[u.length-1]:null,p=m&&this.getMark(m.type.name).escape===!1,h=u.length-(p?1:0);e:for(let b=0;b<h;b++){let x=u[b];if(!this.getMark(x.type.name).mixable)break;for(let v=0;v<i.length;v++){let y=i[v];if(!this.getMark(y.type.name).mixable)break;if(x.eq(y)){b>v?u=u.slice(0,v).concat(x).concat(u.slice(v,b)).concat(u.slice(b+1,h)):v>b&&(u=u.slice(0,b).concat(u.slice(b+1,v)).concat(x).concat(u.slice(v,h)));continue e}}}let g=0;for(;g<Math.min(i.length,h)&&u[g].eq(i[g]);)++g;for(;g<i.length;)this.text(this.markString(i.pop(),!1,t,c),!1);if(f&&this.text(f),o){for(;i.length<h;){let b=u[i.length];i.push(b),this.text(this.markString(b,!0,t,c),!1),this.atBlockStart=!1}p&&o.isText?this.text(this.markString(m,!0,t,c)+o.text+this.markString(m,!1,t,c+1),!1):this.render(o,t,c),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(a),a(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,i){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,a=this.inTightList;this.inTightList=r,t.forEach((o,l,c)=>{c&&r&&this.flushClose(1),this.wrapBlock(n,i(c),t,()=>this.render(o,t,c))}),this.inTightList=a}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(i,r)=>i=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?i:"\\"+i),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let i="";for(let r=0;r<n;r++)i+=t;return i}markString(t,n,i,r){let a=this.getMark(t.type.name),o=n?a.open:a.close;return typeof o=="string"?o:o(this,t,i,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,i){for(;;n++){if(n>=t.childCount)return!1;let r=t.child(n);if(r.type.name!=this.options.hardBreakNodeName)return i.isInSet(r.marks);n++}}};var hl=!0,Fm=!1,Vm=!1,pC=function(e,t){t&&(hl=!t.enabled,Fm=!!t.label,Vm=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)hC(i,r)&&(bC(i[r],n.Token),Sd(i[r-2],"class","task-list-item"+(hl?"":" enabled")),Sd(i[mC(i,r-2)],"class","contains-task-list"))})};function Sd(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function mC(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function hC(e,t){return kC(e[t])&&wC(e[t-1])&&_C(e[t-2])&&SC(e[t])}function bC(e,t){if(e.children.unshift(gC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Fm)if(Vm){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(yC(e.content,n,t))}else e.children.unshift(vC(t)),e.children.push(xC(t))}function gC(e,t){var n=new t("html_inline","",0),i=hl?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function vC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function xC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function yC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function kC(e){return e.type==="inline"}function wC(e){return e.type==="paragraph_open"}function _C(e){return e.type==="list_item_open"}function SC(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const CC=zf(pC);var EC=Object.defineProperty,AC=(e,t,n)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ko=(e,t,n)=>(AC(e,typeof t!="symbol"?t+"":t,n),n);const TC=je.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:i,commands:r}=n;function a(o){if(!i.isActive(o))return!1;const l=i.getAttributes(o);return r.updateAttributes(o,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(o=>a(o))}}}}}),Cd=Et();function Um(e,t){return Cd.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new Cd.inline.State(e,null,null,[]).scanDelims(t,!0)}function Hm(e,t,n,i){let r=e.substring(0,n)+e.substring(n+t.length);return r=r.substring(0,n+i)+t+r.substring(n+i),r}function NC(e,t,n,i){let r=n,a=e;for(;r<i&&!Um(a,r).can_open;)a=Hm(a,t,r,1),r++;return{text:a,from:r,to:i}}function OC(e,t,n,i){let r=i,a=e;for(;r>n&&!Um(a,r).can_close;)a=Hm(a,t,r,-1),r--;return{text:a,from:n,to:r}}function MC(e,t,n,i){let r={text:e,from:n,to:i};return r=NC(r.text,t,r.from,r.to),r=OC(r.text,t,r.from,r.to),r.to-r.from<t.length+1&&(r.text=r.text.substring(0,r.from)+r.text.substring(r.to+t.length)),r.text}class DC extends Pm{constructor(t,n,i){super(t,n,i??{}),ko(this,"inTable",!1),this.inlines=[]}render(t,n,i){super.render(t,n,i);const r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!==null&&r!==void 0&&r.end){const{delimiter:a,start:o,end:l}=this.normalizeInline(r);this.out=MC(this.out,a,o,l),this.inlines.pop()}}markString(t,n,i,r){const a=this.marks[t.type.name];if(a.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:a.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,n,i,r)}normalizeInline(t){let{start:n,end:i}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const qm=St.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,i;return this.editor.storage.markdown.options.html?(n=(i=Ed(t))===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,i;return this.editor.storage.markdown.options.html&&(n=(i=Ed(t))===null||i===void 0?void 0:i[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function Ed(e){const t=e.type.schema,n=t.text(" ",[e]),r=Lp(J.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function vc(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function zC(e){return e==null?void 0:e.replace(/</g,"<").replace(/>/g,">")}function IC(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function RC(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Po=Se.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(LC(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function LC(e,t){const n=e.type.schema,i=Lp(J.from(e),n);return e.isBlock&&(t instanceof J||t.type.name===n.topNodeType.name)?BC(i):i}function BC(e){const n=vc(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
15224
|
-
${n.innerHTML}
|
|
15225
|
-
`:`
|
|
15226
|
-
`,n.outerHTML}const PC=Se.create({name:"blockquote"}),FC=PC.extend({addStorage(){return{markdown:{serialize:rn.nodes.blockquote,parse:{}}}}}),VC=Se.create({name:"bulletList"}),jm=VC.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),UC=Se.create({name:"codeBlock"}),HC=UC.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
|
|
15227
|
-
`),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),qC=Se.create({name:"hardBreak"}),$m=qC.extend({addStorage(){return{markdown:{serialize(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(e.inTable?Po.storage.markdown.serialize.call(this,e,t,n):`\\
|
|
15228
|
-
`);return}},parse:{}}}}}),jC=Se.create({name:"heading"}),$C=jC.extend({addStorage(){return{markdown:{serialize:rn.nodes.heading,parse:{}}}}}),WC=Se.create({name:"horizontalRule"}),GC=WC.extend({addStorage(){return{markdown:{serialize:rn.nodes.horizontal_rule,parse:{}}}}}),KC=Se.create({name:"image"}),XC=KC.extend({addStorage(){return{markdown:{serialize:rn.nodes.image,parse:{}}}}}),JC=Se.create({name:"listItem"}),ZC=JC.extend({addStorage(){return{markdown:{serialize:rn.nodes.list_item,parse:{}}}}}),QC=Se.create({name:"orderedList"});function YC(e,t,n){let i=0;for(;n-i>0&&t.child(n-i-1).type.name===e.type.name;i++);return i}const eE=QC.extend({addStorage(){return{markdown:{serialize(e,t,n,i){const r=t.attrs.start||1,a=String(r+t.childCount-1).length,o=e.repeat(" ",a+2),c=YC(t,n,i)%2?") ":". ";e.renderList(t,o,u=>{const f=String(r+u);return e.repeat(" ",a-f.length)+f+c})},parse:{}}}}}),tE=Se.create({name:"paragraph"}),nE=tE.extend({addStorage(){return{markdown:{serialize:rn.nodes.paragraph,parse:{}}}}});function Ss(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const iE=Se.create({name:"table"}),rE=iE.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!aE(t)){Po.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((i,r,a)=>{if(e.write("| "),i.forEach((o,l,c)=>{c&&e.write(" | ");const u=o.firstChild;u.textContent.trim()&&e.renderInline(u)}),e.write(" |"),e.ensureNewLine(),!a){const o=Array.from({length:i.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function Ad(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function aE(e){const t=Ss(e),n=t[0],i=t.slice(1);return!(Ss(n).some(r=>r.type.name!=="tableHeader"||Ad(r)||r.childCount>1)||i.some(r=>Ss(r).some(a=>a.type.name==="tableHeader"||Ad(a)||a.childCount>1)))}const oE=Se.create({name:"taskItem"}),sE=oE.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),lE=Se.create({name:"taskList"}),cE=lE.extend({addStorage(){return{markdown:{serialize:jm.storage.markdown.serialize,parse:{setup(e){e.use(CC)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),uE=Se.create({name:"text"}),dE=uE.extend({addStorage(){return{markdown:{serialize(e,t){e.text(zC(t.text))},parse:{}}}}}),fE=St.create({name:"bold"}),pE=fE.extend({addStorage(){return{markdown:{serialize:rn.marks.strong,parse:{}}}}}),mE=St.create({name:"code"}),hE=mE.extend({addStorage(){return{markdown:{serialize:rn.marks.code,parse:{}}}}}),bE=St.create({name:"italic"}),gE=bE.extend({addStorage(){return{markdown:{serialize:rn.marks.em,parse:{}}}}}),vE=St.create({name:"link"}),xE=vE.extend({addStorage(){return{markdown:{serialize:rn.marks.link,parse:{}}}}}),yE=St.create({name:"strike"}),kE=yE.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),wE=[FC,jm,HC,$m,$C,GC,Po,XC,ZC,eE,nE,rE,sE,cE,dE,pE,hE,qm,gE,xE,kE];function wo(e){var t,n;const i=(t=e.storage)===null||t===void 0?void 0:t.markdown,r=(n=wE.find(a=>a.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return i||r?{...r,...i}:null}class _E{constructor(t){ko(this,"editor",null),this.editor=t}serialize(t){const n=new DC(this.nodes,this.marks,{hardBreakNodeName:$m.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Po)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(qm)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=wo(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const i=(n=wo(t))===null||n===void 0?void 0:n.serialize;return i?{...i,open:typeof i.open=="function"?i.open.bind({editor:this.editor,options:t.options}):i.open,close:typeof i.close=="function"?i.close.bind({editor:this.editor,options:t.options}):i.close}:null}}class SE{constructor(t,n){ko(this,"editor",null),ko(this,"md",null);let{html:i,linkify:r,breaks:a}=n;this.editor=t,this.md=this.withPatchedRenderer(Et({html:i,linkify:r,breaks:a}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=wo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},this.md)});const i=this.md.render(t),r=vc(i);return this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=wo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},r)}),this.normalizeDOM(r,{inline:n,content:t}),r.innerHTML}return t}normalizeDOM(t,n){let{inline:i,content:r}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(a=>{var o;((o=a.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!a.closest("pre")&&(a.nextSibling.textContent=a.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(t,r),t}normalizeBlocks(t){const i=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var a;return(a=r.spec.parseDOM)===null||a===void 0?void 0:a.map(o=>o.tag)}).flat().filter(Boolean).join(",");i&&[...t.querySelectorAll(i)].forEach(r=>{r.parentElement.matches("p")&&IC(r)})}normalizeInline(t,n){var i;if((i=t.firstElementChild)!==null&&i!==void 0&&i.matches("p")){var r,a,o,l;const c=t.firstElementChild,{nextElementSibling:u}=c,f=(r=(a=n.match(/^\s+/))===null||a===void 0?void 0:a[0])!==null&&r!==void 0?r:"",m=u?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${m}`;return}RC(c),t.innerHTML=`${f}${t.innerHTML}${m}`}}withPatchedRenderer(t){const n=i=>function(){const r=i(...arguments);return r===`
|
|
15229
|
-
`?r:r[r.length-1]===`
|
|
15230
|
-
`?r.slice(0,-1):r};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const CE=je.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new dt({key:new at("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const i=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ir.fromSchema(this.editor.schema).parseSlice(vc(i),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),EE=je.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=lw.Commands.config.addCommands();return{setContent:(t,n,i)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n,i)(r),insertContentAt:(t,n,i)=>r=>e.insertContentAt(t,r.editor.storage.markdown.parser.parse(n,{inline:!0}),i)(r)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new SE(this.editor,this.options),serializer:new _E(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[TC.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),CE.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});_e.definePlugin({id:"formatting",tiptapExtensions:[Nw],toolbar:[{id:"bold",label:"Bold",action:"toggleBold",iconComponent:"Bold"},{id:"italic",label:"Italic",action:"toggleItalic",iconComponent:"Italic"},{id:"underline",label:"Underline",action:"toggleUnderline",iconComponent:"Underline"},{id:"strike",label:"Strikethrough",action:"toggleStrike",iconComponent:"Strikethrough"}]});function wi(e){return t=>t.commands.toggleHeading({level:e})}_e.definePlugin({id:"headings",toolbar:[{id:"heading-1",label:"Heading 1",action:"toggleHeading1",iconComponent:"Heading1"},{id:"heading-2",label:"Heading 2",action:"toggleHeading2",iconComponent:"Heading2"},{id:"heading-3",label:"Heading 3",action:"toggleHeading3",iconComponent:"Heading3"},{id:"heading-4",label:"Heading 4",action:"toggleHeading4",iconComponent:"Heading4"},{id:"heading-5",label:"Heading 5",action:"toggleHeading5",iconComponent:"Heading5"},{id:"heading-6",label:"Heading 6",action:"toggleHeading6",iconComponent:"Heading6"}],slashCommands:[{name:"Heading 1",command:"toggleHeading1"},{name:"Heading 2",command:"toggleHeading2"},{name:"Heading 3",command:"toggleHeading3"}],commands:{toggleHeading1:wi(1),toggleHeading2:wi(2),toggleHeading3:wi(3),toggleHeading4:wi(4),toggleHeading5:wi(5),toggleHeading6:wi(6)}});_e.definePlugin({id:"lists",tiptapExtensions:[Ow,Dw.configure({nested:!0})],toolbar:[{id:"bullet-list",label:"Bullet List",action:"toggleBulletList",iconComponent:"List"},{id:"ordered-list",label:"Ordered List",action:"toggleOrderedList",iconComponent:"ListOrdered"},{id:"task-list",label:"Task List",action:"toggleTaskList",iconComponent:"CheckSquare"}],slashCommands:[{name:"Bullet List",command:"toggleBulletList"},{name:"Ordered List",command:"toggleOrderedList"},{name:"Task List",command:"toggleTaskList"}]});function xa(e){return t=>t.commands.setTextAlign(e)}_e.definePlugin({id:"alignment",tiptapExtensions:[zw.configure({types:["heading","paragraph"]})],toolbar:[{id:"align-left",label:"Align Left",action:"alignLeft",iconComponent:"AlignLeft"},{id:"align-center",label:"Align Center",action:"alignCenter",iconComponent:"AlignCenter"},{id:"align-right",label:"Align Right",action:"alignRight",iconComponent:"AlignRight"},{id:"align-justify",label:"Align Justify",action:"alignJustify",iconComponent:"AlignJustify"}],commands:{alignLeft:xa("left"),alignCenter:xa("center"),alignRight:xa("right"),alignJustify:xa("justify")}});_e.definePlugin({id:"link",tiptapExtensions:[a_.configure({openOnClick:!0})],toolbar:[{id:"set-link",label:"Link",action:"setLink",iconComponent:"Link"}],slashCommands:[{name:"Link",command:"setLink"}],commands:{setLink:(e,...t)=>{if(e.isActive("link"))return e.chain().focus().unsetLink().run();const n=t[0],i=(n==null?void 0:n.href)??(typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter link URL:","https://"):null);return i?e.chain().focus().setLink({href:i,target:"_blank"}).run():!1}}});function AE(){return typeof document>"u"?Promise.resolve(null):new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept="image/*";const n=()=>t.remove();t.onchange=()=>{var r;const i=((r=t.files)==null?void 0:r[0])??null;n(),e(i)},t.oncancel=()=>{n(),e(null)},document.body.appendChild(t),t.click()})}_e.definePlugin({id:"image",tiptapExtensions:[s_],toolbar:[{id:"insert-image",label:"Image",action:"insertImage",iconComponent:"Image"}],slashCommands:[{name:"Image",command:"insertImage"}],commands:{insertImage:(e,...t)=>{const n=t[0];if(n!=null&&n.src)return e.commands.setImage({src:n.src,alt:n.alt,title:n.title});const i=e.storage.editorContext,r=i==null?void 0:i.onImageUpload;if(r)return AE().then(async a=>{if(a)try{const o=await r(a);o!=null&&o.src&&e.commands.setImage({src:o.src,alt:o.alt,title:o.title})}catch(o){console.error("[image] upload failed:",o)}}),!0;if(typeof window<"u"&&typeof window.prompt=="function"){const a=window.prompt("Enter image URL:","https://");return a?e.commands.setImage({src:a}):!1}return!1}}});var TE=u3.extend({renderHTML({node:e,HTMLAttributes:t}){let n=0;const i=e.firstChild;i&&i.forEach(c=>{n+=c.attrs.colspan||1});const r=[];let a=0,o=!1;if(n>0)for(let c=0;c<n;c++){let u=null;if(i){let f=0;i.forEach(m=>{const p=m.attrs.colspan||1;if(c>=f&&c<f+p){const h=m.attrs.colwidth;if(h&&Array.isArray(h)){const g=c-f,b=h[g];typeof b=="number"&&b>0&&(u=b)}}f+=p})}u&&(a+=u,o=!0),r.push(["col",u?{style:`width: ${u}px !important`,width:String(u)}:{}])}const l=Be(t);if(o&&a>0){const c=l.style||"";l.style=c?`${c}; width: ${a}px !important`:`width: ${a}px !important`}return["table",l,["colgroup",...r],["tbody",0]]}}),NE=f3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}}),OE=p3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}});_e.definePlugin({id:"table",tiptapExtensions:[TE.configure({resizable:!1}),d3,NE,OE],toolbar:[{id:"insert-table",label:"Insert Table",action:"insertTable",args:[{rows:3,cols:3,withHeaderRow:!0}],iconComponent:"Table"}],slashCommands:[{name:"Table",command:"insertTable"}]});_e.definePlugin({id:"blockquote",toolbar:[{id:"blockquote",label:"Blockquote",action:"toggleBlockquote",iconComponent:"Quote"}],slashCommands:[{name:"Blockquote",command:"toggleBlockquote"}]});_e.definePlugin({id:"code-block",toolbar:[{id:"code-block",label:"Code Block",action:"toggleCodeBlock",iconComponent:"Code"}],slashCommands:[{name:"Code Block",command:"toggleCodeBlock"}]});function ME(e={}){return _e.definePlugin({id:"placeholder",tiptapExtensions:[m3.configure({placeholder:e.placeholder??"Start writing…"})]})}ME();var DE=Se.create({name:"pageBreak",group:"block",selectable:!1,draggable:!1,parseHTML(){return[{tag:'div[data-page-break="true"]'}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-page-break":"true","data-node-type":"pageBreak",class:"docs-editor-page-break"}),["span",{class:"docs-editor-page-break__label"},"Page break"]]},addNodeView(){return()=>{const e=document.createElement("div");e.className="docs-editor-page-break",e.setAttribute("data-page-break","true"),e.setAttribute("data-node-type","pageBreak"),e.setAttribute("contenteditable","false");const t=document.createElement("div");t.className="docs-editor-page-break__inner";const n=document.createElement("div");n.className="docs-editor-page-break__line";const i=document.createElement("span");return i.className="docs-editor-page-break__label-text",i.textContent="Page break",t.appendChild(n),t.appendChild(i),e.appendChild(t),{dom:e,contentDOM:void 0}}}});_e.definePlugin({id:"pageBreak",tiptapExtensions:[DE],toolbar:[{id:"insert-page-break",label:"Page Break",action:"insertPageBreak",iconComponent:"FileText"}],slashCommands:[{name:"Page Break",command:"insertPageBreak"}],commands:{insertPageBreak:e=>e.chain().focus().insertContent([{type:"pageBreak"},{type:"paragraph"}]).run()}});var zE=Se.create({name:"footnote",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{content:{default:"",parseHTML:e=>e.getAttribute("data-footnote-content")??"",renderHTML:e=>({"data-footnote-content":e.content})},citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>e.citationId?{"data-citation-id":e.citationId}:{}},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-footnote-source-id"),renderHTML:e=>e.sourceId?{"data-footnote-source-id":e.sourceId}:{}},locator:{default:"",parseHTML:e=>e.getAttribute("data-footnote-locator")??"",renderHTML:e=>e.locator?{"data-footnote-locator":e.locator}:{}}}},parseHTML(){return[{tag:'span[data-node-type="footnote"]'}]},renderHTML({HTMLAttributes:e}){return["span",Be(e,{"data-node-type":"footnote",class:"docs-footnote-ref"}),"1"]},addNodeView(){return e=>{const t=e.node??e,n=t&&typeof t=="object"&&"attrs"in t?t.attrs:{},i=document.createElement("span");return i.className="docs-footnote-ref",i.setAttribute("data-node-type","footnote"),i.setAttribute("data-footnote-content",String(n.content??"")),n.sourceId&&(i.setAttribute("data-footnote-source-id",String(n.sourceId)),i.setAttribute("data-citation-id",String(n.citationId??"")),n.locator&&i.setAttribute("data-footnote-locator",String(n.locator))),i.textContent="1",{dom:i,update(r){try{const a=(r==null?void 0:r.attrs)??{};i.setAttribute("data-footnote-content",String(a.content??"")),a.sourceId?(i.setAttribute("data-footnote-source-id",String(a.sourceId)),i.setAttribute("data-citation-id",String(a.citationId??"")),a.locator&&i.setAttribute("data-footnote-locator",String(a.locator))):(i.removeAttribute("data-footnote-source-id"),i.removeAttribute("data-citation-id"),i.removeAttribute("data-footnote-locator"))}catch{}return!0}}}}});_e.definePlugin({id:"footnote",tiptapExtensions:[zE],toolbar:[{id:"insert-footnote",label:"Catatan Kaki",action:"insertFootnote",iconComponent:"FileText"}],slashCommands:[{name:"Catatan Kaki",command:"insertFootnote"}],commands:{insertFootnote:(e,...t)=>{const n=t[0];return e.chain().focus().insertContent({type:"footnote",attrs:{content:(n==null?void 0:n.content)??""}}).run()}}});function Wm(e){const t=[];return e.descendants((n,i)=>{if(n.type.name==="heading"){const r=n.attrs.level;(r===1||r===2||r===3)&&t.push({level:r,text:n.textContent.trim(),pos:i})}return!0}),t}function IE(e){return Wm(e.state.doc)}function Gm(e){let t=[];try{const i=e.view.dom.querySelector("[data-rm-pagination]");i&&(t=Array.from(i.querySelectorAll(".rm-page-break .breaker")).filter(r=>r instanceof HTMLElement))}catch{}if(t.length===0)return()=>null;const n=e.view.dom;return i=>{try{const a=e.view.coordsAtPos(i).top-n.getBoundingClientRect().top+n.scrollTop;let o=1;for(const l of t){if(a<l.offsetTop)return o;o++}return o}catch{return null}}}function RE(e,t,n){const i=e.nodes.tocEntry;return t.length===0?[i.create({level:1,pos:0})]:t.map(r=>{const a=[];r.text&&a.push(e.text(r.text));const o=n(r.pos);return o!==null&&a.push(e.nodes.tocPageNum.create({page:o})),i.create({level:r.level,pos:r.pos},a)})}function LE(e){const t=IE(e);if(t.length===0)return[{type:"tocEntry",attrs:{level:1,pos:0}}];const n=Gm(e);return t.map(i=>{const r=[];i.text&&r.push({type:"text",text:i.text});const a=n(i.pos);return a!==null&&r.push({type:"tocPageNum",attrs:{page:a}}),{type:"tocEntry",attrs:{level:i.level,pos:i.pos},...r.length>0?{content:r}:{}}})}function Km(e,t){const n=e.schema.nodes.toc;if(!n)return!1;const i=[];if(t.doc.descendants((a,o)=>a.type.name==="toc"?(i.push({pos:o,nodeSize:a.nodeSize}),!1):!0),i.length===0)return!1;const r=RE(e.schema,Wm(t.doc),Gm(e));for(const a of i.reverse())t.replaceWith(a.pos,a.pos+a.nodeSize,n.create(null,r));return!0}function Xm(e){const t=e.state.tr;return Km(e,t)?(e.view.dispatch(t),!0):!1}var BE=je.create({name:"tocCommands",addCommands(){return{insertToc:()=>({editor:e,chain:t})=>t().focus().insertContent({type:"toc",content:LE(e)}).run(),refreshToc:()=>({editor:e,tr:t})=>Km(e,t)}}}),PE=Se.create({name:"tocPageNum",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{page:{default:null,parseHTML:e=>Number(e.textContent)||null,renderHTML:e=>e.page?{"data-page":e.page}:{}}}},parseHTML(){return[{tag:"span[data-toc-page]"}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-toc-page":"",class:"docs-toc__page"}),String(e.attrs.page??"")]}}),FE=Se.create({name:"tocEntry",content:"inline*",defining:!0,addAttributes(){return{level:{default:1,parseHTML:e=>Number(e.getAttribute("data-level")??1),renderHTML:e=>({"data-level":e.level})},pos:{default:0,parseHTML:e=>Number(e.getAttribute("data-pos")??0),renderHTML:e=>({"data-pos":e.pos})}}},parseHTML(){return[{tag:"p[data-toc-entry]"}]},renderHTML({HTMLAttributes:e}){return["p",Be(e,{"data-toc-entry":"",class:"docs-toc__entry"}),0]}}),VE=Se.create({name:"toc",group:"block",content:"tocEntry+",defining:!0,parseHTML(){return[{tag:"div[data-toc]"}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-toc":"",class:"docs-toc"}),0]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-toc",n.setAttribute("data-toc","");const i=document.createElement("div");i.className="docs-toc__chrome",i.contentEditable="false";const r=document.createElement("span");r.className="docs-toc__caption",r.textContent="Table of contents";const a=document.createElement("button");a.type="button",a.className="docs-toc__refresh",a.title="Refresh table of contents",a.textContent="⟳",i.appendChild(r),i.appendChild(a);const o=document.createElement("div");o.className="docs-toc__entries",n.appendChild(i),n.appendChild(o);const l=u=>{u.preventDefault(),Xm(t)},c=u=>{var h,g;const f=(g=(h=u.target)==null?void 0:h.closest)==null?void 0:g.call(h,"[data-toc-entry]");if(!f)return;const m=Number(f.getAttribute("data-pos")??0),p=Math.min(Math.max(0,m),t.state.doc.content.size);t.chain().focus().setTextSelection(p).scrollIntoView().run()};return a.addEventListener("click",l),n.addEventListener("click",c),{dom:n,contentDOM:o,update(u){var f;return((f=u==null?void 0:u.type)==null?void 0:f.name)==="toc"},destroy(){a.removeEventListener("click",l),n.removeEventListener("click",c)}}}}});_e.definePlugin({id:"toc",tiptapExtensions:[PE,FE,VE,BE],slashCommands:[{name:"Table of contents",description:"Daftar isi",command:"insertToc"}],commands:{insertToc:e=>e.commands.insertToc(),refreshToc:e=>Xm(e)}});_e.definePlugin({id:"font-size",tiptapExtensions:[_e.FontSizeExtension],commands:{setFontSize:(e,...t)=>{const n=t[0]||"16px";return n==="16px"?e.commands.unsetFontSize():e.commands.setFontSize(n),e.commands.focus(),!0}}});_e.definePlugin({id:"text-color",tiptapExtensions:[b3],toolbar:[{id:"text-color",label:"Text Color",action:"setTextColor",iconComponent:"Palette"}],commands:{setTextColor:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetColor().run():e.chain().focus().setColor(n).run():!1}}});var UE=x3.extend({parseHTML(){return[{tag:"mark"},{tag:"span",style:"background-color"}]},renderHTML({HTMLAttributes:e}){return["mark",Be(this.options.HTMLAttributes,e),0]}});_e.definePlugin({id:"highlight",tiptapExtensions:[UE.configure({multicolor:!0})],toolbar:[{id:"highlight",label:"Highlight",action:"setHighlight",iconComponent:"Highlighter"}],commands:{setHighlight:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetHighlight().run():e.chain().focus().toggleHighlight({color:n}).run():e.chain().focus().toggleHighlight().run()}}});function HE(e){const t=e.storage.markdown;if(!t||typeof t!="object")return;const n=t.parser;if(!(!n||typeof n!="object"||!("parse"in n)))return n}function Jm(e,t,n){const i=HE(e);if(!i)return null;let r;try{r=i.parse(t,{inline:n.inline})}catch{return null}if(typeof r!="string")return null;const a=Mi(r,e.schema,{slice:!0,parseOptions:{preserveWhitespace:"full"}});return a instanceof J?a:J.from(a)}function qE(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}function Td(e,t,n,i,r){const a=Jm(e,r,{inline:!1});if(!a){t.dispatch(t.state.tr.insertText(r,n,i));return}const o=t.state.tr;let l=n,c=i;if(l===c){let f=!0;if(a.forEach(m=>{m.isBlock||(f=!1)}),f){const p=o.doc.resolve(l).parent;p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}}let u=!0;if(a.forEach(f=>{(!f.isText||f.marks.length>0)&&(u=!1)}),u){let f="";a.forEach(m=>{m.isText&&(f+=m.text??"")}),o.insertText(f,l,c)}else o.replaceWith(l,c,a);qE(o,0,-1),t.dispatch(o)}var tt=new at("docflow-ai"),Nd=1500;function bl(e){var t;return(t=e.storage.editorContext)==null?void 0:t.aiStream}function Od(e,t,n){return{before:e.doc.textBetween(Math.max(0,t-Nd),t,`
|
|
15229
|
+
`,IE=zE,xa={"chicago-notes-bibliography":{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)",category:"note",xml:EE},"chicago-author-date":{id:"chicago-author-date",name:"Chicago (author-date)",category:"in-text",xml:TE},apa:{id:"apa",name:"APA",category:"in-text",xml:OE},"modern-language-association":{id:"modern-language-association",name:"MLA",category:"in-text",xml:DE}},RE="chicago-notes-bibliography",LE=IE,Sd=0;function Km(){return Sd+=1,`cite-${Date.now().toString(36)}-${Sd.toString(36)}`}var BE=/^<\/?(i|b|em|strong|sup|sub|span|nobr)( style="font-variant: ?small-caps;?")?\/?>$|^<div class="csl-entry">$|^<\/div>$/;function Cd(e){return e.replace(/<[^>]*>/g,t=>BE.test(t)?t:t.replace(/</g,"<").replace(/>/g,">"))}var PE=class{constructor(e={}){dn(this,"sources",new Map);dn(this,"style");dn(this,"clusters",new Map);dn(this,"order",[]);dn(this,"rendered",new Map);dn(this,"bibliography",[]);dn(this,"listeners",new Set);dn(this,"lastSignature","");this.style=e.style&&xa[e.style]?e.style:RE,this.updateSources(e.sources??[],!1)}getStyle(){return this.style}isNoteStyle(){var e;return((e=xa[this.style])==null?void 0:e.category)==="note"}getSource(e){return this.sources.get(e)}getSourceIds(){return[...this.sources.keys()]}getCitedSourceIds(){const e=new Set;for(const t of this.clusters.values())t.sourceId&&e.add(t.sourceId);return[...e]}setStyle(e){!xa[e]||e===this.style||(this.style=e,this.recompute(),this.emitChange())}updateSources(e,t=!0){this.sources=new Map(e.map(n=>[n.id,n])),this.recompute(),t&&this.emitChange()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}syncCitations(e){const t=e.map(n=>{const i=n.attrs;return`${n.citationId}|${i.sourceId??""}|${i.locator??""}|${i.label??""}|${i.mode??""}|${i.prefix??""}|${i.suffix??""}`}).join(`
|
|
15230
|
+
`);return t===this.lastSignature?!1:(this.lastSignature=t,this.clusters=new Map(e.map(n=>[n.citationId,n.attrs])),this.order=e.map(n=>n.citationId),this.recompute(),this.emitChange(),!0)}renderCluster(e){return this.rendered.get(e)??""}getBibliography(){return this.bibliography}emitChange(){for(const e of this.listeners)e()}recompute(){const e=xa[this.style],t=new n3.Engine({retrieveLocale:()=>LE,retrieveItem:a=>this.sources.get(a)},e.xml,"en-US"),n=new Map,i=[];let r=0;for(const a of this.order){const o=this.clusters.get(a);if(!(o!=null&&o.sourceId)||!this.sources.has(o.sourceId)){n.set(a,"");continue}r+=1;try{const[,l]=t.processCitationCluster({citationID:a,citationItems:[{id:o.sourceId,locator:o.locator||void 0,label:o.label||void 0,prefix:o.prefix||void 0,suffix:o.suffix||void 0,"suppress-author":o.mode==="suppress-author"||void 0,"author-only":o.mode==="author-only"||void 0}],properties:{noteIndex:e.category==="note"?r:0}},i,[]);i.push([a,r]);for(const[,c,u]of l??[])n.set(u,Cd(c));n.has(a)||n.set(a,"")}catch{n.set(a,"")}}this.rendered=n;try{const a=t.makeBibliography();this.bibliography=a?a[1].map(o=>Cd(o).trim()):[]}catch{this.bibliography=[]}}};function Ed(e){const t=e.storage.citation;return(t==null?void 0:t.engine)??null}var FE=Se.create({name:"bibliography",group:"block",selectable:!0,draggable:!0,atom:!0,parseHTML(){return[{tag:'div[data-node-type="bibliography"]'}]},renderHTML({HTMLAttributes:e}){return["div",Be(e,{"data-node-type":"bibliography",class:"docs-bibliography"})]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-bibliography",n.setAttribute("data-node-type","bibliography");const i=()=>{const o=Ed(t),l=(o==null?void 0:o.getBibliography())??[];if(n.innerHTML="",l.length===0){const f=document.createElement("p");f.className="docs-bibliography__empty",f.textContent="Bibliography",n.appendChild(f);return}const c=document.createElement("h2");c.className="docs-bibliography__heading",c.textContent="Bibliography",n.appendChild(c);const u=document.createElement("div");u.className="docs-bibliography__entries";for(const f of l){const m=document.createElement("p");m.className="docs-bibliography__entry",m.innerHTML=f,u.appendChild(m)}n.appendChild(u)};i();const r=Ed(t),a=r==null?void 0:r.onChange(i);return{dom:n,update(o){var l;return((l=o==null?void 0:o.type)==null?void 0:l.name)==="bibliography"},destroy(){a==null||a()}}}}});function Xm(e,t){const n=Km();return e.isNoteStyle()?{type:"footnote",attrs:{content:"",sourceId:t.sourceId,locator:t.locator??"",citationId:n}}:{type:"citation",attrs:{citationId:n,sourceId:t.sourceId,locator:t.locator??""}}}function Ii(e){return e.storage.citation?e.storage.citation.engine??null:null}var VE=je.create({name:"citation",addStorage(){return{engine:null}},onUpdate(){var r,a;const e=this.editor,t=Ii(e);if(!t)return;{const o=new Set,l=[];if(e.state.doc.descendants((c,u)=>{if(c.type.name==="citation"||c.type.name==="footnote"&&c.attrs.sourceId){const f=c.attrs.citationId;f&&(o.has(f)?l.push({pos:u,attrs:{...c.attrs}}):o.add(f))}return!0}),l.length>0){const c=e.state.tr;for(const{pos:u,attrs:f}of l)c.setNodeMarkup(u,void 0,{...f,citationId:Km()});e.view.dispatch(c);return}}const n=[];if(e.state.doc.descendants((o,l)=>((o.type.name==="citation"||o.type.name==="footnote"&&o.attrs.sourceId)&&n.push({citationId:o.attrs.citationId??`anon-${l}`,attrs:{sourceId:o.attrs.sourceId??null,locator:o.attrs.locator||"",label:o.attrs.label||"page",mode:o.attrs.mode||"normal",prefix:o.attrs.prefix||"",suffix:o.attrs.suffix||""}}),!0)),t.syncCitations(n)){const o=e.storage.editorContext;(a=(r=o==null?void 0:o.citation)==null?void 0:r.onSourcesChange)==null||a.call(r,t.getCitedSourceIds())}}}),UE=Se.create({name:"citation",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>({"data-citation-id":e.citationId})},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-citation-source-id"),renderHTML:e=>({"data-citation-source-id":e.sourceId})},locator:{default:"",parseHTML:e=>e.getAttribute("data-citation-locator")??"",renderHTML:e=>({"data-citation-locator":e.locator})},label:{default:"page",parseHTML:e=>e.getAttribute("data-citation-label")??"page",renderHTML:e=>({"data-citation-label":e.label})},mode:{default:"normal",parseHTML:e=>e.getAttribute("data-citation-mode")??"normal",renderHTML:e=>({"data-citation-mode":e.mode})},prefix:{default:""},suffix:{default:""}}},parseHTML(){return[{tag:'span[data-node-type="citation"]'}]},renderHTML({HTMLAttributes:e}){return["span",Be(e,{"data-node-type":"citation",class:"docs-citation"}),""]},addNodeView(){return e=>{const t=e.editor,n=e.node??e,i=document.createElement("span");i.className="docs-citation",i.setAttribute("data-node-type","citation");const r=()=>{const l=Ii(t),c=n.attrs.citationId,u=l&&c?l.renderCluster(c):"";u?(i.innerHTML=u,i.classList.remove("docs-citation--missing")):(i.textContent="[?]",i.classList.add("docs-citation--missing")),i.setAttribute("data-citation-id",String(n.attrs.citationId??"")),i.setAttribute("data-citation-source-id",String(n.attrs.sourceId??""))};r();const a=Ii(t),o=a==null?void 0:a.onChange(r);return{dom:i,update(l){var c;if(((c=l==null?void 0:l.type)==null?void 0:c.name)!=="citation")return!1;try{Object.assign(n.attrs,l.attrs),r()}catch{}return!0},destroy(){o==null||o()}}}}});function Ad(e,t,n){const i=Xm(t,n);return i.type==="footnote"&&!e.schema.nodes.footnote?!1:e.chain().focus().insertContent({type:i.type,attrs:i.attrs}).run()}_e.definePlugin({id:"citation",tiptapExtensions:[VE,UE,FE],toolbar:[{id:"insert-citation",label:"Citation",action:"insertCitation",iconComponent:"Quote"}],slashCommands:[{name:"Citation",command:"insertCitation"},{name:"Bibliography",command:"insertBibliography"}],commands:{insertCitation:(e,...t)=>{var o;const n=Ii(e);if(!n)return console.warn("[citation] no citation engine — inject the CitationPort to enable citations"),!1;const i=t[0];if(i!=null&&i.sourceId)return Ad(e,n,{sourceId:i.sourceId,locator:i.locator});const r=e.storage.editorContext,a=(o=r==null?void 0:r.citation)==null?void 0:o.onSourceRequest;return a?(a().then(l=>{l&&Ad(e,n,{sourceId:l})}),!0):!1},insertBibliography:e=>{let t=!1;return e.state.doc.descendants(n=>(n.type.name==="bibliography"&&(t=!0),!t)),t?!1:e.chain().focus().insertContent({type:"bibliography"}).run()},setCitationStyle:(e,...t)=>{const n=Ii(e),i=t[0];return!n||!i?!1:(n.setStyle(i),!0)}},hooks:{onInit(e){const t=e.storage.editorContext,n=t==null?void 0:t.citation;if(!n)return;const i=typeof n.sources=="function"?n.sources():n.sources,r=new PE({sources:i,style:n.style});e.storage.citation.engine=r},onDestroy(e){e.storage.citation.engine=null}}});function HE(e){const t=e.storage.markdown;if(!t||typeof t!="object")return;const n=t.parser;if(!(!n||typeof n!="object"||!("parse"in n)))return n}function Jm(e,t,n){const i=HE(e);if(!i)return null;let r;try{r=i.parse(t,{inline:n.inline})}catch{return null}if(typeof r!="string")return null;const a=Mi(r,e.schema,{slice:!0,parseOptions:{preserveWhitespace:"full"}});return a instanceof J?a:J.from(a)}function qE(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ge.near(e.doc.resolve(o),n))}function Td(e,t,n,i,r){const a=Jm(e,r,{inline:!1});if(!a){t.dispatch(t.state.tr.insertText(r,n,i));return}const o=t.state.tr;let l=n,c=i;if(l===c){let f=!0;if(a.forEach(m=>{m.isBlock||(f=!1)}),f){const p=o.doc.resolve(l).parent;p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}}let u=!0;if(a.forEach(f=>{(!f.isText||f.marks.length>0)&&(u=!1)}),u){let f="";a.forEach(m=>{m.isText&&(f+=m.text??"")}),o.insertText(f,l,c)}else o.replaceWith(l,c,a);qE(o,0,-1),t.dispatch(o)}var tt=new at("docflow-ai"),Nd=1500;function bl(e){var t;return(t=e.storage.editorContext)==null?void 0:t.aiStream}function Od(e,t,n){return{before:e.doc.textBetween(Math.max(0,t-Nd),t,`
|
|
15231
15231
|
`," "),after:e.doc.textBetween(n,Math.min(e.doc.content.size,n+Nd),`
|
|
15232
15232
|
`," ")}}function Md(e,t,n){const i=bl(e);i&&(async()=>{const r=a=>{n.signal.aborted||e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(tt,a))};try{for await(const a of i(t,n.signal)){if(n.signal.aborted||e.isDestroyed)return;r({type:"chunk",text:a})}r({type:"done"})}catch(a){r({type:"error",message:a instanceof Error?a.message:"AI request failed"})}})()}function Dd(e){var n;const t=e.storage.ai;(n=t.abort)==null||n.abort(),t.abort=null}var jE=je.create({name:"ai",addStorage(){return{preview:null,abort:null}},addCommands(){return{aiTransform:e=>({editor:t,state:n,dispatch:i})=>{if(tt.getState(n))return!1;if(!bl(t))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const{from:r,to:a,empty:o}=n.selection;if(o)return!1;const l=n.doc.textBetween(r,a,`
|
|
15233
15233
|
`," ");if(!l.trim())return!1;const c=new AbortController;t.storage.ai.abort=c,i==null||i(n.tr.setMeta(tt,{type:"start",mode:"transform",status:"streaming",from:r,to:a,originalText:l,action:e.action}));const u={action:e.action,selection:l,context:Od(n,r,a),...e.prompt?{prompt:e.prompt}:{}};return Md(t,u,c),!0},aiGenerate:()=>({editor:e,state:t,dispatch:n})=>{if(tt.getState(t))return!1;if(!bl(e))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const i=t.selection.to;return n==null||n(t.tr.setMeta(tt,{type:"start",mode:"generate",status:"prompt",from:i,to:i,originalText:"",action:"generate"})),!0},aiPromptSubmit:e=>({editor:t,state:n,dispatch:i})=>{var c;const r=tt.getState(n);if(!r||r.mode!=="generate"||r.status!=="prompt")return!1;const a=(c=e.prompt)==null?void 0:c.trim();if(!a)return!1;const o=new AbortController;t.storage.ai.abort=o,i==null||i(n.tr.setMeta(tt,{type:"start",mode:"generate",status:"streaming",from:r.from,to:r.to,originalText:"",action:"generate"}));const l={action:"generate",prompt:a,context:Od(n,r.from,r.to)};return Md(t,l,o),t.commands.focus(),!0},aiAccept:()=>({editor:e,state:t,dispatch:n})=>{const i=tt.getState(t);if(!i||i.status==="prompt")return!1;if(Dd(e),!n)return!0;const r=t.tr;if(i.text.trim()){const a=Jm(e,i.text,{inline:!0});a?r.replaceWith(i.from,i.to,a):r.replaceWith(i.from,i.to,t.schema.text(i.text))}return r.setMeta(tt,{type:"clear"}),n(r),!0},aiReject:()=>({editor:e,state:t,dispatch:n})=>tt.getState(t)?(Dd(e),n==null||n(t.tr.setMeta(tt,{type:"clear"})),!0):!1}},addProseMirrorPlugins(){const e=this.editor;let t=null;function n(){if(t)return t;const r=document.createElement("span");r.className="docs-ai-prompt";const a=document.createElement("input");return a.type="text",a.className="docs-ai-prompt__input",a.placeholder="Ask AI to write… (Enter ⏎ · Esc cancel)",a.addEventListener("keydown",o=>{o.key==="Enter"?(o.preventDefault(),e.commands.aiPromptSubmit({prompt:a.value})):o.key==="Escape"&&(o.preventDefault(),e.commands.aiReject())}),a.addEventListener("blur",()=>{const o=tt.getState(e.state);(o==null?void 0:o.status)==="prompt"&&e.commands.aiReject()}),r.appendChild(a),setTimeout(()=>a.focus(),0),t={dom:r,stopEvent:o=>o.target instanceof Node&&r.contains(o.target)},t}function i(r){const a=document.createElement("span");let o=null;if(r.status==="error")a.className="docs-ai-ghost docs-ai-ghost--error",a.textContent=` ${r.error??"AI error"} — press Esc`;else{a.className="docs-ai-ghost";const l=document.createElement("span");if(!r.text&&r.status==="streaming"?(l.textContent="AI writing…",l.className="docs-ai-ghost-placeholder"):l.textContent=r.text+(r.status==="streaming"?"▌":""),a.appendChild(l),r.status==="done"){o=document.createElement("span"),o.className="docs-ai-ghost-actions";const c=document.createElement("button");c.type="button",c.className="docs-ai-ghost-btn docs-ai-ghost-btn--accept",c.textContent="✓ Accept",c.title="Accept (Enter)",c.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiAccept()});const u=document.createElement("button");u.type="button",u.className="docs-ai-ghost-btn docs-ai-ghost-btn--reject",u.textContent="✗ Reject",u.title="Reject (Esc)",u.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiReject()}),o.appendChild(c),o.appendChild(u),a.appendChild(o)}}return{dom:a,stopEvent:l=>o!==null&&l.target instanceof Node&&o.contains(l.target)}}return[new dt({key:tt,state:{init:()=>null,apply(r,a){const o=r.getMeta(tt);if(o)switch(o.type){case"start":return{mode:o.mode,status:o.status,from:o.from,to:o.to,originalText:o.originalText,text:"",action:o.action};case"chunk":return a&&{...a,text:a.text+o.text};case"done":return a&&{...a,status:"done"};case"error":return a&&{...a,status:"error",error:o.message};case"clear":return null}if(!a)return a;if(a.status==="prompt"&&r.selectionSet)return null;if(r.docChanged){if(a.mode==="generate"){const u=r.mapping.map(a.from,1);return{...a,from:u,to:u}}const l=r.mapping.map(a.from,-1),c=r.mapping.map(a.to,1);return c<=l||r.doc.textBetween(l,c,`
|
|
15234
|
-
`," ")!==a.originalText?null:{...a,from:l,to:c}}return a}},props:{decorations(r){const a=tt.getState(r);if(!a)return t=null,Ve.empty;const o=[];if(a.mode==="transform"&&a.to>a.from&&o.push(ot.inline(a.from,a.to,{class:"docs-ai-selection"})),a.status==="prompt"){const l=n();o.push(ot.widget(a.to,l.dom,{key:"docs-ai-prompt",side:1,stopEvent:l.stopEvent}))}else{t=null;const l=i(a);o.push(ot.widget(a.to,l.dom,{key:`docs-ai-ghost-${a.status}-${a.text.length}-${(a.error??"").length}`,side:1,stopEvent:l.stopEvent}))}return Ve.create(r.doc,o)},handleKeyDown(r,a){const o=tt.getState(e.state);return o?a.key==="Escape"?(e.commands.aiReject(),!0):o.status==="prompt"?!1:(a.key==="Enter"||a.key==="Tab")&&o.status!=="error"?(a.preventDefault(),e.commands.aiAccept(),!0):!1:!1}}})]},onTransaction(){const e=this.editor.storage.ai;e.preview=tt.getState(this.editor.state)??null},onDestroy(){var t;const e=this.editor.storage.ai;(t=e.abort)==null||t.abort(),e.abort=null,e.preview=null}});_e.definePlugin({id:"ai",tiptapExtensions:[jE,EE.configure({html:!0,linkify:!0,breaks:!1})],slashCommands:[{name:"AI",description:"Generate text with AI",command:"aiGenerate"}]});St.create({name:"comment",inclusive:!0,addAttributes(){return{threadId:{default:null,parseHTML:e=>e.getAttribute("data-comment-thread"),renderHTML:e=>e.threadId?{"data-comment-thread":e.threadId,class:"docs-comment"}:{}},pos:{default:null,renderHTML:()=>({})}}},parseHTML(){return[{tag:"span[data-comment-thread]"}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}});function gl(){return new Date().toISOString().slice(0,10)}function zd(e){if(!e)return"Pick a date";const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?"Pick a date":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function $E(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}var ei=["To Do","In Progress","Review","Approved"];function Id(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}var WE=Se.create({name:"dateChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{date:{default:gl(),parseHTML:e=>e.getAttribute("data-date")??gl(),renderHTML:e=>({"data-date":e.date??""})}}},parseHTML(){return[{tag:'span[data-node-type="date-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"date-chip",class:"docs-chip docs-chip--date"}),zd(e.attrs.date)]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--date",r.setAttribute("data-node-type","date-chip"),r.setAttribute("contenteditable","false");const a=()=>{r.querySelector("input")||(r.textContent=zd(t.attrs.date),r.setAttribute("data-date",t.attrs.date))};return a(),r.addEventListener("click",o=>{if(o.preventDefault(),o.stopPropagation(),r.querySelector("input"))return;const l=document.createElement("input");l.type="date",l.value=t.attrs.date,l.className="docs-chip-date-input",r.replaceChildren(l),l.focus();const c=()=>{const u=l.value,f=n();typeof f=="number"&&i.dispatch(i.state.tr.setNodeMarkup(f,void 0,{date:u})),setTimeout(a,30)};l.addEventListener("change",c),l.addEventListener("blur",()=>setTimeout(a,30))}),{dom:r,update(o){return o.type.name!=="dateChip"?!1:(t=o,a(),!0)}}}}}),GE=Se.create({name:"peopleChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{userId:{default:"",parseHTML:e=>e.getAttribute("data-user-id")??"",renderHTML:e=>e.userId?{"data-user-id":e.userId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="people-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"people-chip",class:"docs-chip docs-chip--people"}),`@${e.attrs.name||"user"}`]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--people",n.setAttribute("data-node-type","people-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"user";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-avatar",a.textContent=$E(r),n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent="@"+r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="peopleChip"?!1:(t=r,i(),!0)}}}}}),KE=Se.create({name:"fileChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{fileId:{default:"",parseHTML:e=>e.getAttribute("data-file-id")??"",renderHTML:e=>e.fileId?{"data-file-id":e.fileId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="file-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"file-chip",class:"docs-chip docs-chip--file"}),e.attrs.name||"file"]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--file",n.setAttribute("data-node-type","file-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"Untitled file";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="🗎",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="fileChip"?!1:(t=r,i(),!0)}}}}}),XE=Se.create({name:"dropdownChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{options:{default:ei,parseHTML:e=>{const t=e.getAttribute("data-options")??"",n=t?t.split("|"):[];return n.length?n:ei},renderHTML:e=>({"data-options":(e.options??[]).join("|")})},selected:{default:ei[0],parseHTML:e=>e.getAttribute("data-selected")??ei[0],renderHTML:e=>({"data-selected":e.selected??""})}}},parseHTML(){return[{tag:'span[data-node-type="dropdown-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"dropdown-chip",class:"docs-chip docs-chip--dropdown"}),e.attrs.selected||""]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--dropdown",r.setAttribute("data-node-type","dropdown-chip"),r.setAttribute("contenteditable","false");const a=()=>{const o=t.attrs.options??ei,l=t.attrs.selected??o[0]??"";r.innerHTML="";const c=document.createElement("select");c.className="docs-chip-select",c.addEventListener("mousedown",u=>u.stopPropagation());for(const u of o){const f=document.createElement("option");f.value=u,f.textContent=u,u===l&&(f.selected=!0),c.appendChild(f)}c.addEventListener("change",()=>{const u=n();typeof u=="number"&&i.dispatch(i.state.tr.setNodeMarkup(u,void 0,{...t.attrs,selected:c.value}))}),r.appendChild(c)};return a(),{dom:r,update(o){return o.type.name!=="dropdownChip"?!1:(t=o,a(),!0)}}}}}),JE=Se.create({name:"locationChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{label:{default:"",parseHTML:e=>e.getAttribute("data-label")??"",renderHTML:e=>({"data-label":e.label??""})},lat:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lat");return t===null?null:Number(t)},renderHTML:e=>e.lat!=null?{"data-lat":e.lat}:{}},lng:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lng");return t===null?null:Number(t)},renderHTML:e=>e.lng!=null?{"data-lng":e.lng}:{}}}},parseHTML(){return[{tag:'span[data-node-type="location-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"location-chip",class:"docs-chip docs-chip--location"}),e.attrs.label||""]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--location",n.setAttribute("data-node-type","location-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.label||"Add location";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="📍",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="locationChip"?!1:(t=r,i(),!0)}}}}});_e.definePlugin({id:"smart-elements",tiptapExtensions:[WE,GE,KE,XE,JE],slashCommands:[{name:"Date",command:"insertDateChip"},{name:"People",command:"insertPeopleChip"},{name:"File",command:"insertFileChip"},{name:"Dropdown",command:"insertDropdownChip"},{name:"Location",command:"insertLocationChip"}],commands:{insertDateChip:e=>e.chain().focus().insertContent({type:"dateChip",attrs:{date:gl()}}).run(),insertPeopleChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter user name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"peopleChip",attrs:{userId:Id(n),name:n}}).run()},insertFileChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter file/document name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"fileChip",attrs:{fileId:Id(n),name:n}}).run()},insertDropdownChip:e=>e.chain().focus().insertContent({type:"dropdownChip",attrs:{options:ei,selected:ei[0]}}).run(),insertLocationChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter location name:","")??"":"";return t.trim()?e.chain().focus().insertContent({type:"locationChip",attrs:{label:t.trim()}}).run():!1}}});var ht={open:!1,query:"",position:{top:0,left:0},commands:[],selectedIndex:0},ZE=[];function _o(){ZE.forEach(e=>e())}function Cs(){ht={...ht,open:!1,query:""},_o()}function ya(e,t){const{selection:n}=e.state,i=n.head,r=e.coordsAtPos(i),a=YE(),o=t?a.filter(l=>l.name.toLowerCase().includes(t.toLowerCase())):a;ht={open:!0,query:t,position:{top:r.bottom+4,left:r.left},commands:o.map(l=>({...l,action:null})),selectedIndex:0},_o()}var vl=new Map;function QE(e,t){const n=vl.get(e)||[];vl.set(e,[...n,...t])}function YE(){const e=[];vl.forEach(n=>{e.push(...n)});const t=new Set;return e.filter(n=>t.has(n.name)?!1:(t.add(n.name),!0))}var e5=je.create({name:"slashMenu",addProseMirrorPlugins(){return[new dt({key:new at("slashMenu"),props:{handleTextInput(e,t,n,i){if(i==="/"){const r=e.state.doc.resolve(t),a=r.parent.textContent.slice(0,r.parentOffset);if(a===""||a.endsWith(" "))return setTimeout(()=>ya(e,""),10),!1}if(ht.open&&i.length===1&&/[a-zA-Z]/.test(i)){const r=ht.query+i;return ya(e,r),!1}return!1},handleKeyDown(e,t){if(!ht.open)return!1;if(t.key==="ArrowDown")return t.preventDefault(),ht.selectedIndex=Math.min(ht.selectedIndex+1,ht.commands.length-1),_o(),!0;if(t.key==="ArrowUp")return t.preventDefault(),ht.selectedIndex=Math.max(ht.selectedIndex-1,0),_o(),!0;if(t.key==="Enter"){t.preventDefault();const n=ht.commands[ht.selectedIndex];if(n){const i=e.state.doc.resolve(e.state.selection.head),r=i.start(),a=r+i.parent.textContent.lastIndexOf("/");if(a>=r){const l=e.state.tr.delete(a,e.state.selection.head);e.dispatch(l)}const o=e._tiptapEditor;if(o){const l=o;typeof l[n.command]=="function"&&l[n.command]()}}return Cs(),!0}if(t.key==="Escape")return Cs(),!0;if(t.key==="Backspace")if(ht.query.length>0){const n=ht.query.slice(0,-1);return n?ya(e,n):ya(e,""),!1}else{const n=e.state.doc.resolve(e.state.selection.head),i=n.start(),r=n.parent.textContent.lastIndexOf("/");if(r>=0){const a=e.state.tr.delete(i+r,e.state.selection.head);e.dispatch(a)}return Cs(),!0}return!1}}})]}});_e.definePlugin({id:"slash-menu",tiptapExtensions:[e5],hooks:{onInit(e){QE("default",[])}}});const xl=/\[(\d{1,3})\]/g;function t5(e){return e.replace(xl,"")}function n5(e,t,n){const i=[];let r=0;xl.lastIndex=0;let a;for(;(a=xl.exec(e))!==null;){const l=Number(a[1]),c=t.get(l),u=e.slice(r,a.index);if(u&&i.push(u),!c){r=a.index+a[0].length;continue}i.push(Wp(n,{sourceId:c.sourceId})),r=a.index+a[0].length}const o=e.slice(r);return o&&i.push(o),i}const i5={class:"ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},r5={class:"flex items-start justify-between border-b border-slate-200 p-4 dark:border-white/5"},a5={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},o5={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},s5=["aria-label"],l5={key:0,class:"flex flex-1 flex-col items-center justify-center p-6 text-center text-slate-400 dark:text-slate-500"},c5={class:"text-xs"},u5={class:"space-y-2 border-b border-slate-200 p-4 dark:border-white/5"},d5={class:"block font-mono text-[10px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},f5={class:"grid grid-cols-2 gap-2"},p5=["disabled","title","onClick"],m5={key:0,class:"flex h-full flex-col items-center justify-center p-4 text-center text-slate-400 dark:text-slate-500"},h5={class:"text-[10px]"},b5={class:"flex items-center gap-1 font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},g5={key:0,class:"animate-pulse text-cyan-500"},v5={key:0,class:"flex flex-wrap gap-1 pl-1"},x5={key:1,class:"flex gap-1.5"},y5=["onClick"],k5=["onClick"],w5={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},_5=["disabled","placeholder","onKeydown"],S5={class:"flex justify-end"},C5=["disabled"],Zm=s.defineComponent({__name:"AISidebar",props:{editor:{},aiStream:{type:Function},aiDraft:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct();function a(){return n.editor?s.toRaw(n.editor):null}const o=s.ref([]),l=s.ref(""),c=s.ref(!1),u=s.ref(null),f=s.ref(null),m=s.ref(null);let p=null;const h=s.computed(()=>{var P,W,L;return n.aiStream?n.aiStream:(L=(W=(P=a())==null?void 0:P.storage)==null?void 0:W.editorContext)==null?void 0:L.aiStream}),g=s.computed(()=>{var P,W,L;return n.aiDraft?n.aiDraft:(L=(W=(P=a())==null?void 0:P.storage)==null?void 0:W.editorContext)==null?void 0:L.aiDraft}),b=s.ref(!1),x=s.ref(0);function v(){x.value++}s.watch(()=>n.editor,(P,W)=>{W&&s.toRaw(W).off("transaction",v),P&&s.toRaw(P).on("transaction",v)},{immediate:!0});const y=s.computed(()=>{var Y;x.value;const P=(Y=a())==null?void 0:Y.state;if(!P||P.selection.empty)return null;const{from:W,to:L}=P.selection;return{from:W,to:L,text:P.doc.textBetween(W,L,`
|
|
15234
|
+
`," ")!==a.originalText?null:{...a,from:l,to:c}}return a}},props:{decorations(r){const a=tt.getState(r);if(!a)return t=null,Ve.empty;const o=[];if(a.mode==="transform"&&a.to>a.from&&o.push(ot.inline(a.from,a.to,{class:"docs-ai-selection"})),a.status==="prompt"){const l=n();o.push(ot.widget(a.to,l.dom,{key:"docs-ai-prompt",side:1,stopEvent:l.stopEvent}))}else{t=null;const l=i(a);o.push(ot.widget(a.to,l.dom,{key:`docs-ai-ghost-${a.status}-${a.text.length}-${(a.error??"").length}`,side:1,stopEvent:l.stopEvent}))}return Ve.create(r.doc,o)},handleKeyDown(r,a){const o=tt.getState(e.state);return o?a.key==="Escape"?(e.commands.aiReject(),!0):o.status==="prompt"?!1:(a.key==="Enter"||a.key==="Tab")&&o.status!=="error"?(a.preventDefault(),e.commands.aiAccept(),!0):!1:!1}}})]},onTransaction(){const e=this.editor.storage.ai;e.preview=tt.getState(this.editor.state)??null},onDestroy(){var t;const e=this.editor.storage.ai;(t=e.abort)==null||t.abort(),e.abort=null,e.preview=null}});_e.definePlugin({id:"ai",tiptapExtensions:[jE,cE.configure({html:!0,linkify:!0,breaks:!1})],slashCommands:[{name:"AI",description:"Generate text with AI",command:"aiGenerate"}]});St.create({name:"comment",inclusive:!0,addAttributes(){return{threadId:{default:null,parseHTML:e=>e.getAttribute("data-comment-thread"),renderHTML:e=>e.threadId?{"data-comment-thread":e.threadId,class:"docs-comment"}:{}},pos:{default:null,renderHTML:()=>({})}}},parseHTML(){return[{tag:"span[data-comment-thread]"}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}});function gl(){return new Date().toISOString().slice(0,10)}function zd(e){if(!e)return"Pick a date";const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?"Pick a date":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function $E(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}var ei=["To Do","In Progress","Review","Approved"];function Id(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}var WE=Se.create({name:"dateChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{date:{default:gl(),parseHTML:e=>e.getAttribute("data-date")??gl(),renderHTML:e=>({"data-date":e.date??""})}}},parseHTML(){return[{tag:'span[data-node-type="date-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"date-chip",class:"docs-chip docs-chip--date"}),zd(e.attrs.date)]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--date",r.setAttribute("data-node-type","date-chip"),r.setAttribute("contenteditable","false");const a=()=>{r.querySelector("input")||(r.textContent=zd(t.attrs.date),r.setAttribute("data-date",t.attrs.date))};return a(),r.addEventListener("click",o=>{if(o.preventDefault(),o.stopPropagation(),r.querySelector("input"))return;const l=document.createElement("input");l.type="date",l.value=t.attrs.date,l.className="docs-chip-date-input",r.replaceChildren(l),l.focus();const c=()=>{const u=l.value,f=n();typeof f=="number"&&i.dispatch(i.state.tr.setNodeMarkup(f,void 0,{date:u})),setTimeout(a,30)};l.addEventListener("change",c),l.addEventListener("blur",()=>setTimeout(a,30))}),{dom:r,update(o){return o.type.name!=="dateChip"?!1:(t=o,a(),!0)}}}}}),GE=Se.create({name:"peopleChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{userId:{default:"",parseHTML:e=>e.getAttribute("data-user-id")??"",renderHTML:e=>e.userId?{"data-user-id":e.userId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="people-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"people-chip",class:"docs-chip docs-chip--people"}),`@${e.attrs.name||"user"}`]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--people",n.setAttribute("data-node-type","people-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"user";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-avatar",a.textContent=$E(r),n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent="@"+r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="peopleChip"?!1:(t=r,i(),!0)}}}}}),KE=Se.create({name:"fileChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{fileId:{default:"",parseHTML:e=>e.getAttribute("data-file-id")??"",renderHTML:e=>e.fileId?{"data-file-id":e.fileId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="file-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"file-chip",class:"docs-chip docs-chip--file"}),e.attrs.name||"file"]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--file",n.setAttribute("data-node-type","file-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"Untitled file";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="🗎",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="fileChip"?!1:(t=r,i(),!0)}}}}}),XE=Se.create({name:"dropdownChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{options:{default:ei,parseHTML:e=>{const t=e.getAttribute("data-options")??"",n=t?t.split("|"):[];return n.length?n:ei},renderHTML:e=>({"data-options":(e.options??[]).join("|")})},selected:{default:ei[0],parseHTML:e=>e.getAttribute("data-selected")??ei[0],renderHTML:e=>({"data-selected":e.selected??""})}}},parseHTML(){return[{tag:'span[data-node-type="dropdown-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"dropdown-chip",class:"docs-chip docs-chip--dropdown"}),e.attrs.selected||""]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--dropdown",r.setAttribute("data-node-type","dropdown-chip"),r.setAttribute("contenteditable","false");const a=()=>{const o=t.attrs.options??ei,l=t.attrs.selected??o[0]??"";r.innerHTML="";const c=document.createElement("select");c.className="docs-chip-select",c.addEventListener("mousedown",u=>u.stopPropagation());for(const u of o){const f=document.createElement("option");f.value=u,f.textContent=u,u===l&&(f.selected=!0),c.appendChild(f)}c.addEventListener("change",()=>{const u=n();typeof u=="number"&&i.dispatch(i.state.tr.setNodeMarkup(u,void 0,{...t.attrs,selected:c.value}))}),r.appendChild(c)};return a(),{dom:r,update(o){return o.type.name!=="dropdownChip"?!1:(t=o,a(),!0)}}}}}),JE=Se.create({name:"locationChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{label:{default:"",parseHTML:e=>e.getAttribute("data-label")??"",renderHTML:e=>({"data-label":e.label??""})},lat:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lat");return t===null?null:Number(t)},renderHTML:e=>e.lat!=null?{"data-lat":e.lat}:{}},lng:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lng");return t===null?null:Number(t)},renderHTML:e=>e.lng!=null?{"data-lng":e.lng}:{}}}},parseHTML(){return[{tag:'span[data-node-type="location-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Be(t,{"data-node-type":"location-chip",class:"docs-chip docs-chip--location"}),e.attrs.label||""]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--location",n.setAttribute("data-node-type","location-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.label||"Add location";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="📍",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="locationChip"?!1:(t=r,i(),!0)}}}}});_e.definePlugin({id:"smart-elements",tiptapExtensions:[WE,GE,KE,XE,JE],slashCommands:[{name:"Date",command:"insertDateChip"},{name:"People",command:"insertPeopleChip"},{name:"File",command:"insertFileChip"},{name:"Dropdown",command:"insertDropdownChip"},{name:"Location",command:"insertLocationChip"}],commands:{insertDateChip:e=>e.chain().focus().insertContent({type:"dateChip",attrs:{date:gl()}}).run(),insertPeopleChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter user name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"peopleChip",attrs:{userId:Id(n),name:n}}).run()},insertFileChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter file/document name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"fileChip",attrs:{fileId:Id(n),name:n}}).run()},insertDropdownChip:e=>e.chain().focus().insertContent({type:"dropdownChip",attrs:{options:ei,selected:ei[0]}}).run(),insertLocationChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter location name:","")??"":"";return t.trim()?e.chain().focus().insertContent({type:"locationChip",attrs:{label:t.trim()}}).run():!1}}});var ht={open:!1,query:"",position:{top:0,left:0},commands:[],selectedIndex:0},ZE=[];function _o(){ZE.forEach(e=>e())}function Cs(){ht={...ht,open:!1,query:""},_o()}function ya(e,t){const{selection:n}=e.state,i=n.head,r=e.coordsAtPos(i),a=YE(),o=t?a.filter(l=>l.name.toLowerCase().includes(t.toLowerCase())):a;ht={open:!0,query:t,position:{top:r.bottom+4,left:r.left},commands:o.map(l=>({...l,action:null})),selectedIndex:0},_o()}var vl=new Map;function QE(e,t){const n=vl.get(e)||[];vl.set(e,[...n,...t])}function YE(){const e=[];vl.forEach(n=>{e.push(...n)});const t=new Set;return e.filter(n=>t.has(n.name)?!1:(t.add(n.name),!0))}var e5=je.create({name:"slashMenu",addProseMirrorPlugins(){return[new dt({key:new at("slashMenu"),props:{handleTextInput(e,t,n,i){if(i==="/"){const r=e.state.doc.resolve(t),a=r.parent.textContent.slice(0,r.parentOffset);if(a===""||a.endsWith(" "))return setTimeout(()=>ya(e,""),10),!1}if(ht.open&&i.length===1&&/[a-zA-Z]/.test(i)){const r=ht.query+i;return ya(e,r),!1}return!1},handleKeyDown(e,t){if(!ht.open)return!1;if(t.key==="ArrowDown")return t.preventDefault(),ht.selectedIndex=Math.min(ht.selectedIndex+1,ht.commands.length-1),_o(),!0;if(t.key==="ArrowUp")return t.preventDefault(),ht.selectedIndex=Math.max(ht.selectedIndex-1,0),_o(),!0;if(t.key==="Enter"){t.preventDefault();const n=ht.commands[ht.selectedIndex];if(n){const i=e.state.doc.resolve(e.state.selection.head),r=i.start(),a=r+i.parent.textContent.lastIndexOf("/");if(a>=r){const l=e.state.tr.delete(a,e.state.selection.head);e.dispatch(l)}const o=e._tiptapEditor;if(o){const l=o;typeof l[n.command]=="function"&&l[n.command]()}}return Cs(),!0}if(t.key==="Escape")return Cs(),!0;if(t.key==="Backspace")if(ht.query.length>0){const n=ht.query.slice(0,-1);return n?ya(e,n):ya(e,""),!1}else{const n=e.state.doc.resolve(e.state.selection.head),i=n.start(),r=n.parent.textContent.lastIndexOf("/");if(r>=0){const a=e.state.tr.delete(i+r,e.state.selection.head);e.dispatch(a)}return Cs(),!0}return!1}}})]}});_e.definePlugin({id:"slash-menu",tiptapExtensions:[e5],hooks:{onInit(e){QE("default",[])}}});const xl=/\[(\d{1,3})\]/g;function t5(e){return e.replace(xl,"")}function n5(e,t,n){const i=[];let r=0;xl.lastIndex=0;let a;for(;(a=xl.exec(e))!==null;){const l=Number(a[1]),c=t.get(l),u=e.slice(r,a.index);if(u&&i.push(u),!c){r=a.index+a[0].length;continue}i.push(Xm(n,{sourceId:c.sourceId})),r=a.index+a[0].length}const o=e.slice(r);return o&&i.push(o),i}const i5={class:"ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},r5={class:"flex items-start justify-between border-b border-slate-200 p-4 dark:border-white/5"},a5={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},o5={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},s5=["aria-label"],l5={key:0,class:"flex flex-1 flex-col items-center justify-center p-6 text-center text-slate-400 dark:text-slate-500"},c5={class:"text-xs"},u5={class:"space-y-2 border-b border-slate-200 p-4 dark:border-white/5"},d5={class:"block font-mono text-[10px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},f5={class:"grid grid-cols-2 gap-2"},p5=["disabled","title","onClick"],m5={key:0,class:"flex h-full flex-col items-center justify-center p-4 text-center text-slate-400 dark:text-slate-500"},h5={class:"text-[10px]"},b5={class:"flex items-center gap-1 font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},g5={key:0,class:"animate-pulse text-cyan-500"},v5={key:0,class:"flex flex-wrap gap-1 pl-1"},x5={key:1,class:"flex gap-1.5"},y5=["onClick"],k5=["onClick"],w5={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},_5=["disabled","placeholder","onKeydown"],S5={class:"flex justify-end"},C5=["disabled"],Zm=s.defineComponent({__name:"AISidebar",props:{editor:{},aiStream:{type:Function},aiDraft:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct();function a(){return n.editor?s.toRaw(n.editor):null}const o=s.ref([]),l=s.ref(""),c=s.ref(!1),u=s.ref(null),f=s.ref(null),m=s.ref(null);let p=null;const h=s.computed(()=>{var P,W,L;return n.aiStream?n.aiStream:(L=(W=(P=a())==null?void 0:P.storage)==null?void 0:W.editorContext)==null?void 0:L.aiStream}),g=s.computed(()=>{var P,W,L;return n.aiDraft?n.aiDraft:(L=(W=(P=a())==null?void 0:P.storage)==null?void 0:W.editorContext)==null?void 0:L.aiDraft}),b=s.ref(!1),x=s.ref(0);function v(){x.value++}s.watch(()=>n.editor,(P,W)=>{W&&s.toRaw(W).off("transaction",v),P&&s.toRaw(P).on("transaction",v)},{immediate:!0});const y=s.computed(()=>{var Y;x.value;const P=(Y=a())==null?void 0:Y.state;if(!P||P.selection.empty)return null;const{from:W,to:L}=P.selection;return{from:W,to:L,text:P.doc.textBetween(W,L,`
|
|
15235
15235
|
`," ")}});function k(){var q;const P=(q=a())==null?void 0:q.state;if(!P)return;const{from:W,to:L}=P.selection,Y=1500;return{before:P.doc.textBetween(Math.max(0,W-Y),W,`
|
|
15236
15236
|
`," "),after:P.doc.textBetween(L,Math.min(P.doc.content.size,L+Y),`
|
|
15237
|
-
`," ")}}async function w(){await s.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)}async function S(P,W){const L=h.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:W}),o.value.push({role:"assistant",text:"",streaming:!0});const Y=o.value.length-1;await w();try{for await(const q of L(P,p.signal))o.value[Y].text+=q,w();o.value[Y].text||(o.value[Y].text=r("sidebars.ai.emptyResponse"),o.value[Y].error=!0)}catch(q){p.signal.aborted||(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q instanceof Error?q.message:String(q)}`,o.value[Y].error=!0)}finally{o.value[Y].streaming=!1,c.value=!1,p=null,w()}}function E(){const P=l.value.trim();if(!P||c.value)return;if(l.value="",b.value){D({prompt:P,context:k()},P);return}const W=y.value;S({action:"chat",prompt:P,...W?{selection:W.text}:{},context:k()},P)}async function D(P,W){const L=g.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:W}),o.value.push({role:"assistant",text:"",streaming:!0});const Y=o.value.length-1;await w();try{for await(const q of L(P,p.signal))q.type==="delta"?(o.value[Y].text+=q.text,w()):q.type==="done"?o.value[Y].citations=q.citations:q.type==="error"&&(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q.message}`,o.value[Y].error=!0,o.value[Y].citations=void 0);!o.value[Y].text&&!o.value[Y].error&&(o.value[Y].text=r("sidebars.ai.emptyResponse"),o.value[Y].error=!0)}catch(q){p.signal.aborted||(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q instanceof Error?q.message:String(q)}`,o.value[Y].error=!0,o.value[Y].citations=void 0)}finally{o.value[Y].streaming=!1,c.value=!1,p=null,w()}}function _(){b.value=!b.value,s.nextTick(()=>{const P=document.querySelector(".ai-sidebar textarea");P==null||P.focus()})}function C(P){if(c.value||!P.action)return;const W=y.value;P.needsSelection&&!W||S({action:P.action,...W?{selection:W.text}:{},...P.prompt?{prompt:P.prompt}:{},context:k()},P.prompt??P.label)}function N(){var P,W,L;y.value&&((L=(W=(P=a())==null?void 0:P.commands)==null?void 0:W.aiTransform)==null||L.call(W,{action:"rewrite"}))}const I=s.computed(()=>[{label:r("sidebars.ai.summarize"),icon:pr,color:"text-cyan-500",action:"summarize",needsSelection:!0},{label:r("sidebars.ai.fixGrammar"),icon:qh,color:"text-emerald-500",action:"grammar",needsSelection:!0},{label:r("sidebars.ai.continue"),icon:jb,color:"text-amber-500",action:"generate",prompt:"Continue writing naturally from where the text ends, matching the existing style."},{label:r("sidebars.ai.toSpanish"),icon:Xd,color:"text-cyan-500",action:"translate",prompt:"translate to Spanish",needsSelection:!0},{label:r("sidebars.ai.improveSelection"),icon:Ab,color:"text-violet-500",improve:!0,needsSelection:!0},{label:r("sidebars.ai.draft"),icon:Ma,color:"text-cyan-500",draft:!0,disabled:!g.value}]);function H(P,W){P.text&&(navigator.clipboard.writeText(P.text),u.value=W,setTimeout(()=>u.value=null,2e3))}function F(P){f.value=P,setTimeout(()=>{f.value===P&&(f.value=null)},2e3)}function M(P,W){const L=a();if(!P.text||!L)return;const{state:Y,view:q}=L,{from:O,to:B}=Y.selection;if(!P.citations||P.citations.length===0){Td(L,q,O,B,P.text),q.focus(),F(W);return}const U=Di(L);if(!U){Td(L,q,O,B,t5(P.text)),q.focus(),F(W);return}const oe=new Map(P.citations.map(V=>[V.ref,V])),ne=n5(P.text,oe,U),te=Y.schema,ie=ne.map(V=>typeof V=="string"?te.text(V):te.nodeFromJSON(V)).filter(V=>!!V),X=new ae(J.from(ie),0,0);q.dispatch(Y.tr.replace(O,B,X)),q.focus(),F(W)}function j(){p==null||p.abort(),c.value=!1,i("close")}return s.onUnmounted(()=>{var P;p==null||p.abort(),(P=a())==null||P.off("transaction",v)}),(P,W)=>(s.openBlock(),s.createElementBlock("div",i5,[s.createElementVNode("div",r5,[s.createElementVNode("div",null,[s.createElementVNode("h3",a5,[s.createVNode(s.unref(zn),{class:"h-4 w-4 animate-pulse text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.ai.title")),1)]),s.createElementVNode("p",o5,s.toDisplayString(s.unref(r)("sidebars.ai.description")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-200","aria-label":s.unref(r)("sidebars.ai.close"),onClick:j},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,s5)]),h.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",u5,[s.createElementVNode("span",d5,s.toDisplayString(s.unref(r)("sidebars.ai.quickMacros")),1),s.createElementVNode("div",f5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,L=>(s.openBlock(),s.createElementBlock("button",{key:L.label,type:"button",disabled:c.value||L.needsSelection&&!y.value||"disabled"in L&&L.disabled,title:L.needsSelection&&!y.value?s.unref(r)("sidebars.ai.selectTextFirst"):L.label,class:s.normalizeClass(["flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-left text-[11px] font-bold transition-colors disabled:opacity-40","draft"in L&&L.draft&&b.value?"border-cyan-500 bg-cyan-500/10 text-cyan-700 dark:border-cyan-400/50 dark:bg-cyan-500/15 dark:text-cyan-300":"border-slate-200 bg-slate-50 text-slate-700 hover:border-cyan-500/50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:border-cyan-500/30"]),onClick:Y=>L.improve?N():"draft"in L&&L.draft?_():C(L)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(L.icon),{class:s.normalizeClass(["h-3 w-3",L.color])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(L.label),1)],10,p5))),128))])]),s.createElementVNode("div",{ref_key:"turnsEl",ref:m,class:"flex-1 space-y-3 overflow-y-auto p-4"},[o.value.length===0?(s.openBlock(),s.createElementBlock("div",m5,[s.createVNode(s.unref(zn),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",h5,s.toDisplayString(s.unref(r)("sidebars.ai.noDraft")),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.value,(L,Y)=>(s.openBlock(),s.createElementBlock("div",{key:Y,class:s.normalizeClass(["flex flex-col gap-1",L.role==="user"?"items-end":"items-start"])},[s.createElementVNode("span",b5,[L.role==="user"?(s.openBlock(),s.createBlock(s.unref(Nl),{key:0,class:"h-2.5 w-2.5"})):(s.openBlock(),s.createBlock(s.unref(zn),{key:1,class:"h-2.5 w-2.5 text-cyan-400"})),s.createTextVNode(" "+s.toDisplayString(L.role==="user"?s.unref(r)("sidebars.ai.you"):s.unref(r)("sidebars.ai.assistant")),1)]),s.createElementVNode("div",{class:s.normalizeClass(["max-w-full whitespace-pre-wrap rounded-xl px-3 py-2 text-xs leading-relaxed",[L.role==="user"?"bg-cyan-500/10 text-slate-700 dark:bg-cyan-500/15 dark:text-slate-200":L.error?"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-300":"bg-slate-100 text-slate-700 dark:bg-white/[0.04] dark:text-slate-300"]])},[s.createTextVNode(s.toDisplayString(L.text),1),L.streaming?(s.openBlock(),s.createElementBlock("span",g5,"▌")):s.createCommentVNode("",!0)],2),L.role==="assistant"&&L.citations&&L.citations.length>0?(s.openBlock(),s.createElementBlock("div",v5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(L.citations,q=>(s.openBlock(),s.createElementBlock("span",{key:q.ref,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},[s.createVNode(s.unref(Ma),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(q.label),1)]))),128))])):s.createCommentVNode("",!0),L.role==="assistant"&&!L.streaming&&!L.error&&L.text?(s.openBlock(),s.createElementBlock("div",x5,[s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg border border-slate-200 bg-white px-2 py-1 text-[10px] font-semibold text-slate-600 transition-all hover:bg-slate-50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:q=>H(L,Y)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value===Y?s.unref(Na):s.unref(Os)),{class:s.normalizeClass(["h-3 w-3",u.value===Y?"text-emerald-500":""])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(u.value===Y?s.unref(r)("sidebars.ai.copied"):s.unref(r)("sidebars.ai.copy")),1)],8,y5),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-2 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:q=>M(L,Y)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(f.value===Y?s.unref(Na):s.unref(Uh)),{class:"h-3 w-3"})),s.createElementVNode("span",null,s.toDisplayString(f.value===Y?s.unref(r)("sidebars.ai.inserted"):s.unref(r)("sidebars.ai.insert")),1)],8,k5)])):s.createCommentVNode("",!0)],2))),128))],512),s.createElementVNode("div",w5,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(E,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":W[0]||(W[0]=L=>l.value=L),rows:"2",disabled:c.value,placeholder:b.value?s.unref(r)("sidebars.ai.draftPlaceholder"):s.unref(r)("sidebars.ai.promptPlaceholder"),class:"w-full min-h-[55px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(s.withModifiers(E,["exact","prevent"]),["enter"])},null,40,_5),[[s.vModelText,l.value]]),s.createElementVNode("div",S5,[s.createElementVNode("button",{type:"submit",disabled:c.value||!l.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-40"},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(b.value?s.unref(r)("sidebars.ai.promptDraft"):s.unref(r)("sidebars.ai.promptAI")),1)],8,C5)])],32)])],64)):(s.openBlock(),s.createElementBlock("div",l5,[s.createVNode(s.unref(zn),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",c5,s.toDisplayString(s.unref(r)("sidebars.ai.notConfigured")),1)]))]))}}),E5={class:"comments-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},A5={class:"border-b border-slate-200 p-4 dark:border-white/5"},T5={class:"mb-3 flex items-center justify-between"},N5={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},O5={class:"flex rounded-xl border border-slate-200 bg-slate-50 p-1 text-[11px] font-semibold dark:border-white/10 dark:bg-white/[0.02]"},M5={key:0,class:"mb-1 rounded-xl border border-cyan-500/25 bg-cyan-500/5 p-2.5 text-xs text-cyan-700 animate-fadeIn dark:border-cyan-500/15 dark:bg-cyan-500/10 dark:text-cyan-400"},D5={class:"mb-1 font-mono text-[9px] font-bold uppercase tracking-wider"},z5={class:"line-clamp-1 border-l-2 border-cyan-400 bg-cyan-500/10 py-0.5 pl-2.5 italic dark:bg-cyan-500/5"},I5={class:"flex-1 space-y-4 overflow-y-auto p-4"},R5={class:"flex items-start justify-between"},L5={class:"flex items-center gap-2"},B5={class:"text-xs font-bold text-slate-800 dark:text-slate-200"},P5={class:"font-mono text-[9px] text-slate-400 dark:text-slate-500"},F5={class:"flex items-center gap-1.5"},V5=["title","onClick"],U5=["title","onClick"],H5={key:0,class:"inline-flex items-center gap-1 rounded-full border border-amber-400/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-amber-600 dark:border-amber-500/30 dark:text-amber-400"},q5={class:"whitespace-pre-wrap break-words text-xs leading-relaxed text-slate-700 dark:text-slate-300"},j5={key:2,class:"space-y-2.5 border-l border-slate-200 pl-4 pt-1 dark:border-white/10"},$5={class:"flex items-center gap-1.5"},W5={class:"text-[10px] font-bold text-slate-600 dark:text-slate-300"},G5={class:"font-mono text-[8px] text-slate-400 dark:text-slate-500"},K5={class:"break-words pl-1 text-xs text-slate-600 dark:text-slate-400"},X5={key:3,class:"flex items-center justify-between border-t border-slate-100 pt-2 dark:border-white/5"},J5={key:0,class:"flex w-full items-center gap-1.5"},Z5=["onUpdate:modelValue","placeholder","onKeydown"],Q5=["onClick"],Y5=["onClick"],e6={key:4,class:"rounded-lg border border-green-100/40 bg-green-50/55 p-2 text-[10px] text-green-700 dark:border-green-500/10 dark:bg-green-950/10 dark:text-green-400"},t6={key:0},n6={key:0,class:"py-12 text-center text-slate-400 dark:text-slate-500"},i6={class:"text-xs"},r6={key:0,class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},a6=["placeholder"],o6={class:"flex items-center justify-between"},s6={class:"font-mono text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},l6=["disabled"],Qm=s.defineComponent({__name:"CommentsSidebar",props:{comments:{},selectedTextSnippet:{},selectedTextIndex:{},orphanedIds:{}},emits:["add-comment","add-reply","resolve-comment","delete-comment"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref(""),o=s.ref({}),l=s.ref(null),c=s.ref("active"),u=s.computed(()=>(n.comments??[]).filter(b=>c.value==="resolved"?b.resolved:!b.resolved));function f(){a.value.trim()&&i("add-comment",a.value.trim(),n.selectedTextSnippet,n.selectedTextIndex)}function m(b){const x=o.value[b]||"";x.trim()&&(i("add-reply",b,x.trim()),o.value={...o.value,[b]:""},l.value=null)}function p(b){return b.split(" ").map(x=>x[0]).join("").slice(0,2).toUpperCase()}function h(b){var x;return((x=n.orphanedIds)==null?void 0:x.includes(b.id))===!0}function g(b){typeof window<"u"&&!window.confirm(r("sidebars.comments.confirmDelete"))||i("delete-comment",b)}return(b,x)=>(s.openBlock(),s.createElementBlock("div",E5,[s.createElementVNode("div",A5,[s.createElementVNode("div",T5,[s.createElementVNode("h3",N5,[s.createVNode(s.unref(tf),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.title")),1)]),s.createElementVNode("div",O5,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="active"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:x[0]||(x[0]=v=>c.value="active")},s.toDisplayString(s.unref(r)("sidebars.comments.active")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="resolved"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:x[1]||(x[1]=v=>c.value="resolved")},s.toDisplayString(s.unref(r)("sidebars.comments.resolved")),3)])]),e.selectedTextSnippet?(s.openBlock(),s.createElementBlock("div",M5,[s.createElementVNode("p",D5,s.toDisplayString(s.unref(r)("sidebars.comments.creatingAnchored")),1),s.createElementVNode("p",z5,' "'+s.toDisplayString(e.selectedTextSnippet)+'" ',1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",I5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.value,v=>(s.openBlock(),s.createElementBlock("div",{key:v.id,class:"relative space-y-3 rounded-2xl border border-slate-200/60 bg-slate-50/60 p-4 transition-all hover:border-cyan-500/30 hover:shadow-cyan dark:border-white/5 dark:bg-[#02040a]/40"},[s.createElementVNode("div",R5,[s.createElementVNode("div",L5,[s.createElementVNode("div",{class:"flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:v.authorColor})},s.toDisplayString(p(v.authorName)),5),s.createElementVNode("div",null,[s.createElementVNode("h4",B5,s.toDisplayString(v.authorName),1),s.createElementVNode("p",P5,s.toDisplayString(new Date(v.createdAt).toLocaleTimeString()),1)])]),s.createElementVNode("div",F5,[v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-green-500/10 hover:text-green-500",title:s.unref(r)("sidebars.comments.resolve"),onClick:y=>i("resolve-comment",v.id)},[s.createVNode(s.unref(Xh),{class:"h-4 w-4"})],8,V5)),h(v)?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-red-500/10 hover:text-red-500",title:s.unref(r)("sidebars.comments.delete"),onClick:y=>g(v.id)},[s.createVNode(s.unref(mr),{class:"h-4 w-4"})],8,U5)):s.createCommentVNode("",!0)])]),h(v)?(s.openBlock(),s.createElementBlock("div",H5,s.toDisplayString(s.unref(r)("sidebars.comments.orphaned")),1)):s.createCommentVNode("",!0),v.anchorText?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["max-w-full truncate rounded-r-lg border-l-2 py-1 pl-2.5 text-[10px] italic text-slate-500 dark:text-slate-400",h(v)?"border-amber-500/50 bg-amber-50/50 line-through opacity-70 dark:border-amber-500/40 dark:bg-amber-500/5":"border-cyan-500/50 bg-slate-100 dark:border-cyan-500/40 dark:bg-white/5"])},s.toDisplayString(s.unref(r)("sidebars.comments.quote"))+' "'+s.toDisplayString(v.anchorText)+'" ',3)):s.createCommentVNode("",!0),s.createElementVNode("p",q5,s.toDisplayString(v.content),1),v.replies.length>0?(s.openBlock(),s.createElementBlock("div",j5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(v.replies,y=>(s.openBlock(),s.createElementBlock("div",{key:y.id,class:"space-y-1"},[s.createElementVNode("div",$5,[s.createElementVNode("div",{class:"flex h-4.5 w-4.5 items-center justify-center rounded-full text-[8px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:y.authorColor})},s.toDisplayString(p(y.authorName)),5),s.createElementVNode("span",W5,s.toDisplayString(y.authorName),1),s.createElementVNode("span",G5,s.toDisplayString(new Date(y.createdAt).toLocaleTimeString()),1)]),s.createElementVNode("p",K5,s.toDisplayString(y.content),1)]))),128))])):s.createCommentVNode("",!0),v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",X5,[l.value===v.id?(s.openBlock(),s.createElementBlock("div",J5,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y=>o.value[v.id]=y,type:"text",placeholder:s.unref(r)("sidebars.comments.reply"),class:"flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 focus:border-cyan-500/50 focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(y=>m(v.id),["enter"])},null,40,Z5),[[s.vModelText,o.value[v.id]]]),s.createElementVNode("button",{type:"button",class:"rounded-lg bg-cyan-500 p-1.5 font-bold text-black shadow-cyan hover:bg-cyan-400",onClick:y=>m(v.id)},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"})],8,Q5)])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-all hover:text-cyan-500",onClick:y=>l.value=v.id},[s.createVNode(s.unref(Mb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.replyInThread")),1)],8,Y5))])),v.resolved?(s.openBlock(),s.createElementBlock("div",e6,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.comments.resolvedBy").replace("{user}",v.resolvedByName||v.resolvedBy||"You"))+" ",1),v.resolvedAt?(s.openBlock(),s.createElementBlock("span",t6,"at "+s.toDisplayString(new Date(v.resolvedAt).toLocaleTimeString()),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))),128)),u.value.length===0?(s.openBlock(),s.createElementBlock("div",n6,[s.createVNode(s.unref(kb),{class:"mx-auto mb-2 h-8 w-8 text-cyan-500 opacity-50"}),s.createElementVNode("p",i6,s.toDisplayString(s.unref(r)("sidebars.comments.noComments").replace("{mode}",c.value)),1)])):s.createCommentVNode("",!0)]),c.value==="active"?(s.openBlock(),s.createElementBlock("div",r6,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(f,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":x[2]||(x[2]=v=>a.value=v),rows:"2",placeholder:e.selectedTextSnippet?s.unref(r)("sidebars.comments.commentOnSelection"):s.unref(r)("sidebars.comments.generalComment"),class:"w-full min-h-[60px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,a6),[[s.vModelText,a.value]]),s.createElementVNode("div",o6,[s.createElementVNode("span",s6,s.toDisplayString(e.selectedTextSnippet?s.unref(r)("sidebars.comments.anchoredComment"):s.unref(r)("sidebars.comments.general")),1),s.createElementVNode("button",{type:"submit",disabled:!a.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-50"},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.post")),1)],8,l6)])],32)])):s.createCommentVNode("",!0)]))}}),c6={class:"history-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},u6={class:"border-b border-slate-200 p-4 dark:border-white/5"},d6={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},f6={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},p6={class:"flex-1 space-y-3 overflow-y-auto p-4"},m6={key:0,class:"space-y-2 rounded-2xl border border-amber-500/30 bg-amber-500/10 p-3.5 text-xs animate-fadeIn dark:border-amber-500/20"},h6={class:"flex items-start gap-1.5 text-amber-700 dark:text-amber-400"},b6={class:"font-bold"},g6={class:"mt-0.5 text-[10px] leading-relaxed text-amber-600 dark:text-amber-500"},v6={class:"flex justify-end gap-2 pt-1"},x6={class:"space-y-2.5"},y6={class:"mb-1 flex items-center justify-between"},k6={class:"rounded-md bg-slate-200 px-1.5 py-0.5 font-mono text-[9px] font-bold text-slate-500 dark:bg-cyan-500/10 dark:text-cyan-400"},w6={class:"flex items-center gap-0.5 font-mono text-[9px] text-slate-400 dark:text-slate-500"},_6={class:"text-xs font-bold leading-snug text-slate-800 dark:text-slate-200"},S6={class:"flex items-center gap-1.5 text-[10px] text-slate-500"},C6={class:"font-semibold text-slate-600 dark:text-slate-300"},E6={class:"flex justify-end gap-2 border-t border-slate-200/50 pt-2 dark:border-white/5"},A6=["onClick"],T6=["onClick"],N6={key:0,class:"py-6 text-center text-xs text-slate-400 dark:text-slate-500"},O6={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/85"},M6=["placeholder"],D6={class:"flex justify-end gap-2"},z6={type:"submit",class:"rounded-lg bg-cyan-500 px-3.5 py-1.5 text-xs font-bold text-black shadow-cyan hover:bg-cyan-400"},Ym=s.defineComponent({__name:"HistorySidebar",props:{snapshots:{},activePreviewIndex:{}},emits:["save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref(""),o=s.ref(!1);function l(){a.value.trim()&&(i("save-snapshot",a.value.trim()),a.value="",o.value=!1)}const c=s.computed(()=>n.snapshots??[]);return(u,f)=>(s.openBlock(),s.createElementBlock("div",c6,[s.createElementVNode("div",u6,[s.createElementVNode("h3",d6,[s.createVNode(s.unref(Sl),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.title")),1)]),s.createElementVNode("p",f6,s.toDisplayString(s.unref(r)("sidebars.history.empty")),1)]),s.createElementVNode("div",p6,[e.activePreviewIndex!==null?(s.openBlock(),s.createElementBlock("div",m6,[s.createElementVNode("div",h6,[s.createVNode(s.unref(Pb),{class:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-500"}),s.createElementVNode("div",null,[s.createElementVNode("p",b6,s.toDisplayString(s.unref(r)("sidebars.history.viewingPreview")),1),s.createElementVNode("p",g6,s.toDisplayString(s.unref(r)("sidebars.history.readOnlyPreview").replace("{index}",String(e.activePreviewIndex))),1)])]),s.createElementVNode("div",v6,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] font-semibold text-slate-500 hover:bg-white/5 hover:text-slate-700 dark:text-slate-400",onClick:f[0]||(f[0]=m=>i("preview-snapshot",null))},s.toDisplayString(s.unref(r)("sidebars.history.closePreview")),1),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:f[1]||(f[1]=()=>{i("restore-snapshot",e.activePreviewIndex),i("preview-snapshot",null)})},[s.createVNode(s.unref(qc),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restoreThis")),1)])])])):s.createCommentVNode("",!0),s.createElementVNode("div",x6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,m=>(s.openBlock(),s.createElementBlock("div",{key:m.versionIndex,class:s.normalizeClass(["space-y-2.5 rounded-2xl border p-4 transition-all",e.activePreviewIndex===m.versionIndex?"border-cyan-500/40 bg-cyan-500/5 shadow-cyan dark:border-cyan-500/30":"border-slate-200/60 bg-slate-50/60 hover:border-cyan-500/30 dark:border-white/5 dark:bg-[#02040a]/40 dark:hover:border-white/10"])},[s.createElementVNode("div",null,[s.createElementVNode("div",y6,[s.createElementVNode("span",k6,s.toDisplayString(s.unref(r)("sidebars.history.version"))+" #"+s.toDisplayString(m.versionIndex),1),s.createElementVNode("span",w6,[s.createVNode(s.unref(_l),{class:"h-2.5 w-2.5"}),s.createTextVNode(" "+s.toDisplayString(new Date(m.timestamp).toLocaleDateString())+" "+s.toDisplayString(new Date(m.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),1)])]),s.createElementVNode("h4",_6,s.toDisplayString(m.title),1)]),s.createElementVNode("div",S6,[s.createVNode(s.unref(Nl),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.history.modifiedBy"))+" ",1),s.createElementVNode("strong",C6,s.toDisplayString(m.modifiedBy),1)])]),s.createElementVNode("div",E6,[e.activePreviewIndex!==m.versionIndex?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-slate-500 transition-colors hover:text-cyan-600 dark:text-slate-400 dark:hover:text-cyan-400",onClick:p=>i("preview-snapshot",m)},[s.createVNode(s.unref(tb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.preview")),1)],8,A6)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-colors hover:text-cyan-500 dark:text-cyan-400 dark:hover:text-cyan-300",onClick:p=>i("restore-snapshot",m.versionIndex)},[s.createVNode(s.unref(qc),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restore")),1)],8,T6)])],2))),128)),c.value.length===0?(s.openBlock(),s.createElementBlock("p",N6,s.toDisplayString(s.unref(r)("sidebars.history.noSnapshots")),1)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",O6,[o.value?(s.openBlock(),s.createElementBlock("form",{key:0,class:"space-y-2 animate-fadeIn",onSubmit:s.withModifiers(l,["prevent"])},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[2]||(f[2]=m=>a.value=m),type:"text",required:"",placeholder:s.unref(r)("sidebars.history.snapshotPlaceholder"),class:"w-full rounded-xl border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,M6),[[s.vModelText,a.value]]),s.createElementVNode("div",D6,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] text-slate-500 hover:bg-white/5 dark:text-slate-400",onClick:f[3]||(f[3]=m=>o.value=!1)},s.toDisplayString(s.unref(r)("sidebars.history.cancel")),1),s.createElementVNode("button",z6,s.toDisplayString(s.unref(r)("sidebars.history.save")),1)])],32)):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-slate-300 py-2.5 text-xs font-bold text-slate-500 transition-all hover:border-cyan-500 hover:bg-cyan-500/5 hover:text-cyan-500 dark:border-white/10 dark:text-slate-400 dark:hover:border-cyan-400/50 dark:hover:text-cyan-400",onClick:f[4]||(f[4]=m=>o.value=!0)},[s.createVNode(s.unref(zb),{class:"h-3.5 w-3.5 animate-pulse"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.saveNamedSnapshot")),1)]))])]))}}),I6={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},R6={class:"mb-4 flex items-center justify-between"},L6={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},B6={key:0,class:"space-y-4"},P6={class:"flex items-start gap-3"},F6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},V6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},U6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},H6={class:"flex items-start gap-3"},q6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400"},j6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},$6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},W6={class:"text-xs text-slate-500 dark:text-slate-400"},G6={class:"flex items-start gap-3"},K6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400"},X6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},J6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},Z6={class:"grid grid-cols-2 gap-3"},Q6={class:"flex items-start gap-3"},Y6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"},eA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},tA={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},nA={class:"flex items-start gap-3"},iA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400"},rA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},aA={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},oA={class:"rounded-lg border border-slate-200 bg-slate-50 p-4 dark:border-slate-700/50 dark:bg-white/5"},sA={class:"mb-2 flex items-center gap-2 text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},lA={class:"grid grid-cols-3 gap-3 text-center"},cA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},uA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},dA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},fA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},pA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},mA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},hA={key:1,class:"py-8 text-center text-sm text-slate-500 dark:text-slate-400"},eh=s.defineComponent({__name:"DetailsDialog",props:{isOpen:{type:Boolean},meta:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ct(),i=t;function r(a){return a?new Date(a).toLocaleString():"-"}return(a,o)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:o[1]||(o[1]=s.withModifiers(l=>i("close"),["self"]))},[s.createElementVNode("div",I6,[s.createElementVNode("div",R6,[s.createElementVNode("h2",L6,s.toDisplayString(s.unref(n)("editor.details.title")),1),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:o[0]||(o[0]=l=>i("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),e.meta?(s.openBlock(),s.createElementBlock("div",B6,[s.createElementVNode("div",P6,[s.createElementVNode("div",F6,[s.createVNode(s.unref(gt),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",V6,s.toDisplayString(s.unref(n)("editor.details.titleLabel")),1),s.createElementVNode("p",U6,s.toDisplayString(e.meta.title),1)])]),s.createElementVNode("div",H6,[s.createElementVNode("div",q6,[s.createVNode(s.unref(Nl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",j6,s.toDisplayString(s.unref(n)("editor.details.owner")),1),s.createElementVNode("p",$6,s.toDisplayString(e.meta.owner.name),1),s.createElementVNode("p",W6,s.toDisplayString(e.meta.owner.email),1)])]),s.createElementVNode("div",G6,[s.createElementVNode("div",K6,[s.createVNode(s.unref(ab),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",X6,s.toDisplayString(s.unref(n)("editor.details.location")),1),s.createElementVNode("p",J6,s.toDisplayString(e.meta.folderName||s.unref(n)("editor.details.noFolder")),1)])]),s.createElementVNode("div",Z6,[s.createElementVNode("div",Q6,[s.createElementVNode("div",Y6,[s.createVNode(s.unref(_l),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",eA,s.toDisplayString(s.unref(n)("editor.details.created")),1),s.createElementVNode("p",tA,s.toDisplayString(r(e.meta.createdAt)),1)])]),s.createElementVNode("div",nA,[s.createElementVNode("div",iA,[s.createVNode(s.unref(Zh),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",rA,s.toDisplayString(s.unref(n)("editor.details.modified")),1),s.createElementVNode("p",aA,s.toDisplayString(r(e.meta.updatedAt)),1)])])]),s.createElementVNode("div",oA,[s.createElementVNode("div",sA,[s.createVNode(s.unref(Oa),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.details.statistics")),1)]),s.createElementVNode("div",lA,[s.createElementVNode("div",null,[s.createElementVNode("p",cA,s.toDisplayString(e.meta.wordCount),1),s.createElementVNode("p",uA,s.toDisplayString(s.unref(n)("editor.details.words")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",dA,s.toDisplayString(e.meta.charCount),1),s.createElementVNode("p",fA,s.toDisplayString(s.unref(n)("editor.details.characters")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",pA,s.toDisplayString(e.meta.pageCount),1),s.createElementVNode("p",mA,s.toDisplayString(s.unref(n)("editor.details.pages")),1)])])])])):(s.openBlock(),s.createElementBlock("div",hA,s.toDisplayString(s.unref(n)("editor.details.loading")),1))])])):s.createCommentVNode("",!0)}}),bA={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},gA={class:"mb-4 flex items-center justify-between"},vA={class:"flex items-center gap-2"},xA={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},yA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},kA={class:"mb-4 rounded-md border border-slate-200 bg-slate-50 p-3 dark:border-slate-700/50 dark:bg-white/5"},wA={class:"mb-1 block text-[11px] font-bold uppercase tracking-wide text-slate-500 dark:text-slate-400"},_A={class:"flex items-center gap-2"},SA=["value"],CA=["title"],EA={class:"space-y-3"},AA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},TA=["placeholder"],NA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},OA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},MA={class:"mt-5 flex justify-end gap-2"},DA=["href"],th=s.defineComponent({__name:"EmailDialog",props:{isOpen:{type:Boolean},documentTitle:{},shareUrl:{},defaultRecipient:{}},emits:["close","copy-link"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(i.defaultRecipient||""),o=s.ref(""),l=s.ref(""),c=s.ref(!1),u=s.ref(!1),f=s.computed(()=>n("editor.email.defaultSubject",{title:i.documentTitle})),m=s.computed(()=>n("editor.email.defaultBody",{url:i.shareUrl})),p=s.computed(()=>o.value===f.value),h=s.computed(()=>l.value===m.value);s.watch(()=>i.documentTitle,()=>{o.value=f.value},{immediate:!0}),s.watch(()=>i.shareUrl,()=>{l.value=m.value},{immediate:!0});const g=s.computed(()=>{const v=new URLSearchParams;o.value.trim()&&v.set("subject",o.value.trim()),l.value.trim()&&v.set("body",l.value.trim());const y=v.toString();let k=`mailto:${a.value.trim()}`;return y&&(k+=`?${y}`),k});function b(){r("copy-link")}function x(){a.value=i.defaultRecipient||"",o.value=f.value,l.value=m.value,c.value=!1,u.value=!1}return s.watch(()=>i.isOpen,v=>{v&&x()}),(v,y)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:y[10]||(y[10]=s.withModifiers(k=>r("close"),["self"]))},[s.createElementVNode("div",bA,[s.createElementVNode("div",gA,[s.createElementVNode("div",vA,[s.createElementVNode("div",xA,[s.createVNode(s.unref(Ms),{class:"h-4 w-4"})]),s.createElementVNode("h2",yA,s.toDisplayString(s.unref(n)("editor.email.title")),1)]),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:y[0]||(y[0]=k=>r("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),s.createElementVNode("div",kA,[s.createElementVNode("label",wA,s.toDisplayString(s.unref(n)("editor.email.shareableLink")),1),s.createElementVNode("div",_A,[s.createElementVNode("input",{type:"text",value:e.shareUrl,readonly:"",class:"flex-1 rounded-md border border-slate-300 bg-white px-2 py-1.5 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300"},null,8,SA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md border border-slate-300 text-slate-500 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-400 dark:hover:bg-slate-700",title:s.unref(n)("editor.email.copyLink"),onClick:b},[s.createVNode(s.unref(El),{class:"h-3.5 w-3.5"})],8,CA)])]),s.createElementVNode("div",EA,[s.createElementVNode("div",null,[s.createElementVNode("label",AA,s.toDisplayString(s.unref(n)("editor.email.to")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[1]||(y[1]=k=>a.value=k),type:"email",class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",placeholder:s.unref(n)("editor.email.toPlaceholder")},null,8,TA),[[s.vModelText,a.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",NA,s.toDisplayString(s.unref(n)("editor.email.subject")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[2]||(y[2]=k=>o.value=k),type:"text",class:s.normalizeClass(["w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",p.value&&!c.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:y[3]||(y[3]=k=>c.value=!0),onBlur:y[4]||(y[4]=k=>c.value=!1)},null,34),[[s.vModelText,o.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",OA,s.toDisplayString(s.unref(n)("editor.email.body")),1),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":y[5]||(y[5]=k=>l.value=k),rows:"4",class:s.normalizeClass(["w-full resize-none rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",h.value&&!u.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:y[6]||(y[6]=k=>u.value=!0),onBlur:y[7]||(y[7]=k=>u.value=!1)},null,34),[[s.vModelText,l.value]])])]),s.createElementVNode("div",MA,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold text-slate-700 transition hover:bg-slate-100 dark:text-slate-300",onClick:y[8]||(y[8]=k=>r("close"))},s.toDisplayString(s.unref(n)("common.cancel")),1),s.createElementVNode("a",{href:g.value,class:"inline-flex rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-cyan-700",onClick:y[9]||(y[9]=k=>r("close"))},s.toDisplayString(s.unref(n)("editor.email.send")),9,DA)])])])):s.createCommentVNode("",!0)}}),zA=["aria-label"],IA={class:"flex items-center gap-1.5"},RA=["placeholder"],LA={class:"w-16 flex-shrink-0 text-center text-[11px] text-slate-400 dark:text-slate-500"},BA=["disabled","title"],PA=["disabled","title"],FA=["title"],VA={class:"mt-2 flex items-center gap-1.5"},UA=["placeholder","onKeydown"],HA=["disabled"],qA=["disabled"],jA=s.defineComponent({__name:"FindReplaceDialog",props:{isOpen:{type:Boolean},editor:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(null),o=s.ref(""),l=s.ref(""),c=s.ref({query:"",matches:[],activeIndex:0}),u=s.computed(()=>{if(!o.value)return"";const{matches:y,activeIndex:k}=c.value;return y.length===0?n("editor.findReplace.noMatches"):n("editor.findReplace.matchCount",{current:k+1,total:y.length})}),f=()=>{i.editor&&(c.value=_e.getSearchState(i.editor))};s.watch(()=>i.editor,(y,k)=>{k==null||k.off("transaction",f),y==null||y.on("transaction",f)}),s.watch(()=>i.isOpen,async y=>{var k,w;if(i.editor)if(y){const{from:S,to:E}=i.editor.state.selection;S!==E&&(o.value=i.editor.state.doc.textBetween(S,E," ")),m(),i.editor.on("transaction",f),await s.nextTick(),(k=a.value)==null||k.focus(),(w=a.value)==null||w.select()}else v()});function m(){i.editor&&(_e.setSearchQuery(i.editor,o.value),f())}s.watch(o,m);function p(){i.editor&&_e.searchNext(i.editor)}function h(){i.editor&&_e.searchPrev(i.editor)}function g(){i.editor&&_e.replaceCurrent(i.editor,l.value)}function b(){i.editor&&_e.replaceAll(i.editor,l.value)}function x(y){y.key==="Enter"&&y.shiftKey?(y.preventDefault(),h()):y.key==="Enter"?(y.preventDefault(),p()):y.key==="Escape"&&(y.preventDefault(),v())}function v(){var y;i.editor&&_e.clearSearch(i.editor),(y=i.editor)==null||y.off("transaction",f),o.value="",l.value="",c.value={query:"",matches:[],activeIndex:0},r("close")}return s.onUnmounted(()=>{var y;(y=i.editor)==null||y.off("transaction",f)}),(y,k)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"absolute right-4 top-16 z-40 w-[340px] rounded-xl border border-slate-200 bg-white p-3 shadow-2xl dark:border-slate-700 dark:bg-[#0e1525]",role:"dialog","aria-label":s.unref(n)("editor.findReplace.title")},[s.createElementVNode("div",IA,[s.withDirectives(s.createElementVNode("input",{ref_key:"findInput",ref:a,"onUpdate:modelValue":k[0]||(k[0]=w=>o.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.findPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:x},null,40,RA),[[s.vModelText,o.value]]),s.createElementVNode("span",LA,s.toDisplayString(u.value),1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.previous"),onClick:h},[s.createVNode(s.unref(Gh),{class:"h-4 w-4"})],8,BA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.next"),onClick:p},[s.createVNode(s.unref(Xt),{class:"h-4 w-4"})],8,PA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800",title:s.unref(n)("editor.findReplace.close"),onClick:v},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,FA)]),s.createElementVNode("div",VA,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[1]||(k[1]=w=>l.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.replacePlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:s.withKeys(s.withModifiers(g,["prevent"]),["enter"])},null,40,UA),[[s.vModelText,l.value]]),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:g},s.toDisplayString(s.unref(n)("editor.findReplace.replace")),9,HA),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:b},s.toDisplayString(s.unref(n)("editor.findReplace.replaceAll")),9,qA)])],8,zA)):s.createCommentVNode("",!0)}}),$A={class:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-6 shadow-xl dark:border-slate-700 dark:bg-slate-800"},WA={class:"mb-4 flex items-center justify-between"},GA={class:"flex items-center gap-2 text-base font-semibold text-slate-900 dark:text-slate-100"},KA={class:"mb-4"},XA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},JA=["placeholder"],ZA={class:"mb-2"},QA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},YA=["placeholder"],e8={key:0,class:"mt-1 text-[11px] text-red-600 dark:text-red-400"},t8={class:"flex items-center justify-end gap-2 pt-2"},n8=s.defineComponent({__name:"LinkDialog",props:{isOpen:{type:Boolean},initialText:{},initialUrl:{},isEditing:{type:Boolean}},emits:["apply","remove","close"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(""),o=s.ref(""),l=s.ref("");s.watch(()=>i.isOpen,g=>{g&&(a.value=i.initialText??"",o.value=i.initialUrl??"https://",l.value="")});function c(){const g=o.value.trim();if(!g)return l.value=n("editor.linkDialog.urlRequired"),!1;if(/^(\/|#|mailto:|tel:)/.test(g))return l.value="",!0;try{return new URL(g),l.value="",!0}catch{return l.value=n("editor.linkDialog.urlInvalid"),!1}}function u(g){const b=g.trim();return/^(\/|#|mailto:|tel:)/.test(b)||/^https?:\/\//i.test(b)?b:`https://${b}`}function f(){c()&&r("apply",{text:a.value.trim(),url:u(o.value)})}function m(){r("remove")}function p(){r("close")}function h(g){g.key==="Escape"&&p()}return(g,b)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:s.withModifiers(p,["self"]),onKeydown:h},[s.createElementVNode("div",$A,[s.createElementVNode("div",WA,[s.createElementVNode("h3",GA,[s.createVNode(s.unref(El),{class:"h-5 w-5 text-slate-500 dark:text-slate-400"}),s.createTextVNode(" "+s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.editTitle"):s.unref(n)("editor.linkDialog.insertTitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-sm text-slate-400 transition-all hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-700 dark:hover:text-slate-300",onClick:p},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),s.createElementVNode("div",KA,[s.createElementVNode("label",XA,s.toDisplayString(s.unref(n)("editor.linkDialog.text")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=x=>a.value=x),type:"text",placeholder:s.unref(n)("editor.linkDialog.textPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,JA),[[s.vModelText,a.value]])]),s.createElementVNode("div",ZA,[s.createElementVNode("label",QA,s.toDisplayString(s.unref(n)("editor.linkDialog.url")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=x=>o.value=x),type:"text",placeholder:s.unref(n)("editor.linkDialog.urlPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,YA),[[s.vModelText,o.value]]),l.value?(s.openBlock(),s.createElementBlock("p",e8,s.toDisplayString(l.value),1)):s.createCommentVNode("",!0)]),s.createElementVNode("div",t8,[e.isEditing?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"mr-auto flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-semibold text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40",onClick:m},[s.createVNode(s.unref(mr),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.linkDialog.remove")),1)])):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:p},s.toDisplayString(s.unref(n)("editor.linkDialog.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition-all hover:bg-cyan-700",onClick:f},s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.update"):s.unref(n)("editor.linkDialog.insert")),1)])])],32)):s.createCommentVNode("",!0)}});async function Rd(e,t){var n,i;if(typeof document>"u")return!1;try{if(t&&typeof ClipboardItem<"u"&&((n=navigator.clipboard)!=null&&n.write)){const r=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});return await navigator.clipboard.write([r]),!0}if((i=navigator.clipboard)!=null&&i.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");return r.remove(),a}catch{return!1}}async function i8(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.read))return null;try{const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes("text/html"))return await(await n.getType("text/html")).text();for(const n of t)if(n.types.includes("text/plain"))return await(await n.getType("text/plain")).text();return null}catch{return null}}async function Es(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return null;try{return await navigator.clipboard.readText()}catch{return null}}const r8={class:"docs-editor flex h-screen w-full flex-col overflow-hidden bg-slate-50 transition-colors dark:bg-[#02040a]"},a8=["title","aria-label"],o8={class:"docs-editor__body relative flex flex-1 overflow-hidden"},s8=["title"],l8={class:"flex flex-1 flex-col items-center gap-4 w-full relative"},c8=["aria-label"],u8={key:5,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},d8={class:"w-full max-w-lg rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},f8={class:"text-lg font-bold mb-4"},p8={class:"mb-6"},m8={class:"flex justify-between items-center mb-2"},h8={class:"text-sm font-semibold text-slate-500 dark:text-slate-400"},b8={class:"grid grid-cols-2 gap-3"},g8={class:"text-[11px] font-medium block mb-1"},v8=["placeholder"],x8={class:"text-[11px] font-medium block mb-1"},y8=["placeholder"],k8={class:"rounded-lg bg-slate-50 p-3 text-[11px] text-slate-500 dark:bg-white/5 dark:text-slate-400 mb-6"},w8={class:"flex justify-end gap-2"},_8={key:6,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},S8={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},C8={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},E8={class:"mb-6"},A8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},T8={class:"space-y-4"},N8={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},O8={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},M8={class:"mb-8"},D8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},z8={class:"space-y-3"},I8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},R8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},L8={class:"flex justify-end items-center gap-3"},B8={key:7,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},P8={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},F8={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},V8={class:"mb-6"},U8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},H8={class:"space-y-3"},q8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},j8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},$8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none pt-1"},W8={class:"mb-8"},G8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},K8={class:"space-y-3"},X8={class:"flex items-center gap-3"},J8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},Z8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},Q8={class:"flex justify-end items-center gap-3"},Y8={key:8,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},eT={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},tT={class:"text-lg font-bold mb-4"},nT={class:"mb-4"},iT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},rT=["value"],aT={class:"mb-4"},oT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},sT={class:"flex gap-2"},lT={class:"mb-6"},cT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},uT={class:"grid grid-cols-2 gap-3"},dT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},fT=["max"],pT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},mT=["max"],hT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},bT=["max"],gT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},vT=["max"],xT={class:"flex justify-end gap-2"},yT=189,Zi=37.795,As=0,Ts=5,Ld=.1,_i=0,kT=s.defineComponent({__name:"DocsEditor",props:{modelValue:{default:void 0},plugins:{default:()=>[]},editable:{type:Boolean,default:!0},collaboration:{default:void 0},pageSize:{default:"a4"},pageless:{type:Boolean,default:!1},virtualPages:{type:Boolean,default:!1},title:{default:"Untitled Document"},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},connectionState:{default:"connected"},userName:{default:""},userAvatar:{default:""},locale:{default:void 0},documentMeta:{default:void 0},shareUrl:{default:""},onImageUpload:{type:Function,default:void 0},citation:{default:void 0},aiStream:{type:Function,default:void 0},aiDraft:{type:Function,default:void 0},debug:{type:Boolean,default:!1},comments:{default:()=>[]},selectedTextSnippet:{default:""},selectedTextIndex:{default:void 0},snapshots:{default:()=>[]},activePreviewIndex:{default:null},orientation:{default:"portrait"},margins:{default:()=>({top:94,bottom:94,left:94,right:94})},headerMarginCm:{default:.5},footerMarginCm:{default:.5}},emits:["update:modelValue","update:title","update:pageSize","update:orientation","update:margins","update:header-footer-margins","update:pageless","update:pageCount","update:locale","citation-sources-change","update:citation-style","toggle-star","back","share","menu-click","export","ready","add-comment","add-reply","resolve-comment","delete-comment","save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){var Ac,Tc,Nc,Oc,Mc;const n=e,i=t,{locale:r,setLocale:a,t:o}=jd(n.locale);s.watch(()=>n.locale,A=>{A&&A!==r.value&&a(A)}),s.watch(r,A=>{i("update:locale",A)});const l=s.ref({top:((Ac=n.margins)==null?void 0:Ac.top)??94,bottom:((Tc=n.margins)==null?void 0:Tc.bottom)??94,left:((Nc=n.margins)==null?void 0:Nc.left)??94,right:((Oc=n.margins)==null?void 0:Oc.right)??94});function c(A,T=.5){const z=typeof A=="number"?A:Number(A);if(!Number.isFinite(z))return T;const le=Math.min(Ts,Math.max(As,z));return Math.round(le*10)/10}const u=s.ref(n.orientation??"portrait"),f=s.ref(n.pageSize??"a4"),m=s.ref(n.pageless??!1);s.watch(()=>n.orientation,A=>{A!==void 0&&(u.value=A)}),s.watch(()=>n.margins,A=>{A!==void 0&&(l.value={...A})}),s.watch(()=>n.headerMarginCm,A=>{typeof A=="number"&&Number.isFinite(A)&&(ln.value=c(A))}),s.watch(()=>n.footerMarginCm,A=>{typeof A=="number"&&Number.isFinite(A)&&(cn.value=c(A))});const p=s.computed(()=>{const A=Qi.getPageSize(f.value)??Qi.PAGE_SIZES[0];let T=A.pageWidth,z=A.pageHeight;return u.value==="landscape"&&([T,z]=[z,T]),{pageHeight:z,pageWidth:T,margins:{...l.value}}}),h=s.computed(()=>`${p.value.pageWidth}px`),{isDark:g}=So(),b=s.computed(()=>n.virtualPages===!0),x=s.computed(()=>({enabled:!m.value&&!b.value,pageHeight:p.value.pageHeight,pageWidth:p.value.pageWidth,marginTop:p.value.margins.top,marginBottom:p.value.margins.bottom,marginLeft:p.value.margins.left,marginRight:p.value.margins.right,contentMarginTop:0,contentMarginBottom:0,pageGap:40,pageBreakBackground:g.value?"#02040a":"#f1f5f9",headerLeft:"",headerRight:"",footerLeft:"",footerRight:"",onHeaderClick:A=>{ea(A==null?void 0:A.event)},onFooterClick:A=>{A!=null&&A.event&&A.event.detail!==2||ta()}})),y=(A=>{const T=A;return T&&typeof T=="object"&&T.type==="tabbed-doc"&&Array.isArray(T.tabs)?T:{type:"tabbed-doc",activeTabId:"tab-1",tabs:[{id:"tab-1",label:"Tab 1",content:A||{type:"doc",content:[{type:"paragraph"}]}}]}})(n.modelValue),k=s.ref(y.headerLeft||""),w=s.ref(y.headerRight||""),S=s.ref(y.footerLeft||""),E=s.ref(y.footerRight||""),D=s.ref(y.tabs.map(A=>({id:A.id,label:A.label,active:A.id===y.activeTabId}))),_=s.ref({});y.tabs.forEach(A=>{_.value[A.id]=A.content});const C=s.ref(y.activeTabId),N=s.computed(()=>_.value[C.value]),I=s.ref(!1),H=s.ref(null),F=s.ref(null),M=s.ref(localStorage.getItem("docflow:view:showRuler")!=="false"),j=s.ref(!1);s.watch(M,A=>{localStorage.setItem("docflow:view:showRuler",A?"true":"false")});const P=s.ref(0),W=s.ref(0),L=s.ref("saved"),Y=s.ref(Date.now()),q=s.ref(null),O=s.ref(new Set);let B=null;const U=s.ref(!1);function oe(){if(!G.value||!we.value)return;const A=G.value.state.doc;if(n.collaboration&&!U.value&&A.content.size<=2)return;U.value=!0;const T=new Set;A.descendants(z=>{for(const le of z.marks)le.type.name==="comment"&&le.attrs.threadId&&T.add(le.attrs.threadId);return!0}),O.value=T}function ne(){B&&clearTimeout(B),B=setTimeout(oe,200)}const te=s.computed(()=>{if(!U.value)return[];const A=O.value;return(n.comments??[]).filter(T=>T.anchorIndex!=null&&!A.has(T.id)).map(T=>T.id)});s.onUnmounted(()=>{B&&clearTimeout(B)});const ie=s.computed(()=>{const A=[];for(const T of n.plugins)for(const z of T.slashCommands||[])A.push({name:z.name,command:z.command});return A}),X=()=>{const A={type:"tabbed-doc",activeTabId:C.value,tabs:D.value.map(T=>({id:T.id,label:T.label,content:_.value[T.id]})),headerLeft:k.value,headerRight:w.value,footerLeft:S.value,footerRight:E.value};i("update:modelValue",A),L.value="saving",q.value&&clearTimeout(q.value),q.value=setTimeout(()=>{L.value="saved",Y.value=Date.now()},800)},V=s.ref((()=>{var T;const A=(T=n.citation)==null?void 0:T.sources;return Array.isArray(A)?[...A]:typeof A=="function"?[...A()]:[]})()),$=s.ref(((Mc=n.citation)==null?void 0:Mc.style)||"chicago-notes-bibliography");let re=null;const se=s.ref(!1),Ce=A=>{re==null||re(A),re=null,se.value=!1},Ne=()=>new Promise(A=>{Ce(null),re=A,se.value=!0,F.value="references"}),de=s.computed(()=>{const A=n.citation;if(A)return{...A,sources:()=>V.value,onSourceRequest:A.onSourceRequest??Ne}}),{editorRef:ke,editor:G,pluginActions:At,isReady:we,docsEditor:Bt}=Bd({content:N,plugins:n.plugins,editable:n.editable,collaboration:n.collaboration,onImageUpload:n.onImageUpload,citation:de.value,aiStream:n.aiStream,aiDraft:n.aiDraft,debug:n.debug,getPageMap:()=>new Map,paginationOptions:x.value,onUpdate:A=>{_.value[C.value]=A,X()}}),K=()=>{var A,T,z;return((z=(T=(A=G.value)==null?void 0:A.storage)==null?void 0:T.citation)==null?void 0:z.engine)??null},R=()=>{var A;(A=K())==null||A.updateSources(V.value),i("citation-sources-change",V.value)},Q=A=>{V.value=[...V.value,A],R()},Ie=A=>{V.value=V.value.map(T=>T.id===A.id?A:T),R()},$e=A=>{V.value=V.value.filter(T=>T.id!==A),R()},Ge=A=>{var T;$.value=A,(T=K())==null||T.setStyle(A),i("update:citation-style",A)},an=A=>{var T,z;re?(Ce(A),F.value=null):(z=(T=At.value).insertCitation)==null||z.call(T,{sourceId:A})};s.watch(F,(A,T)=>{T==="references"&&A!=="references"&&Ce(null)});const vt=s.ref(!1),xt=s.ref(""),Pt=s.computed(()=>{var A,T;return!!((A=n.citation)!=null&&A.onImportDoi||(T=n.citation)!=null&&T.onImportBibliography)}),yn=async A=>{const T=n.citation;if(!(!(T!=null&&T.onImportDoi)||vt.value)){vt.value=!0,xt.value="";try{const z=await T.onImportDoi(A);if(!z){xt.value=o("sidebars.references.import.doiFailed");return}const le=V.value.some(ue=>ue.id===z.id);V.value=le?V.value.map(ue=>ue.id===z.id?z:ue):[...V.value,z],R(),xt.value=o("sidebars.references.import.doiSuccess")}catch{xt.value=o("sidebars.references.import.doiFailed")}finally{vt.value=!1}}},Ye=async A=>{const T=n.citation;if(!(!(T!=null&&T.onImportBibliography)||vt.value)){vt.value=!0,xt.value="";try{const{imported:z,failed:le}=await T.onImportBibliography(A);if(z.length>0){const ue=new Map(V.value.map(ye=>[ye.id,ye]));for(const ye of z)ue.set(ye.id,ye);V.value=[...ue.values()],R()}xt.value=le>0?o("sidebars.references.import.partial").replace("{ok}",String(z.length)).replace("{failed}",String(le)):o("sidebars.references.import.batchSuccess").replace("{count}",String(z.length))}catch{xt.value=o("sidebars.references.import.failed")}finally{vt.value=!1}}},jn=()=>{var T;const A=((T=G.value)==null?void 0:T.getText())??"";W.value=A.length,P.value=A.trim()?A.trim().split(/\s+/).length:0},Pi=()=>{if(!G.value)return null;const{from:A,to:T,head:z}=G.value.state.selection;if(A===T)return null;const le=G.value.view.coordsAtPos(z);if(!le)return null;const ue=12,ye=180,Oe=le.top-48,Ae=(le.left+le.right)/2;if(typeof window>"u")return{top:Math.max(ue,Oe),left:Ae};const me=Math.min(ye,Math.max(0,window.innerWidth/2-ue)),fe=ue+me,ce=window.innerWidth-ue-me,be=Math.max(ue,window.innerHeight-48);return{top:Math.min(be,Math.max(ue,Oe)),left:Math.min(ce,Math.max(fe,Ae))}},Fi=()=>{if(!G.value){I.value=!1,H.value=null;return}const{from:A,to:T}=G.value.state.selection;I.value=A!==T,H.value=A!==T?Pi():null},$n=s.ref(null);let kn=null;const Fo=()=>{G.value&&(kn&&clearTimeout(kn),kn=setTimeout(()=>{G.value&&G.value.view.dispatch(G.value.state.tr)},150))},on=s.ref(1),yt=s.ref(1),Ft=s.computed(()=>{const A=p.value;return{pageSize:{id:f.value,name:f.value.toUpperCase(),pageWidth:A.pageWidth,pageHeight:A.pageHeight},margins:{top:A.margins.top,bottom:A.margins.bottom,left:A.margins.left,right:A.margins.right},pageGap:40,headerLeft:k.value,headerRight:w.value,footerLeft:S.value,footerRight:E.value}}),{data:Vi,totalPages:Vt,isReady:Wn,refreshData:Vo}=Ch({editorRef:s.computed(()=>G.value),scrollRef:$n,config:Ft.value,bufferPages:2});s.watch([Vt,Wn],()=>{b.value&&Wn.value&&(on.value=Vt.value)}),s.watch(b,A=>{A&&Vo()});const sn=()=>{if(!G.value||!we.value){on.value=1,yt.value=1;return}const A=G.value.view.dom,T=A.querySelector("[data-rm-pagination]");T?on.value=T.children.length||1:on.value=1;try{const{selection:z}=G.value.state,le=G.value.view.coordsAtPos(z.head);if(le&&T){const ue=Array.from(T.querySelectorAll(".rm-page-break")),ye=A.getBoundingClientRect(),Oe=le.top-ye.top+A.scrollTop;let Ae=1,me=!1;for(let fe=0;fe<ue.length;fe++){const ce=ue[fe].querySelector(".breaker");if(ce instanceof HTMLElement&&Oe<ce.offsetTop){yt.value=Ae,me=!0;break}Ae++}me||(yt.value=Ae)}else yt.value=1}catch{yt.value=1}};s.watch(p,A=>{G.value&&(G.value.commands.updatePageHeight(A.pageHeight),G.value.commands.updatePageWidth(A.pageWidth),G.value.commands.updateMargins({top:A.margins.top,bottom:A.margins.bottom,left:A.margins.left,right:A.margins.right}),sn())});const wn=A=>{A!==m.value&&(m.value=A,i("update:pageless",A),G.value&&(A?G.value.commands.disablePagination():G.value.commands.enablePagination(),setTimeout(()=>{sn(),Xn()},60)))};s.watch(()=>n.pageless,A=>wn(A??!1));const Ut=s.ref(!1),_n=s.ref(!1),ft=s.ref(""),pt=s.ref(""),Sn=s.ref(""),Lr=s.ref(""),ln=s.ref(c(n.headerMarginCm)),cn=s.ref(c(n.footerMarginCm)),Br=s.ref(!1),Ui=s.ref(ln.value),Hi=s.ref(cn.value),Pr=s.ref(!1),Fr=s.ref(!1),Vr=s.ref(!1),Ur=s.ref("header"),Hr=s.ref(!0),qr=s.ref("startAt"),jr=s.ref(1),hi=s.ref("header"),$r=s.ref(!0),bi=s.ref("startAt"),Wr=s.ref(1),Uo=A=>{if(!Hr.value&&A===0)return"";let T=A+1;return qr.value==="startAt"&&(T=A+jr.value),String(T)},Ht=()=>{if(!G.value||!we.value)return;const A=String(on.value),T=G.value.view.dom,z=k.value.replace(/{total}/g,A),le=w.value.replace(/{total}/g,A),ue=S.value.replace(/{total}/g,A),ye=E.value.replace(/{total}/g,A);G.value.commands.updateHeaderContent(z,le),G.value.commands.updateFooterContent(ue,ye);const Oe=`${Math.max(0,ln.value)*Zi}px`,Ae=`${Math.max(0,cn.value)*Zi}px`;T.style.setProperty("--rm-header-margin-top",Oe),T.style.setProperty("--rm-footer-margin-bottom",Ae),G.value.view.dispatch(G.value.state.tr),setTimeout(()=>{requestAnimationFrame(()=>{if(!G.value||G.value.view.dom!==T)return;const me=(be,Te)=>{let Ee=z,De=le;return Te&&Ut.value?(Ee=ft.value.replace(/{total}/g,A),De=pt.value.replace(/{total}/g,A)):_n.value&&be%2===0&&(Ee=Sn.value.replace(/{total}/g,A),De=Lr.value.replace(/{total}/g,A)),{left:Ee.replace(/{page}/g,Uo(be-1)),right:De.replace(/{page}/g,Uo(be-1))}},fe=(be,Te,Ee)=>{const De=me(Te,Ee),Me=be.querySelector(".rm-page-header-left"),Fe=be.querySelector(".rm-page-header-right");Me&&(Me.innerHTML=De.left),Fe&&(Fe.innerHTML=De.right)},ce=T.querySelector(".rm-first-page-header");ce&&fe(ce,1,!0),Array.from(T.querySelectorAll(".rm-page-break .rm-page-header")).forEach((be,Te)=>{fe(be,Te+2,!1)}),Array.from(T.querySelectorAll(".rm-page-break .rm-page-footer")).forEach((be,Te)=>{const Ee=Te+1,De=Uo(Ee-1),Me=be.querySelector(".rm-page-footer-left"),Fe=be.querySelector(".rm-page-footer-right");Me&&(Me.innerHTML=ue.replace(/{page}/g,De)),Fe&&(Fe.innerHTML=ye.replace(/{page}/g,De))})})},50)};s.watch(Ut,()=>{Ht()}),s.watch([_n,ln,cn,Ur,Hr,qr,jr],()=>{Ht()}),s.watch(on,A=>{Ht(),i("update:pageCount",A)}),s.watch(g,A=>{G.value&&(G.value.commands.updatePageBreakBackground(A?"#02040a":"#f1f5f9"),G.value.view.dispatch(G.value.state.tr))}),s.watch(x,A=>{if(!G.value||!we.value)return;const T=G.value.storage.PaginationPlus;!T||!(T.pageHeight!==A.pageHeight||T.pageWidth!==A.pageWidth||T.marginTop!==A.marginTop||T.marginBottom!==A.marginBottom||T.marginLeft!==A.marginLeft||T.marginRight!==A.marginRight||T.pageGap!==A.pageGap||T.contentMarginTop!==A.contentMarginTop||T.contentMarginBottom!==A.contentMarginBottom||T.pageBreakBackground!==A.pageBreakBackground||T.enabled!==A.enabled)||(T.pageHeight=A.pageHeight,T.pageWidth=A.pageWidth,T.marginTop=A.marginTop,T.marginBottom=A.marginBottom,T.marginLeft=A.marginLeft,T.marginRight=A.marginRight,T.pageGap=A.pageGap,T.contentMarginTop=A.contentMarginTop,T.contentMarginBottom=A.contentMarginBottom,T.pageBreakBackground=A.pageBreakBackground,T.enabled=A.enabled,G.value.view.dispatch(G.value.state.tr))},{deep:!0}),s.watch(we,A=>{var T,z,le,ue,ye,Oe,Ae,me;A&&G.value&&(!k.value&&!w.value&&!S.value&&!E.value&&(k.value=((z=(T=G.value.storage.PaginationPlus)==null?void 0:T.appliedConfig)==null?void 0:z.headerLeft)||"",w.value=((ue=(le=G.value.storage.PaginationPlus)==null?void 0:le.appliedConfig)==null?void 0:ue.headerRight)||"",S.value=((Oe=(ye=G.value.storage.PaginationPlus)==null?void 0:ye.appliedConfig)==null?void 0:Oe.footerLeft)||"",E.value=((me=(Ae=G.value.storage.PaginationPlus)==null?void 0:Ae.appliedConfig)==null?void 0:me.footerRight)||""),Ht(),Bt.value&&i("ready",Bt.value),G.value.on("selectionUpdate",()=>{Fi(),sn()}),G.value.on("transaction",()=>{sn(),jn(),ne()}),Fi(),jn(),sn(),ne(),setTimeout(()=>{var ce;return(ce=G.value)==null?void 0:ce.commands.focus("start")},50),[100,300,600,1200,2500].forEach(ce=>{setTimeout(()=>{G.value&&G.value.view.dispatch(G.value.state.tr)},ce)}),G.value.view.dom.addEventListener("keydown",ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key.toLowerCase()==="k"&&(ce.preventDefault(),xc())}),G.value.view.dom.addEventListener("click",ce=>{const be=ce.target;if(!be||be.closest('.rm-google-docs-header-bar, .rm-options-dropdown, [contenteditable="true"]'))return;if(be.closest(".rm-page-header, .rm-first-page-header")){ea(ce);return}const Ee=be.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ee){const De=Ee.getBoundingClientRect(),Me=ce.clientY-De.top,Fe=ln.value*37.795;if(Me>=0&&Me<=Math.max(Fe,40)+15){let et=null;Ee.classList.contains("rm-page-break")&&(et=Ee.querySelector(".rm-page-header")),et||(et=document.querySelector(".rm-page-header, .rm-first-page-header")),et&&ea(ce)}}}),G.value.view.dom.addEventListener("dblclick",ce=>{const be=ce.target;if(!be)return;if(be.closest(".rm-page-footer")){ta();return}const Ee=be.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ee){const Me=Ee.getBoundingClientRect().bottom-ce.clientY,Fe=cn.value*37.795;Me>=0&&Me<=Math.max(Fe,40)+15&&ta()}}))}),s.watch(()=>n.collaboration,()=>{},{deep:!0}),s.onUnmounted(()=>{En(!1),q.value&&clearTimeout(q.value),kn&&clearTimeout(kn)});const Gr=s.ref(!1),qi=s.ref(""),ji=s.ref(""),Kr=s.ref(!1),Ho=s.ref(!1),qo=s.ref(!1),Xr=s.ref(!1),$i=s.ref(!1),Jr=s.ref(""),jo=s.ref(""),Zr=s.ref(!1);function xc(){if(!G.value)return;const{state:A}=G.value,{from:T,to:z,empty:le}=A.selection,ue=G.value.getAttributes("link");ue.href?(Zr.value=!0,jo.value=ue.href,le?Jr.value="":Jr.value=A.doc.textBetween(T,z," ")):(Zr.value=!1,jo.value="https://",Jr.value=le?"":A.doc.textBetween(T,z," ")),$i.value=!0}function nh(A){if(!G.value)return;const{state:T}=G.value,{from:z,to:le,empty:ue}=T.selection,ye=A.text.trim(),Oe=G.value.chain().focus();Zr.value||G.value.isActive("link")?(Oe.setLink({href:A.url,target:"_blank"}).run(),ye&&!ue&&Oe.insertContentAt({from:z,to:le},ye).run()):ye?Oe.insertContentAt({from:z,to:le},{type:"text",text:ye,marks:[{type:"link",attrs:{href:A.url,target:"_blank"}}]}).run():ue?Oe.insertContent({type:"text",text:A.url,marks:[{type:"link",attrs:{href:A.url,target:"_blank"}}]}).run():Oe.setLink({href:A.url,target:"_blank"}).run(),$i.value=!1}function ih(){if(!G.value)return;G.value.chain().focus().unsetLink().run(),$i.value=!1}const Qr=s.ref(f.value),Gn=s.ref(u.value),Xe=s.ref({top:Cn(l.value.top),bottom:Cn(l.value.bottom),left:Cn(l.value.left),right:Cn(l.value.right)}),Wi=Number((yT/Zi).toFixed(1));function Cn(A){return Math.round(A/Zi*10)/10}function Yr(A){return Math.round(A*Zi)}const rh=()=>{Qr.value=f.value,Gn.value=u.value,Xe.value={top:Cn(l.value.top),bottom:Cn(l.value.bottom),left:Cn(l.value.left),right:Cn(l.value.right)},Kr.value=!0},ah=()=>{const A=T=>{const z=typeof T=="number"?T:Number(T);return Number.isFinite(z)?Math.min(Wi,Math.max(_i,z)):_i};f.value=Qr.value,u.value=Gn.value,Xe.value={top:A(Xe.value.top),bottom:A(Xe.value.bottom),left:A(Xe.value.left),right:A(Xe.value.right)},l.value={top:Yr(Xe.value.top),bottom:Yr(Xe.value.bottom),left:Yr(Xe.value.left),right:Yr(Xe.value.right)},i("update:pageSize",f.value),i("update:orientation",Gn.value),i("update:margins",{...l.value}),Kr.value=!1},$o=s.ref(!1),Kn={value:null},oh=()=>{Ui.value=ln.value,Hi.value=cn.value,Pr.value=Ut.value,Fr.value=_n.value,Br.value=!0},sh=()=>{ln.value=c(Ui.value),cn.value=c(Hi.value),Ui.value=ln.value,Hi.value=cn.value,Ut.value=Pr.value,_n.value=Fr.value,Br.value=!1,Ht(),i("update:header-footer-margins",{headerMarginCm:ln.value,footerMarginCm:cn.value}),X()},lh=()=>{hi.value=Ur.value,$r.value=Hr.value,bi.value=qr.value,Wr.value=jr.value,Vr.value=!0},ch=()=>{Ur.value=hi.value,Hr.value=$r.value,qr.value=bi.value,jr.value=Wr.value,Vr.value=!1;const A="{page}";Ur.value==="footer"?(w.value.includes(A)&&(w.value=w.value.replace(/{page}/g,"").trim()),E.value=A):(E.value.includes(A)&&(E.value=E.value.replace(/{page}/g,"").trim()),w.value=A),Ht(),X()},uh=()=>{k.value="",w.value="",Ht(),X(),$o.value=!1},dh=A=>{const T=A===1,z=A%2===0;return Ut.value&&T?ft.value:_n.value&&z?Sn.value:k.value},En=(A=!0)=>{var le;const T=Kn.value;if(!T)return;const z=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(le=$n.value)==null||le.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetHeader.classList.remove("rm-header-active"),Kn.value=null,$o.value=!1,A&&(Ut.value&&T.isFirstPage?ft.value=z:_n.value&&T.pageIndex%2===0?Sn.value=z:k.value=z,Ht(),X())},yc=A=>{if(!A.targetHeader.parentNode||!G.value)return;const T=G.value.view.dom,z=A.targetHeader.getBoundingClientRect(),le=T.getBoundingClientRect(),ue=getComputedStyle(T),ye=parseFloat(ue.getPropertyValue("--rm-margin-left"))||0,Oe=parseFloat(ue.getPropertyValue("--rm-margin-right"))||0,Ae=A.targetHeader.querySelector(".rm-page-header-content"),me=(Ae==null?void 0:Ae.getBoundingClientRect())??z,fe=A.isFirstPage?z.left:z.left+ye,ce=A.isFirstPage?z.right:z.right-Oe,be=Math.max(0,fe-le.left),Te=Math.max(0,le.right-ce);A.overlay.style.left=`${fe}px`,A.overlay.style.top=`${me.top}px`,A.overlay.style.width=`${Math.max(ce-fe,1)}px`,A.overlay.style.height=`${Math.max(me.height,24)}px`,A.activeBar.style.setProperty("--rm-header-bar-left",`${-be}px`),A.activeBar.style.setProperty("--rm-header-bar-width",`${le.width}px`),A.activeBar.style.setProperty("--rm-header-bar-padding-left",`${be}px`),A.activeBar.style.setProperty("--rm-header-bar-padding-right",`${Te}px`)},ea=A=>{var Dc,zc;const T=Kn.value;if(T){const ve=A==null?void 0:A.target;if(!ve||ve instanceof Node&&T.targetHeader.contains(ve))return;En(!1)}let z=null;if(A){const ve=A.target;z=ve==null?void 0:ve.closest(".rm-page-header, .rm-first-page-header")}if(z||(z=(Dc=G.value)==null?void 0:Dc.view.dom.querySelector(".rm-first-page-header, .rm-page-header")),!z||!G.value)return;const le=G.value.view.dom,ue=z.classList.contains("rm-first-page-header"),ye=Array.from(le.querySelectorAll(".rm-page-break .rm-page-header")),Oe=ue?1:ye.indexOf(z)+2;if(!ue&&Oe<2)return;const Ae=z.querySelector(".rm-page-header-content");Ae&&(Ae.style.visibility="hidden");const me=document.createElement("div");me.className="rm-header-edit-input",me.contentEditable="true",me.setAttribute("role","textbox"),me.setAttribute("aria-label",o("editor.headerFooter.header")||"Header"),me.dataset.placeholder=o("editor.headerFooter.headerPlaceholder")||"Header",me.innerHTML=dh(Oe);const fe=document.createElement("div");fe.className="rm-header-edit-overlay",fe.appendChild(me);const ce=document.createElement("div");ce.className="rm-google-docs-header-bar",ce.innerHTML=`
|
|
15237
|
+
`," ")}}async function w(){await s.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)}async function S(P,W){const L=h.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:W}),o.value.push({role:"assistant",text:"",streaming:!0});const Y=o.value.length-1;await w();try{for await(const q of L(P,p.signal))o.value[Y].text+=q,w();o.value[Y].text||(o.value[Y].text=r("sidebars.ai.emptyResponse"),o.value[Y].error=!0)}catch(q){p.signal.aborted||(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q instanceof Error?q.message:String(q)}`,o.value[Y].error=!0)}finally{o.value[Y].streaming=!1,c.value=!1,p=null,w()}}function E(){const P=l.value.trim();if(!P||c.value)return;if(l.value="",b.value){D({prompt:P,context:k()},P);return}const W=y.value;S({action:"chat",prompt:P,...W?{selection:W.text}:{},context:k()},P)}async function D(P,W){const L=g.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:W}),o.value.push({role:"assistant",text:"",streaming:!0});const Y=o.value.length-1;await w();try{for await(const q of L(P,p.signal))q.type==="delta"?(o.value[Y].text+=q.text,w()):q.type==="done"?o.value[Y].citations=q.citations:q.type==="error"&&(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q.message}`,o.value[Y].error=!0,o.value[Y].citations=void 0);!o.value[Y].text&&!o.value[Y].error&&(o.value[Y].text=r("sidebars.ai.emptyResponse"),o.value[Y].error=!0)}catch(q){p.signal.aborted||(o.value[Y].text=`${r("sidebars.ai.aiError")}: ${q instanceof Error?q.message:String(q)}`,o.value[Y].error=!0,o.value[Y].citations=void 0)}finally{o.value[Y].streaming=!1,c.value=!1,p=null,w()}}function _(){b.value=!b.value,s.nextTick(()=>{const P=document.querySelector(".ai-sidebar textarea");P==null||P.focus()})}function C(P){if(c.value||!P.action)return;const W=y.value;P.needsSelection&&!W||S({action:P.action,...W?{selection:W.text}:{},...P.prompt?{prompt:P.prompt}:{},context:k()},P.prompt??P.label)}function N(){var P,W,L;y.value&&((L=(W=(P=a())==null?void 0:P.commands)==null?void 0:W.aiTransform)==null||L.call(W,{action:"rewrite"}))}const I=s.computed(()=>[{label:r("sidebars.ai.summarize"),icon:pr,color:"text-cyan-500",action:"summarize",needsSelection:!0},{label:r("sidebars.ai.fixGrammar"),icon:qh,color:"text-emerald-500",action:"grammar",needsSelection:!0},{label:r("sidebars.ai.continue"),icon:jb,color:"text-amber-500",action:"generate",prompt:"Continue writing naturally from where the text ends, matching the existing style."},{label:r("sidebars.ai.toSpanish"),icon:Xd,color:"text-cyan-500",action:"translate",prompt:"translate to Spanish",needsSelection:!0},{label:r("sidebars.ai.improveSelection"),icon:Ab,color:"text-violet-500",improve:!0,needsSelection:!0},{label:r("sidebars.ai.draft"),icon:Ma,color:"text-cyan-500",draft:!0,disabled:!g.value}]);function H(P,W){P.text&&(navigator.clipboard.writeText(P.text),u.value=W,setTimeout(()=>u.value=null,2e3))}function F(P){f.value=P,setTimeout(()=>{f.value===P&&(f.value=null)},2e3)}function M(P,W){const L=a();if(!P.text||!L)return;const{state:Y,view:q}=L,{from:O,to:B}=Y.selection;if(!P.citations||P.citations.length===0){Td(L,q,O,B,P.text),q.focus(),F(W);return}const U=Ii(L);if(!U){Td(L,q,O,B,t5(P.text)),q.focus(),F(W);return}const oe=new Map(P.citations.map(V=>[V.ref,V])),ne=n5(P.text,oe,U),te=Y.schema,ie=ne.map(V=>typeof V=="string"?te.text(V):te.nodeFromJSON(V)).filter(V=>!!V),X=new ae(J.from(ie),0,0);q.dispatch(Y.tr.replace(O,B,X)),q.focus(),F(W)}function j(){p==null||p.abort(),c.value=!1,i("close")}return s.onUnmounted(()=>{var P;p==null||p.abort(),(P=a())==null||P.off("transaction",v)}),(P,W)=>(s.openBlock(),s.createElementBlock("div",i5,[s.createElementVNode("div",r5,[s.createElementVNode("div",null,[s.createElementVNode("h3",a5,[s.createVNode(s.unref(zn),{class:"h-4 w-4 animate-pulse text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.ai.title")),1)]),s.createElementVNode("p",o5,s.toDisplayString(s.unref(r)("sidebars.ai.description")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-200","aria-label":s.unref(r)("sidebars.ai.close"),onClick:j},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,s5)]),h.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",u5,[s.createElementVNode("span",d5,s.toDisplayString(s.unref(r)("sidebars.ai.quickMacros")),1),s.createElementVNode("div",f5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,L=>(s.openBlock(),s.createElementBlock("button",{key:L.label,type:"button",disabled:c.value||L.needsSelection&&!y.value||"disabled"in L&&L.disabled,title:L.needsSelection&&!y.value?s.unref(r)("sidebars.ai.selectTextFirst"):L.label,class:s.normalizeClass(["flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-left text-[11px] font-bold transition-colors disabled:opacity-40","draft"in L&&L.draft&&b.value?"border-cyan-500 bg-cyan-500/10 text-cyan-700 dark:border-cyan-400/50 dark:bg-cyan-500/15 dark:text-cyan-300":"border-slate-200 bg-slate-50 text-slate-700 hover:border-cyan-500/50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:border-cyan-500/30"]),onClick:Y=>L.improve?N():"draft"in L&&L.draft?_():C(L)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(L.icon),{class:s.normalizeClass(["h-3 w-3",L.color])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(L.label),1)],10,p5))),128))])]),s.createElementVNode("div",{ref_key:"turnsEl",ref:m,class:"flex-1 space-y-3 overflow-y-auto p-4"},[o.value.length===0?(s.openBlock(),s.createElementBlock("div",m5,[s.createVNode(s.unref(zn),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",h5,s.toDisplayString(s.unref(r)("sidebars.ai.noDraft")),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.value,(L,Y)=>(s.openBlock(),s.createElementBlock("div",{key:Y,class:s.normalizeClass(["flex flex-col gap-1",L.role==="user"?"items-end":"items-start"])},[s.createElementVNode("span",b5,[L.role==="user"?(s.openBlock(),s.createBlock(s.unref(Nl),{key:0,class:"h-2.5 w-2.5"})):(s.openBlock(),s.createBlock(s.unref(zn),{key:1,class:"h-2.5 w-2.5 text-cyan-400"})),s.createTextVNode(" "+s.toDisplayString(L.role==="user"?s.unref(r)("sidebars.ai.you"):s.unref(r)("sidebars.ai.assistant")),1)]),s.createElementVNode("div",{class:s.normalizeClass(["max-w-full whitespace-pre-wrap rounded-xl px-3 py-2 text-xs leading-relaxed",[L.role==="user"?"bg-cyan-500/10 text-slate-700 dark:bg-cyan-500/15 dark:text-slate-200":L.error?"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-300":"bg-slate-100 text-slate-700 dark:bg-white/[0.04] dark:text-slate-300"]])},[s.createTextVNode(s.toDisplayString(L.text),1),L.streaming?(s.openBlock(),s.createElementBlock("span",g5,"▌")):s.createCommentVNode("",!0)],2),L.role==="assistant"&&L.citations&&L.citations.length>0?(s.openBlock(),s.createElementBlock("div",v5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(L.citations,q=>(s.openBlock(),s.createElementBlock("span",{key:q.ref,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},[s.createVNode(s.unref(Ma),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(q.label),1)]))),128))])):s.createCommentVNode("",!0),L.role==="assistant"&&!L.streaming&&!L.error&&L.text?(s.openBlock(),s.createElementBlock("div",x5,[s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg border border-slate-200 bg-white px-2 py-1 text-[10px] font-semibold text-slate-600 transition-all hover:bg-slate-50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:q=>H(L,Y)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value===Y?s.unref(Na):s.unref(Os)),{class:s.normalizeClass(["h-3 w-3",u.value===Y?"text-emerald-500":""])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(u.value===Y?s.unref(r)("sidebars.ai.copied"):s.unref(r)("sidebars.ai.copy")),1)],8,y5),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-2 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:q=>M(L,Y)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(f.value===Y?s.unref(Na):s.unref(Uh)),{class:"h-3 w-3"})),s.createElementVNode("span",null,s.toDisplayString(f.value===Y?s.unref(r)("sidebars.ai.inserted"):s.unref(r)("sidebars.ai.insert")),1)],8,k5)])):s.createCommentVNode("",!0)],2))),128))],512),s.createElementVNode("div",w5,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(E,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":W[0]||(W[0]=L=>l.value=L),rows:"2",disabled:c.value,placeholder:b.value?s.unref(r)("sidebars.ai.draftPlaceholder"):s.unref(r)("sidebars.ai.promptPlaceholder"),class:"w-full min-h-[55px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(s.withModifiers(E,["exact","prevent"]),["enter"])},null,40,_5),[[s.vModelText,l.value]]),s.createElementVNode("div",S5,[s.createElementVNode("button",{type:"submit",disabled:c.value||!l.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-40"},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(b.value?s.unref(r)("sidebars.ai.promptDraft"):s.unref(r)("sidebars.ai.promptAI")),1)],8,C5)])],32)])],64)):(s.openBlock(),s.createElementBlock("div",l5,[s.createVNode(s.unref(zn),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",c5,s.toDisplayString(s.unref(r)("sidebars.ai.notConfigured")),1)]))]))}}),E5={class:"comments-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},A5={class:"border-b border-slate-200 p-4 dark:border-white/5"},T5={class:"mb-3 flex items-center justify-between"},N5={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},O5={class:"flex rounded-xl border border-slate-200 bg-slate-50 p-1 text-[11px] font-semibold dark:border-white/10 dark:bg-white/[0.02]"},M5={key:0,class:"mb-1 rounded-xl border border-cyan-500/25 bg-cyan-500/5 p-2.5 text-xs text-cyan-700 animate-fadeIn dark:border-cyan-500/15 dark:bg-cyan-500/10 dark:text-cyan-400"},D5={class:"mb-1 font-mono text-[9px] font-bold uppercase tracking-wider"},z5={class:"line-clamp-1 border-l-2 border-cyan-400 bg-cyan-500/10 py-0.5 pl-2.5 italic dark:bg-cyan-500/5"},I5={class:"flex-1 space-y-4 overflow-y-auto p-4"},R5={class:"flex items-start justify-between"},L5={class:"flex items-center gap-2"},B5={class:"text-xs font-bold text-slate-800 dark:text-slate-200"},P5={class:"font-mono text-[9px] text-slate-400 dark:text-slate-500"},F5={class:"flex items-center gap-1.5"},V5=["title","onClick"],U5=["title","onClick"],H5={key:0,class:"inline-flex items-center gap-1 rounded-full border border-amber-400/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-amber-600 dark:border-amber-500/30 dark:text-amber-400"},q5={class:"whitespace-pre-wrap break-words text-xs leading-relaxed text-slate-700 dark:text-slate-300"},j5={key:2,class:"space-y-2.5 border-l border-slate-200 pl-4 pt-1 dark:border-white/10"},$5={class:"flex items-center gap-1.5"},W5={class:"text-[10px] font-bold text-slate-600 dark:text-slate-300"},G5={class:"font-mono text-[8px] text-slate-400 dark:text-slate-500"},K5={class:"break-words pl-1 text-xs text-slate-600 dark:text-slate-400"},X5={key:3,class:"flex items-center justify-between border-t border-slate-100 pt-2 dark:border-white/5"},J5={key:0,class:"flex w-full items-center gap-1.5"},Z5=["onUpdate:modelValue","placeholder","onKeydown"],Q5=["onClick"],Y5=["onClick"],e6={key:4,class:"rounded-lg border border-green-100/40 bg-green-50/55 p-2 text-[10px] text-green-700 dark:border-green-500/10 dark:bg-green-950/10 dark:text-green-400"},t6={key:0},n6={key:0,class:"py-12 text-center text-slate-400 dark:text-slate-500"},i6={class:"text-xs"},r6={key:0,class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},a6=["placeholder"],o6={class:"flex items-center justify-between"},s6={class:"font-mono text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},l6=["disabled"],Qm=s.defineComponent({__name:"CommentsSidebar",props:{comments:{},selectedTextSnippet:{},selectedTextIndex:{},orphanedIds:{}},emits:["add-comment","add-reply","resolve-comment","delete-comment"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref(""),o=s.ref({}),l=s.ref(null),c=s.ref("active"),u=s.computed(()=>(n.comments??[]).filter(b=>c.value==="resolved"?b.resolved:!b.resolved));function f(){a.value.trim()&&i("add-comment",a.value.trim(),n.selectedTextSnippet,n.selectedTextIndex)}function m(b){const x=o.value[b]||"";x.trim()&&(i("add-reply",b,x.trim()),o.value={...o.value,[b]:""},l.value=null)}function p(b){return b.split(" ").map(x=>x[0]).join("").slice(0,2).toUpperCase()}function h(b){var x;return((x=n.orphanedIds)==null?void 0:x.includes(b.id))===!0}function g(b){typeof window<"u"&&!window.confirm(r("sidebars.comments.confirmDelete"))||i("delete-comment",b)}return(b,x)=>(s.openBlock(),s.createElementBlock("div",E5,[s.createElementVNode("div",A5,[s.createElementVNode("div",T5,[s.createElementVNode("h3",N5,[s.createVNode(s.unref(tf),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.title")),1)]),s.createElementVNode("div",O5,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="active"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:x[0]||(x[0]=v=>c.value="active")},s.toDisplayString(s.unref(r)("sidebars.comments.active")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="resolved"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:x[1]||(x[1]=v=>c.value="resolved")},s.toDisplayString(s.unref(r)("sidebars.comments.resolved")),3)])]),e.selectedTextSnippet?(s.openBlock(),s.createElementBlock("div",M5,[s.createElementVNode("p",D5,s.toDisplayString(s.unref(r)("sidebars.comments.creatingAnchored")),1),s.createElementVNode("p",z5,' "'+s.toDisplayString(e.selectedTextSnippet)+'" ',1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",I5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.value,v=>(s.openBlock(),s.createElementBlock("div",{key:v.id,class:"relative space-y-3 rounded-2xl border border-slate-200/60 bg-slate-50/60 p-4 transition-all hover:border-cyan-500/30 hover:shadow-cyan dark:border-white/5 dark:bg-[#02040a]/40"},[s.createElementVNode("div",R5,[s.createElementVNode("div",L5,[s.createElementVNode("div",{class:"flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:v.authorColor})},s.toDisplayString(p(v.authorName)),5),s.createElementVNode("div",null,[s.createElementVNode("h4",B5,s.toDisplayString(v.authorName),1),s.createElementVNode("p",P5,s.toDisplayString(new Date(v.createdAt).toLocaleTimeString()),1)])]),s.createElementVNode("div",F5,[v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-green-500/10 hover:text-green-500",title:s.unref(r)("sidebars.comments.resolve"),onClick:y=>i("resolve-comment",v.id)},[s.createVNode(s.unref(Xh),{class:"h-4 w-4"})],8,V5)),h(v)?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-red-500/10 hover:text-red-500",title:s.unref(r)("sidebars.comments.delete"),onClick:y=>g(v.id)},[s.createVNode(s.unref(mr),{class:"h-4 w-4"})],8,U5)):s.createCommentVNode("",!0)])]),h(v)?(s.openBlock(),s.createElementBlock("div",H5,s.toDisplayString(s.unref(r)("sidebars.comments.orphaned")),1)):s.createCommentVNode("",!0),v.anchorText?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["max-w-full truncate rounded-r-lg border-l-2 py-1 pl-2.5 text-[10px] italic text-slate-500 dark:text-slate-400",h(v)?"border-amber-500/50 bg-amber-50/50 line-through opacity-70 dark:border-amber-500/40 dark:bg-amber-500/5":"border-cyan-500/50 bg-slate-100 dark:border-cyan-500/40 dark:bg-white/5"])},s.toDisplayString(s.unref(r)("sidebars.comments.quote"))+' "'+s.toDisplayString(v.anchorText)+'" ',3)):s.createCommentVNode("",!0),s.createElementVNode("p",q5,s.toDisplayString(v.content),1),v.replies.length>0?(s.openBlock(),s.createElementBlock("div",j5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(v.replies,y=>(s.openBlock(),s.createElementBlock("div",{key:y.id,class:"space-y-1"},[s.createElementVNode("div",$5,[s.createElementVNode("div",{class:"flex h-4.5 w-4.5 items-center justify-center rounded-full text-[8px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:y.authorColor})},s.toDisplayString(p(y.authorName)),5),s.createElementVNode("span",W5,s.toDisplayString(y.authorName),1),s.createElementVNode("span",G5,s.toDisplayString(new Date(y.createdAt).toLocaleTimeString()),1)]),s.createElementVNode("p",K5,s.toDisplayString(y.content),1)]))),128))])):s.createCommentVNode("",!0),v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",X5,[l.value===v.id?(s.openBlock(),s.createElementBlock("div",J5,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y=>o.value[v.id]=y,type:"text",placeholder:s.unref(r)("sidebars.comments.reply"),class:"flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 focus:border-cyan-500/50 focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(y=>m(v.id),["enter"])},null,40,Z5),[[s.vModelText,o.value[v.id]]]),s.createElementVNode("button",{type:"button",class:"rounded-lg bg-cyan-500 p-1.5 font-bold text-black shadow-cyan hover:bg-cyan-400",onClick:y=>m(v.id)},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"})],8,Q5)])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-all hover:text-cyan-500",onClick:y=>l.value=v.id},[s.createVNode(s.unref(Mb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.replyInThread")),1)],8,Y5))])),v.resolved?(s.openBlock(),s.createElementBlock("div",e6,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.comments.resolvedBy").replace("{user}",v.resolvedByName||v.resolvedBy||"You"))+" ",1),v.resolvedAt?(s.openBlock(),s.createElementBlock("span",t6,"at "+s.toDisplayString(new Date(v.resolvedAt).toLocaleTimeString()),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))),128)),u.value.length===0?(s.openBlock(),s.createElementBlock("div",n6,[s.createVNode(s.unref(kb),{class:"mx-auto mb-2 h-8 w-8 text-cyan-500 opacity-50"}),s.createElementVNode("p",i6,s.toDisplayString(s.unref(r)("sidebars.comments.noComments").replace("{mode}",c.value)),1)])):s.createCommentVNode("",!0)]),c.value==="active"?(s.openBlock(),s.createElementBlock("div",r6,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(f,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":x[2]||(x[2]=v=>a.value=v),rows:"2",placeholder:e.selectedTextSnippet?s.unref(r)("sidebars.comments.commentOnSelection"):s.unref(r)("sidebars.comments.generalComment"),class:"w-full min-h-[60px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,a6),[[s.vModelText,a.value]]),s.createElementVNode("div",o6,[s.createElementVNode("span",s6,s.toDisplayString(e.selectedTextSnippet?s.unref(r)("sidebars.comments.anchoredComment"):s.unref(r)("sidebars.comments.general")),1),s.createElementVNode("button",{type:"submit",disabled:!a.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-50"},[s.createVNode(s.unref(zs),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.post")),1)],8,l6)])],32)])):s.createCommentVNode("",!0)]))}}),c6={class:"history-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},u6={class:"border-b border-slate-200 p-4 dark:border-white/5"},d6={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},f6={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},p6={class:"flex-1 space-y-3 overflow-y-auto p-4"},m6={key:0,class:"space-y-2 rounded-2xl border border-amber-500/30 bg-amber-500/10 p-3.5 text-xs animate-fadeIn dark:border-amber-500/20"},h6={class:"flex items-start gap-1.5 text-amber-700 dark:text-amber-400"},b6={class:"font-bold"},g6={class:"mt-0.5 text-[10px] leading-relaxed text-amber-600 dark:text-amber-500"},v6={class:"flex justify-end gap-2 pt-1"},x6={class:"space-y-2.5"},y6={class:"mb-1 flex items-center justify-between"},k6={class:"rounded-md bg-slate-200 px-1.5 py-0.5 font-mono text-[9px] font-bold text-slate-500 dark:bg-cyan-500/10 dark:text-cyan-400"},w6={class:"flex items-center gap-0.5 font-mono text-[9px] text-slate-400 dark:text-slate-500"},_6={class:"text-xs font-bold leading-snug text-slate-800 dark:text-slate-200"},S6={class:"flex items-center gap-1.5 text-[10px] text-slate-500"},C6={class:"font-semibold text-slate-600 dark:text-slate-300"},E6={class:"flex justify-end gap-2 border-t border-slate-200/50 pt-2 dark:border-white/5"},A6=["onClick"],T6=["onClick"],N6={key:0,class:"py-6 text-center text-xs text-slate-400 dark:text-slate-500"},O6={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/85"},M6=["placeholder"],D6={class:"flex justify-end gap-2"},z6={type:"submit",class:"rounded-lg bg-cyan-500 px-3.5 py-1.5 text-xs font-bold text-black shadow-cyan hover:bg-cyan-400"},Ym=s.defineComponent({__name:"HistorySidebar",props:{snapshots:{},activePreviewIndex:{}},emits:["save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ct(),a=s.ref(""),o=s.ref(!1);function l(){a.value.trim()&&(i("save-snapshot",a.value.trim()),a.value="",o.value=!1)}const c=s.computed(()=>n.snapshots??[]);return(u,f)=>(s.openBlock(),s.createElementBlock("div",c6,[s.createElementVNode("div",u6,[s.createElementVNode("h3",d6,[s.createVNode(s.unref(Sl),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.title")),1)]),s.createElementVNode("p",f6,s.toDisplayString(s.unref(r)("sidebars.history.empty")),1)]),s.createElementVNode("div",p6,[e.activePreviewIndex!==null?(s.openBlock(),s.createElementBlock("div",m6,[s.createElementVNode("div",h6,[s.createVNode(s.unref(Pb),{class:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-500"}),s.createElementVNode("div",null,[s.createElementVNode("p",b6,s.toDisplayString(s.unref(r)("sidebars.history.viewingPreview")),1),s.createElementVNode("p",g6,s.toDisplayString(s.unref(r)("sidebars.history.readOnlyPreview").replace("{index}",String(e.activePreviewIndex))),1)])]),s.createElementVNode("div",v6,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] font-semibold text-slate-500 hover:bg-white/5 hover:text-slate-700 dark:text-slate-400",onClick:f[0]||(f[0]=m=>i("preview-snapshot",null))},s.toDisplayString(s.unref(r)("sidebars.history.closePreview")),1),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:f[1]||(f[1]=()=>{i("restore-snapshot",e.activePreviewIndex),i("preview-snapshot",null)})},[s.createVNode(s.unref(qc),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restoreThis")),1)])])])):s.createCommentVNode("",!0),s.createElementVNode("div",x6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,m=>(s.openBlock(),s.createElementBlock("div",{key:m.versionIndex,class:s.normalizeClass(["space-y-2.5 rounded-2xl border p-4 transition-all",e.activePreviewIndex===m.versionIndex?"border-cyan-500/40 bg-cyan-500/5 shadow-cyan dark:border-cyan-500/30":"border-slate-200/60 bg-slate-50/60 hover:border-cyan-500/30 dark:border-white/5 dark:bg-[#02040a]/40 dark:hover:border-white/10"])},[s.createElementVNode("div",null,[s.createElementVNode("div",y6,[s.createElementVNode("span",k6,s.toDisplayString(s.unref(r)("sidebars.history.version"))+" #"+s.toDisplayString(m.versionIndex),1),s.createElementVNode("span",w6,[s.createVNode(s.unref(_l),{class:"h-2.5 w-2.5"}),s.createTextVNode(" "+s.toDisplayString(new Date(m.timestamp).toLocaleDateString())+" "+s.toDisplayString(new Date(m.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),1)])]),s.createElementVNode("h4",_6,s.toDisplayString(m.title),1)]),s.createElementVNode("div",S6,[s.createVNode(s.unref(Nl),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.history.modifiedBy"))+" ",1),s.createElementVNode("strong",C6,s.toDisplayString(m.modifiedBy),1)])]),s.createElementVNode("div",E6,[e.activePreviewIndex!==m.versionIndex?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-slate-500 transition-colors hover:text-cyan-600 dark:text-slate-400 dark:hover:text-cyan-400",onClick:p=>i("preview-snapshot",m)},[s.createVNode(s.unref(tb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.preview")),1)],8,A6)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-colors hover:text-cyan-500 dark:text-cyan-400 dark:hover:text-cyan-300",onClick:p=>i("restore-snapshot",m.versionIndex)},[s.createVNode(s.unref(qc),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restore")),1)],8,T6)])],2))),128)),c.value.length===0?(s.openBlock(),s.createElementBlock("p",N6,s.toDisplayString(s.unref(r)("sidebars.history.noSnapshots")),1)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",O6,[o.value?(s.openBlock(),s.createElementBlock("form",{key:0,class:"space-y-2 animate-fadeIn",onSubmit:s.withModifiers(l,["prevent"])},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[2]||(f[2]=m=>a.value=m),type:"text",required:"",placeholder:s.unref(r)("sidebars.history.snapshotPlaceholder"),class:"w-full rounded-xl border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,M6),[[s.vModelText,a.value]]),s.createElementVNode("div",D6,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] text-slate-500 hover:bg-white/5 dark:text-slate-400",onClick:f[3]||(f[3]=m=>o.value=!1)},s.toDisplayString(s.unref(r)("sidebars.history.cancel")),1),s.createElementVNode("button",z6,s.toDisplayString(s.unref(r)("sidebars.history.save")),1)])],32)):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-slate-300 py-2.5 text-xs font-bold text-slate-500 transition-all hover:border-cyan-500 hover:bg-cyan-500/5 hover:text-cyan-500 dark:border-white/10 dark:text-slate-400 dark:hover:border-cyan-400/50 dark:hover:text-cyan-400",onClick:f[4]||(f[4]=m=>o.value=!0)},[s.createVNode(s.unref(zb),{class:"h-3.5 w-3.5 animate-pulse"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.saveNamedSnapshot")),1)]))])]))}}),I6={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},R6={class:"mb-4 flex items-center justify-between"},L6={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},B6={key:0,class:"space-y-4"},P6={class:"flex items-start gap-3"},F6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},V6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},U6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},H6={class:"flex items-start gap-3"},q6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400"},j6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},$6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},W6={class:"text-xs text-slate-500 dark:text-slate-400"},G6={class:"flex items-start gap-3"},K6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400"},X6={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},J6={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},Z6={class:"grid grid-cols-2 gap-3"},Q6={class:"flex items-start gap-3"},Y6={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"},eA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},tA={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},nA={class:"flex items-start gap-3"},iA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400"},rA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},aA={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},oA={class:"rounded-lg border border-slate-200 bg-slate-50 p-4 dark:border-slate-700/50 dark:bg-white/5"},sA={class:"mb-2 flex items-center gap-2 text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},lA={class:"grid grid-cols-3 gap-3 text-center"},cA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},uA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},dA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},fA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},pA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},mA={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},hA={key:1,class:"py-8 text-center text-sm text-slate-500 dark:text-slate-400"},eh=s.defineComponent({__name:"DetailsDialog",props:{isOpen:{type:Boolean},meta:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ct(),i=t;function r(a){return a?new Date(a).toLocaleString():"-"}return(a,o)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:o[1]||(o[1]=s.withModifiers(l=>i("close"),["self"]))},[s.createElementVNode("div",I6,[s.createElementVNode("div",R6,[s.createElementVNode("h2",L6,s.toDisplayString(s.unref(n)("editor.details.title")),1),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:o[0]||(o[0]=l=>i("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),e.meta?(s.openBlock(),s.createElementBlock("div",B6,[s.createElementVNode("div",P6,[s.createElementVNode("div",F6,[s.createVNode(s.unref(gt),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",V6,s.toDisplayString(s.unref(n)("editor.details.titleLabel")),1),s.createElementVNode("p",U6,s.toDisplayString(e.meta.title),1)])]),s.createElementVNode("div",H6,[s.createElementVNode("div",q6,[s.createVNode(s.unref(Nl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",j6,s.toDisplayString(s.unref(n)("editor.details.owner")),1),s.createElementVNode("p",$6,s.toDisplayString(e.meta.owner.name),1),s.createElementVNode("p",W6,s.toDisplayString(e.meta.owner.email),1)])]),s.createElementVNode("div",G6,[s.createElementVNode("div",K6,[s.createVNode(s.unref(ab),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",X6,s.toDisplayString(s.unref(n)("editor.details.location")),1),s.createElementVNode("p",J6,s.toDisplayString(e.meta.folderName||s.unref(n)("editor.details.noFolder")),1)])]),s.createElementVNode("div",Z6,[s.createElementVNode("div",Q6,[s.createElementVNode("div",Y6,[s.createVNode(s.unref(_l),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",eA,s.toDisplayString(s.unref(n)("editor.details.created")),1),s.createElementVNode("p",tA,s.toDisplayString(r(e.meta.createdAt)),1)])]),s.createElementVNode("div",nA,[s.createElementVNode("div",iA,[s.createVNode(s.unref(Zh),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",rA,s.toDisplayString(s.unref(n)("editor.details.modified")),1),s.createElementVNode("p",aA,s.toDisplayString(r(e.meta.updatedAt)),1)])])]),s.createElementVNode("div",oA,[s.createElementVNode("div",sA,[s.createVNode(s.unref(Oa),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.details.statistics")),1)]),s.createElementVNode("div",lA,[s.createElementVNode("div",null,[s.createElementVNode("p",cA,s.toDisplayString(e.meta.wordCount),1),s.createElementVNode("p",uA,s.toDisplayString(s.unref(n)("editor.details.words")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",dA,s.toDisplayString(e.meta.charCount),1),s.createElementVNode("p",fA,s.toDisplayString(s.unref(n)("editor.details.characters")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",pA,s.toDisplayString(e.meta.pageCount),1),s.createElementVNode("p",mA,s.toDisplayString(s.unref(n)("editor.details.pages")),1)])])])])):(s.openBlock(),s.createElementBlock("div",hA,s.toDisplayString(s.unref(n)("editor.details.loading")),1))])])):s.createCommentVNode("",!0)}}),bA={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},gA={class:"mb-4 flex items-center justify-between"},vA={class:"flex items-center gap-2"},xA={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},yA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},kA={class:"mb-4 rounded-md border border-slate-200 bg-slate-50 p-3 dark:border-slate-700/50 dark:bg-white/5"},wA={class:"mb-1 block text-[11px] font-bold uppercase tracking-wide text-slate-500 dark:text-slate-400"},_A={class:"flex items-center gap-2"},SA=["value"],CA=["title"],EA={class:"space-y-3"},AA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},TA=["placeholder"],NA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},OA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},MA={class:"mt-5 flex justify-end gap-2"},DA=["href"],th=s.defineComponent({__name:"EmailDialog",props:{isOpen:{type:Boolean},documentTitle:{},shareUrl:{},defaultRecipient:{}},emits:["close","copy-link"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(i.defaultRecipient||""),o=s.ref(""),l=s.ref(""),c=s.ref(!1),u=s.ref(!1),f=s.computed(()=>n("editor.email.defaultSubject",{title:i.documentTitle})),m=s.computed(()=>n("editor.email.defaultBody",{url:i.shareUrl})),p=s.computed(()=>o.value===f.value),h=s.computed(()=>l.value===m.value);s.watch(()=>i.documentTitle,()=>{o.value=f.value},{immediate:!0}),s.watch(()=>i.shareUrl,()=>{l.value=m.value},{immediate:!0});const g=s.computed(()=>{const v=new URLSearchParams;o.value.trim()&&v.set("subject",o.value.trim()),l.value.trim()&&v.set("body",l.value.trim());const y=v.toString();let k=`mailto:${a.value.trim()}`;return y&&(k+=`?${y}`),k});function b(){r("copy-link")}function x(){a.value=i.defaultRecipient||"",o.value=f.value,l.value=m.value,c.value=!1,u.value=!1}return s.watch(()=>i.isOpen,v=>{v&&x()}),(v,y)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:y[10]||(y[10]=s.withModifiers(k=>r("close"),["self"]))},[s.createElementVNode("div",bA,[s.createElementVNode("div",gA,[s.createElementVNode("div",vA,[s.createElementVNode("div",xA,[s.createVNode(s.unref(Ms),{class:"h-4 w-4"})]),s.createElementVNode("h2",yA,s.toDisplayString(s.unref(n)("editor.email.title")),1)]),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:y[0]||(y[0]=k=>r("close"))},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),s.createElementVNode("div",kA,[s.createElementVNode("label",wA,s.toDisplayString(s.unref(n)("editor.email.shareableLink")),1),s.createElementVNode("div",_A,[s.createElementVNode("input",{type:"text",value:e.shareUrl,readonly:"",class:"flex-1 rounded-md border border-slate-300 bg-white px-2 py-1.5 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300"},null,8,SA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md border border-slate-300 text-slate-500 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-400 dark:hover:bg-slate-700",title:s.unref(n)("editor.email.copyLink"),onClick:b},[s.createVNode(s.unref(El),{class:"h-3.5 w-3.5"})],8,CA)])]),s.createElementVNode("div",EA,[s.createElementVNode("div",null,[s.createElementVNode("label",AA,s.toDisplayString(s.unref(n)("editor.email.to")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[1]||(y[1]=k=>a.value=k),type:"email",class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",placeholder:s.unref(n)("editor.email.toPlaceholder")},null,8,TA),[[s.vModelText,a.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",NA,s.toDisplayString(s.unref(n)("editor.email.subject")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[2]||(y[2]=k=>o.value=k),type:"text",class:s.normalizeClass(["w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",p.value&&!c.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:y[3]||(y[3]=k=>c.value=!0),onBlur:y[4]||(y[4]=k=>c.value=!1)},null,34),[[s.vModelText,o.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",OA,s.toDisplayString(s.unref(n)("editor.email.body")),1),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":y[5]||(y[5]=k=>l.value=k),rows:"4",class:s.normalizeClass(["w-full resize-none rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",h.value&&!u.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:y[6]||(y[6]=k=>u.value=!0),onBlur:y[7]||(y[7]=k=>u.value=!1)},null,34),[[s.vModelText,l.value]])])]),s.createElementVNode("div",MA,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold text-slate-700 transition hover:bg-slate-100 dark:text-slate-300",onClick:y[8]||(y[8]=k=>r("close"))},s.toDisplayString(s.unref(n)("common.cancel")),1),s.createElementVNode("a",{href:g.value,class:"inline-flex rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-cyan-700",onClick:y[9]||(y[9]=k=>r("close"))},s.toDisplayString(s.unref(n)("editor.email.send")),9,DA)])])])):s.createCommentVNode("",!0)}}),zA=["aria-label"],IA={class:"flex items-center gap-1.5"},RA=["placeholder"],LA={class:"w-16 flex-shrink-0 text-center text-[11px] text-slate-400 dark:text-slate-500"},BA=["disabled","title"],PA=["disabled","title"],FA=["title"],VA={class:"mt-2 flex items-center gap-1.5"},UA=["placeholder","onKeydown"],HA=["disabled"],qA=["disabled"],jA=s.defineComponent({__name:"FindReplaceDialog",props:{isOpen:{type:Boolean},editor:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(null),o=s.ref(""),l=s.ref(""),c=s.ref({query:"",matches:[],activeIndex:0}),u=s.computed(()=>{if(!o.value)return"";const{matches:y,activeIndex:k}=c.value;return y.length===0?n("editor.findReplace.noMatches"):n("editor.findReplace.matchCount",{current:k+1,total:y.length})}),f=()=>{i.editor&&(c.value=_e.getSearchState(i.editor))};s.watch(()=>i.editor,(y,k)=>{k==null||k.off("transaction",f),y==null||y.on("transaction",f)}),s.watch(()=>i.isOpen,async y=>{var k,w;if(i.editor)if(y){const{from:S,to:E}=i.editor.state.selection;S!==E&&(o.value=i.editor.state.doc.textBetween(S,E," ")),m(),i.editor.on("transaction",f),await s.nextTick(),(k=a.value)==null||k.focus(),(w=a.value)==null||w.select()}else v()});function m(){i.editor&&(_e.setSearchQuery(i.editor,o.value),f())}s.watch(o,m);function p(){i.editor&&_e.searchNext(i.editor)}function h(){i.editor&&_e.searchPrev(i.editor)}function g(){i.editor&&_e.replaceCurrent(i.editor,l.value)}function b(){i.editor&&_e.replaceAll(i.editor,l.value)}function x(y){y.key==="Enter"&&y.shiftKey?(y.preventDefault(),h()):y.key==="Enter"?(y.preventDefault(),p()):y.key==="Escape"&&(y.preventDefault(),v())}function v(){var y;i.editor&&_e.clearSearch(i.editor),(y=i.editor)==null||y.off("transaction",f),o.value="",l.value="",c.value={query:"",matches:[],activeIndex:0},r("close")}return s.onUnmounted(()=>{var y;(y=i.editor)==null||y.off("transaction",f)}),(y,k)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"absolute right-4 top-16 z-40 w-[340px] rounded-xl border border-slate-200 bg-white p-3 shadow-2xl dark:border-slate-700 dark:bg-[#0e1525]",role:"dialog","aria-label":s.unref(n)("editor.findReplace.title")},[s.createElementVNode("div",IA,[s.withDirectives(s.createElementVNode("input",{ref_key:"findInput",ref:a,"onUpdate:modelValue":k[0]||(k[0]=w=>o.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.findPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:x},null,40,RA),[[s.vModelText,o.value]]),s.createElementVNode("span",LA,s.toDisplayString(u.value),1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.previous"),onClick:h},[s.createVNode(s.unref(Gh),{class:"h-4 w-4"})],8,BA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.next"),onClick:p},[s.createVNode(s.unref(Xt),{class:"h-4 w-4"})],8,PA),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800",title:s.unref(n)("editor.findReplace.close"),onClick:v},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})],8,FA)]),s.createElementVNode("div",VA,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[1]||(k[1]=w=>l.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.replacePlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:s.withKeys(s.withModifiers(g,["prevent"]),["enter"])},null,40,UA),[[s.vModelText,l.value]]),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:g},s.toDisplayString(s.unref(n)("editor.findReplace.replace")),9,HA),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:b},s.toDisplayString(s.unref(n)("editor.findReplace.replaceAll")),9,qA)])],8,zA)):s.createCommentVNode("",!0)}}),$A={class:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-6 shadow-xl dark:border-slate-700 dark:bg-slate-800"},WA={class:"mb-4 flex items-center justify-between"},GA={class:"flex items-center gap-2 text-base font-semibold text-slate-900 dark:text-slate-100"},KA={class:"mb-4"},XA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},JA=["placeholder"],ZA={class:"mb-2"},QA={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},YA=["placeholder"],e8={key:0,class:"mt-1 text-[11px] text-red-600 dark:text-red-400"},t8={class:"flex items-center justify-end gap-2 pt-2"},n8=s.defineComponent({__name:"LinkDialog",props:{isOpen:{type:Boolean},initialText:{},initialUrl:{},isEditing:{type:Boolean}},emits:["apply","remove","close"],setup(e,{emit:t}){const{t:n}=ct(),i=e,r=t,a=s.ref(""),o=s.ref(""),l=s.ref("");s.watch(()=>i.isOpen,g=>{g&&(a.value=i.initialText??"",o.value=i.initialUrl??"https://",l.value="")});function c(){const g=o.value.trim();if(!g)return l.value=n("editor.linkDialog.urlRequired"),!1;if(/^(\/|#|mailto:|tel:)/.test(g))return l.value="",!0;try{return new URL(g),l.value="",!0}catch{return l.value=n("editor.linkDialog.urlInvalid"),!1}}function u(g){const b=g.trim();return/^(\/|#|mailto:|tel:)/.test(b)||/^https?:\/\//i.test(b)?b:`https://${b}`}function f(){c()&&r("apply",{text:a.value.trim(),url:u(o.value)})}function m(){r("remove")}function p(){r("close")}function h(g){g.key==="Escape"&&p()}return(g,b)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:s.withModifiers(p,["self"]),onKeydown:h},[s.createElementVNode("div",$A,[s.createElementVNode("div",WA,[s.createElementVNode("h3",GA,[s.createVNode(s.unref(El),{class:"h-5 w-5 text-slate-500 dark:text-slate-400"}),s.createTextVNode(" "+s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.editTitle"):s.unref(n)("editor.linkDialog.insertTitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-sm text-slate-400 transition-all hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-700 dark:hover:text-slate-300",onClick:p},[s.createVNode(s.unref(qt),{class:"h-4 w-4"})])]),s.createElementVNode("div",KA,[s.createElementVNode("label",XA,s.toDisplayString(s.unref(n)("editor.linkDialog.text")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=x=>a.value=x),type:"text",placeholder:s.unref(n)("editor.linkDialog.textPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,JA),[[s.vModelText,a.value]])]),s.createElementVNode("div",ZA,[s.createElementVNode("label",QA,s.toDisplayString(s.unref(n)("editor.linkDialog.url")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=x=>o.value=x),type:"text",placeholder:s.unref(n)("editor.linkDialog.urlPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,YA),[[s.vModelText,o.value]]),l.value?(s.openBlock(),s.createElementBlock("p",e8,s.toDisplayString(l.value),1)):s.createCommentVNode("",!0)]),s.createElementVNode("div",t8,[e.isEditing?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"mr-auto flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-semibold text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40",onClick:m},[s.createVNode(s.unref(mr),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.linkDialog.remove")),1)])):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:p},s.toDisplayString(s.unref(n)("editor.linkDialog.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition-all hover:bg-cyan-700",onClick:f},s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.update"):s.unref(n)("editor.linkDialog.insert")),1)])])],32)):s.createCommentVNode("",!0)}});async function Rd(e,t){var n,i;if(typeof document>"u")return!1;try{if(t&&typeof ClipboardItem<"u"&&((n=navigator.clipboard)!=null&&n.write)){const r=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});return await navigator.clipboard.write([r]),!0}if((i=navigator.clipboard)!=null&&i.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");return r.remove(),a}catch{return!1}}async function i8(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.read))return null;try{const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes("text/html"))return await(await n.getType("text/html")).text();for(const n of t)if(n.types.includes("text/plain"))return await(await n.getType("text/plain")).text();return null}catch{return null}}async function Es(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return null;try{return await navigator.clipboard.readText()}catch{return null}}const r8={class:"docs-editor flex h-screen w-full flex-col overflow-hidden bg-slate-50 transition-colors dark:bg-[#02040a]"},a8=["title","aria-label"],o8={class:"docs-editor__body relative flex flex-1 overflow-hidden"},s8=["title"],l8={class:"flex flex-1 flex-col items-center gap-4 w-full relative"},c8=["aria-label"],u8={key:5,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},d8={class:"w-full max-w-lg rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},f8={class:"text-lg font-bold mb-4"},p8={class:"mb-6"},m8={class:"flex justify-between items-center mb-2"},h8={class:"text-sm font-semibold text-slate-500 dark:text-slate-400"},b8={class:"grid grid-cols-2 gap-3"},g8={class:"text-[11px] font-medium block mb-1"},v8=["placeholder"],x8={class:"text-[11px] font-medium block mb-1"},y8=["placeholder"],k8={class:"rounded-lg bg-slate-50 p-3 text-[11px] text-slate-500 dark:bg-white/5 dark:text-slate-400 mb-6"},w8={class:"flex justify-end gap-2"},_8={key:6,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},S8={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},C8={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},E8={class:"mb-6"},A8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},T8={class:"space-y-4"},N8={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},O8={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},M8={class:"mb-8"},D8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},z8={class:"space-y-3"},I8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},R8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},L8={class:"flex justify-end items-center gap-3"},B8={key:7,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},P8={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},F8={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},V8={class:"mb-6"},U8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},H8={class:"space-y-3"},q8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},j8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},$8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none pt-1"},W8={class:"mb-8"},G8={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},K8={class:"space-y-3"},X8={class:"flex items-center gap-3"},J8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},Z8={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},Q8={class:"flex justify-end items-center gap-3"},Y8={key:8,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},eT={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},tT={class:"text-lg font-bold mb-4"},nT={class:"mb-4"},iT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},rT=["value"],aT={class:"mb-4"},oT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},sT={class:"flex gap-2"},lT={class:"mb-6"},cT={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},uT={class:"grid grid-cols-2 gap-3"},dT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},fT=["max"],pT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},mT=["max"],hT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},bT=["max"],gT={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},vT=["max"],xT={class:"flex justify-end gap-2"},yT=189,Zi=37.795,As=0,Ts=5,Ld=.1,_i=0,kT=s.defineComponent({__name:"DocsEditor",props:{modelValue:{default:void 0},plugins:{default:()=>[]},editable:{type:Boolean,default:!0},collaboration:{default:void 0},pageSize:{default:"a4"},pageless:{type:Boolean,default:!1},virtualPages:{type:Boolean,default:!1},title:{default:"Untitled Document"},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},connectionState:{default:"connected"},userName:{default:""},userAvatar:{default:""},locale:{default:void 0},documentMeta:{default:void 0},shareUrl:{default:""},onImageUpload:{type:Function,default:void 0},citation:{default:void 0},aiStream:{type:Function,default:void 0},aiDraft:{type:Function,default:void 0},debug:{type:Boolean,default:!1},comments:{default:()=>[]},selectedTextSnippet:{default:""},selectedTextIndex:{default:void 0},snapshots:{default:()=>[]},activePreviewIndex:{default:null},orientation:{default:"portrait"},margins:{default:()=>({top:94,bottom:94,left:94,right:94})},headerMarginCm:{default:.5},footerMarginCm:{default:.5}},emits:["update:modelValue","update:title","update:pageSize","update:orientation","update:margins","update:header-footer-margins","update:pageless","update:pageCount","update:locale","citation-sources-change","update:citation-style","toggle-star","back","share","menu-click","export","ready","add-comment","add-reply","resolve-comment","delete-comment","save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){var Ac,Tc,Nc,Oc,Mc;const n=e,i=t,{locale:r,setLocale:a,t:o}=jd(n.locale);s.watch(()=>n.locale,A=>{A&&A!==r.value&&a(A)}),s.watch(r,A=>{i("update:locale",A)});const l=s.ref({top:((Ac=n.margins)==null?void 0:Ac.top)??94,bottom:((Tc=n.margins)==null?void 0:Tc.bottom)??94,left:((Nc=n.margins)==null?void 0:Nc.left)??94,right:((Oc=n.margins)==null?void 0:Oc.right)??94});function c(A,T=.5){const z=typeof A=="number"?A:Number(A);if(!Number.isFinite(z))return T;const le=Math.min(Ts,Math.max(As,z));return Math.round(le*10)/10}const u=s.ref(n.orientation??"portrait"),f=s.ref(n.pageSize??"a4"),m=s.ref(n.pageless??!1);s.watch(()=>n.orientation,A=>{A!==void 0&&(u.value=A)}),s.watch(()=>n.margins,A=>{A!==void 0&&(l.value={...A})}),s.watch(()=>n.headerMarginCm,A=>{typeof A=="number"&&Number.isFinite(A)&&(ln.value=c(A))}),s.watch(()=>n.footerMarginCm,A=>{typeof A=="number"&&Number.isFinite(A)&&(cn.value=c(A))});const p=s.computed(()=>{const A=Qi.getPageSize(f.value)??Qi.PAGE_SIZES[0];let T=A.pageWidth,z=A.pageHeight;return u.value==="landscape"&&([T,z]=[z,T]),{pageHeight:z,pageWidth:T,margins:{...l.value}}}),h=s.computed(()=>`${p.value.pageWidth}px`),{isDark:g}=So(),b=s.computed(()=>n.virtualPages===!0),x=s.computed(()=>({enabled:!m.value&&!b.value,pageHeight:p.value.pageHeight,pageWidth:p.value.pageWidth,marginTop:p.value.margins.top,marginBottom:p.value.margins.bottom,marginLeft:p.value.margins.left,marginRight:p.value.margins.right,contentMarginTop:0,contentMarginBottom:0,pageGap:40,pageBreakBackground:g.value?"#02040a":"#f1f5f9",headerLeft:"",headerRight:"",footerLeft:"",footerRight:"",onHeaderClick:A=>{ea(A==null?void 0:A.event)},onFooterClick:A=>{A!=null&&A.event&&A.event.detail!==2||ta()}})),y=(A=>{const T=A;return T&&typeof T=="object"&&T.type==="tabbed-doc"&&Array.isArray(T.tabs)?T:{type:"tabbed-doc",activeTabId:"tab-1",tabs:[{id:"tab-1",label:"Tab 1",content:A||{type:"doc",content:[{type:"paragraph"}]}}]}})(n.modelValue),k=s.ref(y.headerLeft||""),w=s.ref(y.headerRight||""),S=s.ref(y.footerLeft||""),E=s.ref(y.footerRight||""),D=s.ref(y.tabs.map(A=>({id:A.id,label:A.label,active:A.id===y.activeTabId}))),_=s.ref({});y.tabs.forEach(A=>{_.value[A.id]=A.content});const C=s.ref(y.activeTabId),N=s.computed(()=>_.value[C.value]),I=s.ref(!1),H=s.ref(null),F=s.ref(null),M=s.ref(localStorage.getItem("docflow:view:showRuler")!=="false"),j=s.ref(!1);s.watch(M,A=>{localStorage.setItem("docflow:view:showRuler",A?"true":"false")});const P=s.ref(0),W=s.ref(0),L=s.ref("saved"),Y=s.ref(Date.now()),q=s.ref(null),O=s.ref(new Set);let B=null;const U=s.ref(!1);function oe(){if(!G.value||!we.value)return;const A=G.value.state.doc;if(n.collaboration&&!U.value&&A.content.size<=2)return;U.value=!0;const T=new Set;A.descendants(z=>{for(const le of z.marks)le.type.name==="comment"&&le.attrs.threadId&&T.add(le.attrs.threadId);return!0}),O.value=T}function ne(){B&&clearTimeout(B),B=setTimeout(oe,200)}const te=s.computed(()=>{if(!U.value)return[];const A=O.value;return(n.comments??[]).filter(T=>T.anchorIndex!=null&&!A.has(T.id)).map(T=>T.id)});s.onUnmounted(()=>{B&&clearTimeout(B)});const ie=s.computed(()=>{const A=[];for(const T of n.plugins)for(const z of T.slashCommands||[])A.push({name:z.name,command:z.command});return A}),X=()=>{const A={type:"tabbed-doc",activeTabId:C.value,tabs:D.value.map(T=>({id:T.id,label:T.label,content:_.value[T.id]})),headerLeft:k.value,headerRight:w.value,footerLeft:S.value,footerRight:E.value};i("update:modelValue",A),L.value="saving",q.value&&clearTimeout(q.value),q.value=setTimeout(()=>{L.value="saved",Y.value=Date.now()},800)},V=s.ref((()=>{var T;const A=(T=n.citation)==null?void 0:T.sources;return Array.isArray(A)?[...A]:typeof A=="function"?[...A()]:[]})()),$=s.ref(((Mc=n.citation)==null?void 0:Mc.style)||"chicago-notes-bibliography");let re=null;const se=s.ref(!1),Ce=A=>{re==null||re(A),re=null,se.value=!1},Ne=()=>new Promise(A=>{Ce(null),re=A,se.value=!0,F.value="references"}),de=s.computed(()=>{const A=n.citation;if(A)return{...A,sources:()=>V.value,onSourceRequest:A.onSourceRequest??Ne}}),{editorRef:ke,editor:G,pluginActions:At,isReady:we,docsEditor:Bt}=Bd({content:N,plugins:n.plugins,editable:n.editable,collaboration:n.collaboration,onImageUpload:n.onImageUpload,citation:de.value,aiStream:n.aiStream,aiDraft:n.aiDraft,debug:n.debug,getPageMap:()=>new Map,paginationOptions:x.value,onUpdate:A=>{_.value[C.value]=A,X()}}),K=()=>{var A,T,z;return((z=(T=(A=G.value)==null?void 0:A.storage)==null?void 0:T.citation)==null?void 0:z.engine)??null},R=()=>{var A;(A=K())==null||A.updateSources(V.value),i("citation-sources-change",V.value)},Q=A=>{V.value=[...V.value,A],R()},Ie=A=>{V.value=V.value.map(T=>T.id===A.id?A:T),R()},$e=A=>{V.value=V.value.filter(T=>T.id!==A),R()},Ge=A=>{var T;$.value=A,(T=K())==null||T.setStyle(A),i("update:citation-style",A)},an=A=>{var T,z;re?(Ce(A),F.value=null):(z=(T=At.value).insertCitation)==null||z.call(T,{sourceId:A})};s.watch(F,(A,T)=>{T==="references"&&A!=="references"&&Ce(null)});const vt=s.ref(!1),xt=s.ref(""),Pt=s.computed(()=>{var A,T;return!!((A=n.citation)!=null&&A.onImportDoi||(T=n.citation)!=null&&T.onImportBibliography)}),yn=async A=>{const T=n.citation;if(!(!(T!=null&&T.onImportDoi)||vt.value)){vt.value=!0,xt.value="";try{const z=await T.onImportDoi(A);if(!z){xt.value=o("sidebars.references.import.doiFailed");return}const le=V.value.some(ue=>ue.id===z.id);V.value=le?V.value.map(ue=>ue.id===z.id?z:ue):[...V.value,z],R(),xt.value=o("sidebars.references.import.doiSuccess")}catch{xt.value=o("sidebars.references.import.doiFailed")}finally{vt.value=!1}}},Ye=async A=>{const T=n.citation;if(!(!(T!=null&&T.onImportBibliography)||vt.value)){vt.value=!0,xt.value="";try{const{imported:z,failed:le}=await T.onImportBibliography(A);if(z.length>0){const ue=new Map(V.value.map(ye=>[ye.id,ye]));for(const ye of z)ue.set(ye.id,ye);V.value=[...ue.values()],R()}xt.value=le>0?o("sidebars.references.import.partial").replace("{ok}",String(z.length)).replace("{failed}",String(le)):o("sidebars.references.import.batchSuccess").replace("{count}",String(z.length))}catch{xt.value=o("sidebars.references.import.failed")}finally{vt.value=!1}}},jn=()=>{var T;const A=((T=G.value)==null?void 0:T.getText())??"";W.value=A.length,P.value=A.trim()?A.trim().split(/\s+/).length:0},Pi=()=>{if(!G.value)return null;const{from:A,to:T,head:z}=G.value.state.selection;if(A===T)return null;const le=G.value.view.coordsAtPos(z);if(!le)return null;const ue=12,ye=180,Oe=le.top-48,Ae=(le.left+le.right)/2;if(typeof window>"u")return{top:Math.max(ue,Oe),left:Ae};const me=Math.min(ye,Math.max(0,window.innerWidth/2-ue)),fe=ue+me,ce=window.innerWidth-ue-me,be=Math.max(ue,window.innerHeight-48);return{top:Math.min(be,Math.max(ue,Oe)),left:Math.min(ce,Math.max(fe,Ae))}},Fi=()=>{if(!G.value){I.value=!1,H.value=null;return}const{from:A,to:T}=G.value.state.selection;I.value=A!==T,H.value=A!==T?Pi():null},$n=s.ref(null);let kn=null;const Fo=()=>{G.value&&(kn&&clearTimeout(kn),kn=setTimeout(()=>{G.value&&G.value.view.dispatch(G.value.state.tr)},150))},on=s.ref(1),yt=s.ref(1),Ft=s.computed(()=>{const A=p.value;return{pageSize:{id:f.value,name:f.value.toUpperCase(),pageWidth:A.pageWidth,pageHeight:A.pageHeight},margins:{top:A.margins.top,bottom:A.margins.bottom,left:A.margins.left,right:A.margins.right},pageGap:40,headerLeft:k.value,headerRight:w.value,footerLeft:S.value,footerRight:E.value}}),{data:Vi,totalPages:Vt,isReady:Wn,refreshData:Vo}=Ch({editorRef:s.computed(()=>G.value),scrollRef:$n,config:Ft.value,bufferPages:2});s.watch([Vt,Wn],()=>{b.value&&Wn.value&&(on.value=Vt.value)}),s.watch(b,A=>{A&&Vo()});const sn=()=>{if(!G.value||!we.value){on.value=1,yt.value=1;return}const A=G.value.view.dom,T=A.querySelector("[data-rm-pagination]");T?on.value=T.children.length||1:on.value=1;try{const{selection:z}=G.value.state,le=G.value.view.coordsAtPos(z.head);if(le&&T){const ue=Array.from(T.querySelectorAll(".rm-page-break")),ye=A.getBoundingClientRect(),Oe=le.top-ye.top+A.scrollTop;let Ae=1,me=!1;for(let fe=0;fe<ue.length;fe++){const ce=ue[fe].querySelector(".breaker");if(ce instanceof HTMLElement&&Oe<ce.offsetTop){yt.value=Ae,me=!0;break}Ae++}me||(yt.value=Ae)}else yt.value=1}catch{yt.value=1}};s.watch(p,A=>{G.value&&(G.value.commands.updatePageHeight(A.pageHeight),G.value.commands.updatePageWidth(A.pageWidth),G.value.commands.updateMargins({top:A.margins.top,bottom:A.margins.bottom,left:A.margins.left,right:A.margins.right}),sn())});const wn=A=>{A!==m.value&&(m.value=A,i("update:pageless",A),G.value&&(A?G.value.commands.disablePagination():G.value.commands.enablePagination(),setTimeout(()=>{sn(),Xn()},60)))};s.watch(()=>n.pageless,A=>wn(A??!1));const Ut=s.ref(!1),_n=s.ref(!1),ft=s.ref(""),pt=s.ref(""),Sn=s.ref(""),Lr=s.ref(""),ln=s.ref(c(n.headerMarginCm)),cn=s.ref(c(n.footerMarginCm)),Br=s.ref(!1),Ui=s.ref(ln.value),Hi=s.ref(cn.value),Pr=s.ref(!1),Fr=s.ref(!1),Vr=s.ref(!1),Ur=s.ref("header"),Hr=s.ref(!0),qr=s.ref("startAt"),jr=s.ref(1),hi=s.ref("header"),$r=s.ref(!0),bi=s.ref("startAt"),Wr=s.ref(1),Uo=A=>{if(!Hr.value&&A===0)return"";let T=A+1;return qr.value==="startAt"&&(T=A+jr.value),String(T)},Ht=()=>{if(!G.value||!we.value)return;const A=String(on.value),T=G.value.view.dom,z=k.value.replace(/{total}/g,A),le=w.value.replace(/{total}/g,A),ue=S.value.replace(/{total}/g,A),ye=E.value.replace(/{total}/g,A);G.value.commands.updateHeaderContent(z,le),G.value.commands.updateFooterContent(ue,ye);const Oe=`${Math.max(0,ln.value)*Zi}px`,Ae=`${Math.max(0,cn.value)*Zi}px`;T.style.setProperty("--rm-header-margin-top",Oe),T.style.setProperty("--rm-footer-margin-bottom",Ae),G.value.view.dispatch(G.value.state.tr),setTimeout(()=>{requestAnimationFrame(()=>{if(!G.value||G.value.view.dom!==T)return;const me=(be,Te)=>{let Ee=z,De=le;return Te&&Ut.value?(Ee=ft.value.replace(/{total}/g,A),De=pt.value.replace(/{total}/g,A)):_n.value&&be%2===0&&(Ee=Sn.value.replace(/{total}/g,A),De=Lr.value.replace(/{total}/g,A)),{left:Ee.replace(/{page}/g,Uo(be-1)),right:De.replace(/{page}/g,Uo(be-1))}},fe=(be,Te,Ee)=>{const De=me(Te,Ee),Me=be.querySelector(".rm-page-header-left"),Fe=be.querySelector(".rm-page-header-right");Me&&(Me.innerHTML=De.left),Fe&&(Fe.innerHTML=De.right)},ce=T.querySelector(".rm-first-page-header");ce&&fe(ce,1,!0),Array.from(T.querySelectorAll(".rm-page-break .rm-page-header")).forEach((be,Te)=>{fe(be,Te+2,!1)}),Array.from(T.querySelectorAll(".rm-page-break .rm-page-footer")).forEach((be,Te)=>{const Ee=Te+1,De=Uo(Ee-1),Me=be.querySelector(".rm-page-footer-left"),Fe=be.querySelector(".rm-page-footer-right");Me&&(Me.innerHTML=ue.replace(/{page}/g,De)),Fe&&(Fe.innerHTML=ye.replace(/{page}/g,De))})})},50)};s.watch(Ut,()=>{Ht()}),s.watch([_n,ln,cn,Ur,Hr,qr,jr],()=>{Ht()}),s.watch(on,A=>{Ht(),i("update:pageCount",A)}),s.watch(g,A=>{G.value&&(G.value.commands.updatePageBreakBackground(A?"#02040a":"#f1f5f9"),G.value.view.dispatch(G.value.state.tr))}),s.watch(x,A=>{if(!G.value||!we.value)return;const T=G.value.storage.PaginationPlus;!T||!(T.pageHeight!==A.pageHeight||T.pageWidth!==A.pageWidth||T.marginTop!==A.marginTop||T.marginBottom!==A.marginBottom||T.marginLeft!==A.marginLeft||T.marginRight!==A.marginRight||T.pageGap!==A.pageGap||T.contentMarginTop!==A.contentMarginTop||T.contentMarginBottom!==A.contentMarginBottom||T.pageBreakBackground!==A.pageBreakBackground||T.enabled!==A.enabled)||(T.pageHeight=A.pageHeight,T.pageWidth=A.pageWidth,T.marginTop=A.marginTop,T.marginBottom=A.marginBottom,T.marginLeft=A.marginLeft,T.marginRight=A.marginRight,T.pageGap=A.pageGap,T.contentMarginTop=A.contentMarginTop,T.contentMarginBottom=A.contentMarginBottom,T.pageBreakBackground=A.pageBreakBackground,T.enabled=A.enabled,G.value.view.dispatch(G.value.state.tr))},{deep:!0}),s.watch(we,A=>{var T,z,le,ue,ye,Oe,Ae,me;A&&G.value&&(!k.value&&!w.value&&!S.value&&!E.value&&(k.value=((z=(T=G.value.storage.PaginationPlus)==null?void 0:T.appliedConfig)==null?void 0:z.headerLeft)||"",w.value=((ue=(le=G.value.storage.PaginationPlus)==null?void 0:le.appliedConfig)==null?void 0:ue.headerRight)||"",S.value=((Oe=(ye=G.value.storage.PaginationPlus)==null?void 0:ye.appliedConfig)==null?void 0:Oe.footerLeft)||"",E.value=((me=(Ae=G.value.storage.PaginationPlus)==null?void 0:Ae.appliedConfig)==null?void 0:me.footerRight)||""),Ht(),Bt.value&&i("ready",Bt.value),G.value.on("selectionUpdate",()=>{Fi(),sn()}),G.value.on("transaction",()=>{sn(),jn(),ne()}),Fi(),jn(),sn(),ne(),setTimeout(()=>{var ce;return(ce=G.value)==null?void 0:ce.commands.focus("start")},50),[100,300,600,1200,2500].forEach(ce=>{setTimeout(()=>{G.value&&G.value.view.dispatch(G.value.state.tr)},ce)}),G.value.view.dom.addEventListener("keydown",ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key.toLowerCase()==="k"&&(ce.preventDefault(),xc())}),G.value.view.dom.addEventListener("click",ce=>{const be=ce.target;if(!be||be.closest('.rm-google-docs-header-bar, .rm-options-dropdown, [contenteditable="true"]'))return;if(be.closest(".rm-page-header, .rm-first-page-header")){ea(ce);return}const Ee=be.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ee){const De=Ee.getBoundingClientRect(),Me=ce.clientY-De.top,Fe=ln.value*37.795;if(Me>=0&&Me<=Math.max(Fe,40)+15){let et=null;Ee.classList.contains("rm-page-break")&&(et=Ee.querySelector(".rm-page-header")),et||(et=document.querySelector(".rm-page-header, .rm-first-page-header")),et&&ea(ce)}}}),G.value.view.dom.addEventListener("dblclick",ce=>{const be=ce.target;if(!be)return;if(be.closest(".rm-page-footer")){ta();return}const Ee=be.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ee){const Me=Ee.getBoundingClientRect().bottom-ce.clientY,Fe=cn.value*37.795;Me>=0&&Me<=Math.max(Fe,40)+15&&ta()}}))}),s.watch(()=>n.collaboration,()=>{},{deep:!0}),s.onUnmounted(()=>{En(!1),q.value&&clearTimeout(q.value),kn&&clearTimeout(kn)});const Gr=s.ref(!1),qi=s.ref(""),ji=s.ref(""),Kr=s.ref(!1),Ho=s.ref(!1),qo=s.ref(!1),Xr=s.ref(!1),$i=s.ref(!1),Jr=s.ref(""),jo=s.ref(""),Zr=s.ref(!1);function xc(){if(!G.value)return;const{state:A}=G.value,{from:T,to:z,empty:le}=A.selection,ue=G.value.getAttributes("link");ue.href?(Zr.value=!0,jo.value=ue.href,le?Jr.value="":Jr.value=A.doc.textBetween(T,z," ")):(Zr.value=!1,jo.value="https://",Jr.value=le?"":A.doc.textBetween(T,z," ")),$i.value=!0}function nh(A){if(!G.value)return;const{state:T}=G.value,{from:z,to:le,empty:ue}=T.selection,ye=A.text.trim(),Oe=G.value.chain().focus();Zr.value||G.value.isActive("link")?(Oe.setLink({href:A.url,target:"_blank"}).run(),ye&&!ue&&Oe.insertContentAt({from:z,to:le},ye).run()):ye?Oe.insertContentAt({from:z,to:le},{type:"text",text:ye,marks:[{type:"link",attrs:{href:A.url,target:"_blank"}}]}).run():ue?Oe.insertContent({type:"text",text:A.url,marks:[{type:"link",attrs:{href:A.url,target:"_blank"}}]}).run():Oe.setLink({href:A.url,target:"_blank"}).run(),$i.value=!1}function ih(){if(!G.value)return;G.value.chain().focus().unsetLink().run(),$i.value=!1}const Qr=s.ref(f.value),Gn=s.ref(u.value),Xe=s.ref({top:Cn(l.value.top),bottom:Cn(l.value.bottom),left:Cn(l.value.left),right:Cn(l.value.right)}),Wi=Number((yT/Zi).toFixed(1));function Cn(A){return Math.round(A/Zi*10)/10}function Yr(A){return Math.round(A*Zi)}const rh=()=>{Qr.value=f.value,Gn.value=u.value,Xe.value={top:Cn(l.value.top),bottom:Cn(l.value.bottom),left:Cn(l.value.left),right:Cn(l.value.right)},Kr.value=!0},ah=()=>{const A=T=>{const z=typeof T=="number"?T:Number(T);return Number.isFinite(z)?Math.min(Wi,Math.max(_i,z)):_i};f.value=Qr.value,u.value=Gn.value,Xe.value={top:A(Xe.value.top),bottom:A(Xe.value.bottom),left:A(Xe.value.left),right:A(Xe.value.right)},l.value={top:Yr(Xe.value.top),bottom:Yr(Xe.value.bottom),left:Yr(Xe.value.left),right:Yr(Xe.value.right)},i("update:pageSize",f.value),i("update:orientation",Gn.value),i("update:margins",{...l.value}),Kr.value=!1},$o=s.ref(!1),Kn={value:null},oh=()=>{Ui.value=ln.value,Hi.value=cn.value,Pr.value=Ut.value,Fr.value=_n.value,Br.value=!0},sh=()=>{ln.value=c(Ui.value),cn.value=c(Hi.value),Ui.value=ln.value,Hi.value=cn.value,Ut.value=Pr.value,_n.value=Fr.value,Br.value=!1,Ht(),i("update:header-footer-margins",{headerMarginCm:ln.value,footerMarginCm:cn.value}),X()},lh=()=>{hi.value=Ur.value,$r.value=Hr.value,bi.value=qr.value,Wr.value=jr.value,Vr.value=!0},ch=()=>{Ur.value=hi.value,Hr.value=$r.value,qr.value=bi.value,jr.value=Wr.value,Vr.value=!1;const A="{page}";Ur.value==="footer"?(w.value.includes(A)&&(w.value=w.value.replace(/{page}/g,"").trim()),E.value=A):(E.value.includes(A)&&(E.value=E.value.replace(/{page}/g,"").trim()),w.value=A),Ht(),X()},uh=()=>{k.value="",w.value="",Ht(),X(),$o.value=!1},dh=A=>{const T=A===1,z=A%2===0;return Ut.value&&T?ft.value:_n.value&&z?Sn.value:k.value},En=(A=!0)=>{var le;const T=Kn.value;if(!T)return;const z=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(le=$n.value)==null||le.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetHeader.classList.remove("rm-header-active"),Kn.value=null,$o.value=!1,A&&(Ut.value&&T.isFirstPage?ft.value=z:_n.value&&T.pageIndex%2===0?Sn.value=z:k.value=z,Ht(),X())},yc=A=>{if(!A.targetHeader.parentNode||!G.value)return;const T=G.value.view.dom,z=A.targetHeader.getBoundingClientRect(),le=T.getBoundingClientRect(),ue=getComputedStyle(T),ye=parseFloat(ue.getPropertyValue("--rm-margin-left"))||0,Oe=parseFloat(ue.getPropertyValue("--rm-margin-right"))||0,Ae=A.targetHeader.querySelector(".rm-page-header-content"),me=(Ae==null?void 0:Ae.getBoundingClientRect())??z,fe=A.isFirstPage?z.left:z.left+ye,ce=A.isFirstPage?z.right:z.right-Oe,be=Math.max(0,fe-le.left),Te=Math.max(0,le.right-ce);A.overlay.style.left=`${fe}px`,A.overlay.style.top=`${me.top}px`,A.overlay.style.width=`${Math.max(ce-fe,1)}px`,A.overlay.style.height=`${Math.max(me.height,24)}px`,A.activeBar.style.setProperty("--rm-header-bar-left",`${-be}px`),A.activeBar.style.setProperty("--rm-header-bar-width",`${le.width}px`),A.activeBar.style.setProperty("--rm-header-bar-padding-left",`${be}px`),A.activeBar.style.setProperty("--rm-header-bar-padding-right",`${Te}px`)},ea=A=>{var Dc,zc;const T=Kn.value;if(T){const ve=A==null?void 0:A.target;if(!ve||ve instanceof Node&&T.targetHeader.contains(ve))return;En(!1)}let z=null;if(A){const ve=A.target;z=ve==null?void 0:ve.closest(".rm-page-header, .rm-first-page-header")}if(z||(z=(Dc=G.value)==null?void 0:Dc.view.dom.querySelector(".rm-first-page-header, .rm-page-header")),!z||!G.value)return;const le=G.value.view.dom,ue=z.classList.contains("rm-first-page-header"),ye=Array.from(le.querySelectorAll(".rm-page-break .rm-page-header")),Oe=ue?1:ye.indexOf(z)+2;if(!ue&&Oe<2)return;const Ae=z.querySelector(".rm-page-header-content");Ae&&(Ae.style.visibility="hidden");const me=document.createElement("div");me.className="rm-header-edit-input",me.contentEditable="true",me.setAttribute("role","textbox"),me.setAttribute("aria-label",o("editor.headerFooter.header")||"Header"),me.dataset.placeholder=o("editor.headerFooter.headerPlaceholder")||"Header",me.innerHTML=dh(Oe);const fe=document.createElement("div");fe.className="rm-header-edit-overlay",fe.appendChild(me);const ce=document.createElement("div");ce.className="rm-google-docs-header-bar",ce.innerHTML=`
|
|
15238
15238
|
<span class="rm-header-label">${o("editor.headerFooter.header")||"Header"}</span>
|
|
15239
15239
|
<div class="rm-header-right-tools">
|
|
15240
15240
|
<label class="rm-diff-label">
|