ocean-brain 0.8.0 → 0.8.2
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/README.md +113 -0
- package/dist/mcp.js +230 -291
- package/package.json +6 -5
- package/server/client/dist/assets/ArrowRight.es-g2YZTklZ.js +1 -0
- package/server/client/dist/assets/Calendar-BP6HTuSn.js +25 -0
- package/server/client/dist/assets/Callout-B_IPSF_5.js +1 -0
- package/server/client/dist/assets/Copy.es-CNxe4ujr.js +1 -0
- package/server/client/dist/assets/Graph-D9GeO71k.js +1 -0
- package/server/client/dist/assets/Graph-Xha3fwhp.js +46 -0
- package/server/client/dist/assets/Image-BLEjLUqd.js +1 -0
- package/server/client/dist/assets/Image.es-DnON8cv2.js +1 -0
- package/server/client/dist/assets/Note-DjrCYtat.js +24 -0
- package/server/client/dist/assets/NotePropertiesPanel-2DgXEM4B.js +2 -0
- package/server/client/dist/assets/Plus.es-CQ8wn2is.js +1 -0
- package/server/client/dist/assets/Reminders-B4l3KdlK.js +1 -0
- package/server/client/dist/assets/Search-BN5sf7bE.js +1 -0
- package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +1 -0
- package/server/client/dist/assets/Tag-oSnmViVp.js +1 -0
- package/server/client/dist/assets/TagNotes-BDTCcJcL.js +1 -0
- package/server/client/dist/assets/Trash.es-0aPpA-3S.js +1 -0
- package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +1 -0
- package/server/client/dist/assets/{ViewSectionDialog-CzskgmMF.js → ViewSectionDialog-Ctl_694Y.js} +17 -17
- package/server/client/dist/assets/Views-D-zlatYD.js +1 -0
- package/server/client/dist/assets/app-DmqIOMWF.css +1 -0
- package/server/client/dist/assets/app-cTRcKMGc.js +26 -0
- package/server/client/dist/assets/floating-ui.react-dom-wWLZ1CdM.js +1 -0
- package/server/client/dist/assets/{image.api-8dlMwzMd.js → image.api-CVuuvTBk.js} +1 -1
- package/server/client/dist/assets/index-DKJChPr4.js +1 -0
- package/server/client/dist/assets/manage-image-BZjaxp-f.js +1 -0
- package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +1 -0
- package/server/client/dist/assets/{mcp-EDurbggR.js → mcp-CT_9IV2c.js} +2 -2
- package/server/client/dist/assets/mcp-admin-adapter-xAuyZc_M.js +1 -0
- package/server/client/dist/assets/note-core-Buwzyxi7.js +13 -0
- package/server/client/dist/assets/note-runtime-CPDVOFEo.js +168 -0
- package/server/client/dist/assets/note-ui-CHI-tzj-.js +2 -0
- package/server/client/dist/assets/{index-BEUqDuAZ.css → note-ui-DL8owV-U.css} +1 -1
- package/server/client/dist/assets/note.api-D_00ZzJC.js +356 -0
- package/server/client/dist/assets/{placeholder-DeKgSBnC.js → placeholder-DbdGiYGL.js} +4 -4
- package/server/client/dist/assets/preload-helper-BXl3LOEh.js +1 -0
- package/server/client/dist/assets/properties-D447wsWk.js +1 -0
- package/server/client/dist/assets/route-preload.js +2 -0
- package/server/client/dist/assets/{tag.api-Dl8DQd0m.js → tag.api-CX0SE06J.js} +1 -1
- package/server/client/dist/assets/time-B3pt8vt4.js +9 -0
- package/server/client/dist/assets/trash-8sH7EZgc.js +1 -0
- package/server/client/dist/assets/url-BSnWpmJx.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-CoXXqJY2.js → useReminderMutate-CLK1tHvT.js} +4 -4
- package/server/client/dist/index.html +10 -5
- package/server/dist/app.js +1 -2
- package/server/dist/features/auth/http/api.js +0 -1
- package/server/dist/features/auth/http/login-page.js +272 -5
- package/server/dist/features/auth/http/pages.js +20 -3
- package/server/dist/features/auth/service.js +3 -2
- package/server/dist/features/cache/graphql/cache.field.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.query.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.type-defs.js +0 -1
- package/server/dist/features/cache/graphql/index.js +0 -1
- package/server/dist/features/image/graphql/image.field.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.mutation.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.query.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.type-defs.js +0 -1
- package/server/dist/features/image/graphql/index.js +0 -1
- package/server/dist/features/image/http/upload.js +0 -1
- package/server/dist/features/image/services/delete.js +0 -1
- package/server/dist/features/image/services/upload.js +0 -1
- package/server/dist/features/image/services/validation.js +0 -1
- package/server/dist/features/mcp-admin/http/handlers.js +0 -1
- package/server/dist/features/mcp-admin/service.js +0 -1
- package/server/dist/features/note/graphql/index.js +0 -1
- package/server/dist/features/note/graphql/note.field.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.query.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.type-defs.js +0 -1
- package/server/dist/features/note/http/mcp.js +0 -1
- package/server/dist/features/note/services/authoring.js +0 -1
- package/server/dist/features/note/services/cleanup.js +0 -1
- package/server/dist/features/note/services/content-blocks.js +0 -1
- package/server/dist/features/note/services/markdown-intent-write.js +0 -1
- package/server/dist/features/note/services/markdown-patch.js +0 -1
- package/server/dist/features/note/services/properties.js +0 -1
- package/server/dist/features/note/services/search-backfill.js +0 -1
- package/server/dist/features/note/services/search.js +0 -1
- package/server/dist/features/note/services/snapshot.js +0 -1
- package/server/dist/features/note/services/tag-filter.js +0 -1
- package/server/dist/features/note/services/trash.js +0 -1
- package/server/dist/features/note/services/write-conflict.js +0 -1
- package/server/dist/features/note/services/write.js +0 -1
- package/server/dist/features/placeholder/graphql/index.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js +0 -1
- package/server/dist/features/reminder/graphql/index.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.type-defs.js +0 -1
- package/server/dist/features/tag/graphql/index.js +0 -1
- package/server/dist/features/tag/graphql/tag.field.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.type-defs.js +0 -1
- package/server/dist/features/tag/http/mcp.js +0 -1
- package/server/dist/features/tag/services/organization.js +0 -1
- package/server/dist/features/view/graphql/index.js +0 -1
- package/server/dist/features/view/graphql/view.mutation.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.query.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.type-defs.js +0 -1
- package/server/dist/features/view/services/workspace.js +0 -1
- package/server/dist/main.js +0 -1
- package/server/dist/models.js +0 -1
- package/server/dist/modules/app-version.js +0 -1
- package/server/dist/modules/auth-guard.js +0 -1
- package/server/dist/modules/auth-mode.js +0 -1
- package/server/dist/modules/auth-redirect.js +0 -1
- package/server/dist/modules/blocknote-markdown-editor.js +53 -0
- package/server/dist/modules/blocknote-tree.js +0 -1
- package/server/dist/modules/blocknote.js +272 -79
- package/server/dist/modules/data-maintenance.js +0 -1
- package/server/dist/modules/error-handler.js +8 -1
- package/server/dist/modules/graphql.js +0 -1
- package/server/dist/modules/logger.js +0 -1
- package/server/dist/modules/mcp-auth.js +0 -1
- package/server/dist/modules/mcp-token.js +0 -1
- package/server/dist/modules/prisma-runtime.js +0 -1
- package/server/dist/modules/rate-limit.js +0 -1
- package/server/dist/modules/recovery-retention.js +0 -1
- package/server/dist/modules/server-events-handler.js +0 -1
- package/server/dist/modules/server-events.js +0 -1
- package/server/dist/modules/session-store.js +0 -1
- package/server/dist/modules/use-async.js +0 -1
- package/server/dist/paths.js +0 -1
- package/server/dist/routes/api.js +0 -1
- package/server/dist/routes/auth-pages.js +0 -1
- package/server/dist/routes/client.js +0 -1
- package/server/dist/routes/graphql.js +0 -1
- package/server/dist/routes/index.js +0 -1
- package/server/dist/routes/mcp.js +0 -1
- package/server/dist/schema/index.js +0 -1
- package/server/dist/start.js +0 -1
- package/server/dist/types/index.js +0 -1
- package/server/dist/types/input.js +0 -1
- package/server/client/dist/assets/ArrowRight.es-C4zlc54Z.js +0 -1
- package/server/client/dist/assets/Calendar-COrN6Hjv.js +0 -25
- package/server/client/dist/assets/Callout-BK0K9E74.js +0 -1
- package/server/client/dist/assets/Copy.es-zm8f_XXX.js +0 -1
- package/server/client/dist/assets/Graph-BH1fzhue.js +0 -1
- package/server/client/dist/assets/Image-KXuHOG4b.js +0 -1
- package/server/client/dist/assets/Image.es-BKahRbIm.js +0 -1
- package/server/client/dist/assets/Note-C143cKKw.js +0 -12
- package/server/client/dist/assets/Plus.es-BqeC8T8h.js +0 -1
- package/server/client/dist/assets/Reminders-BYG5rz1M.js +0 -1
- package/server/client/dist/assets/Search-DBWsIMDP.js +0 -1
- package/server/client/dist/assets/SurfaceCard-CNSQfYfM.js +0 -1
- package/server/client/dist/assets/Tag-5aCfSO8Y.js +0 -1
- package/server/client/dist/assets/TagNotes-BPZjN-6l.js +0 -1
- package/server/client/dist/assets/Trash.es-CRQkTnXZ.js +0 -1
- package/server/client/dist/assets/ViewNotes-DGLNF96x.js +0 -1
- package/server/client/dist/assets/Views-DR5jT23G.js +0 -1
- package/server/client/dist/assets/graph-vendor-UTvF2NS_.js +0 -46
- package/server/client/dist/assets/index-DGIAh3ZY.js +0 -1
- package/server/client/dist/assets/index-VHp17GQX.js +0 -342
- package/server/client/dist/assets/manage-image-RqtWKas2.js +0 -1
- package/server/client/dist/assets/manage-image-detail-BTSIbLlQ.js +0 -1
- package/server/client/dist/assets/mcp-admin-adapter-DmGUo5G8.js +0 -1
- package/server/client/dist/assets/note-core-BklwyZHk.js +0 -180
- package/server/client/dist/assets/note-vendor-DkYKUmLo.js +0 -54
- package/server/client/dist/assets/properties-BjrZvOYn.js +0 -1
- package/server/client/dist/assets/trash-C5ntddLu.js +0 -1
- package/server/client/dist/fonts/Pretendard-Bold.woff +0 -0
- package/server/client/dist/fonts/Pretendard-Regular.woff +0 -0
- package/server/dist/app.js.map +0 -1
- package/server/dist/features/auth/http/api.js.map +0 -1
- package/server/dist/features/auth/http/login-page.js.map +0 -1
- package/server/dist/features/auth/http/pages.js.map +0 -1
- package/server/dist/features/auth/service.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.field.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.query.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.type-defs.js.map +0 -1
- package/server/dist/features/cache/graphql/index.js.map +0 -1
- package/server/dist/features/image/graphql/image.field.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.mutation.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.query.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.type-defs.js.map +0 -1
- package/server/dist/features/image/graphql/index.js.map +0 -1
- package/server/dist/features/image/http/upload.js.map +0 -1
- package/server/dist/features/image/services/delete.js.map +0 -1
- package/server/dist/features/image/services/upload.js.map +0 -1
- package/server/dist/features/image/services/validation.js.map +0 -1
- package/server/dist/features/mcp-admin/http/handlers.js.map +0 -1
- package/server/dist/features/mcp-admin/service.js.map +0 -1
- package/server/dist/features/note/graphql/index.js.map +0 -1
- package/server/dist/features/note/graphql/note.field.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.query.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.type-defs.js.map +0 -1
- package/server/dist/features/note/http/mcp.js.map +0 -1
- package/server/dist/features/note/services/authoring.js.map +0 -1
- package/server/dist/features/note/services/cleanup.js.map +0 -1
- package/server/dist/features/note/services/content-blocks.js.map +0 -1
- package/server/dist/features/note/services/markdown-intent-write.js.map +0 -1
- package/server/dist/features/note/services/markdown-patch.js.map +0 -1
- package/server/dist/features/note/services/properties.js.map +0 -1
- package/server/dist/features/note/services/search-backfill.js.map +0 -1
- package/server/dist/features/note/services/search.js.map +0 -1
- package/server/dist/features/note/services/snapshot.js.map +0 -1
- package/server/dist/features/note/services/tag-filter.js.map +0 -1
- package/server/dist/features/note/services/trash.js.map +0 -1
- package/server/dist/features/note/services/write-conflict.js.map +0 -1
- package/server/dist/features/note/services/write.js.map +0 -1
- package/server/dist/features/placeholder/graphql/index.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js.map +0 -1
- package/server/dist/features/reminder/graphql/index.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.type-defs.js.map +0 -1
- package/server/dist/features/tag/graphql/index.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.field.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.type-defs.js.map +0 -1
- package/server/dist/features/tag/http/mcp.js.map +0 -1
- package/server/dist/features/tag/services/organization.js.map +0 -1
- package/server/dist/features/view/graphql/index.js.map +0 -1
- package/server/dist/features/view/graphql/view.mutation.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.query.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.type-defs.js.map +0 -1
- package/server/dist/features/view/services/workspace.js.map +0 -1
- package/server/dist/main.js.map +0 -1
- package/server/dist/models.js.map +0 -1
- package/server/dist/modules/app-version.js.map +0 -1
- package/server/dist/modules/auth-guard.js.map +0 -1
- package/server/dist/modules/auth-mode.js.map +0 -1
- package/server/dist/modules/auth-redirect.js.map +0 -1
- package/server/dist/modules/blocknote-tree.js.map +0 -1
- package/server/dist/modules/blocknote.js.map +0 -1
- package/server/dist/modules/data-maintenance.js.map +0 -1
- package/server/dist/modules/error-handler.js.map +0 -1
- package/server/dist/modules/graphql.js.map +0 -1
- package/server/dist/modules/logger.js.map +0 -1
- package/server/dist/modules/mcp-auth.js.map +0 -1
- package/server/dist/modules/mcp-token.js.map +0 -1
- package/server/dist/modules/prisma-runtime.js.map +0 -1
- package/server/dist/modules/rate-limit.js.map +0 -1
- package/server/dist/modules/recovery-retention.js.map +0 -1
- package/server/dist/modules/server-events-handler.js.map +0 -1
- package/server/dist/modules/server-events.js.map +0 -1
- package/server/dist/modules/session-store.js.map +0 -1
- package/server/dist/modules/use-async.js.map +0 -1
- package/server/dist/paths.js.map +0 -1
- package/server/dist/routes/api.js.map +0 -1
- package/server/dist/routes/auth-pages.js.map +0 -1
- package/server/dist/routes/client.js.map +0 -1
- package/server/dist/routes/graphql.js.map +0 -1
- package/server/dist/routes/index.js.map +0 -1
- package/server/dist/routes/mcp.js.map +0 -1
- package/server/dist/schema/index.js.map +0 -1
- package/server/dist/start.js.map +0 -1
- package/server/dist/types/index.js.map +0 -1
- package/server/dist/types/input.js.map +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import{g as yp,r as C,R as mc,a as za,j as O,w as wA,b as St,c as kA,d as NE,e as Pr,u as AA,f as Kl,h as eh,o as IE,i as vA,k as mu,s as Ep,l as q0,m as Yo,n as RE,p as _A}from"./floating-ui.react-dom-wWLZ1CdM.js";const xs=new WeakMap,Gl=new WeakMap,gu={current:[]};let Af=!1;const ml=new Set,Y0=new Map;function ME(t){const e=Array.from(t).sort((n,r)=>n instanceof Ss&&n.options.deps.includes(r)?1:r instanceof Ss&&r.options.deps.includes(n)?-1:0);for(const n of e){if(gu.current.includes(n))continue;gu.current.push(n),n.recompute();const r=Gl.get(n);if(r)for(const i of r){const s=xs.get(i);s&&ME(s)}}}function NA(t){const e={prevVal:t.prevState,currentVal:t.state};for(const n of t.listeners)n(e)}function IA(t){const e={prevVal:t.prevState,currentVal:t.state};for(const n of t.listeners)n(e)}function RA(t){if(ml.add(t),!Af)try{for(Af=!0;ml.size>0;){const e=Array.from(ml);ml.clear();for(const n of e){const r=Y0.get(n)??n.prevState;n.prevState=r,NA(n)}for(const n of e){const r=xs.get(n);r&&(gu.current.push(n),ME(r))}for(const n of e){const r=xs.get(n);if(r)for(const i of r)IA(i)}}}finally{Af=!1,gu.current=[],Y0.clear()}}function MA(t){return typeof t=="function"}class K0{constructor(e,n){this.listeners=new Set,this.subscribe=r=>{var i,s;this.listeners.add(r);const o=(s=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:s.call(i,r,this);return()=>{this.listeners.delete(r),o?.()}},this.prevState=e,this.state=e,this.options=n}setState(e){var n,r,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(e):MA(e)?this.state=e(this.prevState):this.state=e,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),RA(this)}}class Ss{constructor(e){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=this.options.deps.length,r=new Array(n),i=new Array(n);for(let s=0;s<n;s++){const o=this.options.deps[s];r[s]=o.prevState,i[s]=o.state}return this.lastSeenDepValues=i,{prevDepVals:r,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const s of this.options.deps)s instanceof Ss&&s.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let s=0;s<i.length;s++)if(i[s]!==r[s]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,i;this.listeners.add(n);const s=(i=(r=this.options).onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),s?.()}},this.options=e,this.state=e.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(e=this.options.deps){for(const n of e)if(n instanceof Ss)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof K0){let r=xs.get(n);r||(r=new Set,xs.set(n,r)),r.add(this);let i=Gl.get(this);i||(i=new Set,Gl.set(this,i)),i.add(n)}}unregisterFromGraph(e=this.options.deps){for(const n of e)if(n instanceof Ss)this.unregisterFromGraph(n.options.deps);else if(n instanceof K0){const r=xs.get(n);r&&r.delete(this);const i=Gl.get(this);i&&i.delete(n)}}}function Et(t){this.content=t}Et.prototype={constructor:Et,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Et(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Et(n)},addToStart:function(t,e){return new Et([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Et(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Et(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Et.from(t),t.size?new Et(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Et.from(t),t.size?new Et(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Et.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Et.from=function(t){if(t instanceof Et)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Et(e)};function OE(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=OE(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function DE(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,c=Math.min(o.text.length,a.text.length);for(;u<c&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=DE(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class q{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new q(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new q(r,i)}cutByIndex(e,n){return e==n?q.empty:e==0&&n==this.content.length?this:new q(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new q(i,s)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return OE(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return DE(this,e,n,r)}findIndex(e){if(e==0)return gl(0,e);if(e==this.size)return gl(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?gl(n+1,s):gl(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return q.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new q(n||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const vf={index:0,offset:0};function gl(t,e){return vf.index=t,vf.offset=e,vf}function bu(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!bu(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!bu(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let He=class th{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&bu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return th.none;if(e instanceof th)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};He.none=[];class yu extends Error{}class ee{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=PE(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new ee(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ee(LE(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ee.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ee(q.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new ee(e,r,i)}}ee.empty=new ee(q.empty,0,0);function LE(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(LE(s.content,e-i-1,n-i-1)))}function PE(t,e,n,r,i,s){let{index:o,offset:a}=t.findIndex(e),l=t.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=PE(l.content,e-a-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,l);return u&&t.replaceChild(o,l.copy(u))}function OA(t,e,n){if(n.openStart>t.depth)throw new yu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new yu("Inconsistent open depths");return BE(t,e,n,0)}function BE(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=BE(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Ii(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=DA(n,t);return Ii(s,HE(t,o,a,e,r))}else return Ii(s,Eu(t,e,r))}function FE(t,e){if(!e.type.compatibleContent(t.type))throw new yu("Cannot join "+e.type.name+" onto "+t.type.name)}function nh(t,e,n){let r=t.node(n);return FE(r,e.node(n)),r}function Ni(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ko(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Ni(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Ni(i.child(a),r);e&&e.depth==n&&e.textOffset&&Ni(e.nodeBefore,r)}function Ii(t,e){return t.type.checkContent(e),t.copy(e)}function HE(t,e,n,r,i){let s=t.depth>i&&nh(t,e,i+1),o=r.depth>i&&nh(n,r,i+1),a=[];return Ko(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(FE(s,o),Ni(Ii(s,HE(t,e,n,r,i+1)),a)):(s&&Ni(Ii(s,Eu(t,e,i+1)),a),Ko(e,n,i,a),o&&Ni(Ii(o,Eu(n,r,i+1)),a)),Ko(r,null,i,a),new q(a)}function Eu(t,e,n){let r=[];if(Ko(null,t,n,r),t.depth>n){let i=nh(t,e,n+1);Ni(Ii(i,Eu(t,e,n+1)),r)}return Ko(e,null,n,r),new q(r)}function DA(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(q.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class da{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return He.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Tu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new da(n,r,s)}static resolveCached(e,n){let r=G0.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else G0.set(e,r=new LA);let i=r.elts[r.i]=da.resolve(e,n);return r.i=(r.i+1)%PA,i}}class LA{constructor(){this.elts=[],this.i=0}}const PA=12,G0=new WeakMap;class Tu{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 BA=Object.create(null);let ni=class rh{constructor(e,n,r,i=He.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&bu(this.attrs,n||e.defaultAttrs||BA)&&He.sameSet(this.marks,r||He.none)}copy(e=null){return e==this.content?this:new rh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new rh(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ee.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new ee(u,i.depth-o,s.depth-o)}replace(e,n,r){return OA(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return da.resolveCached(this,e)}resolveNoCache(e){return da.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),UE(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=q.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=He.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!He.sameSet(e,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 e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=q.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};ni.prototype.text=void 0;class Cu extends ni{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):UE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Cu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Cu(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function UE(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Pi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new FA(e,n);if(r.next==null)return Pi.empty;let i=$E(r);r.next&&r.err("Unexpected trailing text");let s=WA(jA(i));return qA(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return q.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:f}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=s(f,a.concat(c));if(d)return d}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
2
|
+
`)}}Pi.empty=new Pi(!0);class FA{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $E(t){let e=[];do e.push(HA(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function HA(t){let e=[];do e.push(UA(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function UA(t){let e=zA(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=$A(t,e);else break;return e}function X0(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function $A(t,e){let n=X0(t),r=n;return t.eat(",")&&(t.next!="}"?r=X0(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function VA(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function zA(t){if(t.eat("(")){let e=$E(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=VA(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jA(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let c=n();i(s(o.expr,l),c),l=c}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=n();r(l,c),i(s(o.expr,l),c),l=c}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function VE(t,e){return e-t}function Q0(t,e){let n=[];return r(e),n.sort(VE);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function WA(t){let e=Object.create(null);return n(Q0(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<i.length;c++)i[c][0]==a&&(u=i[c][1]);Q0(t,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[r.join(",")]=new Pi(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(VE);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function qA(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function zE(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function jE(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function WE(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function qE(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new KA(t,r,e[r]);return n}let Z0=class YE{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=qE(e,r.attrs),this.defaultAttrs=zE(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Pi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jE(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ni(this,this.computeAttrs(e),q.from(n),He.setFrom(r))}createChecked(e=null,n,r){return n=q.from(n),this.checkContent(n),new ni(this,this.computeAttrs(e),n,He.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=q.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(q.empty,!0);return s?new ni(this,e,n.append(s),He.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){WE(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:He.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new YE(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function YA(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class KA{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?YA(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class gc{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=qE(e,i.attrs),this.excluded=null;let s=zE(this.attrs);this.instance=s?new He(this,s):null}create(e=null){return!e&&this.instance?this.instance:new He(this,jE(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new gc(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){WE(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let KE=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Et.from(e.nodes),n.marks=Et.from(e.marks||{}),this.nodes=Z0.compile(this.spec.nodes,this),this.marks=gc.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Pi.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?J0(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:J0(this,o.split(" "))}this.nodeFromJSON=i=>ni.fromJSON(this,i),this.markFromJSON=i=>He.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Z0){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Cu(r,r.defaultAttrs,e,He.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function J0(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function GA(t){return t.tag!=null}function XA(t){return t.style!=null}let Go=class ih{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(GA(i))this.tags.push(i);else if(XA(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new tg(this,n,!1);return r.addAll(e,He.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new tg(this,n,!0);return r.addAll(e,He.none,n.from,n.to),ee.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(JA(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ng(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ng(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ih(e,ih.schemaRules(e)))}};const GE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},QA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},XE={ol:!0,ul:!0},ha=1,sh=2,Xo=4;function eg(t,e,n){return e!=null?(e?ha:0)|(e==="full"?sh:0):t&&t.whitespace=="pre"?ha|sh:n&~Xo}class bl{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=He.none,this.match=s||(o&Xo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(q.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ha)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=q.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(q.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!GE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class tg{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=eg(null,n.preserveWhitespace,0)|(r?Xo:0);i?s=new bl(i.type,i.attrs,He.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new bl(null,null,He.none,!0,null,o):s=new bl(e.schema.topNodeType,null,He.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&sh?"full":this.localPreserveWS||(i.options&ha)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;XE.hasOwnProperty(o)&&this.parser.normalizeLists&&ZA(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:QA.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(GE.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=He.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):rg(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=eg(e,s,o.options);o.options&Xo&&o.content.length==0&&(a|=Xo);let l=He.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):rg(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new bl(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!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(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ha)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function ZA(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&XE.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function JA(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ng(t){let e={};for(let n in t)e[n]=t[n];return e}function rg(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class Ki{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=yl(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,n);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return yl(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Xl(yl(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Xl(yl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Xl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ki(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=ig(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return ig(e.marks)}}function ig(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function yl(t){return t.document||window.document}const sg=new WeakMap;function e3(t){let e=sg.get(t);return e===void 0&&sg.set(t,e=t3(t)),e}function t3(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Xl(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=e3(r))&&s.indexOf(e)>-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=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof d=="string")l.appendChild(t.createTextNode(d));else{let{dom:h,contentDOM:p}=Xl(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const QE=65535,ZE=Math.pow(2,16);function n3(t,e){return t+e*ZE}function og(t){return t&QE}function r3(t){return(t-(t&QE))/ZE}const JE=1,e2=2,Ql=4,t2=8;class oh{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&t2)>0}get deletedBefore(){return(this.delInfo&(JE|Ql))>0}get deletedAfter(){return(this.delInfo&(e2|Ql))>0}get deletedAcross(){return(this.delInfo&Ql)>0}}class pn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&pn.empty)return pn.empty}recover(e){let n=0,r=og(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+r3(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],c=this.ranges[a+o],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:n3(a/3,e-l),g=e==l?e2:e==f?JE:Ql;return(n<0?e!=l:e!=f)&&(g|=t2),new oh(h,g,p)}i+=c-u}return r?e+i:new oh(e+i,0,null)}touches(e,n){let r=0,i=og(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],c=this.ranges[i+r];e(a,a+u,l,l+c),s+=c-u}}invert(){return new pn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?pn.empty:new pn(e<0?[0,-e,0]:[0,0,e])}}pn.empty=new pn([]);class pa{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new pa(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new pa;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new oh(e,i,null)}}const _f=Object.create(null);class Mt{getMap(){return pn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=_f[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in _f)throw new RangeError("Duplicate use of step JSON ID "+e);return _f[e]=n,n.prototype.jsonID=e,n}}class it{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new it(e,null)}static fail(e){return new it(null,e)}static fromReplace(e,n,r,i){try{return it.ok(e.replace(n,r,i))}catch(s){if(s instanceof yu)return it.fail(s.message);throw s}}}function Tp(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Tp(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return q.fromArray(r)}class Xr extends Mt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new ee(Tp(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return it.fromReplace(e,this.from,this.to,s)}invert(){return new Bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Xr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Xr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Xr(n.from,n.to,e.markFromJSON(n.mark))}}Mt.jsonID("addMark",Xr);class Bn extends Mt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ee(Tp(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return it.fromReplace(e,this.from,this.to,r)}invert(){return new Xr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bn(n.from,n.to,e.markFromJSON(n.mark))}}Mt.jsonID("removeMark",Bn);class Qr extends Mt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return it.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return it.fromReplace(e,this.pos,this.pos+1,new ee(q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Qr(this.pos,n.marks[i]);return new Qr(this.pos,this.mark)}}return new Bi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qr(n.pos,e.markFromJSON(n.mark))}}Mt.jsonID("addNodeMark",Qr);class Bi extends Mt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return it.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return it.fromReplace(e,this.pos,this.pos+1,new ee(q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Qr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Bi(n.pos,e.markFromJSON(n.mark))}}Mt.jsonID("removeNodeMark",Bi);class rt extends Mt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ah(e,this.from,this.to)?it.fail("Structure replace would overwrite content"):it.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new pn([this.from,this.to-this.from,this.slice.size])}invert(e){return new rt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&rt.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new rt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof rt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ee.empty:new ee(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ee.empty:new ee(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new rt(n.from,n.to,ee.fromJSON(e,n.slice),!!n.structure)}}rt.MAP_BIAS=1;Mt.jsonID("replace",rt);class pt extends Mt{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(ah(e,this.from,this.gapFrom)||ah(e,this.gapTo,this.to)))return it.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return it.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?it.fromReplace(e,this.from,this.to,r):it.fail("Content does not fit in gap")}getMap(){return new pn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new pt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new pt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 pt(n.from,n.to,n.gapFrom,n.gapTo,ee.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mt.jsonID("replaceAround",pt);function ah(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function i3(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,n),p=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(p)||(o&&o.to==d&&o.mark.eq(f[g])?o.to=h:i.push(o=new Bn(d,h,f[g])));a&&a.to==d?a.to=h:s.push(a=new Xr(d,h,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function s3(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof gc){let u=o.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=u,d.step=s):i.push({style:f,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new Bn(o.from,o.to,o.style)))}function Cp(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),c=a+u.nodeSize,f=r.matchType(u.type);if(!f)o.push(new rt(a,c,ee.empty));else{r=f;for(let d=0;d<u.marks.length;d++)n.allowsMarkType(u.marks[d].type)||t.step(new Bn(a,c,u.marks[d]));if(i&&u.isText&&n.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(u.text);)p||(p=new ee(q.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new rt(a+d.index,a+d.index+d[0].length,p))}}a=c}if(!r.validEnd){let l=r.fillBefore(q.empty,!0);t.replace(a,a,new ee(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function o3(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function oo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!o3(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function a3(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,c=q.empty,f=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,c=q.from(r.node(p).copy(c)),f++):l--;let d=q.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,d=q.from(i.node(p).copy(d)),h++):u++;t.step(new pt(l,u,o,a,new ee(c.append(d),f,h),c.size-f,!0))}function n2(t,e,n=null,r=t){let i=l3(t,e),s=i&&u3(r,e);return s?i.map(ag).concat({type:e,attrs:n}).concat(s.map(ag)):null}function ag(t){return{type:t,attrs:null}}function l3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function u3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function c3(t,e,n){let r=q.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=q.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new pt(i,s,i,s,new ee(r,0,0),n.length,!0))}function f3(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&d3(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?u=!1:!h&&p&&(u=!0)}u===!1&&i2(t,o,a,s),Cp(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let c=t.mapping.slice(s),f=c.map(a,1),d=c.map(a+o.nodeSize,1);return t.step(new pt(f,d,f+1,d-1,new ee(q.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&r2(t,o,a,s),!1}})}function r2(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function i2(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
5
|
+
`))}})}function d3(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function h3(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new pt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new ee(q.from(o),0,0),1,!0))}function Nr(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>s;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!g.type.validContent(h))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function p3(t,e,n=1,r){let i=t.doc.resolve(e),s=q.empty,o=q.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=q.from(i.node(a).copy(s));let c=r&&r[u];o=q.from(c?c.type.create(c.attrs,o):i.node(a).copy(o))}t.step(new rt(e,e,new ee(s.append(o),n,n),!0))}function Gi(t,e){let n=t.resolve(e),r=n.index();return s2(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function m3(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function s2(t,e){return!!(t&&e&&!t.isLeaf&&m3(t,e))}function bc(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&s2(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function g3(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",f=!!o.contentMatch.matchType(i);c&&!f?r=!1:!c&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);i2(t,c.node(),c.before(),a)}o.inlineContent&&Cp(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new rt(u,l.map(e+n,-1),ee.empty,!0)),r===!0){let c=t.doc.resolve(u);r2(t,c.node(),c.before(),t.steps.length)}return t}function b3(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function y3(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),c=!1;if(s==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function yc(t,e,n=e,r=ee.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return o2(i,s,r)?new rt(e,n,r):new E3(i,s,r).fit()}function o2(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class E3{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=q.from(e.node(i).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 e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new ee(s,o,a);return e>-1?new pt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new rt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Nf(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(o?u.matchType(o.type)||(f=u.fillBefore(q.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Nf(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ee(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Nf(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new ee(Vo(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new ee(Vo(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,c=[],{match:f,type:d}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)c.push(i.child(g));f=f.matchFragment(i)}let h=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let g=a.child(u),b=f.matchType(g.type);if(!b)break;u++,(u>1||l==0||g.content.size)&&(f=b,c.push(a2(g.mark(d.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=zo(this.placed,n,q.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=p?e==0?ee.empty:new ee(Vo(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new ee(Vo(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!If(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=If(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=If(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zo(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=zo(this.placed,this.depth,q.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=zo(this.placed,this.frontier.length,n))}}function Vo(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Vo(t.firstChild.content,e-1,n)))}function zo(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zo(t.lastChild.content,e-1,n)))}function Nf(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function a2(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,a2(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),t.copy(r)}function If(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!T3(n,s.content,o)?a:null}function T3(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function C3(t){return t.spec.defining||t.spec.definingForContent}function x3(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(o2(i,s,r))return t.step(new rt(e,n,r));let o=u2(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(d)>-1?a=d:i.before(d)==h&&o.splice(1,0,-d)}let l=o.indexOf(a),u=[],c=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==r.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=C3(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+c+1)%(r.openStart+1),p=u[h];if(p)for(let g=0;g<o.length;g++){let b=o[(g+l)%o.length],y=!0;b<0&&(y=!1,b=-b);let E=i.node(b-1),T=i.index(b-1);if(E.canReplaceWith(T,T,p.type,p.marks))return t.replace(i.before(b),y?s.after(b):n,new ee(l2(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let d=o.length-1;d>=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=o[d];h<0||(e=i.before(h),n=s.after(h))}}function l2(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(l2(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(q.empty,!0))}return t}function S3(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=b3(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ee(q.from(r),0,0))}function w3(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=u2(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function u2(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class ws extends Mt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return it.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return it.fromReplace(e,this.pos,this.pos+1,new ee(q.from(i),0,n.isLeaf?0:1))}getMap(){return pn.empty}invert(e){return new ws(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ws(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ws(n.pos,n.attr,n.value)}}Mt.jsonID("attr",ws);class ma extends Mt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return it.ok(r)}getMap(){return pn.empty}invert(e){return new ma(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ma(n.attr,n.value)}}Mt.jsonID("docAttr",ma);let Fs=class extends Error{};Fs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Fs.prototype=Object.create(Error.prototype);Fs.prototype.constructor=Fs;Fs.prototype.name="TransformError";class xp{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pa}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Fs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ee.empty){let i=yc(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new ee(q.from(r),0,0))}delete(e,n){return this.replace(e,n,ee.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return x3(this,e,n,r),this}replaceRangeWith(e,n,r){return S3(this,e,n,r),this}deleteRange(e,n){return w3(this,e,n),this}lift(e,n){return a3(this,e,n),this}join(e,n=1){return g3(this,e,n),this}wrap(e,n){return c3(this,e,n),this}setBlockType(e,n=e,r,i=null){return f3(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return h3(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ws(e,n,r)),this}setDocAttribute(e,n){return this.step(new ma(e,n)),this}addNodeMark(e,n){return this.step(new Qr(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof He)n.isInSet(r.marks)&&this.step(new Bi(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Bi(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return p3(this,e,n,r),this}addMark(e,n,r){return i3(this,e,n,r),this}removeMark(e,n,r){return s3(this,e,n,r),this}clearIncompatible(e,n,r){return Cp(this,e,n,r),this}}const Rf=Object.create(null);class he{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new c2(e.min(n),e.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 e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ee.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],c=e.mapping.slice(s);e.replaceRange(c.map(l.pos),c.map(u.pos),a?ee.empty:n),a==0&&cg(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),c=l.map(a.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),cg(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new fe(e):ps(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?ps(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):ps(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new tn(e.node(0))}static atStart(e){return ps(e,e,0,0,1)||new tn(e)}static atEnd(e){return ps(e,e,e.content.size,e.childCount,-1)||new tn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Rf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Rf)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return fe.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class c2{constructor(e,n){this.$from=e,this.$to=n}}let lg=!1;function ug(t){!lg&&!t.parent.inlineContent&&(lg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class fe extends he{constructor(e,n=e){ug(e),ug(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return he.near(r);let i=e.resolve(n.map(this.anchor));return new fe(i.parent.inlineContent?i:r,r)}replace(e,n=ee.empty){if(super.replace(e,n),n==ee.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof fe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ec(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new fe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=he.findFrom(n,r,!0)||he.findFrom(n,-r,!0);if(s)n=s.$head;else return he.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(he.findFrom(e,-r,!0)||he.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new fe(e,n)}}he.jsonID("text",fe);class Ec{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ec(e.map(this.anchor),e.map(this.head))}resolve(e){return fe.between(e.resolve(this.anchor),e.resolve(this.head))}}class ae extends he{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?he.near(s):new ae(s)}content(){return new ee(q.from(this.node),0,0)}eq(e){return e instanceof ae&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Sp(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ae(e.resolve(n.anchor))}static create(e,n){return new ae(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ae.prototype.visible=!1;he.jsonID("node",ae);class Sp{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ec(r,r):new Sp(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ae.isSelectable(r)?new ae(n):he.near(n)}}class tn extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ee.empty){if(n==ee.empty){e.delete(0,e.doc.content.size);let r=he.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new tn(e)}map(e){return new tn(e)}eq(e){return e instanceof tn}getBookmark(){return k3}}he.jsonID("all",tn);const k3={map(){return this},resolve(t){return new tn(t)}};function ps(t,e,n,r,i,s=!1){if(e.inlineContent)return fe.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ae.isSelectable(a))return ae.create(t,n-(i<0?a.nodeSize:0))}else{let l=ps(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function cg(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof rt||i instanceof pt))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,c)=>{o==null&&(o=c)}),t.setSelection(he.near(t.doc.resolve(o),n))}const fg=1,El=2,dg=4;let A3=class extends xp{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|fg)&~El,this.storedMarks=null,this}get selectionSet(){return(this.updated&fg)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=El,this}ensureMarks(e){return He.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&El)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~El,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||He.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(he.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=dg,this}get scrolledIntoView(){return(this.updated&dg)>0}};function hg(t,e){return!e||!t?t:t.bind(e)}class jo{constructor(e,n,r){this.name=e,this.init=hg(n.init,r),this.apply=hg(n.apply,r)}}const v3=[new jo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new jo("selection",{init(t,e){return t.selection||he.atStart(e.doc)},apply(t){return t.selection}}),new jo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new jo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Mf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v3.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new jo(r.key,r.spec.state,r))})}}class Es{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(c&&r.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<o?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Es(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new A3(this)}static create(e){let n=new Mf(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Es(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Mf(this.schema,e.plugins),r=n.fields,i=new Es(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Mf(e.schema,e.plugins),s=new Es(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=ni.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=he.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function f2(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=f2(i,e,{})),n[r]=i}return n}class ot{constructor(e){this.spec=e,this.props={},e.props&&f2(e.props,this,this.props),this.key=e.key?e.key.key:d2("plugin")}getState(e){return e[this.key]}}const Of=Object.create(null);function d2(t){return t in Of?t+"$"+ ++Of[t]:(Of[t]=0,t+"$")}class wt{constructor(e="key"){this.key=d2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const wp=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function h2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const p2=(t,e,n)=>{let r=h2(t,n);if(!r)return!1;let i=kp(r);if(!i){let o=r.blockRange(),a=o&&oo(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(S2(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Hs(s,"end")||ae.isSelectable(s)))for(let o=r.depth;;o--){let a=yc(t.doc,r.before(o),r.after(o),ee.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Hs(s,"end")?he.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ae.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},_3=(t,e,n)=>{let r=h2(t,n);if(!r)return!1;let i=kp(r);return i?m2(t,i,e):!1},N3=(t,e,n)=>{let r=b2(t,n);if(!r)return!1;let i=Ap(r);return i?m2(t,i,e):!1};function m2(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=yc(t.doc,s,l,ee.empty);if(!u||u.from!=s||u instanceof rt&&u.slice.size>=l-s)return!1;if(n){let c=t.tr.step(u);c.setSelection(fe.create(c.doc,s)),n(c.scrollIntoView())}return!0}function Hs(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const g2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=kp(r)}let o=s&&s.nodeBefore;return!o||!ae.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function kp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function b2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const y2=(t,e,n)=>{let r=b2(t,n);if(!r)return!1;let i=Ap(r);if(!i)return!1;let s=i.nodeAfter;if(S2(t,i,e,1))return!0;if(r.parent.content.size==0&&(Hs(s,"start")||ae.isSelectable(s))){let o=yc(t.doc,r.before(),r.after(),ee.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Hs(s,"start")?he.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ae.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},E2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Ap(r)}let o=s&&s.nodeAfter;return!o||!ae.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,s.pos)).scrollIntoView()),!0)};function Ap(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const I3=(t,e)=>{let n=t.selection,r=n instanceof ae,i;if(r){if(n.node.isTextblock||!Gi(t.doc,n.from))return!1;i=n.from}else if(i=bc(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ae.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},R3=(t,e)=>{let n=t.selection,r;if(n instanceof ae){if(n.node.isTextblock||!Gi(t.doc,n.to))return!1;r=n.to}else if(r=bc(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},M3=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&oo(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},T2=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
6
|
+
`).scrollIntoView()),!0)};function vp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const O3=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=vp(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(he.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},C2=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof tn||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=vp(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(fe.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},x2=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Nr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&oo(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function D3(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!r.parentOffset||!Nr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),u=r.start(h)==r.pos-(r.depth-h),a=vp(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),s.unshift(l&&a?{type:a}:null),o=h;break}else{if(h==1)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof fe||e.selection instanceof tn)&&c.deleteSelection();let f=c.mapping.map(r.pos),d=Nr(c.doc,f,s.length,s);if(d||(s[0]=a?{type:a}:null,d=Nr(c.doc,f,s.length,s)),!d)return!1;if(c.split(f,s.length,s),!l&&u&&r.node(o).type!=a){let h=c.mapping.map(r.before(o)),p=c.doc.resolve(h);a&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,a)&&c.setNodeMarkup(c.mapping.map(r.before(o)),a)}return n&&n(c.scrollIntoView()),!0}}const L3=D3(),P3=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ae.create(t.doc,i))),!0)};function B3(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Gi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function S2(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&B3(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let h=e.pos+s.nodeSize,p=q.empty;for(let y=o.length-1;y>=0;y--)p=q.from(o[y].create(null,p));p=q.from(i.copy(p));let g=t.tr.step(new pt(e.pos-1,h,e.pos,h,new ee(p,1,0),o.length,!0)),b=g.doc.resolve(h+2*o.length);b.nodeAfter&&b.nodeAfter.type==i.type&&Gi(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let c=s.type.spec.isolating||r>0&&l?null:he.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),d=f&&oo(f);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(f,d).scrollIntoView()),!0;if(u&&Hs(s,"start",!0)&&Hs(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=s,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=q.empty;for(let T=p.length-1;T>=0;T--)y=q.from(p[T].copy(y));let E=t.tr.step(new pt(e.pos-p.length,e.pos+s.nodeSize,e.pos+b,e.pos+s.nodeSize-b,new ee(y,p.length,0),0,!0));n(E.scrollIntoView())}return!0}}return!1}function w2(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(fe.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const F3=w2(-1),H3=w2(1);function U3(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&n2(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function pg(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function _p(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}_p(wp,p2,g2);_p(wp,y2,E2);_p(T2,C2,x2,L3);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $3(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return V3(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function V3(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new Tu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Tu(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=n2(s,n,r,e);return a?(t&&z3(t,e,a,i,n),!0):!1}function z3(t,e,n,r,i){let s=q.empty;for(let c=n.length-1;c>=0;c--)s=q.from(n[c].type.create(n[c].attrs,s));t.step(new pt(e.start-(r?2:0),e.end,e.start,e.end,new ee(s,0,0),n.length,!0));let o=0;for(let c=0;c<n.length;c++)n[c].type==i&&(o=c+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let c=e.startIndex,f=e.endIndex,d=!0;c<f;c++,d=!1)!d&&Nr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function j3(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?W3(e,n,t,s):q3(e,n,s):!0:!1}}function W3(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new pt(s-1,o,s,o,new ee(q.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Tu(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=oo(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Gi(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function q3(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(a?0:1),c+1,o.content.append(l?q.empty:q.from(i))))return!1;let f=s.pos,d=f+o.nodeSize;return r.step(new pt(f-(a?1:0),d+(l?1:0),f+1,d-1,new ee((a?q.empty:q.from(i.copy(q.empty))).append(l?q.empty:q.from(i.copy(q.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Y3(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=q.from(u?t.create():null),f=new ee(q.from(t.create(null,q.from(a.type.create(null,c)))),u?3:1,0),d=s.start,h=s.end;n(e.tr.step(new pt(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}const Tt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Us=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let lh=null;const wr=function(t,e,n){let r=lh||(lh=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},K3=function(){lh=null},Fi=function(t,e,n,r){return n&&(mg(t,e,n,r,-1)||mg(t,e,n,r,1))},G3=/^(img|br|input|textarea|hr)$/i;function mg(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:vn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ja(t)||G3.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?vn(t):0}else return!1}}function vn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function X3(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=vn(t)}else if(t.parentNode&&!ja(t))e=Tt(t),t=t.parentNode;else return null}}function Q3(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ja(t))e=Tt(t)+1,t=t.parentNode;else return null}}function Z3(t,e,n){for(let r=e==0,i=e==vn(t);r||i;){if(t==n)return!0;let s=Tt(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==vn(t)}}function ja(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tc=function(t){return t.focusNode&&Fi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function wi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function J3(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ev(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(vn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(vn(r.startContainer),r.startOffset)}}}const ur=typeof navigator<"u"?navigator:null,gg=typeof document<"u"?document:null,pi=ur&&ur.userAgent||"",uh=/Edge\/(\d+)/.exec(pi),k2=/MSIE \d/.exec(pi),ch=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pi),nn=!!(k2||ch||uh),ri=k2?document.documentMode:ch?+ch[1]:uh?+uh[1]:0,In=!nn&&/gecko\/(\d+)/i.test(pi);In&&+(/Firefox\/(\d+)/.exec(pi)||[0,0])[1];const fh=!nn&&/Chrome\/(\d+)/.exec(pi),xt=!!fh,A2=fh?+fh[1]:0,It=!nn&&!!ur&&/Apple Computer/.test(ur.vendor),$s=It&&(/Mobile\/\w+/.test(pi)||!!ur&&ur.maxTouchPoints>2),wn=$s||(ur?/Mac/.test(ur.platform):!1),v2=ur?/Win/.test(ur.platform):!1,Ar=/Android \d/.test(pi),Wa=!!gg&&"webkitFontSmoothing"in gg.documentElement.style,tv=Wa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nv(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Cr(t,e){return typeof t=="number"?t:t[e]}function rv(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function bg(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=Us(o);continue}let a=o,l=a==s.body,u=l?nv(s):rv(a),c=0,f=0;if(e.top<u.top+Cr(r,"top")?f=-(u.top-e.top+Cr(i,"top")):e.bottom>u.bottom-Cr(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Cr(i,"top")-u.top:e.bottom-u.bottom+Cr(i,"bottom")),e.left<u.left+Cr(r,"left")?c=-(u.left-e.left+Cr(i,"left")):e.right>u.right-Cr(r,"right")&&(c=e.right-u.right+Cr(i,"right")),c||f)if(l)s.defaultView.scrollBy(c,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),c&&(a.scrollLeft+=c);let g=a.scrollLeft-h,b=a.scrollTop-p;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:Us(o)}}function iv(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:_2(t.dom)}}function _2(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Us(r));return e}function sv({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;N2(n,r==0?0:r-e)}function N2(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let rs=null;function ov(t){if(t.setActive)return t.setActive();if(rs)return t.focus(rs);let e=_2(t);t.focus(rs==null?{get preventScroll(){return rs={preventScroll:!0},!0}}:void 0),rs||(rs=!1,N2(e,0))}function I2(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let c=t.firstChild,f=0;c;c=c.nextSibling,f++){let d;if(c.nodeType==1)d=c.getClientRects();else if(c.nodeType==3)d=wr(c).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=o&&p.bottom>=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=c,r=g,i=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,c.nodeType==1&&g&&(s=f+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?av(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:I2(n,i)}function av(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=$r(r,1);if(o.top!=o.bottom&&Np(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function Np(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function lv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function uv(t,e,n){let{node:r,offset:i}=I2(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function cv(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function R2(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(Np(e,u))return R2(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function fv(t,e){let n=t.dom.ownerDocument,r,i=0,s=ev(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!Np(e,u)||(o=R2(t.dom,e,u),!o))return null}if(It)for(let u=o;r&&u;u=Us(u))u.draggable&&(r=void 0);if(o=lv(o,e),r){if(In&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;Wa&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=cv(t,r,i,e))}a==null&&(a=uv(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function yg(t){return t.top<t.bottom||t.left<t.right}function $r(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(yg(r))return r}return Array.prototype.find.call(n,yg)||t.getBoundingClientRect()}const dv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function M2(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Wa||In;if(r.nodeType==3)if(o&&(dv.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=$r(wr(r,i,i),n);if(In&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=$r(wr(r,i-1,i-1),-1);if(u.top==l.top){let c=$r(wr(r,i,i+1),-1);if(c.top!=l.top)return Oo(c,c.left<u.left)}}return l}else{let l=i,u=i,c=n<0?1:-1;return n<0&&!i?(u++,c=-1):n>=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,Oo($r(wr(r,l,u),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==vn(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Df(l.getBoundingClientRect(),!1)}if(s==null&&i<vn(r)){let l=r.childNodes[i];if(l.nodeType==1)return Df(l.getBoundingClientRect(),!0)}return Df(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==vn(r))){let l=r.childNodes[i-1],u=l.nodeType==3?wr(l,vn(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Oo($r(u,1),!1)}if(s==null&&i<vn(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?wr(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return Oo($r(u,-1),!0)}return Oo($r(r.nodeType==3?wr(r):r,-n),n>=0)}function Oo(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Df(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function O2(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function hv(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return O2(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=M2(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=wr(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const pv=/[\u0590-\u08ac]/;function mv(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!pv.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:O2(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),b=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==g;try{a.collapse(c,f),l&&(l!=c||u!=f)&&a.extend&&a.extend(l,u)}catch{}return d!=null&&(a.caretBidiLevel=d),b}):r.pos==r.start()||r.pos==r.end()}let Eg=null,Tg=null,Cg=!1;function gv(t,e,n){return Eg==e&&Tg==n?Cg:(Eg=e,Tg=n,Cg=n=="up"||n=="down"?hv(t,e,n):mv(t,e,n))}const Rn=0,xg=1,Ai=2,cr=3;class qa{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Rn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Tt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof L2){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof D2&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Tt(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Tt(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let c=o+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=o;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Tt(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=Tt(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let g=this.children[h],b=p+g.size;if(s>p&&o<b)return g.setSelection(e-p-g.border,n-p-g.border,r,i);p=b}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),c=r.domSelectionRange(),f=!1;if((In||It)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(f=!!(p&&h.nodeValue[p-1]==`
|
|
7
|
+
`),f&&p==h.nodeValue.length)for(let g=h,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:Tt(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[p-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(In&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&It)&&Fi(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Fi(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((u.extend||e==n)&&!(f&&In)){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Ai:xg,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=cr:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ai:cr}r=o}this.dirty=Ai}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ai:xg;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class D2 extends qa{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Rn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class bv extends qa{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Hi extends qa{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Ki.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Hi(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&cr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=cr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Rn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Rn}}slice(e,n,r){let i=Hi.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=hh(s,n,o,r)),e>0&&(s=hh(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ii extends qa{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=Ki.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=F2(c,r,n),u?l=new yv(e,n,r,i,c,f||null,d,u,s,o+1):n.isText?new Cc(e,n,r,i,c,d,s):new ii(e,n,r,i,c,f||null,d,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>q.empty)}return e}matchesNode(e,n,r){return this.dirty==Rn&&e.eq(this.node)&&xu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new Tv(this,o&&o.node,e);Sv(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,c):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?He.none:this.node.child(c).marks,r,e,c),l.placeWidget(u,e,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,e,d);let h;l.findNodeMatch(u,c,f,d)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(h=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,c,f,h,e)||l.updateNextNode(u,c,f,e,d,i)||l.addNode(u,c,f,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ai)&&(o&&this.protectLocalComposition(e,o),P2(this.contentDOM,this.children,e),$s&&wv(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof fe)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=kv(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new bv(this,s,n,i);e.input.compositionNodes.push(o),this.children=hh(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==cr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Rn}updateOuterDeco(e){if(xu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=B2(this.dom,this.nodeDOM,dh(this.outerDeco,this.node,n),dh(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Sg(t,e,n,r,i){F2(r,e,t);let s=new ii(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Cc extends ii{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==cr||this.dirty!=Rn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Rn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Rn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Cc(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=cr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class L2 extends qa{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Rn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class yv extends ii{constructor(e,n,r,i,s,o,a,l,u,c){super(e,n,r,i,s,o,a,u,c),this.spec=l}update(e,n,r,i){if(this.dirty==cr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function P2(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=wg(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof Hi){let l=r?r.previousSibling:t.lastChild;P2(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=wg(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Qo=function(t){t&&(this.nodeName=t)};Qo.prototype=Object.create(null);const vi=[new Qo];function dh(t,e,n){if(t.length==0)return vi;let r=n?vi[0]:new Qo,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Qo(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Qo(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function B2(t,e,n,r){if(n==vi&&r==vi)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=vi[0]),i=l}Ev(i,a||vi[0],o)}return i}function Ev(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function F2(t,e,n){return B2(t,t,vi,dh(e,n,t.nodeType!=1))}function xu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function wg(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Tv{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Cv(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Rn,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let f=this.top.children[c];if(f.matchesMark(e[o])&&!this.isLocked(f.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=Hi.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==cr&&o.dom==o.contentDOM&&(o.dirty=Ai),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ii){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let c=l.dom,f,d=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=cr&&xu(n,l.outerDeco));if(!d&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Ai,f.updateChildren(i,o+1),f.dirty=Rn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!xu(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=ii.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=ii.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new D2(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Hi;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((It||xt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new L2(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Cv(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Hi)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function xv(t,e){return t.type.side-e.type.side}function Sv(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);r(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let c,f;for(;o<i.length&&i[o].to==s;){let b=i[o++];b.widget&&(c?(f||(f=[c])).push(b):c=b)}if(c)if(f){f.sort(xv);for(let b=0;b<f.length;b++)n(f[b],u,!!l)}else n(c,u,!!l);let d,h;if(l)h=-1,d=l,l=null;else if(u<t.childCount)h=u,d=t.child(u++);else break;for(let b=0;b<a.length;b++)a[b].to<=s&&a.splice(b--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let p=s+d.nodeSize;if(d.isText){let b=p;o<i.length&&i[o].from<b&&(b=i[o].from);for(let y=0;y<a.length;y++)a[y].to<b&&(b=a[y].to);b<p&&(l=d.cut(b-s),d=d.cut(0,b-s),p=b,h=-1)}else for(;o<i.length&&i[o].to<p;)o++;let g=d.isInline&&!d.isLeaf?a.filter(b=>!b.inline):a.slice();r(d,g,e.forChild(s,d),h),s=p}}function wv(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function kv(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function hh(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,c=a+=l.size;u>=n||c<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),c>n&&s.push(l.slice(n-u,l.size,r)))}return s}function Ip(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(Tc(n)){for(l=o;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ae.isSelectable(f)&&i.parent&&!(f.isInline&&Z3(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;u=new ae(o==d?a:r.resolve(d))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=o,d=o;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);f=Math.min(f,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(f<0)return null;[l,o]=d==t.state.selection.anchor?[d,f]:[f,d],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let f=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=Rp(t,c,a,f)}return u}function H2(t){return t.editable?t.hasFocus():$2(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ir(t,e=!1){let n=t.state.selection;if(U2(t,n),!!H2(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&xt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Fi(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)vv(t);else{let{anchor:r,head:i}=n,s,o;kg&&!(n instanceof fe)&&(n.$from.parent.inlineContent||(s=Ag(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ag(t,n.to))),t.docView.setSelection(r,i,t,e),kg&&(s&&vg(s),o&&vg(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Av(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const kg=It||xt&&A2<63;function Ag(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(It&&i&&i.contentEditable=="false")return Lf(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Lf(i);if(s)return Lf(s)}}function Lf(t){return t.contentEditable="true",It&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Av(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!H2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function vv(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Tt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&nn&&ri<=11&&(n.disabled=!0,n.disabled=!1)}function U2(t,e){if(e instanceof ae){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(_g(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else _g(t)}function _g(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Rp(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||fe.between(e,n,r)}function Ng(t){return t.editable&&!t.hasFocus()?!1:$2(t)}function $2(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function _v(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Fi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ph(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&he.findFrom(s,e)}function jr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ig(t,e,n){let r=t.state.selection;if(r instanceof fe)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return jr(t,new fe(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ph(t.state,e);return i&&i instanceof ae?jr(t,i):!1}else if(!(wn&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ae.isSelectable(s)?jr(t,new ae(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Wa?jr(t,new fe(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ae&&r.node.isInline)return jr(t,new fe(e>0?r.$to:r.$from));{let i=ph(t.state,e);return i?jr(t,i):!1}}}function Su(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function is(t,e){return e<0?Nv(t):Iv(t)}function Nv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(In&&n.nodeType==1&&r<Su(n)&&Zo(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Zo(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(V2(n))break;{let a=n.previousSibling;for(;a&&Zo(a,-1);)i=n.parentNode,s=Tt(a),a=a.previousSibling;if(a)n=a,r=Su(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?mh(t,n,r):i&&mh(t,i,s)}function Iv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Su(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Zo(a,1))s=n,o=++r;else break}else{if(V2(n))break;{let a=n.nextSibling;for(;a&&Zo(a,1);)s=a.parentNode,o=Tt(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Su(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&mh(t,s,o)}function V2(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Rv(t,e){for(;t&&e==t.childNodes.length&&!ja(t);)e=Tt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Mv(t,e){for(;t&&!e&&!ja(t);)e=Tt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function mh(t,e,n){if(e.nodeType!=3){let s,o;(o=Rv(e,n))?(e=o,n=0):(s=Mv(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Tc(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ir(t)},50)}function Rg(t,e){let n=t.state.doc.resolve(e);if(!(xt||v2)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Mg(t,e,n){let r=t.state.selection;if(r instanceof fe&&!r.empty||n.indexOf("s")>-1||wn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=ph(t.state,e);if(o&&o instanceof ae)return jr(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof tn?he.near(o,e):he.findFrom(o,e);return a?jr(t,a):!1}return!1}function Og(t,e){if(!(t.state.selection instanceof fe))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Dg(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ov(t){if(!It||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Dg(t,r,"true"),setTimeout(()=>Dg(t,r,"false"),20)}return!1}function Dv(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Lv(t,e){let n=e.keyCode,r=Dv(e);if(n==8||wn&&n==72&&r=="c")return Og(t,-1)||is(t,-1);if(n==46&&!e.shiftKey||wn&&n==68&&r=="c")return Og(t,1)||is(t,1);if(n==13||n==27)return!0;if(n==37||wn&&n==66&&r=="c"){let i=n==37?Rg(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ig(t,i,r)||is(t,i)}else if(n==39||wn&&n==70&&r=="c"){let i=n==39?Rg(t,t.state.selection.from)=="ltr"?1:-1:1;return Ig(t,i,r)||is(t,i)}else{if(n==38||wn&&n==80&&r=="c")return Mg(t,-1,r)||is(t,-1);if(n==40||wn&&n==78&&r=="c")return Ov(t)||Mg(t,1,r)||is(t,1);if(r==(wn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Mp(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||Ki.fromSchema(t.state.schema),a=K2(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=Y2[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=a.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
8
|
+
|
|
9
|
+
`);return{dom:l,text:d,slice:e}}function z2(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,s||r,t)}),s)return a=new ee(q.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
10
|
+
`))),0,0),t.someProp("transformPasted",d=>{a=d(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=Ki.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(p.serializeNode(h.text(g,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),o=Hv(n),Wa&&Uv(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Go.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Pv.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=$v(Lg(a,+c[1],+c[2]),c[4]);else if(a=ee.maxOpen(Bv(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f<a.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=a.content.lastChild;d<a.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);a=Lg(a,f,d)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const Pv=/^(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 Bv(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&W2(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=q2(o[o.length-1],s.length));let c=j2(a,l);o.push(c),i=i.matchType(c.type),s=l}}),o)return q.from(o)}return t}function j2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,q.from(t));return t}function W2(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=W2(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(q.from(j2(n,t,i+1))))}}function q2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,q2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(q.empty,!0);return t.copy(n.append(r))}function gh(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=gh(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(q.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function Lg(t,e,n){return e<t.openStart&&(t=new ee(gh(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ee(gh(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Y2={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 Pg=null;function K2(){return Pg||(Pg=document.implementation.createHTMLDocument("title"))}let Pf=null;function Fv(t){let e=window.trustedTypes;return e?(Pf||(Pf=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Pf.createHTML(t)):t}function Hv(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=K2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Y2[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=Fv(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function Uv(t){let e=t.querySelectorAll(xt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function $v(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=q.from(l.create(r[a+1],i)),s++,o++}return new ee(i,s,o)}const $t={},Vt={},Vv={touchstart:!0,touchmove:!0};class zv{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function jv(t){for(let e in $t){let n=$t[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{qv(t,r)&&!Op(t,r)&&(t.editable||!(r.type in Vt))&&n(t,r)},Vv[e]?{passive:!0}:void 0)}It&&t.dom.addEventListener("input",()=>null),bh(t)}function Zr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Wv(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function bh(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Op(t,r))})}function Op(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function qv(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Yv(t,e){!Op(t,e)&&$t[e.type]&&(t.editable||!(e.type in Vt))&&$t[e.type](t,e)}Vt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!X2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ar&&xt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),$s&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,wi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Lv(t,n)?n.preventDefault():Zr(t,"key")};Vt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Vt.keypress=(t,e)=>{let n=e;if(X2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||wn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof fe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function xc(t){return{left:t.clientX,top:t.clientY}}function Kv(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Dp(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function ks(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Gv(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ae.isSelectable(r)?(ks(t,new ae(n)),!0):!1}function Xv(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ae&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ae.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(ks(t,ae.create(t.state.doc,i)),!0):!1}function Qv(t,e,n,r,i){return Dp(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?Xv(t,n):Gv(t,n))}function Zv(t,e,n,r){return Dp(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Jv(t,e,n,r){return Dp(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||e_(t,n,r)}function e_(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ks(t,fe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)ks(t,fe.create(r,a+1,a+1+o.content.size));else if(ae.isSelectable(o))ks(t,ae.create(r,a));else continue;return!0}}function Lp(t){return wu(t)}const G2=wn?"metaKey":"ctrlKey";$t.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Lp(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&Kv(n,t.input.lastClick)&&!n[G2]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(xc(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new t_(t,o,n,!!r)):(s=="doubleClick"?Zv:Jv)(t,o.pos,o.inside,n)?n.preventDefault():Zr(t,"pointer"))};class t_{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[G2],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let c=e.state.doc.resolve(n.pos);s=c.parent,o=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ae&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&In&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ir(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(xc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Zr(this.view,"pointer"):Qv(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||It&&this.mightDrag&&!this.mightDrag.node.isAtom||xt&&!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)?(ks(this.view,he.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Zr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Zr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}$t.touchstart=t=>{t.input.lastTouch=Date.now(),Lp(t),Zr(t,"pointer")};$t.touchmove=t=>{t.input.lastTouch=Date.now(),Zr(t,"pointer")};$t.contextmenu=t=>Lp(t);function X2(t,e){return t.composing?!0:It&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const n_=Ar?5e3:-1;Vt.compositionstart=Vt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof fe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||xt&&v2&&r_(t)))t.markCursor=t.state.storedMarks||n.marks(),wu(t,!0),t.markCursor=null;else if(wu(t,!e.selection.empty),In&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}Q2(t,n_)};function r_(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Vt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Q2(t,20))};function Q2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>wu(t),e))}function Z2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=s_());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function i_(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=X3(e.focusNode,e.focusOffset),r=Q3(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function s_(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function wu(t,e=!1){if(!(Ar&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Z2(t),e||t.docView&&t.docView.dirty){let n=Ip(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function o_(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ga=nn&&ri<15||$s&&tv<604;$t.copy=Vt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=ga?null:n.clipboardData,o=r.content(),{dom:a,text:l}=Mp(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):o_(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function a_(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function l_(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ba(t,r.value,null,i,e):ba(t,r.textContent,r.innerHTML,i,e)},50)}function ba(t,e,n,r,i){let s=z2(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||ee.empty)))return!0;if(!s)return!1;let o=a_(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function J2(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Vt.paste=(t,e)=>{let n=e;if(t.composing&&!Ar)return;let r=ga?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ba(t,J2(r),r.getData("text/html"),i,n)?n.preventDefault():l_(t,n)};class eT{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const u_=wn?"altKey":"ctrlKey";function tT(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[u_]}$t.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(xc(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ae?i.to-1:i.to))){if(r&&r.mightDrag)o=ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(o=ae.create(t.state.doc,f.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:c}=Mp(t,a);(!n.dataTransfer.files.length||!xt||A2>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ga?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ga||n.dataTransfer.setData("text/plain",u),t.dragging=new eT(c,tT(t,n),o)};$t.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Vt.dragover=Vt.dragenter=(t,e)=>e.preventDefault();Vt.drop=(t,e)=>{try{c_(t,e,t.dragging)}finally{t.dragging=null}};function c_(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(xc(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",h=>{s=h(s,t,!1)}):s=z2(t,J2(e.dataTransfer),ga?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&tT(t,e));if(t.someProp("handleDrop",h=>h(t,e,s||ee.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?y3(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(f))return;let d=l.doc.resolve(u);if(c&&ae.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ae(d));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,g,b,y)=>h=y),l.setSelection(Rp(t,d,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}$t.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ir(t)},20))};$t.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};$t.beforeinput=(t,e)=>{if(xt&&Ar&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,wi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Vt)$t[t]=Vt[t];function ya(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ku{constructor(e,n){this.toDOM=e,this.spec=n||Ri,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new ut(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ku&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ya(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class si{constructor(e,n){this.attrs=e,this.spec=n||Ri}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new ut(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof si&&ya(this.attrs,e.attrs)&&ya(this.spec,e.spec)}static is(e){return e.type instanceof si}destroy(){}}class Pp{constructor(e,n){this.attrs=e,this.spec=n||Ri}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new ut(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Pp&&ya(this.attrs,e.attrs)&&ya(this.spec,e.spec)}destroy(){}}class ut{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ut(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ut(e,e,new ku(n,r))}static inline(e,n,r,i){return new ut(e,n,new si(r,i))}static node(e,n,r,i){return new ut(e,n,new Pp(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof si}get widget(){return this.type instanceof ku}}const ms=[],Ri={};class qe{constructor(e,n){this.local=e.length?e:ms,this.children=n.length?n:ms}static create(e,n){return n.length?Au(n,e,0,Ri):kt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==kt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ri)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?f_(this.children,o||[],e,n,r,i,s):o?new qe(o.sort(Mi),ms):kt}add(e,n){return n.length?this==kt?qe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,c;if(c=rT(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,c,u+1):i.splice(s,0,l,l+a.nodeSize,Au(c,a,u+1,Ri)),s+=3}});let o=nT(s?iT(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new qe(o.length?this.local.concat(o).sort(Mi):this.local,i||this.children)}remove(e){return e.length==0||this==kt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let c=0,f;c<e.length;c++)(f=e[c])&&f.from>a&&f.to<l&&(e[c]=null,(o||(o=[])).push(f));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=kt?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new qe(i,r):kt}forChild(e,n){if(this==kt)return this;if(n.isLeaf)return qe.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof si){let u=Math.max(s,l.from)-s,c=Math.min(o,l.to)-s;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new qe(i.sort(Mi),ms);return r?new qr([a,r]):a}return r||kt}eq(e){if(this==e)return!0;if(!(e instanceof qe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Bp(this.localsInner(e))}localsInner(e){if(this==kt)return ms;if(e.inlineContent||!this.local.some(si.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof si||n.push(this.local[r]);return n}forEachSet(e){e(this)}}qe.empty=new qe([],[]);qe.removeOverlap=Bp;const kt=qe.empty;class qr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Ri));return qr.from(r)}forChild(e,n){if(n.isLeaf)return qe.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=kt&&(s instanceof qr?r=r.concat(s.members):r.push(s))}return qr.from(r)}eq(e){if(!(e instanceof qr)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?Bp(r?n:n.sort(Mi)):ms}static from(e){switch(e.length){case 0:return kt;case 1:return e[0];default:return new qr(e.every(n=>n instanceof qe)?e:e.reduce((n,r)=>n.concat(r instanceof qe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function f_(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,c=s;u<n.maps.length;u++){let f=0;n.maps[u].forEach((d,h,p,g)=>{let b=g-p-(h-d);for(let y=0;y<a.length;y+=3){let E=a[y+1];if(E<0||d>E+c-f)continue;let T=a[y]+c-f;h>=T?a[y+1]=d<=T?-2:-1:d>=c&&b&&(a[y]+=b,a[y+1]+=b)}f+=b}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(t[u]+s),f=c-i;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(t[u+1]+s,-1),h=d-i,{index:p,offset:g}=r.content.findIndex(f),b=r.maybeChild(p);if(b&&g==f&&g+b.nodeSize==h){let y=a[u+2].mapInner(n,b,c+1,t[u]+s+1,o);y!=kt?(a[u]=f,a[u+1]=h,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=d_(a,t,e,n,i,s,o),c=Au(u,r,0,o);e=c.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<c.children.length;f+=3){let h=c.children[f];for(;d<a.length&&a[d]<h;)d+=3;a.splice(d,0,c.children[f],c.children[f+1],c.children[f+2])}}return new qe(e.sort(Mi),a)}function nT(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new ut(i.from+e,i.to+e,i.type))}return n}function d_(t,e,n,r,i,s,o){function a(l,u){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(r,i,u);f?n.push(f):o.onRemove&&o.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function rT(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function iT(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Au(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=rT(t,a,l+n);if(u){s=!0;let c=Au(u,a,n+l+1,r);c!=kt&&i.push(l,l+a.nodeSize,c)}});let o=nT(s?iT(t):t,-n).sort(Mi);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new qe(o,i):kt}function Mi(t,e){return t.from-e.from||t.to-e.to}function Bp(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Bg(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Bg(e,i,r.copy(s.from,r.to)));break}}}return e}function Bg(t,e,n){for(;e<t.length&&Mi(n,t[e])>0;)e++;t.splice(e,0,n)}function Bf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=kt&&e.push(r)}),t.cursorWrapper&&e.push(qe.create(t.state.doc,[t.cursorWrapper.deco])),qr.from(e)}const h_={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},p_=nn&&ri<=11;class m_{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class g_{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new m_,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);nn&&ri<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():It&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),p_&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,h_)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ng(this.view)){if(this.suppressingSelectionUpdates)return Ir(this.view);if(nn&&ri<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Fi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Us(s))n.add(s);for(let s=e.anchorNode;s;s=Us(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ng(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let f=this.registerMutation(n[c],l);f&&(s=s<0?f.from:Math.min(f.from,s),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(a=!0))}if(l.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let f=c.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){c.parentNode.removeChild(c);break}f=f.firstChild}}}else if(In&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||E_(e,f)!=h)&&d.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tc(r)&&(u=Ip(e))&&u.eq(he.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ir(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),b_(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,T_(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ir(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let f=e.addedNodes[c];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(nn&&ri<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:f,nextSibling:d}=e.addedNodes[c];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(s=d)}let o=i&&i.parentNode==e.target?Tt(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?Tt(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Fg=new WeakMap,Hg=!1;function b_(t){if(!Fg.has(t)&&(Fg.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=In,Hg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Hg=!0}}function Ug(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Fi(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function y_(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Ug(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Ug(t,n):null}function E_(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function T_(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function C_(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],Tc(l)||u.push({node:l.focusNode,offset:l.focusOffset})),xt&&t.input.lastKeyCode===8)for(let b=s;b>i;b--){let y=r.childNodes[b-1],E=y.pmViewDesc;if(y.nodeName=="BR"&&!E){s=b;break}if(!E||E.size)break}let f=t.state.doc,d=t.someProp("domParser")||Go.fromSchema(t.state.schema),h=f.resolve(o),p=null,g=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:x_,context:h});if(u&&u[0].pos!=null){let b=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=b),p={anchor:b+o,head:y+o}}return{doc:g,sel:p,from:o,to:a}}function x_(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(It&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||It&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const S_=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function w_(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let M=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=Ip(t,M);if(P&&!t.state.selection.eq(P)){if(xt&&Ar&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,wi(13,"Enter"))))return;let F=t.state.tr.setSelection(P);M=="pointer"?F.setMeta("pointer",!0):M=="key"&&F.scrollIntoView(),s&&F.setMeta("composition",s),t.dispatch(F)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=C_(t,e,n),c=t.state.doc,f=c.slice(u.from,u.to),d,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,h="end"):(d=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=v_(f.content,u.doc.content,u.from,d,h);if(p&&t.input.domChangeCount++,($s&&t.input.lastIOSEnter>Date.now()-225||Ar)&&i.some(M=>M.nodeType==1&&!S_.test(M.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",M=>M(t,wi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof fe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let M=$g(t,t.state.doc,u.sel);if(M&&!M.eq(t.state.selection)){let P=t.state.tr.setSelection(M);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof fe&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),nn&&ri<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)==" "&&(p.start--,p.endA--,p.endB--);let g=u.doc.resolveNoCache(p.start-u.from),b=u.doc.resolveNoCache(p.endB-u.from),y=c.resolve(p.start),E=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=p.endA;if(($s&&t.input.lastIOSEnter>Date.now()-225&&(!E||i.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!E&&g.pos<u.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(u.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",M=>M(t,wi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&A_(c,p.start,p.endA,g,b)&&t.someProp("handleKeyDown",M=>M(t,wi(8,"Backspace")))){Ar&&xt&&t.domObserver.suppressSelectionUpdates();return}xt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),Ar&&!E&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,b=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(M){return M(t,wi(13,"Enter"))})},20));let T=p.start,v=p.endA,_=M=>{let P=M||t.state.tr.replace(T,v,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let F=$g(t,P.doc,u.sel);F&&!(xt&&t.composing&&F.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(F.head==T||F.head==P.mapping.map(v)-1)||nn&&F.empty&&F.head==T)&&P.setSelection(F)}return s&&P.setMeta("composition",s),P.scrollIntoView()},k;if(E)if(g.pos==b.pos){nn&&ri<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ir(t),20));let M=_(t.state.tr.delete(T,v)),P=c.resolve(p.start).marksAcross(c.resolve(p.endA));P&&M.ensureMarks(P),t.dispatch(M)}else if(p.endA==p.endB&&(k=k_(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let M=_(t.state.tr);k.type=="add"?M.addMark(T,v,k.mark):M.removeMark(T,v,k.mark),t.dispatch(M)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let M=g.parent.textBetween(g.parentOffset,b.parentOffset),P=()=>_(t.state.tr.insertText(M,T,v));t.someProp("handleTextInput",F=>F(t,T,v,M,P))||t.dispatch(P())}else t.dispatch(_());else t.dispatch(_())}function $g(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Rp(t,e.resolve(n.anchor),e.resolve(n.head))}function k_(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<n.length;c++)s=n[c].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=c=>c.mark(a.addToSet(c.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(q.from(u).eq(t))return{mark:a,type:o}}function A_(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ff(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Ff(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Ff(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Ff(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function v_(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&Vg(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&Vg(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Vg(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class sT{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new zv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Yg),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Wg(this),jg(this),this.nodeViews=qg(this),this.docView=Sg(this.state.doc,zg(this),Bf(this),this.dom,this),this.domObserver=new g_(this,(r,i,s,o)=>w_(this,r,i,s,o)),this.domObserver.start(),jv(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&bh(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Yg),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(Z2(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=qg(this);N_(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&bh(this),this.editable=Wg(this),jg(this);let l=Bf(this),u=zg(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(o=!0);let d=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&iv(this);if(o){this.domObserver.stop();let h=f&&(nn||xt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&__(i.selection,e.selection);if(f){let p=xt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=i_(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=Sg(e.doc,u,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&_v(this))?Ir(this,h):(U2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&sv(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ae){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&bg(this,n.getBoundingClientRect(),e)}else bg(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new eT(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(nn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ov(this.dom),Ir(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return fv(this,e)}coordsAtPos(e,n=1){return M2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return gv(this,n||this.state,e)}pasteHTML(e,n){return ba(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ba(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Mp(this,e)}destroy(){this.docView&&(Wv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Bf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,K3())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Yv(this,e)}domSelectionRange(){let e=this.domSelection();return e?It&&this.root.nodeType===11&&J3(this.dom.ownerDocument)==this.dom&&y_(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}sT.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function zg(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ut.node(0,t.state.doc.content.size,e)]}function jg(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ut.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Wg(t){return!t.someProp("editable",e=>e(t.state)===!1)}function __(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function qg(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function N_(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Yg(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var li={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:"'"},vu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},I_=typeof navigator<"u"&&/Mac/.test(navigator.platform),R_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ct=0;Ct<10;Ct++)li[48+Ct]=li[96+Ct]=String(Ct);for(var Ct=1;Ct<=24;Ct++)li[Ct+111]="F"+Ct;for(var Ct=65;Ct<=90;Ct++)li[Ct]=String.fromCharCode(Ct+32),vu[Ct]=String.fromCharCode(Ct);for(var Hf in li)vu.hasOwnProperty(Hf)||(vu[Hf]=li[Hf]);function M_(t){var e=I_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||R_&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?vu:li)[t.keyCode]||t.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 O_=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),D_=typeof navigator<"u"&&/Win/.test(navigator.platform);function L_(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))O_?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function P_(t){let e=Object.create(null);for(let n in t)e[L_(n)]=t[n];return e}function Uf(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function B_(t){return new ot({props:{handleKeyDown:Fp(t)}})}function Fp(t){let e=P_(t);return function(n,r){let i=M_(r),s,o=e[Uf(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Uf(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(D_&&r.ctrlKey&&r.altKey)&&(s=li[r.keyCode])&&s!=i){let a=e[Uf(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var F_=Object.defineProperty,Hp=(t,e)=>{for(var n in e)F_(t,n,{get:e[n],enumerable:!0})};function Sc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var wc=class{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:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...u)=>{const c=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!t,l=t||i.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(f=>f===!0)),c={...Object.fromEntries(Object.entries(n).map(([f,d])=>[f,(...p)=>{const g=this.buildProps(l,e),b=d(...p)(g);return o.push(b),c}])),run:u};return c}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:t,editor:r,view:s,state:Sc({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},oT={};Hp(oT,{blur:()=>H_,clearContent:()=>U_,clearNodes:()=>$_,command:()=>V_,createParagraphNear:()=>z_,cut:()=>j_,deleteCurrentNode:()=>W_,deleteNode:()=>q_,deleteRange:()=>Y_,deleteSelection:()=>K_,enter:()=>G_,exitCode:()=>X_,extendMarkRange:()=>Q_,first:()=>Z_,focus:()=>eN,forEach:()=>tN,insertContent:()=>nN,insertContentAt:()=>sN,joinBackward:()=>lN,joinDown:()=>aN,joinForward:()=>uN,joinItemBackward:()=>cN,joinItemForward:()=>fN,joinTextblockBackward:()=>dN,joinTextblockForward:()=>hN,joinUp:()=>oN,keyboardShortcut:()=>mN,lift:()=>gN,liftEmptyBlock:()=>bN,liftListItem:()=>yN,newlineInCode:()=>EN,resetAttributes:()=>TN,scrollIntoView:()=>CN,selectAll:()=>xN,selectNodeBackward:()=>SN,selectNodeForward:()=>wN,selectParentNode:()=>kN,selectTextblockEnd:()=>AN,selectTextblockStart:()=>vN,setContent:()=>_N,setMark:()=>KN,setMeta:()=>GN,setNode:()=>XN,setNodeSelection:()=>QN,setTextDirection:()=>ZN,setTextSelection:()=>JN,sinkListItem:()=>eI,splitBlock:()=>tI,splitListItem:()=>nI,toggleList:()=>iI,toggleMark:()=>sI,toggleNode:()=>oI,toggleWrap:()=>aI,undoInputRule:()=>lI,unsetAllMarks:()=>uI,unsetMark:()=>cI,unsetTextDirection:()=>fI,updateAttributes:()=>dI,wrapIn:()=>hI,wrapInList:()=>pI});var H_=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),U_=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),$_=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=oo(h);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},V_=t=>e=>t(e),z_=()=>({state:t,dispatch:e})=>C2(t,e),j_=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new fe(r.doc.resolve(Math.max(o-1,0)))),!0},W_=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function bt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var q_=t=>({tr:e,state:n,dispatch:r})=>{const i=bt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},Y_=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},K_=()=>({state:t,dispatch:e})=>wp(t,e),G_=()=>({commands:t})=>t.keyboardShortcut("Enter"),X_=()=>({state:t,dispatch:e})=>O3(t,e);function Up(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function _u(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Up(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function aT(t,e,n={}){return t.find(r=>r.type===e&&_u(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Kg(t,e,n={}){return!!aT(t,e,n)}function $p(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;if(!n){const u=r.node.marks.find(c=>c.type===e);u&&(n=u.attrs)}if(!aT([...r.node.marks],e,n))return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(;s>0&&Kg([...t.parent.child(s-1).marks],e,n);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&Kg([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Br(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var Q_=(t,e)=>({tr:n,state:r,dispatch:i})=>{const s=Br(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=$p(l,s,e);if(f&&f.from<=u&&f.to>=c){const d=fe.create(o,f.from,f.to);n.setSelection(d)}}return!0},Z_=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Vp(t){return t instanceof fe}function vr(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function lT(t,e=null){if(!e)return null;const n=he.atStart(t),r=he.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?fe.create(t,vr(0,i,s),vr(t.content.size,i,s)):fe.create(t,vr(e,i,s),vr(e,i,s))}function yh(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ea(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function J_(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var eN=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(Ea()||yh())&&r.dom.focus(),J_()&&!Ea()&&!yh()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!Vp(n.state.selection))return o(),!0;const a=lT(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},tN=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),nN=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),uT=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&uT(r)}return t};function Tl(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return uT(n)}function Ta(t,e,n){if(t instanceof ni||t instanceof q)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return q.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Ta("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new KE({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Go.fromSchema(l).parseSlice(Tl(t),n.parseOptions):Go.fromSchema(l).parse(Tl(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Go.fromSchema(e);return n.slice?s.parseSlice(Tl(t),n.parseOptions).content:s.parse(Tl(t),n.parseOptions)}return Ta("",e,n)}function rN(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof rt||i instanceof pt))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,c)=>{o===0&&(o=c)}),t.setSelection(he.near(t.doc.resolve(o),n))}var iN=t=>!("type"in t),sN=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=b=>{s.emit("contentError",{editor:s,error:b,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ta(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(b){l(b)}try{a=Ta(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(b){return l(b),!1}let{from:c,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,h=!0;if((iN(a)?a:[a]).forEach(b=>{b.check(),d=d?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),c===f&&h){const{parent:b}=r.doc.resolve(c);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(c-=1,f+=1)}let g;if(d){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof q){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,c,f)}else{g=a;const b=r.doc.resolve(c),y=b.node(),E=b.parentOffset===0,T=y.isText||y.isTextblock,v=y.content.size>0;E&&T&&v&&h&&(c=Math.max(0,c-1)),r.replaceWith(c,f,g)}n.updateSelection&&rN(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:g})}return!0},oN=()=>({state:t,dispatch:e})=>I3(t,e),aN=()=>({state:t,dispatch:e})=>R3(t,e),lN=()=>({state:t,dispatch:e})=>p2(t,e),uN=()=>({state:t,dispatch:e})=>y2(t,e),cN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=bc(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},fN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=bc(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},dN=()=>({state:t,dispatch:e})=>_3(t,e),hN=()=>({state:t,dispatch:e})=>N3(t,e);function cT(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function pN(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Ea()||cT()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var mN=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=pN(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function Ca(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?bt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>_u(f.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}var gN=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return Ca(n,i,e)?M3(n,r):!1},bN=()=>({state:t,dispatch:e})=>x2(t,e),yN=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return j3(r)(e,n)},EN=()=>({state:t,dispatch:e})=>T2(t,e);function kc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Gg(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var TN=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=kc(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=bt(t,r.schema)),a==="mark"&&(o=Br(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,f)=>{s&&s===c.type&&(l=!0,i&&n.setNodeMarkup(f,void 0,Gg(c.attrs,e))),o&&c.marks.length&&c.marks.forEach(d=>{o===d.type&&(l=!0,i&&n.addMark(f,f+c.nodeSize,o.create(Gg(d.attrs,e))))})})}),l},CN=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),xN=()=>({tr:t,dispatch:e})=>{if(e){const n=new tn(t.doc);t.setSelection(n)}return!0},SN=()=>({state:t,dispatch:e})=>g2(t,e),wN=()=>({state:t,dispatch:e})=>E2(t,e),kN=()=>({state:t,dispatch:e})=>P3(t,e),AN=()=>({state:t,dispatch:e})=>H3(t,e),vN=()=>({state:t,dispatch:e})=>F3(t,e);function Eh(t,e,n={},r={}){return Ta(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var _N=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const u=Eh(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function fT(t,e){const n=Br(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function NN(t,e){const n=new xp(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function IN(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function yK(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function RN(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function zp(t){return e=>RN(e.$from,t)}function oe(t,e,n){return t.config[e]===void 0&&t.parent?oe(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?oe(t.parent,e,n):null}):t.config[e]}function jp(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=oe(e,"addExtensions",n);return r?[e,...jp(r())]:e}).flat(10)}function Wp(t,e){const n=Ki.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function dT(t){return typeof t=="function"}function $e(t,e=void 0,...n){return dT(t)?e?t.bind(e)(...n):t(...n):t}function MN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Vs(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function hT(t){const e=[],{nodeExtensions:n,markExtensions:r}=Vs(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const c={name:u.name,options:u.options,storage:u.storage,extensions:i},f=oe(u,"addGlobalAttributes",c);if(!f)return;f().forEach(h=>{let p;Array.isArray(h.types)?p=h.types:h.types==="*"?p=l:h.types==="nodes"?p=o:h.types==="marks"?p=a:p=[],p.forEach(g=>{Object.entries(h.attributes).forEach(([b,y])=>{e.push({type:g,name:b,attribute:{...s,...y}})})})})}),i.forEach(u=>{const c={name:u.name,options:u.options,storage:u.storage},f=oe(u,"addAttributes",c);if(!f)return;const d=f();Object.entries(d).forEach(([h,p])=>{const g={...s,...p};typeof g?.default=="function"&&(g.default=g.default()),g?.isRequired&&g?.default===void 0&&delete g.default,e.push({type:u.name,name:h,attribute:g})})}),e}function ON(t){const e=[];let n="",r=!1,i=!1,s=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){s+=1,n+=l;continue}if(l===")"&&s>0){s-=1,n+=l;continue}if(l===";"&&s===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function Xg(t){const e=[],n=ON(t||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function ao(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=new Map([...Xg(r[i]),...Xg(s)]);r[i]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[i]=s}),r},{})}function xa(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ao(n,r),{})}function DN(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Qg(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):DN(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function Zg(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&MN(n)?!1:n!=null))}function Jg(t){var e,n;const r={};return!((e=t?.attribute)!=null&&e.isRequired)&&"default"in(t?.attribute||{})&&(r.default=t.attribute.default),((n=t?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function pT(t,e){var n;const r=hT(t),{nodeExtensions:i,markExtensions:s}=Vs(t),o=(n=i.find(u=>oe(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(u=>{const c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((y,E)=>{const T=oe(E,"extendNodeSchema",f);return{...y,...T?T(u):{}}},{}),h=Zg({...d,content:$e(oe(u,"content",f)),marks:$e(oe(u,"marks",f)),group:$e(oe(u,"group",f)),inline:$e(oe(u,"inline",f)),atom:$e(oe(u,"atom",f)),selectable:$e(oe(u,"selectable",f)),draggable:$e(oe(u,"draggable",f)),code:$e(oe(u,"code",f)),whitespace:$e(oe(u,"whitespace",f)),linebreakReplacement:$e(oe(u,"linebreakReplacement",f)),defining:$e(oe(u,"defining",f)),isolating:$e(oe(u,"isolating",f)),attrs:Object.fromEntries(c.map(Jg))}),p=$e(oe(u,"parseHTML",f));p&&(h.parseDOM=p.map(y=>Qg(y,c)));const g=oe(u,"renderHTML",f);g&&(h.toDOM=y=>g({node:y,HTMLAttributes:xa(y,c)}));const b=oe(u,"renderText",f);return b&&(h.toText=b),[u.name,h]})),l=Object.fromEntries(s.map(u=>{const c=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((b,y)=>{const E=oe(y,"extendMarkSchema",f);return{...b,...E?E(u):{}}},{}),h=Zg({...d,inclusive:$e(oe(u,"inclusive",f)),excludes:$e(oe(u,"excludes",f)),group:$e(oe(u,"group",f)),spanning:$e(oe(u,"spanning",f)),code:$e(oe(u,"code",f)),attrs:Object.fromEntries(c.map(Jg))}),p=$e(oe(u,"parseHTML",f));p&&(h.parseDOM=p.map(b=>Qg(b,c)));const g=oe(u,"renderHTML",f);return g&&(h.toDOM=b=>g({mark:b,HTMLAttributes:xa(b,c)})),[u.name,h]}));return new KE({topNode:o,nodes:a,marks:l})}function LN(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Jo(t){return t.sort((n,r)=>{const i=oe(n,"priority")||100,s=oe(r,"priority")||100;return i>s?-1:i<s?1:0})}function qp(t){const e=Jo(jp(t)),n=LN(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function EK(t,e){const n=qp(t);return pT(n,e)}function mT(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
11
|
+
|
|
12
|
+
`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=s);const h=o?.[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l?.text)==null?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function PN(t,e){const n={from:0,to:t.content.size};return mT(t,n,e)}function gT(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function BN(t,e){const n=bt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function FN(t,e){const n=kc(typeof e=="string"?e:e.name,t.schema);return n==="node"?BN(t,e):n==="mark"?fT(t,e):{}}function HN(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function UN(t){const e=HN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function $N(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),c=e.slice(s).map(l),f=e.invert().map(u,-1),d=e.invert().map(c);r.push({oldRange:{from:f,to:d},newRange:{from:u,to:c}})})}),UN(r)}function bT(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=$p(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function Do(t,e){return e.nodes[t]||e.marks[t]||null}function Zl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var VN=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-s))}),n};function Th(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Br(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>_u(f.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(g,b)=>{if(s&&g.inlineContent&&!g.type.allowsMarkType(s))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(h,b),E=Math.min(p,b+g.nodeSize),T=E-y;o+=T,a.push(...g.marks.map(v=>({mark:v,from:y,to:E})))})}),o===0)return!1;const l=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>_u(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=o}function zN(t,e,n={}){if(!e)return Ca(t,null,n)||Th(t,null,n);const r=kc(e,t.schema);return r==="node"?Ca(t,e,n):r==="mark"?Th(t,e,n):!1}function e1(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function $f(t,e){const{nodeExtensions:n}=Vs(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=$e(oe(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Yp(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Yp(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function TK(t){return t instanceof ae}function jN({selection:t,pos:e,nodeSize:n,selectedOnTextSelection:r=!1}){const{from:i,to:s}=t;return!!(i<=e&&s>=e+n||r&&Vp(t)&&i>e&&s<e+n)}var yT=class ET{constructor(e){this.position=e}static fromJSON(e){return new ET(e.position)}toJSON(){return{position:this.position}}};function WN(t,e){const n=e.mapping.mapResult(t.position);return{position:new yT(n.pos),mapResult:n}}function qN(t){return new yT(t)}function CK(t,e,n){const i=t.state.doc.content.size,s=vr(e,0,i),o=vr(n,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-f,p=c-u,y={top:u,bottom:c,left:f,right:d,width:h,height:p,x:f,y:u};return{...y,toJSON:()=>y}}function YN(t,e,n){var r;const{selection:i}=e;let s=null;if(Vp(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=h&&p}return!u}),u})}var KN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Br(t,r.schema);if(i)if(o){const u=fT(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),g=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,g,l.create({...y.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return YN(r,n,l)},GN=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),XN=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=bt(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>pg(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>pg(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},QN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=vr(t,0,r.content.size),s=ae.create(r,i);e.setSelection(s)}return!0},ZN=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},JN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=fe.atStart(r).from,a=fe.atEnd(r).to,l=vr(i,o,a),u=vr(s,o,a),c=fe.create(r,l,u);e.setSelection(c)}return!0},eI=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return Y3(r)(e,n)};function t1(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var tI=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,c=Zl(u,a.node().type.name,a.node().attrs);if(s instanceof ae&&s.node.isBlock)return!a.parentOffset||!Nr(o,a.pos)?!1:(r&&(t&&t1(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:IN(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=Nr(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Nr(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),r){if(p&&(s instanceof fe&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const g=e.mapping.map(a.before()),b=e.doc.resolve(g);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&t1(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},nI=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=bt(t,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const f=l.node(-1);if(f.type!==a)return!1;const d=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=q.empty;const E=l.index(-1)?1:l.index(-2)?2:3;for(let P=l.depth-E;P>=l.depth-3;P-=1)y=q.from(l.node(P).copy(y));const T=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Zl(d,l.node().type.name,l.node().attrs),...e},_=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(v))||void 0;y=y.append(q.from(a.createAndFill(null,_)||void 0));const k=l.before(l.depth-(E-1));n.replace(k,l.after(-T),new ee(y,4-E,0));let M=-1;n.doc.nodesBetween(k,n.doc.content.size,(P,F)=>{if(M>-1)return!1;P.isTextblock&&P.content.size===0&&(M=F+1)}),M>-1&&n.setSelection(fe.near(n.doc.resolve(M))),n.scrollIntoView()}return!0}const h=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,p={...Zl(d,f.type.name,f.attrs),...e},g={...Zl(d,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const b=h?[{type:a,attrs:p},{type:h,attrs:g}]:[{type:a,attrs:p}];if(!Nr(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:E}=r,{splittableMarks:T}=s.extensionManager,v=E||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,b).scrollIntoView(),!v||!i)return!0;const _=v.filter(k=>T.includes(k.type.name));n.ensureMarks(_)}return!0},Vf=(t,e)=>{const n=zp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Gi(t.doc,n.pos)&&t.join(n.pos),!0},zf=(t,e)=>{const n=zp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Gi(t.doc,r)&&t.join(r),!0};function rI(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),i=e.resolve(n.nodeSize-1);return fe.between(r,i)}var iI=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=bt(t,o.schema),p=bt(e,o.schema),{selection:g,storedMarks:b}=o,{$from:y,$to:E}=g,T=y.blockRange(E),v=b||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const _=zp(V=>$f(V.type.name,f))(g),k=g.from===0&&g.to===o.doc.content.size,M=o.doc.content.content,P=M.length===1?M[0]:null,F=k&&P&&$f(P.type.name,f)?{node:P,pos:0}:null,N=_??F,U=!!_&&T.depth>=1&&T.depth-_.depth<=1,j=!!F;if((U||j)&&N){if(N.node.type===h)return k&&j?l().command(({tr:V,dispatch:I})=>{const L=rI(V);return L?(V.setSelection(L),I&&I(V),!0):!1}).liftListItem(p).run():u.liftListItem(p);if($f(N.node.type.name,f)&&h.validContent(N.node.content))return l().command(()=>(s.setNodeMarkup(N.pos,h),!0)).command(()=>Vf(s,h)).command(()=>zf(s,h)).run()}return!n||!v||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>Vf(s,h)).command(()=>zf(s,h)).run():l().command(()=>{const V=c().wrapInList(h,r),I=v.filter(L=>d.includes(L.type.name));return s.ensureMarks(I),V?!0:u.clearNodes()}).wrapInList(h,r).command(()=>Vf(s,h)).command(()=>zf(s,h)).run()},sI=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Br(t,r.schema);return Th(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},oI=(t,e,n={})=>({state:r,commands:i})=>{const s=bt(t,r.schema),o=bt(e,r.schema),a=Ca(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},aI=(t,e={})=>({state:n,commands:r})=>{const i=bt(t,n.schema);return Ca(n,i,e)?r.lift(i):r.wrapIn(i,e)},lI=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},uI=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},cI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Br(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&o){let{from:d,to:h}=a;const p=(s=u.marks().find(b=>b.type===l))==null?void 0:s.attrs,g=$p(u,l,p);g&&(d=g.from,h=g.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},fI=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof t=="number"?(s=t,o=t):t&&"from"in t&&"to"in t?(s=t.from,o=t.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},dI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=kc(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=bt(t,r.schema)),a==="mark"&&(o=Br(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;let d,h,p,g;n.selection.empty?r.doc.nodesBetween(c,f,(b,y)=>{s&&s===b.type&&(l=!0,p=Math.max(y,c),g=Math.min(y+b.nodeSize,f),d=y,h=b)}):r.doc.nodesBetween(c,f,(b,y)=>{y<c&&s&&s===b.type&&(l=!0,p=Math.max(y,c),g=Math.min(y+b.nodeSize,f),d=y,h=b),y>=c&&y<=f&&(s&&s===b.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(E=>{if(o===E.type&&(l=!0,i)){const T=Math.max(y,c),v=Math.min(y+b.nodeSize,f);n.addMark(T,v,o.create({...E.attrs,...e}))}}))}),h&&(d!==void 0&&i&&n.setNodeMarkup(d,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(b=>{o===b.type&&i&&n.addMark(p,g,o.create({...b.attrs,...e}))}))}),l},hI=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return U3(i,e)(n,r)},pI=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return $3(i,e)(n,r)},mI=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},gI=class{constructor(e){var n;this.find=e.find,this.handler=e.handler,this.undoable=(n=e.undoable)!=null?n:!0}},bI=(t,e)=>{if(Up(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Cl(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(d=>d.type.spec.code))return!1;let c=!1;const f=VN(u)+s;return o.forEach(d=>{if(c)return;const h=bI(f,d.find);if(!h)return;const p=l.state.tr,g=Sc({state:l.state,transaction:p}),b={from:r-(h[0].length-s.length),to:i},{commands:y,chain:E,can:T}=new wc({editor:n,state:g});d.handler({state:g,range:b,match:h,commands:y,chain:E,can:T})===null||!p.steps.length||(d.undoable&&p.setMeta(a,{transform:p,from:r,to:i,text:s}),l.dispatch(p),c=!0)}),c}function yI(t){const{editor:e,rules:n}=t,r=new ot({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Wp(q.from(c),o.schema);const{from:f}=l,d=f+c.length;Cl({editor:e,from:f,to:d,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Cl({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Cl({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Cl({editor:e,from:o.pos,to:o.pos,text:`
|
|
13
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function EI(t){return Object.prototype.toString.call(t).slice(8,-1)}function xl(t){return EI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function TT(t,e){const n={...t};return xl(t)&&xl(e)&&Object.keys(e).forEach(r=>{xl(e[r])&&xl(t[r])?n[r]=TT(t[r],e[r]):n[r]=e[r]}),n}var Kp=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...$e(oe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...$e(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>TT(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},lo=class CT extends Kp{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new CT(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>u?.type.name===n.name))return!1;const l=o.find(u=>u?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function TI(t){return typeof t=="number"}var CI=class{constructor(t){this.find=t.find,this.handler=t.handler}},xI=(t,e,n)=>{if(Up(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function SI(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:c}=new wc({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,p)=>{var g,b,y,E,T;if((b=(g=h.type)==null?void 0:g.spec)!=null&&b.code||!(h.isText||h.isTextblock||h.isInline))return;const v=(T=(E=(y=h.content)==null?void 0:y.size)!=null?E:h.nodeSize)!=null?T:0,_=Math.max(r,p),k=Math.min(i,p+v);if(_>=k)return;const M=h.isText?h.text||"":h.textBetween(_-p,k-p,void 0,"");xI(M,s.find,o).forEach(F=>{if(F.index===void 0)return;const N=_+F.index+1,U=N+F[0].length,j={from:n.tr.mapping.map(N),to:n.tr.mapping.map(U)},V=s.handler({state:n,range:j,match:F,commands:l,chain:u,can:c,pasteEvent:o,dropEvent:a});f.push(V)})}),f.every(h=>h!==null)}var Sl=null,wI=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function kI(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:f,to:d,rule:h,pasteEvt:p})=>{const g=c.tr,b=Sc({state:c,transaction:g});if(!(!SI({editor:e,state:b,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(c=>new ot({view(f){const d=p=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(p.target)?f.dom.parentElement:null,r&&(Sl=e)},h=()=>{Sl&&(Sl=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(s=r===f.dom.parentElement,a=d,!s){const h=Sl;h?.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(f,d)=>{var h;const p=(h=d.clipboardData)==null?void 0:h.getData("text/html");return o=d,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],g=p.getMeta("uiEvent")==="paste"&&!i,b=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),E=!!y;if(!g&&!b&&!E)return;if(E){let{text:_}=y;typeof _=="string"?_=_:_=Wp(q.from(_),h.schema);const{from:k}=y,M=k+_.length,P=wI(_);return l({rule:c,state:h,from:k,to:{b:M},pasteEvt:P})}const T=d.doc.content.findDiffStart(h.doc.content),v=d.doc.content.findDiffEnd(h.doc.content);if(!(!TI(T)||!v||T===v.b))return l({rule:c,state:h,from:T,to:v,pasteEvt:o})}}))}var Ac=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=qp(t),this.schema=pT(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Do(e.name,this.schema)},r=oe(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Jo([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Do(r.name,this.schema)},s=[],o=oe(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&oe(r,"exitable",i)&&(a.ArrowRight=()=>lo.handleExit({editor:t,mark:r})),o){const d=Object.fromEntries(Object.entries(o()).map(([h,p])=>[h,()=>p({editor:t})]));a={...a,...d}}const l=B_(a);s.push(l);const u=oe(r,"addInputRules",i);if(e1(r,t.options.enableInputRules)&&u){const d=u();if(d&&d.length){const h=yI({editor:t,rules:d}),p=Array.isArray(h)?h:[h];s.push(...p)}}const c=oe(r,"addPasteRules",i);if(e1(r,t.options.enablePasteRules)&&c){const d=c();if(d&&d.length){const h=kI({editor:t,rules:d});s.push(...h)}}const f=oe(r,"addProseMirrorPlugins",i);if(f){const d=f();s.push(...d)}return s})}get attributes(){return hT(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Vs(this.extensions);return Object.fromEntries(e.filter(n=>!!oe(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:bt(n.name,this.schema)},s=oe(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,u,c,f,d)=>{const h=xa(l,r);return o({node:l,view:u,getPos:c,decorations:f,innerDecorations:d,editor:t,extension:n,HTMLAttributes:h})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Jo([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Do(i.name,this.schema)},o=oe(i,"dispatchTransaction",s);return o?a=>{o.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Jo([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Do(i.name,this.schema)},o=oe(i,"transformPastedHTML",s);return o?(a,l)=>{const u=r(a,l);return o.call(s,u)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Vs(this.extensions);return Object.fromEntries(e.filter(n=>!!oe(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Br(n.name,this.schema)},s=oe(n,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const c=xa(a,r);return s()({mark:a,view:l,inline:u,editor:t,extension:n,HTMLAttributes:c,updateAttributes:f=>{FI(a,t,f)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Do(e.name,this.schema)};e.type==="mark"&&((n=$e(oe(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=oe(e,"onBeforeCreate",r),s=oe(e,"onCreate",r),o=oe(e,"onUpdate",r),a=oe(e,"onSelectionUpdate",r),l=oe(e,"onTransaction",r),u=oe(e,"onFocus",r),c=oe(e,"onBlur",r),f=oe(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),f&&this.editor.on("destroy",f)})}};Ac.resolve=qp;Ac.sort=Jo;Ac.flatten=jp;var AI={};Hp(AI,{ClipboardTextSerializer:()=>ST,Commands:()=>wT,Delete:()=>kT,Drop:()=>AT,Editable:()=>vT,FocusEvents:()=>NT,Keymap:()=>IT,Paste:()=>RT,Tabindex:()=>MT,TextDirection:()=>OT,focusEventsPluginKey:()=>_T});var Yn=class xT extends Kp{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new xT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ST=Yn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ot({key:new wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=gT(n);return mT(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),wT=Yn.create({name:"commands",addCommands(){return{...oT}}}),kT=Yn.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const c=NN(t.before,[t,...e]);$N(c).forEach(h=>{c.mapping.mapResult(h.oldRange.from).deletedAfter&&c.mapping.mapResult(h.oldRange.to).deletedBefore&&c.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,g)=>{const b=g+p.nodeSize-2,y=h.oldRange.from<=g&&b<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:g,to:b,newFrom:c.mapping.map(g),newTo:c.mapping.map(b),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:c})})});const d=c.mapping;c.steps.forEach((h,p)=>{var g,b;if(h instanceof Bn){const y=d.slice(p).map(h.from,-1),E=d.slice(p).map(h.to),T=d.invert().map(y,-1),v=d.invert().map(E),_=y>0?(g=c.doc.nodeAt(y-1))==null?void 0:g.marks.some(M=>M.eq(h.mark)):!1,k=(b=c.doc.nodeAt(E))==null?void 0:b.marks.some(M=>M.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:T,to:v},newRange:{from:y,to:E},partial:!!(k||_),editor:this.editor,transaction:t,combinedTransform:c})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),AT=Yn.create({name:"drop",addProseMirrorPlugins(){return[new ot({key:new wt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),vT=Yn.create({name:"editable",addProseMirrorPlugins(){return[new ot({key:new wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),_T=new wt("focusEvents"),NT=Yn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ot({key:_T,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),IT=Yn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,g=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=g&&p.parent.childCount===1?b===f.pos:he.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ea()||cT()?s:i},addProseMirrorPlugins(){return[new ot({key:new wt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=he.atStart(e.doc).from,u=he.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!Yp(n.doc))return;const d=n.tr,h=Sc({state:n,transaction:d}),{commands:p}=new wc({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),RT=Yn.create({name:"paste",addProseMirrorPlugins(){return[new ot({key:new wt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),MT=Yn.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new ot({key:new wt("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),OT=Yn.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Vs(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ot({key:new wt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),vI=class Wo{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Wo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Wo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Wo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const u=new Wo(l,this.editor,i,i||o?n:null);i&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},_I=`.ProseMirror {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ProseMirror {
|
|
18
|
+
word-wrap: break-word;
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
white-space: break-spaces;
|
|
21
|
+
-webkit-font-variant-ligatures: none;
|
|
22
|
+
font-variant-ligatures: none;
|
|
23
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ProseMirror [contenteditable="false"] {
|
|
27
|
+
white-space: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror pre {
|
|
35
|
+
white-space: pre-wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
img.ProseMirror-separator {
|
|
39
|
+
display: inline !important;
|
|
40
|
+
border: none !important;
|
|
41
|
+
margin: 0 !important;
|
|
42
|
+
width: 0 !important;
|
|
43
|
+
height: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror-gapcursor {
|
|
47
|
+
display: none;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror-gapcursor:after {
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -2px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-top: 1px solid black;
|
|
60
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ProseMirror-cursor-blink {
|
|
64
|
+
to {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-hideselection *::selection {
|
|
70
|
+
background: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
+
background: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection * {
|
|
78
|
+
caret-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
+
display: block;
|
|
83
|
+
}`;function NI(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var SK=class extends mI{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:WN,createMappablePosition:qN},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=lT(e,this.options.autofocus);this.editorState=Es.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=NI(_I,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=dT(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[vT,ST.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),wT,NT,IT,MT.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),AT,RT,kT,OT.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Ac(s,this)}createCommandManager(){this.commandManager=new wc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Eh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Eh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new sT(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var c;return(c=this.capturedTransaction)==null?void 0:c.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o?.getMeta("focus"),l=o?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return FN(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return zN(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Wp(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
84
|
+
|
|
85
|
+
`,textSerializers:n={}}=t||{};return PN(this.state.doc,{blockSeparator:e,textSerializers:{...gT(this.schema),...n}})}get isEmpty(){return Yp(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new vI(e,this,!1,n)}get $doc(){return this.$pos(0)}};function zs(t){return new gI({find:t.find,handler:({state:e,range:n,match:r})=>{const i=$e(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),c=u+o.length;if(bT(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;c<n.to&&s.delete(c,n.to),u>n.from&&s.delete(n.from+l,u);const d=n.from+l+o.length;s.addMark(n.from+l,d,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}var II={};Hp(II,{createAtomBlockMarkdownSpec:()=>RI,createBlockMarkdownSpec:()=>MI,createInlineMarkdownSpec:()=>LI,parseAttributes:()=>Gp,parseIndentedBlocks:()=>PI,renderNestedMarkdownContent:()=>BI,serializeAttributes:()=>Xp});function Gp(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(c=>c.trim().slice(1));e.class=u.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,u,c])=>{var f;const d=parseInt(((f=c.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),h=n[d];h&&(e[u]=h.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(c=>{c.match(/^[a-zA-Z][\w-]*$/)&&(e[c]=!0)}),e}function Xp(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function RI(t){const{nodeName:e,name:n,parseAttributes:r=Gp,serializeAttributes:i=Xp,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,u=c=>{if(!a)return c;const f={};return a.forEach(d=>{d in c&&(f[d]=c[d])}),f};return{parseMarkdown:(c,f)=>{const d={...s,...c.attributes};return f.createNode(e,d,[])},markdownTokenizer:{name:e,level:"block",start(c){var f;const d=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(f=c.match(d))==null?void 0:f.index;return h!==void 0?h:-1},tokenize(c,f,d){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=c.match(h);if(!p)return;const g=p[1]||"",b=r(g);if(!o.find(E=>!(E in b)))return{type:e,raw:p[0],attributes:b}}},renderMarkdown:c=>{const f=u(c.attrs||{}),d=i(f),h=d?` {${d}}`:"";return`:::${l}${h} :::`}}}function MI(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=Gp,serializeAttributes:s=Xp,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,u=n||e,c=f=>{if(!l)return f;const d={};return l.forEach(h=>{h in f&&(d[h]=f[h])}),d};return{parseMarkdown:(f,d)=>{let h;if(r){const g=r(f);h=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?h=d.parseChildren(f.tokens||[]):h=d.parseInline(f.tokens||[]);const p={...o,...f.attributes};return d.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(f){var d;const h=new RegExp(`^:::${u}`,"m"),p=(d=f.match(h))==null?void 0:d.index;return p!==void 0?p:-1},tokenize(f,d,h){var p;const g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=f.match(g);if(!b)return;const[y,E=""]=b,T=i(E);let v=1;const _=y.length;let k="";const M=/^:::([\w-]*)(\s.*)?/gm,P=f.slice(_);for(M.lastIndex=0;;){const F=M.exec(P);if(F===null)break;const N=F.index,U=F[1];if(!((p=F[2])!=null&&p.endsWith(":::"))){if(U)v+=1;else if(v-=1,v===0){const j=P.slice(0,N);k=j.trim();const V=f.slice(0,_+N+F[0].length);let I=[];if(k)if(a==="block")for(I=h.blockTokens(j),I.forEach(L=>{L.text&&(!L.tokens||L.tokens.length===0)&&(L.tokens=h.inlineTokens(L.text))});I.length>0;){const L=I[I.length-1];if(L.type==="paragraph"&&(!L.text||L.text.trim()===""))I.pop();else break}else I=h.inlineTokens(k);return{type:e,raw:V,attributes:T,content:k,tokens:I}}}}}},renderMarkdown:(f,d)=>{const h=c(f.attrs||{}),p=s(h),g=p?` {${p}}`:"",b=d.renderChildren(f.content||[],`
|
|
86
|
+
|
|
87
|
+
`);return`:::${u}${g}
|
|
88
|
+
|
|
89
|
+
${b}
|
|
90
|
+
|
|
91
|
+
:::`}}}function OI(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,o]=r;e[i]=s||o,r=n.exec(t)}return e}function DI(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function LI(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=OI,serializeAttributes:s=DI,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,u=n||e,c=d=>{if(!l)return d;const h={};return l.forEach(p=>{const g=typeof p=="string"?p:p.name,b=typeof p=="string"?void 0:p.skipIfDefault;if(g in d){const y=d[g];if(b!==void 0&&y===b)return;h[g]=y}}),h},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(d,h)=>{const p={...o,...d.attributes};if(a)return h.createNode(e,p);const g=r?r(d):d.content||"";return g?h.createNode(e,p,[h.createTextNode(g)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(d){const h=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),p=d.match(h),g=p?.index;return g!==void 0?g:-1},tokenize(d,h,p){const g=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),b=d.match(g);if(!b)return;let y="",E="";if(a){const[,v]=b;E=v}else{const[,v,_]=b;E=v,y=_||""}const T=i(E.trim());return{type:e,raw:b[0],content:y.trim(),attributes:T}}},renderMarkdown:d=>{let h="";r?h=r(d):d.content&&d.content.length>0&&(h=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=c(d.attrs||{}),g=s(p),b=g?` ${g}`:"";return a?`[${u}${b}]`:`[${u}${b}]${h}[/${u}]`}}}function PI(t,e,n){var r,i,s,o;const a=t.split(`
|
|
92
|
+
`),l=[];let u="",c=0;const f=e.baseIndentSize||2;for(;c<a.length;){const d=a[c],h=d.match(e.itemPattern);if(!h){if(l.length>0)break;if(d.trim()===""){c+=1,u=`${u}${d}
|
|
93
|
+
`;continue}else return}const p=e.extractItemData(h),{indentLevel:g,mainContent:b}=p;u=`${u}${d}
|
|
94
|
+
`;const y=[b];for(c+=1;c<a.length;){const _=a[c];if(_.trim()===""){const M=a.slice(c+1).findIndex(N=>N.trim()!=="");if(M===-1)break;if((((i=(r=a[c+1+M].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){y.push(_),u=`${u}${_}
|
|
95
|
+
`,c+=1;continue}else break}if((((o=(s=_.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>g)y.push(_),u=`${u}${_}
|
|
96
|
+
`,c+=1;else break}let E;const T=y.slice(1);if(T.length>0){const _=T.map(k=>k.slice(g+f)).join(`
|
|
97
|
+
`);_.trim()&&(e.customNestedParser?E=e.customNestedParser(_):E=n.blockTokens(_))}const v=e.createToken(p,E);l.push(v)}if(l.length!==0)return{items:l,raw:u}}function BI(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=t.content,a=e.renderChildren([s]);let l=`${i}${a}`;return o&&o.length>0&&o.forEach((u,c)=>{var f,d;const h=(d=(f=e.renderChild)==null?void 0:f.call(e,u,c+1))!=null?d:e.renderChildren([u]);if(h!=null){const p=h.split(`
|
|
98
|
+
`).map(g=>g?e.indent(g):e.indent("")).join(`
|
|
99
|
+
`);l+=u.type==="paragraph"?`
|
|
100
|
+
|
|
101
|
+
${p}`:`
|
|
102
|
+
${p}`}}),l}function FI(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const u=s.mapping.map(l),c=s.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(h=>{if(h!==o)return!1;f=h}),!f)return;let d=!1;if(Object.keys(n).forEach(h=>{n[h]!==f.attrs[h]&&(d=!0)}),d){const h=t.type.create({...t.attrs,...n});s.removeMark(u,c,t.type),s.addMark(u,c,h)}}),s.docChanged&&e.view.dispatch(s)}var HI=class DT extends Kp{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new DT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},UI=class{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n,r,i,s,o,a;const{view:l}=this.editor,u=t.target,c=u.nodeType===3?(e=u.parentElement)==null?void 0:e.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(u)||!c)return;let f=0,d=0;if(this.dom!==c){const E=this.dom.getBoundingClientRect(),T=c.getBoundingClientRect(),v=(i=t.offsetX)!=null?i:(r=t.nativeEvent)==null?void 0:r.offsetX,_=(o=t.offsetY)!=null?o:(s=t.nativeEvent)==null?void 0:s.offsetY;f=T.x-E.x+v,d=T.y-E.y+_}const h=this.dom.cloneNode(!0);try{const E=this.dom.getBoundingClientRect();h.style.width=`${Math.round(E.width)}px`,h.style.height=`${Math.round(E.height)}px`,h.style.boxSizing="border-box",h.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(h),document.body.appendChild(p),(a=t.dataTransfer)==null||a.setDragImage(h,f,d)}finally{p&&setTimeout(()=>{try{p?.remove()}catch{}},0)}const g=this.getPos();if(typeof g!="number")return;const b=ae.create(l.state.doc,g),y=l.state.tr.setSelection(b);l.dispatch(y)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const n=t.target;if(!(this.dom.contains(n)&&!((e=this.contentDOM)!=null&&e.contains(n))))return!1;const i=t.type.startsWith("drag"),s=t.type==="dragover"||t.type==="dragenter",o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=ae.isSelectable(this.node),d=t.type==="copy",h=t.type==="paste",p=t.type==="cut",g=t.type==="mousedown";if(!c&&f&&i&&t.target===this.dom&&t.preventDefault(),c&&i&&!u&&t.target===this.dom)return t.preventDefault(),!1;if(c&&l&&!u&&g){const b=n.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||s||o||d||h||p||g&&f)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(Ea()||yh())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:e})=>{const n=this.getPos();return typeof n!="number"?!1:(e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function js(t){return new CI({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=$e(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if(bT(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>f).length)return null;d<n.to&&o.delete(d,n.to),f>n.from&&o.delete(n.from+c,f),u=n.from+c+a.length,o.addMark(n.from+c,u,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const Vn=Math.floor,Jl=Math.abs,Rr=(t,e)=>t<e?t:e,zn=(t,e)=>t>e?t:e,LT=t=>t!==0?t<0:1/t<0,n1=1,r1=2,jf=4,Wf=8,Sa=32,Mr=64,Ut=128,$I=1<<29,vc=31,Ch=63,Oi=127,VI=2147483647,zI=crypto.getRandomValues.bind(crypto),jI=Math.random,PT=()=>zI(new Uint32Array(1))[0],WI=t=>t[Vn(jI()*t.length)],qI="10000000-1000-4000-8000"+-1e11,YI=()=>qI.replace(/[018]/g,t=>(t^PT()&15>>t/4).toString(16));let xh,Sh;if(typeof WeakMap<"u"){let t=new WeakMap;xh=e=>t.get(e),Sh=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;xh=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Sh=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Je=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==n;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==n;a++)o++;return{left:r,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:o==this.height)?null:this.map[r+this.width*(n<0?s-1:o)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:o,right:a,top:l,bottom:u}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(s,u)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,o=this.map[s];n[o]||(n[o]=!0,!(i==t.left&&i&&this.map[s-1]==o||r==t.top&&r&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const a=(t+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(t){return xh(t)||Sh(t,KI(t))}};function KI(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=GI(t),n=t.childCount,r=[];let i=0,s=null;const o=[];for(let u=0,c=e*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){const f=t.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;const g=f.child(p),{colspan:b,rowspan:y,colwidth:E}=g.attrs;for(let T=0;T<y;T++){if(T+u>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:y-T});break}const v=i+T*e;for(let _=0;_<b;_++){r[v+_]==0?r[v+_]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:b-_});const k=E&&E[_];if(k){const M=(v+_)%e*2,P=o[M];P==null||P!=k&&o[M+1]==1?(o[M]=k,o[M+1]=1):P==k&&o[M+1]++}}}i+=b,c+=g.nodeSize}const d=(u+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:u,n:h}),c++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new Je(e,n,r,s);let l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(l=!0);return l&&XI(a,o,t),a}function GI(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let o=0;o<r;o++){const a=t.child(o);for(let l=0;l<a.childCount;l++){const u=a.child(l);o+u.attrs.rowspan>r&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function XI(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const o=n.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let u=0;u<l.colspan;u++){const c=e[(i+u)%t.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((a||(a=QI(l)))[u]=c)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function QI(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Rt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const Yr=new wt("selectingCells");function Ui(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function ZI(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function hr(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Qp(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Ui(e.$head)||JI(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function JI(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function wh(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function eR(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Zp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function BT(t,e,n){const r=t.node(-1),i=Je.get(r),s=t.start(-1),o=i.nextCell(t.pos-s,e,n);return o==null?null:t.node(0).resolve(s+o)}function $i(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function FT(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function tR(t,e,n){const r=Rt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Xe=class Sr extends he{constructor(e,n=e){const r=e.node(-1),i=Je.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=n.pos-s);l.unshift(n.pos-s);const u=l.map(c=>{const f=r.nodeAt(c);if(!f)throw new RangeError(`No cell with offset ${c} found`);const d=s+c+1;return new c2(a.resolve(d),a.resolve(d+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(wh(r)&&wh(i)&&Zp(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Sr.rowSelection(r,i):s&&this.isColSelection()?Sr.colSelection(r,i):new Sr(r,i)}return fe.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=Je.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*n.width+i.left,f=i.left;f<i.right;f++,c++){const d=n.map[c];if(s[d])continue;s[d]=!0;const h=n.findCell(d);let p=e.nodeAt(d);if(!p)throw new RangeError(`No cell with offset ${d} found`);const g=i.left-h.left,b=h.right-i.right;if(g>0||b>0){let y=p.attrs;if(g>0&&(y=$i(y,0,g)),b>0&&(y=$i(y,y.colspan-b,b)),h.left<i.left){if(p=p.type.createAndFill(y),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<i.top||h.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}u.push(p)}o.push(e.child(l).copy(q.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new ee(q.from(a),1,1)}replace(e,n=ee.empty){const r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(l.pos),o?ee.empty:n)}const s=he.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new ee(q.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Je.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(n.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=Je.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(n=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new Sr(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Je.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof Sr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=Je.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(n=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new Sr(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Sr(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Sr(e.resolve(n),e.resolve(r))}getBookmark(){return new nR(this.$anchorCell.pos,this.$headCell.pos)}};Xe.prototype.visible=!1;he.jsonID("cell",Xe);var nR=class HT{constructor(e,n){this.anchor=e,this.head=n}map(e){return new HT(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Zp(n,r)?new Xe(n,r):he.near(r,1)}};function rR(t){if(!(t.selection instanceof Xe))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(ut.node(r,r+n.nodeSize,{class:"selectedCell"}))}),qe.create(t.doc,e)}function iR({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function sR({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function oR(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,o;if(r instanceof ae&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=Xe.create(i,r.from);else if(o=="row"){const a=i.resolve(r.from+1);s=Xe.rowSelection(a,a)}else if(!n){const a=Je.get(r.node),l=r.from+1,u=l+a.map[a.width*a.height-1];s=Xe.create(i,l+1,u)}}else r instanceof fe&&iR(r)?s=fe.create(i,r.from):r instanceof fe&&sR(r)&&(s=fe.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const aR=new wt("fix-tables");function UT(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){const l=e.child(o);for(let u=a,c=Math.min(i,o+3);u<c;u++)if(t.child(u)==l){a=u+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?UT(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function lR(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=uR(t,i,s,n))};return e?e.doc!=t.doc&&UT(e.doc,t.doc,0,r):t.doc.descendants(r),n}function uR(t,e,n,r){const i=Je.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){const u=i.problems[l];if(u.type=="collision"){const c=e.nodeAt(u.pos);if(!c)continue;const f=c.attrs;for(let d=0;d<f.rowspan;d++)s[u.row+d]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,$i(f,f.colspan-u.n,u.n))}else if(u.type=="missing")s[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const c=r.mapping.map(n);r.delete(c,c+e.nodeSize)}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,u=n+1;l<i.height;l++){const c=e.child(l),f=u+c.nodeSize,d=s[l];if(d>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);const p=[];for(let b=0;b<d;b++){const y=Rt(t.schema)[h].createAndFill();y&&p.push(y)}const g=(l==0||o==l-1)&&a==l?u+1:f-1;r.insert(r.mapping.map(g),p)}u=f}return r.setMeta(aR,{fixTables:!0})}function pr(t){const e=t.selection,n=Qp(t),r=n.node(-1),i=n.start(-1),s=Je.get(r);return{...e instanceof Xe?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function $T(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;tR(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],u=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,FT(u.attrs,i-e.colCount(l))),o+=u.attrs.rowspan-1}else{const l=s==null?Rt(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,u=e.positionAt(o,i,r);t.insert(t.mapping.map(n+u),l.createAndFill())}}return t}function wK(t,e){if(!hr(t))return!1;if(e){const n=pr(t);e($T(t.tr,n,n.left))}return!0}function kK(t,e){if(!hr(t))return!1;if(e){const n=pr(t);e($T(t.tr,n,n.right))}return!0}function cR(t,{map:e,table:n,tableStart:r},i){const s=t.mapping.maps.length;for(let o=0;o<e.height;){const a=o*e.width+i,l=e.map[a],u=n.nodeAt(l),c=u.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,$i(c,i-e.colCount(l)));else{const f=t.mapping.slice(s).map(r+l);t.delete(f,f+u.nodeSize)}o+=c.rowspan}}function AK(t,e){if(!hr(t))return!1;if(e){const n=pr(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;cR(r,n,i),i!=n.left;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=Je.get(s)}e(r)}return!0}function fR(t,e,n){var r;const i=Rt(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))===null||r===void 0?void 0:r.type)!=i)return!1;return!0}function VT(t,{map:e,tableStart:n,table:r},i){let s=n;for(let u=0;u<i;u++)s+=r.child(u).nodeSize;const o=[];let a=i>0?-1:0;fR(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let u=0,c=e.width*i;u<e.width;u++,c++)if(i>0&&i<e.height&&e.map[c]==e.map[c-e.width]){const f=e.map[c],d=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...d,rowspan:d.rowspan+1}),u+=d.colspan-1}else{var l;const f=a==null?Rt(r.type.schema).cell:(l=r.nodeAt(e.map[c+a*e.width]))===null||l===void 0?void 0:l.type,d=f?.createAndFill();d&&o.push(d)}return t.insert(s,Rt(r.type.schema).row.create(null,o)),t}function vK(t,e){if(!hr(t))return!1;if(e){const n=pr(t);e(VT(t.tr,n,n.top))}return!0}function _K(t,e){if(!hr(t))return!1;if(e){const n=pr(t);e(VT(t.tr,n,n.bottom))}return!0}function dR(t,{map:e,table:n,tableStart:r},i){let s=0;for(let u=0;u<i;u++)s+=n.child(u).nodeSize;const o=s+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(s+r,o+r);const l=new Set;for(let u=0,c=i*e.width;u<e.width;u++,c++){const f=e.map[c];if(!l.has(f)){if(l.add(f),i>0&&f==e.map[c-e.width]){const d=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...d,rowspan:d.rowspan-1}),u+=d.colspan-1}else if(i<e.height&&f==e.map[c+e.width]){const d=n.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),g=e.positionAt(i+1,u,n);t.insert(t.mapping.slice(a).map(r+g),p),u+=h.colspan-1}}}}function NK(t,e){if(!hr(t))return!1;if(e){const n=pr(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;dR(r,n,i),i!=n.top;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=Je.get(n.table)}e(r)}return!0}function i1(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function hR({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,o=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[o]==n[o+t])return!0;i++,o++}return!1}function IK(t,e){const n=t.selection;if(!(n instanceof Xe)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=pr(t),{map:i}=r;if(hR(i,r))return!1;if(e){const s=t.tr,o={};let a=q.empty,l,u;for(let c=r.top;c<r.bottom;c++)for(let f=r.left;f<r.right;f++){const d=i.map[c*i.width+f],h=r.table.nodeAt(d);if(!(o[d]||!h))if(o[d]=!0,l==null)l=d,u=h;else{i1(h)||(a=a.append(h.content));const p=s.mapping.map(d+r.tableStart);s.delete(p,p+h.nodeSize)}}if(l==null||u==null)return!0;if(s.setNodeMarkup(l+r.tableStart,null,{...FT(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),rowspan:r.bottom-r.top}),a.size>0){const c=l+1+u.content.size,f=i1(u)?l+1:c;s.replaceWith(f+r.tableStart,c+r.tableStart,a)}s.setSelection(new Xe(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function RK(t,e){const n=Rt(t.schema);return pR(({node:r})=>n[r.type.spec.tableRole])(t,e)}function pR(t){return(e,n)=>{const r=e.selection;let i,s;if(r instanceof Xe){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,s=r.$anchorCell.pos}else{var o;if(i=ZI(r.$from),!i)return!1;s=(o=Ui(r.$from))===null||o===void 0?void 0:o.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],u=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const c=pr(e),f=e.tr;for(let h=0;h<c.right-c.left;h++)l.push(u?{...a,colwidth:u&&u[h]?[u[h]]:null}:a);let d;for(let h=c.top;h<c.bottom;h++){let p=c.map.positionAt(h,c.left,c.table);h==c.top&&(p+=i.nodeSize);for(let g=c.left,b=0;g<c.right;g++,b++)g==c.left&&h==c.top||f.insert(d=f.mapping.map(p+c.tableStart,1),t({node:i,row:h,col:g}).createAndFill(l[b]))}f.setNodeMarkup(s,t({node:i,row:c.top,col:c.left}),l[0]),r instanceof Xe&&f.setSelection(new Xe(f.doc.resolve(r.$anchorCell.pos),d?f.doc.resolve(d):void 0)),n(f)}return!0}}function mR(t){return function(e,n){if(!hr(e))return!1;if(n){const r=Rt(e.schema),i=pr(e),s=e.tr,o=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[l],r.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],r.header_cell,a[l].attrs);n(s)}return!0}}function s1(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Jp(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?mR(t):function(n,r){if(!hr(n))return!1;if(r){const i=Rt(n.schema),s=pr(n),o=n.tr,a=s1("row",s,i),l=s1("column",s,i),u=(t==="column"?a:t==="row"&&l)?1:0,c=t=="column"?{left:0,top:u,right:1,bottom:s.map.height}:t=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,f=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(c).forEach(d=>{const h=d+s.tableStart,p=o.doc.nodeAt(h);p&&o.setNodeMarkup(h,f,p.attrs)}),r(o)}return!0}}Jp("row",{useDeprecatedLogic:!0});Jp("column",{useDeprecatedLogic:!0});Jp("cell",{useDeprecatedLogic:!0});function gR(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function MK(t){return function(e,n){if(!hr(e))return!1;const r=gR(Qp(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(fe.between(i,eR(i))).scrollIntoView())}return!0}}function wl(t,e){const n=t.selection;if(!(n instanceof Xe))return!1;if(e){const r=t.tr,i=Rt(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new ee(i,0,0))}),r.docChanged&&e(r)}return!0}function bR(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content;const c=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=kh(Rt(o).row,new ee(u,c,f)).content),a.push(u)}else if(s=="cell"||s=="header_cell")a.push(n||r?kh(Rt(o).row,new ee(e,n,r)).content:e);else return null;return yR(o,a)}function yR(t,e){const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:a,colspan:l}=s.child(o).attrs;for(let u=i;u<i+a;u++)n[u]=(n[u]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(q.empty),n[i]<r){const s=Rt(t).cell.createAndFill(),o=[];for(let a=n[i];a<r;a++)o.push(s);e[i]=e[i].append(q.from(o))}return{height:e.length,width:r,rows:e}}function kh(t,e){const n=t.createAndFill();return new xp(n).replace(0,n.content.size,e).doc}function ER({width:t,height:e,rows:n},r,i){if(t!=r){const s=[],o=[];for(let a=0;a<n.length;a++){const l=n[a],u=[];for(let c=s[a]||0,f=0;c<r;f++){let d=l.child(f%l.childCount);c+d.attrs.colspan>r&&(d=d.type.createChecked($i(d.attrs,d.attrs.colspan,c+d.attrs.colspan-r),d.content)),u.push(d),c+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)s[a+h]=(s[a+h]||0)+d.attrs.colspan}o.push(q.from(u))}n=o,t=r}if(e!=i){const s=[];for(let o=0,a=0;o<i;o++,a++){const l=[],u=n[a%e];for(let c=0;c<u.childCount;c++){let f=u.child(c);o+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}s.push(q.from(l))}n=s,e=i}return{width:t,height:e,rows:n}}function TR(t,e,n,r,i,s,o){const a=t.doc.type.schema,l=Rt(a);let u,c;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const h=n.child(f);d+=h.nodeSize;const p=[];let g;h.lastChild==null||h.lastChild.type==l.cell?g=u||(u=l.cell.createAndFill()):g=c||(c=l.header_cell.createAndFill());for(let b=e.width;b<i;b++)p.push(g);t.insert(t.mapping.slice(o).map(d-1+r),p)}if(s>e.height){const f=[];for(let p=0,g=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const b=p>=e.width?!1:n.nodeAt(e.map[g+p]).type==l.header_cell;f.push(b?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const d=l.row.create(null,q.from(f)),h=[];for(let p=e.height;p<s;p++)h.push(d);t.insert(t.mapping.slice(o).map(r+n.nodeSize-2),h)}return!!(u||c)}function o1(t,e,n,r,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let u=i;u<s;u++){const c=o*e.width+u,f=e.map[c];if(e.map[c-e.width]==f){l=!0;const d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...d.attrs,rowspan:o-h}),t.insert(t.mapping.slice(a).map(e.positionAt(o,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-o})),u+=d.attrs.colspan-1}}return l}function a1(t,e,n,r,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let u=i;u<s;u++){const c=u*e.width+o,f=e.map[c];if(e.map[c-1]==f){l=!0;const d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(a).map(f+r);t.setNodeMarkup(p,null,$i(d.attrs,o-h,d.attrs.colspan-(o-h))),t.insert(p+d.nodeSize,d.type.createAndFill($i(d.attrs,0,o-h))),u+=d.attrs.rowspan-1}}return l}function l1(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let o=Je.get(s);const{top:a,left:l}=r,u=l+i.width,c=a+i.height,f=t.tr;let d=0;function h(){if(s=n?f.doc.nodeAt(n-1):f.doc,!s)throw new Error("No table found");o=Je.get(s),d=f.mapping.maps.length}TR(f,o,s,n,u,c,d)&&h(),o1(f,o,s,n,l,u,a,d)&&h(),o1(f,o,s,n,l,u,c,d)&&h(),a1(f,o,s,n,a,c,l,d)&&h(),a1(f,o,s,n,a,c,u,d)&&h();for(let p=a;p<c;p++){const g=o.positionAt(p,l,s),b=o.positionAt(p,u,s);f.replace(f.mapping.slice(d).map(g+n),f.mapping.slice(d).map(b+n),new ee(i.rows[p-a],0,0))}h(),f.setSelection(new Xe(f.doc.resolve(n+o.positionAt(a,l,s)),f.doc.resolve(n+o.positionAt(c-1,u-1,s)))),e(f)}const CR=Fp({ArrowLeft:kl("horiz",-1),ArrowRight:kl("horiz",1),ArrowUp:kl("vert",-1),ArrowDown:kl("vert",1),"Shift-ArrowLeft":Al("horiz",-1),"Shift-ArrowRight":Al("horiz",1),"Shift-ArrowUp":Al("vert",-1),"Shift-ArrowDown":Al("vert",1),Backspace:wl,"Mod-Backspace":wl,Delete:wl,"Mod-Delete":wl});function eu(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function kl(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof Xe)return eu(n,r,he.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const o=zT(i,t,e);if(o==null)return!1;if(t=="horiz")return eu(n,r,he.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(o),l=BT(a,t,e);let u;return l?u=he.near(l,1):e<0?u=he.near(n.doc.resolve(a.before(-1)),-1):u=he.near(n.doc.resolve(a.after(-1)),1),eu(n,r,u)}}}function Al(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let o;if(s instanceof Xe)o=s;else{const l=zT(i,t,e);if(l==null)return!1;o=new Xe(n.doc.resolve(l))}const a=BT(o.$headCell,t,e);return a?eu(n,r,new Xe(o.$anchorCell,a)):!1}}function xR(t,e){const n=t.state.doc,r=Ui(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Xe(r))),!0):!1}function SR(t,e,n){if(!hr(t.state))return!1;let r=bR(n);const i=t.state.selection;if(i instanceof Xe){r||(r={width:1,height:1,rows:[q.from(kh(Rt(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=Je.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=ER(r,a.right-a.left,a.bottom-a.top),l1(t.state,t.dispatch,o,a,r),!0}else if(r){const s=Qp(t.state),o=s.start(-1);return l1(t.state,t.dispatch,o,Je.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function wR(t,e){var n;if(e.button!=0||e.ctrlKey||e.metaKey)return;const r=u1(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Xe)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Ui(t.state.selection.$anchor))!=null&&((n=qf(t,e))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(l,u){let c=qf(t,u);const f=Yr.getState(t.state)==null;if(!c||!Zp(l,c))if(f)c=l;else return;const d=new Xe(l,c);if(f||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);f&&h.setMeta(Yr,l.pos),t.dispatch(h)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",a),Yr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Yr,-1))}function a(l){const u=l,c=Yr.getState(t.state);let f;if(c!=null)f=t.state.doc.resolve(c);else if(u1(t,u.target)!=r&&(f=qf(t,e),!f))return o();f&&s(f,u)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",a)}function zT(t,e,n){if(!(t.state.selection instanceof fe))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=r.before(i),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}function u1(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function qf(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Ui(t.state.doc.resolve(r))||Ui(t.state.doc.resolve(i))}var kR=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,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",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ah(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Ah(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Ah(t,e,n,r,i,s){let o=0,a=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let f=0,d=0;f<u.childCount;f++){const{colspan:h,colwidth:p}=u.child(f).attrs;for(let g=0;g<h;g++,d++){const b=i==d?s:p&&p[g],y=b?b+"px":"";if(o+=b||r,b||(a=!1),l)l.style.width!=y&&(l.style.width=y),l=l.nextSibling;else{const E=document.createElement("col");E.style.width=y,e.appendChild(E)}}}for(;l;){var c;const f=l.nextSibling;(c=l.parentNode)===null||c===void 0||c.removeChild(l),l=f}a?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const mn=new wt("tableColumnResizing");function OK({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=kR,lastColumnResizable:i=!0}={}){const s=new ot({key:mn,state:{init(o,a){var l;const u=(l=s.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,c=Rt(a.schema).table.name;return r&&u&&(u[c]=(f,d)=>new r(f,n,d)),new AR(-1,!1)},apply(o,a){return a.apply(o)}},props:{attributes:o=>{const a=mn.getState(o);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,a)=>{vR(o,a,t,i)},mouseleave:o=>{_R(o)},mousedown:(o,a)=>{NR(o,a,e,n)}},decorations:o=>{const a=mn.getState(o);if(a&&a.activeHandle>-1)return DR(o,a.activeHandle)},nodeViews:{}}});return s}var AR=class tu{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(mn);if(r&&r.setHandle!=null)return new tu(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new tu(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return wh(e.doc.resolve(i))||(i=-1),new tu(i,n.dragging)}return n}};function vR(t,e,n,r){if(!t.editable)return;const i=mn.getState(t.state);if(i&&!i.dragging){const s=RR(e.target);let o=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=n?o=c1(t,e,"left",n):l-e.clientX<=n&&(o=c1(t,e,"right",n))}if(o!=i.activeHandle){if(!r&&o!==-1){const a=t.state.doc.resolve(o),l=a.node(-1),u=Je.get(l),c=a.start(-1);if(u.colCount(a.pos-c)+a.nodeAfter.attrs.colspan-1==u.width-1)return}jT(t,o)}}}function _R(t){if(!t.editable)return;const e=mn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&jT(t,-1)}function NR(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,o=mn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const a=t.state.doc.nodeAt(o.activeHandle),l=IR(t,o.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(mn,{setDragging:{startX:e.clientX,startWidth:l}}));function u(f){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",c);const d=mn.getState(t.state);d?.dragging&&(MR(t,d.activeHandle,f1(d.dragging,f,n)),t.dispatch(t.state.tr.setMeta(mn,{setDragging:null})))}function c(f){if(!f.which)return u(f);const d=mn.getState(t.state);if(d&&d.dragging){const h=f1(d.dragging,f,n);d1(t,d.activeHandle,h,r)}}return d1(t,o.activeHandle,l,r),s.addEventListener("mouseup",u),s.addEventListener("mousemove",c),e.preventDefault(),!0}function IR(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let o=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(o-=r[l],a--);return o/a}function RR(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function c1(t,e,n,r){const i=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,a=Ui(t.state.doc.resolve(o));if(!a)return-1;if(n=="right")return a.pos;const l=Je.get(a.node(-1)),u=a.start(-1),c=l.map.indexOf(a.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function f1(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function jT(t,e){t.dispatch(t.state.tr.setMeta(mn,{setHandle:e}))}function MR(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=Je.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let u=0;u<s.height;u++){const c=u*s.width+a;if(u&&s.map[c]==s.map[c-s.width])continue;const f=s.map[c],d=i.nodeAt(f).attrs,h=d.colspan==1?0:a-s.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;const p=d.colwidth?d.colwidth.slice():OR(d.colspan);p[h]=n,l.setNodeMarkup(o+f,null,{...d,colwidth:p})}l.docChanged&&t.dispatch(l)}function d1(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=Je.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Ah(s,l.firstChild,l,r,a,n)}function OR(t){return Array(t).fill(0)}function DR(t,e){const n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return qe.empty;const s=Je.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let u=0;u<s.height;u++){const c=a+u*s.width;if((a==s.width-1||s.map[c]!=s.map[c+1])&&(u==0||s.map[c]!=s.map[c-s.width])){var l;const f=s.map[c],d=o+f+i.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((l=mn.getState(t))===null||l===void 0)&&l.dragging&&n.push(ut.node(o+f,o+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),n.push(ut.widget(d,h))}}return qe.create(t.doc,n)}function DK({allowTableNodeSelection:t=!1}={}){return new ot({key:Yr,state:{init(){return null},apply(e,n){const r=e.getMeta(Yr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:rR,handleDOMEvents:{mousedown:wR},createSelectionBetween(e){return Yr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:xR,handleKeyDown:CR,handlePaste:SR},appendTransaction(e,n,r){return oR(r,lR(r,n),t)}})}var LR=class WT{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,n,r){e<0||this.cache.set(e,[n,r])}replace(e,n,r,i){this.remove(e),this.set(n,r,i)}remove(e){this.cache.delete(e)}invalidate(e){const n=new WT(this.cache),r=e.mapping;return this.cache.forEach(([i,s],o)=>{if(o<0)return;const a=r.mapResult(o),l=e.doc.nodeAt(a.pos);if(a.deleted||!l?.eq(i))n.remove(o);else if(o!==a.pos){const u=s.map(c=>c.map(r,0,0)).filter(c=>c!=null);n.replace(o,a.pos,l,u)}}),n}};function LK({parser:t,nodeTypes:e=["code_block","codeBlock"],languageExtractor:n=r=>r.attrs.language}){const r=new wt("prosemirror-highlight");return new ot({key:r,state:{init(i,s){const o=new LR,[a,l]=h1(s.doc,t,e,n,o);return{cache:o,decorations:a,promises:l}},apply:(i,s)=>{const o=s.cache.invalidate(i),a=!!i.getMeta("prosemirror-highlight-refresh");if(!i.docChanged&&!a)return{cache:o,decorations:s.decorations?.map(i.mapping,i.doc),promises:s.promises};const[l,u]=h1(i.doc,t,e,n,o);return{cache:o,decorations:l,promises:u}}},view:i=>{const s=new Set,o=()=>{if(s.size>0||i.isDestroyed)return;const l=i.state.tr.setMeta("prosemirror-highlight-refresh",!0);i.dispatch(l)},a=()=>{const l=r.getState(i.state);for(const u of l?.promises??[])s.add(u),u.then(()=>{s.delete(u),o()}).catch(c=>{console.error("[prosemirror-highlight] Error resolving parser:",c),s.delete(u)})};return a(),{update:()=>{a()}}},props:{decorations(i){return this.getState(i)?.decorations}}})}function h1(t,e,n,r,i){const s=[],o=[],a=PR(t,n);try{for(const[l,u]of a){const c=r(l),f=i.get(u);if(f){const[d,h]=f;h.length>0&&s.push(h)}else{const d=e({content:l.textContent,language:c||void 0,pos:u,size:l.nodeSize});d&&Array.isArray(d)?(i.set(u,l,d),d.length>0&&s.push(d)):d instanceof Promise?(i.remove(u),o.push(d)):console.error("[prosemirror-highlight] Invalid parser result:",d)}}}catch(l){console.error("[prosemirror-highlight] Error parsing code blocks:",l)}return[s.length>0?qe.create(t,s.flat()):void 0,o]}function PR(t,e){const n=[];return t.descendants((r,i)=>{if(r.type.inlineContent&&e.includes(r.type.name))return n.push([r,i]),!1}),n}function PK(t,e){return function({content:r,language:i,pos:s,size:o}){const a=[],{tokens:l,fg:u,bg:c,rootStyle:f}=t.codeToTokens(r,{lang:i,theme:t.getLoadedThemes()[0]}),d=f||(u&&c?`--prosemirror-highlight:${u};--prosemirror-highlight-bg:${c}`:"");if(d){const p=ut.node(s,s+o,{style:d});a.push(p)}let h=s+1;for(const p of l){for(const g of p){const b=h+g.content.length,y=ut.inline(h,b,{style:BR(g.htmlStyle??`color: ${g.color}`),class:"shiki"});a.push(y),h=b}h+=1}return a}}function BR(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const Mn=()=>new Map,vh=t=>{const e=Mn();return t.forEach((n,r)=>{e.set(r,n)}),e},mr=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},FR=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},HR=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},Vi=()=>new Set,Yf=t=>t[t.length-1],UR=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},ui=Array.from,em=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},tm=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},$R=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},Ws=Array.isArray;class qT{constructor(){this._observers=Mn()}on(e,n){return mr(this._observers,e,Vi).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return ui((this._observers.get(e)||Mn()).values()).forEach(r=>r(...n))}destroy(){this._observers=Mn()}}const Nu=Number.MAX_SAFE_INTEGER,p1=Number.MIN_SAFE_INTEGER,VR=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Vn(t)===t),YT=String.fromCharCode,zR=t=>t.toLowerCase(),jR=/^\s*/g,WR=t=>t.replace(jR,""),qR=/([A-Z])/g,m1=(t,e)=>WR(t.replace(qR,n=>`${e}${zR(n)}`)),YR=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},wa=typeof TextEncoder<"u"?new TextEncoder:null,KR=t=>wa.encode(t),GR=wa?KR:YR;let ea=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});ea&&ea.decode(new Uint8Array).length===1&&(ea=null);const XR=(t,e)=>$R(e,()=>t).join("");class Ya{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Ka=()=>new Ya,QR=t=>{const e=Ka();return t(e),Fn(e)},ZR=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Fn=t=>{const e=new Uint8Array(ZR(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},JR=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(zn(n,e)*2),t.cpos=0)},dt=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},_h=dt,ve=(t,e)=>{for(;e>Oi;)dt(t,Ut|Oi&e),e=Vn(e/128);dt(t,Oi&e)},nm=(t,e)=>{const n=LT(e);for(n&&(e=-e),dt(t,(e>Ch?Ut:0)|(n?Mr:0)|Ch&e),e=Vn(e/64);e>0;)dt(t,(e>Oi?Ut:0)|Oi&e),e=Vn(e/128)},Nh=new Uint8Array(3e4),e4=Nh.length/3,t4=(t,e)=>{if(e.length<e4){const n=wa.encodeInto(e,Nh).written||0;ve(t,n);for(let r=0;r<n;r++)dt(t,Nh[r])}else fn(t,GR(e))},n4=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;ve(t,r);for(let i=0;i<r;i++)dt(t,n.codePointAt(i))},As=wa&&wa.encodeInto?t4:n4,_c=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=Rr(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(zn(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},fn=(t,e)=>{ve(t,e.byteLength),_c(t,e)},rm=(t,e)=>{JR(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},r4=(t,e)=>rm(t,4).setFloat32(0,e,!1),i4=(t,e)=>rm(t,8).setFloat64(0,e,!1),s4=(t,e)=>rm(t,8).setBigInt64(0,e,!1),g1=new DataView(new ArrayBuffer(4)),o4=t=>(g1.setFloat32(0,t),g1.getFloat32(0)===t),qs=(t,e)=>{switch(typeof e){case"string":dt(t,119),As(t,e);break;case"number":VR(e)&&Jl(e)<=VI?(dt(t,125),nm(t,e)):o4(e)?(dt(t,124),r4(t,e)):(dt(t,123),i4(t,e));break;case"bigint":dt(t,122),s4(t,e);break;case"object":if(e===null)dt(t,126);else if(Ws(e)){dt(t,117),ve(t,e.length);for(let n=0;n<e.length;n++)qs(t,e[n])}else if(e instanceof Uint8Array)dt(t,116),fn(t,e);else{dt(t,118);const n=Object.keys(e);ve(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];As(t,i),qs(t,e[i])}}break;case"boolean":dt(t,e?120:121);break;default:dt(t,127)}};class b1 extends Ya{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ve(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const y1=t=>{t.count>0&&(nm(t.encoder,t.count===1?t.s:-t.s),t.count>1&&ve(t.encoder,t.count-2))};class nu{constructor(){this.encoder=new Ya,this.s=0,this.count=0}write(e){this.s===e?this.count++:(y1(this),this.count=1,this.s=e)}toUint8Array(){return y1(this),Fn(this.encoder)}}const E1=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);nm(t.encoder,e),t.count>1&&ve(t.encoder,t.count-2)}};class Kf{constructor(){this.encoder=new Ya,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(E1(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return E1(this),Fn(this.encoder)}}class a4{constructor(){this.sarr=[],this.s="",this.lensE=new nu}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Ya;return this.sarr.push(this.s),this.s="",As(e,this.sarr.join("")),_c(e,this.lensE.toUint8Array()),Fn(e)}}const fr=t=>new Error(t),On=()=>{throw fr("Method unimplemented")},zt=()=>{throw fr("Unexpected case")},KT=fr("Unexpected end of array"),GT=fr("Integer out of Range");class Nc{constructor(e){this.arr=e,this.pos=0}}const uo=t=>new Nc(t),l4=t=>t.pos!==t.arr.length,u4=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},dn=t=>u4(t,we(t)),Ys=t=>t.arr[t.pos++],we=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&Oi)*n,n*=128,i<Ut)return e;if(e>Nu)throw GT}throw KT},im=t=>{let e=t.arr[t.pos++],n=e&Ch,r=64;const i=(e&Mr)>0?-1:1;if((e&Ut)===0)return i*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&Oi)*r,r*=128,e<Ut)return i*n;if(n>Nu)throw GT}throw KT},c4=t=>{let e=we(t);if(e===0)return"";{let n=String.fromCodePoint(Ys(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Ys(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},f4=t=>ea.decode(dn(t)),vs=ea?f4:c4,sm=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},d4=t=>sm(t,4).getFloat32(0,!1),h4=t=>sm(t,8).getFloat64(0,!1),p4=t=>sm(t,8).getBigInt64(0,!1),m4=[t=>{},t=>null,im,d4,h4,p4,t=>!1,t=>!0,vs,t=>{const e=we(t),n={};for(let r=0;r<e;r++){const i=vs(t);n[i]=ka(t)}return n},t=>{const e=we(t),n=[];for(let r=0;r<e;r++)n.push(ka(t));return n},dn],ka=t=>m4[127-Ys(t)](t);class T1 extends Nc{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),l4(this)?this.count=we(this)+1:this.count=-1),this.count--,this.s}}class ru extends Nc{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=im(this);const e=LT(this.s);this.count=1,e&&(this.s=-this.s,this.count=we(this)+2)}return this.count--,this.s}}class Gf extends Nc{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=im(this),n=e&1;this.diff=Vn(e/2),this.count=1,n&&(this.count=we(this)+2)}return this.s+=this.diff,this.count--,this.s}}class g4{constructor(e){this.decoder=new ru(e),this.str=vs(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const b4=Date.now,C1=t=>new Promise(t);Promise.all.bind(Promise);const x1=t=>t===void 0?null:t;class y4{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let XT=new y4,E4=!0;try{typeof localStorage<"u"&&localStorage&&(XT=localStorage,E4=!1)}catch{}const T4=XT,Aa=Symbol("Equality"),QT=(t,e)=>t===e||!!t?.[Aa]?.(e)||!1,C4=t=>typeof t=="object",x4=Object.assign,ZT=Object.keys,S4=(t,e)=>{for(const n in t)e(t[n],n)},Iu=t=>ZT(t).length,w4=t=>{for(const e in t)return!1;return!0},co=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},om=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),k4=(t,e)=>t===e||Iu(t)===Iu(e)&&co(t,(n,r)=>(n!==void 0||om(e,r))&&QT(e[r],n)),A4=Object.freeze,JT=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&JT(t[e])}return A4(t)},am=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&am(t,e,n+1)}},v4=t=>t,iu=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[Aa]!=null)return t[Aa](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!iu(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Iu(t)!==Iu(e))return!1;for(const n in t)if(!om(t,n)||!iu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!iu(t[n],e[n]))return!1;break;default:return!1}return!0},_4=(t,e)=>e.includes(t);var eC={};const Ks=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",tC=typeof window<"u"&&typeof document<"u"&&!Ks;let Zn;const N4=()=>{if(Zn===void 0)if(Ks){Zn=Mn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Zn.set(e,""),e=r):e!==null&&(Zn.set(e,r),e=null)}e!==null&&Zn.set(e,"")}else typeof location=="object"?(Zn=Mn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Zn.set(`--${m1(e,"-")}`,n),Zn.set(`-${m1(e,"-")}`,n)}})):Zn=Mn();return Zn},Ih=t=>N4().has(t),Ru=t=>x1(Ks?eC[t.toUpperCase().replaceAll("-","_")]:T4.getItem(t)),nC=t=>Ih("--"+t)||Ru(t)!==null,I4=nC("production"),R4=Ks&&_4(eC.FORCE_COLOR,["true","1","2"]),M4=R4||!Ih("--no-colors")&&!nC("no-color")&&(!Ks||process.stdout.isTTY)&&(!Ks||Ih("--color")||Ru("COLORTERM")!==null||(Ru("TERM")||"").includes("color")),O4=t=>new Uint8Array(t),D4=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=YT(t[n]);return btoa(e)},L4=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),P4=tC?D4:L4,B4=t=>{const e=O4(t.byteLength);return e.set(t),e},F4=t=>QR(e=>qs(e,t));class H4{constructor(e,n){this.left=e,this.right=n}}const xr=(t,e)=>new H4(t,e),S1=t=>t.next()>=.5,Xf=(t,e,n)=>Vn(t.next()*(n+1-e)+e),rC=(t,e,n)=>Vn(t.next()*(n+1-e)+e),lm=(t,e,n)=>rC(t,e,n),U4=t=>YT(lm(t,97,122)),$4=(t,e=0,n=20)=>{const r=lm(t,e,n);let i="";for(let s=0;s<r;s++)i+=U4(t);return i},Qf=(t,e)=>e[lm(t,0,e.length-1)],V4=Symbol("0schema");class z4{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(XR(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
|
|
103
|
+
`)}}const Rh=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[Aa]?QT(t,e):Ws(t)?em(t,n=>tm(e,r=>Rh(n,r))):C4(t)?co(t,(n,r)=>Rh(n,e[r])):!1;let jt=class{static _dilutes=!1;extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),Rh(n,r)}equals(e){return this.constructor===e.constructor&&iu(this.shape,e.shape)}[V4](){return!0}[Aa](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){On()}get nullable(){return fo(this,Dc)}get optional(){return new oC(this)}cast(e){return w1(e,this),e}expect(e){return w1(e,this),e}};class um extends jt{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=e?.constructor===this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}const at=(t,e=null)=>new um(t,e);at(um);class cm extends jt{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&n?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),r}}const yt=t=>new cm(t);at(cm);class Ic extends jt{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&n?.extend(null,this.shape.join(" | "),e.toString()),r}}const Rc=(...t)=>new Ic(t),iC=at(Ic),j4=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),sC=t=>{if(Gs.check(t))return[j4(t)];if(iC.check(t))return t.shape.map(e=>e+"");if(mC.check(t))return["[+-]?\\d+.?\\d*"];if(gC.check(t))return[".*"];if(Mu.check(t))return t.shape.map(sC).flat(1);zt()};class W4 extends jt{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(sC).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&n?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),r}}at(W4);const q4=Symbol("optional");class oC extends jt{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&n?.extend(null,"undefined (optional)","()"),r}get[q4](){return!0}}const Y4=at(oC);class K4 extends jt{check(e,n){return n?.extend(null,"never",typeof e),!1}}at(K4);class Mc extends jt{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}static _dilutes=!0;get partial(){return new Mc(this.shape,!0)}check(e,n){return e==null?(n?.extend(null,"object","null"),!1):co(this.shape,(r,i)=>{const s=this._isPartial&&!om(e,i)||r.check(e[i],n);return!s&&n?.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match"),s})}}const G4=t=>new Mc(t),X4=at(Mc),Q4=yt(t=>t!=null&&(t.constructor===Object||t.constructor==null));class aC extends jt{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&co(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&n?.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(r,n)})}}const lC=(t,e)=>new aC(t,e),Z4=at(aC);class uC extends jt{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&co(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&n?.extend(i.toString(),"Tuple",typeof r),s})}}const J4=(...t)=>new uC(t);at(uC);class cC extends jt{constructor(e){super(),this.shape=e.length===1?e[0]:new fm(e)}check(e,n){const r=Ws(e)&&em(e,i=>this.shape.check(i));return!r&&n?.extend(null,"Array",""),r}}const fC=(...t)=>new cC(t),e6=at(cC),t6=yt(t=>Ws(t));class dC extends jt{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name),r}}const n6=(t,e=null)=>new dC(t,e);at(dC);const r6=n6(jt);class i6 extends jt{constructor(e){super(),this.len=e.length-1,this.args=J4(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&n?.extend(null,"function",typeof e),r}}const s6=at(i6),o6=yt(t=>typeof t=="function");class a6 extends jt{constructor(e){super(),this.shape=e}check(e,n){const r=em(this.shape,i=>i.check(e,n));return!r&&n?.extend(null,"Intersectinon",typeof e),r}}at(a6,t=>t.shape.length>0);class fm extends jt{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,n){const r=tm(this.shape,i=>i.check(e,n));return n?.extend(null,"Union",typeof e),r}}const fo=(...t)=>t.findIndex(e=>Mu.check(e))>=0?fo(...t.map(e=>va(e)).map(e=>Mu.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new fm(t),Mu=at(fm),hC=()=>!0,Ou=yt(hC),l6=at(cm,t=>t.shape===hC),dm=yt(t=>typeof t=="bigint"),u6=yt(t=>t===dm),pC=yt(t=>typeof t=="symbol");yt(t=>t===pC);const _s=yt(t=>typeof t=="number"),mC=yt(t=>t===_s),Gs=yt(t=>typeof t=="string"),gC=yt(t=>t===Gs),Oc=yt(t=>typeof t=="boolean"),c6=yt(t=>t===Oc),bC=Rc(void 0);at(Ic,t=>t.shape.length===1&&t.shape[0]===void 0);Rc(void 0);const Dc=Rc(null),f6=at(Ic,t=>t.shape.length===1&&t.shape[0]===null);at(Uint8Array);at(um,t=>t.shape===Uint8Array);const d6=fo(_s,Gs,Dc,bC,dm,Oc,pC);(()=>{const t=fC(Ou),e=lC(Gs,Ou),n=fo(_s,Gs,Dc,Oc,t,e);return t.shape=n,e.shape.values=n,n})();const va=t=>{if(r6.check(t))return t;if(Q4.check(t)){const e={};for(const n in t)e[n]=va(t[n]);return G4(e)}else{if(t6.check(t))return fo(...t.map(va));if(d6.check(t))return Rc(t);if(o6.check(t))return at(t)}zt()},w1=I4?()=>{}:(t,e)=>{const n=new z4;if(!e.check(t,n))throw fr(`Expected value to be of type ${e.constructor.name}.
|
|
104
|
+
${n.toString()}`)};class h6{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:va(e),h:n}),this}else(e){return this.if(Ou,e)}done(){return(e,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw fr("Unhandled pattern")}}}const p6=t=>new h6(t),yC=p6(Ou).if(mC,(t,e)=>Xf(e,p1,Nu)).if(gC,(t,e)=>$4(e)).if(c6,(t,e)=>S1(e)).if(u6,(t,e)=>BigInt(Xf(e,p1,Nu))).if(Mu,(t,e)=>ss(e,Qf(e,t.shape))).if(X4,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(Y4.check(i)){if(S1(e))continue;i=i.shape}n[r]=yC(i,e)}return n}).if(e6,(t,e)=>{const n=[],r=rC(e,0,42);for(let i=0;i<r;i++)n.push(ss(e,t.shape));return n}).if(iC,(t,e)=>Qf(e,t.shape)).if(f6,(t,e)=>null).if(s6,(t,e)=>{const n=ss(e,t.res);return()=>n}).if(l6,(t,e)=>ss(e,Qf(e,[_s,Gs,Dc,bC,dm,Oc,fC(_s),lC(fo("a","b","c"),_s)]))).if(Z4,(t,e)=>{const n={},r=Xf(e,0,3);for(let i=0;i<r;i++){const s=ss(e,t.shape.keys),o=ss(e,t.shape.values);n[s]=o}return n}).done(),ss=(t,e)=>yC(va(e),t),Ga=typeof document<"u"?document:{};yt(t=>t.nodeType===E6);typeof DOMParser<"u"&&new DOMParser;yt(t=>t.nodeType===g6);yt(t=>t.nodeType===b6);const m6=t=>FR(t,(e,n)=>`${n}:${e};`).join(""),g6=Ga.ELEMENT_NODE,b6=Ga.TEXT_NODE,y6=Ga.DOCUMENT_NODE,E6=Ga.DOCUMENT_FRAGMENT_NODE;yt(t=>t.nodeType===y6);const T6=t=>class{constructor(n){this._=n}destroy(){t(this._)}},C6=T6(clearTimeout),hm=(t,e)=>new C6(setTimeout(e,t)),Fr=Symbol,EC=Fr(),TC=Fr(),x6=Fr(),S6=Fr(),w6=Fr(),CC=Fr(),k6=Fr(),pm=Fr(),A6=Fr(),v6=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const i=t[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const i=t[r];i instanceof Symbol||n.push(i)}return n},_6={[EC]:xr("font-weight","bold"),[TC]:xr("font-weight","normal"),[x6]:xr("color","blue"),[w6]:xr("color","green"),[S6]:xr("color","grey"),[CC]:xr("color","red"),[k6]:xr("color","purple"),[pm]:xr("color","orange"),[A6]:xr("color","black")},N6=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],r=Mn();let i=[],s=0;for(;s<t.length;s++){const o=t[s],a=_6[o];if(a!==void 0)r.set(a.left,a.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const l=m6(r);s>0||l.length>0?(e.push("%c"+o),n.push(l)):e.push(o)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s<t.length;s++){const o=t[s];o instanceof Symbol||i.push(o)}return i},xC=M4?N6:v6,I6=(...t)=>{console.log(...xC(t)),wC.forEach(e=>e.print(t))},SC=(...t)=>{console.warn(...xC(t)),t.unshift(pm),wC.forEach(e=>e.print(t))},wC=Vi(),kC=t=>({[Symbol.iterator](){return this},next:t}),R6=(t,e)=>kC(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Zf=(t,e)=>kC(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Lc{constructor(e,n){this.clock=e,this.len=n}}class ho{constructor(){this.clients=new Map}}const ci=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],a=o.id.clock+o.length;for(let l=0,u=r[l];l<r.length&&u.clock<a;u=r[++l])HC(t,s,u.clock,u.len,n)}}),M6=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=Vn((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;n=i+1}else r=i-1}return null},po=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&M6(n,e.clock)!==null},mm=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?e[r-1]=new Lc(i.clock,zn(i.len,s.clock+s.len-i.clock)):(r<n&&(e[r]=s),r++)}e.length=r})},Mh=t=>{const e=new ho;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o<t.length;o++)UR(s,t[o].clients.get(i)||[]);e.clients.set(i,s)}});return mm(e),e},_a=(t,e,n,r)=>{mr(t.clients,e,()=>[]).push(new Lc(n,r))},AC=()=>new ho,vC=t=>{const e=AC();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s<n.length;s++){const o=n[s];if(o.deleted){const a=o.id.clock;let l=o.length;if(s+1<n.length)for(let u=n[s+1];s+1<n.length&&u.deleted;u=n[++s+1])l+=u.length;i.push(new Lc(a,l))}}i.length>0&&e.clients.set(r,i)}),e},mo=(t,e)=>{ve(t.restEncoder,e.clients.size),ui(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),ve(t.restEncoder,n);const i=r.length;ve(t.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},gm=t=>{const e=new ho,n=we(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=we(t.restDecoder),s=we(t.restDecoder);if(s>0){const o=mr(e.clients,i,()=>[]);for(let a=0;a<s;a++)o.push(new Lc(t.readDsClock(),t.readDsLen()))}}return e},k1=(t,e,n)=>{const r=new ho,i=we(t.restDecoder);for(let s=0;s<i;s++){t.resetDsCurVal();const o=we(t.restDecoder),a=we(t.restDecoder),l=n.clients.get(o)||[],u=et(n,o);for(let c=0;c<a;c++){const f=t.readDsClock(),d=f+t.readDsLen();if(f<u){u<d&&_a(r,o,u,d-u);let h=jn(l,f),p=l[h];for(!p.deleted&&p.id.clock<f&&(l.splice(h+1,0,Uu(e,p,f-p.id.clock)),h++);h<l.length&&(p=l[h++],p.id.clock<d);)p.deleted||(d<p.id.clock+p.length&&l.splice(h,0,Uu(e,p,d-p.id.clock)),p.delete(e))}else _a(r,o,f,d-f)}}if(r.clients.size>0){const s=new zi;return ve(s.restEncoder,0),mo(s,r),s.toUint8Array()}return null},_C=PT;class Xi extends qT{constructor({guid:e=YI(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=_C(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new BC,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=C1(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>C1(u=>{const c=f=>{(f===void 0||f===!0)&&(this.off("sync",c),u())};this.on("sync",c)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Fe(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ui(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Fe(this,e,n)}get(e,n=mt){const r=mr(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==mt&&i!==n)if(i===mt){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Rs)}getText(e=""){return this.get(e,fi)}getMap(e=""){return this.get(e,Qs)}getXmlElement(e=""){return this.get(e,Ht)}getXmlFragment(e=""){return this.get(e,ji)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,ui(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Xi({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Fe(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class NC{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return we(this.restDecoder)}readDsLen(){return we(this.restDecoder)}}class IC extends NC{readLeftID(){return Ee(we(this.restDecoder),we(this.restDecoder))}readRightID(){return Ee(we(this.restDecoder),we(this.restDecoder))}readClient(){return we(this.restDecoder)}readInfo(){return Ys(this.restDecoder)}readString(){return vs(this.restDecoder)}readParentInfo(){return we(this.restDecoder)===1}readTypeRef(){return we(this.restDecoder)}readLen(){return we(this.restDecoder)}readAny(){return ka(this.restDecoder)}readBuf(){return B4(dn(this.restDecoder))}readJSON(){return JSON.parse(vs(this.restDecoder))}readKey(){return vs(this.restDecoder)}}class O6{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=we(this.restDecoder),this.dsCurrVal}readDsLen(){const e=we(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Xs extends O6{constructor(e){super(e),this.keys=[],we(e),this.keyClockDecoder=new Gf(dn(e)),this.clientDecoder=new ru(dn(e)),this.leftClockDecoder=new Gf(dn(e)),this.rightClockDecoder=new Gf(dn(e)),this.infoDecoder=new T1(dn(e),Ys),this.stringDecoder=new g4(dn(e)),this.parentInfoDecoder=new T1(dn(e),Ys),this.typeRefDecoder=new ru(dn(e)),this.lenDecoder=new ru(dn(e))}readLeftID(){return new Ns(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ns(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return ka(this.restDecoder)}readBuf(){return dn(this.restDecoder)}readJSON(){return ka(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class RC{constructor(){this.restEncoder=Ka()}toUint8Array(){return Fn(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ve(this.restEncoder,e)}writeDsLen(e){ve(this.restEncoder,e)}}class Xa extends RC{writeLeftID(e){ve(this.restEncoder,e.client),ve(this.restEncoder,e.clock)}writeRightID(e){ve(this.restEncoder,e.client),ve(this.restEncoder,e.clock)}writeClient(e){ve(this.restEncoder,e)}writeInfo(e){_h(this.restEncoder,e)}writeString(e){As(this.restEncoder,e)}writeParentInfo(e){ve(this.restEncoder,e?1:0)}writeTypeRef(e){ve(this.restEncoder,e)}writeLen(e){ve(this.restEncoder,e)}writeAny(e){qs(this.restEncoder,e)}writeBuf(e){fn(this.restEncoder,e)}writeJSON(e){As(this.restEncoder,JSON.stringify(e))}writeKey(e){As(this.restEncoder,e)}}class MC{constructor(){this.restEncoder=Ka(),this.dsCurrVal=0}toUint8Array(){return Fn(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,ve(this.restEncoder,n)}writeDsLen(e){e===0&&zt(),ve(this.restEncoder,e-1),this.dsCurrVal+=e}}class zi extends MC{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Kf,this.clientEncoder=new nu,this.leftClockEncoder=new Kf,this.rightClockEncoder=new Kf,this.infoEncoder=new b1(_h),this.stringEncoder=new a4,this.parentInfoEncoder=new b1(_h),this.typeRefEncoder=new nu,this.lenEncoder=new nu}toUint8Array(){const e=Ka();return ve(e,0),fn(e,this.keyClockEncoder.toUint8Array()),fn(e,this.clientEncoder.toUint8Array()),fn(e,this.leftClockEncoder.toUint8Array()),fn(e,this.rightClockEncoder.toUint8Array()),fn(e,Fn(this.infoEncoder)),fn(e,this.stringEncoder.toUint8Array()),fn(e,Fn(this.parentInfoEncoder)),fn(e,this.typeRefEncoder.toUint8Array()),fn(e,this.lenEncoder.toUint8Array()),_c(e,Fn(this.restEncoder)),Fn(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){qs(this.restEncoder,e)}writeBuf(e){fn(this.restEncoder,e)}writeJSON(e){qs(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const D6=(t,e,n,r)=>{r=zn(r,e[0].id.clock);const i=jn(e,r);ve(t.restEncoder,e.length-i),t.writeClient(n),ve(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(t,0)},bm=(t,e,n)=>{const r=new Map;n.forEach((i,s)=>{et(e,s)>i&&r.set(s,i)}),Qa(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),ve(t.restEncoder,r.size),ui(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{D6(t,e.clients.get(i),i,s)})},L6=(t,e)=>{const n=Mn(),r=we(t.restDecoder);for(let i=0;i<r;i++){const s=we(t.restDecoder),o=new Array(s),a=t.readClient();let l=we(t.restDecoder);n.set(a,{i:0,refs:o});for(let u=0;u<s;u++){const c=t.readInfo();switch(vc&c){case 0:{const f=t.readLen();o[u]=new _n(Ee(a,l),f),l+=f;break}case 10:{const f=we(t.restDecoder);o[u]=new Nn(Ee(a,l),f),l+=f;break}default:{const f=(c&(Mr|Ut))===0,d=new je(Ee(a,l),null,(c&Ut)===Ut?t.readLeftID():null,null,(c&Mr)===Mr?t.readRightID():null,f?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,f&&(c&Sa)===Sa?t.readString():null,ax(t,c));o[u]=d,l+=d.length}}}}return n},P6=(t,e,n)=>{const r=[];let i=ui(n.keys()).sort((h,p)=>h-p);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let h=n.get(i[i.length-1]);for(;h.refs.length===h.i;)if(i.pop(),i.length>0)h=n.get(i[i.length-1]);else return null;return h};let o=s();if(o===null)return null;const a=new BC,l=new Map,u=(h,p)=>{const g=l.get(h);(g==null||g>p)&&l.set(h,p)};let c=o.refs[o.i++];const f=new Map,d=()=>{for(const h of r){const p=h.id.client,g=n.get(p);g?(g.i--,a.clients.set(p,g.refs.slice(g.i)),n.delete(p),g.i=0,g.refs=[]):a.clients.set(p,[h]),i=i.filter(b=>b!==p)}r.length=0};for(;;){if(c.constructor!==Nn){const p=mr(f,c.id.client,()=>et(e,c.id.client))-c.id.clock;if(p<0)r.push(c),u(c.id.client,c.id.clock-1),d();else{const g=c.getMissing(t,e);if(g!==null){r.push(c);const b=n.get(g)||{refs:[],i:0};if(b.refs.length===b.i)u(g,et(e,g)),d();else{c=b.refs[b.i++];continue}}else(p===0||p<c.length)&&(c.integrate(t,p),f.set(c.id.client,c.id.clock+c.length))}}if(r.length>0)c=r.pop();else if(o!==null&&o.i<o.refs.length)c=o.refs[o.i++];else{if(o=s(),o===null)break;c=o.refs[o.i++]}}if(a.clients.size>0){const h=new zi;return bm(h,a,new Map),ve(h.restEncoder,0),{missing:l,update:h.toUint8Array()}}return null},B6=(t,e)=>bm(t,e.doc.store,e.beforeState),F6=(t,e,n,r=new Xs(t))=>Fe(e,i=>{i.local=!1;let s=!1;const o=i.doc,a=o.store,l=L6(r,o),u=P6(i,a,l),c=a.pendingStructs;if(c){for(const[d,h]of c.missing)if(h<et(a,d)){s=!0;break}if(u){for(const[d,h]of u.missing){const p=c.missing.get(d);(p==null||p>h)&&c.missing.set(d,h)}c.update=Lu([c.update,u.update])}}else a.pendingStructs=u;const f=k1(r,i,a);if(a.pendingDs){const d=new Xs(uo(a.pendingDs));we(d.restDecoder);const h=k1(d,i,a);f&&h?a.pendingDs=Lu([f,h]):a.pendingDs=f||h}else a.pendingDs=f;if(s){const d=a.pendingStructs.update;a.pendingStructs=null,Du(i.doc,d)}},n,!1),Du=(t,e,n,r=Xs)=>{const i=uo(e);F6(i,t,n,new r(i))},HK=(t,e,n)=>Du(t,e,n,IC),H6=(t,e,n=new Map)=>{bm(t,e.store,n),mo(t,vC(e.store))},U6=(t,e=new Uint8Array([0]),n=new zi)=>{const r=OC(e);H6(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(iM(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===Xa)return nM(i.map((s,o)=>o===0?s:oM(s)));if(n.constructor===zi)return Lu(i)}return i[0]},UK=(t,e)=>U6(t,e,new Xa),$6=t=>{const e=new Map,n=we(t.restDecoder);for(let r=0;r<n;r++){const i=we(t.restDecoder),s=we(t.restDecoder);e.set(i,s)}return e},OC=t=>$6(new NC(uo(t))),DC=(t,e)=>(ve(t.restEncoder,e.size),ui(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{ve(t.restEncoder,n),ve(t.restEncoder,r)}),t),V6=(t,e)=>DC(t,Qa(e.store)),z6=(t,e=new MC)=>(t instanceof Map?DC(e,t):V6(e,t),e.toUint8Array()),$K=t=>z6(t,new RC);class j6{constructor(){this.l=[]}}const A1=()=>new j6,v1=(t,e)=>t.l.push(e),_1=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},LC=(t,e,n)=>am(t.l,[e,n]);class Ns{constructor(e,n){this.client=e,this.clock=n}}const Ts=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ee=(t,e)=>new Ns(t,e),Na=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw zt()},Ia=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Ra{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}const ta=t=>new Ra(t.type==null?null:Ee(t.type.client,t.type.clock),t.tname??null,t.item==null?null:Ee(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class W6{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const q6=(t,e,n=0)=>new W6(t,e,n),vl=(t,e,n)=>{let r=null,i=null;return t._item===null?i=Na(t):r=Ee(t._item.id.client,t._item.id.clock),new Ra(r,i,e,n)},Jf=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return vl(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return vl(t,Ee(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return vl(t,r.lastId,n);r=r.right}return vl(t,null,n)},Y6=(t,e)=>{const n=Is(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},K6=(t,e,n=!0)=>{const r=e.store,i=t.item,s=t.type,o=t.tname,a=t.assoc;let l=null,u=0;if(i!==null){if(et(r,i.client)<=i.clock)return null;const c=n?Ph(r,i):Y6(r,i),f=c.item;if(!(f instanceof je))return null;if(l=f.parent,l._item===null||!l._item.deleted){u=f.deleted||!f.countable?0:c.diff+(a>=0?0:1);let d=f.left;for(;d!==null;)!d.deleted&&d.countable&&(u+=d.length),d=d.left}}else{if(o!==null)l=e.get(o);else if(s!==null){if(et(r,s.client)<=s.clock)return null;const{item:c}=n?Ph(r,s):{item:Is(r,s)};if(c instanceof je&&c.content instanceof Kn)l=c.content.type;else return null}else throw zt();a>=0?u=l._length:u=0}return q6(l,u,t.assoc)},N1=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&Ts(t.item,e.item)&&Ts(t.type,e.type)&&t.assoc===e.assoc;class ym{constructor(e,n){this.ds=e,this.sv=n}}const PC=(t,e)=>new ym(t,e),ed=t=>PC(vC(t.store),Qa(t.store)),ki=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!po(e.ds,t.id),Oh=(t,e)=>{const n=mr(t.meta,Oh,Vi),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i<et(r,s)&&Qt(t,Ee(s,i))}),ci(t,e.ds,i=>{}),n.add(e))};class BC{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Qa=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},et=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},FC=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw zt()}n.push(e)},jn=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=Vn(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;n=o+1}else r=o-1;o=Vn((n+r)/2)}throw zt()},G6=(t,e)=>{const n=t.clients.get(e.client);return n[jn(n,e.clock)]},Is=G6,Dh=(t,e,n)=>{const r=jn(e,n),i=e[r];return i.id.clock<n&&i instanceof je?(e.splice(r+1,0,Uu(t,i,n-i.id.clock)),r+1):r},Qt=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Dh(t,n,e.clock)]},I1=(t,e,n)=>{const r=e.clients.get(n.client),i=jn(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==_n&&r.splice(i+1,0,Uu(t,s,n.clock-s.id.clock+1)),s},X6=(t,e,n)=>{const r=t.clients.get(e.id.client);r[jn(r,e.id.clock)]=n},HC=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=Dh(t,e,n),a;do a=e[o++],s<a.id.clock+a.length&&Dh(t,e,s),i(a);while(o<e.length&&e[o].id.clock<s)};class Q6{constructor(e,n,r){this.doc=e,this.deleteSet=new ho,this.beforeState=Qa(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const R1=(t,e)=>e.deleteSet.clients.size===0&&!HR(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(mm(e.deleteSet),B6(t,e),mo(t,e.deleteSet),!0),M1=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&mr(t.changed,e,Vi).add(n)},su=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof je&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},Z6=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let u=jn(s,a.clock),c=s[u];u<s.length&&c.id.clock<l;c=s[++u]){const f=s[u];if(a.clock+a.len<=f.id.clock)break;f instanceof je&&f.deleted&&!f.keep&&n(f)&&f.gc(e,!1)}}}},J6=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=Rr(i.length-1,1+jn(i,o.clock+o.len-1));for(let l=a,u=i[l];l>0&&u.id.clock>=o.clock;u=i[l])l-=1+su(i,l)}})},UC=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,o=n._mergeStructs;try{mm(s),n.afterState=Qa(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,u)=>a.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(l=l.filter(c=>c.target._item===null||!c.target._item.deleted),l.forEach(c=>{c.currentTarget=u,c._path=null}),l.sort((c,f)=>c.path.length-f.path.length),a.push(()=>{LC(u._dEH,l,n)}))}),a.push(()=>r.emit("afterTransaction",[n,r])),a.push(()=>{n._needFormattingCleanup&&TM(n)})}),am(a,[])}finally{r.gc&&Z6(s,i,r.gcFilter),J6(s,i),n.afterState.forEach((c,f)=>{const d=n.beforeState.get(f)||0;if(d!==c){const h=i.clients.get(f),p=zn(jn(h,d),1);for(let g=h.length-1;g>=p;)g-=1+su(h,g)}});for(let c=o.length-1;c>=0;c--){const{client:f,clock:d}=o[c].id,h=i.clients.get(f),p=jn(h,d);p+1<h.length&&su(h,p+1)>1||p>0&&su(h,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(I6(pm,EC,"[yjs] ",TC,CC,"Changed the client-id because another client seems to be using it."),r.clientID=_C()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const c=new Xa;R1(c,n)&&r.emit("update",[c.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const c=new zi;R1(c,n)&&r.emit("updateV2",[c.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:u}=n;(a.size>0||u.size>0||l.size>0)&&(a.forEach(c=>{c.clientID=r.clientID,c.collectionid==null&&(c.collectionid=r.collectionid),r.subdocs.add(c)}),u.forEach(c=>r.subdocs.delete(c)),r.emit("subdocs",[{loaded:l,added:a,removed:u},r,n]),u.forEach(c=>c.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):UC(t,e+1)}}},Fe=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new Q6(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&UC(i,0)}}return o};class eM{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const O1=(t,e,n)=>{ci(t,n.deletions,r=>{r instanceof je&&e.scope.some(i=>i===t.doc||Ia(i,r))&&Am(r,!1)})},D1=(t,e,n)=>{let r=null;const i=t.doc,s=t.scope;Fe(i,a=>{for(;e.length>0&&t.currStackItem===null;){const l=i.store,u=e.pop(),c=new Set,f=[];let d=!1;ci(a,u.insertions,h=>{if(h instanceof je){if(h.redone!==null){let{item:p,diff:g}=Ph(l,h.id);g>0&&(p=Qt(a,Ee(p.id.client,p.id.clock+g))),h=p}!h.deleted&&s.some(p=>p===a.doc||Ia(p,h))&&f.push(h)}}),ci(a,u.deletions,h=>{h instanceof je&&s.some(p=>p===a.doc||Ia(p,h))&&!po(u.insertions,h.id)&&c.add(h)}),c.forEach(h=>{d=ox(a,h,c,u.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let h=f.length-1;h>=0;h--){const p=f[h];t.deleteFilter(p)&&(p.delete(a),d=!0)}t.currStackItem=d?u:null}a.changed.forEach((l,u)=>{l.has(null)&&u._searchMarker&&(u._searchMarker.length=0)}),r=a},t);const o=t.currStackItem;if(o!=null){const a=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:a,origin:t},t]),t.currStackItem=null}return o};class $C extends qT{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:i=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:a=Ws(e)?e[0].doc:e instanceof Xi?e:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=i,s.add(this),this.trackedOrigins=s,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(b=>l.changedParentTypes.has(b)||b===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const u=this.undoing,c=this.redoing,f=u?this.redoStack:this.undoStack;u?this.stopCapturing():c||this.clear(!1,!0);const d=new ho;l.afterState.forEach((b,y)=>{const E=l.beforeState.get(y)||0,T=b-E;T>0&&_a(d,y,E,T)});const h=b4();let p=!1;if(this.lastChange>0&&h-this.lastChange<this.captureTimeout&&f.length>0&&!u&&!c){const b=f[f.length-1];b.deletions=Mh([b.deletions,l.deleteSet]),b.insertions=Mh([b.insertions,d])}else f.push(new eM(l.deleteSet,d)),p=!0;!u&&!c&&(this.lastChange=h),ci(l,l.deleteSet,b=>{b instanceof je&&this.scope.some(y=>y===l.doc||Ia(y,b))&&Am(b,!0)});const g=[{stackItem:f[f.length-1],origin:l.origin,type:u?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=Ws(e)?e:[e],e.forEach(r=>{n.has(r)||(n.add(r),(r instanceof mt?r.doc!==this.doc:r!==this.doc)&&SC("[yjs#509] Not same Y.Doc"),this.scope.push(r))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(i=>O1(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>O1(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=D1(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=D1(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*tM(t){const e=we(t.restDecoder);for(let n=0;n<e;n++){const r=we(t.restDecoder),i=t.readClient();let s=we(t.restDecoder);for(let o=0;o<r;o++){const a=t.readInfo();if(a===10){const l=we(t.restDecoder);yield new Nn(Ee(i,s),l),s+=l}else if((vc&a)!==0){const l=(a&(Mr|Ut))===0,u=new je(Ee(i,s),null,(a&Ut)===Ut?t.readLeftID():null,null,(a&Mr)===Mr?t.readRightID():null,l?t.readParentInfo()?t.readString():t.readLeftID():null,l&&(a&Sa)===Sa?t.readString():null,ax(t,a));yield u,s+=u.length}else{const l=t.readLen();yield new _n(Ee(i,s),l),s+=l}}}}class Em{constructor(e,n){this.gen=tM(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Nn);return this.curr}}class Tm{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const nM=t=>Lu(t,IC,Xa),rM=(t,e)=>{if(t.constructor===_n){const{client:n,clock:r}=t.id;return new _n(Ee(n,r+e),t.length-e)}else if(t.constructor===Nn){const{client:n,clock:r}=t.id;return new Nn(Ee(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new je(Ee(r,i+e),null,Ee(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Lu=(t,e=Xs,n=zi)=>{if(t.length===1)return t[0];const r=t.map(c=>new e(uo(c)));let i=r.map(c=>new Em(c,!0)),s=null;const o=new n,a=new Tm(o);for(;i=i.filter(d=>d.curr!==null),i.sort((d,h)=>{if(d.curr.id.client===h.curr.id.client){const p=d.curr.id.clock-h.curr.id.clock;return p===0?d.curr.constructor===h.curr.constructor?0:d.curr.constructor===Nn?1:-1:p}else return h.curr.id.client-d.curr.id.client}),i.length!==0;){const c=i[0],f=c.curr.id.client;if(s!==null){let d=c.curr,h=!1;for(;d!==null&&d.id.clock+d.length<=s.struct.id.clock+s.struct.length&&d.id.client>=s.struct.id.client;)d=c.next(),h=!0;if(d===null||d.id.client!==f||h&&d.id.clock>s.struct.id.clock+s.struct.length)continue;if(f!==s.struct.id.client)Kr(a,s.struct,s.offset),s={struct:d,offset:0},c.next();else if(s.struct.id.clock+s.struct.length<d.id.clock)if(s.struct.constructor===Nn)s.struct.length=d.id.clock+d.length-s.struct.id.clock;else{Kr(a,s.struct,s.offset);const p=d.id.clock-s.struct.id.clock-s.struct.length;s={struct:new Nn(Ee(f,s.struct.id.clock+s.struct.length),p),offset:0}}else{const p=s.struct.id.clock+s.struct.length-d.id.clock;p>0&&(s.struct.constructor===Nn?s.struct.length-=p:d=rM(d,p)),s.struct.mergeWith(d)||(Kr(a,s.struct,s.offset),s={struct:d,offset:0},c.next())}}else s={struct:c.curr,offset:0},c.next();for(let d=c.curr;d!==null&&d.id.client===f&&d.id.clock===s.struct.id.clock+s.struct.length&&d.constructor!==Nn;d=c.next())Kr(a,s.struct,s.offset),s={struct:d,offset:0}}s!==null&&(Kr(a,s.struct,s.offset),s=null),Cm(a);const l=r.map(c=>gm(c)),u=Mh(l);return mo(o,u),o.toUint8Array()},iM=(t,e,n=Xs,r=zi)=>{const i=OC(e),s=new r,o=new Tm(s),a=new n(uo(t)),l=new Em(a,!1);for(;l.curr;){const c=l.curr,f=c.id.client,d=i.get(f)||0;if(l.curr.constructor===Nn){l.next();continue}if(c.id.clock+c.length>d)for(Kr(o,c,zn(d-c.id.clock,0)),l.next();l.curr&&l.curr.id.client===f;)Kr(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===f&&l.curr.id.clock+l.curr.length<=d;)l.next()}Cm(o);const u=gm(a);return mo(s,u),s.toUint8Array()},VC=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Fn(t.encoder.restEncoder)}),t.encoder.restEncoder=Ka(),t.written=0)},Kr=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&VC(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),ve(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},Cm=t=>{VC(t);const e=t.encoder.restEncoder;ve(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const r=t.clientStructs[n];ve(e,r.written),_c(e,r.restEncoder)}},sM=(t,e,n,r)=>{const i=new n(uo(t)),s=new Em(i,!1),o=new r,a=new Tm(o);for(let u=s.curr;u!==null;u=s.next())Kr(a,e(u),0);Cm(a);const l=gm(i);return mo(o,l),o.toUint8Array()},oM=t=>sM(t,v4,Xs,Xa),L1="You must not compute changes after the event-handler fired.";class Pc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=aM(this.currentTarget,this.target))}deletes(e){return po(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw fr(L1);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=Yf(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=Yf(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=Yf(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw fr(L1);const n=this.target,r=Vi(),i=Vi(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=u.length,i.add(u)):this.adds(u)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(u.content.getContent()),r.add(u)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=u.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const aM=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},Nt=()=>{SC("Invalid access: Add Yjs type to a document before reading data.")},zC=80;let xm=0;class lM{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=xm++}}const uM=t=>{t.timestamp=xm++},jC=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=xm++},cM=(t,e,n)=>{if(t.length>=zC){const r=t.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return jC(r,e,n),r}else{const r=new lM(e,n);return t.push(r),r}},Bc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>Jl(e-s.index)<Jl(e-o.index)?s:o);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,uM(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Jl(n.index-i)<r.parent.length/zC?(jC(n,r,i),n):cM(t._searchMarker,r,i)},Ma=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=zn(e,i.index+n))}},Fc=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;mr(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;LC(r._eH,n,e)};class mt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=A1(),this._dEH=A1(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw On()}clone(){throw On()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){v1(this._eH,e)}observeDeep(e){v1(this._dEH,e)}unobserve(e){_1(this._eH,e)}unobserveDeep(e){_1(this._dEH,e)}toJSON(){}}const WC=(t,e,n)=>{t.doc??Nt(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a<o.length&&r>0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},qC=t=>{t.doc??Nt();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},YC=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&ki(r,e)){const i=r.content.getContent();for(let s=0;s<i.length;s++)n.push(i[s])}r=r.right}return n},Oa=(t,e)=>{let n=0,r=t._start;for(t.doc??Nt();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],n++,t)}r=r.right}},KC=(t,e)=>{const n=[];return Oa(t,(r,i)=>{n.push(e(r,i,t))}),n},fM=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},GC=(t,e)=>{t.doc??Nt();const n=Bc(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Pu=(t,e,n,r)=>{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let u=[];const c=()=>{u.length>0&&(i=new je(Ee(o,et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Wi(u)),i.integrate(t,0),u=[])};r.forEach(f=>{if(f===null)u.push(f);else switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(f);break;default:switch(c(),f.constructor){case Uint8Array:case ArrayBuffer:i=new je(Ee(o,et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Za(new Uint8Array(f))),i.integrate(t,0);break;case Xi:i=new je(Ee(o,et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Ja(f)),i.integrate(t,0);break;default:if(f instanceof mt)i=new je(Ee(o,et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Kn(f)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),c()},XC=()=>fr("Length exceeded!"),QC=(t,e,n,r)=>{if(n>e._length)throw XC();if(n===0)return e._searchMarker&&Ma(e._searchMarker,n,r.length),Pu(t,e,null,r);const i=n,s=Bc(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&Qt(t,Ee(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&Ma(e._searchMarker,i,r.length),Pu(t,e,o,r)},dM=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Pu(t,e,i,n)},ZC=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=Bc(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&Qt(t,Ee(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&Qt(t,Ee(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw XC();e._searchMarker&&Ma(e._searchMarker,i,-s+r)},Bu=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},Sm=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new Wi([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new Wi([r]);break;case Uint8Array:a=new Za(r);break;case Xi:a=new Ja(r);break;default:if(r instanceof mt)a=new Kn(r);else throw new Error("Unexpected content type")}new je(Ee(o,et(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},wm=(t,e)=>{t.doc??Nt();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},JC=t=>{const e={};return t.doc??Nt(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},ex=(t,e)=>{t.doc??Nt();const n=t._map.get(e);return n!==void 0&&!n.deleted},hM=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&ki(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},_l=t=>(t.doc??Nt(),R6(t._map.entries(),e=>!e[1].deleted));class pM extends Pc{}class Rs extends mt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Rs;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Rs}clone(){const e=new Rs;return e.insert(0,this.toArray().map(n=>n instanceof mt?n.clone():n)),e}get length(){return this.doc??Nt(),this._length}_callObserver(e,n){super._callObserver(e,n),Fc(this,e,new pM(this,e))}insert(e,n){this.doc!==null?Fe(this.doc,r=>{QC(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Fe(this.doc,n=>{dM(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Fe(this.doc,r=>{ZC(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return GC(this,e)}toArray(){return qC(this)}slice(e=0,n=this.length){return WC(this,e,n)}toJSON(){return this.map(e=>e instanceof mt?e.toJSON():e)}map(e){return KC(this,e)}forEach(e){Oa(this,e)}[Symbol.iterator](){return fM(this)}_write(e){e.writeTypeRef(HM)}}const mM=t=>new Rs;class gM extends Pc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Qs extends mt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Qs}clone(){const e=new Qs;return this.forEach((n,r)=>{e.set(r,n instanceof mt?n.clone():n)}),e}_callObserver(e,n){Fc(this,e,new gM(this,e,n))}toJSON(){this.doc??Nt();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof mt?i.toJSON():i}}),e}get size(){return[..._l(this)].length}keys(){return Zf(_l(this),e=>e[0])}values(){return Zf(_l(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Zf(_l(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Nt(),this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Fe(this.doc,n=>{Bu(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Fe(this.doc,r=>{Sm(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return wm(this,e)}has(e){return ex(this,e)}clear(){this.doc!==null?Fe(this.doc,e=>{this.forEach(function(n,r,i){Bu(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(UM)}}const bM=t=>new Qs,Jr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&k4(t,e);class Lh{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){this.right===null&&zt(),this.right.content.constructor===st?this.right.deleted||go(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const P1=(t,e,n)=>{for(;e.right!==null&&n>0;)e.right.content.constructor===st?e.right.deleted||go(e.currentAttributes,e.right.content):e.right.deleted||(n<e.right.length&&Qt(t,Ee(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length),e.left=e.right,e.right=e.right.right;return e},Nl=(t,e,n,r)=>{const i=new Map,s=r?Bc(e,n):null;if(s){const o=new Lh(s.p.left,s.p,s.index,i);return P1(t,o,n-s.index)}else{const o=new Lh(null,e._start,0,i);return P1(t,o,n)}},tx=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===st&&Jr(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,a)=>{const l=n.left,u=n.right,c=new je(Ee(s,et(i.store,s)),l,l&&l.lastId,u,u&&u.id,e,null,new st(a,o));c.integrate(t,0),n.right=c,n.forward()})},go=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},nx=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===st&&Jr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},rx=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],u=n.currentAttributes.get(a)??null;if(!Jr(u,l)){o.set(a,u);const{left:c,right:f}=n;n.right=new je(Ee(s,et(i.store,s)),c,c&&c.lastId,f,f&&f.id,e,null,new st(a,l)),n.right.integrate(t,0),n.forward()}}return o},td=(t,e,n,r,i)=>{n.currentAttributes.forEach((d,h)=>{i[h]===void 0&&(i[h]=null)});const s=t.doc,o=s.clientID;nx(n,i);const a=rx(t,e,n,i),l=r.constructor===String?new Wn(r):r instanceof mt?new Kn(r):new Qi(r);let{left:u,right:c,index:f}=n;e._searchMarker&&Ma(e._searchMarker,n.index,l.getLength()),c=new je(Ee(o,et(s.store,o)),u,u&&u.lastId,c,c&&c.id,e,null,l),c.integrate(t,0),n.right=c,n.index=f,n.forward(),tx(t,e,n,a)},B1=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;nx(n,i);const a=rx(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===st));){if(!n.right.deleted)switch(n.right.content.constructor){case st:{const{key:l,value:u}=n.right.content,c=i[l];if(c!==void 0){if(Jr(c,u))a.delete(l);else{if(r===0)break e;a.set(l,u)}n.right.delete(t)}else n.currentAttributes.set(l,u);break}default:r<n.right.length&&Qt(t,Ee(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
|
|
105
|
+
`;n.right=new je(Ee(o,et(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Wn(l)),n.right.integrate(t,0),n.forward()}tx(t,e,n,a)},ix=(t,e,n,r,i)=>{let s=e;const o=Mn();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===st){const u=s.content;o.set(u.key,u)}s=s.right}let a=0,l=!1;for(;e!==s;){if(n===e&&(l=!0),!e.deleted){const u=e.content;if(u.constructor===st){const{key:c,value:f}=u,d=r.get(c)??null;(o.get(c)!==u||d===f)&&(e.delete(t),a++,!l&&(i.get(c)??null)===f&&d!==f&&(d===null?i.delete(c):i.set(c,d))),!l&&!e.deleted&&go(i,u)}}e=e.right}return a},yM=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===st){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},EM=t=>{let e=0;return Fe(t.doc,n=>{let r=t._start,i=t._start,s=Mn();const o=vh(s);for(;i;)i.deleted===!1&&(i.content.constructor===st?go(o,i.content):(e+=ix(n,r,i,s,o),s=vh(o),r=i)),i=i.right}),e},TM=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&HC(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===st&&o.constructor!==_n&&e.add(o.parent)})}Fe(n,r=>{ci(t,t.deleteSet,i=>{if(i instanceof _n||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===st?e.add(s):yM(r,i)});for(const i of e)EM(i)})},F1=(t,e,n)=>{const r=n,i=vh(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Kn:case Qi:case Wn:n<e.right.length&&Qt(t,Ee(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&ix(t,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&Ma(o._searchMarker,e.index,-r+n),e};class CM extends Pc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Fe(e,r=>{const i=new Map,s=new Map;let o=this.target._start,a=null;const l={};let u="",c=0,f=0;const d=()=>{if(a!==null){let h=null;switch(a){case"delete":f>0&&(h={delete:f}),f=0;break;case"insert":(typeof u=="object"||u.length>0)&&(h={insert:u},i.size>0&&(h.attributes={},i.forEach((p,g)=>{p!==null&&(h.attributes[g]=p)}))),u="";break;case"retain":c>0&&(h={retain:c},w4(l)||(h.attributes=x4({},l))),c=0;break}h&&n.push(h),a=null}};for(;o!==null;){switch(o.content.constructor){case Kn:case Qi:this.adds(o)?this.deletes(o)||(d(),a="insert",u=o.content.getContent()[0],d()):this.deletes(o)?(a!=="delete"&&(d(),a="delete"),f+=1):o.deleted||(a!=="retain"&&(d(),a="retain"),c+=1);break;case Wn:this.adds(o)?this.deletes(o)||(a!=="insert"&&(d(),a="insert"),u+=o.content.str):this.deletes(o)?(a!=="delete"&&(d(),a="delete"),f+=o.length):o.deleted||(a!=="retain"&&(d(),a="retain"),c+=o.length);break;case st:{const{key:h,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){const g=i.get(h)??null;Jr(g,p)?p!==null&&o.delete(r):(a==="retain"&&d(),Jr(p,s.get(h)??null)?delete l[h]:l[h]=p)}}else if(this.deletes(o)){s.set(h,p);const g=i.get(h)??null;Jr(g,p)||(a==="retain"&&d(),l[h]=g)}else if(!o.deleted){s.set(h,p);const g=l[h];g!==void 0&&(Jr(g,p)?g!==null&&o.delete(r):(a==="retain"&&d(),p===null?delete l[h]:l[h]=p))}o.deleted||(a==="insert"&&d(),go(i,o.content));break}}o=o.right}for(d();n.length>0;){const h=n[n.length-1];if(h.retain!==void 0&&h.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class fi extends mt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Nt(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new fi}clone(){const e=new fi;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new CM(this,e,n);Fc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Nt();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Wn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Fe(this.doc,r=>{const i=new Lh(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const a=!n&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
|
|
106
|
+
`?o.insert.slice(0,-1):o.insert;(typeof a!="string"||a.length>0)&&td(r,this,i,a,o.attributes||{})}else o.retain!==void 0?B1(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&F1(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??Nt();const i=[],s=new Map,o=this.doc;let a="",l=this._start;function u(){if(a.length>0){const f={};let d=!1;s.forEach((p,g)=>{d=!0,f[g]=p});const h={insert:a};d&&(h.attributes=f),i.push(h),a=""}}const c=()=>{for(;l!==null;){if(ki(l,e)||n!==void 0&&ki(l,n))switch(l.content.constructor){case Wn:{const f=s.get("ychange");e!==void 0&&!ki(l,e)?(f===void 0||f.user!==l.id.client||f.type!=="removed")&&(u(),s.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!ki(l,n)?(f===void 0||f.user!==l.id.client||f.type!=="added")&&(u(),s.set("ychange",r?r("added",l.id):{type:"added"})):f!==void 0&&(u(),s.delete("ychange")),a+=l.content.str;break}case Kn:case Qi:{u();const f={insert:l.content.getContent()[0]};if(s.size>0){const d={};f.attributes=d,s.forEach((h,p)=>{d[p]=h})}i.push(f);break}case st:ki(l,e)&&(u(),go(s,l.content));break}l=l.right}u()};return e||n?Fe(o,f=>{e&&Oh(f,e),n&&Oh(f,n),c()},"cleanup"):c(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Fe(i,s=>{const o=Nl(s,this,e,!r);r||(r={},o.currentAttributes.forEach((a,l)=>{r[l]=a})),td(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?Fe(i,s=>{const o=Nl(s,this,e,!r);td(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Fe(r,i=>{F1(i,Nl(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?Fe(i,s=>{const o=Nl(s,this,e,!1);o.right!==null&&B1(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Fe(this.doc,n=>{Bu(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Fe(this.doc,r=>{Sm(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return wm(this,e)}getAttributes(){return JC(this)}_write(e){e.writeTypeRef($M)}}const xM=t=>new fi;class nd{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Nt()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Ht||n.constructor===ji)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class ji extends mt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ji}clone(){const e=new ji;return e.insert(0,this.toArray().map(n=>n instanceof mt?n.clone():n)),e}get length(){return this.doc??Nt(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new nd(this,e)}querySelector(e){e=e.toUpperCase();const r=new nd(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),ui(new nd(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Fc(this,e,new kM(this,n,e))}toString(){return KC(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),Oa(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?Fe(this.doc,r=>{QC(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Fe(this.doc,r=>{const i=e&&e instanceof mt?e._item:e;Pu(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw fr("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?Fe(this.doc,r=>{ZC(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return qC(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return GC(this,e)}slice(e=0,n=this.length){return WC(this,e,n)}forEach(e){Oa(this,e)}_write(e){e.writeTypeRef(zM)}}const SM=t=>new ji;class Ht extends ji{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Ht(this.nodeName)}clone(){const e=new Ht(this.nodeName),n=this.getAttributes();return S4(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof mt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a<i;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?Fe(this.doc,n=>{Bu(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Fe(this.doc,r=>{Sm(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return wm(this,e)}hasAttribute(e){return ex(this,e)}getAttributes(e){return e?hM(this,e):JC(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const a=s[o];typeof a=="string"&&i.setAttribute(o,a)}return Oa(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(VM),e.writeKey(this.nodeName)}}const wM=t=>new Ht(t.readKey());class kM extends Pc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Fu extends Qs{constructor(e){super(),this.hookName=e}_copy(){return new Fu(this.hookName)}clone(){const e=new Fu(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(jM),e.writeKey(this.hookName)}}const AM=t=>new Fu(t.readKey());class gn extends fi{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new gn}clone(){const e=new gn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,a)=>o.key<a.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const a=s.attrs[o];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(WM)}}const vM=t=>new gn;class km{constructor(e,n){this.id=e,this.length=n}get deleted(){throw On()}mergeWith(e){return!1}write(e,n,r){throw On()}integrate(e,n){throw On()}}const _M=0;class _n extends km{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),FC(e.doc.store,this)}write(e,n){e.writeInfo(_M),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Za{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Za(this.content)}splice(e){throw On()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const NM=t=>new Za(t.readBuf());class Da{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Da(this.len)}splice(e){const n=new Da(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){_a(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const IM=t=>new Da(t.readLen()),sx=(t,e)=>new Xi({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Ja{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ja(sx(this.doc.guid,this.opts))}splice(e){throw On()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const RM=t=>new Ja(sx(t.readString(),t.readAny()));class Qi{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Qi(this.embed)}splice(e){throw On()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const MM=t=>new Qi(t.readJSON());class st{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new st(this.key,this.value)}splice(e){throw On()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const OM=t=>new st(t.readKey(),t.readJSON());class Hu{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Hu(this.arr)}splice(e){const n=new Hu(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const DM=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const i=t.readString();i==="undefined"?n.push(void 0):n.push(JSON.parse(i))}return new Hu(n)},LM=Ru("node_env")==="development";class Wi{constructor(e){this.arr=e,LM&&JT(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Wi(this.arr)}splice(e){const n=new Wi(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}const PM=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new Wi(n)};class Wn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Wn(this.str)}splice(e){const n=new Wn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const BM=t=>new Wn(t.readString()),FM=[mM,bM,xM,wM,SM,AM,vM],HM=0,UM=1,$M=2,VM=3,zM=4,jM=5,WM=6;class Kn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Kn(this.type._copy())}splice(e){throw On()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const qM=t=>new Kn(FM[t.readTypeRef()](t)),Ph=(t,e)=>{let n=e,r=0,i;do r>0&&(n=Ee(n.client,n.clock+r)),i=Is(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof je);return{item:i,diff:r}},Am=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Uu=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new je(Ee(r,i+n),e,Ee(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=Ee(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},H1=(t,e)=>tm(t,n=>po(n.deletions,e)),ox=(t,e,n,r,i,s)=>{const o=t.doc,a=o.store,l=o.clientID,u=e.redone;if(u!==null)return Qt(t,u);let c=e.parent._item,f=null,d;if(c!==null&&c.deleted===!0){if(c.redone===null&&(!n.has(c)||ox(t,c,n,r,i,s)===null))return null;for(;c.redone!==null;)c=Qt(t,c.redone)}const h=c===null?e.parent:c.content.type;if(e.parentSub===null){for(f=e.left,d=e;f!==null;){let y=f;for(;y!==null&&y.parent._item!==c;)y=y.redone===null?null:Qt(t,y.redone);if(y!==null&&y.parent._item===c){f=y;break}f=f.left}for(;d!==null;){let y=d;for(;y!==null&&y.parent._item!==c;)y=y.redone===null?null:Qt(t,y.redone);if(y!==null&&y.parent._item===c){d=y;break}d=d.right}}else if(d=null,e.right&&!i){for(f=e;f!==null&&f.right!==null&&(f.right.redone||po(r,f.right.id)||H1(s.undoStack,f.right.id)||H1(s.redoStack,f.right.id));)for(f=f.right;f.redone;)f=Qt(t,f.redone);if(f&&f.right!==null)return null}else f=h._map.get(e.parentSub)||null;const p=et(a,l),g=Ee(l,p),b=new je(g,f,f&&f.lastId,d,d&&d.id,h,e.parentSub,e.content.copy());return e.redone=g,Am(b,!0),b.integrate(t,0),b};let je=class Bh extends km{constructor(e,n,r,i,s,o,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?r1:0}set marker(e){(this.info&Wf)>0!==e&&(this.info^=Wf)}get marker(){return(this.info&Wf)>0}get keep(){return(this.info&n1)>0}set keep(e){this.keep!==e&&(this.info^=n1)}get countable(){return(this.info&r1)>0}get deleted(){return(this.info&jf)>0}set deleted(e){this.deleted!==e&&(this.info^=jf)}markDeleted(){this.info|=jf}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=et(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=et(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ns&&this.id.client!==this.parent.client&&this.parent.clock>=et(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=I1(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Qt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===_n||this.right&&this.right.constructor===_n)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Bh?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Bh&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ns){const r=Is(n,this.parent);r.constructor===_n?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=I1(e,e.doc.store,Ee(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),Ts(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Ts(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Is(e.doc.store,i.origin)))s.has(Is(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),FC(e.doc.store,this),this.content.integrate(e,this),M1(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new _n(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ee(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Ts(e.origin,this.lastId)&&this.right===e&&Ts(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),_a(e.deleteSet,this.id.client,this.id.clock,this.length),M1(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw zt();this.content.gc(e),n?X6(e,this,new _n(this.id,this.length)):this.content=new Da(this.length)}write(e,n){const r=n>0?Ee(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&vc|(r===null?0:Ut)|(i===null?0:Mr)|(s===null?0:Sa);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const u=Na(a);e.writeParentInfo(!0),e.writeString(u)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===Ns?(e.writeParentInfo(!1),e.writeLeftID(a)):zt();s!==null&&e.writeString(s)}this.content.write(e,n)}};const ax=(t,e)=>YM[e&vc](t),YM=[()=>{zt()},IM,DM,NM,BM,MM,OM,qM,PM,RM,()=>{zt()}],KM=10;class Nn extends km{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){zt()}write(e,n){e.writeInfo(KM),ve(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const lx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},ux="__ $YJS$ __";lx[ux]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");lx[ux]=!0;const GM=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},XM=/[\uD800-\uDBFF]/,QM=/[\uDC00-\uDFFF]/,ZM=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&XM.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&QM.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},JM=ZM,Ge=new wt("y-sync"),oi=new wt("y-undo"),Il=new wt("yjs-cursor"),ir=(t,e)=>t>>>e|t<<32-e,eO=t=>ir(t,2)^ir(t,13)^ir(t,22),tO=t=>ir(t,6)^ir(t,11)^ir(t,25),nO=t=>ir(t,7)^ir(t,18)^t>>>3,rO=t=>ir(t,17)^ir(t,19)^t>>>10,iO=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),sO=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class oO{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(sO),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let f=16;f<64;f++)n[f]=rO(n[f-2])+n[f-7]+nO(n[f-15])+n[f-16];let r=e[0],i=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7];for(let f=0,d,h;f<64;f++)d=c+tO(a)+(a&l^~a&u)+iO[f]+n[f]>>>0,h=eO(r)+(r&i^r&s^i&s)>>>0,c=u,u=l,l=a,a=o+d>>>0,o=s,s=i,i=r,r=d+h>>>0;e[0]+=r,e[1]+=i,e[2]+=s,e[3]+=o,e[4]+=a,e[5]+=l,e[6]+=u,e[7]+=c}digest(e){let n=0;for(;n+56<=e.length;){let o=0;for(;o<16&&n+3<e.length;o++)this._W[o]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,o,16);n<e.length;)this._W[o]|=e[n]<<(3-n%4)*8,n++;this._W[o]|=Ut<<(3-n%4)*8}this._updateHash()}const r=n%64!==0;this._W.fill(0,0,16);let i=0;for(;n<e.length;i++)for(let o=3;o>=0&&n<e.length;o--)this._W[i]|=e[n++]<<o*8;r||(this._W[i-(n%4===0?0:1)]|=Ut<<(3-n%4)*8),this._W[14]=e.byteLength/$I,this._W[15]=e.byteLength*8,this._updateHash();const s=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let a=0;a<4;a++)s[o*4+a]=this._H[o]>>>(3-a)*8;return s}}const aO=t=>new oO().digest(t),lO=t=>{for(let n=6;n<t.length;n++)t[n%6]=t[n%6]^t[n];return t.slice(0,6)},uO=t=>P4(lO(aO(F4(t)))),$u=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!po(e.ds,t.id),cO=[{light:"#ecd44433",dark:"#ecd444"}],fO=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=Vi();t.forEach(i=>r.add(i)),e=e.filter(i=>!r.has(i))}t.set(n,WI(e))}return t.get(n)},VK=(t,{colors:e=cO,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:s}={})=>{let o=!1;const a=new hO(t,s),l=new ot({props:{editable:u=>{const c=Ge.getState(u);return c.snapshot==null&&c.prevSnapshot==null}},key:Ge,state:{init:(u,c)=>({type:t,doc:t.doc,binding:a,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(u,c)=>{const f=u.getMeta(Ge);if(f!==void 0){c=Object.assign({},c);for(const d in f)c[d]=f[d]}return c.addToHistory=u.getMeta("addToHistory")!==!1,c.isChangeOrigin=f!==void 0&&!!f.isChangeOrigin,c.isUndoRedoOperation=f!==void 0&&!!f.isChangeOrigin&&!!f.isUndoRedoOperation,a.prosemirrorView!==null&&f!==void 0&&(f.snapshot!=null||f.prevSnapshot!=null)&&hm(0,()=>{a.prosemirrorView!=null&&(f.restore==null?a._renderSnapshot(f.snapshot,f.prevSnapshot,c):(a._renderSnapshot(f.snapshot,f.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,a.mux(()=>{a._prosemirrorChanged(a.prosemirrorView.state.doc)})))}),c}},view:u=>(a.initView(u),s==null&&a._forceRerender(),i(),{update:()=>{const c=l.getState(u.state);if(c.snapshot==null&&c.prevSnapshot==null&&(o||u.state.doc.content.findDiffStart(u.state.doc.type.createAndFill().content)!==null)){if(o=!0,c.addToHistory===!1&&!c.isChangeOrigin){const f=oi.getState(u.state),d=f&&f.undoManager;d&&d.stopCapturing()}a.mux(()=>{c.doc.transact(f=>{f.meta.set("addToHistory",c.addToHistory),a._prosemirrorChanged(u.state.doc)},Ge)})}},destroy:()=>{a.destroy()}})});return l},dO=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new tn(t.doc));else if(e.type==="node"){const r=Ms(n.doc,n.type,e.anchor,n.mapping);t.setSelection(ae.create(t.doc,r))}else{const r=Ms(n.doc,n.type,e.anchor,n.mapping),i=Ms(n.doc,n.type,e.head,n.mapping);if(r!==null&&i!==null){const s=fe.between(t.doc.resolve(r),t.doc.resolve(i));t.setSelection(s)}}},Fh=(t,e)=>({type:e.selection.jsonID,anchor:zu(e.selection.anchor,t.type,t.mapping),head:zu(e.selection.head,t.type,t.mapping)});class hO{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=GM(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Fh(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(tC&&this._domSelectionInView===null&&(hm(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const i=n.getBoundingClientRect(),s=Ga.documentElement;return i.bottom>=0&&i.right>=0&&i.left<=(window.innerWidth||s.clientWidth||0)&&i.top<=(window.innerHeight||s.clientHeight||0)}renderSnapshot(e,n){n||(n=PC(AC(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(Ge,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(r=>ou(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ee(q.from(e),0,0));n.setMeta(Ge,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(i=>ou(i,this.prosemirrorView.state.schema,this)).filter(i=>i!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ee(q.from(n),0,0));if(e){const i=Rr(zn(e.anchor,0),r.doc.content.size),s=Rr(zn(e.head,0),r.doc.content.size);r.setSelection(fe.create(r.doc,i,s))}this.prosemirrorView.dispatch(r.setMeta(Ge,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,r){let i=this.doc,s=this.type;if(e||(e=ed(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&zt(),i=new Xi({gc:!1}),Du(i,n),n=ed(i),Du(i,e),e=ed(i),s._item===null){const o=Array.from(this.doc.share.keys()).find(a=>this.doc.share.get(a)===this.type);s=i.getXmlFragment(o)}else{const o=i.store.clients.get(s._item.id.client)??[],a=jn(o,s._item.id.clock);s=o[a].content.type}this.mapping.clear(),this.mux(()=>{i.transact(o=>{const a=r.permanentUserData;a&&a.dss.forEach(f=>{ci(o,f,d=>{})});const l=(f,d)=>{const h=f==="added"?a.getUserByClientId(d.client):a.getUserByDeletedId(d);return{user:h,type:f,color:fO(r.colorMapping,r.colors,h)}},u=YC(s,new ym(n.ds,e.sv)).map(f=>!f._item.deleted||$u(f._item,e)||$u(f._item,n)?ou(f,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,l):null).filter(f=>f!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ee(q.from(u),0,0));this.prosemirrorView.dispatch(c.setMeta(Ge,{isChangeOrigin:!0}))},Ge)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const r=Ge.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const i=(a,l)=>this.mapping.delete(l);ci(n,n.deleteSet,a=>{if(a.constructor===je){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(i),n.changedParentTypes.forEach(i);const s=this.type.toArray().map(a=>cx(a,this.prosemirrorView.state.schema,this)).filter(a=>a!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ee(q.from(s),0,0));dO(o,this.beforeTransactionSelection,this),o=o.setMeta(Ge,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof $C}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{Uh(this.doc,this.type,e,this),this.beforeTransactionSelection=Fh(this,this.prosemirrorView.state)},Ge)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const cx=(t,e,n,r,i,s)=>{const o=n.mapping.get(t);if(o===void 0){if(t instanceof Ht)return ou(t,e,n,r,i,s);throw On()}return o},ou=(t,e,n,r,i,s)=>{const o=[],a=l=>{if(l instanceof Ht){const u=cx(l,e,n,r,i,s);u!==null&&o.push(u)}else{const u=l._item.right?.content?.type;u instanceof fi&&!u._item.deleted&&u._item.id.client===u.doc.clientID&&(l.applyDelta([{retain:l.length},...u.toDelta()]),u.doc.transact(f=>{u._item.delete(f)}));const c=pO(l,e,n,r,i,s);c!==null&&c.forEach(f=>{f!==null&&o.push(f)})}};r===void 0||i===void 0?t.toArray().forEach(a):YC(t,new ym(i.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&($u(t._item,r)?$u(t._item,i)||(l.ychange=s?s("added",t._item.id):{type:"added"}):l.ychange=s?s("removed",t._item.id):{type:"removed"});const u=e.node(t.nodeName,l,o);return n.mapping.set(t,u),u}catch{return t.doc.transact(u=>{t._item.delete(u)},Ge),n.mapping.delete(t),null}},pO=(t,e,n,r,i,s)=>{const o=[],a=t.toDelta(r,i,s);try{for(let l=0;l<a.length;l++){const u=a[l];o.push(e.text(u.insert,TO(u.attributes,e)))}}catch{return t.doc.transact(u=>{t._item.delete(u)},Ge),null}return o},mO=(t,e)=>{const n=new gn,r=t.map(i=>({insert:i.text,attributes:hx(i.marks,e)}));return n.applyDelta(r),e.mapping.set(n,t),n},gO=(t,e)=>{const n=new Ht(t.type.name);for(const r in t.attrs){const i=t.attrs[r];i!==null&&r!=="ychange"&&n.setAttribute(r,i)}return n.insert(0,Hc(t).map(r=>Hh(r,e))),e.mapping.set(n,t),n},Hh=(t,e)=>t instanceof Array?mO(t,e):gO(t,e),U1=t=>typeof t=="object"&&t!==null,vm=(t,e)=>{const n=Object.keys(t).filter(i=>t[i]!==null);let r=n.length===(e==null?0:Object.keys(e).filter(i=>e[i]!==null).length);for(let i=0;i<n.length&&r;i++){const s=n[i],o=t[s],a=e[s];r=s==="ychange"||o===a||U1(o)&&U1(a)&&vm(o,a)}return r},Hc=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.isText){const s=[];for(let o=e[r];r<e.length&&o.isText;o=e[++r])s.push(o);r--,n.push(s)}else n.push(i)}return n},fx=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,i)=>r.insert===e[i].text&&ZT(r.attributes||{}).length===e[i].marks.length&&co(r.attributes,(s,o)=>{const a=dx(o),l=e[i].marks;return vm(s,l.find(u=>u.type.name===a)?.attrs)}))},La=(t,e)=>{if(t instanceof Ht&&!(e instanceof Array)&&$h(t,e)){const n=Hc(e);return t._length===n.length&&vm(t.getAttributes(),e.attrs)&&t.toArray().every((r,i)=>La(r,n[i]))}return t instanceof gn&&e instanceof Array&&fx(t,e)},Vu=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),$1=(t,e,n)=>{const r=t.toArray(),i=Hc(e),s=i.length,o=r.length,a=Rr(o,s);let l=0,u=0,c=!1;for(;l<a;l++){const f=r[l],d=i[l];if(Vu(n.mapping.get(f),d))c=!0;else if(!La(f,d))break}for(;l+u<a;u++){const f=r[o-u-1],d=i[s-u-1];if(Vu(n.mapping.get(f),d))c=!0;else if(!La(f,d))break}return{equalityFactor:l+u,foundMappedChild:c}},bO=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Wn?e+=n.content.str:n.content instanceof st&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},yO=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:r,str:i}=bO(t),s=e.map(u=>({insert:u.text,attributes:Object.assign({},r,hx(u.marks,n))})),{insert:o,remove:a,index:l}=JM(i,s.map(u=>u.insert).join(""));t.delete(l,a),t.insert(l,o),t.applyDelta(s.map(u=>({retain:u.insert.length,attributes:u.attributes})))},EO=/(.*)(--[a-zA-Z0-9+/=]{8})$/,dx=t=>EO.exec(t)?.[1]??t,TO=(t,e)=>{const n=[];for(const r in t)n.push(e.mark(dx(r),t[r]));return n},hx=(t,e)=>{const n={};return t.forEach(r=>{if(r.type.name!=="ychange"){const i=mr(e.isOMark,r.type,()=>!r.type.excludes(r.type));n[i?`${r.type.name}--${uO(r.toJSON())}`:r.type.name]=r.attrs}}),n},Uh=(t,e,n,r)=>{if(e instanceof Ht&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.mapping.set(e,n),e instanceof Ht){const f=e.getAttributes(),d=n.attrs;for(const h in d)d[h]!==null?f[h]!==d[h]&&h!=="ychange"&&e.setAttribute(h,d[h]):e.removeAttribute(h);for(const h in f)d[h]===void 0&&e.removeAttribute(h)}const i=Hc(n),s=i.length,o=e.toArray(),a=o.length,l=Rr(s,a);let u=0,c=0;for(;u<l;u++){const f=o[u],d=i[u];if(!Vu(r.mapping.get(f),d))if(La(f,d))r.mapping.set(f,d);else break}for(;c+u<l;c++){const f=o[a-c-1],d=i[s-c-1];if(!Vu(r.mapping.get(f),d))if(La(f,d))r.mapping.set(f,d);else break}t.transact(()=>{for(;a-u-c>0&&s-u-c>0;){const d=o[u],h=i[u],p=o[a-c-1],g=i[s-c-1];if(d instanceof gn&&h instanceof Array)fx(d,h)||yO(d,h,r),u+=1;else{let b=d instanceof Ht&&$h(d,h),y=p instanceof Ht&&$h(p,g);if(b&&y){const E=$1(d,h,r),T=$1(p,g,r);E.foundMappedChild&&!T.foundMappedChild?y=!1:!E.foundMappedChild&&T.foundMappedChild||E.equalityFactor<T.equalityFactor?b=!1:y=!1}b?(Uh(t,d,h,r),u+=1):y?(Uh(t,p,g,r),c+=1):(r.mapping.delete(e.get(u)),e.delete(u,1),e.insert(u,[Hh(h,r)]),u+=1)}}const f=a-u-c;if(a===1&&s===0&&o[0]instanceof gn?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):f>0&&(e.slice(u,u+f).forEach(d=>r.mapping.delete(d)),e.delete(u,f)),u+c<s){const d=[];for(let h=u;h<s-c;h++)d.push(Hh(i[h],r));e.insert(u,d)}},Ge)},$h=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;let na=null;const CO=()=>{const t=na;na=null,t.forEach((e,n)=>{const r=n.state.tr,i=Ge.getState(n.state);i&&i.binding&&!i.binding.isDestroyed&&(e.forEach((s,o)=>{r.setMeta(o,s)}),n.dispatch(r))})},xO=(t,e,n)=>{na||(na=new Map,hm(0,CO)),mr(na,t,Mn).set(e,n)},zu=(t,e,n)=>{if(t===0)return Jf(e,0,e.length===0?-1:0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof gn){if(r._length>=t)return Jf(r,t,e.length===0?-1:0);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<i)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&i>1)return new Ra(r._item===null?null:r._item.id,r._item===null?Na(r):null,null);if(t-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Ra(r._item===null?null:r._item.id,r._item===null?Na(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw zt();if(t===0&&r.constructor!==gn&&r!==e)return SO(r._item.parent,r._item)}return Jf(e,e._length,e.length===0?-1:0)},SO=(t,e)=>{let n=null,r=null;return t._item===null?r=Na(t):n=Ee(t._item.id.client,t._item.id.clock),new Ra(n,r,e.id)},Ms=(t,e,n,r)=>{const i=K6(n,t);if(i===null||i.type!==e&&!Ia(e,i.type._item))return null;let s=i.type,o=0;if(s.constructor===gn)o=i.index;else if(s._item===null||!s._item.deleted){let a=s._first,l=0;for(;l<s._length&&l<i.index&&a!==null;){if(!a.deleted){const u=a.content.type;l++,u instanceof gn?o+=u._length:o+=r.get(u).nodeSize}a=a.right}o+=1}for(;s!==e&&s._item!==null;){const a=s._item.parent;if(a._item===null||!a._item.deleted){o+=1;let l=a._first;for(;l!==null;){const u=l.content.type;if(u===s)break;l.deleted||(u instanceof gn?o+=u._length:o+=r.get(u).nodeSize),l=l.right}}s=a}return o-1},wO=(t,e,n)=>t!==e,kO=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null);const r=document.createTextNode(""),i=document.createTextNode("");return e.insertBefore(r,null),e.insertBefore(n,null),e.insertBefore(i,null),e},AO=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),vO=/^#[0-9a-fA-F]{6}$/,V1=(t,e,n,r,i)=>{const s=Ge.getState(t),o=s.doc,a=[];return s.snapshot!=null||s.prevSnapshot!=null||s.binding.mapping.size===0?qe.create(t.doc,[]):(e.getStates().forEach((l,u)=>{if(n(o.clientID,u,l)&&l.cursor!=null){const c=l.user||{};c.color==null?c.color="#ffa500":vO.test(c.color)||console.warn("A user uses an unsupported color format",c),c.name==null&&(c.name=`User: ${u}`);let f=Ms(o,s.type,ta(l.cursor.anchor),s.binding.mapping),d=Ms(o,s.type,ta(l.cursor.head),s.binding.mapping);if(f!==null&&d!==null){const h=zn(t.doc.content.size-1,0);f=Rr(f,h),d=Rr(d,h),a.push(ut.widget(d,()=>r(c,u),{key:u+"",side:10}));const p=Rr(f,d),g=zn(f,d);a.push(ut.inline(p,g,i(c,u),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),qe.create(t.doc,a))},zK=(t,{awarenessStateFilter:e=wO,cursorBuilder:n=kO,selectionBuilder:r=AO,getSelection:i=o=>o.selection}={},s="cursor")=>new ot({key:Il,state:{init(o,a){return V1(a,t,e,n,r)},apply(o,a,l,u){const c=Ge.getState(u),f=o.getMeta(Il);return c&&c.isChangeOrigin||f&&f.awarenessUpdated?V1(u,t,e,n,r):a.map(o.mapping,o.doc)}},props:{decorations:o=>Il.getState(o)},view:o=>{const a=()=>{o.docView&&xO(o,Il,{awarenessUpdated:!0})},l=()=>{const u=Ge.getState(o.state),c=t.getLocalState()||{};if(o.hasFocus()){const f=i(o.state),d=zu(f.anchor,u.type,u.binding.mapping),h=zu(f.head,u.type,u.binding.mapping);(c.cursor==null||!N1(ta(c.cursor.anchor),d)||!N1(ta(c.cursor.head),h))&&t.setLocalStateField(s,{anchor:d,head:h})}else c.cursor!=null&&Ms(u.doc,u.type,ta(c.cursor.anchor),u.binding.mapping)!==null&&t.setLocalStateField(s,null)};return t.on("change",a),o.dom.addEventListener("focusin",l),o.dom.addEventListener("focusout",l),{update:l,destroy:()=>{o.dom.removeEventListener("focusin",l),o.dom.removeEventListener("focusout",l),t.off("change",a),t.setLocalStateField(s,null)}}}}),_O=t=>oi.getState(t)?.undoManager?.undo()!=null,NO=t=>oi.getState(t)?.undoManager?.redo()!=null,jK=(t,e)=>e==null?oi.getState(t)?.undoManager?.canUndo():_O(t),WK=(t,e)=>e==null?oi.getState(t)?.undoManager?.canRedo():NO(t),IO=new Set(["paragraph"]),RO=(t,e)=>!(t instanceof je)||!(t.content instanceof Kn)||!(t.content.type instanceof fi||t.content.type instanceof Ht&&e.has(t.content.type.nodeName))||t.content.type._length===0,qK=({protectedNodes:t=IO,trackedOrigins:e=[],undoManager:n=null}={})=>new ot({key:oi,state:{init:(r,i)=>{const s=Ge.getState(i),o=n||new $C(s.type,{trackedOrigins:new Set([Ge].concat(e)),deleteFilter:a=>RO(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(r,i,s,o)=>{const a=Ge.getState(o).binding,l=i.undoManager,u=l.undoStack.length>0,c=l.redoStack.length>0;return a?{undoManager:l,prevSel:Fh(a,s),hasUndoOps:u,hasRedoOps:c}:u!==i.hasUndoOps||c!==i.hasRedoOps?Object.assign({},i,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):i}},view:r=>{const i=Ge.getState(r.state),s=oi.getState(r.state).undoManager;return s.on("stack-item-added",({stackItem:o})=>{const a=i.binding;a&&o.meta.set(a,oi.getState(r.state).prevSel)}),s.on("stack-item-popped",({stackItem:o})=>{const a=i.binding;a&&(a.beforeTransactionSelection=o.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{s.destroy()}}}});var z1=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},MO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,OO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,DO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,LO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,PO=lo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return z1("strong",{...ao(this.options.HTMLAttributes,t),children:z1("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[zs({find:MO,type:this.type}),zs({find:DO,type:this.type})]},addPasteRules(){return[js({find:OO,type:this.type}),js({find:LO,type:this.type})]}}),YK=PO,BO=/(^|[^`])`([^`]+)`(?!`)$/,FO=/(^|[^`])`([^`]+)`(?!`)/g,HO=lo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ao(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[zs({find:BO,type:this.type})]},addPasteRules(){return[js({find:FO,type:this.type})]}}),KK=HO,UO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,$O=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,VO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jO=lo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ao(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[zs({find:UO,type:this.type}),zs({find:VO,type:this.type})]},addPasteRules(){return[js({find:$O,type:this.type}),js({find:zO,type:this.type})]}}),GK=jO,WO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,qO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,YO=lo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ao(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[zs({find:WO,type:this.type})]},addPasteRules(){return[js({find:qO,type:this.type})]}}),XK=YO,KO=lo.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ao(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),QK=KO,rd,j1;function GO(){return j1||(j1=1,rd=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),rd}var XO=GO();const ZK=yp(XO);var ju=200,gt=function(){};gt.prototype.append=function(e){return e.length?(e=gt.from(e),!this.length&&e||e.length<ju&&this.leafAppend(e)||this.length<ju&&e.leafPrepend(this)||this.appendInner(e)):this};gt.prototype.prepend=function(e){return e.length?gt.from(e).append(this):this};gt.prototype.appendInner=function(e){return new QO(this,e)};gt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?gt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};gt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};gt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};gt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};gt.from=function(e){return e instanceof gt?e:e&&e.length?new px(e):gt.empty};var px=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=ju)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ju)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(gt);gt.empty=new px([]);var QO=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(gt);const ZO=500;class Pn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),s=i.maps.length),s--,c.push(f);return}if(i){c.push(new Jn(f.map));let h=f.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],u.push(new Jn(p,void 0,void 0,u.length+c.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(s)):f.selection,l=new Pn(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let f=e.steps[c].invert(e.docs[c]),d=new Jn(e.mapping.maps[c],f,n),h;(h=l&&l.merge(d))&&(d=h,c?s.pop():a=a.slice(0,a.length-1)),s.push(d),n&&(o++,n=void 0),i||(l=d)}let u=o-r.depth;return u>eD&&(a=JO(a,u),o-=u),new Pn(a.append(s),o)}remapping(e,n){let r=new pa;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Pn(this.items.append(e.map(n=>new Jn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let h=s.getMirror(--l);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(d.step){let g=e.steps[h].invert(e.docs[h]),b=d.selection&&d.selection.map(s.slice(l+1,h));b&&a++,r.push(new Jn(p,g,b))}else r.push(new Jn(p))},i);let u=[];for(let d=n;d<o;d++)u.push(new Jn(s.maps[d]));let c=this.items.slice(0,i).append(u).append(r),f=new Pn(c,a);return f.emptyItemCount()>ZO&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=o.selection&&o.selection.map(n.slice(r));c&&s++;let f=new Jn(u.invert(),l,c),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else o.map&&r--},this.items.length,0),new Pn(gt.from(i.reverse()),s)}}Pn.empty=new Pn(gt.empty,0);function JO(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Jn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Jn(n.getMap().invert(),n,this.selection)}}}class Wr{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const eD=20;function tD(t,e,n,r){let i=n.getMeta(Di),s;if(i)return i.historyState;n.getMeta(mx)&&(t=new Wr(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Di))return o.getMeta(Di).redo?new Wr(t.done.addTransform(n,void 0,r,au(e)),t.undone,W1(n.mapping.maps),t.prevTime,t.prevComposition):new Wr(t.done,t.undone.addTransform(n,void 0,r,au(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!nD(n,t.prevRanges)),u=o?id(t.prevRanges,n.mapping):W1(n.mapping.maps);return new Wr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,au(e)),Pn.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Wr(t.done.rebased(n,s),t.undone.rebased(n,s),id(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Wr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),id(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function nD(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function W1(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function id(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function rD(t,e,n){let r=au(e),i=Di.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new Wr(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Di,{redo:n,historyState:l})}let sd=!1,q1=null;function au(t){let e=t.plugins;if(q1!=e){sd=!1,q1=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){sd=!0;break}}return sd}function iD(t){return t.setMeta(mx,!0)}const Di=new wt("history"),mx=new wt("closeHistory");function JK(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ot({key:Di,state:{init(){return new Wr(Pn.empty,Pn.empty,null,0,-1)},apply(e,n,r){return tD(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?sD:r=="historyRedo"?oD:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function gx(t,e){return(n,r)=>{let i=Di.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=rD(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const sD=gx(!1,!0),oD=gx(!0,!0);class el{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}el.prototype.normal={};el.prototype.property={};el.prototype.space=void 0;function bx(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new el(n,r,e)}function Pa(t){return t.toLowerCase()}class sn{constructor(e,n){this.attribute=n,this.property=e}}sn.prototype.attribute="";sn.prototype.booleanish=!1;sn.prototype.boolean=!1;sn.prototype.commaOrSpaceSeparated=!1;sn.prototype.commaSeparated=!1;sn.prototype.defined=!1;sn.prototype.mustUseProperty=!1;sn.prototype.number=!1;sn.prototype.overloadedBoolean=!1;sn.prototype.property="";sn.prototype.spaceSeparated=!1;sn.prototype.space=void 0;let aD=0;const Te=Zi(),nt=Zi(),Vh=Zi(),J=Zi(),Ve=Zi(),Os=Zi(),cn=Zi();function Zi(){return 2**++aD}const zh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:nt,commaOrSpaceSeparated:cn,commaSeparated:Os,number:J,overloadedBoolean:Vh,spaceSeparated:Ve},Symbol.toStringTag,{value:"Module"})),od=Object.keys(zh);class _m extends sn{constructor(e,n,r,i){let s=-1;if(super(e,n),Y1(this,"space",i),typeof r=="number")for(;++s<od.length;){const o=od[s];Y1(this,od[s],(r&zh[o])===zh[o])}}}_m.prototype.defined=!0;function Y1(t,e,n){n&&(t[e]=n)}function bo(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new _m(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Pa(r)]=r,n[Pa(s.attribute)]=r}return new el(e,n,t.space)}const yx=bo({properties:{ariaActiveDescendant:null,ariaAtomic:nt,ariaAutoComplete:null,ariaBusy:nt,ariaChecked:nt,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:Ve,ariaCurrent:null,ariaDescribedBy:Ve,ariaDetails:null,ariaDisabled:nt,ariaDropEffect:Ve,ariaErrorMessage:null,ariaExpanded:nt,ariaFlowTo:Ve,ariaGrabbed:nt,ariaHasPopup:null,ariaHidden:nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ve,ariaLevel:J,ariaLive:null,ariaModal:nt,ariaMultiLine:nt,ariaMultiSelectable:nt,ariaOrientation:null,ariaOwns:Ve,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:nt,ariaReadOnly:nt,ariaRelevant:null,ariaRequired:nt,ariaRoleDescription:Ve,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:nt,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Ex(t,e){return e in t?t[e]:e}function Tx(t,e){return Ex(t,e.toLowerCase())}const lD=bo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Os,acceptCharset:Ve,accessKey:Ve,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Ve,autoFocus:Te,autoPlay:Te,blocking:Ve,capture:null,charSet:null,checked:Te,cite:null,className:Ve,cols:J,colSpan:null,content:null,contentEditable:nt,controls:Te,controlsList:Ve,coords:J|Os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:Vh,draggable:nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Ve,height:J,hidden:Vh,high:J,href:null,hrefLang:null,htmlFor:Ve,httpEquiv:Ve,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Ve,itemRef:Ve,itemScope:Te,itemType:Ve,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:J,pattern:null,ping:Ve,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Ve,required:Te,reversed:Te,rows:J,rowSpan:J,sandbox:Ve,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:nt,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ve,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:nt,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:Tx}),uD=bo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cn,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:Ve,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Os,g2:Os,glyphName:Os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ve,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cn,rev:cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cn,requiredFeatures:cn,requiredFonts:cn,requiredFormats:cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cn,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ex}),Cx=bo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),xx=bo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Tx}),Sx=bo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),cD=/[A-Z]/g,K1=/-[a-z]/g,fD=/^data[-\w.:]+$/i;function Nm(t,e){const n=Pa(e);let r=e,i=sn;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fD.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(K1,hD);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!K1.test(s)){let o=s.replace(cD,dD);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=_m}return new i(r,e)}function dD(t){return"-"+t.toLowerCase()}function hD(t){return t.charAt(1).toUpperCase()}const Uc=bx([yx,lD,Cx,xx,Sx],"html"),tl=bx([yx,uD,Cx,xx,Sx],"svg");function G1(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&e.push(o),i=r+1,r=n.indexOf(",",i)}return e}function pD(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const X1=/[#.]/g;function mD(t,e){const n=t||"",r={};let i=0,s,o;for(;i<n.length;){X1.lastIndex=i;const a=X1.exec(n),l=n.slice(i,a?a.index:n.length);l&&(s?s==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:o=l,i+=l.length),a&&(s=a[0],i++)}return{type:"element",tagName:o||e||"div",properties:r,children:[]}}function Q1(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function gD(t){return t.join(" ").trim()}function wx(t,e,n){const r=n?TD(n):void 0;function i(s,o,...a){let l;if(s==null){l={type:"root",children:[]};const u=o;a.unshift(u)}else{l=mD(s,e);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,bD(o))a.unshift(o);else for(const[f,d]of Object.entries(o))yD(t,l.properties,f,d)}for(const u of a)jh(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function bD(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function yD(t,e,n,r){const i=Nm(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=Q1(r):i.commaSeparated?s=G1(r):i.commaOrSpaceSeparated?s=Q1(G1(r).join(" ")):s=Z1(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?ED(r):String(r);if(Array.isArray(s)){const o=[];for(const a of s)o.push(Z1(i,i.property,a));s=o}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function jh(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)jh(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?jh(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Z1(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Pa(n)===Pa(e)))return!0}return n}function ED(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function TD(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const CD=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],kx=wx(Uc,"div"),Ax=wx(tl,"g",CD);function xD(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let o=0;for(;;){let a=n[o];if(a===void 0){const l=J1(e,n[o-1]);a=l===-1?e.length+1:l+1,n[o]=a}if(a>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const a=n[n.length-1],l=J1(e,a),u=l===-1?e.length+1:l+1;if(a===u)break;n.push(u)}const o=(s.line>1?n[s.line-2]:0)+s.column-1;if(o<n[s.line-1])return o}}}function J1(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
107
|
+
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const lu={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"},vx={}.hasOwnProperty,SD=Object.prototype;function wD(t,e){const n=e||{};return Im({file:n.file||void 0,location:!1,schema:n.space==="svg"?tl:Uc,verbose:n.verbose||!1},t)}function Im(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},uu(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:_x(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),o=xD(s),a=o.toPoint(0),l=o.toPoint(s.length);n.position={start:a,end:l}}return n}case"#documentType":{const r=e;return n={type:"doctype"},uu(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},uu(t,r,n),n}default:return n=kD(t,e),n}}function _x(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=Im(t,e[n]);r.push(i)}return r}function kD(t,e){const n=t.schema;t.schema=e.namespaceURI===lu.svg?tl:Uc;let r=-1;const i={};for(;++r<e.attrs.length;){const a=e.attrs[r],l=(a.prefix?a.prefix+":":"")+a.name;vx.call(SD,l)||(i[l]=a.value)}const o=(t.schema.space==="svg"?Ax:kx)(e.tagName,i,_x(t,e.childNodes));if(uu(t,e,o),o.tagName==="template"){const a=e,l=a.sourceCodeLocation,u=l&&l.startTag&&Cs(l.startTag),c=l&&l.endTag&&Cs(l.endTag),f=Im(t,a.content);u&&c&&t.file&&(f.position={start:u.end,end:c.start}),o.content=f}return t.schema=n,o}function uu(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=AD(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function AD(t,e,n){const r=Cs(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let o;if(n.attrs)for(o in n.attrs)vx.call(n.attrs,o)&&(s[Nm(t.schema,o).property]=Cs(n.attrs[o]));n.startTag;const a=Cs(n.startTag),l=n.endTag?Cs(n.endTag):void 0,u={opening:a};l&&(u.closing=l),u.properties=s,e.data={position:u}}}return r}function Cs(t){const e=eb({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=eb({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function eb(t){return t.line&&t.column?t:void 0}const vD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ye="�";var S;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(S||(S={}));const qt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Nx(t){return t>=55296&&t<=57343}function _D(t){return t>=56320&&t<=57343}function ND(t,e){return(t-55296)*1024+9216+e}function Ix(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Rx(t){return t>=64976&&t<=65007||vD.has(t)}var $;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})($||($={}));const ID=65536;class RD{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=ID,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,o=i+n,a=s+n;return{code:e,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(_D(n))return this.pos++,this._addGap(),ND(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,S.EOF;return this._err($.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,S.EOF;const r=this.html.charCodeAt(n);return r===S.CARRIAGE_RETURN?S.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,S.EOF;let e=this.html.charCodeAt(this.pos);return e===S.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,S.LINE_FEED):e===S.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Nx(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===S.LINE_FEED||e===S.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Ix(e)?this._err($.controlCharacterInInputStream):Rx(e)&&this._err($.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Oe;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(Oe||(Oe={}));function Mx(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const MD=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(t=>t.charCodeAt(0))),OD=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]]);function DD(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=OD.get(t))!==null&&e!==void 0?e:t}var ht;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(ht||(ht={}));const LD=32;var ei;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ei||(ei={}));function Wh(t){return t>=ht.ZERO&&t<=ht.NINE}function PD(t){return t>=ht.UPPER_A&&t<=ht.UPPER_F||t>=ht.LOWER_A&&t<=ht.LOWER_F}function BD(t){return t>=ht.UPPER_A&&t<=ht.UPPER_Z||t>=ht.LOWER_A&&t<=ht.LOWER_Z||Wh(t)}function FD(t){return t===ht.EQUALS||BD(t)}var ft;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(ft||(ft={}));var kr;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(kr||(kr={}));class HD{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=ft.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=kr.Strict}startEntity(e){this.decodeMode=e,this.state=ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case ft.EntityStart:return e.charCodeAt(n)===ht.NUM?(this.state=ft.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=ft.NamedEntity,this.stateNamedEntity(e,n));case ft.NumericStart:return this.stateNumericStart(e,n);case ft.NumericDecimal:return this.stateNumericDecimal(e,n);case ft.NumericHex:return this.stateNumericHex(e,n);case ft.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|LD)===ht.LOWER_X?(this.state=ft.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=ft.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Wh(i)||PD(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Wh(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ht.SEMI)this.consumed+=1;else if(this.decodeMode===kr.Strict)return 0;return this.emitCodePoint(DD(this.result),this.consumed),this.errors&&(e!==ht.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&ei.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=UD(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===kr.Attribute&&(s===0||FD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&ei.VALUE_LENGTH)>>14,s!==0){if(o===ht.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==kr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&ei.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~ei.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case ft.NamedEntity:return this.result!==0&&(this.decodeMode!==kr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ft.NumericDecimal:return this.emitNumericEntity(0,2);case ft.NumericHex:return this.emitNumericEntity(0,3);case ft.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ft.EntityStart:return 0}}}function UD(t,e,n,r){const i=(e&ei.BRANCH_LENGTH)>>7,s=e&ei.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,u=t[l];if(u<r)o=l+1;else if(u>r)a=l-1;else return t[l+i]}return-1}var K;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(K||(K={}));var Li;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Li||(Li={}));var kn;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(kn||(kn={}));var B;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(B||(B={}));var m;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(m||(m={}));const $D=new Map([[B.A,m.A],[B.ADDRESS,m.ADDRESS],[B.ANNOTATION_XML,m.ANNOTATION_XML],[B.APPLET,m.APPLET],[B.AREA,m.AREA],[B.ARTICLE,m.ARTICLE],[B.ASIDE,m.ASIDE],[B.B,m.B],[B.BASE,m.BASE],[B.BASEFONT,m.BASEFONT],[B.BGSOUND,m.BGSOUND],[B.BIG,m.BIG],[B.BLOCKQUOTE,m.BLOCKQUOTE],[B.BODY,m.BODY],[B.BR,m.BR],[B.BUTTON,m.BUTTON],[B.CAPTION,m.CAPTION],[B.CENTER,m.CENTER],[B.CODE,m.CODE],[B.COL,m.COL],[B.COLGROUP,m.COLGROUP],[B.DD,m.DD],[B.DESC,m.DESC],[B.DETAILS,m.DETAILS],[B.DIALOG,m.DIALOG],[B.DIR,m.DIR],[B.DIV,m.DIV],[B.DL,m.DL],[B.DT,m.DT],[B.EM,m.EM],[B.EMBED,m.EMBED],[B.FIELDSET,m.FIELDSET],[B.FIGCAPTION,m.FIGCAPTION],[B.FIGURE,m.FIGURE],[B.FONT,m.FONT],[B.FOOTER,m.FOOTER],[B.FOREIGN_OBJECT,m.FOREIGN_OBJECT],[B.FORM,m.FORM],[B.FRAME,m.FRAME],[B.FRAMESET,m.FRAMESET],[B.H1,m.H1],[B.H2,m.H2],[B.H3,m.H3],[B.H4,m.H4],[B.H5,m.H5],[B.H6,m.H6],[B.HEAD,m.HEAD],[B.HEADER,m.HEADER],[B.HGROUP,m.HGROUP],[B.HR,m.HR],[B.HTML,m.HTML],[B.I,m.I],[B.IMG,m.IMG],[B.IMAGE,m.IMAGE],[B.INPUT,m.INPUT],[B.IFRAME,m.IFRAME],[B.KEYGEN,m.KEYGEN],[B.LABEL,m.LABEL],[B.LI,m.LI],[B.LINK,m.LINK],[B.LISTING,m.LISTING],[B.MAIN,m.MAIN],[B.MALIGNMARK,m.MALIGNMARK],[B.MARQUEE,m.MARQUEE],[B.MATH,m.MATH],[B.MENU,m.MENU],[B.META,m.META],[B.MGLYPH,m.MGLYPH],[B.MI,m.MI],[B.MO,m.MO],[B.MN,m.MN],[B.MS,m.MS],[B.MTEXT,m.MTEXT],[B.NAV,m.NAV],[B.NOBR,m.NOBR],[B.NOFRAMES,m.NOFRAMES],[B.NOEMBED,m.NOEMBED],[B.NOSCRIPT,m.NOSCRIPT],[B.OBJECT,m.OBJECT],[B.OL,m.OL],[B.OPTGROUP,m.OPTGROUP],[B.OPTION,m.OPTION],[B.P,m.P],[B.PARAM,m.PARAM],[B.PLAINTEXT,m.PLAINTEXT],[B.PRE,m.PRE],[B.RB,m.RB],[B.RP,m.RP],[B.RT,m.RT],[B.RTC,m.RTC],[B.RUBY,m.RUBY],[B.S,m.S],[B.SCRIPT,m.SCRIPT],[B.SEARCH,m.SEARCH],[B.SECTION,m.SECTION],[B.SELECT,m.SELECT],[B.SOURCE,m.SOURCE],[B.SMALL,m.SMALL],[B.SPAN,m.SPAN],[B.STRIKE,m.STRIKE],[B.STRONG,m.STRONG],[B.STYLE,m.STYLE],[B.SUB,m.SUB],[B.SUMMARY,m.SUMMARY],[B.SUP,m.SUP],[B.TABLE,m.TABLE],[B.TBODY,m.TBODY],[B.TEMPLATE,m.TEMPLATE],[B.TEXTAREA,m.TEXTAREA],[B.TFOOT,m.TFOOT],[B.TD,m.TD],[B.TH,m.TH],[B.THEAD,m.THEAD],[B.TITLE,m.TITLE],[B.TR,m.TR],[B.TRACK,m.TRACK],[B.TT,m.TT],[B.U,m.U],[B.UL,m.UL],[B.SVG,m.SVG],[B.VAR,m.VAR],[B.WBR,m.WBR],[B.XMP,m.XMP]]);function $c(t){var e;return(e=$D.get(t))!==null&&e!==void 0?e:m.UNKNOWN}const Q=m,VD={[K.HTML]:new Set([Q.ADDRESS,Q.APPLET,Q.AREA,Q.ARTICLE,Q.ASIDE,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BLOCKQUOTE,Q.BODY,Q.BR,Q.BUTTON,Q.CAPTION,Q.CENTER,Q.COL,Q.COLGROUP,Q.DD,Q.DETAILS,Q.DIR,Q.DIV,Q.DL,Q.DT,Q.EMBED,Q.FIELDSET,Q.FIGCAPTION,Q.FIGURE,Q.FOOTER,Q.FORM,Q.FRAME,Q.FRAMESET,Q.H1,Q.H2,Q.H3,Q.H4,Q.H5,Q.H6,Q.HEAD,Q.HEADER,Q.HGROUP,Q.HR,Q.HTML,Q.IFRAME,Q.IMG,Q.INPUT,Q.LI,Q.LINK,Q.LISTING,Q.MAIN,Q.MARQUEE,Q.MENU,Q.META,Q.NAV,Q.NOEMBED,Q.NOFRAMES,Q.NOSCRIPT,Q.OBJECT,Q.OL,Q.P,Q.PARAM,Q.PLAINTEXT,Q.PRE,Q.SCRIPT,Q.SECTION,Q.SELECT,Q.SOURCE,Q.STYLE,Q.SUMMARY,Q.TABLE,Q.TBODY,Q.TD,Q.TEMPLATE,Q.TEXTAREA,Q.TFOOT,Q.TH,Q.THEAD,Q.TITLE,Q.TR,Q.TRACK,Q.UL,Q.WBR,Q.XMP]),[K.MATHML]:new Set([Q.MI,Q.MO,Q.MN,Q.MS,Q.MTEXT,Q.ANNOTATION_XML]),[K.SVG]:new Set([Q.TITLE,Q.FOREIGN_OBJECT,Q.DESC]),[K.XLINK]:new Set,[K.XML]:new Set,[K.XMLNS]:new Set},qh=new Set([Q.H1,Q.H2,Q.H3,Q.H4,Q.H5,Q.H6]);B.STYLE,B.SCRIPT,B.XMP,B.IFRAME,B.NOEMBED,B.NOFRAMES,B.PLAINTEXT;var A;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(A||(A={}));const Zt={DATA:A.DATA,RCDATA:A.RCDATA,RAWTEXT:A.RAWTEXT,SCRIPT_DATA:A.SCRIPT_DATA,PLAINTEXT:A.PLAINTEXT,CDATA_SECTION:A.CDATA_SECTION};function zD(t){return t>=S.DIGIT_0&&t<=S.DIGIT_9}function qo(t){return t>=S.LATIN_CAPITAL_A&&t<=S.LATIN_CAPITAL_Z}function jD(t){return t>=S.LATIN_SMALL_A&&t<=S.LATIN_SMALL_Z}function Vr(t){return jD(t)||qo(t)}function tb(t){return Vr(t)||zD(t)}function Rl(t){return t+32}function Ox(t){return t===S.SPACE||t===S.LINE_FEED||t===S.TABULATION||t===S.FORM_FEED}function nb(t){return Ox(t)||t===S.SOLIDUS||t===S.GREATER_THAN_SIGN}function WD(t){return t===S.NULL?$.nullCharacterReference:t>1114111?$.characterReferenceOutsideUnicodeRange:Nx(t)?$.surrogateCharacterReference:Rx(t)?$.noncharacterCharacterReference:Ix(t)||t===S.CARRIAGE_RETURN?$.controlCharacterReference:null}class qD{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=A.DATA,this.returnState=A.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new RD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new HD(MD,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err($.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err($.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=WD(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Oe.START_TAG,tagName:"",tagID:m.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Oe.END_TAG,tagName:"",tagID:m.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Oe.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Oe.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(Mx(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err($.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=$c(e.tagName),e.type===Oe.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err($.endTagWithAttributes),e.selfClosing&&this._err($.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Oe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Oe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Oe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Oe.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Ox(e)?Oe.WHITESPACE_CHARACTER:e===S.NULL?Oe.NULL_CHARACTER:Oe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Oe.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=A.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?kr.Attribute:kr.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===A.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case A.DATA:{this._stateData(e);break}case A.RCDATA:{this._stateRcdata(e);break}case A.RAWTEXT:{this._stateRawtext(e);break}case A.SCRIPT_DATA:{this._stateScriptData(e);break}case A.PLAINTEXT:{this._statePlaintext(e);break}case A.TAG_OPEN:{this._stateTagOpen(e);break}case A.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case A.TAG_NAME:{this._stateTagName(e);break}case A.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case A.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case A.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case A.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case A.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case A.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case A.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case A.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case A.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case A.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case A.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case A.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case A.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case A.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case A.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case A.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case A.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case A.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case A.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case A.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case A.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case A.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case A.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case A.BOGUS_COMMENT:{this._stateBogusComment(e);break}case A.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case A.COMMENT_START:{this._stateCommentStart(e);break}case A.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case A.COMMENT:{this._stateComment(e);break}case A.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case A.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case A.COMMENT_END:{this._stateCommentEnd(e);break}case A.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case A.DOCTYPE:{this._stateDoctype(e);break}case A.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case A.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case A.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case A.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case A.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case A.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case A.CDATA_SECTION:{this._stateCdataSection(e);break}case A.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case A.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case A.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case A.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case S.LESS_THAN_SIGN:{this.state=A.TAG_OPEN;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitCodePoint(e);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case S.AMPERSAND:{this._startCharacterReference();break}case S.LESS_THAN_SIGN:{this.state=A.RCDATA_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case S.LESS_THAN_SIGN:{this.state=A.RAWTEXT_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Vr(e))this._createStartTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case S.EXCLAMATION_MARK:{this.state=A.MARKUP_DECLARATION_OPEN;break}case S.SOLIDUS:{this.state=A.END_TAG_OPEN;break}case S.QUESTION_MARK:{this._err($.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e);break}case S.EOF:{this._err($.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err($.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=A.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Vr(e))this._createEndTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case S.GREATER_THAN_SIGN:{this._err($.missingEndTagName),this.state=A.DATA;break}case S.EOF:{this._err($.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err($.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.BEFORE_ATTRIBUTE_NAME;break}case S.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case S.NULL:{this._err($.unexpectedNullCharacter),n.tagName+=Ye;break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(qo(e)?Rl(e):e)}}_stateRcdataLessThanSign(e){e===S.SOLIDUS?this.state=A.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Vr(e)?(this.state=A.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=A.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=A.BEFORE_ATTRIBUTE_NAME,!1;case S.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=A.SELF_CLOSING_START_TAG,!1;case S.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=A.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===S.SOLIDUS?this.state=A.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Vr(e)?(this.state=A.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case S.SOLIDUS:{this.state=A.SCRIPT_DATA_END_TAG_OPEN;break}case S.EXCLAMATION_MARK:{this.state=A.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=A.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Vr(e)?(this.state=A.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===S.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===S.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case S.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case S.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case S.HYPHEN_MINUS:{this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case S.NULL:{this._err($.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===S.SOLIDUS?this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Vr(e)?(this._emitChars("<"),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Vr(e)?(this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(qt.SCRIPT,!1)&&nb(this.preprocessor.peek(qt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<qt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case S.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.NULL:{this._err($.unexpectedNullCharacter),this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case S.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.NULL:{this._err($.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case S.HYPHEN_MINUS:{this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case S.NULL:{this._err($.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ye);break}case S.EOF:{this._err($.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===S.SOLIDUS?(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(qt.SCRIPT,!1)&&nb(this.preprocessor.peek(qt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<qt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.SOLIDUS:case S.GREATER_THAN_SIGN:case S.EOF:{this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case S.EQUALS_SIGN:{this._err($.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=A.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:case S.SOLIDUS:case S.GREATER_THAN_SIGN:case S.EOF:{this._leaveAttrName(),this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case S.EQUALS_SIGN:{this._leaveAttrName(),this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case S.QUOTATION_MARK:case S.APOSTROPHE:case S.LESS_THAN_SIGN:{this._err($.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case S.NULL:{this._err($.unexpectedNullCharacter),this.currentAttr.name+=Ye;break}default:this.currentAttr.name+=String.fromCodePoint(qo(e)?Rl(e):e)}}_stateAfterAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case S.EQUALS_SIGN:{this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{this.state=A.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this.state=A.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err($.missingAttributeValue),this.state=A.DATA,this.emitCurrentTagToken();break}default:this.state=A.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case S.QUOTATION_MARK:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err($.unexpectedNullCharacter),this.currentAttr.value+=Ye;break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case S.APOSTROPHE:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err($.unexpectedNullCharacter),this.currentAttr.value+=Ye;break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case S.NULL:{this._err($.unexpectedNullCharacter),this.currentAttr.value+=Ye;break}case S.QUOTATION_MARK:case S.APOSTROPHE:case S.LESS_THAN_SIGN:case S.EQUALS_SIGN:case S.GRAVE_ACCENT:{this._err($.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case S.SOLIDUS:{this._leaveAttrValue(),this.state=A.SELF_CLOSING_START_TAG;break}case S.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this._err($.missingWhitespaceBetweenAttributes),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case S.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=A.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err($.eofInTag),this._emitEOFToken();break}default:this._err($.unexpectedSolidusInTag),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case S.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case S.NULL:{this._err($.unexpectedNullCharacter),n.data+=Ye;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(qt.DASH_DASH,!0)?(this._createCommentToken(qt.DASH_DASH.length+1),this.state=A.COMMENT_START):this._consumeSequenceIfMatch(qt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(qt.DOCTYPE.length+1),this.state=A.DOCTYPE):this._consumeSequenceIfMatch(qt.CDATA_START,!0)?this.inForeignNode?this.state=A.CDATA_SECTION:(this._err($.cdataInHtmlContent),this._createCommentToken(qt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=A.BOGUS_COMMENT):this._ensureHibernation()||(this._err($.incorrectlyOpenedComment),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case S.HYPHEN_MINUS:{this.state=A.COMMENT_START_DASH;break}case S.GREATER_THAN_SIGN:{this._err($.abruptClosingOfEmptyComment),this.state=A.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case S.GREATER_THAN_SIGN:{this._err($.abruptClosingOfEmptyComment),this.state=A.DATA,this.emitCurrentComment(n);break}case S.EOF:{this._err($.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=A.COMMENT_END_DASH;break}case S.LESS_THAN_SIGN:{n.data+="<",this.state=A.COMMENT_LESS_THAN_SIGN;break}case S.NULL:{this._err($.unexpectedNullCharacter),n.data+=Ye;break}case S.EOF:{this._err($.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case S.EXCLAMATION_MARK:{n.data+="!",this.state=A.COMMENT_LESS_THAN_SIGN_BANG;break}case S.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===S.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=A.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===S.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=A.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==S.GREATER_THAN_SIGN&&e!==S.EOF&&this._err($.nestedComment),this.state=A.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case S.EOF:{this._err($.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case S.EXCLAMATION_MARK:{this.state=A.COMMENT_END_BANG;break}case S.HYPHEN_MINUS:{n.data+="-";break}case S.EOF:{this._err($.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case S.HYPHEN_MINUS:{n.data+="--!",this.state=A.COMMENT_END_DASH;break}case S.GREATER_THAN_SIGN:{this._err($.incorrectlyClosedComment),this.state=A.DATA,this.emitCurrentComment(n);break}case S.EOF:{this._err($.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=A.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case S.EOF:{this._err($.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingWhitespaceBeforeDoctypeName),this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(qo(e))this._createDoctypeToken(String.fromCharCode(Rl(e))),this.state=A.DOCTYPE_NAME;else switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.NULL:{this._err($.unexpectedNullCharacter),this._createDoctypeToken(Ye),this.state=A.DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this._err($.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=A.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.AFTER_DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.NULL:{this._err($.unexpectedNullCharacter),n.name+=Ye;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(qo(e)?Rl(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(qt.PUBLIC,!1)?this.state=A.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(qt.SYSTEM,!1)?this.state=A.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err($.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.QUOTATION_MARK:{this._err($.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err($.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err($.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err($.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case S.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.NULL:{this._err($.unexpectedNullCharacter),n.publicId+=Ye;break}case S.GREATER_THAN_SIGN:{this._err($.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case S.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.NULL:{this._err($.unexpectedNullCharacter),n.publicId+=Ye;break}case S.GREATER_THAN_SIGN:{this._err($.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case S.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.QUOTATION_MARK:{this._err($.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err($.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.QUOTATION_MARK:{this._err($.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err($.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err($.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err($.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case S.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.NULL:{this._err($.unexpectedNullCharacter),n.systemId+=Ye;break}case S.GREATER_THAN_SIGN:{this._err($.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case S.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.NULL:{this._err($.unexpectedNullCharacter),n.systemId+=Ye;break}case S.GREATER_THAN_SIGN:{this._err($.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.EOF:{this._err($.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err($.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case S.NULL:{this._err($.unexpectedNullCharacter);break}case S.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case S.RIGHT_SQUARE_BRACKET:{this.state=A.CDATA_SECTION_BRACKET;break}case S.EOF:{this._err($.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===S.RIGHT_SQUARE_BRACKET?this.state=A.CDATA_SECTION_END:(this._emitChars("]"),this.state=A.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case S.GREATER_THAN_SIGN:{this.state=A.DATA;break}case S.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=A.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(S.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&tb(this.preprocessor.peek(1))?A.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){tb(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===S.SEMICOLON&&this._err($.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Dx=new Set([m.DD,m.DT,m.LI,m.OPTGROUP,m.OPTION,m.P,m.RB,m.RP,m.RT,m.RTC]),rb=new Set([...Dx,m.CAPTION,m.COLGROUP,m.TBODY,m.TD,m.TFOOT,m.TH,m.THEAD,m.TR]),Wu=new Set([m.APPLET,m.CAPTION,m.HTML,m.MARQUEE,m.OBJECT,m.TABLE,m.TD,m.TEMPLATE,m.TH]),YD=new Set([...Wu,m.OL,m.UL]),KD=new Set([...Wu,m.BUTTON]),ib=new Set([m.ANNOTATION_XML,m.MI,m.MN,m.MO,m.MS,m.MTEXT]),sb=new Set([m.DESC,m.FOREIGN_OBJECT,m.TITLE]),GD=new Set([m.TR,m.TEMPLATE,m.HTML]),XD=new Set([m.TBODY,m.TFOOT,m.THEAD,m.TEMPLATE,m.HTML]),QD=new Set([m.TABLE,m.TEMPLATE,m.HTML]),ZD=new Set([m.TD,m.TH]);class JD{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=m.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===m.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===K.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==K.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(qh,K.HTML)}popUntilTableCellPopped(){this.popUntilPopped(ZD,K.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(QD,K.HTML)}clearBackToTableBodyContext(){this.clearBackTo(XD,K.HTML)}clearBackToTableRowContext(){this.clearBackTo(GD,K.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===m.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===m.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case K.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case K.SVG:{if(sb.has(i))return!1;break}case K.MATHML:{if(ib.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Wu)}hasInListItemScope(e){return this.hasInDynamicScope(e,YD)}hasInButtonScope(e){return this.hasInDynamicScope(e,KD)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case K.HTML:{if(qh.has(n))return!0;if(Wu.has(n))return!1;break}case K.SVG:{if(sb.has(n))return!1;break}case K.MATHML:{if(ib.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===K.HTML)switch(this.tagIDs[n]){case e:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===K.HTML)switch(this.tagIDs[e]){case m.TBODY:case m.THEAD:case m.TFOOT:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===K.HTML)switch(this.tagIDs[n]){case e:return!0;case m.OPTION:case m.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Dx.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&rb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&rb.has(this.currentTagId);)this.pop()}}const ad=3;var nr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(nr||(nr={}));const ob={type:nr.Marker};class e5{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===nr.Marker)break;const{element:u}=l;if(this.treeAdapter.getTagName(u)===s&&this.treeAdapter.getNamespaceURI(u)===o){const c=this.treeAdapter.getAttrList(u);c.length===i&&r.push({idx:a,attrs:c})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<ad)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<ad)return;const i=new Map(n.map(o=>[o.name,o.value]));let s=0;for(let o=0;o<r.length;o++){const a=r[o];a.attrs.every(l=>i.get(l.name)===l.value)&&(s+=1,s>=ad&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(ob)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:nr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:nr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(ob);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===nr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===nr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===nr.Element&&n.element===e)}}const zr={createDocument(){return{nodeName:"#document",mode:kn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};zr.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(zr.isTextNode(n)){n.value+=e;return}}zr.appendChild(t,zr.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&zr.isTextNode(r)?r.value+=e:zr.insertBefore(t,zr.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},Lx="html",t5="about:legacy-compat",n5="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Px=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],r5=[...Px,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],i5=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Bx=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],s5=[...Bx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function ab(t,e){return e.some(n=>t.startsWith(n))}function o5(t){return t.name===Lx&&t.publicId===null&&(t.systemId===null||t.systemId===t5)}function a5(t){if(t.name!==Lx)return kn.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===n5)return kn.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),i5.has(n))return kn.QUIRKS;let r=e===null?r5:Px;if(ab(n,r))return kn.QUIRKS;if(r=e===null?Bx:s5,ab(n,r))return kn.LIMITED_QUIRKS}return kn.NO_QUIRKS}const lb={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},l5="definitionurl",u5="definitionURL",c5=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),f5=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:K.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:K.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:K.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:K.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:K.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:K.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:K.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:K.XML}],["xml:space",{prefix:"xml",name:"space",namespace:K.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:K.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:K.XMLNS}]]),d5=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),h5=new Set([m.B,m.BIG,m.BLOCKQUOTE,m.BODY,m.BR,m.CENTER,m.CODE,m.DD,m.DIV,m.DL,m.DT,m.EM,m.EMBED,m.H1,m.H2,m.H3,m.H4,m.H5,m.H6,m.HEAD,m.HR,m.I,m.IMG,m.LI,m.LISTING,m.MENU,m.META,m.NOBR,m.OL,m.P,m.PRE,m.RUBY,m.S,m.SMALL,m.SPAN,m.STRONG,m.STRIKE,m.SUB,m.SUP,m.TABLE,m.TT,m.U,m.UL,m.VAR]);function p5(t){const e=t.tagID;return e===m.FONT&&t.attrs.some(({name:r})=>r===Li.COLOR||r===Li.SIZE||r===Li.FACE)||h5.has(e)}function Fx(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===l5){t.attrs[e].name=u5;break}}function Hx(t){for(let e=0;e<t.attrs.length;e++){const n=c5.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function Rm(t){for(let e=0;e<t.attrs.length;e++){const n=f5.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function m5(t){const e=d5.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=$c(t.tagName))}function g5(t,e){return e===K.MATHML&&(t===m.MI||t===m.MO||t===m.MN||t===m.MS||t===m.MTEXT)}function b5(t,e,n){if(e===K.MATHML&&t===m.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Li.ENCODING){const i=n[r].value.toLowerCase();return i===lb.TEXT_HTML||i===lb.APPLICATION_XML}}return e===K.SVG&&(t===m.FOREIGN_OBJECT||t===m.DESC||t===m.TITLE)}function y5(t,e,n,r){return(!r||r===K.HTML)&&b5(t,e,n)||(!r||r===K.MATHML)&&g5(t,e)}const E5="hidden",T5=8,C5=3;var R;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(R||(R={}));const x5={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ux=new Set([m.TABLE,m.TBODY,m.TFOOT,m.THEAD,m.TR]),ub={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:zr,onParseError:null};class $x{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=R.INITIAL,this.originalInsertionMode=R.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ub,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new qD(this.options,this),this.activeFormattingElements=new e5(this.treeAdapter),this.fragmentContextID=r?$c(this.treeAdapter.getTagName(r)):m.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new JD(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...ub,...n};e??(e=r.treeAdapter.createElement(B.TEMPLATE,K.HTML,[]));const i=r.treeAdapter.createElement("documentmock",K.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===m.TEMPLATE&&s.tmplInsertionModeStack.unshift(R.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:x5,o={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(o)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===K.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,K.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=R.TEXT}switchToPlaintextParsing(){this.insertionMode=R.TEXT,this.originalInsertionMode=R.IN_BODY,this.tokenizer.state=Zt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===B.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==K.HTML))switch(this.fragmentContextID){case m.TITLE:case m.TEXTAREA:{this.tokenizer.state=Zt.RCDATA;break}case m.STYLE:case m.XMP:case m.IFRAME:case m.NOEMBED:case m.NOFRAMES:case m.NOSCRIPT:{this.tokenizer.state=Zt.RAWTEXT;break}case m.SCRIPT:{this.tokenizer.state=Zt.SCRIPT_DATA;break}case m.PLAINTEXT:{this.tokenizer.state=Zt.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,K.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,K.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(B.HTML,K.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,m.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:l,endCol:u,endOffset:c}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===Oe.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===m.SVG&&this.treeAdapter.getTagName(n)===B.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===K.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===m.MGLYPH||e.tagID===m.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,K.HTML)}_processToken(e){switch(e.type){case Oe.CHARACTER:{this.onCharacter(e);break}case Oe.NULL_CHARACTER:{this.onNullCharacter(e);break}case Oe.COMMENT:{this.onComment(e);break}case Oe.DOCTYPE:{this.onDoctype(e);break}case Oe.START_TAG:{this._processStartTag(e);break}case Oe.END_TAG:{this.onEndTag(e);break}case Oe.EOF:{this.onEof(e);break}case Oe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return y5(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===nr.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=R.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(m.P),this.openElements.popUntilTagNamePopped(m.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case m.TR:{this.insertionMode=R.IN_ROW;return}case m.TBODY:case m.THEAD:case m.TFOOT:{this.insertionMode=R.IN_TABLE_BODY;return}case m.CAPTION:{this.insertionMode=R.IN_CAPTION;return}case m.COLGROUP:{this.insertionMode=R.IN_COLUMN_GROUP;return}case m.TABLE:{this.insertionMode=R.IN_TABLE;return}case m.BODY:{this.insertionMode=R.IN_BODY;return}case m.FRAMESET:{this.insertionMode=R.IN_FRAMESET;return}case m.SELECT:{this._resetInsertionModeForSelect(e);return}case m.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case m.HTML:{this.insertionMode=this.headElement?R.AFTER_HEAD:R.BEFORE_HEAD;return}case m.TD:case m.TH:{if(e>0){this.insertionMode=R.IN_CELL;return}break}case m.HEAD:{if(e>0){this.insertionMode=R.IN_HEAD;return}break}}this.insertionMode=R.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===m.TEMPLATE)break;if(r===m.TABLE){this.insertionMode=R.IN_SELECT_IN_TABLE;return}}this.insertionMode=R.IN_SELECT}_isElementCausesFosterParenting(e){return Ux.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case m.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===K.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case m.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return VD[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Z8(this,e);return}switch(this.insertionMode){case R.INITIAL:{Lo(this,e);break}case R.BEFORE_HTML:{ra(this,e);break}case R.BEFORE_HEAD:{ia(this,e);break}case R.IN_HEAD:{sa(this,e);break}case R.IN_HEAD_NO_SCRIPT:{oa(this,e);break}case R.AFTER_HEAD:{aa(this,e);break}case R.IN_BODY:case R.IN_CAPTION:case R.IN_CELL:case R.IN_TEMPLATE:{zx(this,e);break}case R.TEXT:case R.IN_SELECT:case R.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case R.IN_TABLE:case R.IN_TABLE_BODY:case R.IN_ROW:{ld(this,e);break}case R.IN_TABLE_TEXT:{Gx(this,e);break}case R.IN_COLUMN_GROUP:{qu(this,e);break}case R.AFTER_BODY:{Yu(this,e);break}case R.AFTER_AFTER_BODY:{cu(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Q8(this,e);return}switch(this.insertionMode){case R.INITIAL:{Lo(this,e);break}case R.BEFORE_HTML:{ra(this,e);break}case R.BEFORE_HEAD:{ia(this,e);break}case R.IN_HEAD:{sa(this,e);break}case R.IN_HEAD_NO_SCRIPT:{oa(this,e);break}case R.AFTER_HEAD:{aa(this,e);break}case R.TEXT:{this._insertCharacters(e);break}case R.IN_TABLE:case R.IN_TABLE_BODY:case R.IN_ROW:{ld(this,e);break}case R.IN_COLUMN_GROUP:{qu(this,e);break}case R.AFTER_BODY:{Yu(this,e);break}case R.AFTER_AFTER_BODY:{cu(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Yh(this,e);return}switch(this.insertionMode){case R.INITIAL:case R.BEFORE_HTML:case R.BEFORE_HEAD:case R.IN_HEAD:case R.IN_HEAD_NO_SCRIPT:case R.AFTER_HEAD:case R.IN_BODY:case R.IN_TABLE:case R.IN_CAPTION:case R.IN_COLUMN_GROUP:case R.IN_TABLE_BODY:case R.IN_ROW:case R.IN_CELL:case R.IN_SELECT:case R.IN_SELECT_IN_TABLE:case R.IN_TEMPLATE:case R.IN_FRAMESET:case R.AFTER_FRAMESET:{Yh(this,e);break}case R.IN_TABLE_TEXT:{Po(this,e);break}case R.AFTER_BODY:{N5(this,e);break}case R.AFTER_AFTER_BODY:case R.AFTER_AFTER_FRAMESET:{I5(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case R.INITIAL:{R5(this,e);break}case R.BEFORE_HEAD:case R.IN_HEAD:case R.IN_HEAD_NO_SCRIPT:case R.AFTER_HEAD:{this._err(e,$.misplacedDoctype);break}case R.IN_TABLE_TEXT:{Po(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,$.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?J8(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case R.INITIAL:{Lo(this,e);break}case R.BEFORE_HTML:{M5(this,e);break}case R.BEFORE_HEAD:{D5(this,e);break}case R.IN_HEAD:{Gn(this,e);break}case R.IN_HEAD_NO_SCRIPT:{B5(this,e);break}case R.AFTER_HEAD:{H5(this,e);break}case R.IN_BODY:{Ot(this,e);break}case R.IN_TABLE:{Zs(this,e);break}case R.IN_TABLE_TEXT:{Po(this,e);break}case R.IN_CAPTION:{L8(this,e);break}case R.IN_COLUMN_GROUP:{Dm(this,e);break}case R.IN_TABLE_BODY:{jc(this,e);break}case R.IN_ROW:{Wc(this,e);break}case R.IN_CELL:{F8(this,e);break}case R.IN_SELECT:{Zx(this,e);break}case R.IN_SELECT_IN_TABLE:{U8(this,e);break}case R.IN_TEMPLATE:{V8(this,e);break}case R.AFTER_BODY:{j8(this,e);break}case R.IN_FRAMESET:{W8(this,e);break}case R.AFTER_FRAMESET:{Y8(this,e);break}case R.AFTER_AFTER_BODY:{G8(this,e);break}case R.AFTER_AFTER_FRAMESET:{X8(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?eL(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case R.INITIAL:{Lo(this,e);break}case R.BEFORE_HTML:{O5(this,e);break}case R.BEFORE_HEAD:{L5(this,e);break}case R.IN_HEAD:{P5(this,e);break}case R.IN_HEAD_NO_SCRIPT:{F5(this,e);break}case R.AFTER_HEAD:{U5(this,e);break}case R.IN_BODY:{zc(this,e);break}case R.TEXT:{k8(this,e);break}case R.IN_TABLE:{Ba(this,e);break}case R.IN_TABLE_TEXT:{Po(this,e);break}case R.IN_CAPTION:{P8(this,e);break}case R.IN_COLUMN_GROUP:{B8(this,e);break}case R.IN_TABLE_BODY:{Kh(this,e);break}case R.IN_ROW:{Qx(this,e);break}case R.IN_CELL:{H8(this,e);break}case R.IN_SELECT:{Jx(this,e);break}case R.IN_SELECT_IN_TABLE:{$8(this,e);break}case R.IN_TEMPLATE:{z8(this,e);break}case R.AFTER_BODY:{tS(this,e);break}case R.IN_FRAMESET:{q8(this,e);break}case R.AFTER_FRAMESET:{K8(this,e);break}case R.AFTER_AFTER_BODY:{cu(this,e);break}}}onEof(e){switch(this.insertionMode){case R.INITIAL:{Lo(this,e);break}case R.BEFORE_HTML:{ra(this,e);break}case R.BEFORE_HEAD:{ia(this,e);break}case R.IN_HEAD:{sa(this,e);break}case R.IN_HEAD_NO_SCRIPT:{oa(this,e);break}case R.AFTER_HEAD:{aa(this,e);break}case R.IN_BODY:case R.IN_TABLE:case R.IN_CAPTION:case R.IN_COLUMN_GROUP:case R.IN_TABLE_BODY:case R.IN_ROW:case R.IN_CELL:case R.IN_SELECT:case R.IN_SELECT_IN_TABLE:{Yx(this,e);break}case R.TEXT:{A8(this,e);break}case R.IN_TABLE_TEXT:{Po(this,e);break}case R.IN_TEMPLATE:{eS(this,e);break}case R.AFTER_BODY:case R.IN_FRAMESET:case R.AFTER_FRAMESET:case R.AFTER_AFTER_BODY:case R.AFTER_AFTER_FRAMESET:{Om(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===S.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case R.IN_HEAD:case R.IN_HEAD_NO_SCRIPT:case R.AFTER_HEAD:case R.TEXT:case R.IN_COLUMN_GROUP:case R.IN_SELECT:case R.IN_SELECT_IN_TABLE:case R.IN_FRAMESET:case R.AFTER_FRAMESET:{this._insertCharacters(e);break}case R.IN_BODY:case R.IN_CAPTION:case R.IN_CELL:case R.IN_TEMPLATE:case R.AFTER_BODY:case R.AFTER_AFTER_BODY:case R.AFTER_AFTER_FRAMESET:{Vx(this,e);break}case R.IN_TABLE:case R.IN_TABLE_BODY:case R.IN_ROW:{ld(this,e);break}case R.IN_TABLE_TEXT:{Kx(this,e);break}}}}function S5(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):qx(t,e),n}function w5(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function k5(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,o=i;o!==n;s++,o=i){i=t.openElements.getCommonAncestor(o);const a=t.activeFormattingElements.getElementEntry(o),l=a&&s>=C5;!a||l?(l&&t.activeFormattingElements.removeEntry(a),t.openElements.remove(o)):(o=A5(t,a),r===e&&(t.activeFormattingElements.bookmark=a),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(o,r),r=o)}return r}function A5(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function v5(t,e,n){const r=t.treeAdapter.getTagName(e),i=$c(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===m.TEMPLATE&&s===K.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function _5(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function Mm(t,e){for(let n=0;n<T5;n++){const r=S5(t,e);if(!r)break;const i=w5(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=k5(t,i,r.element),o=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),o&&v5(t,o,s),_5(t,i,r)}}function Yh(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function N5(t,e){t._appendCommentNode(e,t.openElements.items[0])}function I5(t,e){t._appendCommentNode(e,t.document)}function Om(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],o=t.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&t._setEndLocation(s,e)}}}}function R5(t,e){t._setDocumentType(e);const n=e.forceQuirks?kn.QUIRKS:a5(e);o5(e)||t._err(e,$.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=R.BEFORE_HTML}function Lo(t,e){t._err(e,$.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,kn.QUIRKS),t.insertionMode=R.BEFORE_HTML,t._processToken(e)}function M5(t,e){e.tagID===m.HTML?(t._insertElement(e,K.HTML),t.insertionMode=R.BEFORE_HEAD):ra(t,e)}function O5(t,e){const n=e.tagID;(n===m.HTML||n===m.HEAD||n===m.BODY||n===m.BR)&&ra(t,e)}function ra(t,e){t._insertFakeRootElement(),t.insertionMode=R.BEFORE_HEAD,t._processToken(e)}function D5(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.HEAD:{t._insertElement(e,K.HTML),t.headElement=t.openElements.current,t.insertionMode=R.IN_HEAD;break}default:ia(t,e)}}function L5(t,e){const n=e.tagID;n===m.HEAD||n===m.BODY||n===m.HTML||n===m.BR?ia(t,e):t._err(e,$.endTagWithoutMatchingOpenElement)}function ia(t,e){t._insertFakeElement(B.HEAD,m.HEAD),t.headElement=t.openElements.current,t.insertionMode=R.IN_HEAD,t._processToken(e)}function Gn(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:{t._appendElement(e,K.HTML),e.ackSelfClosing=!0;break}case m.TITLE:{t._switchToTextParsing(e,Zt.RCDATA);break}case m.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Zt.RAWTEXT):(t._insertElement(e,K.HTML),t.insertionMode=R.IN_HEAD_NO_SCRIPT);break}case m.NOFRAMES:case m.STYLE:{t._switchToTextParsing(e,Zt.RAWTEXT);break}case m.SCRIPT:{t._switchToTextParsing(e,Zt.SCRIPT_DATA);break}case m.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=R.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(R.IN_TEMPLATE);break}case m.HEAD:{t._err(e,$.misplacedStartTagForHeadElement);break}default:sa(t,e)}}function P5(t,e){switch(e.tagID){case m.HEAD:{t.openElements.pop(),t.insertionMode=R.AFTER_HEAD;break}case m.BODY:case m.BR:case m.HTML:{sa(t,e);break}case m.TEMPLATE:{Ji(t,e);break}default:t._err(e,$.endTagWithoutMatchingOpenElement)}}function Ji(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==m.TEMPLATE&&t._err(e,$.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(m.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,$.endTagWithoutMatchingOpenElement)}function sa(t,e){t.openElements.pop(),t.insertionMode=R.AFTER_HEAD,t._processToken(e)}function B5(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.BASEFONT:case m.BGSOUND:case m.HEAD:case m.LINK:case m.META:case m.NOFRAMES:case m.STYLE:{Gn(t,e);break}case m.NOSCRIPT:{t._err(e,$.nestedNoscriptInHead);break}default:oa(t,e)}}function F5(t,e){switch(e.tagID){case m.NOSCRIPT:{t.openElements.pop(),t.insertionMode=R.IN_HEAD;break}case m.BR:{oa(t,e);break}default:t._err(e,$.endTagWithoutMatchingOpenElement)}}function oa(t,e){const n=e.type===Oe.EOF?$.openElementsLeftAfterEof:$.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=R.IN_HEAD,t._processToken(e)}function H5(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.BODY:{t._insertElement(e,K.HTML),t.framesetOk=!1,t.insertionMode=R.IN_BODY;break}case m.FRAMESET:{t._insertElement(e,K.HTML),t.insertionMode=R.IN_FRAMESET;break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{t._err(e,$.abandonedHeadElementChild),t.openElements.push(t.headElement,m.HEAD),Gn(t,e),t.openElements.remove(t.headElement);break}case m.HEAD:{t._err(e,$.misplacedStartTagForHeadElement);break}default:aa(t,e)}}function U5(t,e){switch(e.tagID){case m.BODY:case m.HTML:case m.BR:{aa(t,e);break}case m.TEMPLATE:{Ji(t,e);break}default:t._err(e,$.endTagWithoutMatchingOpenElement)}}function aa(t,e){t._insertFakeElement(B.BODY,m.BODY),t.insertionMode=R.IN_BODY,Vc(t,e)}function Vc(t,e){switch(e.type){case Oe.CHARACTER:{zx(t,e);break}case Oe.WHITESPACE_CHARACTER:{Vx(t,e);break}case Oe.COMMENT:{Yh(t,e);break}case Oe.START_TAG:{Ot(t,e);break}case Oe.END_TAG:{zc(t,e);break}case Oe.EOF:{Yx(t,e);break}}}function Vx(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function zx(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function $5(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function V5(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function z5(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_FRAMESET)}function j5(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML)}function W5(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&qh.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,K.HTML)}function q5(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function Y5(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML),n||(t.formElement=t.openElements.current))}function K5(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===m.LI&&i===m.LI||(n===m.DD||n===m.DT)&&(i===m.DD||i===m.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==m.ADDRESS&&i!==m.DIV&&i!==m.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML)}function G5(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML),t.tokenizer.state=Zt.PLAINTEXT}function X5(t,e){t.openElements.hasInScope(m.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(m.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML),t.framesetOk=!1}function Q5(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(B.A);n&&(Mm(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z5(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function J5(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(m.NOBR)&&(Mm(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,K.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function e8(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function t8(t,e){t.treeAdapter.getDocumentMode(t.document)!==kn.QUIRKS&&t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._insertElement(e,K.HTML),t.framesetOk=!1,t.insertionMode=R.IN_TABLE}function jx(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,K.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Wx(t){const e=Mx(t,Li.TYPE);return e!=null&&e.toLowerCase()===E5}function n8(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,K.HTML),Wx(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function r8(t,e){t._appendElement(e,K.HTML),e.ackSelfClosing=!0}function i8(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._appendElement(e,K.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function s8(t,e){e.tagName=B.IMG,e.tagID=m.IMG,jx(t,e)}function o8(t,e){t._insertElement(e,K.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Zt.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=R.TEXT}function a8(t,e){t.openElements.hasInButtonScope(m.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Zt.RAWTEXT)}function l8(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Zt.RAWTEXT)}function cb(t,e){t._switchToTextParsing(e,Zt.RAWTEXT)}function u8(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===R.IN_TABLE||t.insertionMode===R.IN_CAPTION||t.insertionMode===R.IN_TABLE_BODY||t.insertionMode===R.IN_ROW||t.insertionMode===R.IN_CELL?R.IN_SELECT_IN_TABLE:R.IN_SELECT}function c8(t,e){t.openElements.currentTagId===m.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML)}function f8(t,e){t.openElements.hasInScope(m.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,K.HTML)}function d8(t,e){t.openElements.hasInScope(m.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(m.RTC),t._insertElement(e,K.HTML)}function h8(t,e){t._reconstructActiveFormattingElements(),Fx(e),Rm(e),e.selfClosing?t._appendElement(e,K.MATHML):t._insertElement(e,K.MATHML),e.ackSelfClosing=!0}function p8(t,e){t._reconstructActiveFormattingElements(),Hx(e),Rm(e),e.selfClosing?t._appendElement(e,K.SVG):t._insertElement(e,K.SVG),e.ackSelfClosing=!0}function fb(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,K.HTML)}function Ot(t,e){switch(e.tagID){case m.I:case m.S:case m.B:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.SMALL:case m.STRIKE:case m.STRONG:{Z5(t,e);break}case m.A:{Q5(t,e);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{W5(t,e);break}case m.P:case m.DL:case m.OL:case m.UL:case m.DIV:case m.DIR:case m.NAV:case m.MAIN:case m.MENU:case m.ASIDE:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.DETAILS:case m.ADDRESS:case m.ARTICLE:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{j5(t,e);break}case m.LI:case m.DD:case m.DT:{K5(t,e);break}case m.BR:case m.IMG:case m.WBR:case m.AREA:case m.EMBED:case m.KEYGEN:{jx(t,e);break}case m.HR:{i8(t,e);break}case m.RB:case m.RTC:{f8(t,e);break}case m.RT:case m.RP:{d8(t,e);break}case m.PRE:case m.LISTING:{q5(t,e);break}case m.XMP:{a8(t,e);break}case m.SVG:{p8(t,e);break}case m.HTML:{$5(t,e);break}case m.BASE:case m.LINK:case m.META:case m.STYLE:case m.TITLE:case m.SCRIPT:case m.BGSOUND:case m.BASEFONT:case m.TEMPLATE:{Gn(t,e);break}case m.BODY:{V5(t,e);break}case m.FORM:{Y5(t,e);break}case m.NOBR:{J5(t,e);break}case m.MATH:{h8(t,e);break}case m.TABLE:{t8(t,e);break}case m.INPUT:{n8(t,e);break}case m.PARAM:case m.TRACK:case m.SOURCE:{r8(t,e);break}case m.IMAGE:{s8(t,e);break}case m.BUTTON:{X5(t,e);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{e8(t,e);break}case m.IFRAME:{l8(t,e);break}case m.SELECT:{u8(t,e);break}case m.OPTION:case m.OPTGROUP:{c8(t,e);break}case m.NOEMBED:case m.NOFRAMES:{cb(t,e);break}case m.FRAMESET:{z5(t,e);break}case m.TEXTAREA:{o8(t,e);break}case m.NOSCRIPT:{t.options.scriptingEnabled?cb(t,e):fb(t,e);break}case m.PLAINTEXT:{G5(t,e);break}case m.COL:case m.TH:case m.TD:case m.TR:case m.HEAD:case m.FRAME:case m.TBODY:case m.TFOOT:case m.THEAD:case m.CAPTION:case m.COLGROUP:break;default:fb(t,e)}}function m8(t,e){if(t.openElements.hasInScope(m.BODY)&&(t.insertionMode=R.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function g8(t,e){t.openElements.hasInScope(m.BODY)&&(t.insertionMode=R.AFTER_BODY,tS(t,e))}function b8(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function y8(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(m.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(m.FORM):n&&t.openElements.remove(n))}function E8(t){t.openElements.hasInButtonScope(m.P)||t._insertFakeElement(B.P,m.P),t._closePElement()}function T8(t){t.openElements.hasInListItemScope(m.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(m.LI),t.openElements.popUntilTagNamePopped(m.LI))}function C8(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function x8(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function S8(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function w8(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(B.BR,m.BR),t.openElements.pop(),t.framesetOk=!1}function qx(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],o=t.openElements.tagIDs[i];if(r===o&&(r!==m.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,o))break}}function zc(t,e){switch(e.tagID){case m.A:case m.B:case m.I:case m.S:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.NOBR:case m.SMALL:case m.STRIKE:case m.STRONG:{Mm(t,e);break}case m.P:{E8(t);break}case m.DL:case m.UL:case m.OL:case m.DIR:case m.DIV:case m.NAV:case m.PRE:case m.MAIN:case m.MENU:case m.ASIDE:case m.BUTTON:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.ADDRESS:case m.ARTICLE:case m.DETAILS:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.LISTING:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{b8(t,e);break}case m.LI:{T8(t);break}case m.DD:case m.DT:{C8(t,e);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{x8(t);break}case m.BR:{w8(t);break}case m.BODY:{m8(t,e);break}case m.HTML:{g8(t,e);break}case m.FORM:{y8(t);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{S8(t,e);break}case m.TEMPLATE:{Ji(t,e);break}default:qx(t,e)}}function Yx(t,e){t.tmplInsertionModeStack.length>0?eS(t,e):Om(t,e)}function k8(t,e){var n;e.tagID===m.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function A8(t,e){t._err(e,$.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function ld(t,e){if(t.openElements.currentTagId!==void 0&&Ux.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=R.IN_TABLE_TEXT,e.type){case Oe.CHARACTER:{Gx(t,e);break}case Oe.WHITESPACE_CHARACTER:{Kx(t,e);break}}else nl(t,e)}function v8(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_CAPTION}function _8(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_COLUMN_GROUP}function N8(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(B.COLGROUP,m.COLGROUP),t.insertionMode=R.IN_COLUMN_GROUP,Dm(t,e)}function I8(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_TABLE_BODY}function R8(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(B.TBODY,m.TBODY),t.insertionMode=R.IN_TABLE_BODY,jc(t,e)}function M8(t,e){t.openElements.hasInTableScope(m.TABLE)&&(t.openElements.popUntilTagNamePopped(m.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function O8(t,e){Wx(e)?t._appendElement(e,K.HTML):nl(t,e),e.ackSelfClosing=!0}function D8(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,K.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Zs(t,e){switch(e.tagID){case m.TD:case m.TH:case m.TR:{R8(t,e);break}case m.STYLE:case m.SCRIPT:case m.TEMPLATE:{Gn(t,e);break}case m.COL:{N8(t,e);break}case m.FORM:{D8(t,e);break}case m.TABLE:{M8(t,e);break}case m.TBODY:case m.TFOOT:case m.THEAD:{I8(t,e);break}case m.INPUT:{O8(t,e);break}case m.CAPTION:{v8(t,e);break}case m.COLGROUP:{_8(t,e);break}default:nl(t,e)}}function Ba(t,e){switch(e.tagID){case m.TABLE:{t.openElements.hasInTableScope(m.TABLE)&&(t.openElements.popUntilTagNamePopped(m.TABLE),t._resetInsertionMode());break}case m.TEMPLATE:{Ji(t,e);break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:case m.TBODY:case m.TD:case m.TFOOT:case m.TH:case m.THEAD:case m.TR:break;default:nl(t,e)}}function nl(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Vc(t,e),t.fosterParentingEnabled=n}function Kx(t,e){t.pendingCharacterTokens.push(e)}function Gx(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Po(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)nl(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Xx=new Set([m.CAPTION,m.COL,m.COLGROUP,m.TBODY,m.TD,m.TFOOT,m.TH,m.THEAD,m.TR]);function L8(t,e){const n=e.tagID;Xx.has(n)?t.openElements.hasInTableScope(m.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(m.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=R.IN_TABLE,Zs(t,e)):Ot(t,e)}function P8(t,e){const n=e.tagID;switch(n){case m.CAPTION:case m.TABLE:{t.openElements.hasInTableScope(m.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(m.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=R.IN_TABLE,n===m.TABLE&&Ba(t,e));break}case m.BODY:case m.COL:case m.COLGROUP:case m.HTML:case m.TBODY:case m.TD:case m.TFOOT:case m.TH:case m.THEAD:case m.TR:break;default:zc(t,e)}}function Dm(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.COL:{t._appendElement(e,K.HTML),e.ackSelfClosing=!0;break}case m.TEMPLATE:{Gn(t,e);break}default:qu(t,e)}}function B8(t,e){switch(e.tagID){case m.COLGROUP:{t.openElements.currentTagId===m.COLGROUP&&(t.openElements.pop(),t.insertionMode=R.IN_TABLE);break}case m.TEMPLATE:{Ji(t,e);break}case m.COL:break;default:qu(t,e)}}function qu(t,e){t.openElements.currentTagId===m.COLGROUP&&(t.openElements.pop(),t.insertionMode=R.IN_TABLE,t._processToken(e))}function jc(t,e){switch(e.tagID){case m.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_ROW;break}case m.TH:case m.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(B.TR,m.TR),t.insertionMode=R.IN_ROW,Wc(t,e);break}case m.CAPTION:case m.COL:case m.COLGROUP:case m.TBODY:case m.TFOOT:case m.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE,Zs(t,e));break}default:Zs(t,e)}}function Kh(t,e){const n=e.tagID;switch(e.tagID){case m.TBODY:case m.TFOOT:case m.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE);break}case m.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE,Ba(t,e));break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:case m.TD:case m.TH:case m.TR:break;default:Ba(t,e)}}function Wc(t,e){switch(e.tagID){case m.TH:case m.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,K.HTML),t.insertionMode=R.IN_CELL,t.activeFormattingElements.insertMarker();break}case m.CAPTION:case m.COL:case m.COLGROUP:case m.TBODY:case m.TFOOT:case m.THEAD:case m.TR:{t.openElements.hasInTableScope(m.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE_BODY,jc(t,e));break}default:Zs(t,e)}}function Qx(t,e){switch(e.tagID){case m.TR:{t.openElements.hasInTableScope(m.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE_BODY);break}case m.TABLE:{t.openElements.hasInTableScope(m.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE_BODY,Kh(t,e));break}case m.TBODY:case m.TFOOT:case m.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(m.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=R.IN_TABLE_BODY,Kh(t,e));break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:case m.TD:case m.TH:break;default:Ba(t,e)}}function F8(t,e){const n=e.tagID;Xx.has(n)?(t.openElements.hasInTableScope(m.TD)||t.openElements.hasInTableScope(m.TH))&&(t._closeTableCell(),Wc(t,e)):Ot(t,e)}function H8(t,e){const n=e.tagID;switch(n){case m.TD:case m.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=R.IN_ROW);break}case m.TABLE:case m.TBODY:case m.TFOOT:case m.THEAD:case m.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Qx(t,e));break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:break;default:zc(t,e)}}function Zx(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.OPTION:{t.openElements.currentTagId===m.OPTION&&t.openElements.pop(),t._insertElement(e,K.HTML);break}case m.OPTGROUP:{t.openElements.currentTagId===m.OPTION&&t.openElements.pop(),t.openElements.currentTagId===m.OPTGROUP&&t.openElements.pop(),t._insertElement(e,K.HTML);break}case m.HR:{t.openElements.currentTagId===m.OPTION&&t.openElements.pop(),t.openElements.currentTagId===m.OPTGROUP&&t.openElements.pop(),t._appendElement(e,K.HTML),e.ackSelfClosing=!0;break}case m.INPUT:case m.KEYGEN:case m.TEXTAREA:case m.SELECT:{t.openElements.hasInSelectScope(m.SELECT)&&(t.openElements.popUntilTagNamePopped(m.SELECT),t._resetInsertionMode(),e.tagID!==m.SELECT&&t._processStartTag(e));break}case m.SCRIPT:case m.TEMPLATE:{Gn(t,e);break}}}function Jx(t,e){switch(e.tagID){case m.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===m.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===m.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===m.OPTGROUP&&t.openElements.pop();break}case m.OPTION:{t.openElements.currentTagId===m.OPTION&&t.openElements.pop();break}case m.SELECT:{t.openElements.hasInSelectScope(m.SELECT)&&(t.openElements.popUntilTagNamePopped(m.SELECT),t._resetInsertionMode());break}case m.TEMPLATE:{Ji(t,e);break}}}function U8(t,e){const n=e.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?(t.openElements.popUntilTagNamePopped(m.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Zx(t,e)}function $8(t,e){const n=e.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(m.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Jx(t,e)}function V8(t,e){switch(e.tagID){case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{Gn(t,e);break}case m.CAPTION:case m.COLGROUP:case m.TBODY:case m.TFOOT:case m.THEAD:{t.tmplInsertionModeStack[0]=R.IN_TABLE,t.insertionMode=R.IN_TABLE,Zs(t,e);break}case m.COL:{t.tmplInsertionModeStack[0]=R.IN_COLUMN_GROUP,t.insertionMode=R.IN_COLUMN_GROUP,Dm(t,e);break}case m.TR:{t.tmplInsertionModeStack[0]=R.IN_TABLE_BODY,t.insertionMode=R.IN_TABLE_BODY,jc(t,e);break}case m.TD:case m.TH:{t.tmplInsertionModeStack[0]=R.IN_ROW,t.insertionMode=R.IN_ROW,Wc(t,e);break}default:t.tmplInsertionModeStack[0]=R.IN_BODY,t.insertionMode=R.IN_BODY,Ot(t,e)}}function z8(t,e){e.tagID===m.TEMPLATE&&Ji(t,e)}function eS(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(m.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Om(t,e)}function j8(t,e){e.tagID===m.HTML?Ot(t,e):Yu(t,e)}function tS(t,e){var n;if(e.tagID===m.HTML){if(t.fragmentContext||(t.insertionMode=R.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===m.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Yu(t,e)}function Yu(t,e){t.insertionMode=R.IN_BODY,Vc(t,e)}function W8(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.FRAMESET:{t._insertElement(e,K.HTML);break}case m.FRAME:{t._appendElement(e,K.HTML),e.ackSelfClosing=!0;break}case m.NOFRAMES:{Gn(t,e);break}}}function q8(t,e){e.tagID===m.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==m.FRAMESET&&(t.insertionMode=R.AFTER_FRAMESET))}function Y8(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.NOFRAMES:{Gn(t,e);break}}}function K8(t,e){e.tagID===m.HTML&&(t.insertionMode=R.AFTER_AFTER_FRAMESET)}function G8(t,e){e.tagID===m.HTML?Ot(t,e):cu(t,e)}function cu(t,e){t.insertionMode=R.IN_BODY,Vc(t,e)}function X8(t,e){switch(e.tagID){case m.HTML:{Ot(t,e);break}case m.NOFRAMES:{Gn(t,e);break}}}function Q8(t,e){e.chars=Ye,t._insertCharacters(e)}function Z8(t,e){t._insertCharacters(e),t.framesetOk=!1}function nS(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==K.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function J8(t,e){if(p5(e))nS(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===K.MATHML?Fx(e):r===K.SVG&&(m5(e),Hx(e)),Rm(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function eL(t,e){if(e.tagID===m.P||e.tagID===m.BR){nS(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===K.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}B.AREA,B.BASE,B.BASEFONT,B.BGSOUND,B.BR,B.COL,B.EMBED,B.FRAME,B.HR,B.IMG,B.INPUT,B.KEYGEN,B.LINK,B.META,B.PARAM,B.SOURCE,B.TRACK,B.WBR;function tL(t,e){return $x.parse(t,e)}function nL(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=$x.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function la(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?db(t.position):"start"in t||"end"in t?db(t):"line"in t||"column"in t?Gh(t):""}function Gh(t){return hb(t&&t.line)+":"+hb(t&&t.column)}function db(t){return Gh(t&&t.start)+"-"+Gh(t&&t.end)}function hb(t){return t&&typeof t=="number"?t:1}class Wt extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=la(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Wt.prototype.file="";Wt.prototype.name="";Wt.prototype.reason="";Wt.prototype.message="";Wt.prototype.stack="";Wt.prototype.column=void 0;Wt.prototype.line=void 0;Wt.prototype.ancestors=void 0;Wt.prototype.cause=void 0;Wt.prototype.fatal=void 0;Wt.prototype.place=void 0;Wt.prototype.ruleId=void 0;Wt.prototype.source=void 0;const er={basename:rL,dirname:iL,extname:sL,join:oL,sep:"/"};function rL(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');rl(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function iL(t){if(rl(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function sL(t){rl(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function oL(...t){let e=-1,n;for(;++e<t.length;)rl(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":aL(n)}function aL(t){rl(t);const e=t.codePointAt(0)===47;let n=lL(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function lL(t,e){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=t.length;){if(o<t.length)a=t.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function rl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const uL={cwd:cL};function cL(){return"/"}function Xh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function fL(t){if(typeof t=="string")t=new URL(t);else if(!Xh(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return dL(t)}function dL(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const ud=["history","path","basename","stem","extname","dirname"];class Qh{constructor(e){let n;e?Xh(e)?n={path:e}:typeof e=="string"||hL(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":uL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ud.length;){const s=ud[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ud.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?er.basename(this.path):void 0}set basename(e){fd(e,"basename"),cd(e,"basename"),this.path=er.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?er.dirname(this.path):void 0}set dirname(e){pb(this.basename,"dirname"),this.path=er.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?er.extname(this.path):void 0}set extname(e){if(cd(e,"extname"),pb(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=er.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Xh(e)&&(e=fL(e)),fd(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?er.basename(this.path,this.extname):void 0}set stem(e){fd(e,"stem"),cd(e,"stem"),this.path=er.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Wt(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function cd(t,e){if(t&&t.includes(er.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+er.sep+"`")}function fd(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function pb(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function hL(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const pL={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},mL="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-",gL=/-[a-z]/g,bL=/%c(?:([-+])(\d+))?/g,yL=/%x/g,EL={2:!0,1:!1,0:null},TL={};function CL(t,e){const n=e||TL,r=n.onerror,i=t instanceof Qh?t:new Qh(t),s=n.fragment?nL:tL,o=String(i),a=s(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?l:null,scriptingEnabled:!1});return wD(a,{file:i,space:n.space,verbose:n.verbose});function l(u){const c=u.code,f=xL(c),d=n[f],h=d??!0,p=typeof h=="number"?h:h?1:0;if(p){const b=pL[f],y=new Wt(g(b.reason),{place:{start:{line:u.startLine,column:u.startCol,offset:u.startOffset},end:{line:u.endLine,column:u.endCol,offset:u.endOffset}},ruleId:c,source:"hast-util-from-html"});i.path&&(y.file=i.path,y.name=i.path+":"+y.name),y.fatal=EL[p],y.note=g(b.description),y.url=b.url===!1?void 0:mL+c,r(y)}function g(b){return b.replace(bL,y).replace(yL,E);function y(T,v,_){const k=(_?Number.parseInt(_,10):0)*(v==="-"?-1:1),M=o.charAt(u.startOffset+k);return wL(M)}function E(){return kL(o.charCodeAt(u.startOffset))}}}}function xL(t){return t.replace(gL,SL)}function SL(t){return t.charAt(1).toUpperCase()}function wL(t){return t==="`"?"` ` `":t}function kL(t){return"0x"+t.toString(16).toUpperCase()}function eG(t){const e=this,{emitParseErrors:n,...r}={...e.data("settings"),...t};e.parser=i;function i(s,o){return CL(s,{...r,onerror:n?function(a){o.path&&(a.name=o.path+":"+a.name,a.file=o.path),o.messages.push(a)}:void 0})}}const rS=-1,qc=0,ua=1,Ku=2,Lm=3,Pm=4,Bm=5,Fm=6,iS=7,sS=8,AL=typeof self=="object"?self:globalThis,mb=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new AL[t](e)},vL=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,o]=e[i];switch(s){case qc:case rS:return n(o,i);case ua:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Ku:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case Lm:return n(new Date(o),i);case Pm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Bm:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case Fm:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case iS:{const{name:a,message:l}=o;return n(mb(a,l),i)}case sS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(mb(s,o),i)};return r},gb=t=>vL(new Map,t)(0),as="",{toString:_L}={},{keys:NL}=Object,Bo=t=>{const e=typeof t;if(e!=="object"||!t)return[qc,e];const n=_L.call(t).slice(8,-1);switch(n){case"Array":return[ua,as];case"Object":return[Ku,as];case"Date":return[Lm,as];case"RegExp":return[Pm,as];case"Map":return[Bm,as];case"Set":return[Fm,as];case"DataView":return[ua,n]}return n.includes("Array")?[ua,n]:n.includes("Error")?[iS,n]:[Ku,n]},Ml=([t,e])=>t===qc&&(e==="function"||e==="symbol"),IL=(t,e,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Bo(o);switch(a){case qc:{let c=o;switch(l){case"bigint":a=sS,c=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([rS],o)}return i([a,c],o)}case ua:{if(l){let d=o;return l==="DataView"?d=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(o)),i([l,[...d]],o)}const c=[],f=i([a,c],o);for(const d of o)c.push(s(d));return f}case Ku:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const c=[],f=i([a,c],o);for(const d of NL(o))(t||!Ml(Bo(o[d])))&&c.push([s(d),s(o[d])]);return f}case Lm:return i([a,o.toISOString()],o);case Pm:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case Bm:{const c=[],f=i([a,c],o);for(const[d,h]of o)(t||!(Ml(Bo(d))||Ml(Bo(h))))&&c.push([s(d),s(h)]);return f}case Fm:{const c=[],f=i([a,c],o);for(const d of o)(t||!Ml(Bo(d)))&&c.push(s(d));return f}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},bb=(t,{json:e,lossy:n}={})=>{const r=[];return IL(!(e||n),!!e,new Map,r)(t),r},Js=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?gb(bb(t,e)):structuredClone(t):(t,e)=>gb(bb(t,e)),Hm=(function(t,e,n,r,i){const s=Xn(e);return oS(t)?s.call(i,t,n,r):!1}),Xn=(function(t){if(t==null)return OL;if(typeof t=="string")return ML(t);if(typeof t=="object")return RL(t);if(typeof t=="function")return Um(t);throw new Error("Expected function, string, or array as `test`")});function RL(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Xn(t[n]);return Um(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function ML(t){return Um(e);function e(n){return n.tagName===t}}function Um(t){return e;function e(n,r,i){return!!(oS(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function OL(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function oS(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const aS=Xn(function(t){return t.tagName==="audio"||t.tagName==="canvas"||t.tagName==="embed"||t.tagName==="iframe"||t.tagName==="img"||t.tagName==="math"||t.tagName==="object"||t.tagName==="picture"||t.tagName==="svg"||t.tagName==="video"}),DL=/[ \t\n\f\r]/g;function il(t){return typeof t=="object"?t.type==="text"?yb(t.value):!1:yb(t)}function yb(t){return t.replace(DL,"")===""}const yo=(function(t){if(t==null)return FL;if(typeof t=="function")return Yc(t);if(typeof t=="object")return Array.isArray(t)?LL(t):PL(t);if(typeof t=="string")return BL(t);throw new Error("Expected function, string, or object as test")});function LL(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=yo(t[n]);return Yc(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function PL(t){const e=t;return Yc(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function BL(t){return Yc(e);function e(n){return n&&n.type===t}}function Yc(t){return e;function e(n,r,i){return!!(HL(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function FL(){return!0}function HL(t){return t!==null&&typeof t=="object"&&"type"in t}const UL=["address","article","aside","blockquote","body","br","caption","center","col","colgroup","dd","dialog","dir","div","dl","dt","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","li","listing","main","menu","nav","ol","optgroup","option","p","plaintext","pre","section","summary","table","tbody","td","td","tfoot","th","th","thead","tr","ul","wbr","xmp"],$L=["button","input","select","textarea"],VL=["area","base","basefont","dialog","datalist","head","link","meta","noembed","noframes","param","rp","script","source","style","template","track","title"],zL={},$m=yo(["comment","doctype"]);function jL(t,e){lS(t,{collapse:QL((e||zL).newlines?GL:XL),whitespace:"normal"})}function lS(t,e){if("children"in t){const n={...e};return(t.type==="root"||fS(t))&&(n.before=!0,n.after=!0),n.whitespace=ZL(t,e),qL(t,n)}if(t.type==="text"){if(e.whitespace==="normal")return WL(t,e);e.whitespace==="nowrap"&&(t.value=e.collapse(t.value))}return{ignore:$m(t),stripAtStart:!1,remove:!1}}function WL(t,e){const n=e.collapse(t.value),r={ignore:!1,stripAtStart:!1,remove:!1};let i=0,s=n.length;return e.before&&Eb(n.charAt(0))&&i++,i!==s&&Eb(n.charAt(s-1))&&(e.after?s--:r.stripAtStart=!0),i===s?r.remove=!0:t.value=n.slice(i,s),r}function qL(t,e){let n=e.before;const r=e.after,i=t.children;let s=i.length,o=-1;for(;++o<s;){const a=lS(i[o],{...e,after:uS(i,o,r),before:n});a.remove?(i.splice(o,1),o--,s--):a.ignore||(n=a.stripAtStart),cS(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function uS(t,e,n){for(;++e<t.length;){const r=t[e];let i=YL(r);if(i===void 0&&"children"in r&&!KL(r)&&(i=uS(r.children,-1)),typeof i=="boolean")return i}return n}function YL(t){if(t.type==="element"){if(cS(t))return!1;if(fS(t))return!0}else if(t.type==="text"){if(!il(t))return!1}else if(!$m(t))return!1}function cS(t){return aS(t)||Hm(t,$L)}function fS(t){return Hm(t,UL)}function KL(t){return!!(t.type==="element"&&t.properties.hidden)||$m(t)||Hm(t,VL)}function Eb(t){return t===" "||t===`
|
|
108
|
+
`}function GL(t){const e=/\r?\n|\r/.exec(t);return e?e[0]:" "}function XL(){return" "}function QL(t){return e;function e(n){return String(n).replace(/[\t\n\v\f\r ]+/g,t)}}function ZL(t,e){if("tagName"in t&&t.properties)switch(t.tagName){case"listing":case"plaintext":case"script":case"style":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.properties.wrap?"pre-wrap":"pre";case"td":case"th":return t.properties.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}return e.whitespace}function JL(t){return function(e){jL(e,t)}}const dS=[],eP=!0,Gu=!1,hS="skip";function pS(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=yo(i),o=r?-1:1;a(t,void 0,[])();function a(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=dS,p,g,b;if((!e||s(l,u,c[c.length-1]||void 0))&&(h=tP(n(l,c)),h[0]===Gu))return h;if("children"in l&&l.children){const y=l;if(y.children&&h[0]!==hS)for(g=(r?y.children.length:-1)+o,b=c.concat(y);g>-1&&g<y.children.length;){const E=y.children[g];if(p=a(E,g,b)(),p[0]===Gu)return p;g=typeof p[1]=="number"?p[1]:g+o}}return h}}}function tP(t){return Array.isArray(t)?t:typeof t=="number"?[eP,t]:t==null?dS:[t]}function eo(t,e,n,r){let i,s,o;typeof e=="function"&&typeof n!="function"?(s=void 0,o=e,i=n):(s=e,o=n,i=r),pS(t,s,a,i);function a(l,u){const c=u[u.length-1],f=c?c.children.indexOf(l):void 0;return o(l,f,c)}}const mS=bS("end"),gS=bS("start");function bS(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function yS(t){const e=gS(t),n=mS(t);if(e&&n)return{start:e,end:n}}function nP(t,e){const n=e.properties||{},r=t.all(e),i={type:"link",url:t.resolve(String(n.href||"")||null),title:n.title?String(n.title):null,children:r};return t.patch(e,i),i}function rP(t,e){t.baseFound||(t.frozenBaseUrl=String(e.properties&&e.properties.href||"")||void 0,t.baseFound=!0)}function iP(t,e){const n={type:"blockquote",children:t.toFlow(t.all(e))};return t.patch(e,n),n}function sP(t,e){const n={type:"break"};return t.patch(e,n),n}const Tb=(function(t,e,n){const r=yo(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),Cb=/\n/g,xb=/[\t ]+/g,Zh=Xn("br"),Sb=Xn(dP),oP=Xn("p"),wb=Xn("tr"),aP=Xn(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fP,hP]),ES=Xn(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function sl(t,e){const n={},r="children"in t?t.children:[],i=ES(t),s=xS(t,{whitespace:n.whitespace||"normal"}),o=[];(t.type==="text"||t.type==="comment")&&o.push(...CS(t,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)o.push(...TS(r[a],t,{whitespace:s,breakBefore:a?void 0:i,breakAfter:a<r.length-1?Zh(r[a+1]):i}));const l=[];let u;for(a=-1;++a<o.length;){const c=o[a];typeof c=="number"?u!==void 0&&c>u&&(u=c):c&&(u!==void 0&&u>-1&&l.push(`
|
|
109
|
+
`.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function TS(t,e,n){return t.type==="element"?lP(t,e,n):t.type==="text"?n.whitespace==="normal"?CS(t,n):uP(t):[]}function lP(t,e,n){const r=xS(t,n),i=t.children||[];let s=-1,o=[];if(aP(t))return o;let a,l;for(Zh(t)||wb(t)&&Tb(e,t,wb)?l=`
|
|
110
|
+
`:oP(t)?(a=2,l=2):ES(t)&&(a=1,l=1);++s<i.length;)o=o.concat(TS(i[s],t,{whitespace:r,breakBefore:s?void 0:a,breakAfter:s<i.length-1?Zh(i[s+1]):l}));return Sb(t)&&Tb(e,t,Sb)&&o.push(" "),a&&o.unshift(a),l&&o.push(l),o}function CS(t,e){const n=String(t.value),r=[],i=[];let s=0;for(;s<=n.length;){Cb.lastIndex=s;const l=Cb.exec(n),u=l&&"index"in l?l.index:n.length;r.push(cP(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,u===n.length?e.breakAfter:!0)),s=u+1}let o=-1,a;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),a=void 0):r[o]?(typeof a=="number"&&i.push(a),i.push(r[o]),a=0):(o===0||o===r.length-1)&&i.push(0);return i}function uP(t){return[String(t.value)]}function cP(t,e,n){const r=[];let i=0,s;for(;i<t.length;){xb.lastIndex=i;const o=xb.exec(t);s=o?o.index:t.length,!i&&!s&&o&&!e&&r.push(""),i!==s&&r.push(t.slice(i,s)),i=o?s+o[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function xS(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function fP(t){return!!(t.properties||{}).hidden}function dP(t){return t.tagName==="td"||t.tagName==="th"}function hP(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function pP(t){const e=String(t);let n=e.length;for(;n>0;){const r=e.codePointAt(n-1);if(r!==void 0&&(r===10||r===13))n--;else break}return e.slice(0,n)}const dd="language-";function Ol(t,e){const n=e.children;let r=-1,i,s;if(e.tagName==="pre")for(;++r<n.length;){const a=n[r];if(a.type==="element"&&a.tagName==="code"&&a.properties&&a.properties.className&&Array.isArray(a.properties.className)){i=a.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,dd.length)===dd){s=String(i[r]).slice(dd.length);break}}const o={type:"code",lang:s||null,meta:null,value:pP(sl(e))};return t.patch(e,o),o}function mP(t,e){const n={type:"html",value:"<!--"+e.value+"-->"};return t.patch(e,n),n}function hd(t,e){const r={type:"delete",children:t.all(e)};return t.patch(e,r),r}function Vm(t){let e=-1;if(t.length>1){for(;++e<t.length;)if(t[e].spread)return!0}return!1}function gP(t,e){const n=[],r=[];let i=-1;for(;++i<e.children.length;){const a=e.children[i];a.type==="element"&&a.tagName==="div"?n.push(...a.children):n.push(a)}let s={definitions:[],titles:[]};for(i=-1;++i<n.length;){const a=n[i];if(a.type==="element"&&a.tagName==="dt"){const l=n[i-1];l&&l.type==="element"&&l.tagName==="dd"&&(r.push(s),s={definitions:[],titles:[]}),s.titles.push(a)}else s.definitions.push(a)}r.push(s),i=-1;const o=[];for(;++i<r.length;){const a=[...kb(t,r[i].titles),...kb(t,r[i].definitions)];a.length>0&&o.push({type:"listItem",spread:a.length>1,checked:null,children:a})}if(o.length>0){const a={type:"list",ordered:!1,start:null,spread:Vm(o),children:o};return t.patch(e,a),a}}function kb(t,e){const n=t.all({type:"root",children:e}),r=t.toSpecificContent(n,bP);return r.length===0?[]:r.length===1?r[0].children:[{type:"list",ordered:!1,start:null,spread:Vm(r),children:r}]}function bP(){return{type:"listItem",spread:!1,checked:null,children:[]}}function Dl(t,e){const r={type:"emphasis",children:t.all(e)};return t.patch(e,r),r}function zm(t){let e=0,n=t.length;for(;e<n&&t[e].type==="break";)e++;for(;n>e&&t[n-1].type==="break";)n--;return e===0&&n===t.length?t:t.slice(e,n)}function ls(t,e){const n=Number(e.tagName.charAt(1))||1,r=zm(t.all(e)),i={type:"heading",depth:n,children:r};return t.patch(e,i),i}function yP(t,e){const n={type:"thematicBreak"};return t.patch(e,n),n}function EP(t,e){const n=e.properties||{},r=String(n.src||""),i=String(n.title||"");if(r&&i){const s={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:i}]};return t.patch(e,s),s}}function Ab(t,e){const n=e.properties||{},r={type:"image",url:t.resolve(String(n.src||"")||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):""};return t.patch(e,r),r}function Fo(t,e){const n={type:"inlineCode",value:sl(e)};return t.patch(e,n),n}function SS(t,e){const n=[],r=[],i=e||t.properties||{},s=wS(t),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1);let a=-1;for(;++a<s.length;){const c=s[a];c&&c.properties&&c.properties.selected&&n.push(c)}const l=n.length>0?n:s,u=Math.min(l.length,o);for(a=-1;++a<u;){const c=l[a],f=c.properties||{},d=sl(c),h=d||String(f.label||""),p=String(f.value||"")||d;r.push([p,h===p?void 0:h])}return r}function wS(t){const e=[];let n=-1;for(;++n<t.children.length;){const r=t.children[n];"children"in r&&Array.isArray(r.children)&&e.push(...wS(r)),r.type==="element"&&r.tagName==="option"&&(!r.properties||!r.properties.disabled)&&e.push(r)}return e}const TP="[x]",CP="[ ]";function xP(t,e){const n=e.properties||{},r=String(n.value||n.placeholder||"");if(n.disabled||n.type==="hidden"||n.type==="file")return;if(n.type==="checkbox"||n.type==="radio"){const l={type:"text",value:n.checked?t.options.checked||TP:t.options.unchecked||CP};return t.patch(e,l),l}if(n.type==="image"){const l=n.alt||r;if(l){const u={type:"image",url:t.resolve(String(n.src||"")||null),title:String(n.title||"")||null,alt:String(l)};return t.patch(e,u),u}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!=="button"&&n.type!=="file"&&n.type!=="password"&&n.type!=="reset"&&n.type!=="submit"&&n.list){const l=String(n.list),u=t.elementById.get(l);u&&u.tagName==="datalist"&&(i=SS(u,n))}if(i.length===0)return;if(n.type==="password"&&(i[0]=["•".repeat(i[0][0].length),void 0]),n.type==="email"||n.type==="url"){const l=[];let u=-1;for(;++u<i.length;){const c=t.resolve(i[u][0]),f={type:"link",title:null,url:n.type==="email"?"mailto:"+c:c,children:[{type:"text",value:i[u][1]||c}]};l.push(f),u!==i.length-1&&l.push({type:"text",value:", "})}return l}const s=[];let o=-1;for(;++o<i.length;)s.push(i[o][1]?i[o][1]+" ("+i[o][0]+")":i[o][0]);const a={type:"text",value:s.join(", ")};return t.patch(e,a),a}const SP={}.hasOwnProperty;function wP(t,e){const n=t.type==="element"&&SP.call(t.properties,e)&&t.properties[e];return n!=null&&n!==!1}const kP=new Set(["pingback","prefetch","stylesheet"]);function AP(t){if(t.type!=="element"||t.tagName!=="link")return!1;if(t.properties.itemProp)return!0;const e=t.properties.rel;let n=-1;if(!Array.isArray(e)||e.length===0)return!1;for(;++n<e.length;)if(!kP.has(String(e[n])))return!1;return!0}const vP=Xn(["a","abbr","area","b","bdi","bdo","br","button","cite","code","data","datalist","del","dfn","em","i","input","ins","kbd","keygen","label","map","mark","meter","noscript","output","progress","q","ruby","s","samp","script","select","small","span","strong","sub","sup","template","textarea","time","u","var","wbr"]),_P=Xn("meta");function kS(t){return!!(t.type==="text"||vP(t)||aS(t)||AP(t)||_P(t)&&wP(t,"itemProp"))}function pd(t,e){const{rest:n,checkbox:r}=vS(e),i=r?!!r.properties.checked:null,s=AS(n),o=t.toFlow(t.all(n)),a={type:"listItem",spread:s,checked:i,children:o};return t.patch(e,a),a}function AS(t){let e=-1,n=!1;for(;++e<t.children.length;){const r=t.children[e];if(r.type==="element"){if(kS(r))continue;if(r.tagName==="p"||n||AS(r))return!0;n=!0}}return!1}function vS(t){const e=t.children[0];if(e&&e.type==="element"&&e.tagName==="input"&&e.properties&&(e.properties.type==="checkbox"||e.properties.type==="radio")){const n={...t,children:t.children.slice(1)};return{checkbox:e,rest:n}}if(e&&e.type==="element"&&e.tagName==="p"){const{checkbox:n,rest:r}=vS(e);if(n){const i={...t,children:[r,...t.children.slice(1)]};return{checkbox:n,rest:i}}}return{checkbox:void 0,rest:t}}function md(t,e){const n=e.tagName==="ol",r=t.toSpecificContent(t.all(e),NP);let i=null;n&&(i=e.properties&&e.properties.start?Number.parseInt(String(e.properties.start),10):1);const s={type:"list",ordered:n,start:i,spread:Vm(r),children:r};return t.patch(e,s),s}function NP(){return{type:"listItem",spread:!1,checked:null,children:[]}}const IP={};function Kc(t,e){const n=IP,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _S(t,r,i)}function _S(t,e,n){if(RP(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return vb(t.children,e,n)}return Array.isArray(t)?vb(t,e,n):""}function vb(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=_S(t[i],e,n);return r.join("")}function RP(t){return!!(t&&typeof t=="object")}const NS=yo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Gc(t){let e=-1;for(;++e<t.length;){const n=t[e];if(!MS(n)||"children"in n&&Gc(n.children))return!0}return!1}function IS(t){return RS(t,e,function(n){return n});function e(n){return n.every(function(r){return r.type==="text"?il(r.value):!1})?[]:[{type:"paragraph",children:zm(n)}]}}function MP(t){return RS(t.children,e,n);function e(r){const i=gd(t);return i.children=r,[i]}function n(r){if("children"in r&&"children"in t){const i=gd(t),s=gd(r);return i.children=r.children,s.children.push(i),s}return{...r}}}function RS(t,e,n){const r=OP(t),i=[];let s=[],o=-1;for(;++o<r.length;){const a=r[o];MS(a)?s.push(a):(s.length>0&&(i.push(...e(s)),s=[]),i.push(n(a)))}return s.length>0&&(i.push(...e(s)),s=[]),i}function OP(t){const e=[];let n=-1;for(;++n<t.length;){const r=t[n];(r.type==="delete"||r.type==="link")&&Gc(r.children)?e.push(...MP(r)):e.push(r)}return e}function MS(t){const e=t.data&&t.data.hName;return e?kS({type:"element",tagName:e,properties:{},children:[]}):NS(t)}function gd(t){return Js({...t,children:[]})}function _b(t,e){const n=e.properties||{},r=e.tagName==="video"?String(n.poster||""):"";let i=String(n.src||""),s=-1,o=!1,a=t.all(e);if(eo({type:"root",children:a},function(f){if(f.type==="link")return o=!0,Gu}),o||Gc(a))return a;for(;!i&&++s<e.children.length;){const f=e.children[s];f.type==="element"&&f.tagName==="source"&&f.properties&&(i=String(f.properties.src||""))}if(r){const f={type:"image",title:null,url:t.resolve(r),alt:Kc(a)};t.patch(e,f),a=[f]}const u=a,c={type:"link",title:n.title?String(n.title):null,url:t.resolve(i),children:u};return t.patch(e,c),c}function Nb(t,e){const n=zm(t.all(e));if(n.length>0){const r={type:"paragraph",children:n};return t.patch(e,r),r}}const DP=['"'];function LP(t,e){const n=t.options.quotes||DP;t.qNesting++;const r=t.all(e);t.qNesting--;const i=n[t.qNesting%n.length],s=r[0],o=r[r.length-1],a=i.charAt(0),l=i.length>1?i.charAt(1):i;return s&&s.type==="text"?s.value=a+s.value:r.unshift({type:"text",value:a}),o&&o.type==="text"?o.value+=l:r.push({type:"text",value:l}),r}function PP(t,e){let n=t.all(e);(t.options.document||Gc(n))&&(n=IS(n));const r={type:"root",children:n};return t.patch(e,r),r}function BP(t,e){const n=SS(e);let r=-1;const i=[];for(;++r<n.length;){const s=n[r];i.push(s[1]?s[1]+" ("+s[0]+")":s[0])}if(i.length>0){const s={type:"text",value:i.join(", ")};return t.patch(e,s),s}}function Ib(t,e){const r={type:"strong",children:t.all(e)};return t.patch(e,r),r}function Rb(t,e){const r={type:"tableCell",children:t.all(e)};if(t.patch(e,r),e.properties){const i=e.properties.rowSpan,s=e.properties.colSpan;if(i||s){const o=r.data||(r.data={});i&&(o.hastUtilToMdastTemporaryRowSpan=i),s&&(o.hastUtilToMdastTemporaryColSpan=s)}}return r}function FP(t,e){const r={type:"tableRow",children:t.toSpecificContent(t.all(e),HP)};return t.patch(e,r),r}function HP(){return{type:"tableCell",children:[]}}function UP(t,e){if(t.inTable){const u={type:"text",value:sl(e)};return t.patch(e,u),u}t.inTable=!0;const{align:n,headless:r}=$P(e),i=t.toSpecificContent(t.all(e),Mb);r&&i.unshift(Mb());let s=-1;for(;++s<i.length;){const u=i[s],c=t.toSpecificContent(u.children,VP);u.children=c}let o=1;for(s=-1;++s<i.length;){const u=i[s].children;let c=-1;for(;++c<u.length;){const f=u[c];if(f.data){const d=f.data,h=Number.parseInt(String(d.hastUtilToMdastTemporaryColSpan),10)||1,p=Number.parseInt(String(d.hastUtilToMdastTemporaryRowSpan),10)||1;if(h>1||p>1){let g=s-1;for(;++g<s+p;){let b=c-1;for(;++b<c+h&&i[g];){const y=[];(g!==s||b!==c)&&y.push({type:"tableCell",children:[]}),i[g].children.splice(b,0,...y)}}}"hastUtilToMdastTemporaryColSpan"in f.data&&delete f.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in f.data&&delete f.data.hastUtilToMdastTemporaryRowSpan,Object.keys(f.data).length===0&&delete f.data}}u.length>o&&(o=u.length)}for(s=-1;++s<i.length;){const u=i[s].children;let c=u.length-1;for(;++c<o;)u.push({type:"tableCell",children:[]})}let a=n.length-1;for(;++a<o;)n.push(null);t.inTable=!1;const l={type:"table",align:n,children:i};return t.patch(e,l),l}function $P(t){const e={align:[null],headless:!0};let n=0,r=0;return eo(t,function(i){if(i.type==="element"){if(i.tagName==="table"&&t!==i)return hS;if((i.tagName==="th"||i.tagName==="td")&&i.properties){if(!e.align[r]){const s=String(i.properties.align||"")||null;(s==="center"||s==="left"||s==="right"||s===null)&&(e.align[r]=s)}e.headless&&n<2&&i.tagName==="th"&&(e.headless=!1),r++}else i.tagName==="thead"?e.headless=!1:i.tagName==="tr"&&(n++,r=0)}}),e}function VP(){return{type:"tableCell",children:[]}}function Mb(){return{type:"tableRow",children:[]}}function zP(t,e){const n={type:"text",value:e.value};return t.patch(e,n),n}function jP(t,e){const n={type:"text",value:sl(e)};return t.patch(e,n),n}function WP(t,e){const n={type:"text",value:""};return t.patch(e,n),n}const qP={comment:mP,doctype:Se,root:PP,text:zP},YP={applet:Se,area:Se,basefont:Se,bgsound:Se,caption:Se,col:Se,colgroup:Se,command:Se,content:Se,datalist:Se,dialog:Se,element:Se,embed:Se,frame:Se,frameset:Se,isindex:Se,keygen:Se,link:Se,math:Se,menu:Se,menuitem:Se,meta:Se,nextid:Se,noembed:Se,noframes:Se,optgroup:Se,option:Se,param:Se,script:Se,shadow:Se,source:Se,spacer:Se,style:Se,svg:Se,template:Se,title:Se,track:Se,abbr:xe,acronym:xe,bdi:xe,bdo:xe,big:xe,blink:xe,button:xe,canvas:xe,cite:xe,data:xe,details:xe,dfn:xe,font:xe,ins:xe,label:xe,map:xe,marquee:xe,meter:xe,nobr:xe,noscript:xe,object:xe,output:xe,progress:xe,rb:xe,rbc:xe,rp:xe,rt:xe,rtc:xe,ruby:xe,slot:xe,small:xe,span:xe,sup:xe,sub:xe,tbody:xe,tfoot:xe,thead:xe,time:xe,address:tt,article:tt,aside:tt,body:tt,center:tt,div:tt,fieldset:tt,figcaption:tt,figure:tt,form:tt,footer:tt,header:tt,hgroup:tt,html:tt,legend:tt,main:tt,multicol:tt,nav:tt,picture:tt,section:tt,a:nP,audio:_b,b:Ib,base:rP,blockquote:iP,br:sP,code:Fo,dir:md,dl:gP,dt:pd,dd:pd,del:hd,em:Dl,h1:ls,h2:ls,h3:ls,h4:ls,h5:ls,h6:ls,hr:yP,i:Dl,iframe:EP,img:Ab,image:Ab,input:xP,kbd:Fo,li:pd,listing:Ol,mark:Dl,ol:md,p:Nb,plaintext:Ol,pre:Ol,q:LP,s:hd,samp:Fo,select:BP,strike:hd,strong:Ib,summary:Nb,table:UP,td:Rb,textarea:jP,th:Rb,tr:FP,tt:Fo,u:Dl,ul:md,var:Fo,video:_b,wbr:WP,xmp:Ol};function xe(t,e){return t.all(e)}function tt(t,e){return t.toFlow(t.all(e))}function Se(){}const Ob={}.hasOwnProperty;function KP(t){return{all:GP,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...YP,...t.handlers},inTable:!1,nodeHandlers:{...qP,...t.nodeHandlers},one:XP,options:t,patch:QP,qNesting:0,resolve:ZP,toFlow:JP,toSpecificContent:e9}}function GP(t){const e=t.children||[],n=[];let r=-1;for(;++r<e.length;){const i=e[r],s=this.one(i,t);Array.isArray(s)?n.push(...s):s&&n.push(s)}return n}function XP(t,e){if(t.type==="element"){if(t.properties&&t.properties.dataMdast==="ignore")return;if(Ob.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,e)||void 0}else if(Ob.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,e)||void 0;if("value"in t&&typeof t.value=="string"){const n={type:"text",value:t.value};return this.patch(t,n),n}if("children"in t)return this.all(t)}function QP(t,e){t.position&&(e.position=yS(t))}function ZP(t){const e=this.frozenBaseUrl;return t==null?"":e?String(new URL(t,e)):t}function JP(t){return IS(t)}function e9(t,e){const n=e(),r=[];let i=[],s=-1;for(;++s<t.length;){const a=t[s];if(o(a))i.length>0&&(a.children.unshift(...i),i=[]),r.push(a);else{const l=a;i.push(l)}}if(i.length>0){let a=r[r.length-1];a||(a=e(),r.push(a)),a.children.push(...i),i=[]}return r;function o(a){return a.type===n.type}}const t9={};function Db(t,e){const n=Js(t),r=e||t9,i=JL({newlines:r.newlines===!0}),s=KP(r);let o;i(n),eo(n,function(l){if(l&&l.type==="element"&&l.properties){const u=String(l.properties.id||"")||void 0;u&&!s.elementById.has(u)&&s.elementById.set(u,l)}});const a=s.one(n,void 0);return a?Array.isArray(a)?o={type:"root",children:a}:o=a:o={type:"root",children:[]},eo(o,function(l,u,c){if(l.type==="text"&&u!==void 0&&c){const f=c.children[u-1];if(f&&f.type===l.type)return f.value+=l.value,c.children.splice(u,1),f.position&&l.position&&(f.position.end=l.position.end),u-1;if(l.value=l.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),c&&(c.type==="heading"||c.type==="paragraph"||c.type==="root")&&(u||(l.value=l.value.replace(/^[\t ]+/,"")),u===c.children.length-1&&(l.value=l.value.replace(/[\t ]+$/,""))),!l.value)return c.children.splice(u,1),u}}),o}const Lb={document:!0};function tG(t,e){return t&&"run"in t?async function(n,r){const i=Db(n,{...Lb,...e});await t.run(i,r)}:function(n){return Db(n,{...Lb,...t})}}function Xu(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}const Ft=mi(/[A-Za-z]/),vt=mi(/[\dA-Za-z]/),n9=mi(/[#-'*+\--9=?A-Z^-~]/);function Qu(t){return t!==null&&(t<32||t===127)}const Jh=mi(/\d/),r9=mi(/[\dA-Fa-f]/),i9=mi(/[!-/:-@[-`{-~]/);function ce(t){return t!==null&&t<-2}function Ue(t){return t!==null&&(t<0||t===32)}function Ae(t){return t===-2||t===-1||t===32}const Xc=mi(new RegExp("\\p{P}|\\p{S}","u")),qi=mi(/\s/);function mi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function s9(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function o9(t,e,n){const i=yo((n||{}).ignore||[]),s=a9(e);let o=-1;for(;++o<s.length;)pS(t,"text",a);function a(u,c){let f=-1,d;for(;++f<c.length;){const h=c[f],p=d?d.children:void 0;if(i(h,p?p.indexOf(h):void 0,d))return;d=h}if(d)return l(u,c)}function l(u,c){const f=c[c.length-1],d=s[o][0],h=s[o][1];let p=0;const b=f.children.indexOf(u);let y=!1,E=[];d.lastIndex=0;let T=d.exec(u.value);for(;T;){const v=T.index,_={index:T.index,input:T.input,stack:[...c,u]};let k=h(...T,_);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?d.lastIndex=v+1:(p!==v&&E.push({type:"text",value:u.value.slice(p,v)}),Array.isArray(k)?E.push(...k):k&&E.push(k),p=v+T[0].length,y=!0),!d.global)break;T=d.exec(u.value)}return y?(p<u.value.length&&E.push({type:"text",value:u.value.slice(p)}),f.children.splice(b,1,...E)):E=[u],b+E.length}}function a9(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([l9(i[0]),u9(i[1])])}return e}function l9(t){return typeof t=="string"?new RegExp(s9(t),"g"):t}function u9(t){return typeof t=="function"?t:function(){return t}}const bd="phrasing",yd=["autolink","link","image","label"];function c9(){return{transforms:[b9],enter:{literalAutolink:d9,literalAutolinkEmail:Ed,literalAutolinkHttp:Ed,literalAutolinkWww:Ed},exit:{literalAutolink:g9,literalAutolinkEmail:m9,literalAutolinkHttp:h9,literalAutolinkWww:p9}}}function f9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bd,notInConstruct:yd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bd,notInConstruct:yd},{character:":",before:"[ps]",after:"\\/",inConstruct:bd,notInConstruct:yd}]}}function d9(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Ed(t){this.config.enter.autolinkProtocol.call(this,t)}function h9(t){this.config.exit.autolinkProtocol.call(this,t)}function p9(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function m9(t){this.config.exit.autolinkEmail.call(this,t)}function g9(t){this.exit(t)}function b9(t){o9(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,y9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),E9]],{ignore:["link","linkReference"]})}function y9(t,e,n,r,i){let s="";if(!OS(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!T9(n)))return!1;const o=C9(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function E9(t,e,n,r){return!OS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function T9(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function C9(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Xu(t,"(");let s=Xu(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function OS(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||qi(n)||Xc(n))&&(!e||n!==47)}function $n(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}DS.peek=I9;function x9(){this.buffer()}function S9(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function w9(){this.buffer()}function k9(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function A9(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$n(this.sliceSerialize(t)).toLowerCase(),n.label=e}function v9(t){this.exit(t)}function _9(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$n(this.sliceSerialize(t)).toLowerCase(),n.label=e}function N9(t){this.exit(t)}function I9(){return"["}function DS(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function R9(){return{enter:{gfmFootnoteCallString:x9,gfmFootnoteCall:S9,gfmFootnoteDefinitionLabelString:w9,gfmFootnoteDefinition:k9},exit:{gfmFootnoteCallString:A9,gfmFootnoteCall:v9,gfmFootnoteDefinitionLabelString:_9,gfmFootnoteDefinition:N9}}}function M9(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:DS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((e?`
|
|
111
|
+
`:" ")+s.indentLines(s.containerFlow(r,a.current()),e?LS:O9))),u(),l}}function O9(t,e,n){return e===0?t:LS(t,e,n)}function LS(t,e,n){return(n?"":" ")+t}const D9=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];PS.peek=H9;function L9(){return{canContainEols:["delete"],enter:{strikethrough:B9},exit:{strikethrough:F9}}}function P9(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:D9}],handlers:{delete:PS}}}function B9(t){this.enter({type:"delete",children:[]},t)}function F9(t){this.exit(t)}function PS(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function H9(){return"~"}function U9(t){return t.length}function $9(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||U9,s=[],o=[],a=[],l=[];let u=0,c=-1;for(;++c<t.length;){const g=[],b=[];let y=-1;for(t[c].length>u&&(u=t[c].length);++y<t[c].length;){const E=V9(t[c][y]);if(n.alignDelimiters!==!1){const T=i(E);b[y]=T,(l[y]===void 0||T>l[y])&&(l[y]=T)}g.push(E)}o[c]=g,a[c]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=Pb(r[f]);else{const g=Pb(r);for(;++f<u;)s[f]=g}f=-1;const d=[],h=[];for(;++f<u;){const g=s[f];let b="",y="";g===99?(b=":",y=":"):g===108?b=":":g===114&&(y=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[f]-b.length-y.length);const T=b+"-".repeat(E)+y;n.alignDelimiters!==!1&&(E=b.length+E+y.length,E>l[f]&&(l[f]=E),h[f]=E),d[f]=T}o.splice(1,0,d),a.splice(1,0,h),c=-1;const p=[];for(;++c<o.length;){const g=o[c],b=a[c];f=-1;const y=[];for(;++f<u;){const E=g[f]||"";let T="",v="";if(n.alignDelimiters!==!1){const _=l[f]-(b[f]||0),k=s[f];k===114?T=" ".repeat(_):k===99?_%2?(T=" ".repeat(_/2+.5),v=" ".repeat(_/2-.5)):(T=" ".repeat(_/2),v=T):v=" ".repeat(_)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(T),y.push(E),n.alignDelimiters!==!1&&y.push(v),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
|
|
112
|
+
`)}function V9(t){return t==null?"":String(t)}function Pb(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}const Bb={}.hasOwnProperty;function BS(t,e){const n=e||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&Bb.call(i,t)){const l=String(i[t]);o=Bb.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const z9={}.hasOwnProperty;function FS(t,e){let n=-1,r;if(e.extensions)for(;++n<e.extensions.length;)FS(t,e.extensions[n]);for(r in e)if(z9.call(e,r))switch(r){case"extensions":break;case"unsafe":{Fb(t[r],e[r]);break}case"join":{Fb(t[r],e[r]);break}case"handlers":{j9(t[r],e[r]);break}default:t.options[r]=e[r]}return t}function Fb(t,e){e&&t.push(...e)}function j9(t,e){e&&Object.assign(t,e)}function W9(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(t,s.current()),q9);return i(),o}function q9(t,e,n){return">"+(n?"":" ")+t}function HS(t,e){return Hb(t,e.inConstruct,!0)&&!Hb(t,e.notInConstruct,!1)}function Hb(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Ub(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
113
|
+
`&&HS(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
114
|
+
`}function Y9(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,o=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+e.length,r=n.indexOf(e,i);return o}function ep(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function K9(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function G9(t,e,n,r){const i=K9(n),s=t.value||"",o=i==="`"?"GraveAccent":"Tilde";if(ep(t,n)){const f=n.enter("codeIndented"),d=n.indentLines(s,X9);return f(),d}const a=n.createTracker(r),l=i.repeat(Math.max(Y9(s,i)+1,3)),u=n.enter("codeFenced");let c=a.move(l);if(t.lang){const f=n.enter(`codeFencedLang${o}`);c+=a.move(n.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${o}`);c+=a.move(" "),c+=a.move(n.safe(t.meta,{before:c,after:`
|
|
115
|
+
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
116
|
+
`),s&&(c+=a.move(s+`
|
|
117
|
+
`)),c+=a.move(l),u(),c}function X9(t,e,n){return(n?"":" ")+t}function jm(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Q9(t,e,n,r){const i=jm(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":`
|
|
118
|
+
`,...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),o(),u}function Z9(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function di(t){return"&#x"+t.toString(16).toUpperCase()+";"}function to(t){if(t===null||Ue(t)||qi(t))return 1;if(Xc(t))return 2}function Zu(t,e,n){const r=to(t),i=to(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}US.peek=J9;function US(t,e,n,r){const i=Z9(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(t,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Zu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=di(u)+l.slice(1));const f=l.charCodeAt(l.length-1),d=Zu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+di(f));const h=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+h}function J9(t,e,n){return n.options.emphasis||"*"}function $S(t,e){let n=!1;return eo(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Gu}),!!((!t.depth||t.depth<3)&&Kc(t)&&(e.options.setext||n))}function e7(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if($S(t,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),d=n.containerPhrasing(t,{...s.current(),before:`
|
|
119
|
+
`,after:`
|
|
120
|
+
`});return f(),c(),d+`
|
|
121
|
+
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
|
122
|
+
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(t,{before:"# ",after:`
|
|
123
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=di(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}VS.peek=t7;function VS(t){return t.value||""}function t7(){return"<"}zS.peek=n7;function zS(t,e,n,r){const i=jm(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function n7(){return"!"}jS.peek=r7;function jS(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(t.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function r7(){return"!"}WS.peek=i7;function WS(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function i7(){return"`"}function qS(t,e){const n=Kc(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}YS.peek=s7;function YS(t,e,n,r){const i=jm(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(qS(t,n)){const c=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(t,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=c,f}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=n.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(n.safe(t.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),a(),u}function s7(t,e,n){return qS(t,n)?"<":"["}KS.peek=o7;function KS(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(t,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function o7(){return"["}function Wm(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function a7(t){const e=Wm(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function l7(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function GS(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function u7(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=t.ordered?l7(n):Wm(n);const a=t.ordered?o==="."?")":".":a7(n);let l=e&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!t.ordered){const c=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),GS(n)===o&&c){let f=-1;for(;++f<t.children.length;){const d=t.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const u=n.containerFlow(t,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function c7(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function f7(t,e,n,r){const i=c7(n);let s=n.bulletCurrent||Wm(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(t,a.current()),c);return l(),u;function c(f,d,h){return d?(h?"":" ".repeat(o))+f:(h?s:s+" ".repeat(o-s.length))+f}}function d7(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(t,r);return s(),i(),o}function h7(t,e,n,r){return(t.children.some(function(o){return NS(o)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function p7(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}XS.peek=m7;function XS(t,e,n,r){const i=p7(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(t,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Zu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=di(u)+l.slice(1));const f=l.charCodeAt(l.length-1),d=Zu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+di(f));const h=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+h}function m7(t,e,n){return n.options.strong||"*"}function g7(t,e,n,r){return n.safe(t.value,r)}function b7(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function y7(t,e,n){const r=(GS(n)+(n.options.ruleSpaces?" ":"")).repeat(b7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const qm={blockquote:W9,break:Ub,code:G9,definition:Q9,emphasis:US,hardBreak:Ub,heading:e7,html:VS,image:zS,imageReference:jS,inlineCode:WS,link:YS,linkReference:KS,list:u7,listItem:f7,paragraph:d7,root:h7,strong:XS,text:g7,thematicBreak:y7},E7=[T7];function T7(t,e,n,r){if(e.type==="code"&&ep(e,r)&&(t.type==="list"||t.type===e.type&&ep(t,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&$S(e,r))?void 0:n.spread?1:0}const Ci=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],C7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
124
|
+
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ci},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
125
|
+
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ci},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
126
|
+
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ci},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
127
|
+
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
128
|
+
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
129
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ci},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ci},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ci},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ci},{atBreak:!0,character:"~"}],$b=document.createElement("i");function Ym(t){const e="&"+t+";";$b.innerHTML=e;const n=$b.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function QS(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const x7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZS(t){return t.replace(x7,S7)}function S7(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return QS(n.slice(s?2:1),s?16:10)}return Ym(n)||t}function w7(t){return t.label||!t.identifier?t.label||"":ZS(t.identifier)}function k7(t){if(!t._compiled){const e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function A7(t,e,n){const r=e.indexStack,i=t.children||[],s=[];let o=-1,a=n.before,l;r.push(-1);let u=e.createTracker(n);for(;++o<i.length;){const c=i[o];let f;if(r[r.length-1]=o,o+1<i.length){let p=e.handle.handlers[i[o+1].type];p&&p.peek&&(p=p.peek),f=p?p(i[o+1],t,e,{before:"",after:"",...u.current()}).charAt(0):""}else f=n.after;s.length>0&&(a==="\r"||a===`
|
|
130
|
+
`)&&c.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),a=" ",u=e.createTracker(n),u.move(s.join("")));let d=e.handle(c,t,e,{...u.current(),after:f,before:a});l&&l===d.slice(0,1)&&(d=di(l.charCodeAt(0))+d.slice(1));const h=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,h&&(s.length>0&&h.before&&a===s[s.length-1].slice(-1)&&(s[s.length-1]=s[s.length-1].slice(0,-1)+di(a.charCodeAt(0))),h.after&&(l=f)),u.move(d),s.push(d),a=d.slice(-1)}return r.pop(),s.join("")}function v7(t,e,n){const r=e.indexStack,i=t.children||[],s=e.createTracker(n),o=[];let a=-1;for(r.push(-1);++a<i.length;){const l=i[a];r[r.length-1]=a,o.push(s.move(e.handle(l,t,e,{before:`
|
|
131
|
+
`,after:`
|
|
132
|
+
`,...s.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&o.push(s.move(_7(l,i[a+1],t,e)))}return r.pop(),o.join("")}function _7(t,e,n,r){let i=r.join.length;for(;i--;){const s=r.join[i](t,e,n,r);if(s===!0||s===1)break;if(typeof s=="number")return`
|
|
133
|
+
`.repeat(1+s);if(s===!1)return`
|
|
134
|
+
|
|
135
|
+
<!---->
|
|
136
|
+
|
|
137
|
+
`}return`
|
|
138
|
+
|
|
139
|
+
`}const N7=/\r?\n|\r/g;function I7(t,e){const n=[];let r=0,i=0,s;for(;s=N7.exec(t);)o(t.slice(r,s.index)),n.push(s[0]),r=s.index+s[0].length,i++;return o(t.slice(r)),n.join("");function o(a){n.push(e(a,i,!a))}}function R7(t,e,n){const r=(n.before||"")+(e||"")+(n.after||""),i=[],s=[],o={};let a=-1;for(;++a<t.unsafe.length;){const c=t.unsafe[a];if(!HS(t.stack,c))continue;const f=t.compilePattern(c);let d;for(;d=f.exec(r);){const h="before"in c||!!c.atBreak,p="after"in c,g=d.index+(h?d[1].length:0);i.includes(g)?(o[g].before&&!h&&(o[g].before=!1),o[g].after&&!p&&(o[g].after=!1)):(i.push(g),o[g]={before:h,after:p})}}i.sort(M7);let l=n.before?n.before.length:0;const u=r.length-(n.after?n.after.length:0);for(a=-1;++a<i.length;){const c=i[a];c<l||c>=u||c+1<u&&i[a+1]===c+1&&o[c].after&&!o[c+1].before&&!o[c+1].after||i[a-1]===c-1&&o[c].before&&!o[c-1].before&&!o[c-1].after||(l!==c&&s.push(Vb(r.slice(l,c),"\\")),l=c,/[!-/:-@[-`{-~]/.test(r.charAt(c))&&(!n.encode||!n.encode.includes(r.charAt(c)))?s.push("\\"):(s.push(di(r.charCodeAt(c))),l++))}return s.push(Vb(r.slice(l,u),n.after)),s.join("")}function M7(t,e){return t-e}function Vb(t,e){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],s=t+e;let o=-1,a=0,l;for(;l=n.exec(s);)r.push(l.index);for(;++o<r.length;)a!==r[o]&&i.push(t.slice(a,r[o])),i.push("\\"),a=r[o];return i.push(t.slice(a)),i.join("")}function O7(t){const e=t||{},n=e.now||{};let r=e.lineShift||0,i=n.line||1,s=n.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:i,column:s},lineShift:r}}function a(u){r+=u}function l(u){const c=u||"",f=c.split(/\r?\n|\r/g),d=f[f.length-1];return i+=f.length-1,s=f.length===1?s+d.length:1+d.length+r,c}}function D7(t,e){const n=e||{},r={associationId:w7,containerPhrasing:F7,containerFlow:H7,createTracker:O7,compilePattern:k7,enter:s,handlers:{...qm},handle:void 0,indentLines:I7,indexStack:[],join:[...E7],options:{},safe:U7,stack:[],unsafe:[...C7]};FS(r,n),r.options.tightDefinitions&&r.join.push(B7),r.handle=BS("type",{invalid:L7,unknown:P7,handlers:r.handlers});let i=r.handle(t,void 0,r,{before:`
|
|
140
|
+
`,after:`
|
|
141
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
142
|
+
`),i;function s(o){return r.stack.push(o),a;function a(){r.stack.pop()}}}function L7(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function P7(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function B7(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function F7(t,e){return A7(t,this,e)}function H7(t,e){return v7(t,this,e)}function U7(t,e){return R7(this,t,e)}function $7(){return{enter:{table:V7,tableData:zb,tableHeader:zb,tableRow:j7},exit:{codeText:W7,table:z7,tableData:Td,tableHeader:Td,tableRow:Td}}}function V7(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function z7(t){this.exit(t),this.data.inTable=void 0}function j7(t){this.enter({type:"tableRow",children:[]},t)}function Td(t){this.exit(t)}function zb(t){this.enter({type:"tableCell",children:[]},t)}function W7(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,q7));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function q7(t,e){return e==="|"?e:t}function Y7(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
143
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:o,tableCell:l,tableRow:a}};function o(h,p,g,b){return u(c(h,g,b),h.align)}function a(h,p,g,b){const y=f(h,g,b),E=u([y]);return E.slice(0,E.indexOf(`
|
|
144
|
+
`))}function l(h,p,g,b){const y=g.enter("tableCell"),E=g.enter("phrasing"),T=g.containerPhrasing(h,{...b,before:s,after:s});return E(),y(),T}function u(h,p){return $9(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function c(h,p,g){const b=h.children;let y=-1;const E=[],T=p.enter("table");for(;++y<b.length;)E[y]=f(b[y],p,g);return T(),E}function f(h,p,g){const b=h.children;let y=-1;const E=[],T=p.enter("tableRow");for(;++y<b.length;)E[y]=l(b[y],h,p,g);return T(),E}function d(h,p,g){let b=qm.inlineCode(h,p,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function K7(){return{exit:{taskListCheckValueChecked:jb,taskListCheckValueUnchecked:jb,paragraph:X7}}}function G7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Q7}}}function jb(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function X7(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function Q7(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=qm.listItem(t,e,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+o}}function Z7(){return[c9(),R9(),L9(),$7(),K7()]}function J7(t){return{extensions:[f9(),M9(t),P9(),Y7(t),G7()]}}function bn(t,e,n,r){const i=t.length;let s=0,o;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function An(t,e){return t.length>0?(bn(t,t.length,0,e),t):e}const Wb={}.hasOwnProperty;function JS(t){const e={};let n=-1;for(;++n<t.length;)eB(e,t[n]);return e}function eB(t,e){let n;for(n in e){const i=(Wb.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let o;if(s)for(o in s){Wb.call(i,o)||(i[o]=[]);const a=s[o];tB(i[o],Array.isArray(a)?a:a?[a]:[])}}}function tB(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);bn(t,0,0,r)}const nB={tokenize:lB,partial:!0},ew={tokenize:uB,partial:!0},tw={tokenize:cB,partial:!0},nw={tokenize:fB,partial:!0},rB={tokenize:dB,partial:!0},rw={name:"wwwAutolink",tokenize:oB,previous:sw},iw={name:"protocolAutolink",tokenize:aB,previous:ow},Hr={name:"emailAutolink",tokenize:sB,previous:aw},gr={};function iB(){return{text:gr}}let xi=48;for(;xi<123;)gr[xi]=Hr,xi++,xi===58?xi=65:xi===91&&(xi=97);gr[43]=Hr;gr[45]=Hr;gr[46]=Hr;gr[95]=Hr;gr[72]=[Hr,iw];gr[104]=[Hr,iw];gr[87]=[Hr,rw];gr[119]=[Hr,rw];function sB(t,e,n){const r=this;let i,s;return o;function o(f){return!tp(f)||!aw.call(r,r.previous)||Km(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return tp(f)?(t.consume(f),a):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check(rB,c,u)(f):f===45||f===95||vt(f)?(s=!0,t.consume(f),l):c(f)}function u(f){return t.consume(f),i=!0,l}function c(f){return s&&i&&Ft(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function oB(t,e,n){const r=this;return i;function i(o){return o!==87&&o!==119||!sw.call(r,r.previous)||Km(r.events)?n(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(nB,t.attempt(ew,t.attempt(tw,s),n),n)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function aB(t,e,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&ow.call(r,r.previous)&&!Km(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):n(f)}function a(f){if(Ft(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||Qu(f)||Ue(f)||qi(f)||Xc(f)?n(f):t.attempt(ew,t.attempt(tw,c),n)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function lB(t,e,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,t.consume(o),i):o===46&&r===3?(t.consume(o),s):n(o)}function s(o){return o===null?n(o):e(o)}}function uB(t,e,n){let r,i,s;return o;function o(u){return u===46||u===95?t.check(nw,l,a)(u):u===null||Ue(u)||qi(u)||u!==45&&Xc(u)?l(u):(s=!0,t.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),t.consume(u),o}function l(u){return i||r||!s?n(u):e(u)}}function cB(t,e){let n=0,r=0;return i;function i(o){return o===40?(n++,t.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?t.check(nw,e,s)(o):o===null||Ue(o)||qi(o)?e(o):(t.consume(o),i)}function s(o){return o===41&&r++,t.consume(o),i}}function fB(t,e,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),r):a===38?(t.consume(a),s):a===93?(t.consume(a),i):a===60||a===null||Ue(a)||qi(a)?e(a):n(a)}function i(a){return a===null||a===40||a===91||Ue(a)||qi(a)?e(a):r(a)}function s(a){return Ft(a)?o(a):n(a)}function o(a){return a===59?(t.consume(a),r):Ft(a)?(t.consume(a),o):n(a)}}function dB(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return vt(s)?n(s):e(s)}}function sw(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ue(t)}function ow(t){return!Ft(t)}function aw(t){return!(t===47||tp(t))}function tp(t){return t===43||t===45||t===46||t===95||vt(t)}function Km(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Eo(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let o="";if(s===37&&vt(t.charCodeAt(n+1))&&vt(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Qc(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const np={name:"attention",resolveAll:hB,tokenize:pB};function hB(t,e){let n=-1,r,i,s,o,a,l,u,c;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},d={...t[n][1].start};qb(f,-l),qb(d,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:d},s={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[r][1].end={...o.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=An(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=An(u,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),u=An(u,Qc(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=An(u,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=An(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,bn(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function pB(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=to(r);let s;return o;function o(l){return s=l,t.enter("attentionSequence"),a(l)}function a(l){if(l===s)return t.consume(l),a;const u=t.exit("attentionSequence"),c=to(l),f=!c||c===2&&i||n.includes(l),d=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?f:f&&(i||!d)),u._close=!!(s===42?d:d&&(c||!f)),e(l)}}function qb(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const mB={name:"autolink",tokenize:gB};function gB(t,e,n){let r=0;return i;function i(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(h){return Ft(h)?(t.consume(h),o):h===64?n(h):u(h)}function o(h){return h===43||h===45||h===46||vt(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||vt(h))&&r++<32?(t.consume(h),a):(r=0,u(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Qu(h)?n(h):(t.consume(h),l)}function u(h){return h===64?(t.consume(h),c):n9(h)?(t.consume(h),u):n(h)}function c(h){return vt(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,c):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):d(h)}function d(h){if((h===45||vt(h))&&r++<63){const p=h===45?d:f;return t.consume(h),p}return n(h)}}function Re(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Ae(l)?(t.enter(n),a(l)):e(l)}function a(l){return Ae(l)&&s++<i?(t.consume(l),a):(t.exit(n),e(l))}}const ol={partial:!0,tokenize:bB};function bB(t,e,n){return r;function r(s){return Ae(s)?Re(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||ce(s)?e(s):n(s)}}const lw={continuation:{tokenize:EB},exit:TB,name:"blockQuote",tokenize:yB};function yB(t,e,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Ae(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function EB(t,e,n){const r=this;return i;function i(o){return Ae(o)?Re(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(lw,e,n)(o)}}function TB(t){t.exit("blockQuote")}const uw={name:"characterEscape",tokenize:CB};function CB(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return i9(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const cw={name:"characterReference",tokenize:xB};function xB(t,e,n){const r=this;let i=0,s,o;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),s=31,o=vt,c(f))}function u(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=r9,c):(t.enter("characterReferenceValue"),s=7,o=Jh,c(f))}function c(f){if(f===59&&i){const d=t.exit("characterReferenceValue");return o===vt&&!Ym(r.sliceSerialize(d))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(f)&&i++<s?(t.consume(f),c):n(f)}}const Yb={partial:!0,tokenize:wB},Kb={concrete:!0,name:"codeFenced",tokenize:SB};function SB(t,e,n){const r=this,i={partial:!0,tokenize:_};let s=0,o=0,a;return l;function l(k){return u(k)}function u(k){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===a?(o++,t.consume(k),c):o<3?n(k):(t.exit("codeFencedFenceSequence"),Ae(k)?Re(t,f,"whitespace")(k):f(k))}function f(k){return k===null||ce(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(Yb,g,v)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||ce(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(k)):Ae(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Re(t,h,"whitespace")(k)):k===96&&k===a?n(k):(t.consume(k),d)}function h(k){return k===null||ce(k)?f(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||ce(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(t.consume(k),p)}function g(k){return t.attempt(i,v,b)(k)}function b(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),y}function y(k){return s>0&&Ae(k)?Re(t,E,"linePrefix",s+1)(k):E(k)}function E(k){return k===null||ce(k)?t.check(Yb,g,v)(k):(t.enter("codeFlowValue"),T(k))}function T(k){return k===null||ce(k)?(t.exit("codeFlowValue"),E(k)):(t.consume(k),T)}function v(k){return t.exit("codeFenced"),e(k)}function _(k,M,P){let F=0;return N;function N(L){return k.enter("lineEnding"),k.consume(L),k.exit("lineEnding"),U}function U(L){return k.enter("codeFencedFence"),Ae(L)?Re(k,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):j(L)}function j(L){return L===a?(k.enter("codeFencedFenceSequence"),V(L)):P(L)}function V(L){return L===a?(F++,k.consume(L),V):F>=o?(k.exit("codeFencedFenceSequence"),Ae(L)?Re(k,I,"whitespace")(L):I(L)):P(L)}function I(L){return L===null||ce(L)?(k.exit("codeFencedFence"),M(L)):P(L)}}}function wB(t,e,n){const r=this;return i;function i(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const Cd={name:"codeIndented",tokenize:AB},kB={partial:!0,tokenize:vB};function AB(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Re(t,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):ce(u)?t.attempt(kB,o,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function vB(t,e,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ce(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):Re(t,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):ce(o)?i(o):n(o)}}const _B={name:"codeText",previous:IB,resolve:NB,tokenize:RB};function NB(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function IB(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function RB(t,e,n){let r=0,i,s;return o;function o(f){return t.enter("codeText"),t.enter("codeTextSequence"),a(f)}function a(f){return f===96?(t.consume(f),r++,a):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(s=t.enter("codeTextSequence"),i=0,c(f)):ce(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ce(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),u)}function c(f){return f===96?(t.consume(f),i++,c):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(s.type="codeTextData",u(f))}}class MB{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ho(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ho(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ho(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Ho(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ho(this.left,n.reverse())}}}function Ho(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function fw(t){const e={};let n=-1,r,i,s,o,a,l,u;const c=new MB(t);for(;++n<c.length;){for(;n in e;)n=e[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,OB(c,n)),n=e[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return bn(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function OB(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,f,d=-1,h=n,p=0,g=0;const b=[g];for(;h;){for(;t.get(++i)[1]!==h;);s.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(g=d+1,b.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),d=b.length;d--;){const y=a.slice(b[d],b[d+1]),E=s.pop();l.push([E,E+y.length-1]),t.splice(E,2,y)}for(l.reverse(),d=-1;++d<l.length;)u[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return u}const DB={resolve:PB,tokenize:BB},LB={partial:!0,tokenize:FB};function PB(t){return fw(t),t}function BB(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):ce(a)?t.check(LB,o,s)(a):(t.consume(a),i)}function s(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function o(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function FB(t,e,n){const r=this;return i;function i(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Re(t,s,"linePrefix")}function s(o){if(o===null||ce(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):t.interrupt(r.parser.constructs.flow,n,e)(o)}}function dw(t,e,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(y){return y===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(y),t.exit(s),d):y===null||y===32||y===41||Qu(y)?n(y):(t.enter(r),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(y))}function d(y){return y===62?(t.enter(s),t.consume(y),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(t.exit("chunkString"),t.exit(a),d(y)):y===null||y===60||ce(y)?n(y):(t.consume(y),y===92?p:h)}function p(y){return y===60||y===62||y===92?(t.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||Ue(y))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(r),e(y)):c<u&&y===40?(t.consume(y),c++,g):y===41?(t.consume(y),c--,g):y===null||y===32||y===40||Qu(y)?n(y):(t.consume(y),y===92?b:g)}function b(y){return y===40||y===41||y===92?(t.consume(y),g):g(y)}}function hw(t,e,n,r,i,s){const o=this;let a=0,l;return u;function u(h){return t.enter(r),t.enter(i),t.consume(h),t.exit(i),t.enter(s),c}function c(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(t.exit(s),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):ce(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ce(h)||a++>999?(t.exit("chunkString"),c(h)):(t.consume(h),l||(l=!Ae(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function pw(t,e,n,r,i,s){let o;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),o=d===40?41:d,l):n(d)}function l(d){return d===o?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(s),u(d))}function u(d){return d===o?(t.exit(s),l(o)):d===null?n(d):ce(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Re(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||ce(d)?(t.exit("chunkString"),u(d)):(t.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(t.consume(d),c):c(d)}}function ca(t,e){let n;return r;function r(i){return ce(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ae(i)?Re(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const HB={name:"definition",tokenize:$B},UB={partial:!0,tokenize:VB};function $B(t,e,n){const r=this;let i;return s;function s(h){return t.enter("definition"),o(h)}function o(h){return hw.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=$n(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return Ue(h)?ca(t,u)(h):u(h)}function u(h){return dw(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return t.attempt(UB,f,f)(h)}function f(h){return Ae(h)?Re(t,d,"whitespace")(h):d(h)}function d(h){return h===null||ce(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function VB(t,e,n){return r;function r(a){return Ue(a)?ca(t,i)(a):n(a)}function i(a){return pw(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ae(a)?Re(t,o,"whitespace")(a):o(a)}function o(a){return a===null||ce(a)?e(a):n(a)}}const zB={name:"hardBreakEscape",tokenize:jB};function jB(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return ce(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const WB={name:"headingAtx",resolve:qB,tokenize:YB};function qB(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},bn(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function YB(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),s(c)}function s(c){return t.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(t.consume(c),o):c===null||Ue(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||ce(c)?(t.exit("atxHeading"),e(c)):Ae(c)?Re(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ue(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const KB=["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"],Gb=["pre","script","style","textarea"],GB={concrete:!0,name:"htmlFlow",resolveTo:ZB,tokenize:JB},XB={partial:!0,tokenize:tF},QB={partial:!0,tokenize:eF};function ZB(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function JB(t,e,n){const r=this;let i,s,o,a,l;return u;function u(w){return c(w)}function c(w){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(w),f}function f(w){return w===33?(t.consume(w),d):w===47?(t.consume(w),s=!0,g):w===63?(t.consume(w),i=3,r.interrupt?e:x):Ft(w)?(t.consume(w),o=String.fromCharCode(w),b):n(w)}function d(w){return w===45?(t.consume(w),i=2,h):w===91?(t.consume(w),i=5,a=0,p):Ft(w)?(t.consume(w),i=4,r.interrupt?e:x):n(w)}function h(w){return w===45?(t.consume(w),r.interrupt?e:x):n(w)}function p(w){const me="CDATA[";return w===me.charCodeAt(a++)?(t.consume(w),a===me.length?r.interrupt?e:j:p):n(w)}function g(w){return Ft(w)?(t.consume(w),o=String.fromCharCode(w),b):n(w)}function b(w){if(w===null||w===47||w===62||Ue(w)){const me=w===47,te=o.toLowerCase();return!me&&!s&&Gb.includes(te)?(i=1,r.interrupt?e(w):j(w)):KB.includes(o.toLowerCase())?(i=6,me?(t.consume(w),y):r.interrupt?e(w):j(w)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(w):s?E(w):T(w))}return w===45||vt(w)?(t.consume(w),o+=String.fromCharCode(w),b):n(w)}function y(w){return w===62?(t.consume(w),r.interrupt?e:j):n(w)}function E(w){return Ae(w)?(t.consume(w),E):N(w)}function T(w){return w===47?(t.consume(w),N):w===58||w===95||Ft(w)?(t.consume(w),v):Ae(w)?(t.consume(w),T):N(w)}function v(w){return w===45||w===46||w===58||w===95||vt(w)?(t.consume(w),v):_(w)}function _(w){return w===61?(t.consume(w),k):Ae(w)?(t.consume(w),_):T(w)}function k(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(t.consume(w),l=w,M):Ae(w)?(t.consume(w),k):P(w)}function M(w){return w===l?(t.consume(w),l=null,F):w===null||ce(w)?n(w):(t.consume(w),M)}function P(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Ue(w)?_(w):(t.consume(w),P)}function F(w){return w===47||w===62||Ae(w)?T(w):n(w)}function N(w){return w===62?(t.consume(w),U):n(w)}function U(w){return w===null||ce(w)?j(w):Ae(w)?(t.consume(w),U):n(w)}function j(w){return w===45&&i===2?(t.consume(w),Z):w===60&&i===1?(t.consume(w),H):w===62&&i===4?(t.consume(w),ne):w===63&&i===3?(t.consume(w),x):w===93&&i===5?(t.consume(w),z):ce(w)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(XB,G,V)(w)):w===null||ce(w)?(t.exit("htmlFlowData"),V(w)):(t.consume(w),j)}function V(w){return t.check(QB,I,G)(w)}function I(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),L}function L(w){return w===null||ce(w)?V(w):(t.enter("htmlFlowData"),j(w))}function Z(w){return w===45?(t.consume(w),x):j(w)}function H(w){return w===47?(t.consume(w),o="",D):j(w)}function D(w){if(w===62){const me=o.toLowerCase();return Gb.includes(me)?(t.consume(w),ne):j(w)}return Ft(w)&&o.length<8?(t.consume(w),o+=String.fromCharCode(w),D):j(w)}function z(w){return w===93?(t.consume(w),x):j(w)}function x(w){return w===62?(t.consume(w),ne):w===45&&i===2?(t.consume(w),x):j(w)}function ne(w){return w===null||ce(w)?(t.exit("htmlFlowData"),G(w)):(t.consume(w),ne)}function G(w){return t.exit("htmlFlow"),e(w)}}function eF(t,e,n){const r=this;return i;function i(o){return ce(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function tF(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(ol,e,n)}}const nF={name:"htmlText",tokenize:rF};function rF(t,e,n){const r=this;let i,s,o;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),l}function l(x){return x===33?(t.consume(x),u):x===47?(t.consume(x),_):x===63?(t.consume(x),T):Ft(x)?(t.consume(x),P):n(x)}function u(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),s=0,p):Ft(x)?(t.consume(x),E):n(x)}function c(x){return x===45?(t.consume(x),h):n(x)}function f(x){return x===null?n(x):x===45?(t.consume(x),d):ce(x)?(o=f,H(x)):(t.consume(x),f)}function d(x){return x===45?(t.consume(x),h):f(x)}function h(x){return x===62?Z(x):x===45?d(x):f(x)}function p(x){const ne="CDATA[";return x===ne.charCodeAt(s++)?(t.consume(x),s===ne.length?g:p):n(x)}function g(x){return x===null?n(x):x===93?(t.consume(x),b):ce(x)?(o=g,H(x)):(t.consume(x),g)}function b(x){return x===93?(t.consume(x),y):g(x)}function y(x){return x===62?Z(x):x===93?(t.consume(x),y):g(x)}function E(x){return x===null||x===62?Z(x):ce(x)?(o=E,H(x)):(t.consume(x),E)}function T(x){return x===null?n(x):x===63?(t.consume(x),v):ce(x)?(o=T,H(x)):(t.consume(x),T)}function v(x){return x===62?Z(x):T(x)}function _(x){return Ft(x)?(t.consume(x),k):n(x)}function k(x){return x===45||vt(x)?(t.consume(x),k):M(x)}function M(x){return ce(x)?(o=M,H(x)):Ae(x)?(t.consume(x),M):Z(x)}function P(x){return x===45||vt(x)?(t.consume(x),P):x===47||x===62||Ue(x)?F(x):n(x)}function F(x){return x===47?(t.consume(x),Z):x===58||x===95||Ft(x)?(t.consume(x),N):ce(x)?(o=F,H(x)):Ae(x)?(t.consume(x),F):Z(x)}function N(x){return x===45||x===46||x===58||x===95||vt(x)?(t.consume(x),N):U(x)}function U(x){return x===61?(t.consume(x),j):ce(x)?(o=U,H(x)):Ae(x)?(t.consume(x),U):F(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(t.consume(x),i=x,V):ce(x)?(o=j,H(x)):Ae(x)?(t.consume(x),j):(t.consume(x),I)}function V(x){return x===i?(t.consume(x),i=void 0,L):x===null?n(x):ce(x)?(o=V,H(x)):(t.consume(x),V)}function I(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||Ue(x)?F(x):(t.consume(x),I)}function L(x){return x===47||x===62||Ue(x)?F(x):n(x)}function Z(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):n(x)}function H(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),D}function D(x){return Ae(x)?Re(t,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):z(x)}function z(x){return t.enter("htmlTextData"),o(x)}}const Gm={name:"labelEnd",resolveAll:aF,resolveTo:lF,tokenize:uF},iF={tokenize:cF},sF={tokenize:fF},oF={tokenize:dF};function aF(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&bn(t,0,t.length,n),t}function lF(t,e){let n=t.length,r=0,i,s,o,a;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},c={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[o-2][1].start}};return a=[["enter",l,e],["enter",u,e]],a=An(a,t.slice(s+1,s+r+3)),a=An(a,[["enter",c,e]]),a=An(a,Qc(e.parser.constructs.insideSpan.null,t.slice(s+r+4,o-3),e)),a=An(a,[["exit",c,e],t[o-2],t[o-1],["exit",u,e]]),a=An(a,t.slice(o+1)),a=An(a,[["exit",l,e]]),bn(t,s,t.length,a),t}function uF(t,e,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(d){return s?s._inactive?f(d):(o=r.parser.defined.includes($n(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):n(d)}function l(d){return d===40?t.attempt(iF,c,o?c:f)(d):d===91?t.attempt(sF,c,o?u:f)(d):o?c(d):f(d)}function u(d){return t.attempt(oF,c,f)(d)}function c(d){return e(d)}function f(d){return s._balanced=!0,n(d)}}function cF(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return Ue(f)?ca(t,s)(f):s(f)}function s(f){return f===41?c(f):dw(t,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Ue(f)?ca(t,l)(f):c(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?pw(t,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return Ue(f)?ca(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function fF(t,e,n){const r=this;return i;function i(a){return hw.call(r,t,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes($n(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function o(a){return n(a)}}function dF(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const hF={name:"labelStartImage",resolveAll:Gm.resolveAll,tokenize:pF};function pF(t,e,n){const r=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),s}function s(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const mF={name:"labelStartLink",resolveAll:Gm.resolveAll,tokenize:gF};function gF(t,e,n){const r=this;return i;function i(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const xd={name:"lineEnding",tokenize:bF};function bF(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Re(t,e,"linePrefix")}}const fu={name:"thematicBreak",tokenize:yF};function yF(t,e,n){let r=0,i;return s;function s(u){return t.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(t.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ae(u)?Re(t,a,"whitespace")(u):a(u))}}const Yt={continuation:{tokenize:xF},exit:wF,name:"list",tokenize:CF},EF={partial:!0,tokenize:kF},TF={partial:!0,tokenize:SF};function CF(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Jh(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(fu,n,u)(h):u(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return Jh(h)&&++o<10?(t.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),u(h)):n(h)}function u(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(ol,r.interrupt?n:c,t.attempt(EF,d,f))}function c(h){return r.containerState.initialBlankLine=!0,s++,d(h)}function f(h){return Ae(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function xF(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(ol,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Re(t,e,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(TF,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Re(t,t.attempt(Yt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function SF(t,e,n){const r=this;return Re(t,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(s):n(s)}}function wF(t){t.exit(this.containerState.type)}function kF(t,e,n){const r=this;return Re(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Ae(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const Xb={name:"setextUnderline",resolveTo:AF,tokenize:vF};function AF(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=o,t.push(["exit",o,e]),t}function vF(t,e,n){const r=this;let i;return s;function s(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),Ae(u)?Re(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const _F={tokenize:PF,partial:!0};function NF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OF,continuation:{tokenize:DF},exit:LF}},text:{91:{name:"gfmFootnoteCall",tokenize:MF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IF,resolveTo:RF}}}}function IF(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=$n(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function RF(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function MF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||Ue(f))return n(f);if(f===93){t.exit("chunkString");const d=t.exit("gfmFootnoteCallString");return i.includes($n(r.sliceSerialize(d)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Ue(f)||(o=!0),s++,t.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(t.consume(f),s++,u):u(f)}}function OF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):n(p)}function c(p){if(o>999||p===93&&!a||p===null||p===91||Ue(p))return n(p);if(p===93){t.exit("chunkString");const g=t.exit("gfmFootnoteDefinitionLabelString");return s=$n(r.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),d}return Ue(p)||(a=!0),o++,t.consume(p),p===92?f:c}function f(p){return p===91||p===92||p===93?(t.consume(p),o++,c):c(p)}function d(p){return p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),i.includes(s)||i.push(s),Re(t,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return e(p)}}function DF(t,e,n){return t.check(ol,e,t.attempt(_F,e,n))}function LF(t){t.exit("gfmFootnoteDefinition")}function PF(t,e,n){const r=this;return Re(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):n(s)}}function BF(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},d=[["enter",c,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",f,a]],h=a.parser.constructs.insideSpan.null;h&&bn(d,d.length,0,Qc(h,o.slice(u+1,l),a)),bn(d,d.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",c,a]]),bn(o,u-1,l-u+3,d),l=u+d.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,c=this.events;let f=0;return d;function d(p){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),h(p))}function h(p){const g=to(u);if(p===126)return f>1?l(p):(o.consume(p),f++,h);if(f<2&&!n)return l(p);const b=o.exit("strikethroughSequenceTemporary"),y=to(p);return b._open=!y||y===2&&!!g,b._close=!g||g===2&&!!y,a(p)}}}class FF{constructor(){this.map=[]}add(e,n,r){HF(this,e,n,r)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function HF(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function UF(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function $F(){return{flow:{null:{name:"table",tokenize:VF,resolveAll:zF}}}}function VF(t,e,n){const r=this;let i=0,s=0,o;return a;function a(N){let U=r.events.length-1;for(;U>-1;){const I=r.events[U][1].type;if(I==="lineEnding"||I==="linePrefix")U--;else break}const j=U>-1?r.events[U][1].type:null,V=j==="tableHead"||j==="tableRow"?k:l;return V===k&&r.parser.lazy[r.now().line]?n(N):V(N)}function l(N){return t.enter("tableHead"),t.enter("tableRow"),u(N)}function u(N){return N===124||(o=!0,s+=1),c(N)}function c(N){return N===null?n(N):ce(N)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):Ae(N)?Re(t,c,"whitespace")(N):(s+=1,o&&(o=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),o=!0,c):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||Ue(N)?(t.exit("data"),c(N)):(t.consume(N),N===92?d:f)}function d(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),o=!1,Ae(N)?Re(t,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):p(N))}function p(N){return N===45||N===58?b(N):N===124?(o=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),g):_(N)}function g(N){return Ae(N)?Re(t,b,"whitespace")(N):b(N)}function b(N){return N===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),y):N===45?(s+=1,y(N)):N===null||ce(N)?v(N):_(N)}function y(N){return N===45?(t.enter("tableDelimiterFiller"),E(N)):_(N)}function E(N){return N===45?(t.consume(N),E):N===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(N))}function T(N){return Ae(N)?Re(t,v,"whitespace")(N):v(N)}function v(N){return N===124?p(N):N===null||ce(N)?!o||i!==s?_(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):_(N)}function _(N){return n(N)}function k(N){return t.enter("tableRow"),M(N)}function M(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),M):N===null||ce(N)?(t.exit("tableRow"),e(N)):Ae(N)?Re(t,M,"whitespace")(N):(t.enter("data"),P(N))}function P(N){return N===null||N===124||Ue(N)?(t.exit("data"),M(N)):(t.consume(N),N===92?F:P)}function F(N){return N===92||N===124?(t.consume(N),P):P(N)}}function zF(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,c,f;const d=new FF;for(;++n<t.length;){const h=t[n],p=h[1];h[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(Qb(d,e,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",u,e]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",c,e]])),i=p.type==="tableDelimiterRow"?2:c?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Ll(d,e,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Ll(d,e,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Ll(d,e,s,i,n,f)):o[1]!==0&&(f=Ll(d,e,o,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Qb(d,e,l,u,c),d.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=UF(e.events,n))}return t}function Ll(t,e,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},gs(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const l=gs(e.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const u=gs(e.events,n[2]),c=gs(e.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},c)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const d=e.events[n[2]],h=e.events[n[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;t.add(p,g,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(s.end=Object.assign({},gs(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Qb(t,e,n,r,i){const s=[],o=gs(e.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,e])),r.end=Object.assign({},o),s.push(["exit",r,e]),t.add(n+1,0,s)}function gs(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const jF={name:"tasklistCheck",tokenize:qF};function WF(){return{text:{91:jF}}}function qF(t,e,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),s)}function s(l){return Ue(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?e(l):Ae(l)?t.check({tokenize:YF},e,n)(l):n(l)}}function YF(t,e,n){return Re(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function KF(t){return JS([iB(),NF(),BF(t),$F(),WF()])}const GF={};function nG(t){const e=this,n=t||GF,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(KF(n)),s.push(Z7()),o.push(J7(n))}function rG(t){const e=this;e.compiler=n;function n(r){return D7(r,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function Zb(t){if(t)throw t}var Sd,Jb;function XF(){if(Jb)return Sd;Jb=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var d;for(d in u);return typeof d>"u"||t.call(u,d)},o=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Sd=function l(){var u,c,f,d,h,p,g=arguments[0],b=1,y=arguments.length,E=!1;for(typeof g=="boolean"&&(E=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<y;++b)if(u=arguments[b],u!=null)for(c in u)f=a(g,c),d=a(u,c),g!==d&&(E&&d&&(s(d)||(h=i(d)))?(h?(h=!1,p=f&&i(f)?f:[]):p=f&&s(f)?f:{},o(g,{name:c,newValue:l(E,p,d)})):typeof d<"u"&&o(g,{name:c,newValue:d}));return g},Sd}var QF=XF();const wd=yp(QF);function rp(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function ZF(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const c=t[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?JF(c,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function JF(t,e){let n;return r;function r(...o){const a=t.length>o.length;let l;a&&o.push(i);try{l=t.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,e(o,...a))}function s(o){i(null,o)}}const eH=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),tH={}.hasOwnProperty;class Xm extends eH{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZF()}copy(){const e=new Xm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(wd(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(vd("data",this.frozen),this.namespace[e]=n,this):tH.call(this.namespace,e)&&this.namespace[e]||void 0:e?(vd("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Pl(e),r=this.parser||this.Parser;return kd("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),kd("process",this.parser||this.Parser),Ad("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Pl(e),l=r.parse(a);r.run(l,a,function(c,f,d){if(c||!f||!d)return u(c);const h=f,p=r.stringify(h,d);rH(p)?d.value=p:d.result=p,u(c,d)});function u(c,f){c||!f?o(c):s?s(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),kd("processSync",this.parser||this.Parser),Ad("processSync",this.compiler||this.Compiler),this.process(e,i),ty("processSync","process",n),r;function i(s,o){n=!0,Zb(s),r=o}}run(e,n,r){ey(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Pl(n);i.run(e,l,u);function u(c,f,d){const h=f||e;c?a(c):o?o(h):r(void 0,h,d)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),ty("runSync","run",r),i;function s(o,a){Zb(o),i=a,r=!0}}stringify(e,n){this.freeze();const r=Pl(n),i=this.compiler||this.Compiler;return Ad("stringify",i),ey(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(vd("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=wd(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===u){d=f;break}if(d===-1)r.push([u,...c]);else if(c.length>0){let[h,...p]=c;const g=r[d][1];rp(g)&&rp(h)&&(h=wd(!0,g,h)),r[d]=[u,h,...p]}}}}const iG=new Xm().freeze();function kd(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ad(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function vd(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ey(t){if(!rp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function ty(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Pl(t){return nH(t)?t:new Qh(t)}function nH(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function rH(t){return typeof t=="string"||iH(t)}function iH(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function sG(t,e){return mw(t,{})||{type:"root",children:[]}}function mw(t,e){const n=sH(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function sH(t,e){switch(t.nodeType){case 1:return uH(t,e);case 3:return aH(t);case 8:return lH(t);case 9:return ny(t,e);case 10:return oH();case 11:return ny(t,e);default:return}}function ny(t,e){return{type:"root",children:gw(t,e)}}function oH(){return{type:"doctype"}}function aH(t){return{type:"text",value:t.nodeValue||""}}function lH(t){return{type:"comment",value:t.nodeValue||""}}function uH(t,e){const n=t.namespaceURI,r=n===lu.svg?Ax:kx,i=n===lu.html?t.tagName.toLowerCase():t.tagName,s=n===lu.html&&i==="template"?t.content:t,o=t.getAttributeNames(),a={};let l=-1;for(;++l<o.length;)a[o[l]]=t.getAttribute(o[l])||"";return r(i,a,gw(s,e))}function gw(t,e){const n=t.childNodes,r=[];let i=-1;for(;++i<n.length;){const s=mw(n[i],e);s!==void 0&&r.push(s)}return r}const cH={tokenize:fH};function fH(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Re(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),s(a)}function s(a){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return ce(a)?(t.consume(a),t.exit("chunkText"),s):(t.consume(a),o)}}const dH={tokenize:hH},ry={tokenize:pH};function hH(t){const e=this,n=[];let r=0,i,s,o;return a;function a(T){if(r<n.length){const v=n[r];return e.containerState=v[1],t.attempt(v[0].continuation,l,u)(T)}return u(T)}function l(T){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&E();const v=e.events.length;let _=v,k;for(;_--;)if(e.events[_][0]==="exit"&&e.events[_][1].type==="chunkFlow"){k=e.events[_][1].end;break}y(r);let M=v;for(;M<e.events.length;)e.events[M][1].end={...k},M++;return bn(e.events,_+1,0,e.events.slice(v)),e.events.length=M,u(T)}return a(T)}function u(T){if(r===n.length){if(!i)return d(T);if(i.currentConstruct&&i.currentConstruct.concrete)return p(T);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(ry,c,f)(T)}function c(T){return i&&E(),y(r),d(T)}function f(T){return e.parser.lazy[e.now().line]=r!==n.length,o=e.now().offset,p(T)}function d(T){return e.containerState={},t.attempt(ry,h,p)(T)}function h(T){return r++,n.push([e.currentConstruct,e.containerState]),d(T)}function p(T){if(T===null){i&&E(),y(0),t.consume(T);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(T)}function g(T){if(T===null){b(t.exit("chunkFlow"),!0),y(0),t.consume(T);return}return ce(T)?(t.consume(T),b(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(T),g)}function b(T,v){const _=e.sliceStream(T);if(v&&_.push(null),T.previous=s,s&&(s.next=T),s=T,i.defineSkip(T.start),i.write(_),e.parser.lazy[T.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const M=e.events.length;let P=M,F,N;for(;P--;)if(e.events[P][0]==="exit"&&e.events[P][1].type==="chunkFlow"){if(F){N=e.events[P][1].end;break}F=!0}for(y(r),k=M;k<e.events.length;)e.events[k][1].end={...N},k++;bn(e.events,P+1,0,e.events.slice(M)),e.events.length=k}}function y(T){let v=n.length;for(;v-- >T;){const _=n[v];e.containerState=_[1],_[0].exit.call(e,t)}n.length=T}function E(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function pH(t,e,n){return Re(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const mH={tokenize:gH};function gH(t){const e=this,n=t.attempt(ol,r,t.attempt(this.parser.constructs.flowInitial,i,Re(t,t.attempt(this.parser.constructs.flow,i,t.attempt(DB,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const bH={resolveAll:yw()},yH=bw("string"),EH=bw("text");function bw(t){return{resolveAll:yw(t==="text"?TH:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,o,a);return o;function o(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d<f.length;){const h=f[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function yw(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function TH(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){const u={type:n===t.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(t.splice(n,0,["enter",u,e],["exit",u,e]),n+=2)}n++}return t}const CH={42:Yt,43:Yt,45:Yt,48:Yt,49:Yt,50:Yt,51:Yt,52:Yt,53:Yt,54:Yt,55:Yt,56:Yt,57:Yt,62:lw},xH={91:HB},SH={[-2]:Cd,[-1]:Cd,32:Cd},wH={35:WB,42:fu,45:[Xb,fu],60:GB,61:Xb,95:fu,96:Kb,126:Kb},kH={38:cw,92:uw},AH={[-5]:xd,[-4]:xd,[-3]:xd,33:hF,38:cw,42:np,60:[mB,nF],91:mF,92:[zB,uw],93:Gm,95:np,96:_B},vH={null:[np,bH]},_H={null:[42,95]},NH={null:[]},IH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_H,contentInitial:xH,disable:NH,document:CH,flow:wH,flowInitial:SH,insideSpan:vH,string:kH,text:AH},Symbol.toStringTag,{value:"Module"}));function RH(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:M(_),check:M(k),consume:E,enter:T,exit:v,interrupt:M(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:t,previous:null,sliceSerialize:d,sliceStream:h,write:f};let c=e.tokenize.call(u,l);return e.resolveAll&&s.push(e),u;function f(U){return o=An(o,U),b(),o[o.length-1]!==null?[]:(P(e,0),u.events=Qc(s,u.events,u),u.events)}function d(U,j){return OH(h(U),j)}function h(U){return MH(o,U)}function p(){const{_bufferIndex:U,_index:j,line:V,column:I,offset:L}=r;return{_bufferIndex:U,_index:j,line:V,column:I,offset:L}}function g(U){i[U.line]=U.column,N()}function b(){let U;for(;r._index<o.length;){const j=o[r._index];if(typeof j=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<j.length;)y(j.charCodeAt(r._bufferIndex));else y(j)}}function y(U){c=c(U)}function E(U){ce(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=U}function T(U,j){const V=j||{};return V.type=U,V.start=p(),u.events.push(["enter",V,u]),a.push(V),V}function v(U){const j=a.pop();return j.end=p(),u.events.push(["exit",j,u]),j}function _(U,j){P(U,j.from)}function k(U,j){j.restore()}function M(U,j){return V;function V(I,L,Z){let H,D,z,x;return Array.isArray(I)?G(I):"tokenize"in I?G([I]):ne(I);function ne(le){return _e;function _e(ye){const ge=ye!==null&&le[ye],De=ye!==null&&le.null,We=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(De)?De:De?[De]:[]];return G(We)(ye)}}function G(le){return H=le,D=0,le.length===0?Z:w(le[D])}function w(le){return _e;function _e(ye){return x=F(),z=le,le.partial||(u.currentConstruct=le),le.name&&u.parser.constructs.disable.null.includes(le.name)?te():le.tokenize.call(j?Object.assign(Object.create(u),j):u,l,me,te)(ye)}}function me(le){return U(z,x),L}function te(le){return x.restore(),++D<H.length?w(H[D]):Z}}}function P(U,j){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&bn(u.events,j,u.events.length-j,U.resolve(u.events.slice(j),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function F(){const U=p(),j=u.previous,V=u.currentConstruct,I=u.events.length,L=Array.from(a);return{from:I,restore:Z};function Z(){r=U,u.previous=j,u.currentConstruct=V,u.events.length=I,a=L,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function MH(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let o;if(n===i)o=[t[n].slice(r,s)];else{if(o=t.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function OH(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
145
|
+
`;break}case-3:{o=`\r
|
|
146
|
+
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function DH(t){const r={constructs:JS([IH,...(t||{}).extensions||[]]),content:i(cH),defined:[],document:i(dH),flow:i(mH),lazy:{},string:i(yH),text:i(EH)};return r;function i(s){return o;function o(a){return RH(r,s,a)}}}function LH(t){for(;!fw(t););return t}const iy=/[\0\t\n\r]/g;function PH(){let t=1,e="",n=!0,r;return i;function i(s,o,a){const l=[];let u,c,f,d,h;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,e="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(iy.lastIndex=f,u=iy.exec(s),d=u&&u.index!==void 0?u.index:s.length,h=s.charCodeAt(d),!u){e=s.slice(f);break}if(h===10&&f===d&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<d&&(l.push(s.slice(f,d)),t+=d-f),h){case 0:{l.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,l.push(-2);t++<c;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=d+1}return a&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Ew={}.hasOwnProperty;function BH(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),FH(n)(LH(DH(n).document().write(PH()(t,e,!0))))}function FH(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Pe),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Me),blockQuote:s(De),characterEscape:F,characterReference:F,codeFenced:s(We),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(We,o),codeText:s(se,o),codeTextData:F,data:F,codeFlowValue:F,definition:s(ie),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(de),hardBreakEscape:s(Be),hardBreakTrailing:s(Be),htmlFlow:s(Ce,o),htmlFlowData:F,htmlText:s(Ce,o),htmlTextData:F,image:s(lt),label:o,link:s(Pe),listItem:s(Tn),listItemValue:d,listOrdered:s(Qe,f),listUnordered:s(Qe),paragraph:s(Cn),reference:w,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Me),strong:s(an),thematicBreak:s(ts)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:ge,autolinkProtocol:ye,blockQuote:l(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:le,characterReference:_e,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:N,codeIndented:l(y),codeText:l(L),codeTextData:N,data:N,definition:l(),definitionDestinationString:v,definitionLabelString:E,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(V),htmlFlowData:N,htmlText:l(I),htmlTextData:N,image:l(H),label:z,labelText:D,lineEnding:U,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:me,resourceDestinationString:x,resourceTitleString:ne,resource:G,setextHeading:l(P),setextHeadingLineSequence:M,setextHeadingText:k,strong:l(),thematicBreak:l()}};Tw(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(W){let X={type:"root",children:[]};const be={stack:[X],tokenStack:[],config:e,enter:a,exit:u,buffer:o,resume:c,data:n},ke=[];let Le=-1;for(;++Le<W.length;)if(W[Le][1].type==="listOrdered"||W[Le][1].type==="listUnordered")if(W[Le][0]==="enter")ke.push(Le);else{const ln=ke.pop();Le=i(W,ln,Le)}for(Le=-1;++Le<W.length;){const ln=e[W[Le][0]];Ew.call(ln,W[Le][1].type)&&ln[W[Le][1].type].call(Object.assign({sliceSerialize:W[Le][2].sliceSerialize},be),W[Le][1])}if(be.tokenStack.length>0){const ln=be.tokenStack[be.tokenStack.length-1];(ln[1]||sy).call(be,void 0,ln[0])}for(X.position={start:Ur(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ur(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<e.transforms.length;)X=e.transforms[Le](X)||X;return X}function i(W,X,be){let ke=X-1,Le=-1,ln=!1,Pt,Er,Ro,Mo;for(;++ke<=be;){const un=W[ke];switch(un[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{un[0]==="enter"?Le++:Le--,Mo=void 0;break}case"lineEndingBlank":{un[0]==="enter"&&(Pt&&!Mo&&!Le&&!Ro&&(Ro=ke),Mo=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mo=void 0}if(!Le&&un[0]==="enter"&&un[1].type==="listItemPrefix"||Le===-1&&un[0]==="exit"&&(un[1].type==="listUnordered"||un[1].type==="listOrdered")){if(Pt){let ns=ke;for(Er=void 0;ns--;){const Tr=W[ns];if(Tr[1].type==="lineEnding"||Tr[1].type==="lineEndingBlank"){if(Tr[0]==="exit")continue;Er&&(W[Er][1].type="lineEndingBlank",ln=!0),Tr[1].type="lineEnding",Er=ns}else if(!(Tr[1].type==="linePrefix"||Tr[1].type==="blockQuotePrefix"||Tr[1].type==="blockQuotePrefixWhitespace"||Tr[1].type==="blockQuoteMarker"||Tr[1].type==="listItemIndent"))break}Ro&&(!Er||Ro<Er)&&(Pt._spread=!0),Pt.end=Object.assign({},Er?W[Er][1].start:un[1].end),W.splice(Er||ke,0,["exit",Pt,un[2]]),ke++,be++}if(un[1].type==="listItemPrefix"){const ns={type:"listItem",_spread:!1,start:Object.assign({},un[1].start),end:void 0};Pt=ns,W.splice(ke,0,["enter",ns,un[2]]),ke++,be++,Ro=void 0,Mo=!0}}}return W[X][1]._spread=ln,be}function s(W,X){return be;function be(ke){a.call(this,W(ke),ke),X&&X.call(this,ke)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(W,X,be){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([X,be||void 0]),W.position={start:Ur(X.start),end:void 0}}function l(W){return X;function X(be){W&&W.call(this,be),u.call(this,be)}}function u(W,X){const be=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==W.type&&(X?X.call(this,W,ke[0]):(ke[1]||sy).call(this,W,ke[0]));else throw new Error("Cannot close `"+W.type+"` ("+la({start:W.start,end:W.end})+"): it’s not open");be.position.end=Ur(W.end)}function c(){return Kc(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(W){if(this.data.expectingFirstListItemValue){const X=this.stack[this.stack.length-2];X.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function h(){const W=this.resume(),X=this.stack[this.stack.length-1];X.lang=W}function p(){const W=this.resume(),X=this.stack[this.stack.length-1];X.meta=W}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const W=this.resume(),X=this.stack[this.stack.length-1];X.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const W=this.resume(),X=this.stack[this.stack.length-1];X.value=W.replace(/(\r?\n|\r)$/g,"")}function E(W){const X=this.resume(),be=this.stack[this.stack.length-1];be.label=X,be.identifier=$n(this.sliceSerialize(W)).toLowerCase()}function T(){const W=this.resume(),X=this.stack[this.stack.length-1];X.title=W}function v(){const W=this.resume(),X=this.stack[this.stack.length-1];X.url=W}function _(W){const X=this.stack[this.stack.length-1];if(!X.depth){const be=this.sliceSerialize(W).length;X.depth=be}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function M(W){const X=this.stack[this.stack.length-1];X.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function F(W){const be=this.stack[this.stack.length-1].children;let ke=be[be.length-1];(!ke||ke.type!=="text")&&(ke=xn(),ke.position={start:Ur(W.start),end:void 0},be.push(ke)),this.stack.push(ke)}function N(W){const X=this.stack.pop();X.value+=this.sliceSerialize(W),X.position.end=Ur(W.end)}function U(W){const X=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=X.children[X.children.length-1];be.position.end=Ur(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(X.type)&&(F.call(this,W),N.call(this,W))}function j(){this.data.atHardBreak=!0}function V(){const W=this.resume(),X=this.stack[this.stack.length-1];X.value=W}function I(){const W=this.resume(),X=this.stack[this.stack.length-1];X.value=W}function L(){const W=this.resume(),X=this.stack[this.stack.length-1];X.value=W}function Z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=X,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function H(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=X,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function D(W){const X=this.sliceSerialize(W),be=this.stack[this.stack.length-2];be.label=ZS(X),be.identifier=$n(X).toLowerCase()}function z(){const W=this.stack[this.stack.length-1],X=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const ke=W.children;be.children=ke}else be.alt=X}function x(){const W=this.resume(),X=this.stack[this.stack.length-1];X.url=W}function ne(){const W=this.resume(),X=this.stack[this.stack.length-1];X.title=W}function G(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function me(W){const X=this.resume(),be=this.stack[this.stack.length-1];be.label=X,be.identifier=$n(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function te(W){this.data.characterReferenceType=W.type}function le(W){const X=this.sliceSerialize(W),be=this.data.characterReferenceType;let ke;be?(ke=QS(X,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=Ym(X);const Le=this.stack[this.stack.length-1];Le.value+=ke}function _e(W){const X=this.stack.pop();X.position.end=Ur(W.end)}function ye(W){N.call(this,W);const X=this.stack[this.stack.length-1];X.url=this.sliceSerialize(W)}function ge(W){N.call(this,W);const X=this.stack[this.stack.length-1];X.url="mailto:"+this.sliceSerialize(W)}function De(){return{type:"blockquote",children:[]}}function We(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function Qe(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Tn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Cn(){return{type:"paragraph",children:[]}}function an(){return{type:"strong",children:[]}}function xn(){return{type:"text",value:""}}function ts(){return{type:"thematicBreak"}}}function Ur(t){return{line:t.line,column:t.column,offset:t.offset}}function Tw(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Tw(t,r):HH(t,r)}}function HH(t,e){let n;for(n in e)if(Ew.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function sy(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+la({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+la({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+la({start:e.start,end:e.end})+") is still open")}function oG(t){const e=this;e.parser=n;function n(r){return BH(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function UH(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function $H(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
147
|
+
`}]}function VH(t,e){const n=e.value?e.value+`
|
|
148
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function zH(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function jH(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function WH(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Eo(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let o,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function qH(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function YH(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Cw(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function KH(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Cw(t,e);const i={src:Eo(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function GH(t,e){const n={src:Eo(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function XH(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function QH(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Cw(t,e);const i={href:Eo(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function ZH(t,e){const n={href:Eo(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function JH(t,e,n){const r=t.all(e),i=n?eU(n):xw(e),s={},o=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
149
|
+
`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
150
|
+
`});const u={type:"element",tagName:"li",properties:s,children:o};return t.patch(e,u),t.applyData(e,u)}function eU(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=xw(n[r])}return e}function xw(t){const e=t.spread;return e??t.children.length>1}function tU(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function nU(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function rU(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function iU(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function sU(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=gS(e.children[1]),l=mS(e.children[e.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function oU(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let l=-1;const u=[];for(;++l<a;){const f=e.children[l],d={},h=o?o[l]:void 0;h&&(d.align=h);let p={type:"element",tagName:s,properties:d,children:[]};f&&(p.children=t.all(f),t.patch(f,p),p=t.applyData(f,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,c),t.applyData(e,c)}function aU(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const oy=9,ay=32;function lU(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(ly(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(ly(e.slice(i),i>0,!1)),s.join("")}function ly(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===oy||s===ay;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===oy||s===ay;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function uU(t,e){const n={type:"text",value:lU(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function cU(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const fU={blockquote:UH,break:$H,code:VH,delete:zH,emphasis:jH,footnoteReference:WH,heading:qH,html:YH,imageReference:KH,image:GH,inlineCode:XH,linkReference:QH,link:ZH,listItem:JH,list:tU,paragraph:nU,root:rU,strong:iU,table:sU,tableCell:aU,tableRow:oU,text:uU,thematicBreak:cU,toml:Bl,yaml:Bl,definition:Bl,footnoteDefinition:Bl};function Bl(){}function dU(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function hU(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function pU(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||dU,r=t.options.footnoteBackLabel||hU,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[l]);if(!u)continue;const c=t.all(u),f=String(u.identifier).toUpperCase(),d=Eo(f.toLowerCase());let h=0;const p=[],g=t.footnoteCounts.get(f);for(;g!==void 0&&++h<=g;){p.length>0&&p.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,h);typeof E=="string"&&(E={type:"text",value:E}),p.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const b=c[c.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const E=b.children[b.children.length-1];E&&E.type==="text"?E.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...p)}else c.push(...p);const y={type:"element",tagName:"li",properties:{id:e+"fn-"+d},children:t.wrap(c,!0)};t.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Js(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
151
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
|
|
152
|
+
`}]}}const ip={}.hasOwnProperty,mU={};function gU(t,e){const n=e||mU,r=new Map,i=new Map,s=new Map,o={...fU,...n.handlers},a={all:u,applyData:yU,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:bU,wrap:TU};return eo(t,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,d=String(c.identifier).toUpperCase();f.has(d)||f.set(d,c)}}),a;function l(c,f){const d=c.type,h=a.handlers[d];if(ip.call(a.handlers,d)&&h)return h(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in c){const{children:g,...b}=c,y=Js(b);return y.children=a.all(c),y}return Js(c)}return(a.options.unknownHandler||EU)(a,c,f)}function u(c){const f=[];if("children"in c){const d=c.children;let h=-1;for(;++h<d.length;){const p=a.one(d[h],c);if(p){if(h&&d[h-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=uy(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=uy(g.value))}Array.isArray(p)?f.push(...p):f.push(p)}}}return f}}function bU(t,e){t.position&&(e.position=yS(t))}function yU(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Js(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function EU(t,e){const n=e.data||{},r="value"in e&&!(ip.call(n,"hProperties")||ip.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function TU(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
153
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
154
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
155
|
+
`}),n}function uy(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function cy(t,e){const n=gU(t,e),r=n.one(t,void 0),i=pU(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
156
|
+
`},i),s}function aG(t,e){return t&&"run"in t?async function(n,r){const i=cy(n,{file:r,...e});await t.run(i,r)}:function(n,r){return cy(n,{file:r,...t||e})}}const CU=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],xU=/["&'<>`]/g,SU=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wU=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,kU=/[|\\{}()[\]^$+*?.]/g,fy=new WeakMap;function AU(t,e){if(t=t.replace(e.subset?vU(e.subset):xU,r),e.subset||e.escapeOnly)return t;return t.replace(SU,n).replace(wU,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function vU(t){let e=fy.get(t);return e||(e=_U(t),fy.set(t,e)),e}function _U(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(kU,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const NU=/[\dA-Fa-f]/;function IU(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!NU.test(String.fromCharCode(e))?r:r+";"}const RU=/\d/;function MU(t,e,n){const r="&#"+String(t);return n&&e&&!RU.test(String.fromCharCode(e))?r:r+";"}const OU=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],_d={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},DU=["cent","copy","divide","gt","lt","not","para","times"],Sw={}.hasOwnProperty,sp={};let Fl;for(Fl in _d)Sw.call(_d,Fl)&&(sp[_d[Fl]]=Fl);const LU=/[^\dA-Za-z]/;function PU(t,e,n,r){const i=String.fromCharCode(t);if(Sw.call(sp,i)){const s=sp[i],o="&"+s;return n&&OU.includes(s)&&!DU.includes(s)&&(!r||e&&e!==61&&LU.test(String.fromCharCode(e)))?o:o+";"}return""}function BU(t,e,n){let r=IU(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=PU(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=MU(t,e,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Ds(t,e){return AU(t,Object.assign({format:BU},e))}const FU=/^>|^->|<!--|-->|--!>|<!-$/g,HU=[">"],UU=["<",">"];function $U(t,e,n,r){return r.settings.bogusComments?"<?"+Ds(t.value,Object.assign({},r.settings.characterReferences,{subset:HU}))+">":"<!--"+t.value.replace(FU,i)+"-->";function i(s){return Ds(s,Object.assign({},r.settings.characterReferences,{subset:UU}))}}function VU(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const ct=kw(1),ww=kw(-1),zU=[];function kw(t){return e;function e(n,r,i){const s=n?n.children:zU;let o=(r||0)+t,a=s[o];if(!i)for(;a&&il(a);)o+=t,a=s[o];return a}}const jU={}.hasOwnProperty;function Aw(t){return e;function e(n,r,i){return jU.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const Qm=Aw({body:qU,caption:Nd,colgroup:Nd,dd:XU,dt:GU,head:Nd,html:WU,li:KU,optgroup:QU,option:ZU,p:YU,rp:dy,rt:dy,tbody:e$,td:hy,tfoot:t$,th:hy,thead:JU,tr:n$});function Nd(t,e,n){const r=ct(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&il(r.value.charAt(0)))}function WU(t,e,n){const r=ct(n,e);return!r||r.type!=="comment"}function qU(t,e,n){const r=ct(n,e);return!r||r.type!=="comment"}function YU(t,e,n){const r=ct(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function KU(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&r.tagName==="li"}function GU(t,e,n){const r=ct(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function XU(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function dy(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function QU(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function ZU(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function JU(t,e,n){const r=ct(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function e$(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function t$(t,e,n){return!ct(n,e)}function n$(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function hy(t,e,n){const r=ct(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const r$=Aw({body:o$,colgroup:a$,head:s$,html:i$,tbody:l$});function i$(t){const e=ct(t,-1);return!e||e.type!=="comment"}function s$(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function o$(t){const e=ct(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&il(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function a$(t,e,n){const r=ww(n,e),i=ct(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Qm(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function l$(t,e,n){const r=ww(n,e),i=ct(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Qm(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Hl={name:[[`
|
|
157
|
+
\f\r &/=>`.split(""),`
|
|
158
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
159
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
160
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
161
|
+
\f\r &>`.split(""),`\0
|
|
162
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
163
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
164
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function u$(t,e,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=tl);const u=c$(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(o=!1),(u||!s||!r$(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!o&&(!s||!Qm(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function c$(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const s=f$(t,i,e[i]);s&&n.push(s)}}for(;++r<n.length;){const s=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function f$(t,e,n){const r=Nm(t.schema,e),i=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,s=t.settings.allowDangerousCharacters?0:1;let o=t.quote,a;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Ds(r.attribute,Object.assign({},t.settings.characterReferences,{subset:Hl.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?pD:gD)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?l:(t.settings.preferUnquoted&&(a=Ds(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Hl.unquoted[i][s]}))),a!==n&&(t.settings.quoteSmart&&Xu(n,o)>Xu(n,t.alternative)&&(o=t.alternative),a=o+Ds(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?Hl.single:Hl.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const d$=["<","&"];function vw(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Ds(t.value,Object.assign({},r.settings.characterReferences,{subset:d$}))}function h$(t,e,n,r){return r.settings.allowDangerousHtml?t.value:vw(t,e,n,r)}function p$(t,e,n,r){return r.all(t)}const m$=BS("type",{invalid:g$,unknown:b$,handlers:{comment:$U,doctype:VU,element:u$,raw:h$,root:p$,text:vw}});function g$(t){throw new Error("Expected node, not `"+t+"`")}function b$(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const y$={},E$={},T$=[];function C$(t,e){const n=e||y$,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:x$,all:S$,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||CU,characterReferences:n.characterReferences||E$,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?tl:Uc,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function x$(t,e,n){return m$(t,e,n,this)}function S$(t){const e=[],n=t&&t.children||T$;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function lG(t){const e=this,n={...e.data("settings"),...t};e.compiler=r;function r(i){return C$(i,n)}}class To{match;handler;undoable;inCode;inCodeMark;constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?w$(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}}function w$(t){return function(e,n,r,i){let s=t;if(n[1]){let o=n[0].lastIndexOf(n[1]);s+=n[0].slice(o+n[1].length),r+=o;let a=r-i;a>0&&(s=n[0].slice(o-a,o)+s,r=i)}return e.tr.insertText(s,r,i)}}const k$=500;function uG({rules:t}){let e=new ot({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,s){return py(n,r,i,s,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&py(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function py(t,e,n,r,i,s){if(t.composing)return!1;const o=t.state.tr.insertText(r,e,n),a=o.mapping.map(e),l=o.mapping.map(n);let u=null,c=o.doc.resolve(a),f=c.parent.textBetween(Math.max(0,c.parentOffset-k$),c.parentOffset,null,"");for(let d=0;d<i.length;d++){let h=i[d];if(!h.inCodeMark&&c.marks().some(b=>b.type.spec.code))continue;if(c.parent.type.spec.code){if(!h.inCode)continue}else if(h.inCode==="only")continue;let p=h.match.exec(f);if(!p||p[0].length<r.length)continue;u??=t.state.apply(o);let g=h.handler(u,p,a-p[0].length,l);if(g)return t.dispatch(o),t.dispatch(iD(t.state.tr)),h.undoable&&g.setMeta(s,{transform:g,from:a,to:l,text:r}),t.dispatch(g),!0}return!1}new To(/--$/,"—",{inCodeMark:!1});new To(/\.\.\.$/,"…",{inCodeMark:!1});new To(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1});new To(/"$/,"”",{inCodeMark:!1});new To(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1});new To(/'$/,"’",{inCodeMark:!1});class Ze extends he{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ze.valid(r)?new Ze(r):he.near(r)}content(){return ee.empty}eq(e){return e instanceof Ze&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ze(e.resolve(n.pos))}getBookmark(){return new Zm(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!A$(e)||!v$(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ze.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Ze.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ae.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Ze.valid(a))return a}return null}}}Ze.prototype.visible=!1;Ze.findFrom=Ze.findGapCursorFrom;he.jsonID("gapcursor",Ze);class Zm{constructor(e){this.pos=e}map(e){return new Zm(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ze.valid(n)?new Ze(n):he.near(n)}}function _w(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function A$(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||_w(i.type))return!0;if(i.inlineContent)return!1}}return!0}function v$(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||_w(i.type))return!0;if(i.inlineContent)return!1}}return!0}function _$(){return new ot({props:{decorations:M$,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ze.valid(n)?new Ze(n):null},handleClick:I$,handleKeyDown:N$,handleDOMEvents:{beforeinput:R$}}})}const N$=Fp({ArrowLeft:Ul("horiz",-1),ArrowRight:Ul("horiz",1),ArrowUp:Ul("vert",-1),ArrowDown:Ul("vert",1)});function Ul(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof fe){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Ze.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Ze(u))),!0):!1}}function I$(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ze.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ze(r))),!0)}function R$(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ze))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=q.empty;for(let o=r.length-1;o>=0;o--)i=q.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new ee(i,0,0));return s.setSelection(fe.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function M$(t){if(!(t.selection instanceof Ze))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qe.create(t.doc,[ut.widget(t.selection.head,e,{key:"gapcursor"})])}var cG=Yn.create({name:"gapCursor",addProseMirrorPlugins(){return[_$()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=$e(oe(t,"allowGapCursor",n)))!=null?e:null}}}),fG=HI.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""});function Zc(){return typeof window<"u"}function gi(t){return Jm(t)?(t.nodeName||"").toLowerCase():"#document"}function yn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function br(t){var e;return(e=(Jm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Jm(t){return Zc()?t instanceof Node||t instanceof yn(t).Node:!1}function Ke(t){return Zc()?t instanceof Element||t instanceof yn(t).Element:!1}function At(t){return Zc()?t instanceof HTMLElement||t instanceof yn(t).HTMLElement:!1}function Fa(t){return!Zc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yn(t).ShadowRoot}function al(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Dn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function O$(t){return/^(table|td|th)$/.test(gi(t))}function Jc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const D$=/transform|translate|scale|rotate|perspective|filter/,L$=/paint|layout|strict|content/,Si=t=>!!t&&t!=="none";let Id;function e0(t){const e=Ke(t)?Dn(t):t;return Si(e.transform)||Si(e.translate)||Si(e.scale)||Si(e.rotate)||Si(e.perspective)||!ef()&&(Si(e.backdropFilter)||Si(e.filter))||D$.test(e.willChange||"")||L$.test(e.contain||"")}function P$(t){let e=Dr(t);for(;At(e)&&!Or(e);){if(e0(e))return e;if(Jc(e))return null;e=Dr(e)}return null}function ef(){return Id==null&&(Id=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Id}function Or(t){return/^(html|body|#document)$/.test(gi(t))}function Dn(t){return yn(t).getComputedStyle(t)}function tf(t){return Ke(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Dr(t){if(gi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||br(t);return Fa(e)?e.host:e}function Nw(t){const e=Dr(t);return Or(e)?t.ownerDocument?t.ownerDocument.body:t.body:At(e)&&al(e)?e:Nw(e)}function ai(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Nw(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=yn(i);if(s){const a=op(o);return e.concat(o,o.visualViewport||[],al(i)?i:[],a&&n?ai(a):[])}else return e.concat(i,ai(i,[],n))}function op(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const B$=["top","right","bottom","left"],my=["start","end"],gy=B$.reduce((t,e)=>t.concat(e,e+"-"+my[0],e+"-"+my[1]),[]),no=Math.min,hn=Math.max,Ju=Math.round,$l=Math.floor,sr=t=>({x:t,y:t}),F$={left:"right",right:"left",bottom:"top",top:"bottom"};function by(t,e,n){return hn(t,no(e,n))}function Co(t,e){return typeof t=="function"?t(e):t}function dr(t){return t.split("-")[0]}function or(t){return t.split("-")[1]}function Iw(t){return t==="x"?"y":"x"}function Rw(t){return t==="y"?"height":"width"}function _r(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Mw(t){return Iw(_r(t))}function Ow(t,e,n){n===void 0&&(n=!1);const r=or(t),i=Mw(t),s=Rw(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=tc(o)),[o,tc(o)]}function H$(t){const e=tc(t);return[ec(t),e,ec(e)]}function ec(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const yy=["left","right"],Ey=["right","left"],U$=["top","bottom"],$$=["bottom","top"];function V$(t,e,n){switch(t){case"top":case"bottom":return n?e?Ey:yy:e?yy:Ey;case"left":case"right":return e?U$:$$;default:return[]}}function z$(t,e,n,r){const i=or(t);let s=V$(dr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(ec)))),s}function tc(t){const e=dr(t);return F$[e]+t.slice(e.length)}function j$(t){return{top:0,right:0,bottom:0,left:0,...t}}function W$(t){return typeof t!="number"?j$(t):{top:t,right:t,bottom:t,left:t}}function nc(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}var q$=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],rc=q$.join(","),Dw=typeof Element>"u",ro=Dw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ic=!Dw&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},sc=function(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):sc(e.parentNode));return o},Y$=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Lw=function(e,n,r){if(sc(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(rc));return n&&ro.call(e,rc)&&i.unshift(e),i=i.filter(r),i},oc=function(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!sc(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=oc(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var c=ro.call(o,rc);c&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var f=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),d=!sc(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(f&&d){var h=oc(f===!0?o.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:o,candidates:h})}else s.unshift.apply(s,o.children)}}return i},Pw=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Bw=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Y$(e))&&!Pw(e)?0:e.tabIndex},K$=function(e,n){var r=Bw(e);return r<0&&n&&!Pw(e)?0:r},G$=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Fw=function(e){return e.tagName==="INPUT"},X$=function(e){return Fw(e)&&e.type==="hidden"},Q$=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},Z$=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},J$=function(e){if(!e.name)return!0;var n=e.form||ic(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Z$(i,e.form);return!s||s===e},eV=function(e){return Fw(e)&&e.type==="radio"},tV=function(e){return eV(e)&&!J$(e)},nV=function(e){var n,r=e&&ic(e),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&i;){var u,c,f;r=ic(i),i=(u=r)===null||u===void 0?void 0:u.host,s=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return s},Ty=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},rV=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var o=ro.call(e,"details>summary:first-of-type"),a=o?e.parentElement:e;if(ro.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var u=e.parentElement,c=ic(e);if(u&&!u.shadowRoot&&i(u)===!0)return Ty(e);e.assignedSlot?e=e.assignedSlot:!u&&c!==e.ownerDocument?e=c.host:e=u}e=l}if(nV(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ty(e);return!1},iV=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return ro.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},ap=function(e,n){return!(n.disabled||X$(n)||rV(n,e)||Q$(n)||iV(n))},lp=function(e,n){return!(tV(n)||Bw(n)<0||!ap(e,n))},sV=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Hw=function(e){var n=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=K$(a,o),u=o?Hw(i.candidates):a;l===0?o?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(G$).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},nf=function(e,n){n=n||{};var r;return n.getShadowRoot?r=oc([e],n.includeContainer,{filter:lp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sV}):r=Lw(e,n.includeContainer,lp.bind(null,n)),Hw(r)},oV=function(e,n){n=n||{};var r;return n.getShadowRoot?r=oc([e],n.includeContainer,{filter:ap.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Lw(e,n.includeContainer,ap.bind(null,n)),r},Uw=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return ro.call(e,rc)===!1?!1:lp(n,e)};function aV(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function $w(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function lV(){return/apple/i.test(navigator.vendor)}function up(){const t=/android/i;return t.test(aV())||t.test($w())}function uV(){return $w().includes("jsdom/")}const Cy="data-floating-ui-focusable",cV="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function bs(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Gt(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Fa(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Gr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Rd(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function fV(t){return t.matches("html,body")}function Bt(t){return t?.ownerDocument||document}function dV(t){return At(t)&&t.matches(cV)}function xy(t){return t?t.getAttribute("role")==="combobox"&&dV(t):!1}function Sy(t){return t?t.hasAttribute(Cy)?t:t.querySelector("["+Cy+"]")||t:null}function Ls(t,e,n){return n===void 0&&(n=!0),t.filter(i=>{var s;return i.parentId===e&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...Ls(t,i.id,n)])}function wy(t,e){var n;let r=[],i=(n=t.find(s=>s.id===e))==null?void 0:n.parentId;for(;i;){const s=t.find(o=>o.id===i);i=s?.parentId,s&&(r=r.concat(s))}return r}function Md(t){t.preventDefault(),t.stopPropagation()}function hV(t){return"nativeEvent"in t}function pV(t){return t.mozInputSource===0&&t.isTrusted?!0:up()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function mV(t){return uV()?!1:!up()&&t.width===0&&t.height===0||up()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function cp(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var gV=typeof document<"u",bV=function(){},_t=gV?C.useLayoutEffect:bV;const yV={...mc};function Hn(t){const e=C.useRef(t);return _t(()=>{e.current=t}),e}const EV=yV.useInsertionEffect,TV=EV||(t=>t());function Jt(t){const e=C.useRef(()=>{});return TV(()=>{e.current=t}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}const ll=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Vw(t,e){const n=nf(t,ll()),r=n.length;if(r===0)return;const i=bs(Bt(t)),s=n.indexOf(i),o=s===-1?e===1?0:r-1:s+e;return n[o]}function zw(t){return Vw(Bt(t).body,1)||t}function jw(t){return Vw(Bt(t).body,-1)||t}function fa(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Gt(n,r)}function CV(t){nf(t,ll()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ky(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ay(t,e,n){let{reference:r,floating:i}=t;const s=_r(e),o=Mw(e),a=Rw(o),l=dr(e),u=s==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(or(e)){case"start":h[o]-=d*(n&&u?-1:1);break;case"end":h[o]+=d*(n&&u?-1:1);break}return h}async function xV(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Co(e,t),p=W$(h),b=a[d?f==="floating"?"reference":"floating":f],y=nc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),v=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},_=nc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:l}):E);return{top:(y.top-_.top+p.top)/v.y,bottom:(_.bottom-y.bottom+p.bottom)/v.y,left:(y.left-_.left+p.left)/v.x,right:(_.right-y.right+p.right)/v.x}}const SV=50,wV=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:xV},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=Ay(u,r,l),d=r,h=0;const p={};for(let g=0;g<s.length;g++){const b=s[g];if(!b)continue;const{name:y,fn:E}=b,{x:T,y:v,data:_,reset:k}=await E({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:u,platform:a,elements:{reference:t,floating:e}});c=T??c,f=v??f,p[y]={...p[y],..._},k&&h<SV&&(h++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(u=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:c,y:f}=Ay(u,d,l)),g=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:p}};function kV(t,e,n){return(t?[...n.filter(i=>or(i)===t),...n.filter(i=>or(i)!==t)]:n.filter(i=>dr(i)===i)).filter(i=>t?or(i)===t||(e?ec(i)!==i:!1):!0)}const AV=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:u}=e,{crossAxis:c=!1,alignment:f,allowedPlacements:d=gy,autoAlignment:h=!0,...p}=Co(t,e),g=f!==void 0||d===gy?kV(f||null,h,d):d,b=await l.detectOverflow(e,p),y=((n=o.autoPlacement)==null?void 0:n.index)||0,E=g[y];if(E==null)return{};const T=Ow(E,s,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(a!==E)return{reset:{placement:g[0]}};const v=[b[dr(E)],b[T[0]],b[T[1]]],_=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:E,overflows:v}],k=g[y+1];if(k)return{data:{index:y+1,overflows:_},reset:{placement:k}};const M=_.map(N=>{const U=or(N.placement);return[N.placement,U&&c?N.overflows.slice(0,2).reduce((j,V)=>j+V,0):N.overflows[0],N.overflows]}).sort((N,U)=>N[1]-U[1]),F=((i=M.filter(N=>N[2].slice(0,or(N[0])?2:3).every(U=>U<=0))[0])==null?void 0:i[0])||M[0][0];return F!==a?{data:{index:y+1,overflows:_},reset:{placement:F}}:{}}}},vV=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...b}=Co(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=dr(i),E=_r(a),T=dr(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=d||(T||!g?[tc(a)]:H$(a)),k=p!=="none";!d&&k&&_.push(...z$(a,g,p,v));const M=[a,..._],P=await l.detectOverflow(e,b),F=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&F.push(P[y]),f){const I=Ow(i,o,v);F.push(P[I[0]],P[I[1]])}if(N=[...N,{placement:i,overflows:F}],!F.every(I=>I<=0)){var U,j;const I=(((U=s.flip)==null?void 0:U.index)||0)+1,L=M[I];if(L&&(!(f==="alignment"?E!==_r(L):!1)||N.every(D=>_r(D.placement)===E?D.overflows[0]>0:!0)))return{data:{index:I,overflows:N},reset:{placement:L}};let Z=(j=N.filter(H=>H.overflows[0]<=0).sort((H,D)=>H.overflows[1]-D.overflows[1])[0])==null?void 0:j.placement;if(!Z)switch(h){case"bestFit":{var V;const H=(V=N.filter(D=>{if(k){const z=_r(D.placement);return z===E||z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(z=>z>0).reduce((z,x)=>z+x,0)]).sort((D,z)=>D[1]-z[1])[0])==null?void 0:V[0];H&&(Z=H);break}case"initialPlacement":Z=a;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}},_V=new Set(["left","top"]);async function NV(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dr(n),a=or(n),l=_r(n)==="y",u=_V.has(o)?-1:1,c=s&&l?-1:1,f=Co(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*c,y:d*u}:{x:d*u,y:h*c}}const IV=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await NV(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},RV=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:E,y:T}=y;return{x:E,y:T}}},...u}=Co(t,e),c={x:n,y:r},f=await s.detectOverflow(e,u),d=_r(dr(i)),h=Iw(d);let p=c[h],g=c[d];if(o){const y=h==="y"?"top":"left",E=h==="y"?"bottom":"right",T=p+f[y],v=p-f[E];p=by(T,p,v)}if(a){const y=d==="y"?"top":"left",E=d==="y"?"bottom":"right",T=g+f[y],v=g-f[E];g=by(T,g,v)}const b=l.fn({...e,[h]:p,[d]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:o,[d]:a}}}}}},MV=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Co(t,e),c=await o.detectOverflow(e,u),f=dr(i),d=or(i),h=_r(i)==="y",{width:p,height:g}=s.floating;let b,y;f==="top"||f==="bottom"?(b=f,y=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,b=d==="end"?"top":"bottom");const E=g-c.top-c.bottom,T=p-c.left-c.right,v=no(g-c[b],E),_=no(p-c[y],T),k=!e.middlewareData.shift;let M=v,P=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=E),k&&!d){const N=hn(c.left,0),U=hn(c.right,0),j=hn(c.top,0),V=hn(c.bottom,0);h?P=p-2*(N!==0||U!==0?N+U:hn(c.left,c.right)):M=g-2*(j!==0||V!==0?j+V:hn(c.top,c.bottom))}await l({...e,availableWidth:P,availableHeight:M});const F=await o.getDimensions(a.floating);return p!==F.width||g!==F.height?{reset:{rects:!0}}:{}}}};function Ww(t){const e=Dn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=At(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Ju(n)!==s||Ju(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function t0(t){return Ke(t)?t:t.contextElement}function Ps(t){const e=t0(t);if(!At(e))return sr(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Ww(e);let o=(s?Ju(n.width):n.width)/r,a=(s?Ju(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const OV=sr(0);function qw(t){const e=yn(t);return!ef()||!e.visualViewport?OV:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function DV(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==yn(t)?!1:e}function Yi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=t0(t);let o=sr(1);e&&(r?Ke(r)&&(o=Ps(r)):o=Ps(t));const a=DV(s,n,r)?qw(s):sr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(s){const d=yn(s),h=r&&Ke(r)?yn(r):r;let p=d,g=op(p);for(;g&&r&&h!==p;){const b=Ps(g),y=g.getBoundingClientRect(),E=Dn(g),T=y.left+(g.clientLeft+parseFloat(E.paddingLeft))*b.x,v=y.top+(g.clientTop+parseFloat(E.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,f*=b.y,l+=T,u+=v,p=yn(g),g=op(p)}}return nc({width:c,height:f,x:l,y:u})}function rf(t,e){const n=tf(t).scrollLeft;return e?e.left+n:Yi(br(t)).left+n}function Yw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-rf(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function LV(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=br(r),a=e?Jc(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=sr(1);const c=sr(0),f=At(r);if((f||!f&&!s)&&((gi(r)!=="body"||al(o))&&(l=tf(r)),f)){const h=Yi(r);u=Ps(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const d=o&&!f&&!s?Yw(o,l):sr(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function PV(t){return Array.from(t.getClientRects())}function BV(t){const e=br(t),n=tf(t),r=t.ownerDocument.body,i=hn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=hn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+rf(t);const a=-n.scrollTop;return Dn(r).direction==="rtl"&&(o+=hn(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const vy=25;function FV(t,e){const n=yn(t),r=br(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=ef();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=rf(r);if(u<=0){const c=r.ownerDocument,f=c.body,d=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(r.clientWidth-f.clientWidth-h);p<=vy&&(s-=p)}else u<=vy&&(s+=u);return{width:s,height:o,x:a,y:l}}function HV(t,e){const n=Yi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=At(t)?Ps(t):sr(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function _y(t,e,n){let r;if(e==="viewport")r=FV(t,n);else if(e==="document")r=BV(br(t));else if(Ke(e))r=HV(e,n);else{const i=qw(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return nc(r)}function Kw(t,e){const n=Dr(t);return n===e||!Ke(n)||Or(n)?!1:Dn(n).position==="fixed"||Kw(n,e)}function UV(t,e){const n=e.get(t);if(n)return n;let r=ai(t,[],!1).filter(a=>Ke(a)&&gi(a)!=="body"),i=null;const s=Dn(t).position==="fixed";let o=s?Dr(t):t;for(;Ke(o)&&!Or(o);){const a=Dn(o),l=e0(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||al(o)&&!l&&Kw(t,o))?r=r.filter(c=>c!==o):i=a,o=Dr(o)}return e.set(t,r),r}function $V(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Jc(e)?[]:UV(e,this._c):[].concat(n),r],a=_y(e,o[0],i);let l=a.top,u=a.right,c=a.bottom,f=a.left;for(let d=1;d<o.length;d++){const h=_y(e,o[d],i);l=hn(h.top,l),u=no(h.right,u),c=no(h.bottom,c),f=hn(h.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function VV(t){const{width:e,height:n}=Ww(t);return{width:e,height:n}}function zV(t,e,n){const r=At(e),i=br(e),s=n==="fixed",o=Yi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=sr(0);function u(){l.x=rf(i)}if(r||!r&&!s)if((gi(e)!=="body"||al(i))&&(a=tf(e)),r){const h=Yi(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&u();s&&!r&&i&&u();const c=i&&!r&&!s?Yw(i,a):sr(0),f=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:f,y:d,width:o.width,height:o.height}}function Od(t){return Dn(t).position==="static"}function Ny(t,e){if(!At(t)||Dn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return br(t)===n&&(n=n.ownerDocument.body),n}function Gw(t,e){const n=yn(t);if(Jc(t))return n;if(!At(t)){let i=Dr(t);for(;i&&!Or(i);){if(Ke(i)&&!Od(i))return i;i=Dr(i)}return n}let r=Ny(t,e);for(;r&&O$(r)&&Od(r);)r=Ny(r,e);return r&&Or(r)&&Od(r)&&!e0(r)?n:r||P$(t)||n}const jV=async function(t){const e=this.getOffsetParent||Gw,n=this.getDimensions,r=await n(t.floating);return{reference:zV(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WV(t){return Dn(t).direction==="rtl"}const qV={convertOffsetParentRelativeRectToViewportRelativeRect:LV,getDocumentElement:br,getClippingRect:$V,getOffsetParent:Gw,getElementRects:jV,getClientRects:PV,getDimensions:VV,getScale:Ps,isElement:Ke,isRTL:WV};function Xw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function YV(t,e){let n=null,r;const i=br(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:c,top:f,width:d,height:h}=u;if(a||e(),!d||!h)return;const p=$l(f),g=$l(i.clientWidth-(c+d)),b=$l(i.clientHeight-(f+h)),y=$l(c),T={rootMargin:-p+"px "+-g+"px "+-b+"px "+-y+"px",threshold:hn(0,no(1,l))||1};let v=!0;function _(k){const M=k[0].intersectionRatio;if(M!==l){if(!v)return o();M?o(!1,M):r=setTimeout(()=>{o(!1,1e-7)},1e3)}M===1&&!Xw(u,t.getBoundingClientRect())&&o(),v=!1}try{n=new IntersectionObserver(_,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,T)}n.observe(t)}return o(!0),s}function dG(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=t0(t),c=i||s?[...u?ai(u):[],...e?ai(e):[]]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&a?YV(u,n):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[E]=y;E&&E.target===u&&h&&e&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(e)})),n()}),u&&!l&&h.observe(u),e&&h.observe(e));let p,g=l?Yi(t):null;l&&b();function b(){const y=Yi(t);g&&!Xw(g,y)&&n(),g=y,p=requestAnimationFrame(b)}return n(),()=>{var y;c.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const KV=IV,GV=AV,XV=RV,QV=vV,ZV=MV,JV=(t,e,n)=>{const r=new Map,i={platform:qV,...n},s={...i.platform,_c:r};return wV(t,e,{...i,platform:s})};var ez=typeof document<"u",tz=function(){},du=ez?C.useLayoutEffect:tz;function ac(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ac(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!ac(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Qw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Iy(t,e){const n=Qw(t);return Math.round(e*n)/n}function Dd(t){const e=C.useRef(t);return du(()=>{e.current=t}),e}function nz(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,f]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=C.useState(r);ac(d,r)||h(r);const[p,g]=C.useState(null),[b,y]=C.useState(null),E=C.useCallback(D=>{D!==k.current&&(k.current=D,g(D))},[]),T=C.useCallback(D=>{D!==M.current&&(M.current=D,y(D))},[]),v=s||p,_=o||b,k=C.useRef(null),M=C.useRef(null),P=C.useRef(c),F=l!=null,N=Dd(l),U=Dd(i),j=Dd(u),V=C.useCallback(()=>{if(!k.current||!M.current)return;const D={placement:e,strategy:n,middleware:d};U.current&&(D.platform=U.current),JV(k.current,M.current,D).then(z=>{const x={...z,isPositioned:j.current!==!1};I.current&&!ac(P.current,x)&&(P.current=x,za.flushSync(()=>{f(x)}))})},[d,e,n,U,j]);du(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[u]);const I=C.useRef(!1);du(()=>(I.current=!0,()=>{I.current=!1}),[]),du(()=>{if(v&&(k.current=v),_&&(M.current=_),v&&_){if(N.current)return N.current(v,_,V);V()}},[v,_,V,N,F]);const L=C.useMemo(()=>({reference:k,floating:M,setReference:E,setFloating:T}),[E,T]),Z=C.useMemo(()=>({reference:v,floating:_}),[v,_]),H=C.useMemo(()=>{const D={position:n,left:0,top:0};if(!Z.floating)return D;const z=Iy(Z.floating,c.x),x=Iy(Z.floating,c.y);return a?{...D,transform:"translate("+z+"px, "+x+"px)",...Qw(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:x}},[n,a,Z.floating,c.x,c.y]);return C.useMemo(()=>({...c,update:V,refs:L,elements:Z,floatingStyles:H}),[c,V,L,Z,H])}const hG=(t,e)=>{const n=KV(t);return{name:n.name,fn:n.fn,options:[t,e]}},pG=(t,e)=>{const n=XV(t);return{name:n.name,fn:n.fn,options:[t,e]}},mG=(t,e)=>{const n=QV(t);return{name:n.name,fn:n.fn,options:[t,e]}},gG=(t,e)=>{const n=ZV(t);return{name:n.name,fn:n.fn,options:[t,e]}},bG=(t,e)=>{const n=GV(t);return{name:n.name,fn:n.fn,options:[t,e]}};function yG(t){const e=C.useRef(void 0),n=C.useCallback(r=>{const i=t.map(s=>{if(s!=null){if(typeof s=="function"){const o=s,a=o(r);return typeof a=="function"?a:()=>{o(null)}}return s.current=r,()=>{s.current=null}}});return()=>{i.forEach(s=>s?.())}},t);return C.useMemo(()=>t.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},t)}const rz="data-floating-ui-focusable",Ry="active",My="selected",iz={...mc};let Oy=!1,sz=0;const Dy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+sz++;function oz(){const[t,e]=C.useState(()=>Oy?Dy():void 0);return _t(()=>{t==null&&e(Dy())},[]),C.useEffect(()=>{Oy=!0},[]),t}const az=iz.useId,Zw=az||oz;function lz(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const uz=C.createContext(null),cz=C.createContext(null),Jw=()=>{var t;return((t=C.useContext(uz))==null?void 0:t.id)||null},sf=()=>C.useContext(cz);function io(t){return"data-floating-ui-"+t}function Kt(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const Ly=io("safe-polygon");function Ld(t,e,n){if(n&&!cp(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const r=t();return typeof r=="number"?r:r?.[e]}return t?.[e]}function Pd(t){return typeof t=="function"?t():t}function EG(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:o}=t,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:c=!1,restMs:f=0,move:d=!0}=e,h=sf(),p=Jw(),g=Hn(u),b=Hn(l),y=Hn(n),E=Hn(f),T=C.useRef(),v=C.useRef(-1),_=C.useRef(),k=C.useRef(-1),M=C.useRef(!0),P=C.useRef(!1),F=C.useRef(()=>{}),N=C.useRef(!1),U=Jt(()=>{var H;const D=(H=i.current.openEvent)==null?void 0:H.type;return D?.includes("mouse")&&D!=="mousedown"});C.useEffect(()=>{if(!a)return;function H(D){let{open:z}=D;z||(Kt(v),Kt(k),M.current=!0,N.current=!1)}return s.on("openchange",H),()=>{s.off("openchange",H)}},[a,s]),C.useEffect(()=>{if(!a||!g.current||!n)return;function H(z){U()&&r(!1,z,"hover")}const D=Bt(o.floating).documentElement;return D.addEventListener("mouseleave",H),()=>{D.removeEventListener("mouseleave",H)}},[o.floating,n,r,a,g,U]);const j=C.useCallback(function(H,D,z){D===void 0&&(D=!0),z===void 0&&(z="hover");const x=Ld(b.current,"close",T.current);x&&!_.current?(Kt(v),v.current=window.setTimeout(()=>r(!1,H,z),x)):D&&(Kt(v),r(!1,H,z))},[b,r]),V=Jt(()=>{F.current(),_.current=void 0}),I=Jt(()=>{if(P.current){const H=Bt(o.floating).body;H.style.pointerEvents="",H.removeAttribute(Ly),P.current=!1}}),L=Jt(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);C.useEffect(()=>{if(!a)return;function H(G){if(Kt(v),M.current=!1,c&&!cp(T.current)||Pd(E.current)>0&&!Ld(b.current,"open"))return;const w=Ld(b.current,"open",T.current);w?v.current=window.setTimeout(()=>{y.current||r(!0,G,"hover")},w):n||r(!0,G,"hover")}function D(G){if(L()){I();return}F.current();const w=Bt(o.floating);if(Kt(k),N.current=!1,g.current&&i.current.floatingContext){n||Kt(v),_.current=g.current({...i.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){I(),V(),L()||j(G,!0,"safe-polygon")}});const te=_.current;w.addEventListener("mousemove",te),F.current=()=>{w.removeEventListener("mousemove",te)};return}(T.current!=="touch"||!Gt(o.floating,G.relatedTarget))&&j(G)}function z(G){L()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){I(),V(),L()||j(G)}})(G))}function x(){Kt(v)}function ne(G){L()||j(G,!1)}if(Ke(o.domReference)){const G=o.domReference,w=o.floating;return n&&G.addEventListener("mouseleave",z),d&&G.addEventListener("mousemove",H,{once:!0}),G.addEventListener("mouseenter",H),G.addEventListener("mouseleave",D),w&&(w.addEventListener("mouseleave",z),w.addEventListener("mouseenter",x),w.addEventListener("mouseleave",ne)),()=>{n&&G.removeEventListener("mouseleave",z),d&&G.removeEventListener("mousemove",H),G.removeEventListener("mouseenter",H),G.removeEventListener("mouseleave",D),w&&(w.removeEventListener("mouseleave",z),w.removeEventListener("mouseenter",x),w.removeEventListener("mouseleave",ne))}}},[o,a,t,c,d,j,V,I,r,n,y,h,b,g,i,L,E]),_t(()=>{var H;if(a&&n&&(H=g.current)!=null&&(H=H.__options)!=null&&H.blockPointerEvents&&U()){P.current=!0;const z=o.floating;if(Ke(o.domReference)&&z){var D;const x=Bt(o.floating).body;x.setAttribute(Ly,"");const ne=o.domReference,G=h==null||(D=h.nodesRef.current.find(w=>w.id===p))==null||(D=D.context)==null?void 0:D.elements.floating;return G&&(G.style.pointerEvents=""),x.style.pointerEvents="none",ne.style.pointerEvents="auto",z.style.pointerEvents="auto",()=>{x.style.pointerEvents="",ne.style.pointerEvents="",z.style.pointerEvents=""}}}},[a,n,p,o,h,g,U]),_t(()=>{n||(T.current=void 0,N.current=!1,V(),I())},[n,V,I]),C.useEffect(()=>()=>{V(),Kt(v),Kt(k),I()},[a,o.domReference,V,I]);const Z=C.useMemo(()=>{function H(D){T.current=D.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(D){const{nativeEvent:z}=D;function x(){!M.current&&!y.current&&r(!0,z,"hover")}c&&!cp(T.current)||n||Pd(E.current)===0||N.current&&D.movementX**2+D.movementY**2<2||(Kt(k),T.current==="touch"?x():(N.current=!0,k.current=window.setTimeout(x,Pd(E.current))))}}},[c,r,n,y,E]);return C.useMemo(()=>a?{reference:Z}:{},[a,Z])}let Py=0;function us(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=e;r&&cancelAnimationFrame(Py);const s=()=>t?.focus({preventScroll:n});i?s():Py=requestAnimationFrame(s)}function Bd(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Fa(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function fz(t){return"composedPath"in t?t.composedPath()[0]:t.target}function dz(t){return t?.ownerDocument||document}const Bs={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function By(t){return t==="inert"?Bs.inert:t==="aria-hidden"?Bs["aria-hidden"]:Bs.none}let Vl=new WeakSet,zl={},Fd=0;const hz=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function ek(t){return t?Fa(t)?t.host:ek(t.parentNode):null}const pz=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=ek(n);return t.contains(r)?r:null}).filter(n=>n!=null);function mz(t,e,n,r){const i="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=pz(e,t),a=new Set,l=new Set(o),u=[];zl[i]||(zl[i]=new WeakMap);const c=zl[i];o.forEach(f),d(e),a.clear();function f(h){!h||a.has(h)||(a.add(h),h.parentNode&&f(h.parentNode))}function d(h){!h||l.has(h)||[].forEach.call(h.children,p=>{if(gi(p)!=="script")if(a.has(p))d(p);else{const g=s?p.getAttribute(s):null,b=g!==null&&g!=="false",y=By(s),E=(y.get(p)||0)+1,T=(c.get(p)||0)+1;y.set(p,E),c.set(p,T),u.push(p),E===1&&b&&Vl.add(p),T===1&&p.setAttribute(i,""),!b&&s&&p.setAttribute(s,s==="inert"?"":"true")}})}return Fd++,()=>{u.forEach(h=>{const p=By(s),b=(p.get(h)||0)-1,y=(c.get(h)||0)-1;p.set(h,b),c.set(h,y),b||(!Vl.has(h)&&s&&h.removeAttribute(s),Vl.delete(h)),y||h.removeAttribute(i)}),Fd--,Fd||(Bs.inert=new WeakMap,Bs["aria-hidden"]=new WeakMap,Bs.none=new WeakMap,Vl=new WeakSet,zl={})}}function Fy(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=dz(t[0]).body;return mz(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const n0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},lc=C.forwardRef(function(e,n){const[r,i]=C.useState();_t(()=>{lV()&&i("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[io("focus-guard")]:"",style:n0};return O.jsx("span",{...e,...s})}),gz={clipPath:"inset(50%)",position:"fixed",top:0,left:0},tk=C.createContext(null),Hy=io("portal");function bz(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Zw(),i=nk(),[s,o]=C.useState(null),a=C.useRef(null);return _t(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),_t(()=>{if(!r||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Hy,""),l.appendChild(u),a.current=u,o(u)},[e,r]),_t(()=>{if(n===null||!r||a.current)return;let l=n||i?.portalNode;l&&!Jm(l)&&(l=l.current),l=l||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,l.appendChild(u));const c=document.createElement("div");c.id=r,c.setAttribute(Hy,""),l=u||l,l.appendChild(c),a.current=c,o(c)},[e,n,r,i]),s}function TG(t){const{children:e,id:n,root:r,preserveTabOrder:i=!0}=t,s=bz({id:n,root:r}),[o,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),c=C.useRef(null),f=C.useRef(null),d=o?.modal,h=o?.open,p=!!o&&!o.modal&&o.open&&i&&!!(r||s);return C.useEffect(()=>{if(!s||!i||d)return;function g(b){s&&fa(b)&&(b.type==="focusin"?ky:CV)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,i,d]),C.useEffect(()=>{s&&(h||ky(s))},[h,s]),O.jsxs(tk.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:s,setFocusManagerState:a}),[i,s]),children:[p&&s&&O.jsx(lc,{"data-type":"outside",ref:l,onFocus:g=>{if(fa(g,s)){var b;(b=c.current)==null||b.focus()}else{const y=o?o.domReference:null,E=jw(y);E?.focus()}}}),p&&s&&O.jsx("span",{"aria-owns":s.id,style:gz}),s&&za.createPortal(e,s),p&&s&&O.jsx(lc,{"data-type":"outside",ref:u,onFocus:g=>{if(fa(g,s)){var b;(b=f.current)==null||b.focus()}else{const y=o?o.domReference:null,E=zw(y);E?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const nk=()=>C.useContext(tk);function Uy(t){return C.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const $y=20;let ti=[];function r0(){ti=ti.filter(t=>{var e;return(e=t.deref())==null?void 0:e.isConnected})}function yz(t){r0(),t&&gi(t)!=="body"&&(ti.push(new WeakRef(t)),ti.length>$y&&(ti=ti.slice(-$y)))}function Vy(){r0();const t=ti[ti.length-1];return t?.deref()}function Ez(t){const e=ll();return Uw(t,e)?t:nf(t,e)[0]||t}function zy(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=ll(),s=oV(t,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return Uw(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=t.getAttribute("tabindex");e.current.includes("floating")||s.length===0?o!=="0"&&t.setAttribute("tabindex","0"):(o!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}const Tz=C.forwardRef(function(e,n){return O.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:n0})});function CG(t){const{context:e,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:h=()=>[]}=t,{open:p,onOpenChange:g,events:b,dataRef:y,elements:{domReference:E,floating:T}}=e,v=Jt(()=>{var se;return(se=y.current.floatingContext)==null?void 0:se.nodeId}),_=Jt(h),k=typeof o=="number"&&o<0,M=xy(E)&&k,P=hz(),F=P?s:!0,N=!F||P&&d,U=Hn(i),j=Hn(o),V=Hn(a),I=sf(),L=nk(),Z=C.useRef(null),H=C.useRef(null),D=C.useRef(!1),z=C.useRef(!1),x=C.useRef(-1),ne=C.useRef(-1),G=L!=null,w=Sy(T),me=Jt(function(se){return se===void 0&&(se=w),se?nf(se,ll()):[]}),te=Jt(se=>{const ie=me(se);return U.current.map(de=>E&&de==="reference"?E:w&&de==="floating"?w:ie).filter(Boolean).flat()});C.useEffect(()=>{if(r||!u)return;function se(de){if(de.key==="Tab"){Gt(w,bs(Bt(w)))&&me().length===0&&!M&&Md(de);const Me=te(),Be=Gr(de);U.current[0]==="reference"&&Be===E&&(Md(de),de.shiftKey?us(Me[Me.length-1]):us(Me[1])),U.current[1]==="floating"&&Be===w&&de.shiftKey&&(Md(de),us(Me[0]))}}const ie=Bt(w);return ie.addEventListener("keydown",se),()=>{ie.removeEventListener("keydown",se)}},[r,E,w,u,U,M,me,te]),C.useEffect(()=>{if(r||!T)return;function se(ie){const de=Gr(ie),Be=me().indexOf(de);Be!==-1&&(x.current=Be)}return T.addEventListener("focusin",se),()=>{T.removeEventListener("focusin",se)}},[r,T,me]),C.useEffect(()=>{if(r||!f)return;function se(){z.current=!0,setTimeout(()=>{z.current=!1})}function ie(Be){const Ce=Be.relatedTarget,lt=Be.currentTarget,Pe=Gr(Be);queueMicrotask(()=>{const Qe=v(),Tn=!(Gt(E,Ce)||Gt(T,Ce)||Gt(Ce,T)||Gt(L?.portalNode,Ce)||Ce!=null&&Ce.hasAttribute(io("focus-guard"))||I&&(Ls(I.nodesRef.current,Qe).find(Cn=>{var an,xn;return Gt((an=Cn.context)==null?void 0:an.elements.floating,Ce)||Gt((xn=Cn.context)==null?void 0:xn.elements.domReference,Ce)})||wy(I.nodesRef.current,Qe).find(Cn=>{var an,xn,ts;return[(an=Cn.context)==null?void 0:an.elements.floating,Sy((xn=Cn.context)==null?void 0:xn.elements.floating)].includes(Ce)||((ts=Cn.context)==null?void 0:ts.elements.domReference)===Ce})));if(lt===E&&w&&zy(w,U),l&<!==E&&!(Pe!=null&&Pe.isConnected)&&bs(Bt(w))===Bt(w).body){At(w)&&w.focus();const Cn=x.current,an=me(),xn=an[Cn]||an[an.length-1]||w;At(xn)&&xn.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(M||!u)&&Ce&&Tn&&!z.current&&Ce!==Vy()&&(D.current=!0,g(!1,Be,"focus-out"))})}const de=!!(!I&&L);function Me(){Kt(ne),y.current.insideReactTree=!0,ne.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(T&&At(E))return E.addEventListener("focusout",ie),E.addEventListener("pointerdown",se),T.addEventListener("focusout",ie),de&&T.addEventListener("focusout",Me,!0),()=>{E.removeEventListener("focusout",ie),E.removeEventListener("pointerdown",se),T.removeEventListener("focusout",ie),de&&T.removeEventListener("focusout",Me,!0)}},[r,E,T,w,u,I,L,g,f,l,me,M,v,U,y]);const le=C.useRef(null),_e=C.useRef(null),ye=Uy([le,L?.beforeInsideRef]),ge=Uy([_e,L?.afterInsideRef]);C.useEffect(()=>{var se,ie;if(r||!T)return;const de=Array.from((L==null||(se=L.portalNode)==null?void 0:se.querySelectorAll("["+io("portal")+"]"))||[]),Be=(ie=(I?wy(I.nodesRef.current,v()):[]).find(Pe=>{var Qe;return xy(((Qe=Pe.context)==null?void 0:Qe.elements.domReference)||null)}))==null||(ie=ie.context)==null?void 0:ie.elements.domReference,Ce=[T,Be,...de,..._(),Z.current,H.current,le.current,_e.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,U.current.includes("reference")||M?E:null].filter(Pe=>Pe!=null),lt=u||M?Fy(Ce,!N,N):Fy(Ce);return()=>{lt()}},[r,E,T,u,U,L,M,F,N,I,v,_]),_t(()=>{if(r||!At(w))return;const se=Bt(w),ie=bs(se);queueMicrotask(()=>{const de=te(w),Me=j.current,Be=(typeof Me=="number"?de[Me]:Me.current)||w,Ce=Gt(w,ie);!k&&!Ce&&p&&us(Be,{preventScroll:Be===w})})},[r,p,w,k,te,j]),_t(()=>{if(r||!w)return;const se=Bt(w),ie=bs(se);yz(ie);function de(Ce){let{reason:lt,event:Pe,nested:Qe}=Ce;if(["hover","safe-polygon"].includes(lt)&&Pe.type==="mouseleave"&&(D.current=!0),lt==="outside-press")if(Qe)D.current=!1;else if(pV(Pe)||mV(Pe))D.current=!1;else{let Tn=!1;document.createElement("div").focus({get preventScroll(){return Tn=!0,!1}}),Tn?D.current=!1:D.current=!0}}b.on("openchange",de);const Me=se.createElement("span");Me.setAttribute("tabindex","-1"),Me.setAttribute("aria-hidden","true"),Object.assign(Me.style,n0),G&&E&&E.insertAdjacentElement("afterend",Me);function Be(){if(typeof V.current=="boolean"){const Ce=E||Vy();return Ce&&Ce.isConnected?Ce:Me}return V.current.current||Me}return()=>{b.off("openchange",de);const Ce=bs(se),lt=Gt(T,Ce)||I&&Ls(I.nodesRef.current,v(),!1).some(Qe=>{var Tn;return Gt((Tn=Qe.context)==null?void 0:Tn.elements.floating,Ce)}),Pe=Be();queueMicrotask(()=>{const Qe=Ez(Pe);V.current&&!D.current&&At(Qe)&&(!(Qe!==Ce&&Ce!==se.body)||lt)&&Qe.focus({preventScroll:!0}),Me.remove()})}},[r,T,w,V,y,b,I,G,E,v]),C.useEffect(()=>(queueMicrotask(()=>{D.current=!1}),()=>{queueMicrotask(r0)}),[r]),_t(()=>{if(!r&&L)return L.setFocusManagerState({modal:u,closeOnFocusOut:f,open:p,onOpenChange:g,domReference:E}),()=>{L.setFocusManagerState(null)}},[r,L,u,p,g,f,E]),_t(()=>{r||w&&zy(w,U)},[r,w,U]);function De(se){return r||!c||!u?null:O.jsx(Tz,{ref:se==="start"?Z:H,onClick:ie=>g(!1,ie.nativeEvent),children:typeof c=="string"?c:"Dismiss"})}const We=!r&&F&&(u?!M:!0)&&(G||u);return O.jsxs(O.Fragment,{children:[We&&O.jsx(lc,{"data-type":"inside",ref:ye,onFocus:se=>{if(u){const de=te();us(i[0]==="reference"?de[0]:de[de.length-1])}else if(L!=null&&L.preserveTabOrder&&L.portalNode)if(D.current=!1,fa(se,L.portalNode)){const de=zw(E);de?.focus()}else{var ie;(ie=L.beforeOutsideRef.current)==null||ie.focus()}}}),!M&&De("start"),n,De("end"),We&&O.jsx(lc,{"data-type":"inside",ref:ge,onFocus:se=>{if(u)us(te()[0]);else if(L!=null&&L.preserveTabOrder&&L.portalNode)if(f&&(D.current=!0),fa(se,L.portalNode)){const de=jw(E);de?.focus()}else{var ie;(ie=L.afterOutsideRef.current)==null||ie.focus()}}})]})}const Cz={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xz={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},jy=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function xG(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=t,{enabled:o=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:p}=e,g=sf(),b=Jt(typeof l=="function"?l:()=>!1),y=typeof l=="function"?b:l,E=C.useRef(!1),{escapeKey:T,outsidePress:v}=jy(h),{escapeKey:_,outsidePress:k}=jy(p),M=C.useRef(!1),P=Jt(I=>{var L;if(!n||!o||!a||I.key!=="Escape"||M.current)return;const Z=(L=s.current.floatingContext)==null?void 0:L.nodeId,H=g?Ls(g.nodesRef.current,Z):[];if(!T&&(I.stopPropagation(),H.length>0)){let D=!0;if(H.forEach(z=>{var x;if((x=z.context)!=null&&x.open&&!z.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}r(!1,hV(I)?I.nativeEvent:I,"escape-key")}),F=Jt(I=>{var L;const Z=()=>{var H;P(I),(H=Gr(I))==null||H.removeEventListener("keydown",Z)};(L=Gr(I))==null||L.addEventListener("keydown",Z)}),N=Jt(I=>{var L;const Z=s.current.insideReactTree;s.current.insideReactTree=!1;const H=E.current;if(E.current=!1,u==="click"&&H||Z||typeof y=="function"&&!y(I))return;const D=Gr(I),z="["+io("inert")+"]",x=Bt(i.floating).querySelectorAll(z);let ne=Ke(D)?D:null;for(;ne&&!Or(ne);){const te=Dr(ne);if(Or(te)||!Ke(te))break;ne=te}if(x.length&&Ke(D)&&!fV(D)&&!Gt(D,i.floating)&&Array.from(x).every(te=>!Gt(ne,te)))return;if(At(D)&&V){const te=Or(D),le=Dn(D),_e=/auto|scroll/,ye=te||_e.test(le.overflowX),ge=te||_e.test(le.overflowY),De=ye&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,We=ge&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,se=le.direction==="rtl",ie=We&&(se?I.offsetX<=D.offsetWidth-D.clientWidth:I.offsetX>D.clientWidth),de=De&&I.offsetY>D.clientHeight;if(ie||de)return}const G=(L=s.current.floatingContext)==null?void 0:L.nodeId,w=g&&Ls(g.nodesRef.current,G).some(te=>{var le;return Rd(I,(le=te.context)==null?void 0:le.elements.floating)});if(Rd(I,i.floating)||Rd(I,i.domReference)||w)return;const me=g?Ls(g.nodesRef.current,G):[];if(me.length>0){let te=!0;if(me.forEach(le=>{var _e;if((_e=le.context)!=null&&_e.open&&!le.context.dataRef.current.__outsidePressBubbles){te=!1;return}}),!te)return}r(!1,I,"outside-press")}),U=Jt(I=>{var L;const Z=()=>{var H;N(I),(H=Gr(I))==null||H.removeEventListener(u,Z)};(L=Gr(I))==null||L.addEventListener(u,Z)});C.useEffect(()=>{if(!n||!o)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=v;let I=-1;function L(x){r(!1,x,"ancestor-scroll")}function Z(){window.clearTimeout(I),M.current=!0}function H(){I=window.setTimeout(()=>{M.current=!1},ef()?5:0)}const D=Bt(i.floating);a&&(D.addEventListener("keydown",_?F:P,_),D.addEventListener("compositionstart",Z),D.addEventListener("compositionend",H)),y&&D.addEventListener(u,k?U:N,k);let z=[];return d&&(Ke(i.domReference)&&(z=ai(i.domReference)),Ke(i.floating)&&(z=z.concat(ai(i.floating))),!Ke(i.reference)&&i.reference&&i.reference.contextElement&&(z=z.concat(ai(i.reference.contextElement)))),z=z.filter(x=>{var ne;return x!==((ne=D.defaultView)==null?void 0:ne.visualViewport)}),z.forEach(x=>{x.addEventListener("scroll",L,{passive:!0})}),()=>{a&&(D.removeEventListener("keydown",_?F:P,_),D.removeEventListener("compositionstart",Z),D.removeEventListener("compositionend",H)),y&&D.removeEventListener(u,k?U:N,k),z.forEach(x=>{x.removeEventListener("scroll",L)}),window.clearTimeout(I)}},[s,i,a,y,u,n,r,d,o,T,v,P,_,F,N,k,U]),C.useEffect(()=>{s.current.insideReactTree=!1},[s,y,u]);const j=C.useMemo(()=>({onKeyDown:P,...c&&{[Cz[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[P,r,c,f]),V=C.useMemo(()=>{function I(L){L.button===0&&(E.current=!0)}return{onKeyDown:P,onMouseDown:I,onMouseUp:I,[xz[u]]:()=>{s.current.insideReactTree=!0}}},[P,u,s]);return C.useMemo(()=>o?{reference:j,floating:V}:{},[o,j,V])}function Sz(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=Zw(),s=C.useRef({}),[o]=C.useState(()=>lz()),a=Jw()!=null,[l,u]=C.useState(r.reference),c=Jt((h,p,g)=>{s.current.openEvent=h?p:void 0,o.emit("openchange",{open:h,event:p,reason:g,nested:a}),n?.(h,p,g)}),f=C.useMemo(()=>({setPositionReference:u}),[]),d=C.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return C.useMemo(()=>({dataRef:s,open:e,onOpenChange:c,elements:d,events:o,floatingId:i,refs:f}),[e,c,d,o,i,f])}function SG(t){t===void 0&&(t={});const{nodeId:e}=t,n=Sz({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[s,o]=C.useState(null),[a,l]=C.useState(null),c=i?.domReference||s,f=C.useRef(null),d=sf();_t(()=>{c&&(f.current=c)},[c]);const h=nz({...t,elements:{...i,...a&&{reference:a}}}),p=C.useCallback(T=>{const v=Ke(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;l(v),h.refs.setReference(v)},[h.refs]),g=C.useCallback(T=>{(Ke(T)||T===null)&&(f.current=T,o(T)),(Ke(h.refs.reference.current)||h.refs.reference.current===null||T!==null&&!Ke(T))&&h.refs.setReference(T)},[h.refs]),b=C.useMemo(()=>({...h.refs,setReference:g,setPositionReference:p,domReference:f}),[h.refs,g,p]),y=C.useMemo(()=>({...h.elements,domReference:c}),[h.elements,c]),E=C.useMemo(()=>({...h,...r,refs:b,elements:y,nodeId:e}),[h,b,y,e,r]);return _t(()=>{r.dataRef.current.floatingContext=E;const T=d?.nodesRef.current.find(v=>v.id===e);T&&(T.context=E)}),C.useMemo(()=>({...h,context:E,refs:b,elements:y}),[h,b,y,E])}function Hd(t,e,n){const r=new Map,i=n==="item";let s=t;if(i&&t){const{[Ry]:o,[My]:a,...l}=t;s=l}return{...n==="floating"&&{tabIndex:-1,[rz]:""},...s,...e.map(o=>{const a=o?o[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((o,a)=>(a&&Object.entries(a).forEach(l=>{let[u,c]=l;if(!(i&&[Ry,My].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),o[u]=function(){for(var d,h=arguments.length,p=new Array(h),g=0;g<h;g++)p[g]=arguments[g];return(d=r.get(u))==null?void 0:d.map(b=>b(...p)).find(b=>b!==void 0)}}}else o[u]=c}),o),{})}}function wG(t){t===void 0&&(t=[]);const e=t.map(a=>a?.reference),n=t.map(a=>a?.floating),r=t.map(a=>a?.item),i=C.useCallback(a=>Hd(a,t,"reference"),e),s=C.useCallback(a=>Hd(a,t,"floating"),n),o=C.useCallback(a=>Hd(a,t,"item"),r);return C.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}const Wy=t=>t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,n)=>(n?"-":"")+e.toLowerCase());function cs(t,e){return typeof t=="function"?t(e):t}function wz(t,e){const[n,r]=C.useState(t);return t&&!n&&r(!0),C.useEffect(()=>{if(!t&&n){const i=setTimeout(()=>r(!1),e);return()=>clearTimeout(i)}},[t,n,e]),n}function kz(t,e){e===void 0&&(e={});const{open:n,elements:{floating:r}}=t,{duration:i=250}=e,o=(typeof i=="number"?i:i.close)||0,[a,l]=C.useState("unmounted"),u=wz(n,o);return!u&&a==="close"&&l("unmounted"),_t(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{za.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:a}}function kG(t,e){e===void 0&&(e={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:o=250}=e,a=t.placement,l=a.split("-")[0],u=C.useMemo(()=>({side:l,placement:a}),[l,a]),c=typeof o=="number",f=(c?o:o.open)||0,d=(c?o:o.close)||0,[h,p]=C.useState(()=>({...cs(s,u),...cs(n,u)})),{isMounted:g,status:b}=kz(t,{duration:o}),y=Hn(n),E=Hn(r),T=Hn(i),v=Hn(s);return _t(()=>{const _=cs(y.current,u),k=cs(T.current,u),M=cs(v.current,u),P=cs(E.current,u)||Object.keys(_).reduce((F,N)=>(F[N]="",F),{});if(b==="initial"&&p(F=>({transitionProperty:F.transitionProperty,...M,..._})),b==="open"&&p({transitionProperty:Object.keys(P).map(Wy).join(","),transitionDuration:f+"ms",...M,...P}),b==="close"){const F=k||_;p({transitionProperty:Object.keys(F).map(Wy).join(","),transitionDuration:d+"ms",...M,...F})}},[d,T,y,E,v,f,b,u]),{isMounted:g,styles:h}}function rk(t,e,n){return n===void 0&&(n=!0),t.filter(i=>{var s;return i.parentId===e&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...rk(t,i.id,n)])}function qy(t,e){const[n,r]=t;let i=!1;const s=e.length;for(let o=0,a=s-1;o<s;a=o++){const[l,u]=e[o]||[0,0],[c,f]=e[a]||[0,0];u>=r!=f>=r&&n<=(c-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function Az(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function AG(t){t===void 0&&(t={});const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=t,i={current:-1};let s=!1,o=null,a=null,l=typeof performance<"u"?performance.now():0;function u(f,d){const h=performance.now(),p=h-l;if(o===null||a===null||p===0)return o=f,a=d,l=h,null;const g=f-o,b=d-a,E=Math.sqrt(g*g+b*b)/p;return o=f,a=d,l=h,E}const c=f=>{let{x:d,y:h,placement:p,elements:g,onClose:b,nodeId:y,tree:E}=f;return function(v){function _(){Kt(i),b()}if(Kt(i),!g.domReference||!g.floating||p==null||d==null||h==null)return;const{clientX:k,clientY:M}=v,P=[k,M],F=fz(v),N=v.type==="mouseleave",U=Bd(g.floating,F),j=Bd(g.domReference,F),V=g.domReference.getBoundingClientRect(),I=g.floating.getBoundingClientRect(),L=p.split("-")[0],Z=d>I.right-I.width/2,H=h>I.bottom-I.height/2,D=Az(P,V),z=I.width>V.width,x=I.height>V.height,ne=(z?V:I).left,G=(z?V:I).right,w=(x?V:I).top,me=(x?V:I).bottom;if(U&&(s=!0,!N))return;if(j&&(s=!1),j&&!N){s=!0;return}if(N&&Ke(v.relatedTarget)&&Bd(g.floating,v.relatedTarget)||E&&rk(E.nodesRef.current,y).length)return;if(L==="top"&&h>=V.bottom-1||L==="bottom"&&h<=V.top+1||L==="left"&&d>=V.right-1||L==="right"&&d<=V.left+1)return _();let te=[];switch(L){case"top":te=[[ne,V.top+1],[ne,I.bottom-1],[G,I.bottom-1],[G,V.top+1]];break;case"bottom":te=[[ne,I.top+1],[ne,V.bottom-1],[G,V.bottom-1],[G,I.top+1]];break;case"left":te=[[I.right-1,me],[I.right-1,w],[V.left+1,w],[V.left+1,me]];break;case"right":te=[[V.right-1,me],[V.right-1,w],[I.left+1,w],[I.left+1,me]];break}function le(_e){let[ye,ge]=_e;switch(L){case"top":{const De=[z?ye+e/2:Z?ye+e*4:ye-e*4,ge+e+1],We=[z?ye-e/2:Z?ye+e*4:ye-e*4,ge+e+1],se=[[I.left,Z||z?I.bottom-e:I.top],[I.right,Z?z?I.bottom-e:I.top:I.bottom-e]];return[De,We,...se]}case"bottom":{const De=[z?ye+e/2:Z?ye+e*4:ye-e*4,ge-e],We=[z?ye-e/2:Z?ye+e*4:ye-e*4,ge-e],se=[[I.left,Z||z?I.top+e:I.bottom],[I.right,Z?z?I.top+e:I.bottom:I.top+e]];return[De,We,...se]}case"left":{const De=[ye+e+1,x?ge+e/2:H?ge+e*4:ge-e*4],We=[ye+e+1,x?ge-e/2:H?ge+e*4:ge-e*4];return[...[[H||x?I.right-e:I.left,I.top],[H?x?I.right-e:I.left:I.right-e,I.bottom]],De,We]}case"right":{const De=[ye-e,x?ge+e/2:H?ge+e*4:ge-e*4],We=[ye-e,x?ge-e/2:H?ge+e*4:ge-e*4],se=[[H||x?I.left+e:I.right,I.top],[H?x?I.left+e:I.right:I.left+e,I.bottom]];return[De,We,...se]}}}if(!qy([k,M],te)){if(s&&!D)return _();if(!N&&r){const _e=u(v.clientX,v.clientY);if(_e!==null&&_e<.1)return _()}qy([k,M],le([d,h]))?!s&&r&&(i.current=window.setTimeout(_,40)):_()}}};return c.__options={blockPointerEvents:n},c}function vG(t,e=n=>n){return wA.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,vz)}function vz(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!e.has(r)||!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const n=Yy(t);if(n.length!==Yy(e).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(e,n[r])||!Object.is(t[n[r]],e[n[r]]))return!1;return!0}function Yy(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}var Ud,Ky;function _z(){return Ky||(Ky=1,Ud=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),Ud}var Nz=_z();const _G=yp(Nz);var ik={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Gy=St.createContext&&St.createContext(ik),Iz=["attr","size","title"];function Rz(t,e){if(t==null)return{};var n,r,i=Mz(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Mz(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function uc(){return uc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uc.apply(null,arguments)}function Xy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xy(Object(n),!0).forEach(function(r){Oz(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Oz(t,e,n){return(e=Dz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dz(t){var e=Lz(t,"string");return typeof e=="symbol"?e:e+""}function Lz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sk(t){return t&&t.map((e,n)=>St.createElement(e.tag,cc({key:n},e.attr),sk(e.child)))}function ue(t){return e=>St.createElement(Pz,uc({attr:cc({},t.attr)},e),sk(t.child))}function Pz(t){var e=n=>{var{attr:r,size:i,title:s}=t,o=Rz(t,Iz),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),St.createElement("svg",uc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:cc(cc({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&St.createElement("title",null,s),t.children)};return Gy!==void 0?St.createElement(Gy.Consumer,null,n=>e(n)):e(ik)}function NG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z"},child:[]}]})(t)}function IG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z"},child:[]}]})(t)}function RG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5 11V13H19V11H5Z"},child:[]}]})(t)}function MG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"},child:[]}]})(t)}function OG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z"},child:[]}]})(t)}function DG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z"},child:[]}]})(t)}function LG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z"},child:[]}]})(t)}function PG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z"},child:[]}]})(t)}function BG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"},child:[]}]})(t)}function FG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"},child:[]}]})(t)}function HG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"},child:[]}]})(t)}function UG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z"},child:[]}]})(t)}function $G(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z"},child:[]}]})(t)}function VG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z"},child:[]}]})(t)}function zG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"},child:[]}]})(t)}function jG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"},child:[]}]})(t)}function WG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z"},child:[]}]})(t)}function qG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13 6V21H11V6H5V4H19V6H13Z"},child:[]}]})(t)}function YG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"},child:[]}]})(t)}function KG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z"},child:[]}]})(t)}function GG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z"},child:[]}]})(t)}function XG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z"},child:[]}]})(t)}function QG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"},child:[]}]})(t)}function ZG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z"},child:[]}]})(t)}function JG(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z"},child:[]}]})(t)}function eX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z"},child:[]}]})(t)}function tX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z"},child:[]}]})(t)}function nX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z"},child:[]}]})(t)}function rX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z"},child:[]}]})(t)}function iX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z"},child:[]}]})(t)}function sX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z"},child:[]}]})(t)}function oX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z"},child:[]}]})(t)}function aX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z"},child:[]}]})(t)}function lX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z"},child:[]}]})(t)}function uX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z"},child:[]}]})(t)}function cX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z"},child:[]}]})(t)}function fX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z"},child:[]}]})(t)}function dX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z"},child:[]}]})(t)}function hX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z"},child:[]}]})(t)}function pX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z"},child:[]}]})(t)}function mX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z"},child:[]}]})(t)}function gX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z"},child:[]}]})(t)}function bX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"},child:[]}]})(t)}function yX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"},child:[]}]})(t)}function EX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"},child:[]}]})(t)}function TX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z"},child:[]}]})(t)}function CX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"},child:[]}]})(t)}function xX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z"},child:[]}]})(t)}function SX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z"},child:[]}]})(t)}function wX(t){return ue({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z"},child:[]}]})(t)}function kX(t){return ue({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(t)}function AX(t){return ue({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m7 10 5 5 5-5z"},child:[]}]})(t)}function vX(t){return ue({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"},child:[]}]})(t)}var Bz=kA(),Fz=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Hz=({contentComponent:t})=>{const e=Bz.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return O.jsx(O.Fragment,{children:Object.values(e)})};function Uz(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:NE.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var $z=class extends St.Component{constructor(t){super(t),this.editorContentRef=St.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=Uz(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return O.jsxs(O.Fragment,{children:[O.jsx("div",{ref:Fz(e,this.editorContentRef),...n}),t?.contentComponent&&O.jsx(Hz,{contentComponent:t.contentComponent})]})}},Vz=C.forwardRef((t,e)=>{const n=St.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return St.createElement($z,{key:n,innerRef:e,...t})}),zz=St.memo(Vz),ok=C.createContext({editor:null});ok.Consumer;var ak=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),jz=()=>C.useContext(ak),_X=St.forwardRef((t,e)=>{const{onDragStart:n}=jz(),r=t.as||"div";return O.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Qy(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Zy(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function Wz(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function qz(t){if(Qy(t)||Zy(t))return!0;if(Wz(t)){const e=t.type;if(e)return Qy(e)||Zy(e)}return!1}function Yz(){try{if(C.version)return parseInt(C.version.split(".")[0],10)>=19}catch{}return!1}var Kz=class{constructor(t,{editor:e,props:n={},as:r="div",className:i=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isEditorContentInitialized?za.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,n=this.props,r=this.editor,i=Yz(),s=qz(e),o={...n};o.ref&&!(i||s)&&delete o.ref,!o.ref&&(i||s)&&(o.ref=a=>{this.ref=a}),this.reactElement=O.jsx(e,{...o}),(t=r?.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1;const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];if(t[i]!==this.props[i]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e?.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};St.createContext({markViewContentRef:()=>{}});var Gz=class extends UI{constructor(t,e,n){if(super(t,e,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{const r=this.getPos();typeof r!="number"||r===this.currentPos||(this.currentPos=r,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const t=this.editor,e=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(e,{get(n,r,i){var s;return r==="storage"?(s=t.storage[e.name])!=null?s:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(u={})=>this.updateAttributes(u),deleteNode:()=>this.deleteNode(),ref:C.createRef()};if(!this.component.displayName){const u=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=u(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&(u.hasAttribute("data-node-view-wrapper")&&u.removeAttribute("data-node-view-wrapper"),u.appendChild(this.contentDOMElement))}},s=this.component,o=C.memo(u=>O.jsx(ak.Provider,{value:i,children:C.createElement(s,u)}));o.displayName="ReactNodeView";let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Kz(o,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var t;if(this.renderer.element.firstElementChild&&!((t=this.renderer.element.firstElementChild)!=null&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const t=this.currentPos;if(typeof t!="number")return;if(jN({selection:this.editor.state.selection,pos:t,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(t,e,n){const r=a=>{this.renderer.updateProps(a),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const a=this.node,l=this.decorations,u=this.innerDecorations;return this.node=t,this.decorations=e,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:a,oldDecorations:l,newNode:t,newDecorations:e,oldInnerDecorations:u,innerDecorations:n,updateProps:()=>r({node:t,decorations:e,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(!(t!==this.node))return this.node=t,this.decorations=e,this.innerDecorations=n,!0;const s=this.getPos();this.node=t,this.decorations=e,this.innerDecorations=n,this.currentPos=s;const o={node:t,decorations:e,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(o.getPos=()=>this.getPos()),r(o),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,n=xa(this.node,e);t=this.options.attrs({node:this.node,HTMLAttributes:n})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}};function NX(t,e){return n=>n.editor.contentComponent?new Gz(t,n,e):{}}var i0=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});i0.displayName="TiptapContext";var Xz=()=>C.useContext(i0);function lk({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=C.useMemo(()=>({editor:r}),[r]),s=C.useMemo(()=>({editor:r}),[r]);return O.jsx(ok.Provider,{value:s,children:O.jsx(i0.Provider,{value:i,children:n})})}lk.displayName="Tiptap";function uk({...t}){const{editor:e}=Xz();return O.jsx(zz,{editor:e,...t})}uk.displayName="Tiptap.Content";Object.assign(lk,{Content:uk});function ar(t){return Object.keys(t)}function $d(t){return t&&typeof t=="object"&&!Array.isArray(t)}function s0(t,e){const n={...t},r=e;return $d(t)&&$d(e)&&Object.keys(e).forEach(i=>{$d(r[i])&&i in t?n[i]=s0(n[i],r[i]):n[i]=r[i]}),n}function Qz(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Zz(t){return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:t.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Jz(t){const e=Zz(t);return typeof e=="number"?e:typeof e=="string"?e.includes("calc")||e.includes("var")?e:e.includes("px")?Number(e.replace("px","")):e.includes("rem")?Number(e.replace("rem",""))*16:e.includes("em")?Number(e.replace("em",""))*16:Number(e):NaN}function Jy(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function ck(t,{shouldScale:e=!1}={}){function n(r){if(r===0||r==="0")return`0${t}`;if(typeof r=="number"){const i=`${r/16}${t}`;return e?Jy(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${t}`;return e?Jy(s):s}}return r}return n}const Y=ck("rem",{shouldScale:!0}),eE=ck("em");function of(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function fk(t){if(typeof t=="number")return!0;if(typeof t=="string"){if(t.startsWith("calc(")||t.startsWith("var(")||t.includes(" ")&&t.trim()!=="")return!0;const e=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return t.trim().split(/\s+/).every(r=>e.test(r))}return!1}function dk(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==C.Fragment:!1}function af(t){const e=C.createContext(null);return[({children:i,value:s})=>O.jsx(e.Provider,{value:s,children:i}),()=>{const i=C.useContext(e);if(i===null)throw new Error(t);return i}]}function lf(t=null){const e=C.createContext(t);return[({children:i,value:s})=>O.jsx(e.Provider,{value:s,children:i}),()=>C.useContext(e)]}function tE(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function fc(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function ej(t,e,n){for(let r=t-1;r>=0;r-=1)if(!e[r].disabled)return r;if(n){for(let r=e.length-1;r>-1;r-=1)if(!e[r].disabled)return r}return t}function tj(t,e,n){for(let r=t+1;r<e.length;r+=1)if(!e[r].disabled)return r;if(n){for(let r=0;r<e.length;r+=1)if(!e[r].disabled)return r}return t}function nj(t,e,n){return fc(t,n)===fc(e,n)}function o0({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:o}){return a=>{n?.(a);const l=Array.from(fc(a.currentTarget,t)?.querySelectorAll(e)||[]).filter(p=>nj(a.currentTarget,p,t)),u=l.findIndex(p=>a.currentTarget===p),c=tj(u,l,r),f=ej(u,l,r),d=s==="rtl"?f:c,h=s==="rtl"?c:f;switch(a.key){case"ArrowRight":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[d].focus(),i&&l[d].click());break}case"ArrowLeft":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[h].focus(),i&&l[h].click());break}case"ArrowUp":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[f].focus(),i&&l[f].click());break}case"ArrowDown":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[c].focus(),i&&l[c].click());break}case"Home":{a.stopPropagation(),a.preventDefault(),!l[0].disabled&&l[0].focus();break}case"End":{a.stopPropagation(),a.preventDefault();const p=l.length-1;!l[p].disabled&&l[p].focus();break}}}}const rj={app:100,modal:200,popover:300,overlay:400,max:9999};function ul(t){return rj[t]}const ij=()=>{};function sj(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||ij:n=>{n.key==="Escape"&&(t(n),e.onTrigger?.())}}function ze(t,e="size",n=!0){if(t!==void 0)return fk(t)?n?Y(t):t:`var(--${e}-${t})`}function cl(t){return ze(t,"mantine-spacing")}function Dt(t){return t===void 0?"var(--mantine-radius-default)":ze(t,"mantine-radius")}function rn(t){return ze(t,"mantine-font-size")}function oj(t){return ze(t,"mantine-line-height",!1)}function hk(t){if(t)return ze(t,"mantine-shadow",!1)}function en(t,e){return n=>{t?.(n),e?.(n)}}function aj(t,e,n){return n?Array.from(fc(n,e)?.querySelectorAll(t)||[]).findIndex(r=>r===n):null}function lj(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function nE(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>((...n)=>e.current?.(...n)),[])}const uj=["mousedown","touchstart"];function cj(t,e,n){const r=C.useRef(null),i=e||uj;return C.useEffect(()=>{const s=o=>{const{target:a}=o??{};if(Array.isArray(n)){const l=!document.body.contains(a)&&a?.tagName!=="HTML";n.every(c=>!!c&&!o.composedPath().includes(c))&&!l&&t(o)}else r.current&&!r.current.contains(a)&&t(o)};return i.forEach(o=>document.addEventListener(o,s)),()=>{i.forEach(o=>document.removeEventListener(o,s))}},[r,t,n]),r}function fj(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function dj(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function hj(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=C.useState(n?e:dj(t));return C.useEffect(()=>{try{const s=window.matchMedia(t);return i(s.matches),fj(s,o=>i(o.matches))}catch{return}},[t]),r||!1}const fl=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Ha(t,e){const n=C.useRef(!1);C.useEffect(()=>()=>{n.current=!1},[]),C.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function pj({opened:t,shouldReturnFocus:e=!0}){const n=C.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return Ha(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),t?n.current=document.activeElement:e&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[t,e]),r}const mj=/input|select|textarea|button|object/,pk="a, input, select, textarea, button, object, [tabindex]";function gj(t){return t.style.display==="none"}function bj(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let n=t;for(;n&&!(n===document.body||n.nodeType===11);){if(gj(n))return!1;n=n.parentNode}return!0}function mk(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function fp(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(mk(t));return(mj.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&bj(t)}function gk(t){const e=mk(t);return(Number.isNaN(e)||e>=0)&&fp(t)}function yj(t){return Array.from(t.querySelectorAll(pk)).filter(gk)}function Ej(t,e){const n=yj(t);if(!n.length){e.preventDefault();return}const r=n[e.shiftKey?0:n.length-1],i=t.getRootNode();let s=r===i.activeElement||t===i.activeElement;const o=i.activeElement;if(o.tagName==="INPUT"&&o.getAttribute("type")==="radio"&&(s=n.filter(c=>c.getAttribute("type")==="radio"&&c.getAttribute("name")===o.getAttribute("name")).includes(r)),!s)return;e.preventDefault();const l=n[e.shiftKey?n.length-1:0];l&&l.focus()}function Tj(t=!0){const e=C.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const o=Array.from(i.querySelectorAll(pk));s=o.find(gk)||o.find(fp)||null,!s&&fp(i)&&(s=i)}s&&s.focus({preventScroll:!0})},r=C.useCallback(i=>{t&&i!==null&&e.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),e.current=i):e.current=null)},[t]);return C.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>n(e.current));const i=s=>{s.key==="Tab"&&e.current&&Ej(e.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),r}const Cj=St.useId||(()=>{});function xj(){const t=Cj();return t?`mantine-${t.replace(/:/g,"")}`:""}function xo(t){const e=xj(),[n,r]=C.useState(e);return fl(()=>{r(lj())},[]),typeof t=="string"?t:typeof window>"u"?e:n}function dc(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function Sj(...t){const e=new Map;return n=>{if(t.forEach(r=>{const i=dc(r,n);i&&e.set(r,i)}),e.size>0)return()=>{t.forEach(r=>{const i=e.get(r);i&&typeof i=="function"?i():dc(r,null)}),e.clear()}}}function Qn(...t){return C.useCallback(Sj(...t),t)}function So({value:t,defaultValue:e,finalValue:n,onChange:r=()=>{}}){const[i,s]=C.useState(e!==void 0?e:n),o=(a,...l)=>{s(a),r?.(a,...l)};return t!==void 0?[t,r,!0]:[i,o,!1]}function wj(t,e){return hj("(prefers-reduced-motion: reduce)",t,e)}function IX(){const[t,e]=C.useState(!1),n=C.useRef(null),r=C.useCallback(()=>{e(!0)},[]),i=C.useCallback(()=>{e(!1)},[]);return{ref:C.useCallback(o=>{n.current&&(n.current.removeEventListener("mouseenter",r),n.current.removeEventListener("mouseleave",i)),o&&(o.addEventListener("mouseenter",r),o.addEventListener("mouseleave",i)),n.current=o},[r,i]),hovered:t}}function kj(t=!1,e={}){const[n,r]=C.useState(t),i=C.useCallback(()=>{r(a=>a||(e.onOpen?.(),!0))},[e.onOpen]),s=C.useCallback(()=>{r(a=>a&&(e.onClose?.(),!1))},[e.onClose]),o=C.useCallback(()=>{n?s():i()},[s,i,n]);return[n,{open:i,close:s,toggle:o}]}function Aj(t){return t.currentTarget instanceof HTMLElement&&t.relatedTarget instanceof HTMLElement?t.currentTarget.contains(t.relatedTarget):!1}function RX({onBlur:t,onFocus:e}={}){const[n,r]=C.useState(!1),i=C.useRef(!1),s=C.useRef(null),o=nE(e),a=nE(t),l=C.useCallback(d=>{r(d),i.current=d},[]),u=C.useCallback(d=>{i.current||(l(!0),o(d))},[]),c=C.useCallback(d=>{i.current&&!Aj(d)&&(l(!1),a(d))},[]),f=C.useCallback(d=>{d&&(s.current&&(s.current.removeEventListener("focusin",u),s.current.removeEventListener("focusout",c)),d.addEventListener("focusin",u),d.addEventListener("focusout",c),s.current=d)},[u,c]);return C.useEffect(()=>()=>{s.current&&(s.current.removeEventListener("focusin",u),s.current.removeEventListener("focusout",c))},[]),{ref:f,focused:n}}function a0(t){const e=St.version;return typeof St.version!="string"||e.startsWith("18.")?t?.ref:t?.props?.ref}function dl(t){const e=C.Children.toArray(t);return e.length!==1||!dk(e[0])?null:e[0]}const vj={};function _j(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([r,i])=>{e[r]?e[r]=Pr(e[r],i):e[r]=i})}),e}function uf({theme:t,classNames:e,props:n,stylesCtx:r}){const s=(Array.isArray(e)?e:[e]).map(o=>typeof o=="function"?o(t,n,r):o||vj);return _j(s)}function hc({theme:t,styles:e,props:n,stylesCtx:r}){return(Array.isArray(e)?e:[e]).reduce((s,o)=>typeof o=="function"?{...s,...o(t,n,r)}:{...s,...o},{})}const bk=C.createContext(null);function bi(){const t=C.useContext(bk);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function Nj(){return bi().cssVariablesResolver}function Ij(){return bi().classNamesPrefix}function l0(){return bi().getStyleNonce}function Rj(){return bi().withStaticClasses}function Mj(){return bi().headless}function Oj(){return bi().stylesTransform?.sx}function Dj(){return bi().stylesTransform?.styles}function cf(){return bi().env||"default"}function Lj(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function Pj(t){let e=t.replace("#","");if(e.length===3){const o=e.split("");e=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}if(e.length===8){const o=parseInt(e.slice(6,8),16)/255;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:o}}const n=parseInt(e,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function Bj(t){const[e,n,r,i]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:r,a:i===void 0?1:i}}function Fj(t){const e=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=t.match(e);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,o=n[5]?parseFloat(n[5]):void 0,a=(1-Math.abs(2*s-1))*i,l=r/60,u=a*(1-Math.abs(l%2-1)),c=s-a/2;let f,d,h;return l>=0&&l<1?(f=a,d=u,h=0):l>=1&&l<2?(f=u,d=a,h=0):l>=2&&l<3?(f=0,d=a,h=u):l>=3&&l<4?(f=0,d=u,h=a):l>=4&&l<5?(f=u,d=0,h=a):(f=a,d=0,h=u),{r:Math.round((f+c)*255),g:Math.round((d+c)*255),b:Math.round((h+c)*255),a:o||1}}function u0(t){return Lj(t)?Pj(t):t.startsWith("rgb")?Bj(t):t.startsWith("hsl")?Fj(t):{r:0,g:0,b:0,a:1}}function jl(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:r,b:i,a:s}=u0(t),o=1-e,a=l=>Math.round(l*o);return`rgba(${a(n)}, ${a(r)}, ${a(i)}, ${s})`}function Ua(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function Vd(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Hj(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function Uj(t){if(t.startsWith("oklch("))return(Hj(t)||0)/100;const{r:e,g:n,b:r}=u0(t),i=e/255,s=n/255,o=r/255,a=Vd(i),l=Vd(s),u=Vd(o);return .2126*a+.7152*l+.0722*u}function Uo(t,e=.179){return t.startsWith("var(")?!1:Uj(t)>e}function es({color:t,theme:e,colorScheme:n}){if(typeof t!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof t}`);if(t==="bright")return{color:t,value:n==="dark"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Uo(n==="dark"?e.white:e.black,e.luminanceThreshold),variable:"--mantine-color-bright"};if(t==="dimmed")return{color:t,value:n==="dark"?e.colors.dark[2]:e.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Uo(n==="dark"?e.colors.dark[2]:e.colors.gray[6],e.luminanceThreshold),variable:"--mantine-color-dimmed"};if(t==="white"||t==="black")return{color:t,value:t==="white"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Uo(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[r,i]=t.split("."),s=i?Number(i):void 0,o=r in e.colors;if(o){const a=s!==void 0?e.colors[r][s]:e.colors[r][Ua(e,n||"light")];return{color:r,value:a,shade:s,isThemeColor:o,isLight:Uo(a,e.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:t,value:t,isThemeColor:o,isLight:Uo(t,e.luminanceThreshold),shade:s,variable:void 0}}function Lr(t,e){const n=es({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function dp(t,e){const n={from:t?.from||e.defaultGradient.from,to:t?.to||e.defaultGradient.to,deg:t?.deg??e.defaultGradient.deg??0},r=Lr(n.from,e),i=Lr(n.to,e);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function tr(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var(")){const s=(1-e)*100;return`color-mix(in srgb, ${t}, transparent ${s}%)`}if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:r,b:i}=u0(t);return`rgba(${n}, ${r}, ${i}, ${e})`}const fs=tr,$j=({color:t,theme:e,variant:n,gradient:r,autoContrast:i})=>{const s=es({color:t,theme:e}),o=typeof i=="boolean"?i:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const a=o&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${t}-filled)`,hover:`var(--mantine-color-${t}-filled-hover)`,color:a,border:`${Y(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:a,border:`${Y(1)} solid transparent`}:{background:t,hover:jl(t,.1),color:a,border:`${Y(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${t}-light)`,hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Y(1)} solid transparent`};const a=e.colors[s.color][s.shade];return{background:tr(a,.1),hover:tr(a,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Y(1)} solid transparent`}}return{background:tr(t,.1),hover:tr(t,.12),color:t,border:`${Y(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${t}-outline-hover)`,color:`var(--mantine-color-${t}-outline)`,border:`${Y(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:tr(e.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${Y(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:tr(t,.05),color:t,border:`${Y(1)} solid ${t}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Y(1)} solid transparent`};const a=e.colors[s.color][s.shade];return{background:"transparent",hover:tr(a,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Y(1)} solid transparent`}}return{background:"transparent",hover:tr(t,.12),color:t,border:`${Y(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${Y(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Y(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${Y(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:jl(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${Y(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:jl(e.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${Y(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:jl(e.white,.01),color:t,border:`${Y(1)} solid transparent`}:n==="gradient"?{background:dp(r,e),hover:dp(r,e),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${Y(1)} solid var(--mantine-color-default-border)`}:{}},Vj={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},rE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",c0={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:Vj,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:$j,autoContrast:!1,luminanceThreshold:.3,fontFamily:rE,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:rE,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:Y(34),lineHeight:"1.3"},h2:{fontSize:Y(26),lineHeight:"1.35"},h3:{fontSize:Y(22),lineHeight:"1.4"},h4:{fontSize:Y(18),lineHeight:"1.45"},h5:{fontSize:Y(16),lineHeight:"1.5"},h6:{fontSize:Y(14),lineHeight:"1.5"}}},fontSizes:{xs:Y(12),sm:Y(14),md:Y(16),lg:Y(18),xl:Y(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:Y(2),sm:Y(4),md:Y(8),lg:Y(16),xl:Y(32)},spacing:{xs:Y(10),sm:Y(12),md:Y(16),lg:Y(20),xl:Y(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${Y(1)} ${Y(3)} rgba(0, 0, 0, 0.05), 0 ${Y(1)} ${Y(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${Y(1)} ${Y(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Y(10)} ${Y(15)} ${Y(-5)}, rgba(0, 0, 0, 0.04) 0 ${Y(7)} ${Y(7)} ${Y(-5)}`,md:`0 ${Y(1)} ${Y(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Y(20)} ${Y(25)} ${Y(-5)}, rgba(0, 0, 0, 0.04) 0 ${Y(10)} ${Y(10)} ${Y(-5)}`,lg:`0 ${Y(1)} ${Y(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Y(28)} ${Y(23)} ${Y(-7)}, rgba(0, 0, 0, 0.04) 0 ${Y(12)} ${Y(12)} ${Y(-7)}`,xl:`0 ${Y(1)} ${Y(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Y(36)} ${Y(28)} ${Y(-7)}, rgba(0, 0, 0, 0.04) 0 ${Y(17)} ${Y(17)} ${Y(-7)}`},other:{},components:{}};function iE(t){return t==="auto"||t==="dark"||t==="light"}function zj({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(t);return iE(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{e=r=>{r.storageArea===window.localStorage&&r.key===t&&iE(r.newValue)&&n(r.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}const jj="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",sE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function zd(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function oE(t){if(!(t.primaryColor in t.colors))throw new Error(jj);if(typeof t.primaryShade=="object"&&(!zd(t.primaryShade.dark)||!zd(t.primaryShade.light)))throw new Error(sE);if(typeof t.primaryShade=="number"&&!zd(t.primaryShade))throw new Error(sE)}function Wj(t,e){if(!e)return oE(t),t;const n=s0(t,e);return e.fontFamily&&!e.headings?.fontFamily&&(n.headings.fontFamily=e.fontFamily),oE(n),n}const f0=C.createContext(null),qj=()=>C.useContext(f0)||c0;function on(){const t=C.useContext(f0);if(!t)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return t}function yk({theme:t,children:e,inherit:n=!0}){const r=qj(),i=C.useMemo(()=>Wj(n?r:c0,t),[t,r,n]);return O.jsx(f0.Provider,{value:i,children:e})}yk.displayName="@mantine/core/MantineThemeProvider";function Yj(){const t=on(),e=l0(),n=ar(t.breakpoints).reduce((r,i)=>{const s=t.breakpoints[i].includes("px"),o=Jz(t.breakpoints[i]),a=s?`${o-.1}px`:eE(o-.1),l=s?`${o}px`:eE(o);return`${r}@media (max-width: ${a}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${l}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return O.jsx("style",{"data-mantine-styles":"classes",nonce:e?.(),dangerouslySetInnerHTML:{__html:n}})}function jd(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function Ek(t,e){const n=e?[e]:[":root",":host"],r=jd(t.variables),i=r?`${n.join(", ")}{${r}}`:"",s=jd(t.dark),o=jd(t.light),a=c=>n.map(f=>f===":host"?`${f}([data-mantine-color-scheme="${c}"])`:`${f}[data-mantine-color-scheme="${c}"]`).join(", "),l=s?`${a("dark")}{${s}}`:"",u=o?`${a("light")}{${o}}`:"";return`${i}
|
|
165
|
+
|
|
166
|
+
${l}
|
|
167
|
+
|
|
168
|
+
${u}`}function Tk({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&es({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function aE(t,e){return Tk({color:t.colors[t.primaryColor][Ua(t,e)],theme:t,autoContrast:null})}function Wl({theme:t,color:e,colorScheme:n,name:r=e,withColorValues:i=!0}){if(!t.colors[e])return{};if(n==="light"){const a=Ua(t,"light"),l={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:fs(t.colors[e][a],.1),[`--mantine-color-${r}-light-hover`]:fs(t.colors[e][a],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-outline-hover`]:fs(t.colors[e][a],.05)};return i?{[`--mantine-color-${r}-0`]:t.colors[e][0],[`--mantine-color-${r}-1`]:t.colors[e][1],[`--mantine-color-${r}-2`]:t.colors[e][2],[`--mantine-color-${r}-3`]:t.colors[e][3],[`--mantine-color-${r}-4`]:t.colors[e][4],[`--mantine-color-${r}-5`]:t.colors[e][5],[`--mantine-color-${r}-6`]:t.colors[e][6],[`--mantine-color-${r}-7`]:t.colors[e][7],[`--mantine-color-${r}-8`]:t.colors[e][8],[`--mantine-color-${r}-9`]:t.colors[e][9],...l}:l}const s=Ua(t,"dark"),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:fs(t.colors[e][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:fs(t.colors[e][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:fs(t.colors[e][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:t.colors[e][0],[`--mantine-color-${r}-1`]:t.colors[e][1],[`--mantine-color-${r}-2`]:t.colors[e][2],[`--mantine-color-${r}-3`]:t.colors[e][3],[`--mantine-color-${r}-4`]:t.colors[e][4],[`--mantine-color-${r}-5`]:t.colors[e][5],[`--mantine-color-${r}-6`]:t.colors[e][6],[`--mantine-color-${r}-7`]:t.colors[e][7],[`--mantine-color-${r}-8`]:t.colors[e][8],[`--mantine-color-${r}-9`]:t.colors[e][9],...o}:o}function Kj(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function ds(t,e,n){ar(e).forEach(r=>Object.assign(t,{[`--mantine-${n}-${r}`]:e[r]}))}const Ck=t=>{const e=Ua(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:Y(t.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":t.scale.toString(),"--mantine-cursor-type":t.cursorType,"--mantine-webkit-font-smoothing":t.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":t.fontSmoothing?"grayscale":"unset","--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-line-height":t.lineHeights.md,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":t.headings.fontWeight,"--mantine-heading-text-wrap":t.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${t.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${t.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${t.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${t.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${t.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":aE(t,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":t.black,"--mantine-color-body":t.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-${e})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":aE(t,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};ds(r.variables,t.breakpoints,"breakpoint"),ds(r.variables,t.spacing,"spacing"),ds(r.variables,t.fontSizes,"font-size"),ds(r.variables,t.lineHeights,"line-height"),ds(r.variables,t.shadows,"shadow"),ds(r.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((s,o)=>{r.variables[`--mantine-primary-color-${o}`]=`var(--mantine-color-${t.primaryColor}-${o})`}),ar(t.colors).forEach(s=>{const o=t.colors[s];if(Kj(o)){Object.assign(r.light,Wl({theme:t,name:o.name,color:o.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Wl({theme:t,name:o.name,color:o.dark,colorScheme:"dark",withColorValues:!0}));return}o.forEach((a,l)=>{r.variables[`--mantine-color-${s}-${l}`]=a}),Object.assign(r.light,Wl({theme:t,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Wl({theme:t,color:s,colorScheme:"dark",withColorValues:!1}))});const i=t.headings.sizes;return ar(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||t.headings.fontWeight}),r};function Gj({theme:t,generator:e}){const n=Ck(t),r=e?.(t);return r?s0(n,r):n}const Wd=Ck(c0);function Xj(t){const e={variables:{},light:{},dark:{}};return ar(t.variables).forEach(n=>{Wd.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),ar(t.light).forEach(n=>{Wd.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),ar(t.dark).forEach(n=>{Wd.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function Qj(t){return Ek({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},t)}function xk({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=on(),r=l0(),i=Nj(),s=Gj({theme:n,generator:i}),o=(t===void 0||t===":root"||t===":host")&&e,a=o?Xj(s):s,l=Ek(a,t);return l?O.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${l}${o?"":Qj(t)}`}}):null}xk.displayName="@mantine/CssVariables";function hs(t,e){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=t!=="auto"?t:n?"dark":"light";e()?.setAttribute("data-mantine-color-scheme",r)}function Zj({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:r}){const i=C.useRef(null),[s,o]=C.useState(()=>t.get(e)),a=r||s,l=C.useCallback(c=>{r||(hs(c,n),o(c),t.set(c))},[t.set,a,r]),u=C.useCallback(()=>{o(e),hs(e,n),t.clear()},[t.clear,e]);return C.useEffect(()=>(t.subscribe(l),t.unsubscribe),[t.subscribe,t.unsubscribe]),fl(()=>{hs(t.get(e),n)},[]),C.useEffect(()=>{if(r)return hs(r,n),()=>{};r===void 0&&hs(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const c=f=>{s==="auto"&&hs(f.matches?"dark":"light",n)};return i.current?.addEventListener("change",c),()=>i.current?.removeEventListener("change",c)},[s,r]),{colorScheme:a,setColorScheme:l,clearColorScheme:u}}function Jj({respectReducedMotion:t,getRootElement:e}){fl(()=>{t&&e()?.setAttribute("data-respect-reduced-motion","true")},[t])}function eW({theme:t,children:e,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:o=!0,cssVariablesSelector:a,classNamesPrefix:l="mantine",colorSchemeManager:u=zj(),defaultColorScheme:c="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:d,forceColorScheme:h,stylesTransform:p,env:g}){const{colorScheme:b,setColorScheme:y,clearColorScheme:E}=Zj({defaultColorScheme:c,forceColorScheme:h,manager:u,getRootElement:f});return Jj({respectReducedMotion:t?.respectReducedMotion||!1,getRootElement:f}),O.jsx(bk.Provider,{value:{colorScheme:b,setColorScheme:y,clearColorScheme:E,getRootElement:f,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:d,cssVariablesSelector:a??":root",withStaticClasses:r,stylesTransform:p,env:g},children:O.jsxs(yk,{theme:t,children:[o&&O.jsx(xk,{cssVariablesSelector:a,deduplicateCssVariables:s}),i&&O.jsx(Yj,{}),e]})})}eW.displayName="@mantine/core/MantineProvider";function ff({classNames:t,styles:e,props:n,stylesCtx:r}){const i=on();return{resolvedClassNames:uf({theme:i,classNames:t,props:n,stylesCtx:r||void 0}),resolvedStyles:hc({theme:i,styles:e,props:n,stylesCtx:r||void 0})}}const tW={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function nW({theme:t,options:e,unstyled:n}){return Pr(e?.focusable&&!n&&(t.focusClassName||tW[t.focusRing]),e?.active&&!n&&t.activeClassName)}function rW({selector:t,stylesCtx:e,options:n,props:r,theme:i}){return uf({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:e})[t]}function lE({selector:t,stylesCtx:e,theme:n,classNames:r,props:i}){return uf({theme:n,classNames:r,props:i,stylesCtx:e})[t]}function iW({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function sW({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function oW({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:r}){return r===!1?[]:t.map(i=>`${e}-${i}-${n}`)}function aW({themeName:t,theme:e,selector:n,props:r,stylesCtx:i}){return t.map(s=>uf({theme:e,classNames:e.components[s]?.classNames,props:r,stylesCtx:i})?.[n])}function lW({options:t,classes:e,selector:n,unstyled:r}){return t?.variant&&!r?e[`${n}--${t.variant}`]:void 0}function uW({theme:t,options:e,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:o,unstyled:a,className:l,rootSelector:u,props:c,stylesCtx:f,withStaticClasses:d,headless:h,transformedStyles:p}){return Pr(nW({theme:t,options:e,unstyled:a||h}),aW({theme:t,themeName:n,selector:r,props:c,stylesCtx:f}),lW({options:e,classes:o,selector:r,unstyled:a}),lE({selector:r,stylesCtx:f,theme:t,classNames:s,props:c}),lE({selector:r,stylesCtx:f,theme:t,classNames:p,props:c}),rW({selector:r,stylesCtx:f,options:e,props:c,theme:t}),iW({rootSelector:u,selector:r,className:l}),sW({selector:r,classes:o,unstyled:a||h}),d&&!h&&oW({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:e?.withStaticClass}),e?.className)}function cW({theme:t,themeName:e,props:n,stylesCtx:r,selector:i}){return e.map(s=>hc({theme:t,styles:t.components[s]?.styles,props:n,stylesCtx:r})[i]).reduce((s,o)=>({...s,...o}),{})}function hp({style:t,theme:e}){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...hp({style:r,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function fW(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(r=>{e[r]={...e[r],...of(n[r])}}),e),{})}function dW({vars:t,varsResolver:e,theme:n,props:r,stylesCtx:i,selector:s,themeName:o,headless:a}){return fW([a?{}:e?.(n,r,i),...o.map(l=>n.components?.[l]?.vars?.(n,r,i)),t?.(n,r,i)])?.[s]}function hW({theme:t,themeName:e,selector:n,options:r,props:i,stylesCtx:s,rootSelector:o,styles:a,style:l,vars:u,varsResolver:c,headless:f,withStylesTransform:d}){return{...!d&&cW({theme:t,themeName:e,props:i,stylesCtx:s,selector:n}),...!d&&hc({theme:t,styles:a,props:i,stylesCtx:s})[n],...!d&&hc({theme:t,styles:r?.styles,props:r?.props||i,stylesCtx:s})[n],...dW({theme:t,props:i,stylesCtx:s,vars:u,varsResolver:c,selector:n,themeName:e,headless:f}),...o===n?hp({style:l,theme:t}):null,...hp({style:r?.style,theme:t})}}function pW({props:t,stylesCtx:e,themeName:n}){const r=on(),i=Dj()?.();return{getTransformedStyles:o=>i?[...o.map(l=>i(l,{props:t,theme:r,ctx:e})),...n.map(l=>i(r.components[l]?.styles,{props:t,theme:r,ctx:e}))].filter(Boolean):[],withStylesTransform:!!i}}function Ne({name:t,classes:e,props:n,stylesCtx:r,className:i,style:s,rootSelector:o="root",unstyled:a,classNames:l,styles:u,vars:c,varsResolver:f,attributes:d}){const h=on(),p=Ij(),g=Rj(),b=Mj(),y=(Array.isArray(t)?t:[t]).filter(v=>v),{withStylesTransform:E,getTransformedStyles:T}=pW({props:n,stylesCtx:r,themeName:y});return(v,_)=>({className:uW({theme:h,options:_,themeName:y,selector:v,classNamesPrefix:p,classNames:l,classes:e,unstyled:a,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:g,headless:b,transformedStyles:T([_?.styles,u])}),style:hW({theme:h,themeName:y,selector:v,options:_,props:n,stylesCtx:r,rootSelector:o,styles:u,style:s,vars:c,varsResolver:f,headless:b,withStylesTransform:E}),...d?.[v]})}function mW(t,e){return typeof t=="boolean"?t:e.autoContrast}function re(t,e,n){const r=on(),i=r.components[t]?.defaultProps,s=typeof i=="function"?i(r):i;return{...e,...s,...of(n)}}function qd(t){return ar(t).reduce((e,n)=>t[n]!==void 0?`${e}${Qz(n)}:${t[n]};`:e,"").trim()}function gW({selector:t,styles:e,media:n,container:r}){const i=e?qd(e):"",s=Array.isArray(n)?n.map(a=>`@media${a.query}{${t}{${qd(a.styles)}}}`):[],o=Array.isArray(r)?r.map(a=>`@container ${a.query}{${t}{${qd(a.styles)}}}`):[];return`${i?`${t}{${i}}`:""}${s.join("")}${o.join("")}`.trim()}function Sk(t){const e=l0();return O.jsx("style",{"data-mantine-styles":"inline",nonce:e?.(),dangerouslySetInnerHTML:{__html:gW(t)}})}function df(t){const{m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:a,me:l,ms:u,p:c,px:f,py:d,pt:h,pb:p,pl:g,pr:b,pe:y,ps:E,bd:T,bdrs:v,bg:_,c:k,opacity:M,ff:P,fz:F,fw:N,lts:U,ta:j,lh:V,fs:I,tt:L,td:Z,w:H,miw:D,maw:z,h:x,mih:ne,mah:G,bgsz:w,bgp:me,bgr:te,bga:le,pos:_e,top:ye,left:ge,bottom:De,right:We,inset:se,display:ie,flex:de,hiddenFrom:Me,visibleFrom:Be,lightHidden:Ce,darkHidden:lt,sx:Pe,...Qe}=t;return{styleProps:of({m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:a,me:l,ms:u,p:c,px:f,py:d,pt:h,pb:p,pl:g,pr:b,pe:y,ps:E,bd:T,bg:_,c:k,opacity:M,ff:P,fz:F,fw:N,lts:U,ta:j,lh:V,fs:I,tt:L,td:Z,w:H,miw:D,maw:z,h:x,mih:ne,mah:G,bgsz:w,bgp:me,bgr:te,bga:le,pos:_e,top:ye,left:ge,bottom:De,right:We,inset:se,display:ie,flex:de,bdrs:v,hiddenFrom:Me,visibleFrom:Be,lightHidden:Ce,darkHidden:lt,sx:Pe}),rest:Qe}}const bW={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function d0(t,e){const n=es({color:t,theme:e});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function yW(t,e){const n=es({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:d0(t,e)}function EW(t,e){if(typeof t=="number")return Y(t);if(typeof t=="string"){const[n,r,...i]=t.split(" ").filter(o=>o.trim()!=="");let s=`${Y(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${d0(i.join(" "),e)}`),s.trim()}return t}const uE={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function TW(t){return typeof t=="string"&&t in uE?uE[t]:t}const CW=["h1","h2","h3","h4","h5","h6"];function xW(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&CW.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?Y(t):t}function SW(t){return t}const wW=["h1","h2","h3","h4","h5","h6"];function kW(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&wW.includes(t)?`var(--mantine-${t}-line-height)`:t}function AW(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?Y(t):t}function vW(t){return typeof t=="number"?Y(t):t}function _W(t,e){if(typeof t=="number")return Y(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return Y(t);const r=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return t}const Yd={color:d0,textColor:yW,fontSize:xW,spacing:_W,radius:AW,identity:SW,size:vW,lineHeight:kW,fontFamily:TW,border:EW};function cE(t){return t.replace("(min-width: ","").replace("em)","")}function NW({media:t,...e}){const r=Object.keys(t).sort((i,s)=>Number(cE(i))-Number(cE(s))).map(i=>({query:i,styles:t[i]}));return{...e,media:r}}function IW(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function RW(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function MW(t){return typeof t=="object"&&t!==null?ar(t).filter(e=>e!=="base"):[]}function OW(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function wk({styleProps:t,data:e,theme:n}){return NW(ar(t).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=e[i],o=Array.isArray(s.property)?s.property:[s.property],a=RW(t[i]);if(!IW(t[i]))return o.forEach(u=>{r.inlineStyles[u]=Yd[s.type](a,n)}),r;r.hasResponsiveStyles=!0;const l=MW(t[i]);return o.forEach(u=>{a!=null&&(r.styles[u]=Yd[s.type](a,n)),l.forEach(c=>{const f=`(min-width: ${n.breakpoints[c]})`;r.media[f]={...r.media[f],[u]:Yd[s.type](OW(t[i],c),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function kk(){return`__m__-${C.useId().replace(/[:«»]/g,"")}`}function Ak(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...Ak(r,e)}),{}):typeof t=="function"?t(e):t??{}}function vk(t){return t.startsWith("data-")?t:`data-${t}`}function DW(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return r===void 0||r===""||r===!1||r===null||(e[vk(n)]=t[n]),e},{})}function _k(t){return t?typeof t=="string"?{[vk(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,..._k(n)}),{}):DW(t):null}function pp(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...pp(r,e)}),{}):typeof t=="function"?t(e):t??{}}function LW({theme:t,style:e,vars:n,styleProps:r}){const i=pp(e,t),s=pp(n,t);return{...i,...s,...r}}const Nk=C.forwardRef(({component:t,style:e,__vars:n,className:r,variant:i,mod:s,size:o,hiddenFrom:a,visibleFrom:l,lightHidden:u,darkHidden:c,renderRoot:f,__size:d,...h},p)=>{const g=on(),b=t||"div",{styleProps:y,rest:E}=df(h),v=Oj()?.()?.(y.sx),_=kk(),k=wk({styleProps:y,theme:g,data:bW}),M={ref:p,style:LW({theme:g,style:e,vars:n,styleProps:k.inlineStyles}),className:Pr(r,v,{[_]:k.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":c,[`mantine-hidden-from-${a}`]:a,[`mantine-visible-from-${l}`]:l}),"data-variant":i,"data-size":fk(o)?void 0:o||void 0,size:d,..._k(s),...E};return O.jsxs(O.Fragment,{children:[k.hasResponsiveStyles&&O.jsx(Sk,{selector:`.${_}`,styles:k.styles,media:k.media}),typeof f=="function"?f(M):O.jsx(b,{...M})]})});Nk.displayName="@mantine/core/Box";const pe=Nk;function Ik(t){return t}function PW(t){const e=t;return n=>{const r=C.forwardRef((i,s)=>O.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r}}function Ie(t){const e=C.forwardRef(t);return e.extend=Ik,e.withProps=n=>{const r=C.forwardRef((i,s)=>O.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e}function Lt(t){const e=C.forwardRef(t);return e.withProps=n=>{const r=C.forwardRef((i,s)=>O.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e.extend=Ik,e}const BW=C.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function wo(){return C.useContext(BW)}function hf(){return typeof window<"u"}function Rk(t){return Mk(t)?(t.nodeName||"").toLowerCase():"#document"}function ko(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function FW(t){var e;return(e=(Mk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Mk(t){return hf()?t instanceof Node||t instanceof ko(t).Node:!1}function Xt(t){return hf()?t instanceof Element||t instanceof ko(t).Element:!1}function h0(t){return hf()?t instanceof HTMLElement||t instanceof ko(t).HTMLElement:!1}function mp(t){return!hf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ko(t).ShadowRoot}function HW(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const UW=new Set(["html","body","#document"]);function Kd(t){return UW.has(Rk(t))}function $W(t){return ko(t).getComputedStyle(t)}function VW(t){if(Rk(t)==="html")return t;const e=t.assignedSlot||t.parentNode||mp(t)&&t.host||FW(t);return mp(e)?e.host:e}function zW(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function jW(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function WW(){return/apple/i.test(navigator.vendor)}function qW(){return zW().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function YW(){return jW().includes("jsdom/")}const fE="data-floating-ui-focusable",KW="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function dE(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function $a(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&mp(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function ys(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Gd(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function GW(t){return t.matches("html,body")}function _i(t){return t?.ownerDocument||document}function XW(t){return h0(t)&&t.matches(KW)}function QW(t){if(!t||YW())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function ZW(t){return t?t.hasAttribute(fE)?t:t.querySelector("["+fE+"]")||t:null}function hu(t,e,n){return n===void 0&&(n=!0),t.filter(i=>{var s;return i.parentId===e&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...hu(t,i.id,n)])}function JW(t){return"nativeEvent"in t}function gp(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var eq=typeof document<"u",tq=function(){},lr=eq?C.useLayoutEffect:tq;const nq={...mc};function ql(t){const e=C.useRef(t);return lr(()=>{e.current=t}),e}const rq=nq.useInsertionEffect,iq=rq||(t=>t());function rr(t){const e=C.useRef(()=>{});return iq(()=>{e.current=t}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}const sq="data-floating-ui-focusable",hE="active",pE="selected",oq={...mc};let mE=!1,aq=0;const gE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+aq++;function lq(){const[t,e]=C.useState(()=>mE?gE():void 0);return lr(()=>{t==null&&e(gE())},[]),C.useEffect(()=>{mE=!0},[]),t}const uq=oq.useId,Ok=uq||lq;function cq(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const fq=C.createContext(null),dq=C.createContext(null),p0=()=>{var t;return((t=C.useContext(fq))==null?void 0:t.id)||null},m0=()=>C.useContext(dq);function g0(t){return"data-floating-ui-"+t}function Sn(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const bE=g0("safe-polygon");function pu(t,e,n){if(n&&!gp(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const r=t();return typeof r=="number"?r:r?.[e]}return t?.[e]}function Xd(t){return typeof t=="function"?t():t}function hq(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:o}=t,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:c=!1,restMs:f=0,move:d=!0}=e,h=m0(),p=p0(),g=ql(u),b=ql(l),y=ql(n),E=ql(f),T=C.useRef(),v=C.useRef(-1),_=C.useRef(),k=C.useRef(-1),M=C.useRef(!0),P=C.useRef(!1),F=C.useRef(()=>{}),N=C.useRef(!1),U=rr(()=>{var H;const D=(H=i.current.openEvent)==null?void 0:H.type;return D?.includes("mouse")&&D!=="mousedown"});C.useEffect(()=>{if(!a)return;function H(D){let{open:z}=D;z||(Sn(v),Sn(k),M.current=!0,N.current=!1)}return s.on("openchange",H),()=>{s.off("openchange",H)}},[a,s]),C.useEffect(()=>{if(!a||!g.current||!n)return;function H(z){U()&&r(!1,z,"hover")}const D=_i(o.floating).documentElement;return D.addEventListener("mouseleave",H),()=>{D.removeEventListener("mouseleave",H)}},[o.floating,n,r,a,g,U]);const j=C.useCallback(function(H,D,z){D===void 0&&(D=!0),z===void 0&&(z="hover");const x=pu(b.current,"close",T.current);x&&!_.current?(Sn(v),v.current=window.setTimeout(()=>r(!1,H,z),x)):D&&(Sn(v),r(!1,H,z))},[b,r]),V=rr(()=>{F.current(),_.current=void 0}),I=rr(()=>{if(P.current){const H=_i(o.floating).body;H.style.pointerEvents="",H.removeAttribute(bE),P.current=!1}}),L=rr(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);C.useEffect(()=>{if(!a)return;function H(G){if(Sn(v),M.current=!1,c&&!gp(T.current)||Xd(E.current)>0&&!pu(b.current,"open"))return;const w=pu(b.current,"open",T.current);w?v.current=window.setTimeout(()=>{y.current||r(!0,G,"hover")},w):n||r(!0,G,"hover")}function D(G){if(L()){I();return}F.current();const w=_i(o.floating);if(Sn(k),N.current=!1,g.current&&i.current.floatingContext){n||Sn(v),_.current=g.current({...i.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){I(),V(),L()||j(G,!0,"safe-polygon")}});const te=_.current;w.addEventListener("mousemove",te),F.current=()=>{w.removeEventListener("mousemove",te)};return}(T.current!=="touch"||!$a(o.floating,G.relatedTarget))&&j(G)}function z(G){L()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){I(),V(),L()||j(G)}})(G))}function x(){Sn(v)}function ne(G){L()||j(G,!1)}if(Xt(o.domReference)){const G=o.domReference,w=o.floating;return n&&G.addEventListener("mouseleave",z),d&&G.addEventListener("mousemove",H,{once:!0}),G.addEventListener("mouseenter",H),G.addEventListener("mouseleave",D),w&&(w.addEventListener("mouseleave",z),w.addEventListener("mouseenter",x),w.addEventListener("mouseleave",ne)),()=>{n&&G.removeEventListener("mouseleave",z),d&&G.removeEventListener("mousemove",H),G.removeEventListener("mouseenter",H),G.removeEventListener("mouseleave",D),w&&(w.removeEventListener("mouseleave",z),w.removeEventListener("mouseenter",x),w.removeEventListener("mouseleave",ne))}}},[o,a,t,c,d,j,V,I,r,n,y,h,b,g,i,L,E]),lr(()=>{var H;if(a&&n&&(H=g.current)!=null&&(H=H.__options)!=null&&H.blockPointerEvents&&U()){P.current=!0;const z=o.floating;if(Xt(o.domReference)&&z){var D;const x=_i(o.floating).body;x.setAttribute(bE,"");const ne=o.domReference,G=h==null||(D=h.nodesRef.current.find(w=>w.id===p))==null||(D=D.context)==null?void 0:D.elements.floating;return G&&(G.style.pointerEvents=""),x.style.pointerEvents="none",ne.style.pointerEvents="auto",z.style.pointerEvents="auto",()=>{x.style.pointerEvents="",ne.style.pointerEvents="",z.style.pointerEvents=""}}}},[a,n,p,o,h,g,U]),lr(()=>{n||(T.current=void 0,N.current=!1,V(),I())},[n,V,I]),C.useEffect(()=>()=>{V(),Sn(v),Sn(k),I()},[a,o.domReference,V,I]);const Z=C.useMemo(()=>{function H(D){T.current=D.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(D){const{nativeEvent:z}=D;function x(){!M.current&&!y.current&&r(!0,z,"hover")}c&&!gp(T.current)||n||Xd(E.current)===0||N.current&&D.movementX**2+D.movementY**2<2||(Sn(k),T.current==="touch"?x():(N.current=!0,k.current=window.setTimeout(x,Xd(E.current))))}}},[c,r,n,y,E]);return C.useMemo(()=>a?{reference:Z}:{},[a,Z])}const bp=()=>{},Dk=C.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:bp,setState:bp,isInstantPhase:!1}),pq=()=>C.useContext(Dk);function mq(t){const{children:e,delay:n,timeoutMs:r=0}=t,[i,s]=C.useReducer((l,u)=>({...l,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=C.useRef(null),a=C.useCallback(l=>{s({currentId:l})},[]);return lr(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),O.jsx(Dk.Provider,{value:C.useMemo(()=>({...i,setState:s,setCurrentId:a}),[i,a]),children:e})}function gq(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,floatingId:i}=t,{id:s,enabled:o=!0}=e,a=s??i,l=pq(),{currentId:u,setCurrentId:c,initialDelay:f,setState:d,timeoutMs:h}=l;return lr(()=>{o&&u&&(d({delay:{open:1,close:pu(f,"close")}}),u!==a&&r(!1))},[o,a,r,d,u,f]),lr(()=>{function p(){r(!1),d({delay:f,currentId:null})}if(o&&u&&!n&&u===a){if(h){const g=window.setTimeout(p,h);return()=>{clearTimeout(g)}}p()}},[o,n,d,u,a,r,f,h]),lr(()=>{o&&(c===bp||!n||c(a))},[o,n,c,a]),l}const bq={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},yq={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},yE=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function Eq(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=t,{enabled:o=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:p}=e,g=m0(),b=rr(typeof l=="function"?l:()=>!1),y=typeof l=="function"?b:l,E=C.useRef(!1),{escapeKey:T,outsidePress:v}=yE(h),{escapeKey:_,outsidePress:k}=yE(p),M=C.useRef(!1),P=rr(I=>{var L;if(!n||!o||!a||I.key!=="Escape"||M.current)return;const Z=(L=s.current.floatingContext)==null?void 0:L.nodeId,H=g?hu(g.nodesRef.current,Z):[];if(!T&&(I.stopPropagation(),H.length>0)){let D=!0;if(H.forEach(z=>{var x;if((x=z.context)!=null&&x.open&&!z.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}r(!1,JW(I)?I.nativeEvent:I,"escape-key")}),F=rr(I=>{var L;const Z=()=>{var H;P(I),(H=ys(I))==null||H.removeEventListener("keydown",Z)};(L=ys(I))==null||L.addEventListener("keydown",Z)}),N=rr(I=>{var L;const Z=s.current.insideReactTree;s.current.insideReactTree=!1;const H=E.current;if(E.current=!1,u==="click"&&H||Z||typeof y=="function"&&!y(I))return;const D=ys(I),z="["+g0("inert")+"]",x=_i(i.floating).querySelectorAll(z);let ne=Xt(D)?D:null;for(;ne&&!Kd(ne);){const te=VW(ne);if(Kd(te)||!Xt(te))break;ne=te}if(x.length&&Xt(D)&&!GW(D)&&!$a(D,i.floating)&&Array.from(x).every(te=>!$a(ne,te)))return;if(h0(D)&&V){const te=Kd(D),le=$W(D),_e=/auto|scroll/,ye=te||_e.test(le.overflowX),ge=te||_e.test(le.overflowY),De=ye&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,We=ge&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,se=le.direction==="rtl",ie=We&&(se?I.offsetX<=D.offsetWidth-D.clientWidth:I.offsetX>D.clientWidth),de=De&&I.offsetY>D.clientHeight;if(ie||de)return}const G=(L=s.current.floatingContext)==null?void 0:L.nodeId,w=g&&hu(g.nodesRef.current,G).some(te=>{var le;return Gd(I,(le=te.context)==null?void 0:le.elements.floating)});if(Gd(I,i.floating)||Gd(I,i.domReference)||w)return;const me=g?hu(g.nodesRef.current,G):[];if(me.length>0){let te=!0;if(me.forEach(le=>{var _e;if((_e=le.context)!=null&&_e.open&&!le.context.dataRef.current.__outsidePressBubbles){te=!1;return}}),!te)return}r(!1,I,"outside-press")}),U=rr(I=>{var L;const Z=()=>{var H;N(I),(H=ys(I))==null||H.removeEventListener(u,Z)};(L=ys(I))==null||L.addEventListener(u,Z)});C.useEffect(()=>{if(!n||!o)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=v;let I=-1;function L(x){r(!1,x,"ancestor-scroll")}function Z(){window.clearTimeout(I),M.current=!0}function H(){I=window.setTimeout(()=>{M.current=!1},HW()?5:0)}const D=_i(i.floating);a&&(D.addEventListener("keydown",_?F:P,_),D.addEventListener("compositionstart",Z),D.addEventListener("compositionend",H)),y&&D.addEventListener(u,k?U:N,k);let z=[];return d&&(Xt(i.domReference)&&(z=Kl(i.domReference)),Xt(i.floating)&&(z=z.concat(Kl(i.floating))),!Xt(i.reference)&&i.reference&&i.reference.contextElement&&(z=z.concat(Kl(i.reference.contextElement)))),z=z.filter(x=>{var ne;return x!==((ne=D.defaultView)==null?void 0:ne.visualViewport)}),z.forEach(x=>{x.addEventListener("scroll",L,{passive:!0})}),()=>{a&&(D.removeEventListener("keydown",_?F:P,_),D.removeEventListener("compositionstart",Z),D.removeEventListener("compositionend",H)),y&&D.removeEventListener(u,k?U:N,k),z.forEach(x=>{x.removeEventListener("scroll",L)}),window.clearTimeout(I)}},[s,i,a,y,u,n,r,d,o,T,v,P,_,F,N,k,U]),C.useEffect(()=>{s.current.insideReactTree=!1},[s,y,u]);const j=C.useMemo(()=>({onKeyDown:P,...c&&{[bq[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[P,r,c,f]),V=C.useMemo(()=>({onKeyDown:P,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[yq[u]]:()=>{s.current.insideReactTree=!0}}),[P,u,s]);return C.useMemo(()=>o?{reference:j,floating:V}:{},[o,j,V])}function Tq(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=Ok(),s=C.useRef({}),[o]=C.useState(()=>cq()),a=p0()!=null,[l,u]=C.useState(r.reference),c=rr((h,p,g)=>{s.current.openEvent=h?p:void 0,o.emit("openchange",{open:h,event:p,reason:g,nested:a}),n?.(h,p,g)}),f=C.useMemo(()=>({setPositionReference:u}),[]),d=C.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return C.useMemo(()=>({dataRef:s,open:e,onOpenChange:c,elements:d,events:o,floatingId:i,refs:f}),[e,c,d,o,i,f])}function b0(t){t===void 0&&(t={});const{nodeId:e}=t,n=Tq({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[s,o]=C.useState(null),[a,l]=C.useState(null),c=i?.domReference||s,f=C.useRef(null),d=m0();lr(()=>{c&&(f.current=c)},[c]);const h=AA({...t,elements:{...i,...a&&{reference:a}}}),p=C.useCallback(T=>{const v=Xt(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;l(v),h.refs.setReference(v)},[h.refs]),g=C.useCallback(T=>{(Xt(T)||T===null)&&(f.current=T,o(T)),(Xt(h.refs.reference.current)||h.refs.reference.current===null||T!==null&&!Xt(T))&&h.refs.setReference(T)},[h.refs]),b=C.useMemo(()=>({...h.refs,setReference:g,setPositionReference:p,domReference:f}),[h.refs,g,p]),y=C.useMemo(()=>({...h.elements,domReference:c}),[h.elements,c]),E=C.useMemo(()=>({...h,...r,refs:b,elements:y,nodeId:e}),[h,b,y,e,r]);return lr(()=>{r.dataRef.current.floatingContext=E;const T=d?.nodesRef.current.find(v=>v.id===e);T&&(T.context=E)}),C.useMemo(()=>({...h,context:E,refs:b,elements:y}),[h,b,y,E])}function Qd(){return qW()&&WW()}function Cq(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:o}=t,{enabled:a=!0,visibleOnly:l=!0}=e,u=C.useRef(!1),c=C.useRef(-1),f=C.useRef(!0);C.useEffect(()=>{if(!a)return;const h=ko(o.domReference);function p(){!n&&h0(o.domReference)&&o.domReference===dE(_i(o.domReference))&&(u.current=!0)}function g(){f.current=!0}function b(){f.current=!1}return h.addEventListener("blur",p),Qd()&&(h.addEventListener("keydown",g,!0),h.addEventListener("pointerdown",b,!0)),()=>{h.removeEventListener("blur",p),Qd()&&(h.removeEventListener("keydown",g,!0),h.removeEventListener("pointerdown",b,!0))}},[o.domReference,n,a]),C.useEffect(()=>{if(!a)return;function h(p){let{reason:g}=p;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return i.on("openchange",h),()=>{i.off("openchange",h)}},[i,a]),C.useEffect(()=>()=>{Sn(c)},[]);const d=C.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const p=ys(h.nativeEvent);if(l&&Xt(p)){if(Qd()&&!h.relatedTarget){if(!f.current&&!XW(p))return}else if(!QW(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const p=h.relatedTarget,g=h.nativeEvent,b=Xt(p)&&p.hasAttribute(g0("focus-guard"))&&p.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var y;const E=dE(o.domReference?o.domReference.ownerDocument:document);!p&&E===o.domReference||$a((y=s.current.floatingContext)==null?void 0:y.refs.floating.current,E)||$a(o.domReference,E)||b||r(!1,g,"focus")})}}),[s,o.domReference,r,l]);return C.useMemo(()=>a?{reference:d}:{},[a,d])}function Zd(t,e,n){const r=new Map,i=n==="item";let s=t;if(i&&t){const{[hE]:o,[pE]:a,...l}=t;s=l}return{...n==="floating"&&{tabIndex:-1,[sq]:""},...s,...e.map(o=>{const a=o?o[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((o,a)=>(a&&Object.entries(a).forEach(l=>{let[u,c]=l;if(!(i&&[hE,pE].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),o[u]=function(){for(var d,h=arguments.length,p=new Array(h),g=0;g<h;g++)p[g]=arguments[g];return(d=r.get(u))==null?void 0:d.map(b=>b(...p)).find(b=>b!==void 0)}}}else o[u]=c}),o),{})}}function xq(t){t===void 0&&(t=[]);const e=t.map(a=>a?.reference),n=t.map(a=>a?.floating),r=t.map(a=>a?.item),i=C.useCallback(a=>Zd(a,t,"reference"),e),s=C.useCallback(a=>Zd(a,t,"floating"),n),o=C.useCallback(a=>Zd(a,t,"item"),r);return C.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}const Sq=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function wq(t,e){var n,r;e===void 0&&(e={});const{open:i,elements:s,floatingId:o}=t,{enabled:a=!0,role:l="dialog"}=e,u=Ok(),c=((n=s.domReference)==null?void 0:n.id)||u,f=C.useMemo(()=>{var E;return((E=ZW(s.floating))==null?void 0:E.id)||o},[s.floating,o]),d=(r=Sq.get(l))!=null?r:l,p=p0()!=null,g=C.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":i?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:c},...d==="menu"&&p&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,p,i,c,l]),b=C.useMemo(()=>{const E={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?E:{...E,...d==="menu"&&{"aria-labelledby":c}}},[d,f,c,l]),y=C.useCallback(E=>{let{active:T,selected:v}=E;const _={role:"option",...T&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{..._,"aria-selected":v}}return{}},[f,l]);return C.useMemo(()=>a?{reference:g,floating:b,item:y}:{},[a,g,b,y])}var Lk={root:"m_87cf2631"};const kq={__staticSelector:"UnstyledButton"},yi=Lt((t,e)=>{const n=re("UnstyledButton",kq,t),{className:r,component:i="button",__staticSelector:s,unstyled:o,classNames:a,styles:l,style:u,attributes:c,...f}=n,d=Ne({name:s,props:n,classes:Lk,className:r,style:u,classNames:a,styles:l,unstyled:o,attributes:c});return O.jsx(pe,{...d("root",{focusable:!0}),component:i,ref:e,type:i==="button"?"button":void 0,...f})});yi.classes=Lk;yi.displayName="@mantine/core/UnstyledButton";var Pk={root:"m_515a97f8"};const y0=Ie((t,e)=>{const n=re("VisuallyHidden",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,attributes:u,...c}=n,f=Ne({name:"VisuallyHidden",classes:Pk,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:u});return O.jsx(pe,{component:"span",ref:e,...f("root"),...c})});y0.classes=Pk;y0.displayName="@mantine/core/VisuallyHidden";var Bk={root:"m_1b7284a3"};const Aq=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:Dt(e),"--paper-shadow":hk(n)}}),E0=Lt((t,e)=>{const n=re("Paper",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,withBorder:l,vars:u,radius:c,shadow:f,variant:d,mod:h,attributes:p,...g}=n,b=Ne({name:"Paper",props:n,classes:Bk,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:p,vars:u,varsResolver:Aq});return O.jsx(pe,{ref:e,mod:[{"data-with-border":l},h],...b("root"),variant:d,...g})});E0.classes=Bk;E0.displayName="@mantine/core/Paper";function EE(t,e,n,r){return t==="center"||r==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function TE(t,e,n,r,i){return t==="center"||r==="center"?{left:e}:t==="end"?{[i==="ltr"?"right":"left"]:n}:t==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const vq={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function _q({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:o,dir:a}){const[l,u="center"]=t.split("-"),c={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[vq[l]]:r},f=-e/2;return l==="left"?{...c,...EE(u,o,n,i),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:l==="right"?{...c,...EE(u,o,n,i),left:f,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:l==="top"?{...c,...TE(u,s,n,i,a),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:l==="bottom"?{...c,...TE(u,s,n,i,a),top:f,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const pc=C.forwardRef(({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:o,arrowY:a,style:l,...u},c)=>{const{dir:f}=wo();return s?O.jsx("div",{...u,ref:c,style:{...l,..._q({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:f,arrowX:o,arrowY:a})}}):null});pc.displayName="@mantine/core/FloatingArrow";function Fk(t,e){if(t==="rtl"&&(e.includes("right")||e.includes("left"))){const[n,r]=e.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return e}var Hk={root:"m_9814e45f"};const Nq={zIndex:ul("modal")},Iq=(t,{gradient:e,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:o})=>({root:{"--overlay-bg":e||(n!==void 0||r!==void 0)&&tr(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${Y(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Dt(s),"--overlay-z-index":o?.toString()}}),Va=Lt((t,e)=>{const n=re("Overlay",Nq,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,fixed:u,center:c,children:f,radius:d,zIndex:h,gradient:p,blur:g,color:b,backgroundOpacity:y,mod:E,attributes:T,...v}=n,_=Ne({name:"Overlay",props:n,classes:Hk,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:T,vars:l,varsResolver:Iq});return O.jsx(pe,{ref:e,..._("root"),mod:[{center:c,fixed:u},E],...v,children:f})});Va.classes=Hk;Va.displayName="@mantine/core/Overlay";function Jd(t){const e=document.createElement("div");return e.setAttribute("data-portal","true"),typeof t.className=="string"&&e.classList.add(...t.className.split(" ").filter(Boolean)),typeof t.style=="object"&&Object.assign(e.style,t.style),typeof t.id=="string"&&e.setAttribute("id",t.id),e}function Rq({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||Jd(n):t;if(e){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Jd(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Jd(n)}const Mq={reuseTargetNode:!0},Uk=Ie((t,e)=>{const{children:n,target:r,reuseTargetNode:i,...s}=re("Portal",Mq,t),[o,a]=C.useState(!1),l=C.useRef(null);return fl(()=>(a(!0),l.current=Rq({target:r,reuseTargetNode:i,...s}),dc(e,l.current),!r&&!i&&l.current&&document.body.appendChild(l.current),()=>{!r&&!i&&l.current&&document.body.removeChild(l.current)}),[r]),!o||!l.current?null:za.createPortal(O.jsx(O.Fragment,{children:n}),l.current)});Uk.displayName="@mantine/core/Portal";const so=Ie(({withinPortal:t=!0,children:e,...n},r)=>cf()==="test"||!t?O.jsx(O.Fragment,{children:e}):O.jsx(Uk,{ref:r,...n,children:e}));so.displayName="@mantine/core/OptionalPortal";const $o=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Yl={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...$o("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...$o("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...$o("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...$o("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...$o("top"),common:{transformOrigin:"top right"}}},CE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function Oq({transition:t,state:e,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof t=="string"?t in Yl?{transitionProperty:Yl[t].transitionProperty,...i,...Yl[t].common,...Yl[t][CE[e]]}:{}:{transitionProperty:t.transitionProperty,...i,...t.common,...t[CE[e]]}}function Dq({duration:t,exitDuration:e,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:a,enterDelay:l,exitDelay:u}){const c=on(),f=wj(),d=c.respectReducedMotion?f:!1,[h,p]=C.useState(d?0:t),[g,b]=C.useState(r?"entered":"exited"),y=C.useRef(-1),E=C.useRef(-1),T=C.useRef(-1);function v(){window.clearTimeout(y.current),window.clearTimeout(E.current),cancelAnimationFrame(T.current)}const _=M=>{v();const P=M?i:s,F=M?o:a,N=d?0:M?t:e;p(N),N===0?(typeof P=="function"&&P(),typeof F=="function"&&F(),b(M?"entered":"exited")):T.current=requestAnimationFrame(()=>{NE.flushSync(()=>{b(M?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof P=="function"&&P(),b(M?"entering":"exiting"),y.current=window.setTimeout(()=>{typeof F=="function"&&F(),b(M?"entered":"exited")},N)})})},k=M=>{if(v(),typeof(M?l:u)!="number"){_(M);return}E.current=window.setTimeout(()=>{_(M)},M?l:u)};return Ha(()=>{k(r)},[r]),C.useEffect(()=>()=>{v()},[]),{transitionDuration:h,transitionStatus:g,transitionTimingFunction:n||"ease"}}function hi({keepMounted:t,transition:e="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:o="ease",onExit:a,onEntered:l,onEnter:u,onExited:c,enterDelay:f,exitDelay:d}){const h=cf(),{transitionDuration:p,transitionStatus:g,transitionTimingFunction:b}=Dq({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:a,onEntered:l,onEnter:u,onExited:c,enterDelay:f,exitDelay:d});return p===0||h==="test"?i?O.jsx(O.Fragment,{children:s({})}):t?s({display:"none"}):null:g==="exited"?t?s({display:"none"}):null:O.jsx(O.Fragment,{children:s(Oq({transition:e,duration:p,state:g,timingFunction:b}))})}hi.displayName="@mantine/core/Transition";const[Lq,$k]=af("Popover component was not found in the tree");var Vk={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};function T0({children:t,active:e=!0,refProp:n="ref",innerRef:r}){const i=Tj(e),s=Qn(i,r),o=dl(t);return o?C.cloneElement(o,{[n]:s}):t}function zk(t){return O.jsx(y0,{tabIndex:-1,"data-autofocus":!0,...t})}T0.displayName="@mantine/core/FocusTrap";zk.displayName="@mantine/core/FocusTrapInitialFocus";T0.InitialFocus=zk;const C0=Ie((t,e)=>{const n=re("PopoverDropdown",null,t),{className:r,style:i,vars:s,children:o,onKeyDownCapture:a,variant:l,classNames:u,styles:c,...f}=n,d=$k(),h=pj({opened:d.opened,shouldReturnFocus:d.returnFocus}),p=d.withRoles?{"aria-labelledby":d.getTargetId(),id:d.getDropdownId(),role:"dialog",tabIndex:-1}:{},g=Qn(e,d.floating);return d.disabled?null:O.jsx(so,{...d.portalProps,withinPortal:d.withinPortal,children:O.jsx(hi,{mounted:d.opened,...d.transitionProps,transition:d.transitionProps?.transition||"fade",duration:d.transitionProps?.duration??150,keepMounted:d.keepMounted,exitDuration:typeof d.transitionProps?.exitDuration=="number"?d.transitionProps.exitDuration:d.transitionProps?.duration,children:b=>O.jsx(T0,{active:d.trapFocus&&d.opened,innerRef:g,children:O.jsxs(pe,{...p,...f,variant:l,onKeyDownCapture:sj(()=>{d.onClose?.(),d.onDismiss?.()},{active:d.closeOnEscape,onTrigger:h,onKeyDown:a}),"data-position":d.placement,"data-fixed":d.floatingStrategy==="fixed"||void 0,...d.getStyles("dropdown",{className:r,props:n,classNames:u,styles:c,style:[{...b,zIndex:d.zIndex,top:d.y??0,left:d.x??0,width:d.width==="target"?void 0:Y(d.width),...d.referenceHidden?{display:"none"}:null},d.resolvedStyles.dropdown,c?.dropdown,i]}),children:[o,O.jsx(pc,{ref:d.arrowRef,arrowX:d.arrowX,arrowY:d.arrowY,visible:d.withArrow,position:d.placement,arrowSize:d.arrowSize,arrowRadius:d.arrowRadius,arrowOffset:d.arrowOffset,arrowPosition:d.arrowPosition,...d.getStyles("arrow",{props:n,classNames:u,styles:c})})]})})})})});C0.classes=Vk;C0.displayName="@mantine/core/PopoverDropdown";const Pq={refProp:"ref",popupType:"dialog"},jk=Ie((t,e)=>{const{children:n,refProp:r,popupType:i,...s}=re("PopoverTarget",Pq,t),o=dl(n);if(!o)throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=s,l=$k(),u=Qn(l.reference,a0(o),e),c=l.withRoles?{"aria-haspopup":i,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},f=o.props;return C.cloneElement(o,{...a,...c,...l.targetProps,className:Pr(l.targetProps.className,a.className,f.className),[r]:u,...l.controlled?null:{onClick:()=>{l.onToggle(),f.onClick?.()}}})});jk.displayName="@mantine/core/PopoverTarget";function Bq(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function Fq(t,e,n){const r=Bq(t.middlewares),i=[IE(t.offset),vA()];return t.dropdownVisible&&n!=="test"&&t.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip=="boolean"?mu():mu(r.flip)),r.shift&&i.push(Ep(typeof r.shift=="boolean"?{limiter:q0(),padding:5}:{limiter:q0(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline=="boolean"?Yo():Yo(r.inline)),i.push(RE({element:t.arrowRef,padding:t.arrowOffset})),(r.size||t.width==="target")&&i.push(_A({...typeof r.size=="boolean"?{}:r.size,apply({rects:s,availableWidth:o,availableHeight:a,...l}){const c=e().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:s,availableWidth:o,availableHeight:a,...l}):Object.assign(c,{maxWidth:`${o}px`,maxHeight:`${a}px`})),t.width==="target"&&Object.assign(c,{width:`${s.reference.width}px`})}})),i}function Hq(t){const e=cf(),[n,r]=So({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),i=C.useRef(n),s=()=>{n&&!t.disabled&&r(!1)},o=()=>{t.disabled||r(!n)},a=b0({strategy:t.strategy,placement:t.preventPositionChangeWhenVisible?t.positionRef.current:t.position,middleware:Fq(t,()=>a,e),whileElementsMounted:t.keepMounted?void 0:eh});return C.useEffect(()=>{if(!(!a.refs.reference.current||!a.refs.floating.current)&&n)return eh(a.refs.reference.current,a.refs.floating.current,a.update)},[n,a.update]),Ha(()=>{t.onPositionChange?.(a.placement),t.positionRef.current=a.placement},[a.placement,t.preventPositionChangeWhenVisible]),Ha(()=>{n!==i.current&&(n?t.onOpen?.():t.onClose?.()),i.current=n},[n,t.onClose,t.onOpen]),fl(()=>{let l=-1;return n&&(l=window.setTimeout(()=>t.setDropdownVisible(!0),4)),()=>{window.clearTimeout(l)}},[n,t.position]),{floating:a,controlled:typeof t.opened=="boolean",opened:n,onClose:s,onToggle:o}}const Uq={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:ul("popover"),__staticSelector:"Popover",width:"max-content"},$q=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:Dt(e),"--popover-shadow":hk(n)}});function yr(t){const e=re("Popover",Uq,t),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:o,opened:a,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:c,width:f,middlewares:d,withArrow:h,arrowSize:p,arrowOffset:g,arrowRadius:b,arrowPosition:y,unstyled:E,classNames:T,styles:v,closeOnClickOutside:_,withinPortal:k,portalProps:M,closeOnEscape:P,clickOutsideEvents:F,trapFocus:N,onClose:U,onDismiss:j,onOpen:V,onChange:I,zIndex:L,radius:Z,shadow:H,id:D,defaultOpened:z,__staticSelector:x,withRoles:ne,disabled:G,returnFocus:w,variant:me,keepMounted:te,vars:le,floatingStrategy:_e,withOverlay:ye,overlayProps:ge,hideDetached:De,attributes:We,preventPositionChangeWhenVisible:se,...ie}=e,de=Ne({name:x,props:e,classes:Vk,classNames:T,styles:v,unstyled:E,attributes:We,rootSelector:"dropdown",vars:le,varsResolver:$q}),{resolvedStyles:Me}=ff({classNames:T,styles:v,props:e}),[Be,Ce]=C.useState(a??z??!1),lt=C.useRef(r),Pe=C.useRef(null),[Qe,Tn]=C.useState(null),[Cn,an]=C.useState(null),{dir:xn}=wo(),ts=cf(),W=xo(D),X=Hq({middlewares:d,width:f,position:Fk(xn,r),offset:typeof i=="number"?i+(h?p/2:0):i,arrowRef:Pe,arrowOffset:g,onPositionChange:s,positionDependencies:o,opened:a,defaultOpened:z,onChange:I,onOpen:V,onClose:U,onDismiss:j,strategy:_e,dropdownVisible:Be,setDropdownVisible:Ce,positionRef:lt,disabled:G,preventPositionChangeWhenVisible:se,keepMounted:te});cj(()=>{_&&(X.onClose(),j?.())},F,[Qe,Cn]);const be=C.useCallback(Pt=>{Tn(Pt),X.floating.refs.setReference(Pt)},[X.floating.refs.setReference]),ke=C.useCallback(Pt=>{an(Pt),X.floating.refs.setFloating(Pt)},[X.floating.refs.setFloating]),Le=C.useCallback(()=>{l?.onExited?.(),u?.(),Ce(!1),se||(lt.current=r)},[l?.onExited,u,se,r]),ln=C.useCallback(()=>{l?.onEntered?.(),c?.()},[l?.onEntered,c]);return O.jsxs(Lq,{value:{returnFocus:w,disabled:G,controlled:X.controlled,reference:be,floating:ke,x:X.floating.x,y:X.floating.y,arrowX:X.floating?.middlewareData?.arrow?.x,arrowY:X.floating?.middlewareData?.arrow?.y,opened:X.opened,arrowRef:Pe,transitionProps:{...l,onExited:Le,onEntered:ln},width:f,withArrow:h,arrowSize:p,arrowOffset:g,arrowRadius:b,arrowPosition:y,placement:X.floating.placement,trapFocus:N,withinPortal:k,portalProps:M,zIndex:L,radius:Z,shadow:H,closeOnEscape:P,onDismiss:j,onClose:X.onClose,onToggle:X.onToggle,getTargetId:()=>`${W}-target`,getDropdownId:()=>`${W}-dropdown`,withRoles:ne,targetProps:ie,__staticSelector:x,classNames:T,styles:v,unstyled:E,variant:me,keepMounted:te,getStyles:de,resolvedStyles:Me,floatingStrategy:_e,referenceHidden:De&&ts!=="test"?X.floating.middlewareData.hide?.referenceHidden:!1},children:[n,ye&&O.jsx(hi,{transition:"fade",mounted:X.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:Pt=>O.jsx(so,{withinPortal:k,children:O.jsx(Va,{...ge,...de("overlay",{className:ge?.className,style:[Pt,ge?.style]})})})})]})}yr.Target=jk;yr.Dropdown=C0;yr.displayName="@mantine/core/Popover";yr.extend=t=>t;var Un={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const Wk=C.forwardRef(({className:t,...e},n)=>O.jsxs(pe,{component:"span",className:Pr(Un.barsLoader,t),...e,ref:n,children:[O.jsx("span",{className:Un.bar}),O.jsx("span",{className:Un.bar}),O.jsx("span",{className:Un.bar})]}));Wk.displayName="@mantine/core/Bars";const qk=C.forwardRef(({className:t,...e},n)=>O.jsxs(pe,{component:"span",className:Pr(Un.dotsLoader,t),...e,ref:n,children:[O.jsx("span",{className:Un.dot}),O.jsx("span",{className:Un.dot}),O.jsx("span",{className:Un.dot})]}));qk.displayName="@mantine/core/Dots";const Yk=C.forwardRef(({className:t,...e},n)=>O.jsx(pe,{component:"span",className:Pr(Un.ovalLoader,t),...e,ref:n}));Yk.displayName="@mantine/core/Oval";const Kk={bars:Wk,oval:Yk,dots:qk},Vq={loaders:Kk,type:"oval"},zq=(t,{size:e,color:n})=>({root:{"--loader-size":ze(e,"loader-size"),"--loader-color":n?Lr(n,t):void 0}}),Ao=Ie((t,e)=>{const n=re("Loader",Vq,t),{size:r,color:i,type:s,vars:o,className:a,style:l,classNames:u,styles:c,unstyled:f,loaders:d,variant:h,children:p,attributes:g,...b}=n,y=Ne({name:"Loader",props:n,classes:Un,className:a,style:l,classNames:u,styles:c,unstyled:f,attributes:g,vars:o,varsResolver:zq});return p?O.jsx(pe,{...y("root"),ref:e,...b,children:p}):O.jsx(pe,{...y("root"),ref:e,component:d[s],variant:h,size:r,...b})});Ao.defaultLoaders=Kk;Ao.classes=Un;Ao.displayName="@mantine/core/Loader";var vo={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const xE={orientation:"horizontal"},jq=(t,{borderWidth:e})=>({group:{"--ai-border-width":Y(e)}}),x0=Ie((t,e)=>{const n=re("ActionIconGroup",xE,t),{className:r,style:i,classNames:s,styles:o,unstyled:a,orientation:l,vars:u,borderWidth:c,variant:f,mod:d,attributes:h,...p}=re("ActionIconGroup",xE,t),g=Ne({name:"ActionIconGroup",props:n,classes:vo,className:r,style:i,classNames:s,styles:o,unstyled:a,attributes:h,vars:u,varsResolver:jq,rootSelector:"group"});return O.jsx(pe,{...g("group"),ref:e,variant:f,mod:[{"data-orientation":l},d],role:"group",...p})});x0.classes=vo;x0.displayName="@mantine/core/ActionIconGroup";const Wq=(t,{radius:e,color:n,gradient:r,variant:i,autoContrast:s,size:o})=>{const a=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":ze(o,"section-height"),"--section-padding-x":ze(o,"section-padding-x"),"--section-fz":rn(o),"--section-radius":e===void 0?void 0:Dt(e),"--section-bg":n||i?a.background:void 0,"--section-color":a.color,"--section-bd":n||i?a.border:void 0}}},S0=Ie((t,e)=>{const n=re("ActionIconGroupSection",null,t),{className:r,style:i,classNames:s,styles:o,unstyled:a,vars:l,variant:u,gradient:c,radius:f,autoContrast:d,attributes:h,...p}=n,g=Ne({name:"ActionIconGroupSection",props:n,classes:vo,className:r,style:i,classNames:s,styles:o,unstyled:a,attributes:h,vars:l,varsResolver:Wq,rootSelector:"groupSection"});return O.jsx(pe,{...g("groupSection"),ref:e,variant:u,...p})});S0.classes=vo;S0.displayName="@mantine/core/ActionIconGroupSection";const qq=(t,{size:e,radius:n,variant:r,gradient:i,color:s,autoContrast:o})=>{const a=t.variantColorResolver({color:s||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--ai-size":ze(e,"ai-size"),"--ai-radius":n===void 0?void 0:Dt(n),"--ai-bg":s||r?a.background:void 0,"--ai-hover":s||r?a.hover:void 0,"--ai-hover-color":s||r?a.hoverColor:void 0,"--ai-color":a.color,"--ai-bd":s||r?a.border:void 0}}},pf=Lt((t,e)=>{const n=re("ActionIcon",null,t),{className:r,unstyled:i,variant:s,classNames:o,styles:a,style:l,loading:u,loaderProps:c,size:f,color:d,radius:h,__staticSelector:p,gradient:g,vars:b,children:y,disabled:E,"data-disabled":T,autoContrast:v,mod:_,attributes:k,...M}=n,P=Ne({name:["ActionIcon",p],props:n,className:r,style:l,classes:vo,classNames:o,styles:a,unstyled:i,attributes:k,vars:b,varsResolver:qq});return O.jsxs(yi,{...P("root",{active:!E&&!u&&!T}),...M,unstyled:i,variant:s,size:f,disabled:E||u,ref:e,mod:[{loading:u,disabled:E||T},_],children:[typeof u=="boolean"&&O.jsx(hi,{mounted:u,transition:"slide-down",duration:150,children:F=>O.jsx(pe,{component:"span",...P("loader",{style:F}),"aria-hidden":!0,children:O.jsx(Ao,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...c})})}),O.jsx(pe,{component:"span",mod:{loading:u},...P("icon"),children:y})]})});pf.classes=vo;pf.displayName="@mantine/core/ActionIcon";pf.Group=x0;pf.GroupSection=S0;const Gk=C.forwardRef(({size:t="var(--cb-icon-size, 70%)",style:e,...n},r)=>O.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},ref:r,...n,children:O.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));Gk.displayName="@mantine/core/CloseIcon";var Xk={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Yq={variant:"subtle"},Kq=(t,{size:e,radius:n,iconSize:r})=>({root:{"--cb-size":ze(e,"cb-size"),"--cb-radius":n===void 0?void 0:Dt(n),"--cb-icon-size":Y(r)}}),mf=Lt((t,e)=>{const n=re("CloseButton",Yq,t),{iconSize:r,children:i,vars:s,radius:o,className:a,classNames:l,style:u,styles:c,unstyled:f,"data-disabled":d,disabled:h,variant:p,icon:g,mod:b,attributes:y,__staticSelector:E,...T}=n,v=Ne({name:E||"CloseButton",props:n,className:a,style:u,classes:Xk,classNames:l,styles:c,unstyled:f,attributes:y,vars:s,varsResolver:Kq});return O.jsxs(yi,{ref:e,...T,unstyled:f,variant:p,disabled:h,mod:[{disabled:h||d},b],...v("root",{variant:p,active:!h&&!d}),children:[g||O.jsx(Gk,{}),i]})});mf.classes=Xk;mf.displayName="@mantine/core/CloseButton";function Gq(t){return C.Children.toArray(t).filter(Boolean)}var Qk={root:"m_4081bf90"};const Xq={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},Qq=(t,{grow:e,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:o},{childWidth:a})=>({root:{"--group-child-width":e&&n?a:void 0,"--group-gap":cl(r),"--group-align":i,"--group-justify":s,"--group-wrap":o}}),Zk=Ie((t,e)=>{const n=re("Group",Xq,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,children:l,gap:u,align:c,justify:f,wrap:d,grow:h,preventGrowOverflow:p,vars:g,variant:b,__size:y,mod:E,attributes:T,...v}=n,_=Gq(l),k=_.length,M=cl(u??"md"),F={childWidth:`calc(${100/k}% - (${M} - ${M} / ${k}))`},N=Ne({name:"Group",props:n,stylesCtx:F,className:i,style:s,classes:Qk,classNames:r,styles:o,unstyled:a,attributes:T,vars:g,varsResolver:Qq});return O.jsx(pe,{...N("root"),ref:e,variant:b,mod:[{grow:h},E],size:y,...v,children:_})});Zk.classes=Qk;Zk.displayName="@mantine/core/Group";const[Zq,Jq]=lf({size:"sm"});var Ln={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const Jk=Ie((t,e)=>{const n=re("InputClearButton",null,t),{size:r,variant:i,vars:s,classNames:o,styles:a,...l}=n,u=Jq(),{resolvedClassNames:c,resolvedStyles:f}=ff({classNames:o,styles:a,props:n});return O.jsx(mf,{variant:i||"transparent",ref:e,size:r||u?.size||"sm",classNames:c,styles:f,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});Jk.displayName="@mantine/core/InputClearButton";const eY={xs:7,sm:8,md:10,lg:12,xl:15};function tY({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:r,size:i="sm"}){const s=t&&e;return s&&(n||r)?O.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:eY[i]},children:[s,n||r]}):n===null?null:n||s||r}const[nY,gf]=lf({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),rY=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${rn(e)} - ${Y(2)})`}}),bf=Ie((t,e)=>{const n=re("InputDescription",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,size:u,__staticSelector:c,__inheritStyles:f=!0,attributes:d,variant:h,...p}=re("InputDescription",null,n),g=gf(),b=Ne({name:["InputWrapper",c],props:n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:d,rootSelector:"description",vars:l,varsResolver:rY}),y=f&&g?.getStyles||b;return O.jsx(pe,{component:"p",ref:e,variant:h,size:u,...y("description",g?.getStyles?{className:i,style:s}:void 0),...p})});bf.classes=Ln;bf.displayName="@mantine/core/InputDescription";const iY=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${rn(e)} - ${Y(2)})`}}),yf=Ie((t,e)=>{const n=re("InputError",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,size:u,attributes:c,__staticSelector:f,__inheritStyles:d=!0,variant:h,...p}=n,g=Ne({name:["InputWrapper",f],props:n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:c,rootSelector:"error",vars:l,varsResolver:iY}),b=gf(),y=d&&b?.getStyles||g;return O.jsx(pe,{component:"p",ref:e,variant:h,size:u,...y("error",b?.getStyles?{className:i,style:s}:void 0),...p})});yf.classes=Ln;yf.displayName="@mantine/core/InputError";const SE={labelElement:"label"},sY=(t,{size:e})=>({label:{"--input-label-size":rn(e),"--input-asterisk-color":void 0}}),Ef=Ie((t,e)=>{const n=re("InputLabel",SE,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,labelElement:u,size:c,required:f,htmlFor:d,onMouseDown:h,children:p,__staticSelector:g,variant:b,mod:y,attributes:E,...T}=re("InputLabel",SE,n),v=Ne({name:["InputWrapper",g],props:n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:E,rootSelector:"label",vars:l,varsResolver:sY}),_=gf(),k=_?.getStyles||v;return O.jsxs(pe,{...k("label",_?.getStyles?{className:i,style:s}:void 0),component:u,variant:b,size:c,ref:e,htmlFor:u==="label"?d:void 0,mod:[{required:f},y],onMouseDown:M=>{h?.(M),!M.defaultPrevented&&M.detail>1&&M.preventDefault()},...T,children:[p,f&&O.jsx("span",{...k("required"),"aria-hidden":!0,children:" *"})]})});Ef.classes=Ln;Ef.displayName="@mantine/core/InputLabel";const w0=Ie((t,e)=>{const n=re("InputPlaceholder",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,__staticSelector:u,variant:c,error:f,mod:d,attributes:h,...p}=n,g=Ne({name:["InputPlaceholder",u],props:n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:h,rootSelector:"placeholder"});return O.jsx(pe,{...g("placeholder"),mod:[{error:!!f},d],component:"span",variant:c,ref:e,...p})});w0.classes=Ln;w0.displayName="@mantine/core/InputPlaceholder";function oY(t,{hasDescription:e,hasError:n}){const r=t.findIndex(l=>l==="input"),i=t.slice(0,r),s=t.slice(r+1),o=e&&i.includes("description")||n&&i.includes("error");return{offsetBottom:e&&s.includes("description")||n&&s.includes("error"),offsetTop:o}}const aY={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},lY=(t,{size:e})=>({label:{"--input-label-size":rn(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${rn(e)} - ${Y(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${rn(e)} - ${Y(2)})`}}),k0=Ie((t,e)=>{const n=re("InputWrapper",aY,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,size:u,variant:c,__staticSelector:f,inputContainer:d,inputWrapperOrder:h,label:p,error:g,description:b,labelProps:y,descriptionProps:E,errorProps:T,labelElement:v,children:_,withAsterisk:k,id:M,required:P,__stylesApiProps:F,mod:N,attributes:U,...j}=n,V=Ne({name:["InputWrapper",f],props:F||n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:U,vars:l,varsResolver:lY}),I={size:u,variant:c,__staticSelector:f},L=xo(M),Z=typeof k=="boolean"?k:P,H=T?.id||`${L}-error`,D=E?.id||`${L}-description`,z=L,x=!!g&&typeof g!="boolean",ne=!!b,G=`${x?H:""} ${ne?D:""}`,w=G.trim().length>0?G.trim():void 0,me=y?.id||`${L}-label`,te=p&&O.jsx(Ef,{labelElement:v,id:me,htmlFor:z,required:Z,...I,...y,children:p},"label"),le=ne&&O.jsx(bf,{...E,...I,size:E?.size||I.size,id:E?.id||D,children:b},"description"),_e=O.jsx(C.Fragment,{children:d(_)},"input"),ye=x&&C.createElement(yf,{...T,...I,size:T?.size||I.size,key:"error",id:T?.id||H},g),ge=h.map(De=>{switch(De){case"label":return te;case"input":return _e;case"description":return le;case"error":return ye;default:return null}});return O.jsx(nY,{value:{getStyles:V,describedBy:w,inputId:z,labelId:me,...oY(h,{hasDescription:ne,hasError:x})},children:O.jsx(pe,{ref:e,variant:c,size:u,mod:[{error:!!g},N],...V("root"),...j,children:ge})})});k0.classes=Ln;k0.displayName="@mantine/core/InputWrapper";const uY={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},cY=(t,e,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":ze(e.size,"input-height"),"--input-fz":rn(e.size),"--input-radius":e.radius===void 0?void 0:Dt(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?Y(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?Y(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?ze(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),En=Lt((t,e)=>{const n=re("Input",uY,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,required:l,__staticSelector:u,__stylesApiProps:c,size:f,wrapperProps:d,error:h,disabled:p,leftSection:g,leftSectionProps:b,leftSectionWidth:y,rightSection:E,rightSectionProps:T,rightSectionWidth:v,rightSectionPointerEvents:_,leftSectionPointerEvents:k,variant:M,vars:P,pointer:F,multiline:N,radius:U,id:j,withAria:V,withErrorStyles:I,mod:L,inputSize:Z,attributes:H,__clearSection:D,__clearable:z,__defaultRightSection:x,...ne}=n,{styleProps:G,rest:w}=df(ne),me=gf(),te={offsetBottom:me?.offsetBottom,offsetTop:me?.offsetTop},le=Ne({name:["Input",u],props:c||n,classes:Ln,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:H,stylesCtx:te,rootSelector:"wrapper",vars:P,varsResolver:cY}),_e=V?{required:l,disabled:p,"aria-invalid":!!h,"aria-describedby":me?.describedBy,id:me?.inputId||j}:{},ye=tY({__clearable:z,__clearSection:D,rightSection:E,__defaultRightSection:x,size:f});return O.jsx(Zq,{value:{size:f||"sm"},children:O.jsxs(pe,{...le("wrapper"),...G,...d,mod:[{error:!!h&&I,pointer:F,disabled:p,multiline:N,"data-with-right-section":!!ye,"data-with-left-section":!!g},L],variant:M,size:f,children:[g&&O.jsx("div",{...b,"data-position":"left",...le("section",{className:b?.className,style:b?.style}),children:g}),O.jsx(pe,{component:"input",...w,..._e,ref:e,required:l,mod:{disabled:p,error:!!h&&I},variant:M,__size:Z,...le("input")}),ye&&O.jsx("div",{...T,"data-position":"right",...le("section",{className:T?.className,style:T?.style}),children:ye})]})})});En.classes=Ln;En.Wrapper=k0;En.Label=Ef;En.Error=yf;En.Description=bf;En.Placeholder=w0;En.ClearButton=Jk;En.displayName="@mantine/core/Input";function fY(t,e,n){const r=re(t,e,n),{label:i,description:s,error:o,required:a,classNames:l,styles:u,className:c,unstyled:f,__staticSelector:d,__stylesApiProps:h,errorProps:p,labelProps:g,descriptionProps:b,wrapperProps:y,id:E,size:T,style:v,inputContainer:_,inputWrapperOrder:k,withAsterisk:M,variant:P,vars:F,mod:N,attributes:U,...j}=r,{styleProps:V,rest:I}=df(j),L={label:i,description:s,error:o,required:a,classNames:l,className:c,__staticSelector:d,__stylesApiProps:h||r,errorProps:p,labelProps:g,descriptionProps:b,unstyled:f,styles:u,size:T,style:v,inputContainer:_,inputWrapperOrder:k,withAsterisk:M,variant:P,id:E,mod:N,attributes:U,...y};return{...I,classNames:l,styles:u,unstyled:f,wrapperProps:{...L,...V},inputProps:{required:a,classNames:l,styles:u,unstyled:f,size:T,__staticSelector:d,__stylesApiProps:h||r,error:o,variant:P,id:E,attributes:U}}}const dY={__staticSelector:"InputBase",withAria:!0,size:"sm"},_o=Lt((t,e)=>{const{inputProps:n,wrapperProps:r,...i}=fY("InputBase",dY,t);return O.jsx(En.Wrapper,{...r,children:O.jsx(En,{...n,...i,ref:e})})});_o.classes={...En.classes,...En.Wrapper.classes};_o.displayName="@mantine/core/InputBase";const hY={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var eA={root:"m_8bffd616"};const tA=Lt((t,e)=>{const n=re("Flex",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,gap:u,rowGap:c,columnGap:f,align:d,justify:h,wrap:p,direction:g,attributes:b,...y}=n,E=Ne({name:"Flex",classes:eA,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:b,vars:l}),T=on(),v=kk(),_=wk({styleProps:{gap:u,rowGap:c,columnGap:f,align:d,justify:h,wrap:p,direction:g},theme:T,data:hY});return O.jsxs(O.Fragment,{children:[_.hasResponsiveStyles&&O.jsx(Sk,{selector:`.${v}`,styles:_.styles,media:_.media}),O.jsx(pe,{ref:e,...E("root",{className:v,style:of(_.inlineStyles)}),...y})]})});tA.classes=eA;tA.displayName="@mantine/core/Flex";function nA({open:t,close:e,openDelay:n,closeDelay:r}){const i=C.useRef(-1),s=C.useRef(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},a=()=>{o(),n===0||n===void 0?t():i.current=window.setTimeout(t,n)},l=()=>{o(),r===0||r===void 0?e():s.current=window.setTimeout(e,r)};return C.useEffect(()=>o,[]),{openDropdown:a,closeDropdown:l}}function rA({style:t,size:e=16,...n}){return O.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:Y(e),height:Y(e),display:"block"},...n,children:O.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}rA.displayName="@mantine/core/AccordionChevron";var iA={root:"m_b6d8b162"};function pY(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const mY={inherit:!1},gY=(t,{variant:e,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":rn(i),"--text-lh":oj(i),"--text-gradient":e==="gradient"?dp(r,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Lr(s,t):void 0}}),sA=Lt((t,e)=>{const n=re("Text",mY,t),{lineClamp:r,truncate:i,inline:s,inherit:o,gradient:a,span:l,__staticSelector:u,vars:c,className:f,style:d,classNames:h,styles:p,unstyled:g,variant:b,mod:y,size:E,attributes:T,...v}=n,_=Ne({name:["Text",u],props:n,classes:iA,className:f,style:d,classNames:h,styles:p,unstyled:g,attributes:T,vars:c,varsResolver:gY});return O.jsx(pe,{..._("root",{focusable:!0}),ref:e,component:l?"span":"p",variant:b,mod:[{"data-truncate":pY(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":o},y],size:E,...v})});sA.classes=iA;sA.displayName="@mantine/core/Text";function bY({size:t,style:e,...n}){const r=t!==void 0?{width:Y(t),height:Y(t),...e}:e;return O.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:O.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Tf={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const oA=C.createContext(null),yY=oA.Provider;function EY(){return{withinGroup:!!C.useContext(oA)}}const TY=(t,{spacing:e})=>({group:{"--ag-spacing":cl(e)}}),A0=Ie((t,e)=>{const n=re("AvatarGroup",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,spacing:u,attributes:c,...f}=n,d=Ne({name:"AvatarGroup",classes:Tf,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:c,vars:l,varsResolver:TY,rootSelector:"group"});return O.jsx(yY,{value:!0,children:O.jsx(pe,{ref:e,...d("group"),...f})})});A0.classes=Tf;A0.displayName="@mantine/core/AvatarGroup";function CY(t){return O.jsx("svg",{...t,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:O.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function xY(t){let e=0;for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e=(e<<5)-e+r,e|=0}return e}const SY=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function wY(t,e=SY){const n=xY(t),r=Math.abs(n)%e.length;return e[r]}function kY(t,e=2){const n=t.split(" ");return n.length===1?t.slice(0,e).toUpperCase():n.map(r=>r[0]).slice(0,e).join("").toUpperCase()}const AY=(t,{size:e,radius:n,variant:r,gradient:i,color:s,autoContrast:o,name:a,allowedInitialsColors:l})=>{const u=s==="initials"&&typeof a=="string"?wY(a,l):s,c=t.variantColorResolver({color:u||"gray",theme:t,gradient:i,variant:r||"light",autoContrast:o});return{root:{"--avatar-size":ze(e,"avatar-size"),"--avatar-radius":n===void 0?void 0:Dt(n),"--avatar-bg":u||r?c.background:void 0,"--avatar-color":u||r?c.color:void 0,"--avatar-bd":u||r?c.border:void 0}}},v0=Lt((t,e)=>{const n=re("Avatar",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,src:u,alt:c,radius:f,color:d,gradient:h,imageProps:p,children:g,autoContrast:b,mod:y,name:E,allowedInitialsColors:T,attributes:v,..._}=n,k=EY(),[M,P]=C.useState(!u),F=Ne({name:"Avatar",props:n,classes:Tf,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:v,vars:l,varsResolver:AY});return C.useEffect(()=>P(!u),[u]),O.jsx(pe,{...F("root"),mod:[{"within-group":k.withinGroup},y],ref:e,..._,children:M||!u?O.jsx("span",{...F("placeholder"),title:c,children:g||typeof E=="string"&&kY(E)||O.jsx(CY,{})}):O.jsx("img",{...p,...F("image"),src:u,alt:c,onError:N=>{P(!0),p?.onError?.(N)}})})});v0.classes=Tf;v0.displayName="@mantine/core/Avatar";v0.Group=A0;var aA={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const vY=(t,{radius:e,color:n,gradient:r,variant:i,size:s,autoContrast:o,circle:a})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:o});return{root:{"--badge-height":ze(s,"badge-height"),"--badge-padding-x":ze(s,"badge-padding-x"),"--badge-fz":ze(s,"badge-fz"),"--badge-radius":a||e===void 0?void 0:Dt(e),"--badge-bg":n||i?l.background:void 0,"--badge-color":n||i?l.color:void 0,"--badge-bd":n||i?l.border:void 0,"--badge-dot-color":i==="dot"?Lr(n,t):void 0}}},lA=Lt((t,e)=>{const n=re("Badge",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,radius:u,color:c,gradient:f,leftSection:d,rightSection:h,children:p,variant:g,fullWidth:b,autoContrast:y,circle:E,mod:T,attributes:v,..._}=n,k=Ne({name:"Badge",props:n,classes:aA,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:v,vars:l,varsResolver:vY});return O.jsxs(pe,{variant:g,mod:[{block:b,circle:E,"with-right-section":!!h,"with-left-section":!!d},T],...k("root",{variant:g}),ref:e,..._,children:[d&&O.jsx("span",{...k("section"),"data-position":"left",children:d}),O.jsx("span",{...k("label"),children:p}),h&&O.jsx("span",{...k("section"),"data-position":"right",children:h})]})});lA.classes=aA;lA.displayName="@mantine/core/Badge";var No={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const wE={orientation:"horizontal"},_Y=(t,{borderWidth:e})=>({group:{"--button-border-width":Y(e)}}),_0=Ie((t,e)=>{const n=re("ButtonGroup",wE,t),{className:r,style:i,classNames:s,styles:o,unstyled:a,orientation:l,vars:u,borderWidth:c,variant:f,mod:d,attributes:h,...p}=re("ButtonGroup",wE,t),g=Ne({name:"ButtonGroup",props:n,classes:No,className:r,style:i,classNames:s,styles:o,unstyled:a,attributes:h,vars:u,varsResolver:_Y,rootSelector:"group"});return O.jsx(pe,{...g("group"),ref:e,variant:f,mod:[{"data-orientation":l},d],role:"group",...p})});_0.classes=No;_0.displayName="@mantine/core/ButtonGroup";const NY=(t,{radius:e,color:n,gradient:r,variant:i,autoContrast:s,size:o})=>{const a=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":ze(o,"section-height"),"--section-padding-x":ze(o,"section-padding-x"),"--section-fz":o?.includes("compact")?rn(o.replace("compact-","")):rn(o),"--section-radius":e===void 0?void 0:Dt(e),"--section-bg":n||i?a.background:void 0,"--section-color":a.color,"--section-bd":n||i?a.border:void 0}}},N0=Ie((t,e)=>{const n=re("ButtonGroupSection",null,t),{className:r,style:i,classNames:s,styles:o,unstyled:a,vars:l,variant:u,gradient:c,radius:f,autoContrast:d,attributes:h,...p}=n,g=Ne({name:"ButtonGroupSection",props:n,classes:No,className:r,style:i,classNames:s,styles:o,unstyled:a,attributes:h,vars:l,varsResolver:NY,rootSelector:"groupSection"});return O.jsx(pe,{...g("groupSection"),ref:e,variant:u,...p})});N0.classes=No;N0.displayName="@mantine/core/ButtonGroupSection";const IY={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${Y(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},RY=(t,{radius:e,color:n,gradient:r,variant:i,size:s,justify:o,autoContrast:a})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:a});return{root:{"--button-justify":o,"--button-height":ze(s,"button-height"),"--button-padding-x":ze(s,"button-padding-x"),"--button-fz":s?.includes("compact")?rn(s.replace("compact-","")):rn(s),"--button-radius":e===void 0?void 0:Dt(e),"--button-bg":n||i?l.background:void 0,"--button-hover":n||i?l.hover:void 0,"--button-color":l.color,"--button-bd":n||i?l.border:void 0,"--button-hover-color":n||i?l.hoverColor:void 0}}},Cf=Lt((t,e)=>{const n=re("Button",null,t),{style:r,vars:i,className:s,color:o,disabled:a,children:l,leftSection:u,rightSection:c,fullWidth:f,variant:d,radius:h,loading:p,loaderProps:g,gradient:b,classNames:y,styles:E,unstyled:T,"data-disabled":v,autoContrast:_,mod:k,attributes:M,...P}=n,F=Ne({name:"Button",props:n,classes:No,className:s,style:r,classNames:y,styles:E,unstyled:T,attributes:M,vars:i,varsResolver:RY}),N=!!u,U=!!c;return O.jsxs(yi,{ref:e,...F("root",{active:!a&&!p&&!v}),unstyled:T,variant:d,disabled:a||p,mod:[{disabled:a||v,loading:p,block:f,"with-left-section":N,"with-right-section":U},k],...P,children:[typeof p=="boolean"&&O.jsx(hi,{mounted:p,transition:IY,duration:150,children:j=>O.jsx(pe,{component:"span",...F("loader",{style:j}),"aria-hidden":!0,children:O.jsx(Ao,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...g})})}),O.jsxs("span",{...F("inner"),children:[u&&O.jsx(pe,{component:"span",...F("section"),mod:{position:"left"},children:u}),O.jsx(pe,{component:"span",mod:{loading:p},...F("label"),children:l}),c&&O.jsx(pe,{component:"span",...F("section"),mod:{position:"right"},children:c})]})]})});Cf.classes=No;Cf.displayName="@mantine/core/Button";Cf.Group=_0;Cf.GroupSection=N0;const[MY,OY]=af("Card component was not found in tree");var I0={root:"m_e615b15f",section:"m_599a2148"};const xf=Lt((t,e)=>{const n=re("CardSection",null,t),{classNames:r,className:i,style:s,styles:o,vars:a,withBorder:l,inheritPadding:u,mod:c,...f}=n,d=OY();return O.jsx(pe,{ref:e,mod:[{"with-border":l,"inherit-padding":u},c],...d.getStyles("section",{className:i,style:s,styles:o,classNames:r}),...f})});xf.classes=I0;xf.displayName="@mantine/core/CardSection";const DY=(t,{padding:e})=>({root:{"--card-padding":cl(e)}}),R0=Lt((t,e)=>{const n=re("Card",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,children:u,padding:c,attributes:f,...d}=n,h=Ne({name:"Card",props:n,classes:I0,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:f,vars:l,varsResolver:DY}),p=C.Children.toArray(u),g=p.map((b,y)=>typeof b=="object"&&b&&"type"in b&&b.type===xf?C.cloneElement(b,{"data-first-section":y===0||void 0,"data-last-section":y===p.length-1||void 0}):b);return O.jsx(MY,{value:{getStyles:h},children:O.jsx(E0,{ref:e,unstyled:a,...h("root"),...d,children:g})})});R0.classes=I0;R0.displayName="@mantine/core/Card";R0.Section=xf;var uA={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const[LY,PY]=lf();function cA(t){const{value:e,defaultValue:n,onChange:r,multiple:i,children:s}=re("ChipGroup",null,t),[o,a]=So({value:e,defaultValue:n,finalValue:i?[]:null,onChange:r}),l=c=>Array.isArray(o)?o.includes(c):c===o,u=c=>{const f=c.currentTarget.value;Array.isArray(o)?a(o.includes(f)?o.filter(d=>d!==f):[...o,f]):a(f)};return O.jsx(LY,{value:{isChipSelected:l,onChange:u,multiple:i},children:s})}cA.displayName="@mantine/core/ChipGroup";const BY={type:"checkbox"},FY=(t,{size:e,radius:n,variant:r,color:i,autoContrast:s})=>{const o=t.variantColorResolver({color:i||t.primaryColor,theme:t,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":rn(e),"--chip-size":ze(e,"chip-size"),"--chip-radius":n===void 0?void 0:Dt(n),"--chip-checked-padding":ze(e,"chip-checked-padding"),"--chip-padding":ze(e,"chip-padding"),"--chip-icon-size":ze(e,"chip-icon-size"),"--chip-bg":i||r?o.background:void 0,"--chip-hover":i||r?o.hover:void 0,"--chip-color":i||r?o.color:void 0,"--chip-bd":i||r?o.border:void 0,"--chip-spacing":ze(e,"chip-spacing")}}},M0=Ie((t,e)=>{const n=re("Chip",BY,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,id:u,checked:c,defaultChecked:f,onChange:d,value:h,wrapperProps:p,type:g,disabled:b,children:y,size:E,variant:T,icon:v,rootRef:_,autoContrast:k,mod:M,attributes:P,...F}=n,N=Ne({name:"Chip",classes:uA,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:P,vars:l,varsResolver:FY}),U=PY(),j=xo(u),{styleProps:V,rest:I}=df(F),[L,Z]=So({value:c,defaultValue:f,finalValue:!1,onChange:d}),H=U?{checked:U.isChipSelected(h),onChange:z=>{U.onChange(z),d?.(z.currentTarget.checked)},type:U.multiple?"checkbox":"radio"}:{},D=H.checked||L;return O.jsxs(pe,{size:E,variant:T,ref:_,mod:M,...N("root"),...V,...p,children:[O.jsx("input",{type:g,...N("input"),checked:D,onChange:z=>Z(z.currentTarget.checked),id:j,disabled:b,ref:e,value:h,...H,...I}),O.jsxs("label",{htmlFor:j,"data-checked":D||void 0,"data-disabled":b||void 0,...N("label",{variant:T||"filled"}),children:[D&&v!==null&&v!==!1&&O.jsx("span",{...N("iconWrapper"),children:v===void 0?O.jsx(bY,{...N("checkIcon")}):v}),O.jsx("span",{children:y})]})]})});M0.classes=uA;M0.displayName="@mantine/core/Chip";M0.Group=cA;var fA={root:"m_3eebeb36",label:"m_9e365f20"};const HY={orientation:"horizontal"},UY=(t,{color:e,variant:n,size:r})=>({root:{"--divider-color":e?Lr(e,t):void 0,"--divider-border-style":n,"--divider-size":ze(r,"divider-size")}}),dA=Ie((t,e)=>{const n=re("Divider",HY,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,color:u,orientation:c,label:f,labelPosition:d,mod:h,attributes:p,...g}=n,b=Ne({name:"Divider",classes:fA,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:p,vars:l,varsResolver:UY});return O.jsx(pe,{ref:e,mod:[{orientation:c,"with-label":!!f},h],...b("root"),...g,role:"separator",children:f&&O.jsx(pe,{component:"span",mod:{position:d},...b("label"),children:f})})});dA.classes=fA;dA.displayName="@mantine/core/Divider";const $Y={multiple:!1},hA=C.forwardRef((t,e)=>{const{onChange:n,children:r,multiple:i,accept:s,name:o,form:a,resetRef:l,disabled:u,capture:c,inputProps:f,...d}=re("FileButton",$Y,t),h=C.useRef(null),p=()=>{!u&&h.current?.click()},g=y=>{if(y.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(y.currentTarget.files):y.currentTarget.files[0]||null)};return dc(l,()=>{h.current&&(h.current.value="")}),O.jsxs(O.Fragment,{children:[O.jsx("input",{style:{display:"none"},type:"file",accept:s,multiple:i,onChange:g,ref:Qn(e,h),name:o,form:a,capture:c,...f}),r({onClick:p,...d})]})});hA.displayName="@mantine/core/FileButton";const VY=({value:t})=>O.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(t)?t.map(e=>e.name).join(", "):t?.name}),zY={valueComponent:VY,size:"sm"},O0=Ie((t,e)=>{const n=re("FileInput",zY,t),{unstyled:r,vars:i,onChange:s,value:o,defaultValue:a,multiple:l,accept:u,name:c,form:f,valueComponent:d,clearable:h,clearButtonProps:p,readOnly:g,capture:b,fileInputProps:y,rightSection:E,size:T,placeholder:v,component:_,resetRef:k,classNames:M,styles:P,attributes:F,...N}=n,U=C.useRef(null),{resolvedClassNames:j,resolvedStyles:V}=ff({classNames:M,styles:P,props:n}),[I,L]=So({value:o,defaultValue:a,onChange:s,finalValue:l?[]:null}),Z=Array.isArray(I)?I.length!==0:I!==null,H=E||(h&&Z&&!g?O.jsx(mf,{...p,variant:"subtle",onClick:()=>L(l?[]:null),size:T,unstyled:r}):null);return C.useEffect(()=>{(Array.isArray(I)&&I.length===0||I===null)&&U.current?.()},[I]),O.jsx(hA,{onChange:L,multiple:l,accept:u,name:c,form:f,resetRef:Qn(U,k),disabled:g,capture:b,inputProps:y,children:D=>O.jsx(_o,{component:_||"button",ref:e,rightSection:H,...D,...N,__staticSelector:"FileInput",multiline:!0,type:"button",pointer:!0,__stylesApiProps:n,unstyled:r,size:T,classNames:M,styles:P,attributes:F,children:Z?O.jsx(d,{value:I}):O.jsx(En.Placeholder,{__staticSelector:"FileInput",classNames:j,styles:V,attributes:F,children:v})})})});O0.classes=_o.classes;O0.displayName="@mantine/core/FileInput";const MX=O0;var pA={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const kE={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:ul("overlay")},jY=(t,{zIndex:e})=>({root:{"--lo-z-index":e?.toString()}}),mA=Ie((t,e)=>{const n=re("LoadingOverlay",kE,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,transitionProps:u,loaderProps:c,overlayProps:f,visible:d,zIndex:h,attributes:p,...g}=n,b=on(),y=Ne({name:"LoadingOverlay",classes:pA,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:p,vars:l,varsResolver:jY}),E={...kE.overlayProps,...f};return O.jsx(hi,{transition:"fade",...u,mounted:!!d,children:T=>O.jsxs(pe,{...y("root",{style:T}),ref:e,...g,children:[O.jsx(Ao,{...y("loader"),unstyled:a,...c}),O.jsx(Va,{...E,...y("overlay"),darkHidden:!0,unstyled:a,color:f?.color||b.white}),O.jsx(Va,{...E,...y("overlay"),lightHidden:!0,unstyled:a,color:f?.color||b.colors.dark[5]})]})})});mA.classes=pA;mA.displayName="@mantine/core/LoadingOverlay";const[WY,Ei]=af("Menu component was not found in the tree");var Ti={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const D0=Ie((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...a}=re("MenuDivider",null,t),l=Ei();return O.jsx(pe,{ref:e,...l.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...a})});D0.classes=Ti;D0.displayName="@mantine/core/MenuDivider";const L0=Ie((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,onMouseEnter:a,onMouseLeave:l,onKeyDown:u,children:c,...f}=re("MenuDropdown",null,t),d=C.useRef(null),h=Ei(),p=en(u,y=>{(y.key==="ArrowUp"||y.key==="ArrowDown")&&(y.preventDefault(),d.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),g=en(a,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),b=en(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return O.jsxs(yr.Dropdown,{...f,onMouseEnter:g,onMouseLeave:b,role:"menu","aria-orientation":"vertical",ref:Qn(e,d),...h.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:p,children:[h.withInitialFocusPlaceholder&&O.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),c]})});L0.classes=Ti;L0.displayName="@mantine/core/MenuDropdown";const[qY,Sf]=lf(),P0=Lt((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,color:a,closeMenuOnClick:l,leftSection:u,rightSection:c,children:f,disabled:d,"data-disabled":h,...p}=re("MenuItem",null,t),g=Ei(),b=Sf(),y=on(),{dir:E}=wo(),T=C.useRef(null),v=p,_=en(v.onClick,()=>{h||(typeof l=="boolean"?l&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately())}),k=a?y.variantColorResolver({color:a,theme:y,variant:"light"}):void 0,M=a?es({color:a,theme:y}):null,P=en(v.onKeyDown,F=>{F.key==="ArrowLeft"&&b&&(b.close(),b.focusParentItem())});return O.jsxs(yi,{onMouseDown:F=>F.preventDefault(),...p,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:Qn(T,e),role:"menuitem",disabled:d,"data-menu-item":!0,"data-disabled":d||h||void 0,"data-mantine-stop-propagation":!0,onClick:_,onKeyDown:o0({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:E,orientation:"vertical",onKeyDown:P}),__vars:{"--menu-item-color":M?.isThemeColor&&M?.shade===void 0?`var(--mantine-color-${M.color}-6)`:k?.color,"--menu-item-hover":k?.hover},children:[u&&O.jsx("div",{...g.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:u}),f&&O.jsx("div",{...g.getStyles("itemLabel",{styles:s,classNames:n}),children:f}),c&&O.jsx("div",{...g.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:c})]})});P0.classes=Ti;P0.displayName="@mantine/core/MenuItem";const B0=Ie((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...a}=re("MenuLabel",null,t),l=Ei();return O.jsx(pe,{ref:e,...l.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...a})});B0.classes=Ti;B0.displayName="@mantine/core/MenuLabel";const F0=Ie((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,onMouseEnter:a,onMouseLeave:l,onKeyDown:u,children:c,...f}=re("MenuSubDropdown",null,t),d=C.useRef(null),h=Ei(),p=Sf(),g=en(a,p?.open),b=en(l,p?.close);return O.jsx(yr.Dropdown,{...f,onMouseEnter:g,onMouseLeave:b,role:"menu","aria-orientation":"vertical",ref:Qn(e,d),...h.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:c})});F0.classes=Ti;F0.displayName="@mantine/core/MenuSubDropdown";const H0=Lt((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,color:a,leftSection:l,rightSection:u,children:c,disabled:f,"data-disabled":d,closeMenuOnClick:h,...p}=re("MenuSubItem",null,t),g=Ei(),b=Sf(),y=on(),{dir:E}=wo(),T=C.useRef(null),v=p,_=a?y.variantColorResolver({color:a,theme:y,variant:"light"}):void 0,k=a?es({color:a,theme:y}):null,M=en(v.onKeyDown,U=>{U.key==="ArrowRight"&&(b?.open(),b?.focusFirstItem()),U.key==="ArrowLeft"&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),P=en(v.onClick,()=>{!d&&h&&g.closeDropdownImmediately()}),F=en(v.onMouseEnter,b?.open),N=en(v.onMouseLeave,b?.close);return O.jsxs(yi,{onMouseDown:U=>U.preventDefault(),...p,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:Qn(T,e),role:"menuitem",disabled:f,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":f||d||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:F,onMouseLeave:N,onClick:P,onKeyDown:o0({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:E,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:_?.color,"--menu-item-hover":_?.hover},children:[l&&O.jsx("div",{...g.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:l}),c&&O.jsx("div",{...g.getStyles("itemLabel",{styles:s,classNames:n}),children:c}),O.jsx("div",{...g.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:u||O.jsx(rA,{...g.getStyles("chevron"),size:14})})]})});H0.classes=Ti;H0.displayName="@mantine/core/MenuSubItem";function gA({children:t,refProp:e}){if(!dk(t))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Ei(),O.jsx(yr.Target,{refProp:e,popupType:"menu",children:t})}gA.displayName="@mantine/core/MenuSubTarget";const YY={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Io(t){const{children:e,closeDelay:n,openDelay:r,...i}=re("MenuSub",YY,t),s=xo(),[o,{open:a,close:l}]=kj(!1),u=Sf(),{openDropdown:c,closeDropdown:f}=nA({open:a,close:l,closeDelay:n,openDelay:r}),d=()=>window.setTimeout(()=>{document.getElementById(`${s}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),h=()=>window.setTimeout(()=>{document.getElementById(`${s}-target`)?.focus()},16);return O.jsx(qY,{value:{opened:o,close:f,open:c,focusFirstItem:d,focusParentItem:h,parentContext:u},children:O.jsx(yr,{opened:o,withinPortal:!1,withArrow:!1,id:s,...i,children:e})})}Io.extend=t=>t;Io.displayName="@mantine/core/MenuSub";Io.Target=gA;Io.Dropdown=F0;Io.Item=H0;const KY={refProp:"ref"},bA=C.forwardRef((t,e)=>{const{children:n,refProp:r,...i}=re("MenuTarget",KY,t),s=dl(n);if(!s)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const o=Ei(),a=s.props,l=en(a.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),u=en(a.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),c=en(a.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return O.jsx(yr.Target,{refProp:r,popupType:"menu",ref:e,...i,children:C.cloneElement(s,{onClick:l,onMouseEnter:u,onMouseLeave:c,"data-expanded":o.opened?!0:void 0})})});bA.displayName="@mantine/core/MenuTarget";const GY={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function qn(t){const e=re("Menu",GY,t),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:o,trapFocus:a,onChange:l,closeOnItemClick:u,loop:c,closeOnEscape:f,trigger:d,openDelay:h,closeDelay:p,classNames:g,styles:b,unstyled:y,variant:E,vars:T,menuItemTabIndex:v,keepMounted:_,withInitialFocusPlaceholder:k,attributes:M,...P}=e,F=Ne({name:"Menu",classes:Ti,props:e,classNames:g,styles:b,unstyled:y,attributes:M}),[N,U]=So({value:s,defaultValue:o,finalValue:!1,onChange:l}),[j,V]=C.useState(!1),I=()=>{U(!1),V(!1),N&&i?.()},L=()=>{U(!0),!N&&r?.()},Z=()=>{N?I():L()},{openDropdown:H,closeDropdown:D}=nA({open:L,close:I,closeDelay:p,openDelay:h}),z=G=>aj("[data-menu-item]","[data-menu-dropdown]",G),{resolvedClassNames:x,resolvedStyles:ne}=ff({classNames:g,styles:b,props:e});return O.jsx(WY,{value:{getStyles:F,opened:N,toggleDropdown:Z,getItemIndex:z,openedViaClick:j,setOpenedViaClick:V,closeOnItemClick:u,closeDropdown:d==="click"?I:D,openDropdown:d==="click"?L:H,closeDropdownImmediately:I,loop:c,trigger:d,unstyled:y,menuItemTabIndex:v,withInitialFocusPlaceholder:k},children:O.jsx(yr,{returnFocus:!0,...P,opened:N,onChange:Z,defaultOpened:o,trapFocus:_?!1:a,closeOnEscape:f,__staticSelector:"Menu",classNames:x,styles:ne,unstyled:y,variant:E,keepMounted:_,children:n})})}qn.extend=t=>t;qn.withProps=PW(qn);qn.classes=Ti;qn.displayName="@mantine/core/Menu";qn.Item=P0;qn.Label=B0;qn.Dropdown=L0;qn.Target=bA;qn.Divider=D0;qn.Sub=Io;const XY={duration:100,transition:"fade"};function AE(t,e){return{...XY,...e,...t}}var wf={tooltip:"m_1b3c8819",arrow:"m_f898399f"};function QY({offset:t,position:e,defaultOpened:n}){const[r,i]=C.useState(n),s=C.useRef(null),{x:o,y:a,elements:l,refs:u,update:c,placement:f}=b0({placement:e,middleware:[Ep({crossAxis:!0,padding:5,rootBoundary:"document"})]}),d=f.includes("right")?t:e.includes("left")?t*-1:0,h=f.includes("bottom")?t:e.includes("top")?t*-1:0,p=C.useCallback(({clientX:g,clientY:b})=>{u.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y:b,left:g+d,top:b+h,right:g,bottom:b}}})},[l.reference]);return C.useEffect(()=>{if(u.floating.current){const g=s.current;g.addEventListener("mousemove",p);const b=Kl(u.floating.current);return b.forEach(y=>{y.addEventListener("scroll",c)}),()=>{g.removeEventListener("mousemove",p),b.forEach(y=>{y.removeEventListener("scroll",c)})}}},[l.reference,u.floating.current,c,p,r]),{handleMouseMove:p,x:o,y:a,opened:r,setOpened:i,boundaryRef:s,floating:u.setFloating}}const ZY={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ul("popover")},JY=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:Dt(e),"--tooltip-bg":n?Lr(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),U0=Ie((t,e)=>{const n=re("TooltipFloating",ZY,t),{children:r,refProp:i,withinPortal:s,style:o,className:a,classNames:l,styles:u,unstyled:c,radius:f,color:d,label:h,offset:p,position:g,multiline:b,zIndex:y,disabled:E,defaultOpened:T,variant:v,vars:_,portalProps:k,attributes:M,...P}=n,F=on(),N=Ne({name:"TooltipFloating",props:n,classes:wf,className:a,style:o,classNames:l,styles:u,unstyled:c,attributes:M,rootSelector:"tooltip",vars:_,varsResolver:JY}),{handleMouseMove:U,x:j,y:V,opened:I,boundaryRef:L,floating:Z,setOpened:H}=QY({offset:p,position:g,defaultOpened:T}),D=dl(r);if(!D)throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const z=Qn(L,a0(D),e),x=D.props,ne=w=>{x.onMouseEnter?.(w),U(w),H(!0)},G=w=>{x.onMouseLeave?.(w),H(!1)};return O.jsxs(O.Fragment,{children:[O.jsx(so,{...k,withinPortal:s,children:O.jsx(pe,{...P,...N("tooltip",{style:{...Ak(o,F),zIndex:y,display:!E&&I?"block":"none",top:(V&&Math.round(V))??"",left:(j&&Math.round(j))??""}}),variant:v,ref:Z,mod:{multiline:b},children:h})}),C.cloneElement(D,{...x,[i]:z,onMouseEnter:ne,onMouseLeave:G})]})});U0.classes=wf;U0.displayName="@mantine/core/TooltipFloating";const yA=C.createContext(!1),eK=yA.Provider,tK=()=>C.useContext(yA),nK={openDelay:0,closeDelay:0};function $0(t){const{openDelay:e,closeDelay:n,children:r}=re("TooltipGroup",nK,t);return O.jsx(eK,{value:!0,children:O.jsx(mq,{delay:{open:e,close:n},children:r})})}$0.displayName="@mantine/core/TooltipGroup";$0.extend=t=>t;function rK(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function iK(t){const e=rK(t.middlewares),n=[IE(t.offset)];return e.shift&&n.push(Ep(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?mu():mu(e.flip)),n.push(RE({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?Yo():Yo(e.inline)):t.inline&&n.push(Yo()),n}function sK(t){const[e,n]=C.useState(t.defaultOpened),i=typeof t.opened=="boolean"?t.opened:e,s=tK(),o=xo(),a=C.useCallback(_=>{n(_),_&&y(o)},[o]),{x:l,y:u,context:c,refs:f,placement:d,middlewareData:{arrow:{x:h,y:p}={}}}=b0({strategy:t.strategy,placement:t.position,open:i,onOpenChange:a,middleware:iK(t),whileElementsMounted:eh}),{delay:g,currentId:b,setCurrentId:y}=gq(c,{id:o}),{getReferenceProps:E,getFloatingProps:T}=xq([hq(c,{enabled:t.events?.hover,delay:s?g:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch}),Cq(c,{enabled:t.events?.focus,visibleOnly:!0}),wq(c,{role:"tooltip"}),Eq(c,{enabled:typeof t.opened>"u"})]);Ha(()=>{t.onPositionChange?.(d)},[d]);const v=i&&b&&b!==o;return{x:l,y:u,arrowX:h,arrowY:p,reference:f.setReference,floating:f.setFloating,getFloatingProps:T,getReferenceProps:E,isGroupPhase:v,opened:i,placement:d}}const vE={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:ul("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},oK=(t,{radius:e,color:n,variant:r,autoContrast:i})=>{const s=t.variantColorResolver({theme:t,color:n||t.primaryColor,autoContrast:i,variant:r||"filled"});return{tooltip:{"--tooltip-radius":e===void 0?void 0:Dt(e),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},kf=Ie((t,e)=>{const n=re("Tooltip",vE,t),{children:r,position:i,refProp:s,label:o,openDelay:a,closeDelay:l,onPositionChange:u,opened:c,defaultOpened:f,withinPortal:d,radius:h,color:p,classNames:g,styles:b,unstyled:y,style:E,className:T,withArrow:v,arrowSize:_,arrowOffset:k,arrowRadius:M,arrowPosition:P,offset:F,transitionProps:N,multiline:U,events:j,zIndex:V,disabled:I,positionDependencies:L,onClick:Z,onMouseEnter:H,onMouseLeave:D,inline:z,variant:x,keepMounted:ne,vars:G,portalProps:w,mod:me,floatingStrategy:te,middlewares:le,autoContrast:_e,attributes:ye,target:ge,...De}=re("Tooltip",vE,n),{dir:We}=wo(),se=C.useRef(null),ie=sK({position:Fk(We,i),closeDelay:l,openDelay:a,onPositionChange:u,opened:c,defaultOpened:f,events:j,arrowRef:se,arrowOffset:k,offset:typeof F=="number"?F+(v?_/2:0):F,positionDependencies:[...L,ge??r],inline:z,strategy:te,middlewares:le});C.useEffect(()=>{const Pe=ge instanceof HTMLElement?ge:typeof ge=="string"?document.querySelector(ge):ge?.current||null;Pe&&ie.reference(Pe)},[ge,ie]);const de=Ne({name:"Tooltip",props:n,classes:wf,className:T,style:E,classNames:g,styles:b,unstyled:y,attributes:ye,rootSelector:"tooltip",vars:G,varsResolver:oK}),Me=dl(r);if(!ge&&!Me)throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");if(ge){const Pe=AE(N,{duration:100,transition:"fade"});return O.jsx(O.Fragment,{children:O.jsx(so,{...w,withinPortal:d,children:O.jsx(hi,{...Pe,keepMounted:ne,mounted:!I&&!!ie.opened,duration:ie.isGroupPhase?10:Pe.duration,children:Qe=>O.jsxs(pe,{...De,"data-fixed":te==="fixed"||void 0,variant:x,mod:[{multiline:U},me],...ie.getFloatingProps({ref:ie.floating,className:de("tooltip").className,style:{...de("tooltip").style,...Qe,zIndex:V,top:ie.y??0,left:ie.x??0}}),children:[o,O.jsx(pc,{ref:se,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:v,position:ie.placement,arrowSize:_,arrowOffset:k,arrowRadius:M,arrowPosition:P,...de("arrow")})]})})})})}const Be=Me.props,Ce=Qn(ie.reference,a0(Me),e),lt=AE(N,{duration:100,transition:"fade"});return O.jsxs(O.Fragment,{children:[O.jsx(so,{...w,withinPortal:d,children:O.jsx(hi,{...lt,keepMounted:ne,mounted:!I&&!!ie.opened,duration:ie.isGroupPhase?10:lt.duration,children:Pe=>O.jsxs(pe,{...De,"data-fixed":te==="fixed"||void 0,variant:x,mod:[{multiline:U},me],...ie.getFloatingProps({ref:ie.floating,className:de("tooltip").className,style:{...de("tooltip").style,...Pe,zIndex:V,top:ie.y??0,left:ie.x??0}}),children:[o,O.jsx(pc,{ref:se,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:v,position:ie.placement,arrowSize:_,arrowOffset:k,arrowRadius:M,arrowPosition:P,...de("arrow")})]})})}),C.cloneElement(Me,ie.getReferenceProps({onClick:Z,onMouseEnter:H,onMouseLeave:D,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...Be,className:Pr(T,Be.className),[s]:Ce}))]})});kf.classes=wf;kf.displayName="@mantine/core/Tooltip";kf.Floating=U0;kf.Group=$0;var EA={root:"m_18320242","skeleton-fade":"m_299c329c"};const aK={visible:!0,animate:!0},lK=(t,{width:e,height:n,radius:r,circle:i})=>({root:{"--skeleton-height":Y(n),"--skeleton-width":Y(i?n:e),"--skeleton-radius":i?"1000px":r===void 0?void 0:Dt(r)}}),TA=Ie((t,e)=>{const n=re("Skeleton",aK,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,width:u,height:c,circle:f,visible:d,radius:h,animate:p,mod:g,attributes:b,...y}=n,E=Ne({name:"Skeleton",classes:EA,props:n,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:b,vars:l,varsResolver:lK});return O.jsx(pe,{ref:e,...E("root"),mod:[{visible:d,animate:p},g],...y})});TA.classes=EA;TA.displayName="@mantine/core/Skeleton";var CA={root:"m_6d731127"};const uK={gap:"md",align:"stretch",justify:"flex-start"},cK=(t,{gap:e,align:n,justify:r})=>({root:{"--stack-gap":cl(e),"--stack-align":n,"--stack-justify":r}}),xA=Ie((t,e)=>{const n=re("Stack",uK,t),{classNames:r,className:i,style:s,styles:o,unstyled:a,vars:l,align:u,justify:c,gap:f,variant:d,attributes:h,...p}=n,g=Ne({name:"Stack",props:n,classes:CA,className:i,style:s,classNames:r,styles:o,unstyled:a,attributes:h,vars:l,varsResolver:cK});return O.jsx(pe,{ref:e,...g("root"),variant:d,...p})});xA.classes=CA;xA.displayName="@mantine/core/Stack";const[fK,V0]=af("Tabs component was not found in the tree");var hl={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const z0=Ie((t,e)=>{const n=re("TabsList",null,t),{children:r,className:i,grow:s,justify:o,classNames:a,styles:l,style:u,mod:c,...f}=n,d=V0();return O.jsx(pe,{...f,...d.getStyles("list",{className:i,style:u,classNames:a,styles:l,props:n,variant:d.variant}),ref:e,role:"tablist",variant:d.variant,mod:[{grow:s,orientation:d.orientation,placement:d.orientation==="vertical"&&d.placement,inverted:d.inverted},c],"aria-orientation":d.orientation,__vars:{"--tabs-justify":o},children:r})});z0.classes=hl;z0.displayName="@mantine/core/TabsList";const j0=Ie((t,e)=>{const n=re("TabsPanel",null,t),{children:r,className:i,value:s,classNames:o,styles:a,style:l,mod:u,keepMounted:c,...f}=n,d=V0(),h=d.value===s,p=d.keepMounted||c||h?r:null;return O.jsx(pe,{...d.getStyles("panel",{className:i,classNames:o,styles:a,style:[l,h?void 0:{display:"none"}],props:n}),ref:e,mod:[{orientation:d.orientation},u],role:"tabpanel",id:d.getPanelId(s),"aria-labelledby":d.getTabId(s),...f,children:p})});j0.classes=hl;j0.displayName="@mantine/core/TabsPanel";const W0=Ie((t,e)=>{const n=re("TabsTab",null,t),{className:r,children:i,rightSection:s,leftSection:o,value:a,onClick:l,onKeyDown:u,disabled:c,color:f,style:d,classNames:h,styles:p,vars:g,mod:b,tabIndex:y,...E}=n,T=on(),{dir:v}=wo(),_=V0(),k=a===_.value,M=F=>{_.onChange(_.allowTabDeactivation&&a===_.value?null:a),l?.(F)},P={classNames:h,styles:p,props:n};return O.jsxs(yi,{..._.getStyles("tab",{className:r,style:d,variant:_.variant,...P}),disabled:c,unstyled:_.unstyled,variant:_.variant,mod:[{active:k,disabled:c,orientation:_.orientation,inverted:_.inverted,placement:_.orientation==="vertical"&&_.placement},b],ref:e,role:"tab",id:_.getTabId(a),"aria-selected":k,tabIndex:y!==void 0?y:k||_.value===null?0:-1,"aria-controls":_.getPanelId(a),onClick:M,__vars:{"--tabs-color":f?Lr(f,T):void 0},onKeyDown:o0({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:_.activateTabWithKeyboard,loop:_.loop,orientation:_.orientation||"horizontal",dir:v,onKeyDown:u}),...E,children:[o&&O.jsx("span",{..._.getStyles("tabSection",P),"data-position":"left",children:o}),i&&O.jsx("span",{..._.getStyles("tabLabel",P),children:i}),s&&O.jsx("span",{..._.getStyles("tabSection",P),"data-position":"right",children:s})]})});W0.classes=hl;W0.displayName="@mantine/core/TabsTab";const _E="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",dK={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},hK=(t,{radius:e,color:n,autoContrast:r})=>({root:{"--tabs-radius":Dt(e),"--tabs-color":Lr(n,t),"--tabs-text-color":mW(r,t)?Tk({color:n,theme:t,autoContrast:r}):void 0}}),pl=Ie((t,e)=>{const n=re("Tabs",dK,t),{defaultValue:r,value:i,onChange:s,orientation:o,children:a,loop:l,id:u,activateTabWithKeyboard:c,allowTabDeactivation:f,variant:d,color:h,radius:p,inverted:g,placement:b,keepMounted:y,classNames:E,styles:T,unstyled:v,className:_,style:k,vars:M,autoContrast:P,mod:F,attributes:N,...U}=n,j=xo(u),[V,I]=So({value:i,defaultValue:r,finalValue:null,onChange:s}),L=Ne({name:"Tabs",props:n,classes:hl,className:_,style:k,classNames:E,styles:T,unstyled:v,attributes:N,vars:M,varsResolver:hK});return O.jsx(fK,{value:{placement:b,value:V,orientation:o,id:j,loop:l,activateTabWithKeyboard:c,getTabId:tE(`${j}-tab`,_E),getPanelId:tE(`${j}-panel`,_E),onChange:I,allowTabDeactivation:f,variant:d,color:h,radius:p,inverted:g,keepMounted:y,unstyled:v,getStyles:L},children:O.jsx(pe,{ref:e,id:j,variant:d,mod:[{orientation:o,inverted:o==="horizontal"&&g,placement:o==="vertical"&&b},F],...L("root"),...U,children:a})})});pl.classes=hl;pl.displayName="@mantine/core/Tabs";pl.Tab=W0;pl.Panel=j0;pl.List=z0;const SA=Ie((t,e)=>{const n=re("TextInput",null,t);return O.jsx(_o,{component:"input",ref:e,...n,__staticSelector:"TextInput"})});SA.classes=_o.classes;SA.displayName="@mantine/core/TextInput";function OX(t){return ue({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(t)}let pK="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",DX=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=pK[n[t]&63];return e};export{iG as $,LK as A,kR as B,Xe as C,qe as D,Yn as E,q as F,PK as G,y3 as H,CK as I,oD as J,sD as K,JK as L,lo as M,HI as N,ZK as O,ot as P,RK as Q,rt as R,K0 as S,fe as T,IK as U,NK as V,AK as W,vK as X,_K as Y,wK as Z,kK as _,wt as a,SX as a$,eG as a0,tG as a1,nG as a2,rG as a3,ae as a4,Xi as a5,HK as a6,UK as a7,oi as a8,$K as a9,fU as aA,lG as aB,rN as aC,js as aD,pt as aE,bT as aF,FN as aG,Tu as aH,oo as aI,Gi as aJ,Fh as aK,vG as aL,SG as aM,dG as aN,kG as aO,kz as aP,wG as aQ,xG as aR,EG as aS,yG as aT,TG as aU,CG as aV,_G as aW,NG as aX,wX as aY,BG as aZ,MG as a_,zK as aa,VK as ab,WK as ac,jK as ad,qK as ae,eo as af,he as ag,jn as ah,Ht as ai,sG as aj,AO as ak,EK as al,Eh as am,SK as an,ni as ao,uG as ap,To as aq,B_ as ar,TK as as,$p as at,AI as au,cG as av,fG as aw,RN as ax,oG as ay,aG as az,ut as b,Zk as b$,LG as b0,hG as b1,pG as b2,mG as b3,bG as b4,gG as b5,RG as b6,pX as b7,IG as b8,CX as b9,rX as bA,mX as bB,yX as bC,gX as bD,EX as bE,bX as bF,sX as bG,oX as bH,tX as bI,xX as bJ,QG as bK,XG as bL,AG as bM,vX as bN,FG as bO,AX as bP,OG as bQ,nX as bR,kX as bS,jz as bT,_X as bU,bk as bV,eW as bW,dA as bX,sA as bY,R0 as bZ,IX as b_,HG as ba,jG as bb,zG as bc,YG as bd,qG as be,eX as bf,ZG as bg,JG as bh,UG as bi,GG as bj,cX as bk,fX as bl,dX as bm,aX as bn,lX as bo,uX as bp,NX as bq,iX as br,$G as bs,hX as bt,PG as bu,DG as bv,VG as bw,TX as bx,KG as by,WG as bz,NN as c,qn as c0,Cf as c1,OX as c2,bY as c3,pf as c4,kf as c5,RX as c6,tA as c7,Sj as c8,Tj as c9,C0 as ca,jk as cb,yr as cc,SA as cd,Ao as ce,xA as cf,lA as cg,MX as ch,pl as ci,mA as cj,TA as ck,v0 as cl,M0 as cm,DX as cn,Je as d,ee as e,yK as f,$N as g,$e as h,oe as i,MK as j,OK as k,zp as l,ao as m,zu as n,Go as o,pa as p,Ki as q,Ms as r,KK as s,DK as t,YI as u,XK as v,QK as w,GK as x,Ge as y,YK as z};
|