diff --git a/Docs-Site/guide/using-docwell.md b/Docs-Site/guide/using-docwell.md index 7ede499..d256659 100644 --- a/Docs-Site/guide/using-docwell.md +++ b/Docs-Site/guide/using-docwell.md @@ -14,8 +14,13 @@ Pages save as you type, and everyone with the page open sees changes and cursors | To | Do this | | --- | --- | -| Insert a heading, list, quote, code block, divider, image or file | Type `/` and pick from the menu (keep typing to filter) | -| Format text or add a link | Select it and use the toolbar that appears | +| Insert a heading, list, to-do list, table, callout, quote, code block, divider, image or file | Type `/` and pick from the menu (keep typing to filter); headings 4–6 are under **Other headings** | +| Start a to-do list | Type `[] ` at the start of a line | +| Format text, colour or highlight it, align it, or add a link | Select it and use the toolbar that appears | +| Move, duplicate, turn into another kind, or delete a block | Point at it and drag the ⠿ grip in the margin, or click the grip for a menu | +| Change a table | Click in it for the table toolbar; drag the grips on a row's left edge or a column's top edge to move it (or Ctrl+Alt+arrow keys) | +| Copy a link to a block | Ctrl+Shift+C in the desktop app, or the link button in the margin or the toolbar | +| Headings by keyboard | Ctrl+Shift+1 to 6, and Ctrl+Shift+0 for plain text | | Mention someone | Type `@` and their name | | Add an image or file | Paste or drop it, or use `/image`, `/file` or the paperclip in the header | | Undo | Ctrl+Z (your own changes only) | @@ -44,17 +49,18 @@ account. Turning it off makes the link stop working at once. Pages in the trash ## Import and export -- **Export:** the **⋯** menu in the page header saves the page as Markdown, HTML or PDF. PDFs are A4, with a bookmark - per heading and the page's images. Draw.io and Excalidraw diagrams become a link to their file, and Mermaid charts - show their source. +- **Export:** the **⋯** menu in the page header saves the page as Markdown, HTML, PDF or Word. PDFs are A4, with a + bookmark per heading and the page's images. Word files keep headings, lists, to-dos, callouts, tables, colours and + the page's images, and import back into Docwell as they were. Draw.io and Excalidraw diagrams become a link to their + file, and Mermaid charts show their source. - **Import:** **Import** on a space's page list creates a page per Markdown (`.md`, `.txt`), HTML or Word (`.docx`) file. A leading `# Heading`, or the Word document's title, becomes the page title. Word headings, lists, quotes, - links and images are kept. Up to 20 files at once. + tables, alignment, colours, links and images are kept. Up to 20 files at once. - **From Notion:** in Notion, choose **Settings → Export**, pick **Markdown & CSV** or **HTML** and include subpages and files. Import the `.zip` you get (up to 100 MB, 2000 pages) as it is. Docwell rebuilds the page tree, keeps links between the pages, and stores images and files as attachments. Each database becomes a page that lists its rows, - with the row pages under it. Tables in pages and databases come in as one line per row, since the editor has no - tables yet. + with the row pages under it. Tables in pages, and databases, come in as tables; callouts and to-do lists are kept. +- **To Notion:** export the page as Word or Markdown, then import that file with **Import** in Notion's sidebar. ## Trash diff --git a/Packages/api-client/src/index.ts b/Packages/api-client/src/index.ts index 0b083c1..3d6e42d 100644 --- a/Packages/api-client/src/index.ts +++ b/Packages/api-client/src/index.ts @@ -484,7 +484,7 @@ export function createClient(opts: ClientOptions) { "DELETE", `/api/v1/pages/${encodeURIComponent(id)}/access/groups/${encodeURIComponent(groupId)}`, ), - export: (id: string, format: "markdown" | "html" | "pdf") => + export: (id: string, format: "markdown" | "html" | "pdf" | "docx") => download(`/api/v1/pages/${encodeURIComponent(id)}/export${query({ format })}`), /** Records that the user opened the page, for their recent list. */ visit: (id: string) => post(`/api/v1/pages/${encodeURIComponent(id)}/visit`), diff --git a/Packages/api-client/src/schema.d.ts b/Packages/api-client/src/schema.d.ts index 5832d0e..338c985 100644 --- a/Packages/api-client/src/schema.d.ts +++ b/Packages/api-client/src/schema.d.ts @@ -1508,8 +1508,8 @@ export interface paths { cookie?: never; }; /** - * Download the page as Markdown, HTML or PDF - * @description Attachment links point at DOCWELL_PUBLIC_URL and need a file token to open. PDFs are A4 with a bookmark per heading; images stored on the page are drawn in, diagrams become a link to their file and Mermaid charts show their source. + * Download the page as Markdown, HTML, PDF or Word + * @description Attachment links point at DOCWELL_PUBLIC_URL and need a file token to open. PDFs are A4 with a bookmark per heading; images stored on the page are drawn in, diagrams become a link to their file and Mermaid charts show their source. Word files (docx) embed the page's images the same way and keep headings, lists, to-dos, callouts, tables, colours and alignment in a form Docwell imports back. */ get: operations["exportPage"]; put?: never; @@ -5586,7 +5586,7 @@ export interface operations { exportPage: { parameters: { query?: { - format?: "markdown" | "html" | "pdf"; + format?: "markdown" | "html" | "pdf" | "docx"; }; header?: never; path: { @@ -5605,6 +5605,7 @@ export interface operations { "text/markdown": string; "text/html": string; "application/pdf": string; + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": string; }; }; 400: components["responses"]["Error"]; diff --git a/Packages/editor-bridge/dist/index.html b/Packages/editor-bridge/dist/index.html index f8fb9db..56080ff 100644 --- a/Packages/editor-bridge/dist/index.html +++ b/Packages/editor-bridge/dist/index.html @@ -146,20 +146,20 @@ img.ProseMirror-separator { `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wk,this.editor.getAttributes(Tk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new E({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=vk(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=Gp({find:Ek,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Gp({find:Ek,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Tk)}),joinPredicate:e,editor:this.editor})),[t]}}),kk=/^\s*(\[([( |x])?\])\s$/,Ak=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,jk=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},Mk=Jp.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,A(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>op(e,t,`- [${e.attrs?.checked?`x`:` `}] `,void 0,{indentMainContent:!0}),addExtensions(){return this.options.nested?[kO(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=Ak;let l=e=>{let t=jk(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Lu(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Gp({find:kk,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Nk=Jp.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,A(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=rp(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=rp(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Tp.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(TO.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push($O.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ck.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ok.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Mk.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Nk.configure(this.options.taskList)),e}});var Pk=` `,Fk=`\xA0`,Ik=Jp.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,A(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===Pk||n[0].text===Pk||n[0].raw===Fk||n[0].text===Fk)&&r.length===1&&r[0].type===`text`&&(r[0].text===Pk||r[0].text===Fk)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?Pk:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Lk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Rk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,zk=_p.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,A(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Hp({find:Lk,type:this.type})]},addPasteRules(){return[Yp({find:Rk,type:this.type})]}}),Bk=Jp.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Vk=_p.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,A(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`${t.renderChildren(e)}`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.toLowerCase().indexOf(``)},tokenize(e,t,n){if(!/^/i.test(e))return;let r=/\\[\s\S]|`+|<\/u>/gi;r.lastIndex=3;let i=r.exec(e);for(;i;){if(i[0].startsWith("`")){let t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/.exec(e.slice(i.index));t&&(r.lastIndex=i.index+t[0].length)}else if(!i[0].startsWith(`\\`)){let t=e.slice(3,i.index);return t?{type:`underline`,raw:e.slice(0,r.lastIndex),text:t,tokens:n.inlineTokens(t)}:void 0}i=r.exec(e)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Hk=Tp.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(jT.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(ET.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(TO.configure(this.options.bulletList)),this.options.code!==!1&&e.push(FT.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(zT.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(VT.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Ww.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Gw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(HT.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(UT.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(gT.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(WT.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(YT.configure(this.options.italic)),this.options.listItem!==!1&&e.push($O.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ck.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(xO.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Ok.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ik.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(zk.configure(this.options.strike)),this.options.text!==!1&&e.push(Bk.configure(this.options.text)),this.options.underline!==!1&&e.push(Vk.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(hT.configure(this.options?.trailingNode)),e}}),Uk=Math.min,Wk=Math.max,Gk=Math.round,Kk=Math.floor,qk=e=>({x:e,y:e}),Jk={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Yk(e,t,n){return Wk(e,Uk(t,n))}function Xk(e,t){return typeof e==`function`?e(t):e}function Zk(e){return e.split(`-`)[0]}function Qk(e){return e.split(`-`)[1]}function $k(e){return e===`x`?`y`:`x`}function eA(e){return e===`y`?`height`:`width`}function tA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function nA(e){return $k(tA(e))}function rA(e,t,n){n===void 0&&(n=!1);let r=Qk(e),i=nA(e),a=eA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fA(o)),[o,fA(o)]}function iA(e){let t=fA(e);return[aA(e),t,aA(t)]}function aA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var oA=[`left`,`right`],sA=[`right`,`left`],cA=[`top`,`bottom`],lA=[`bottom`,`top`];function uA(e,t,n){switch(e){case`top`:case`bottom`:return n?t?sA:oA:t?oA:sA;case`left`:case`right`:return t?cA:lA;default:return[]}}function dA(e,t,n,r){let i=Qk(e),a=uA(Zk(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(aA)))),a}function fA(e){let t=Zk(e);return Jk[t]+e.slice(t.length)}function pA(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function mA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:pA(e)}function hA(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gA(e,t,n){let{reference:r,floating:i}=e,a=tA(t),o=nA(t),s=eA(o),c=Zk(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Qk(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function _A(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Xk(t,e),p=mA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=hA(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=hA(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var vA=50,yA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:_A},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=gA(l,r,c),f=r,p=0,m={};for(let n=0;ne<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===tA(t)||ne.every(e=>tA(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:ne},reset:{placement:t}};let n=ne.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=ne.filter(e=>{if(x){let t=tA(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},xA=new Set([`left`,`top`]);async function SA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zk(n),s=Qk(n),c=tA(n)===`y`,l=xA.has(o)?-1:1,u=a&&c?-1:1,d=Xk(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var CA=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await SA(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wA=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Xk(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=tA(i),p=$k(f),m=u[p],h=u[f],g=(e,t)=>Yk(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}};function TA(){return typeof window<`u`}function EA(e){return kA(e)?(e.nodeName||``).toLowerCase():`#document`}function DA(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function OA(e){return((kA(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kA(e){return TA()?e instanceof Node||e instanceof DA(e).Node:!1}function AA(e){return TA()?e instanceof Element||e instanceof DA(e).Element:!1}function jA(e){return TA()?e instanceof HTMLElement||e instanceof DA(e).HTMLElement:!1}function MA(e){return!TA()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof DA(e).ShadowRoot}function NA(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=WA(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function PA(e){return/^(table|td|th)$/.test(EA(e))}function FA(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var IA=/transform|translate|scale|rotate|perspective|filter/,LA=/paint|layout|strict|content/,RA=e=>!!e&&e!==`none`,zA;function BA(e){let t=AA(e)?WA(e):e;return RA(t.transform)||RA(t.translate)||RA(t.scale)||RA(t.rotate)||RA(t.perspective)||!HA()&&(RA(t.backdropFilter)||RA(t.filter))||IA.test(t.willChange||``)||LA.test(t.contain||``)}function VA(e){let t=KA(e);for(;jA(t)&&!UA(t);){if(BA(t))return t;if(FA(t))return null;t=KA(t)}return null}function HA(){return zA??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zA}function UA(e){return/^(html|body|#document)$/.test(EA(e))}function WA(e){return DA(e).getComputedStyle(e)}function GA(e){return AA(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function KA(e){if(EA(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||MA(e)&&e.host||OA(e);return MA(t)?t.host:t}function qA(e){let t=KA(e);return UA(t)?(e.ownerDocument||e).body:jA(t)&&NA(t)?t:qA(t)}function JA(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qA(e),i=r===e.ownerDocument?.body,a=DA(r);if(i){let e=YA(a);return t.concat(a,a.visualViewport||[],NA(r)?r:[],e&&n?JA(e):[])}return t.concat(r,JA(r,[],n))}function YA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XA(e){let t=WA(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=jA(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Gk(n)!==a||Gk(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ZA(e){return AA(e)?e:e.contextElement}function QA(e){let t=ZA(e);if(!jA(t))return qk(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=XA(t),o=(a?Gk(n.width):n.width)/r,s=(a?Gk(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var $A=qk(0);function ej(e){let t=DA(e);return!HA()||!t.visualViewport?$A:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tj(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===DA(e)}function nj(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ZA(e),o=qk(1);t&&(r?AA(r)&&(o=QA(r)):o=QA(e));let s=tj(a,n,r)?ej(a):qk(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=DA(a),t=AA(r)?DA(r):r,n=e,i=YA(n);for(;i&&t!==n;){let e=QA(i),t=i.getBoundingClientRect(),r=WA(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=DA(i),i=YA(n)}}return hA({width:u,height:d,x:c,y:l})}function rj(e,t){let n=GA(e).scrollLeft;return t?t.left+n:nj(OA(e)).left+n}function ij(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rj(e,n),y:n.top+t.scrollTop}}function aj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=OA(r),s=t?FA(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=qk(1),u=qk(0),d=jA(r);if((d||!a)&&((EA(r)!==`body`||NA(o))&&(c=GA(r)),d)){let e=nj(r);l=QA(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ij(o,c):qk(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function oj(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sj(e){let t=GA(e),n=e.ownerDocument.body,r=Wk(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Wk(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+rj(e),o=-t.scrollTop;return WA(n).direction===`rtl`&&(a+=Wk(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var cj=25;function lj(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=DA(e),a=OA(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!HA()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(rj(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=cj&&(s-=o)}return{width:s,height:c,x:l,y:u}}function uj(e,t){let n=nj(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=QA(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function dj(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=lj(e,n,t);else if(t===`document`)r=sj(OA(e));else if(AA(t))r=uj(t,n);else{let n=ej(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return hA(r)}function fj(e,t){let n=t.get(e);if(n)return n;let r=JA(e,[],!1).filter(e=>AA(e)&&EA(e)!==`body`),i=null,a=WA(e).position===`fixed`,o=a?KA(e):e;for(;AA(o)&&!UA(o);){let e=WA(o),t=BA(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=KA(o)}return t.set(e,r),r}function pj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?FA(t)?[]:fj(t,this._c):[].concat(n),r],o=dj(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=DA(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function wj(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ZA(e),u=i||a?[...l?JA(l):[],...t?JA(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Cj(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?nj(e):null;c&&g();function g(){let t=nj(e);h&&!Sj(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Tj=CA,Ej=wA,Dj=bA,Oj=(e,t,n)=>{let r=new Map,i=n??{},a={...xj,...i.platform,_c:r};return yA(e,t,{...i,platform:a})};function kj(e,t){return typeof e==`boolean`?e:t}var Aj=BT.extend({addOptions(){return{...this.parent(),lineNumbers:!1}},addAttributes(){return{...this.parent?.(),lineNumbers:{default:null,parseHTML:e=>{let t=e.getAttribute(`data-line-numbers`);return t===`true`||t!==`false`&&null},renderHTML:e=>typeof e.lineNumbers==`boolean`?{"data-line-numbers":String(e.lineNumbers)}:{}}}},addCommands(){return{...this.parent?.(),toggleCodeLineNumbers:()=>({editor:e,commands:t})=>{if(!e.isActive(this.name))return!1;let n=kj(e.getAttributes(this.name).lineNumbers,this.options.lineNumbers);return t.updateAttributes(this.name,{lineNumbers:!n})}}},addNodeView(){let e=this.options.lineNumbers,t=this.options.languageClassPrefix??`language-`;return({node:n})=>{let r=document.createElement(`pre`);r.className=`dw-code`;let i=document.createElement(`div`);i.className=`dw-code__gutter`,i.contentEditable=`false`,i.setAttribute(`aria-hidden`,`true`);let a=document.createElement(`code`);r.append(i,a);let o=-1,s=n=>{let s=kj(n.attrs.lineNumbers,e);r.classList.toggle(`dw-code--numbered`,s),a.className=n.attrs.language?`${t}${String(n.attrs.language)}`:``;let c=s?n.textContent.split(` `).length:0;c!==o&&(o=c,i.textContent=Array.from({length:c},(e,t)=>t+1).join(` -`))};return s(n),{dom:r,contentDOM:a,update:e=>e.type===n.type&&(s(e),!0),ignoreMutation:e=>i.contains(e.target)}}}}),jj=(e,t)=>e===`application/pdf`||typeof t==`string`&&/\.pdf$/i.test(t);function Mj(e,t,n,r){let i=!1,a=null,o=null,s=document.createElement(`div`);return s.className=`dw-pdf__status`,s.textContent=r.blocks.pdfLoading,e.replaceChildren(s),(async()=>{try{let c=await n();if(i)return;o=c.getDocument({url:t});let l=await o.promise;if(i)return;s.remove();let u=Math.max(e.clientWidth-2,200),d=window.devicePixelRatio||1;a=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=t.target;a?.unobserve(e),p(e,Number(e.dataset.page))}},{root:e,rootMargin:`400px 0px`});let f=(await l.getPage(1)).getViewport({scale:1});for(let t=1;t<=l.numPages;t++){let n=document.createElement(`div`);n.className=`dw-pdf__page`,n.dataset.page=String(t),n.style.aspectRatio=`${f.width} / ${f.height}`,n.setAttribute(`aria-label`,r.blocks.pdfPage.replace(`{n}`,String(t))),e.append(n),a.observe(n)}async function p(e,t){let n=await l.getPage(t);if(i)return;let r=u/n.getViewport({scale:1}).width,a=n.getViewport({scale:r*d}),o=document.createElement(`canvas`);o.width=Math.floor(a.width),o.height=Math.floor(a.height),e.style.aspectRatio=`${a.width} / ${a.height}`,e.append(o),await n.render({canvas:o,viewport:a}).promise}}catch{i||(s.textContent=r.blocks.loadFailed)}})(),()=>{i=!0,a?.disconnect(),o?.destroy()}}var Nj={page:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M9 12h6`,`M9 16h6`],"chevron-right":[`M10 6l6 6-6 6`],"chevron-down":[`M6 10l6 6 6-6`],"chevron-up":[`M6 14l6-6 6 6`],plus:[`M12 5v14`,`M5 12h14`],search:[`M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14z`,`M16.5 16.5L20 20`],more:[`M6 12h.01`,`M12 12h.01`,`M18 12h.01`],drop:[`M12 4h7v7a7 7 0 1 1-7-7z`],info:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M12 11v5`,`M12 8h.01`],check:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M8 12.5l2.5 2.5L16 9.5`],alert:[`M12 4l9 16H3z`,`M12 10v4`,`M12 17h.01`],error:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M9 9l6 6`,`M15 9l-6 6`],text:[`M5 6h14`,`M12 6v13`],heading:[`M6 5v14`,`M18 5v14`,`M6 12h12`],list:[`M9 6h11`,`M9 12h11`,`M9 18h11`,`M4.5 6h.01`,`M4.5 12h.01`,`M4.5 18h.01`],todo:[`M4 4h7v7H4z`,`M5.5 7.5l1.5 1.5 2.5-2.5`,`M14 7h6`,`M4 14h7v7H4z`,`M14 17h6`],code:[`M9 7l-5 5 5 5`,`M15 7l5 5-5 5`],quote:[`M6 6v12`,`M10 8h9`,`M10 12h9`,`M10 16h6`],image:[`M4 5h16v14H4z`,`M4 16l5-5 4 4 2-2 5 5`,`M15.5 8.5h.01`],table:[`M4 5h16v14H4z`,`M4 10h16`,`M4 15h16`,`M10 5v14`],lock:[`M6 11h12v9H6z`,`M8.5 11V8a3.5 3.5 0 0 1 7 0v3`],trash:[`M4 7h16`,`M10 4h4`,`M6 7l1 13h10l1-13`,`M10 11v6`,`M14 11v6`],settings:[`M4 7h9`,`M17 7h3`,`M15 5v4`,`M4 17h3`,`M11 17h9`,`M9 15v4`],menu:[`M4 7h16`,`M4 12h16`,`M4 17h16`],close:[`M6 6l12 12`,`M18 6L6 18`],open:[`M8 16L16 8`,`M9 8h7v7`],restore:[`M4.5 13a7.5 7.5 0 1 0 2.2-6.3`,`M5 4v4h4`],"sign-out":[`M14 4h5v16h-5`,`M10 8l-4 4 4 4`,`M6 12h9`],sidebar:[`M4 5h16v14H4z`,`M9.5 5v14`],home:[`M4 11l8-7 8 7`,`M6 9.5V20h12V9.5`,`M10 20v-5h4v5`],sun:[`M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z`,`M12 3v1.5`,`M12 19.5V21`,`M3 12h1.5`,`M19.5 12H21`,`M5.6 5.6l1.1 1.1`,`M17.3 17.3l1.1 1.1`,`M5.6 18.4l1.1-1.1`,`M17.3 6.7l1.1-1.1`],moon:[`M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z`],monitor:[`M4 5h16v11H4z`,`M9 20h6`,`M12 16v4`],selector:[`M8 9l4-4 4 4`,`M8 15l4 4 4-4`],star:[`M12 4l2.5 5.2 5.5.8-4 3.9.9 5.6L12 16.9l-4.9 2.6.9-5.6-4-3.9 5.5-.8z`],clock:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M12 7v5l3 2`],calendar:[`M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z`,`M4 10h16`,`M8 3v4`,`M16 3v4`],share:[`M12 4v11`,`M8 8l4-4 4 4`,`M6 13v7h12v-7`],link:[`M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1`,`M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1`],upload:[`M12 16V4`,`M7 9l5-5 5 5`,`M4 20h16`],download:[`M12 4v12`,`M7 11l5 5 5-5`,`M4 20h16`],file:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`],paperclip:[`M18 11.5l-6.4 6.4a4.2 4.2 0 0 1-6-6l7-7a2.8 2.8 0 0 1 4 4l-7 7a1.4 1.4 0 0 1-2-2l6.4-6.4`],comment:[`M5 5h14v10H9l-4 4z`],at:[`M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z`,`M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.1`],bold:[`M7 5h6a3.5 3.5 0 0 1 0 7H7z`,`M7 12h7a3.5 3.5 0 0 1 0 7H7z`],italic:[`M10 5h8`,`M6 19h8`,`M14 5l-4 14`],strike:[`M5 12h14`,`M16 7.5A3.5 3 0 0 0 12.5 5h-1A3.5 3 0 0 0 8 8c0 4 8 3 8 7.5a3.5 3.5 0 0 1-3.5 3.5h-1A3.5 3 0 0 1 8 16.5`],underline:[`M7 4v7a5 5 0 0 0 10 0V4`,`M5 20h14`],"list-ordered":[`M10 6h10`,`M10 12h10`,`M10 18h10`,`M4 5l1.5-1v5`,`M4 15.5a1.5 1.5 0 0 1 3 .5L4 19h3`],divider:[`M4 12h16`],globe:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M3 12h18`,`M12 3c2.5 2.5 3.5 5.5 3.5 9s-1 6.5-3.5 9`,`M12 3C9.5 5.5 8.5 8.5 8.5 12s1 6.5 3.5 9`],bell:[`M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z`,`M10 20a2 2 0 0 0 4 0`],"bell-off":[`M6 16V11a6 6 0 0 1 9.5-4.9`,`M18 11v5l1.5 2H8`,`M10 20a2 2 0 0 0 4 0`,`M4 4l16 16`],smile:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M8.5 14a4 4 0 0 0 7 0`,`M9 9.5h.01`,`M15 9.5h.01`],reply:[`M9 7L4 12l5 5`,`M4 12h10a6 6 0 0 1 6 6v1`],pencil:[`M15 5l4 4L8 20H4v-4z`],sigma:[`M18 6V4H6l6 8l-6 8h12v-2`],diagram:[`M4 4h6v5H4z`,`M14 15h6v5h-6z`,`M7 9v4a2 2 0 0 0 2 2h5`],video:[`M4 6h11v12H4z`,`M15 10l5-3v10l-5-3`],archive:[`M4 5h16v4H4z`,`M5 9v10h14V9`,`M10 13h4`],pin:[`M9 4h6`,`M10 4v6l-3 4h10l-3-4V4`,`M12 14v6`],width:[`M3 12h18`,`M7 8l-4 4 4 4`,`M17 8l4 4-4 4`],type:[`M5 7V5h14v2`,`M12 5v14`,`M9 19h6`],server:[`M4 4h16v6H4z`,`M4 14h16v6H4z`,`M8 7h.01`,`M8 17h.01`],users:[`M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7z`,`M3 20a6 6 0 0 1 12 0`,`M16 4.5a3.5 3.5 0 0 1 0 6.5`,`M18 14a6 6 0 0 1 3 6`],"align-left":[`M4 6h16`,`M4 10h10`,`M4 14h16`,`M4 18h10`],"align-center":[`M4 6h16`,`M7 10h10`,`M4 14h16`,`M7 18h10`],"align-right":[`M4 6h16`,`M10 10h10`,`M4 14h16`,`M10 18h10`],grip:[`M9 6h.01`,`M15 6h.01`,`M9 12h.01`,`M15 12h.01`,`M9 18h.01`,`M15 18h.01`],copy:[`M9 9h11v11H9z`,`M5 15H4V4h11v1`],"arrow-up":[`M12 19V5`,`M6 11l6-6 6 6`],"arrow-down":[`M12 5v14`,`M6 13l6 6 6-6`],callout:[`M4 5h16v14H4z`,`M8 10h.01`,`M11 10h5`,`M8 14h8`],palette:[`M12 3a9 9 0 1 0 0 18c1 0 1.5-.7 1.5-1.5 0-1.2-1-1.5-1-2.5s.8-1.5 2-1.5H17a4 4 0 0 0 4-4c0-4.7-4-8.5-9-8.5z`,`M7.5 11h.01`,`M10 7.5h.01`,`M14.5 7.5h.01`],"page-plus":[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M12 11v6`,`M9 14h6`]},Pj=`http://www.w3.org/2000/svg`;function Fj(e,t=18){let n=document.createElementNS(Pj,`svg`);for(let[e,r]of Object.entries({width:String(t),height:String(t),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))n.setAttribute(e,r);for(let t of Nj[e]){let e=document.createElementNS(Pj,`path`);e.setAttribute(`d`,t),n.append(e)}return n}function Ij(e){return()=>{let t=null,n=null,r=null,i=0,a=t=>{let n=r?.items[t];r&&n!==void 0&&e.pick(r,n)},o=()=>{if(!t||!r)return;let n=r;if(t.replaceChildren(),e.showQuery){let e=document.createElement(`div`);e.className=`dw-suggest__query`,e.textContent=`/${n.query}`,t.append(e)}if(n.items.length)n.items.forEach((n,r)=>{let o=e.toItem(n),s=document.createElement(`div`);s.className=r===i?`dw-suggest__item is-active`:`dw-suggest__item`,s.setAttribute(`role`,`option`),s.setAttribute(`aria-selected`,String(r===i)),s.addEventListener(`mousedown`,e=>{e.preventDefault(),a(r)});let c=document.createElement(`span`);c.className=`dw-suggest__icon`,c.append(Fj(o.icon??`text`));let l=document.createElement(`span`);l.className=`dw-suggest__text`;let u=document.createElement(`span`);if(u.className=`dw-suggest__label`,u.textContent=o.label,l.append(u),o.description){let e=document.createElement(`span`);e.className=`dw-suggest__desc`,e.textContent=o.description,l.append(e)}s.append(c,l),t.append(s)}),t.querySelector(`.is-active`)?.scrollIntoView({block:`nearest`});else{let n=document.createElement(`div`);n.className=`dw-suggest__empty`,n.setAttribute(`role`,`status`),n.textContent=e.empty,t.append(n)}},s=()=>{let e=r?.clientRect?.();if(!t||!e)return;let i={getBoundingClientRect:()=>r?.clientRect?.()??e};n?.(),n=wj(i,t,()=>{t&&Oj(i,t,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:n})=>{t&&Object.assign(t.style,{left:`${e}px`,top:`${n}px`})})})},c=()=>{n?.(),n=null,t?.remove(),t=null};return{onStart(n){r=n,i=0,t=document.createElement(`div`),t.className=`dw-suggest`,t.setAttribute(`role`,`listbox`),t.setAttribute(`aria-label`,e.label),document.body.append(t),o(),s()},onUpdate(e){e.items!==r?.items&&(i=0),r=e,o(),s()},onKeyDown({event:e}){let t=r?.items.length??0;return e.key===`Escape`?(c(),!0):t?e.key===`ArrowDown`||e.key===`ArrowUp`?(i=(i+(e.key===`ArrowDown`?1:-1)+t)%t,o(),!0):e.key===`Enter`||e.key===`Tab`?(a(i),!0):!1:!1},onExit(){r=null,c()}}}}var Lj=[[`text`,`text`,e=>e],[`h1`,`heading`,e=>e.setNode(`heading`,{level:1})],[`h2`,`heading`,e=>e.setNode(`heading`,{level:2})],[`h3`,`heading`,e=>e.setNode(`heading`,{level:3})],[`bullet`,`list`,e=>e.toggleBulletList()],[`ordered`,`list-ordered`,e=>e.toggleOrderedList()],[`todo`,`todo`,e=>e.toggleTaskList()],[`quote`,`quote`,e=>e.setBlockquote()],[`code`,`code`,e=>e.setCodeBlock()],[`callout`,`callout`,e=>e.setCallout()]],Rj=[`paragraph`,`heading`,`codeBlock`,`blockquote`,`bulletList`,`orderedList`,`taskList`,`callout`];function zj(e){let t={...e};return t.attrs&&`blockId`in t.attrs&&(t.attrs={...t.attrs,blockId:null}),t.content&&=t.content.map(zj),t}function Bj(e,t,n,r){let i=e.state.doc.nodeAt(t);if(!i)return[];let a=n.blockMenu,o=t+i.nodeSize,c=e.state.doc.resolve(t).index(0),l=[];if(Rj.includes(i.type.name)&&l.push({id:`turnInto`,label:a.turnInto,icon:`text`,children:Lj.map(([r,a,c])=>({id:r,icon:a,label:n.slash[r]?.label??r,run:()=>{if(r===`callout`){if(i.type.name===`callout`)return;let n=i.type.name===`blockquote`?i.content:s.from(i),r=e.schema.nodes.callout.create(null,n),a=e.state.tr.replaceWith(t,o,r);e.view.dispatch(a.setSelection(C.near(a.doc.resolve(t+1))).scrollIntoView()),e.commands.focus();return}let n=e.state.doc,a=C.findFrom(n.resolve(t),1,!0)?.from??t+1,l=C.findFrom(n.resolve(o),-1,!0)?.to??o-1;c(e.chain().focus().setTextSelection({from:a,to:l}).clearNodes()).run()}}))}),i.type.name===`codeBlock`){let n=!!e.extensionManager.extensions.find(e=>e.name===`codeBlock`)?.options.lineNumbers,r=kj(i.attrs.lineNumbers,n);l.push({id:`lineNumbers`,label:r?a.hideLineNumbers:a.showLineNumbers,icon:`list-ordered`,run:()=>e.view.dispatch(e.state.tr.setNodeAttribute(t,`lineNumbers`,!r))})}if(i.type.name===`fileAttachment`&&jj(i.attrs.mime,i.attrs.name)){let n=i.attrs.view===`preview`;l.push({id:`pdfView`,label:n?a.showAsFile:a.showPages,icon:n?`paperclip`:`file`,run:()=>e.view.dispatch(e.state.tr.setNodeAttribute(t,`view`,n?`card`:`preview`))})}return c>0&&l.push({id:`moveUp`,label:a.moveUp,icon:`arrow-up`,run:()=>{let n=e.state.doc.child(c-1),r=e.state.tr.delete(t,o).insert(t-n.nodeSize,i);e.view.dispatch(r.scrollIntoView())}}),c{let n=e.state.doc.child(c+1),r=e.state.tr.delete(t,o).insert(t+n.nodeSize,i);e.view.dispatch(r.scrollIntoView())}}),l.push({id:`duplicate`,label:a.duplicate,icon:`plus`,run:()=>{let t=e.schema.nodeFromJSON(zj(i.toJSON()));e.view.dispatch(e.state.tr.insert(o,t).scrollIntoView())}},{id:`copy`,label:a.copy,icon:`copy`,run:()=>{e.chain().focus().setNodeSelection(t).run(),document.execCommand(`copy`)}}),r&&l.push({id:`copyLink`,label:n.blocks.copyBlockLink,icon:`link`,run:r}),l.push({id:`delete`,label:a.delete,icon:`trash`,danger:!0,run:()=>{e.view.dispatch(e.state.tr.delete(t,o)),e.commands.focus()}}),l}function Vj(e,t,n,r){let i=document.createElement(`div`);i.className=`dw-suggest dw-block-menu`,i.setAttribute(`role`,`menu`),i.setAttribute(`aria-label`,n);let a=t,o=0,s=[],c=()=>{i.replaceChildren(),a.forEach((e,t)=>{let n=document.createElement(`button`);n.type=`button`,n.className=`dw-suggest__item${t===o?` is-active`:``}${e.danger?` is-danger`:``}`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,e.children&&n.setAttribute(`aria-haspopup`,`menu`);let r=document.createElement(`span`);r.className=`dw-suggest__icon`,r.append(Fj(e.icon));let a=document.createElement(`span`);if(a.className=`dw-suggest__label`,a.textContent=e.label,n.append(r,a),e.children){let e=Fj(`chevron-right`,14);e.classList.add(`dw-block-menu__more`),n.append(e)}n.addEventListener(`mousedown`,e=>e.preventDefault()),n.addEventListener(`click`,()=>l(t)),n.addEventListener(`mouseenter`,()=>{o=t;for(let[e,n]of[...i.children].entries())n.classList.toggle(`is-active`,e===t)}),i.append(n)}),i.children[o]?.focus()},l=e=>{let t=a[e];t&&(t.children?(s.push(a),a=t.children,o=0,c()):(m(),t.run?.()))},u=e=>{e.key===`Escape`||e.key===`ArrowLeft`&&s.length?(e.preventDefault(),e.stopPropagation(),s.length?(a=s.pop(),o=0,c()):m()):e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),o=(o+(e.key===`ArrowDown`?1:-1)+a.length)%a.length,c()):(e.key===`Enter`||e.key===` `||e.key===`ArrowRight`)&&(e.preventDefault(),(e.key!==`ArrowRight`||a[o]?.children)&&l(o))},d=t=>{!i.contains(t.target)&&!e.contains(t.target)&&m()};document.body.append(i);let f=wj(e,i,()=>{Oj(e,i,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(4),Dj(),Ej({padding:8})]}).then(({x:e,y:t})=>Object.assign(i.style,{left:`${e}px`,top:`${t}px`}))});i.addEventListener(`keydown`,u),document.addEventListener(`mousedown`,d,!0);let p=!1;function m(){p||(p=!0,f(),i.remove(),document.removeEventListener(`mousedown`,d,!0),s=[],r?.())}return c(),m}var Hj=[`paragraph`,`heading`,`blockquote`,`codeBlock`,`bulletList`,`orderedList`,`taskList`,`callout`,`table`,`details`,`image`,`embed`,`linkCard`,`mermaid`,`blockMath`,`drawio`,`excalidraw`,`fileAttachment`],Uj=/^[a-z0-9]{6,16}$/,Wj=e=>`#b-${e}`;function Gj(){return[...crypto.getRandomValues(new Uint8Array(8))].map(e=>(e%36).toString(36)).join(``)}function Kj(e,t){let n=e.state.doc.nodeAt(t);if(!n)return null;let r=n.attrs.blockId;if(r)return r;if(!e.editable||!Hj.includes(n.type.name))return null;let i=Gj();return e.dispatch(e.state.tr.setNodeAttribute(t,`blockId`,i)),i}var qj=Tp.create({name:`blockLinks`,addOptions(){return{labels:null,link:void 0,onCopied:void 0}},addGlobalAttributes(){return[{types:Hj,attributes:{blockId:{default:null,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-block-id`);return t&&Uj.test(t)?t:null},renderHTML:e=>e.blockId?{"data-block-id":e.blockId}:{}}}}]},addProseMirrorPlugins(){let{link:e,onCopied:t}=this.options,n=this.options.labels,r=this.editor;return[new E({key:new D(`blockLinks`),view:i=>new Xj(i,r,n,e,t)})]}}),Jj=``,Yj=``,Xj=class{view;editor;labels;link;onCopied;gutter=document.createElement(`div`);linkButton=document.createElement(`button`);grip=document.createElement(`button`);pos=-1;closeMenu=null;constructor(e,t,n,r,i){this.view=e,this.editor=t,this.labels=n,this.link=r,this.onCopied=i;let a=this.gutter;a.className=`dw-block-gutter`,a.contentEditable=`false`,a.hidden=!0,a.addEventListener(`mouseleave`,this.leave);let o=this.linkButton;o.type=`button`,o.className=`dw-block-handle`,o.setAttribute(`aria-label`,n.blocks.copyBlockLink),o.title=n.blocks.copyBlockLink,o.innerHTML=Jj,o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>void this.copy());let s=this.grip;s.type=`button`,s.className=`dw-block-handle dw-block-grip`,s.setAttribute(`aria-label`,n.blockMenu.open),s.setAttribute(`aria-haspopup`,`menu`),s.setAttribute(`aria-expanded`,`false`),s.title=n.blockMenu.open,s.innerHTML=Yj,s.draggable=!0,s.addEventListener(`click`,this.openMenu),s.addEventListener(`dragstart`,this.dragStart),s.addEventListener(`dragend`,()=>this.hide()),r&&a.append(o),a.append(s),e.dom.addEventListener(`mousemove`,this.move),e.dom.addEventListener(`mouseleave`,this.leave)}get host(){let e=this.view.dom.parentElement;return e&&this.gutter.parentElement!==e&&(e.classList.add(`dw-block-host`),e.append(this.gutter)),e}hide=()=>{this.closeMenu||(this.gutter.hidden=!0,this.pos=-1)};leave=e=>{let t=e.relatedTarget;t&&(this.gutter.contains(t)||this.view.dom.contains(t))||this.hide()};move=e=>{if(this.closeMenu)return;let t=e.target;for(;t&&t.parentElement!==this.view.dom;)t=t.parentElement;let n=this.host;if(!t||!n)return this.hide();let r;try{r=this.view.posAtDOM(t,0)}catch{return this.hide()}let i=this.view.state.doc.resolve(Math.min(r,this.view.state.doc.content.size)),a=i.depth>=1?i.before(1):r,o=this.view.state.doc.nodeAt(a);if(!o)return this.hide();let s=!!this.link&&Hj.includes(o.type.name)&&(!!o.attrs.blockId||this.view.editable),c=this.view.editable;if(!s&&!c)return this.hide();this.linkButton.hidden=!s,this.grip.hidden=!c,this.pos=a;let l=t.getBoundingClientRect(),u=n.getBoundingClientRect();this.gutter.style.top=`${l.top-u.top+Math.min(l.height/2,14)-11}px`,this.gutter.hidden=!1};openMenu=()=>{if(this.closeMenu){this.closeMenu();return}let e=this.pos;if(e<0||!this.view.editable)return;let t=this.view.state.doc.nodeAt(e),n=!!this.link&&!!t&&Hj.includes(t.type.name),r=Bj(this.editor,e,this.labels,n?()=>void this.copy(e):void 0);this.grip.setAttribute(`aria-expanded`,`true`),this.closeMenu=Vj(this.grip,r,this.labels.blockMenu.open,()=>{this.closeMenu=null,this.grip.setAttribute(`aria-expanded`,`false`),this.hide()})};dragStart=e=>{let t=this.pos;if(t<0||!e.dataTransfer)return;this.closeMenu?.();let n=T.create(this.view.state.doc,t);this.view.dispatch(this.view.state.tr.setSelection(n)),e.dataTransfer.effectAllowed=`copyMove`,e.dataTransfer.setData(`text/plain`,n.node.textContent);let r=this.view.nodeDOM(t);r instanceof HTMLElement&&e.dataTransfer.setDragImage(r,0,0),this.view.dragging={slice:n.content(),move:!0}};async copy(e=this.pos){if(e<0||!this.link)return;let t=Kj(this.view,e);if(!t)return;let n=this.link(Wj(t));try{await navigator.clipboard.writeText(n),this.onCopied?.(n)}catch{window.prompt(``,n)}}update(){this.pos>=this.view.state.doc.content.size&&this.hide()}destroy(){this.closeMenu?.(),this.gutter.parentElement?.classList.remove(`dw-block-host`),this.gutter.remove(),this.view.dom.removeEventListener(`mousemove`,this.move),this.view.dom.removeEventListener(`mouseleave`,this.leave)}},Zj,Qj;if(typeof WeakMap<`u`){let e=new WeakMap;Zj=t=>e.get(t),Qj=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Zj=t=>{for(let n=0;n(t==10&&(t=0),e[t++]=n,e[t++]=r)}var $j=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;er&&(a+=i.attrs.colspan)}}for(let e=0;e1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function nM(e,t,n){e.problems||=[];let r={};for(let i=0;i0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function sM(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function cM(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function lM(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=oM(t.$head)||uM(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function uM(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function dM(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function fM(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function pM(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function mM(e,t,n){let r=e.node(-1),i=$j.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function hM(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function gM(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;ee!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Cn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(dM(r)&&dM(i)&&pM(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return w.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=$j.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n0||u>0){let e=c.attrs;if(l>0&&(e=hM(e,0,l)),u>0&&(e=hM(e,e.colspan-u,u)),s.leftr.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=$j.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom0&&(n=c.resolve(a+i.map[s.left])),o.bottom0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=$j.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right{t.push(vs.node(n,n+e.nodeSize,{class:`selectedCell`}))}),xs.create(e.doc,t)}function xM({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(i+1)=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function SM({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function CM(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof T&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=vM.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=vM.rowSelection(e,e)}else if(!n){let e=$j.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=vM.create(i,t+1,n)}}else r instanceof w&&xM(r)?a=w.create(i,r.from):r instanceof w&&SM(r)&&(a=w.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var wM=new D(`fix-tables`);function TM(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o{t.type.spec.tableRole==`table`&&(n=DM(e,t,r,n))};return t?t.doc!=e.doc&&TM(t.doc,e.doc,0,r):e.doc.descendants(r),n}function DM(e,t,n,r){let i=$j.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n0?-1:0;_M(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o0&&i0&&t.map[s-1]==c||i0?-1:0;PM(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a0&&i0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i0&&n[a]==n[a-1]||r.right0&&n[i]==n[i-e]||r.bottom0){let e=c+1+l.content.size,t=BM(l)?c+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new vM(n.doc.resolve(c+r.tableStart))),t(n)}return!0}function UM(e,t){let n=iM(e.schema);return WM(({node:e})=>n[e.type.spec.tableRole])(e,t)}function WM(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof vM){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=sM(r.$from),!i)return!1;a=oM(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=OM(t),u=t.tr;for(let e=0;e{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function KM(e){return function(t,n){if(!cM(t))return!1;if(n){let r=iM(t.schema),i=OM(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}JM(`row`,{useDeprecatedLogic:!0}),JM(`column`,{useDeprecatedLogic:!0});var YM=JM(`cell`,{useDeprecatedLogic:!0});function XM(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function $M(e,t){let n=e.selection;if(!(n instanceof vM))return!1;if(t){let r=e.tr,i=iM(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new p(i,0,0))}),r.docChanged&&t(r)}return!0}function eN(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t=t.length&&t.push(s.empty),n[i]r&&(s=s.type.createChecked(hM(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;ni&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(s.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function iN(e,t,n,r,i,a,o){let c=e.doc.type.schema,l=iM(c),u,d;if(i>t.width)for(let a=0,s=0;at.height){let c=[];for(let e=0,r=(t.height-1)*t.width;e=t.width?!1:n.nodeAt(t.map[r+e]).type==l.header_cell;c.push(i?d||=l.header_cell.createAndFill():u||=l.cell.createAndFill())}let f=l.row.create(null,s.from(c)),p=[];for(let e=t.height;e{if(!i)return!1;let a=n.selection;if(a instanceof vM)return lN(n,r,C.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=hN(i,e,t);if(o==null)return!1;if(e==`horiz`)return lN(n,r,C.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=mM(i,e,t),s;return s=a?C.near(a,1):t<0?C.near(n.doc.resolve(i.before(-1)),-1):C.near(n.doc.resolve(i.after(-1)),1),lN(n,r,s)}}}function dN(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof vM)o=a;else{let r=hN(i,e,t);if(r==null)return!1;o=new vM(n.doc.resolve(r))}let s=mM(o.$headCell,e,t);return s?lN(n,r,new vM(o.$anchorCell,s)):!1}}function fN(e,t){let n=e.state.doc,r=oM(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new vM(r))),!0):!1}function pN(e,t,n){if(!cM(e.state))return!1;let r=eN(n),i=e.state.selection;if(i instanceof vM){r||={width:1,height:1,rows:[s.from(nN(iM(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=$j.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=rN(r,o.right-o.left,o.bottom-o.top),sN(e.state,e.dispatch,a,o,r),!0}if(r){let t=lM(e.state),n=t.start(-1);return sN(e.state,e.dispatch,n,$j.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function mN(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=gN(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof vM)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=oM(e.state.selection.$anchor))!=null&&_N(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=_N(e,n),i=aM.getState(e.state)==null;if(!r||!pM(t,r)){if(i)r=t;else return}let a=new vM(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(aM,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),aM.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(aM,-1))}function o(r){let o=r,s=aM.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(gN(e,o.target)!=n&&(c=_N(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function hN(e,t,n){if(!(e.state.selection instanceof w))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function gN(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function _N(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&oM(e.state.doc.resolve(r))||oM(e.state.doc.resolve(i))}var vN=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),yN(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,yN(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function yN(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;enew r(e,n,t)),new SN(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=bN.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{CN(t,n,e,i)},mouseleave:e=>{wN(e)},mousedown:(e,r)=>{TN(e,r,t,n)}},decorations:e=>{let t=bN.getState(e);if(t&&t.activeHandle>-1)return PN(e,t.activeHandle)},nodeViews:{}}});return a}var SN=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(bN);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return dM(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function CN(e,t,n,r){if(!e.editable)return;let i=bN.getState(e.state);if(i&&!i.dragging){let a=DN(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ON(e,t,`left`,n):i-t.clientX<=n&&(o=ON(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=$j.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}AN(e,o)}}}function wN(e){if(!e.editable)return;let t=bN.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&AN(e,-1)}function TN(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=bN.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=EN(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(bN,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=bN.getState(e.state);r?.dragging&&(jN(e,r.activeHandle,kN(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(bN,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=bN.getState(e.state);if(i&&i.dragging){let a=kN(i.dragging,t,n);MN(e,i.activeHandle,a,r)}}return MN(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function EN(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;eLN(e),renderHTML:e=>{let t=IN(e.align);return Pf(t)?{style:`text-align: ${t}`}:{}}}}function BN(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function VN(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):BN(e)}var HN=/[ \t\r\n\f]+/g;function UN(e){return e.children.length>0?!1:(e.textContent??``).replace(HN,``)===``}function WN(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function GN(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var KN=Jp.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:VN},align:zN()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>UN(e)?{}:!1,getContent:(e,t)=>WN(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=A(this.options.HTMLAttributes,e);return GN(t,e,`colspan`),GN(t,e,`rowspan`),[`td`,t,0]}}),qN=Jp.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:VN},align:zN()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>UN(e)?{}:!1,getContent:(e,t)=>WN(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=A(this.options.HTMLAttributes,e);return GN(t,e,`colspan`),GN(t,e,`rowspan`),[`th`,t,0]}}),JN=Jp.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,A(this.options.HTMLAttributes,e),0]}});function YN(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function XN(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function tP(e,t,n,r,i){let a=eP(e),o=[],s=[];for(let e=0;e{let{selection:t}=e.state;if(!nP(t))return!1;let n=0;return vu(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function iP(e,t){let n=e.mapping.map(t);if(vu(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(w.near(e.doc.resolve(i),-1))}function aP(e){let t=``,n=0;for(;ne===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function oP(e){return e.split(` -`).map(e=>!e.includes(`|`)||!e.includes("`")?e:aP(e)).join(` -`)}function sP(e){return(e||``).replaceAll(``,` `).replace(/\s+/g,` `).trim()}function cP(e,t){return t?e.split(t).join(` -`):e}function lP(e){return e.replace(/\\.|\|/g,e=>e===`|`?`\\|`:e)}function uP(e,t,n={}){if(!e||!e.content||e.content.length===0)return``;let r=[];e.content.forEach(e=>{let i=[];e.content&&e.content.forEach(e=>{let r=``;r=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>cP(t.renderChildren(e),n.cellLineSeparator)).join(` -`):cP(e.content?t.renderChildren(e.content):``,n.cellLineSeparator);let a=lP(sP(r.replace(/[ \t]*\r?\n[ \t]*/g,`
`))),o=e.type===`tableHeader`,s=RN(e.attrs);i.push({text:a,isHeader:o,align:s})}),r.push(i)});let i=r.reduce((e,t)=>Math.max(e,t.length),0);if(i===0)return``;let a=Array.from({length:i}).fill(0);r.forEach(e=>{for(let t=0;ta[t]&&(a[t]=n),a[t]<3&&(a[t]=3)}});let o=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),s=r[0],c=s.some(e=>e.isHeader),l=Array.from({length:i}).fill(null);r.forEach(e=>{for(let t=0;tc&&s[t]&&s[t].text||``);return u+=`| ${d.map((e,t)=>o(e,a[t])).join(` | `)} |\n`,u+=`| ${a.map((e,t)=>{let n=Math.max(3,e),r=l[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(c?r.slice(1):r).forEach(e=>{u+=`| ${Array.from({length:i}).fill(0).map((t,n)=>o(e[n]&&e[n].text||``,a[n])).join(` | `)} |\n`}),u}var dP=new D(`preserveCellSelectionOnContextMenu`);function fP(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(n)return n.pos;if(!(t.target instanceof Node))return null;try{return e.posAtDOM(t.target,0)}catch{return null}}function pP(e,t){let n=!1;return e.forEachCell((e,r)=>{t>=r&&t{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=IN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=IN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>uP(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(` +`))};return s(n),{dom:r,contentDOM:a,update:e=>e.type===n.type&&(s(e),!0),ignoreMutation:e=>i.contains(e.target)}}}}),jj=(e,t)=>e===`application/pdf`||typeof t==`string`&&/\.pdf$/i.test(t);function Mj(e,t,n,r){let i=!1,a=null,o=null,s=document.createElement(`div`);return s.className=`dw-pdf__status`,s.textContent=r.blocks.pdfLoading,e.replaceChildren(s),(async()=>{try{let c=await n();if(i)return;o=c.getDocument({url:t});let l=await o.promise;if(i)return;s.remove();let u=Math.max(e.clientWidth-2,200),d=window.devicePixelRatio||1;a=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=t.target;a?.unobserve(e),p(e,Number(e.dataset.page))}},{root:e,rootMargin:`400px 0px`});let f=(await l.getPage(1)).getViewport({scale:1});for(let t=1;t<=l.numPages;t++){let n=document.createElement(`div`);n.className=`dw-pdf__page`,n.dataset.page=String(t),n.style.aspectRatio=`${f.width} / ${f.height}`,n.setAttribute(`aria-label`,r.blocks.pdfPage.replace(`{n}`,String(t))),e.append(n),a.observe(n)}async function p(e,t){let n=await l.getPage(t);if(i)return;let r=u/n.getViewport({scale:1}).width,a=n.getViewport({scale:r*d}),o=document.createElement(`canvas`);o.width=Math.floor(a.width),o.height=Math.floor(a.height),e.style.aspectRatio=`${a.width} / ${a.height}`,e.append(o),await n.render({canvas:o,viewport:a}).promise}}catch{i||(s.textContent=r.blocks.loadFailed)}})(),()=>{i=!0,a?.disconnect(),o?.destroy()}}var Nj={page:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M9 12h6`,`M9 16h6`],"chevron-right":[`M10 6l6 6-6 6`],"chevron-down":[`M6 10l6 6 6-6`],"chevron-up":[`M6 14l6-6 6 6`],plus:[`M12 5v14`,`M5 12h14`],search:[`M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14z`,`M16.5 16.5L20 20`],more:[`M6 12h.01`,`M12 12h.01`,`M18 12h.01`],drop:[`M12 4h7v7a7 7 0 1 1-7-7z`],info:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M12 11v5`,`M12 8h.01`],check:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M8 12.5l2.5 2.5L16 9.5`],alert:[`M12 4l9 16H3z`,`M12 10v4`,`M12 17h.01`],error:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M9 9l6 6`,`M15 9l-6 6`],text:[`M5 6h14`,`M12 6v13`],heading:[`M6 5v14`,`M18 5v14`,`M6 12h12`],list:[`M9 6h11`,`M9 12h11`,`M9 18h11`,`M4.5 6h.01`,`M4.5 12h.01`,`M4.5 18h.01`],todo:[`M4 4h7v7H4z`,`M5.5 7.5l1.5 1.5 2.5-2.5`,`M14 7h6`,`M4 14h7v7H4z`,`M14 17h6`],code:[`M9 7l-5 5 5 5`,`M15 7l5 5-5 5`],quote:[`M6 6v12`,`M10 8h9`,`M10 12h9`,`M10 16h6`],image:[`M4 5h16v14H4z`,`M4 16l5-5 4 4 2-2 5 5`,`M15.5 8.5h.01`],table:[`M4 5h16v14H4z`,`M4 10h16`,`M4 15h16`,`M10 5v14`],lock:[`M6 11h12v9H6z`,`M8.5 11V8a3.5 3.5 0 0 1 7 0v3`],trash:[`M4 7h16`,`M10 4h4`,`M6 7l1 13h10l1-13`,`M10 11v6`,`M14 11v6`],settings:[`M4 7h9`,`M17 7h3`,`M15 5v4`,`M4 17h3`,`M11 17h9`,`M9 15v4`],menu:[`M4 7h16`,`M4 12h16`,`M4 17h16`],close:[`M6 6l12 12`,`M18 6L6 18`],open:[`M8 16L16 8`,`M9 8h7v7`],restore:[`M4.5 13a7.5 7.5 0 1 0 2.2-6.3`,`M5 4v4h4`],"sign-out":[`M14 4h5v16h-5`,`M10 8l-4 4 4 4`,`M6 12h9`],sidebar:[`M4 5h16v14H4z`,`M9.5 5v14`],home:[`M4 11l8-7 8 7`,`M6 9.5V20h12V9.5`,`M10 20v-5h4v5`],sun:[`M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z`,`M12 3v1.5`,`M12 19.5V21`,`M3 12h1.5`,`M19.5 12H21`,`M5.6 5.6l1.1 1.1`,`M17.3 17.3l1.1 1.1`,`M5.6 18.4l1.1-1.1`,`M17.3 6.7l1.1-1.1`],moon:[`M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z`],monitor:[`M4 5h16v11H4z`,`M9 20h6`,`M12 16v4`],selector:[`M8 9l4-4 4 4`,`M8 15l4 4 4-4`],star:[`M12 4l2.5 5.2 5.5.8-4 3.9.9 5.6L12 16.9l-4.9 2.6.9-5.6-4-3.9 5.5-.8z`],clock:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M12 7v5l3 2`],calendar:[`M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z`,`M4 10h16`,`M8 3v4`,`M16 3v4`],share:[`M12 4v11`,`M8 8l4-4 4 4`,`M6 13v7h12v-7`],link:[`M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1`,`M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1`],upload:[`M12 16V4`,`M7 9l5-5 5 5`,`M4 20h16`],download:[`M12 4v12`,`M7 11l5 5 5-5`,`M4 20h16`],file:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`],paperclip:[`M18 11.5l-6.4 6.4a4.2 4.2 0 0 1-6-6l7-7a2.8 2.8 0 0 1 4 4l-7 7a1.4 1.4 0 0 1-2-2l6.4-6.4`],comment:[`M5 5h14v10H9l-4 4z`],at:[`M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z`,`M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.1`],bold:[`M7 5h6a3.5 3.5 0 0 1 0 7H7z`,`M7 12h7a3.5 3.5 0 0 1 0 7H7z`],italic:[`M10 5h8`,`M6 19h8`,`M14 5l-4 14`],strike:[`M5 12h14`,`M16 7.5A3.5 3 0 0 0 12.5 5h-1A3.5 3 0 0 0 8 8c0 4 8 3 8 7.5a3.5 3.5 0 0 1-3.5 3.5h-1A3.5 3 0 0 1 8 16.5`],underline:[`M7 4v7a5 5 0 0 0 10 0V4`,`M5 20h14`],"list-ordered":[`M10 6h10`,`M10 12h10`,`M10 18h10`,`M4 5l1.5-1v5`,`M4 15.5a1.5 1.5 0 0 1 3 .5L4 19h3`],divider:[`M4 12h16`],globe:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M3 12h18`,`M12 3c2.5 2.5 3.5 5.5 3.5 9s-1 6.5-3.5 9`,`M12 3C9.5 5.5 8.5 8.5 8.5 12s1 6.5 3.5 9`],bell:[`M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z`,`M10 20a2 2 0 0 0 4 0`],"bell-off":[`M6 16V11a6 6 0 0 1 9.5-4.9`,`M18 11v5l1.5 2H8`,`M10 20a2 2 0 0 0 4 0`,`M4 4l16 16`],smile:[`M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18z`,`M8.5 14a4 4 0 0 0 7 0`,`M9 9.5h.01`,`M15 9.5h.01`],reply:[`M9 7L4 12l5 5`,`M4 12h10a6 6 0 0 1 6 6v1`],pencil:[`M15 5l4 4L8 20H4v-4z`],sigma:[`M18 6V4H6l6 8l-6 8h12v-2`],diagram:[`M4 4h6v5H4z`,`M14 15h6v5h-6z`,`M7 9v4a2 2 0 0 0 2 2h5`],video:[`M4 6h11v12H4z`,`M15 10l5-3v10l-5-3`],archive:[`M4 5h16v4H4z`,`M5 9v10h14V9`,`M10 13h4`],pin:[`M9 4h6`,`M10 4v6l-3 4h10l-3-4V4`,`M12 14v6`],width:[`M3 12h18`,`M7 8l-4 4 4 4`,`M17 8l4 4-4 4`],type:[`M5 7V5h14v2`,`M12 5v14`,`M9 19h6`],server:[`M4 4h16v6H4z`,`M4 14h16v6H4z`,`M8 7h.01`,`M8 17h.01`],users:[`M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7z`,`M3 20a6 6 0 0 1 12 0`,`M16 4.5a3.5 3.5 0 0 1 0 6.5`,`M18 14a6 6 0 0 1 3 6`],"align-left":[`M4 6h16`,`M4 10h10`,`M4 14h16`,`M4 18h10`],"align-center":[`M4 6h16`,`M7 10h10`,`M4 14h16`,`M7 18h10`],"align-right":[`M4 6h16`,`M10 10h10`,`M4 14h16`,`M10 18h10`],grip:[`M9 6h.01`,`M15 6h.01`,`M9 12h.01`,`M15 12h.01`,`M9 18h.01`,`M15 18h.01`],copy:[`M9 9h11v11H9z`,`M5 15H4V4h11v1`],"arrow-up":[`M12 19V5`,`M6 11l6-6 6 6`],"arrow-down":[`M12 5v14`,`M6 13l6 6 6-6`],callout:[`M4 5h16v14H4z`,`M8 10h.01`,`M11 10h5`,`M8 14h8`],palette:[`M12 3a9 9 0 1 0 0 18c1 0 1.5-.7 1.5-1.5 0-1.2-1-1.5-1-2.5s.8-1.5 2-1.5H17a4 4 0 0 0 4-4c0-4.7-4-8.5-9-8.5z`,`M7.5 11h.01`,`M10 7.5h.01`,`M14.5 7.5h.01`],"page-plus":[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M12 11v6`,`M9 14h6`]},Pj=`http://www.w3.org/2000/svg`;function Fj(e,t=18){let n=document.createElementNS(Pj,`svg`);for(let[e,r]of Object.entries({width:String(t),height:String(t),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))n.setAttribute(e,r);for(let t of Nj[e]){let e=document.createElementNS(Pj,`path`);e.setAttribute(`d`,t),n.append(e)}return n}function Ij(e){return()=>{let t=null,n=null,r=null,i=0,a=null,o=()=>a?.items??r?.items??[],s=t=>{let n=o()[t];if(!r||n===void 0)return;let s=e.children?.(n);s?.length?(a={parent:n,items:s},i=0,c()):e.pick(r,n)},c=()=>{if(!t||!r)return;let n=r;if(t.replaceChildren(),e.showQuery){let e=document.createElement(`div`);e.className=`dw-suggest__query`,e.textContent=`/${n.query}`,t.append(e)}if(a){let n=document.createElement(`div`);n.className=`dw-suggest__query`,n.textContent=`‹ ${e.toItem(a.parent).label}`,t.append(n)}let c=o();if(c.length)c.forEach((n,r)=>{let a=e.toItem(n),o=document.createElement(`div`);o.className=r===i?`dw-suggest__item is-active`:`dw-suggest__item`,o.setAttribute(`role`,`option`),o.setAttribute(`aria-selected`,String(r===i)),o.addEventListener(`mousedown`,e=>{e.preventDefault(),s(r)});let c=document.createElement(`span`);c.className=`dw-suggest__icon`,c.append(Fj(a.icon??`text`));let l=document.createElement(`span`);l.className=`dw-suggest__text`;let u=document.createElement(`span`);if(u.className=`dw-suggest__label`,u.textContent=a.label,l.append(u),a.description){let e=document.createElement(`span`);e.className=`dw-suggest__desc`,e.textContent=a.description,l.append(e)}if(o.append(c,l),e.children?.(n)?.length){o.setAttribute(`aria-haspopup`,`listbox`);let e=Fj(`chevron-right`,14);e.classList.add(`dw-suggest__more`),o.append(e)}t.append(o)}),t.querySelector(`.is-active`)?.scrollIntoView({block:`nearest`});else{let n=document.createElement(`div`);n.className=`dw-suggest__empty`,n.setAttribute(`role`,`status`),n.textContent=e.empty,t.append(n)}},l=()=>{let e=r?.clientRect?.();if(!t||!e)return;let i={getBoundingClientRect:()=>r?.clientRect?.()??e};n?.(),n=wj(i,t,()=>{t&&Oj(i,t,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:n})=>{t&&Object.assign(t.style,{left:`${e}px`,top:`${n}px`})})})},u=()=>{n?.(),n=null,t?.remove(),t=null};return{onStart(n){r=n,i=0,a=null,t=document.createElement(`div`),t.className=`dw-suggest`,t.setAttribute(`role`,`listbox`),t.setAttribute(`aria-label`,e.label),document.body.append(t),c(),l()},onUpdate(e){e.items!==r?.items&&(i=0,a=null),r=e,c(),l()},onKeyDown({event:t}){let n=o().length;if(a&&(t.key===`Escape`||t.key===`ArrowLeft`))return a=null,i=0,c(),!0;let r=o()[i];return t.key===`ArrowRight`&&r!==void 0&&e.children?.(r)?.length?(s(i),!0):t.key===`Escape`?(u(),!0):n?t.key===`ArrowDown`||t.key===`ArrowUp`?(i=(i+(t.key===`ArrowDown`?1:-1)+n)%n,c(),!0):t.key===`Enter`||t.key===`Tab`?(s(i),!0):!1:!1},onExit(){r=null,u()}}}}var Lj=[[`text`,`text`,e=>e],[`h1`,`heading`,e=>e.setNode(`heading`,{level:1})],[`h2`,`heading`,e=>e.setNode(`heading`,{level:2})],[`h3`,`heading`,e=>e.setNode(`heading`,{level:3})],[`bullet`,`list`,e=>e.toggleBulletList()],[`ordered`,`list-ordered`,e=>e.toggleOrderedList()],[`todo`,`todo`,e=>e.toggleTaskList()],[`quote`,`quote`,e=>e.setBlockquote()],[`code`,`code`,e=>e.setCodeBlock()],[`callout`,`callout`,e=>e.setCallout()]],Rj=[`paragraph`,`heading`,`codeBlock`,`blockquote`,`bulletList`,`orderedList`,`taskList`,`callout`];function zj(e){let t={...e};return t.attrs&&`blockId`in t.attrs&&(t.attrs={...t.attrs,blockId:null}),t.content&&=t.content.map(zj),t}function Bj(e,t,n,r){let i=e.state.doc.nodeAt(t);if(!i)return[];let a=n.blockMenu,o=t+i.nodeSize,c=e.state.doc.resolve(t).index(0),l=[];if(Rj.includes(i.type.name)&&l.push({id:`turnInto`,label:a.turnInto,icon:`text`,children:Lj.map(([r,a,c])=>({id:r,icon:a,label:n.slash[r]?.label??r,run:()=>{if(r===`callout`){if(i.type.name===`callout`)return;let n=i.type.name===`blockquote`?i.content:s.from(i),r=e.schema.nodes.callout.create(null,n),a=e.state.tr.replaceWith(t,o,r);e.view.dispatch(a.setSelection(C.near(a.doc.resolve(t+1))).scrollIntoView()),e.commands.focus();return}let n=e.state.doc,a=C.findFrom(n.resolve(t),1,!0)?.from??t+1,l=C.findFrom(n.resolve(o),-1,!0)?.to??o-1;c(e.chain().focus().setTextSelection({from:a,to:l}).clearNodes()).run()}}))}),i.type.name===`codeBlock`){let n=!!e.extensionManager.extensions.find(e=>e.name===`codeBlock`)?.options.lineNumbers,r=kj(i.attrs.lineNumbers,n);l.push({id:`lineNumbers`,label:r?a.hideLineNumbers:a.showLineNumbers,icon:`list-ordered`,run:()=>e.view.dispatch(e.state.tr.setNodeAttribute(t,`lineNumbers`,!r))})}if(i.type.name===`fileAttachment`&&jj(i.attrs.mime,i.attrs.name)){let n=i.attrs.view===`preview`;l.push({id:`pdfView`,label:n?a.showAsFile:a.showPages,icon:n?`paperclip`:`file`,run:()=>e.view.dispatch(e.state.tr.setNodeAttribute(t,`view`,n?`card`:`preview`))})}return c>0&&l.push({id:`moveUp`,label:a.moveUp,icon:`arrow-up`,run:()=>{let n=e.state.doc.child(c-1),r=e.state.tr.delete(t,o).insert(t-n.nodeSize,i);e.view.dispatch(r.scrollIntoView())}}),c{let n=e.state.doc.child(c+1),r=e.state.tr.delete(t,o).insert(t+n.nodeSize,i);e.view.dispatch(r.scrollIntoView())}}),l.push({id:`duplicate`,label:a.duplicate,icon:`plus`,run:()=>{let t=e.schema.nodeFromJSON(zj(i.toJSON()));e.view.dispatch(e.state.tr.insert(o,t).scrollIntoView())}},{id:`copy`,label:a.copy,icon:`copy`,run:()=>{e.chain().focus().setNodeSelection(t).run(),document.execCommand(`copy`)}}),r&&l.push({id:`copyLink`,label:n.blocks.copyBlockLink,icon:`link`,run:r}),l.push({id:`delete`,label:a.delete,icon:`trash`,danger:!0,run:()=>{e.view.dispatch(e.state.tr.delete(t,o)),e.commands.focus()}}),l}function Vj(e,t,n,r){let i=document.createElement(`div`);i.className=`dw-suggest dw-block-menu`,i.setAttribute(`role`,`menu`),i.setAttribute(`aria-label`,n);let a=t,o=0,s=[],c=()=>{i.replaceChildren(),a.forEach((e,t)=>{let n=document.createElement(`button`);n.type=`button`,n.className=`dw-suggest__item${t===o?` is-active`:``}${e.danger?` is-danger`:``}`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,e.children&&n.setAttribute(`aria-haspopup`,`menu`);let r=document.createElement(`span`);r.className=`dw-suggest__icon`,r.append(Fj(e.icon));let a=document.createElement(`span`);if(a.className=`dw-suggest__label`,a.textContent=e.label,n.append(r,a),e.children){let e=Fj(`chevron-right`,14);e.classList.add(`dw-block-menu__more`),n.append(e)}n.addEventListener(`mousedown`,e=>e.preventDefault()),n.addEventListener(`click`,()=>l(t)),n.addEventListener(`mouseenter`,()=>{o=t;for(let[e,n]of[...i.children].entries())n.classList.toggle(`is-active`,e===t)}),i.append(n)}),i.children[o]?.focus()},l=e=>{let t=a[e];t&&(t.children?(s.push(a),a=t.children,o=0,c()):(m(),t.run?.()))},u=e=>{e.key===`Escape`||e.key===`ArrowLeft`&&s.length?(e.preventDefault(),e.stopPropagation(),s.length?(a=s.pop(),o=0,c()):m()):e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),o=(o+(e.key===`ArrowDown`?1:-1)+a.length)%a.length,c()):(e.key===`Enter`||e.key===` `||e.key===`ArrowRight`)&&(e.preventDefault(),(e.key!==`ArrowRight`||a[o]?.children)&&l(o))},d=t=>{!i.contains(t.target)&&!e.contains(t.target)&&m()};document.body.append(i);let f=wj(e,i,()=>{Oj(e,i,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(4),Dj(),Ej({padding:8})]}).then(({x:e,y:t})=>Object.assign(i.style,{left:`${e}px`,top:`${t}px`}))});i.addEventListener(`keydown`,u),document.addEventListener(`mousedown`,d,!0);let p=!1;function m(){p||(p=!0,f(),i.remove(),document.removeEventListener(`mousedown`,d,!0),s=[],r?.())}return c(),m}var Hj=[`paragraph`,`heading`,`blockquote`,`codeBlock`,`bulletList`,`orderedList`,`taskList`,`callout`,`table`,`details`,`image`,`embed`,`linkCard`,`mermaid`,`blockMath`,`drawio`,`excalidraw`,`fileAttachment`],Uj=/^[a-z0-9]{6,16}$/,Wj=e=>`#b-${e}`;function Gj(){return[...crypto.getRandomValues(new Uint8Array(8))].map(e=>(e%36).toString(36)).join(``)}function Kj(e,t){let n=e.state.doc.nodeAt(t);if(!n)return null;let r=n.attrs.blockId;if(r)return r;if(!e.editable||!Hj.includes(n.type.name))return null;let i=Gj();return e.dispatch(e.state.tr.setNodeAttribute(t,`blockId`,i)),i}async function qj(e,t,n,r){let i=Kj(e,t);if(!i)return!1;let a=n(Wj(i));try{await navigator.clipboard.writeText(a),r?.(a)}catch{window.prompt(``,a)}return!0}var Jj=Tp.create({name:`blockLinks`,addOptions(){return{labels:null,link:void 0,onCopied:void 0}},addGlobalAttributes(){return[{types:Hj,attributes:{blockId:{default:null,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-block-id`);return t&&Uj.test(t)?t:null},renderHTML:e=>e.blockId?{"data-block-id":e.blockId}:{}}}}]},addKeyboardShortcuts(){let{link:e,onCopied:t}=this.options;return{"Mod-Shift-c":({editor:n})=>{if(!e)return!1;let r=n.state.selection.$from;if(r.depth<1)return!1;let i=r.before(1),a=n.state.doc.nodeAt(i);return!a||!Hj.includes(a.type.name)||!a.attrs.blockId&&!n.isEditable?!1:(qj(n.view,i,e,t),!0)}}},addProseMirrorPlugins(){let{link:e,onCopied:t}=this.options,n=this.options.labels,r=this.editor;return[new E({key:new D(`blockLinks`),view:i=>new Zj(i,r,n,e,t)})]}}),Yj=``,Xj=``,Zj=class{view;editor;labels;link;onCopied;gutter=document.createElement(`div`);linkButton=document.createElement(`button`);grip=document.createElement(`button`);pos=-1;closeMenu=null;constructor(e,t,n,r,i){this.view=e,this.editor=t,this.labels=n,this.link=r,this.onCopied=i;let a=this.gutter;a.className=`dw-block-gutter`,a.contentEditable=`false`,a.hidden=!0,a.addEventListener(`mouseleave`,this.leave);let o=this.linkButton;o.type=`button`,o.className=`dw-block-handle`,o.setAttribute(`aria-label`,n.blocks.copyBlockLink),o.title=n.blocks.copyBlockLink,o.innerHTML=Yj,o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>void this.copy());let s=this.grip;s.type=`button`,s.className=`dw-block-handle dw-block-grip`,s.setAttribute(`aria-label`,n.blockMenu.open),s.setAttribute(`aria-haspopup`,`menu`),s.setAttribute(`aria-expanded`,`false`),s.title=n.blockMenu.open,s.innerHTML=Xj,s.draggable=!0,s.addEventListener(`click`,this.openMenu),s.addEventListener(`dragstart`,this.dragStart),s.addEventListener(`dragend`,()=>this.hide()),r&&a.append(o),a.append(s),e.dom.addEventListener(`mousemove`,this.move),e.dom.addEventListener(`mouseleave`,this.leave)}get host(){let e=this.view.dom.parentElement;return e&&this.gutter.parentElement!==e&&(e.classList.add(`dw-block-host`),e.append(this.gutter)),e}hide=()=>{this.closeMenu||(this.gutter.hidden=!0,this.pos=-1)};leave=e=>{let t=e.relatedTarget;t&&(this.gutter.contains(t)||this.view.dom.contains(t))||this.hide()};move=e=>{if(this.closeMenu)return;let t=e.target;for(;t&&t.parentElement!==this.view.dom;)t=t.parentElement;let n=this.host;if(!t||!n)return this.hide();let r;try{r=this.view.posAtDOM(t,0)}catch{return this.hide()}let i=this.view.state.doc.resolve(Math.min(r,this.view.state.doc.content.size)),a=i.depth>=1?i.before(1):r,o=this.view.state.doc.nodeAt(a);if(!o)return this.hide();let s=!!this.link&&Hj.includes(o.type.name)&&(!!o.attrs.blockId||this.view.editable),c=this.view.editable;if(!s&&!c)return this.hide();this.linkButton.hidden=!s,this.grip.hidden=!c,this.pos=a;let l=t.getBoundingClientRect(),u=n.getBoundingClientRect();this.gutter.style.top=`${l.top-u.top+Math.min(l.height/2,14)-11}px`,this.gutter.hidden=!1};openMenu=()=>{if(this.closeMenu){this.closeMenu();return}let e=this.pos;if(e<0||!this.view.editable)return;let t=this.view.state.doc.nodeAt(e),n=!!this.link&&!!t&&Hj.includes(t.type.name),r=Bj(this.editor,e,this.labels,n?()=>void this.copy(e):void 0);this.grip.setAttribute(`aria-expanded`,`true`),this.closeMenu=Vj(this.grip,r,this.labels.blockMenu.open,()=>{this.closeMenu=null,this.grip.setAttribute(`aria-expanded`,`false`),this.hide()})};dragStart=e=>{let t=this.pos;if(t<0||!e.dataTransfer)return;this.closeMenu?.();let n=T.create(this.view.state.doc,t);this.view.dispatch(this.view.state.tr.setSelection(n)),e.dataTransfer.effectAllowed=`copyMove`,e.dataTransfer.setData(`text/plain`,n.node.textContent);let r=this.view.nodeDOM(t);r instanceof HTMLElement&&e.dataTransfer.setDragImage(r,0,0),this.view.dragging={slice:n.content(),move:!0}};async copy(e=this.pos){e>=0&&this.link&&await qj(this.view,e,this.link,this.onCopied)}update(){this.pos>=this.view.state.doc.content.size&&this.hide()}destroy(){this.closeMenu?.(),this.gutter.parentElement?.classList.remove(`dw-block-host`),this.gutter.remove(),this.view.dom.removeEventListener(`mousemove`,this.move),this.view.dom.removeEventListener(`mouseleave`,this.leave)}},Qj,$j;if(typeof WeakMap<`u`){let e=new WeakMap;Qj=t=>e.get(t),$j=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Qj=t=>{for(let n=0;n(t==10&&(t=0),e[t++]=n,e[t++]=r)}var eM=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;er&&(a+=i.attrs.colspan)}}for(let e=0;e1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function rM(e,t,n){e.problems||=[];let r={};for(let i=0;i0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function cM(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function lM(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function uM(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=sM(t.$head)||dM(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function dM(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function fM(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function pM(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function mM(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function hM(e,t,n){let r=e.node(-1),i=eM.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function gM(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function _M(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;ee!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Cn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(fM(r)&&fM(i)&&mM(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return w.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=eM.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n0||u>0){let e=c.attrs;if(l>0&&(e=gM(e,0,l)),u>0&&(e=gM(e,e.colspan-u,u)),s.leftr.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=eM.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom0&&(n=c.resolve(a+i.map[s.left])),o.bottom0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=eM.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right{t.push(vs.node(n,n+e.nodeSize,{class:`selectedCell`}))}),xs.create(e.doc,t)}function SM({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(i+1)=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function CM({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function wM(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof T&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=yM.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=yM.rowSelection(e,e)}else if(!n){let e=eM.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=yM.create(i,t+1,n)}}else r instanceof w&&SM(r)?a=w.create(i,r.from):r instanceof w&&CM(r)&&(a=w.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var TM=new D(`fix-tables`);function EM(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o{t.type.spec.tableRole==`table`&&(n=OM(e,t,r,n))};return t?t.doc!=e.doc&&EM(t.doc,e.doc,0,r):e.doc.descendants(r),n}function OM(e,t,n,r){let i=eM.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n0?-1:0;vM(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o0&&i0&&t.map[s-1]==c||i0?-1:0;FM(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a0&&i0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i0&&n[a]==n[a-1]||r.right0&&n[i]==n[i-e]||r.bottom0){let e=c+1+l.content.size,t=VM(l)?c+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new yM(n.doc.resolve(c+r.tableStart))),t(n)}return!0}function WM(e,t){let n=aM(e.schema);return GM(({node:e})=>n[e.type.spec.tableRole])(e,t)}function GM(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof yM){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=cM(r.$from),!i)return!1;a=sM(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=kM(t),u=t.tr;for(let e=0;e{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function qM(e){return function(t,n){if(!lM(t))return!1;if(n){let r=aM(t.schema),i=kM(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}YM(`row`,{useDeprecatedLogic:!0}),YM(`column`,{useDeprecatedLogic:!0});var XM=YM(`cell`,{useDeprecatedLogic:!0});function ZM(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function eN(e,t){let n=e.selection;if(!(n instanceof yM))return!1;if(t){let r=e.tr,i=aM(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new p(i,0,0))}),r.docChanged&&t(r)}return!0}function tN(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t=t.length&&t.push(s.empty),n[i]r&&(s=s.type.createChecked(gM(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;ni&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(s.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function aN(e,t,n,r,i,a,o){let c=e.doc.type.schema,l=aM(c),u,d;if(i>t.width)for(let a=0,s=0;at.height){let c=[];for(let e=0,r=(t.height-1)*t.width;e=t.width?!1:n.nodeAt(t.map[r+e]).type==l.header_cell;c.push(i?d||=l.header_cell.createAndFill():u||=l.cell.createAndFill())}let f=l.row.create(null,s.from(c)),p=[];for(let e=t.height;e{if(!i)return!1;let a=n.selection;if(a instanceof yM)return uN(n,r,C.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=gN(i,e,t);if(o==null)return!1;if(e==`horiz`)return uN(n,r,C.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=hM(i,e,t),s;return s=a?C.near(a,1):t<0?C.near(n.doc.resolve(i.before(-1)),-1):C.near(n.doc.resolve(i.after(-1)),1),uN(n,r,s)}}}function fN(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof yM)o=a;else{let r=gN(i,e,t);if(r==null)return!1;o=new yM(n.doc.resolve(r))}let s=hM(o.$headCell,e,t);return s?uN(n,r,new yM(o.$anchorCell,s)):!1}}function pN(e,t){let n=e.state.doc,r=sM(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new yM(r))),!0):!1}function mN(e,t,n){if(!lM(e.state))return!1;let r=tN(n),i=e.state.selection;if(i instanceof yM){r||={width:1,height:1,rows:[s.from(rN(aM(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=eM.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=iN(r,o.right-o.left,o.bottom-o.top),cN(e.state,e.dispatch,a,o,r),!0}if(r){let t=uM(e.state),n=t.start(-1);return cN(e.state,e.dispatch,n,eM.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function hN(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=_N(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof yM)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=sM(e.state.selection.$anchor))!=null&&vN(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=vN(e,n),i=oM.getState(e.state)==null;if(!r||!mM(t,r)){if(i)r=t;else return}let a=new yM(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(oM,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),oM.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(oM,-1))}function o(r){let o=r,s=oM.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(_N(e,o.target)!=n&&(c=vN(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function gN(e,t,n){if(!(e.state.selection instanceof w))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function _N(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function vN(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&sM(e.state.doc.resolve(r))||sM(e.state.doc.resolve(i))}var yN=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),bN(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,bN(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function bN(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;enew r(e,n,t)),new CN(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=xN.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{wN(t,n,e,i)},mouseleave:e=>{TN(e)},mousedown:(e,r)=>{EN(e,r,t,n)}},decorations:e=>{let t=xN.getState(e);if(t&&t.activeHandle>-1)return FN(e,t.activeHandle)},nodeViews:{}}});return a}var CN=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(xN);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return fM(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function wN(e,t,n,r){if(!e.editable)return;let i=xN.getState(e.state);if(i&&!i.dragging){let a=ON(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=kN(e,t,`left`,n):i-t.clientX<=n&&(o=kN(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=eM.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}jN(e,o)}}}function TN(e){if(!e.editable)return;let t=xN.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&jN(e,-1)}function EN(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=xN.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=DN(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(xN,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=xN.getState(e.state);r?.dragging&&(MN(e,r.activeHandle,AN(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(xN,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=xN.getState(e.state);if(i&&i.dragging){let a=AN(i.dragging,t,n);NN(e,i.activeHandle,a,r)}}return NN(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function DN(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;eRN(e),renderHTML:e=>{let t=LN(e.align);return Pf(t)?{style:`text-align: ${t}`}:{}}}}function VN(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function HN(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):VN(e)}var UN=/[ \t\r\n\f]+/g;function WN(e){return e.children.length>0?!1:(e.textContent??``).replace(UN,``)===``}function GN(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function KN(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var qN=Jp.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:HN},align:BN()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>WN(e)?{}:!1,getContent:(e,t)=>GN(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=A(this.options.HTMLAttributes,e);return KN(t,e,`colspan`),KN(t,e,`rowspan`),[`td`,t,0]}}),JN=Jp.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:HN},align:BN()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>WN(e)?{}:!1,getContent:(e,t)=>GN(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=A(this.options.HTMLAttributes,e);return KN(t,e,`colspan`),KN(t,e,`rowspan`),[`th`,t,0]}}),YN=Jp.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,A(this.options.HTMLAttributes,e),0]}});function XN(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function ZN(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function nP(e,t,n,r,i){let a=tP(e),o=[],s=[];for(let e=0;e{let{selection:t}=e.state;if(!rP(t))return!1;let n=0;return vu(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function aP(e,t){let n=e.mapping.map(t);if(vu(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(w.near(e.doc.resolve(i),-1))}function oP(e){let t=``,n=0;for(;ne===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function sP(e){return e.split(` +`).map(e=>!e.includes(`|`)||!e.includes("`")?e:oP(e)).join(` +`)}function cP(e){return(e||``).replaceAll(``,` `).replace(/\s+/g,` `).trim()}function lP(e,t){return t?e.split(t).join(` +`):e}function uP(e){return e.replace(/\\.|\|/g,e=>e===`|`?`\\|`:e)}function dP(e,t,n={}){if(!e||!e.content||e.content.length===0)return``;let r=[];e.content.forEach(e=>{let i=[];e.content&&e.content.forEach(e=>{let r=``;r=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>lP(t.renderChildren(e),n.cellLineSeparator)).join(` +`):lP(e.content?t.renderChildren(e.content):``,n.cellLineSeparator);let a=uP(cP(r.replace(/[ \t]*\r?\n[ \t]*/g,`
`))),o=e.type===`tableHeader`,s=zN(e.attrs);i.push({text:a,isHeader:o,align:s})}),r.push(i)});let i=r.reduce((e,t)=>Math.max(e,t.length),0);if(i===0)return``;let a=Array.from({length:i}).fill(0);r.forEach(e=>{for(let t=0;ta[t]&&(a[t]=n),a[t]<3&&(a[t]=3)}});let o=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),s=r[0],c=s.some(e=>e.isHeader),l=Array.from({length:i}).fill(null);r.forEach(e=>{for(let t=0;tc&&s[t]&&s[t].text||``);return u+=`| ${d.map((e,t)=>o(e,a[t])).join(` | `)} |\n`,u+=`| ${a.map((e,t)=>{let n=Math.max(3,e),r=l[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(c?r.slice(1):r).forEach(e=>{u+=`| ${Array.from({length:i}).fill(0).map((t,n)=>o(e[n]&&e[n].text||``,a[n])).join(` | `)} |\n`}),u}var fP=new D(`preserveCellSelectionOnContextMenu`);function pP(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(n)return n.pos;if(!(t.target instanceof Node))return null;try{return e.posAtDOM(t.target,0)}catch{return null}}function mP(e,t){let n=!1;return e.forEachCell((e,r)=>{t>=r&&t{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=LN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=LN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>dP(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(` `);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(`|`)?-1:t[0].includes(`|`)?0:-1},tokenize(e,t,n){let r=e.indexOf(` `),i=r>=0?e.slice(0,r):e,a=i.split(` -`);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=oP(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(` +`);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=sP(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(` `).length,u=e.split(` `).slice(0,l).join(` -`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=tP(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(w.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>AM(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>jM(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=vu(e.selection.$from,e=>e.type.name===`table`);return NM(e,t&&(e=>{n&&iP(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>IM(e,t),addRowAfter:()=>({state:e,dispatch:t})=>LM(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=vu(e.selection.$from,e=>e.type.name===`table`);return zM(e,t&&(e=>{n&&iP(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>QM(e,t),mergeCells:()=>({state:e,dispatch:t})=>HM(e,t),splitCell:()=>({state:e,dispatch:t})=>UM(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>JM(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>JM(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>YM(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>HM(e,t)?!0:UM(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>GM(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>ZM(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>ZM(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&EM(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=vM.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:rP,"Mod-Backspace":rP,Delete:rP,"Mod-Delete":rP}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[xN({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:null,lastColumnResizable:this.options.lastColumnResizable})]:[],FN({allowTableNodeSelection:this.options.allowTableNodeSelection}),mP()]},addNodeView(){let e=this.options.View;return e?({node:t,view:n,HTMLAttributes:r})=>{let i=A(this.options.HTMLAttributes,r);return new e(t,this.options.cellMinWidth,n,i)}:null},extendNodeSchema(e){return{tableRole:Nu(k(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),gP=Tp.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(hP.configure(this.options.table)),this.options.tableCell!==!1&&e.push(KN.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(qN.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(JN.configure(this.options.tableRow)),e}}),_P=Tp.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>!Pf(e.textAlign)||!this.options.alignments.includes(e.textAlign)?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}});function vP(){return[Nk.configure({HTMLAttributes:{class:`dw-tasks`}}),Mk.configure({nested:!0})]}function yP(){return[gP.configure({table:{resizable:!0,cellMinWidth:60,HTMLAttributes:{class:`dw-table`}}})]}var bP=_P.configure({types:[`heading`,`paragraph`],alignments:[`left`,`center`,`right`]}),xP=Tp.create({name:`headingShortcuts`,addKeyboardShortcuts(){let e={"Mod-Shift-0":()=>this.editor.commands.setParagraph()};for(let t of[1,2,3,4,5,6])e[`Mod-Shift-${t}`]=()=>this.editor.commands.toggleHeading({level:t});return e}}),SP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,CP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,wP=_p.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||Af(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>Pf(e.color)?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,A(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)(?!\s)([^=]*[^=\s])(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Hp({find:SP,type:this.type})]},addPasteRules(){return[Yp({find:CP,type:this.type})]}}),TP=[`gray`,`red`,`orange`,`yellow`,`green`,`teal`,`blue`,`purple`,`pink`],EP=e=>typeof e==`string`&&TP.includes(e),DP=_p.create({name:`textColor`,addAttributes(){return{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`data-color`);return EP(t)?t:null},renderHTML:e=>e.color?{"data-color":e.color}:{}}}},parseHTML(){return[{tag:`span[data-color]`,getAttrs:e=>EP(e.getAttribute(`data-color`))?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`span`,A(e,{class:`dw-text-color`}),0]},addCommands(){return{setTextColor:e=>({commands:t})=>t.setMark(this.name,{color:e}),unsetTextColor:()=>({commands:e})=>e.unsetMark(this.name)}}}),OP=wP.extend({addOptions(){return{...this.parent(),multicolor:!0}},addAttributes(){return{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`data-color`);return EP(t)?t:null},renderHTML:e=>({"data-color":EP(e.color)?e.color:`yellow`})}}},renderHTML({HTMLAttributes:e}){return[`mark`,A(e,{class:`dw-highlight`}),0]}}),kP=`💡`;function AP(e){let t=e.trim();return t&&[...t].length<=4?t:``}var jP=Jp.create({name:`callout`,group:`block`,content:`block+`,defining:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){return{emoji:{default:kP,parseHTML:e=>AP(e.getAttribute(`data-emoji`)??``)||kP,renderHTML:e=>({"data-emoji":e.emoji})},color:{default:`blue`,parseHTML:e=>{let t=e.getAttribute(`data-color`);return EP(t)?t:`blue`},renderHTML:e=>({"data-color":e.color})}}},parseHTML(){return[{tag:`aside[data-type=callout]`,contentElement:e=>e.querySelector(`:scope > .callout-body`)??e}]},renderHTML({HTMLAttributes:e}){return[`aside`,A(e,{"data-type":`callout`,class:`dw-callout`}),0]},addCommands(){return{setCallout:e=>({commands:t})=>t.wrapIn(this.name,e),unsetCallout:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{let{$from:t,empty:n}=e.state.selection;if(!n||t.parentOffset>0)return!1;for(let n=t.depth-1;n>0;n--){if(t.node(n).type.name===this.name)return t.index(n)!==0||t.start(n+1)!==t.start()?!1:e.commands.lift(this.name);if(t.index(n)!==0)return!1}return!1}}},addNodeView(){return({node:e,getPos:t,editor:n})=>{let r=this.options.labels,i=document.createElement(`aside`);i.className=`dw-callout`,i.setAttribute(`data-type`,`callout`);let a=document.createElement(`div`);a.className=`dw-callout__side`,a.contentEditable=`false`;let o=document.createElement(`button`);o.type=`button`,o.className=`dw-callout__emoji`;let s=document.createElement(`button`);s.type=`button`,s.className=`dw-callout__color`,a.append(o,s);let c=document.createElement(`div`);c.className=`dw-callout__body`,i.append(a,c);let l=e,u=e=>{let r=t();typeof r==`number`&&n.isEditable&&n.view.dispatch(n.state.tr.setNodeMarkup(r,void 0,{...l.attrs,...e}))};o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>{if(!n.isEditable)return;let e=AP(window.prompt(r?.blocks.calloutEmoji??`Emoji`,l.attrs.emoji)??``);e&&u({emoji:e})}),s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`click`,()=>{let e=TP.indexOf(l.attrs.color);u({color:TP[(e+1)%TP.length]})});let d=()=>{i.setAttribute(`data-color`,String(l.attrs.color)),o.textContent=String(l.attrs.emoji);let e=r?.blocks.calloutEmoji??`Emoji`;o.setAttribute(`aria-label`,e),o.title=e;let t=r?.blocks.calloutColor??`Colour`;s.setAttribute(`aria-label`,t),s.title=t};return d(),{dom:i,contentDOM:c,update:t=>t.type===e.type&&(l=t,d(),!0),stopEvent:e=>a.contains(e.target),ignoreMutation:e=>a.contains(e.target)}}}});function MP(e){let t=MS.getState(e);return t?.type&&t.binding&&t.doc?t:null}function NP(e,t){let n=MP(e);if(!n||!t?.from||!t.to)return null;try{let r=e=>jS(n.doc,n.type,ly(gg(e)),n.binding.mapping),i=r(t.from),a=r(t.to);return i===null||a===null||a<=i||a>e.doc.content.size?null:{from:i,to:a}}catch{return null}}var PP=new D(`docwellComments`);function FP(e,t,n){let r=[];for(let i of t){let t=NP(e,i.anchor);t&&r.push(vs.inline(t.from,t.to,{class:i.id===n?`dw-comment is-active`:`dw-comment`,"data-comment":i.id}))}return xs.create(e.doc,r)}var IP=Tp.create({name:`commentHighlights`,addOptions(){return{onSelect:void 0}},addProseMirrorPlugins(){let e=()=>this.options.onSelect;return[new E({key:PP,state:{init:()=>({marks:[],active:``,decos:xs.empty}),apply(e,t,n,r){let i=e.getMeta(PP);if(i)return{...i,decos:FP(r,i.marks,i.active)};if(!e.docChanged||!t.marks.length)return t;let a=e.getMeta(MS)?.isChangeOrigin;return{...t,decos:a?FP(r,t.marks,t.active):t.decos.map(e.mapping,e.doc)}}},props:{decorations:e=>PP.getState(e)?.decos??xs.empty,handleClick(t,n,r){let i=r.target?.closest?.(`[data-comment]`)?.getAttribute(`data-comment`);return i&&e()?.(i),!1}}})]}}),LP=/^(\d{4})-(\d{2})-(\d{2})$/;function RP(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function zP(e){let t=LP.exec(e);if(!t)return null;let n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return RP(n)===e?n:null}function BP(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function VP(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}function HP(e,t,n=new Date){let r=zP(e);if(!r)return e;let i=t.dates,a=VP(BP(n,0),r);return a===0?i.today:a===1?i.tomorrow:a===-1?i.yesterday:new Intl.DateTimeFormat(t.locale,{month:`short`,day:`numeric`,year:r.getFullYear()===n.getFullYear()?void 0:`numeric`}).format(r)}function UP(e,t){let n=zP(e);return n?new Intl.DateTimeFormat(t.locale,{dateStyle:`full`}).format(n):e}function WP(e,t,n,r=new Date){let i=t.dates,a=e.trim().toLowerCase(),o=!1;for(let e of new Set([i.remindWord.toLowerCase(),`remind`])){if(a.startsWith(e)){o=!0,a=a.slice(e.length).trim();break}if(a.length>=3&&e.startsWith(a)){o=!0,a=``;break}}if(o&&!n)return[];let s=BP(r,0);if(!a)return o?[1,0,7].map(e=>({date:RP(BP(s,e)),remind:o})):[{date:RP(s),remind:!1},...n?[{date:RP(BP(s,1)),remind:!0}]:[]];let c=[{words:[i.today,`today`],date:s},{words:[i.tomorrow,`tomorrow`],date:BP(s,1)},{words:[i.nextWeek,`next week`],date:BP(s,7)}];o||c.push({words:[i.yesterday,`yesterday`],date:BP(s,-1)});let l=e=>new Intl.DateTimeFormat(e,{weekday:`long`});for(let e=1;e<=7;e++){let n=BP(s,e);c.push({words:[l(t.locale).format(n),l(`en`).format(n)],date:n})}let u=[];zP(a)&&u.push({date:a,remind:o});for(let e of c)e.words.some(e=>e.toLowerCase().startsWith(a))&&u.push({date:RP(e.date),remind:o});return u.filter((e,t)=>u.findIndex(t=>t.date===e.date)===t).slice(0,5)}function GP(e,t){let n=e.toLowerCase().split(` `),r=[t.dates.remindWord,`remind`,t.dates.nextWeek.split(` `)[0]??``,`next`];return n.length>1&&n.length<=3&&r.some(e=>e&&e.toLowerCase()===n[0])}var KP=Jp.create({name:`dateMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addOptions(){return{labels:void 0,me:()=>void 0}},addAttributes(){return{date:{default:``,parseHTML:e=>e.getAttribute(`data-date`)??``,renderHTML:e=>({"data-date":e.date})},remind:{default:``,parseHTML:e=>e.getAttribute(`data-remind`)??``,renderHTML:e=>e.remind?{"data-remind":e.remind}:{}},tz:{default:``,parseHTML:e=>e.getAttribute(`data-tz`)??``,renderHTML:e=>e.tz?{"data-tz":e.tz}:{}}}},parseHTML(){return[{tag:`span[data-type="date"]`}]},renderHTML({node:e,HTMLAttributes:t}){return[`span`,A({"data-type":`date`,class:`dw-date`},t),HP(e.attrs.date,this.options.labels)]},renderText({node:e}){return HP(e.attrs.date,this.options.labels)},addNodeView(){let{labels:e,me:t}=this.options;return({node:n,editor:r,getPos:i})=>{let a=n,o=document.createElement(`span`);o.dataset.type=`date`,o.className=`dw-date`,o.contentEditable=`false`;let s=null,c=()=>{let t=a.attrs.date,n=a.attrs.remind,r=!!zP(t)&&t{let t=typeof i==`function`?i():void 0;t!==void 0&&r.chain().command(({tr:n})=>(n.setNodeMarkup(t,void 0,{...a.attrs,...e}),!0)).run()};return o.addEventListener(`mousedown`,n=>{r.isEditable&&!s&&(n.preventDefault(),s=YP(o,r,a,e,t(),l,()=>s=null))}),{dom:o,update(e){return e.type===a.type&&(a=e,c(),!0)},ignoreMutation:()=>!0,stopEvent:e=>o.contains(e.target)&&e.type!==`mousedown`,destroy(){s?.()}}}}});function qP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function JP(e,t,n,r){let i={date:n.date,remind:n.remind&&r?r:``,tz:n.remind&&r?qP():``};e.chain().focus().insertContentAt(t,[{type:`dateMention`,attrs:i},{type:`text`,text:` `}]).run()}function YP(e,t,n,r,i,a,o){let s=r.dates,c=document.createElement(`div`);c.className=`dw-date-pop`,c.setAttribute(`role`,`dialog`),c.setAttribute(`aria-label`,s.edit);let l=document.createElement(`input`);l.type=`date`,l.className=`dw-input`,l.value=n.attrs.date,l.setAttribute(`aria-label`,s.edit),l.addEventListener(`change`,()=>{zP(l.value)&&a({date:l.value})}),c.append(l);let u=n.attrs.remind;if(u&&u!==i){let e=document.createElement(`p`);e.className=`dw-date-pop__note`,e.textContent=s.someoneElse,c.append(e)}else if(i){let e=document.createElement(`label`);e.className=`dw-date-pop__check`;let t=document.createElement(`input`);t.type=`checkbox`,t.checked=u===i,t.addEventListener(`change`,()=>a(t.checked?{remind:i,tz:qP()}:{remind:``,tz:``})),e.append(t,document.createTextNode(s.remindMe));let n=document.createElement(`span`);n.className=`dw-date-pop__note`,n.textContent=s.reminderAt,c.append(e,n)}document.body.append(c);let d=wj(e,c,()=>{Oj(e,c,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:t})=>Object.assign(c.style,{left:`${e}px`,top:`${t}px`}))}),f=t=>{!c.contains(t.target)&&!e.contains(t.target)&&m()},p=e=>{e.key===`Escape`&&(e.preventDefault(),m(),t.commands.focus())};function m(){d(),c.remove(),document.removeEventListener(`mousedown`,f,!0),document.removeEventListener(`keydown`,p,!0),o()}return document.addEventListener(`mousedown`,f,!0),document.addEventListener(`keydown`,p,!0),l.focus(),m}function XP(e){let t=document.createElement(`div`);t.className=`dw-diagram-editor`,t.setAttribute(`role`,`dialog`),t.setAttribute(`aria-modal`,`true`),t.setAttribute(`aria-label`,e);let n=document.createElement(`p`);n.className=`dw-diagram-editor__status`,t.append(n),document.body.append(t);let r=document.body.style.overflow;return document.body.style.overflow=`hidden`,{root:t,status:e=>{n.textContent=e,n.hidden=!e},close:()=>{t.remove(),document.body.style.overflow=r}}}async function ZP(e,t){let n=await fetch(e.resolve(t));if(!n.ok)throw Error(`loading the drawing failed (${n.status})`);return n.text()}function QP(e,t){return new File([e],t,{type:`image/svg+xml`})}function $P(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}function eF(e,t,n){return new Promise(r=>{let i=XP(n.slash.drawio?.label??`Draw.io`),a=document.createElement(`iframe`),o=new URL(e);for(let[e,t]of Object.entries({embed:`1`,proto:`json`,spin:`1`,saveAndExit:`1`,noExitBtn:`0`}))o.searchParams.set(e,t);a.src=o.toString(),a.className=`dw-diagram-editor__frame`,a.title=n.slash.drawio?.label??`Draw.io`;let s=document.createElement(`div`);s.className=`dw-diagram-editor__bar`;let c=document.createElement(`button`);c.type=`button`,c.className=`dw-source__btn`,c.textContent=n.blocks.cancel,c.addEventListener(`click`,()=>d(null)),s.append(c),i.root.append(s,a),i.status(``);let l=e=>a.contentWindow?.postMessage(JSON.stringify(e),o.origin),u=!1,d=e=>{window.removeEventListener(`message`,f),i.close(),r(e)},f=e=>{if(e.source!==a.contentWindow||e.origin!==o.origin||typeof e.data!=`string`)return;let n;try{n=JSON.parse(e.data)}catch{return}switch(n.event){case`init`:l({action:`load`,autosave:0,xml:t?`data:image/svg+xml;base64,${$P(t)}`:``});break;case`save`:u=!0,l({action:`export`,format:`xmlsvg`,spinKey:`saving`});break;case`export`:{let e=n.data??``,t=e.indexOf(`,`),r=e.slice(0,t),i=e.slice(t+1),a=r.includes(`;base64`)?new TextDecoder().decode(Uint8Array.from(atob(i),e=>e.charCodeAt(0))):decodeURIComponent(i);d(u?a:null);break}case`exit`:d(null)}};window.addEventListener(`message`,f)})}async function tF(e,t,n){let r=XP(n.slash.excalidraw?.label??`Excalidraw`);r.status(``);try{let{openExcalidraw:i}=await e();return await i(r.root,t,n)}finally{r.close()}}var nF=!1;function rF(e){return Jp.create({name:e,group:`block`,atom:!0,draggable:!0,addOptions(){return{host:void 0,loadExcalidraw:void 0,labels:null,drawioUrl:void 0,onError:void 0}},addAttributes(){return{src:{default:``},alt:{default:``}}},parseHTML(){return[{tag:`figure[data-type='${e}']`,getAttrs:e=>({src:e.querySelector(`img`)?.getAttribute(`src`)??``})}]},renderHTML({node:t,HTMLAttributes:n}){return[`figure`,A(n,{"data-type":e}),[`img`,{src:String(t.attrs.src),alt:String(t.attrs.alt||e)}]]},addCommands(){return{insertDiagram:e=>({commands:t})=>(nF=!0,t.insertContent({type:e,attrs:{src:``}}))}},addNodeView(){return({node:t,editor:n,getPos:r})=>{let i=this.options,a=i.labels,o=document.createElement(`figure`);o.className=`dw-diagram dw-diagram--${e}`,o.setAttribute(`data-type`,e);let s=document.createElement(`img`);s.className=`dw-diagram__img`;let c=document.createElement(`p`);c.className=`dw-diagram__empty`,c.textContent=e===`drawio`?a.blocks.emptyDrawio:a.blocks.emptyExcalidraw;let l=document.createElement(`button`);l.type=`button`,l.className=`dw-diagram__edit`,l.textContent=a.blocks.edit,o.append(s,c,l);let u=``,d=t=>{u=String(t.attrs.src??``),s.hidden=!u,c.hidden=!!u,u&&(s.src=i.host?i.host.resolve(u):u,s.alt=String(t.attrs.alt||a.slash[e]?.label||e))};d(t);let f=!1,p=async()=>{if(!f&&m()&&i.host?.upload){f=!0;try{let t=u?await ZP(i.host,u):``,o=e===`drawio`?await eF(i.drawioUrl||`https://embed.diagrams.net`,t,a):await tF(i.loadExcalidraw,t,a);if(o===null)return;let s=await i.host.upload(QP(o,`${e===`drawio`?`diagram.drawio`:`drawing.excalidraw`}.svg`)),c=typeof r==`function`?r():void 0;c!==void 0&&iF(n,c,e,s.url)}catch(e){i.onError?.(e)}finally{f=!1}}},m=()=>n.isEditable&&!!i.host?.upload&&(e===`drawio`||!!i.loadExcalidraw),h=()=>l.hidden=!m()||!u;return h(),n.on(`update`,h),o.addEventListener(`dblclick`,()=>void p()),c.addEventListener(`click`,()=>void p()),l.addEventListener(`click`,()=>void p()),nF&&(nF=!1,queueMicrotask(()=>void p())),{dom:o,update:t=>t.type.name===e&&(d(t),h(),!0),ignoreMutation:()=>!0,stopEvent:e=>e.target===l||e.target===c,destroy:()=>n.off(`update`,h)}}}})}function iF(e,t,n,r){e.chain().setNodeSelection(t).updateAttributes(n,{src:r}).run()}var aF=rF(`drawio`),oF=rF(`excalidraw`),sF=null;function cF(e){sF?.();let t=document.createElement(`div`);t.className=`dw-source`,t.setAttribute(`role`,`dialog`),t.setAttribute(`aria-label`,e.label);let n=document.createElement(e.multiline?`textarea`:`input`);n.className=`dw-source__field`+(e.monospace?` dw-source__field--mono`:``),n.value=e.value,n.setAttribute(`aria-label`,e.label),n.spellcheck=!1,n instanceof HTMLTextAreaElement&&(n.rows=Math.min(16,Math.max(4,e.value.split(` -`).length+1)));let r=document.createElement(`div`);r.className=`dw-source__actions`;let i=(e,t,n)=>{let r=document.createElement(`button`);return r.type=`button`,r.className=`dw-source__btn ${t}`,r.textContent=e,r.addEventListener(`mousedown`,e=>e.preventDefault()),r.addEventListener(`click`,n),r};e.onRemove&&r.append(i(e.labels.remove,`dw-source__btn--danger`,()=>{u(!0),e.onRemove()}));let a=document.createElement(`span`);a.style.flex=`1`,r.append(a,i(e.labels.cancel,``,()=>u()),i(e.labels.done,`dw-source__btn--primary`,()=>o())),t.append(n,r),document.body.append(t);let o=()=>{let t=n.value;u(!0),e.onSave(t)};n.addEventListener(`input`,()=>e.onInput?.(n.value)),n.addEventListener(`keydown`,t=>{let n=t;n.key===`Escape`?(n.preventDefault(),u()):n.key===`Enter`&&(n.ctrlKey||n.metaKey||!e.multiline)&&(n.preventDefault(),o()),n.stopPropagation()});let s=n=>{!t.contains(n.target)&&!e.anchor.contains(n.target)&&u()};setTimeout(()=>document.addEventListener(`mousedown`,s),0);let c=wj(e.anchor,t,()=>{Oj(e.anchor,t,{placement:`bottom-start`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:n})=>Object.assign(t.style,{left:`${e}px`,top:`${n}px`}))}),l=!1;function u(n=!1){l||(l=!0,c(),document.removeEventListener(`mousedown`,s),t.remove(),sF===d&&(sF=null),n||e.onCancel?.())}let d=()=>u();return sF=d,n.focus(),e.multiline||n.select(),d}var lF=[{pattern:/^https:\/\/(?:www\.|m\.)?youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/|live\/)([\w-]{11})/,src:e=>`https://www.youtube-nocookie.com/embed/${e[1]}`},{pattern:/^https:\/\/youtu\.be\/([\w-]{11})/,src:e=>`https://www.youtube-nocookie.com/embed/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?vimeo\.com\/(?:video\/)?(\d+)/,src:e=>`https://player.vimeo.com/video/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?loom\.com\/(?:share|embed)\/([\da-f]{32})/,src:e=>`https://www.loom.com/embed/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?figma\.com\/(?:file|design|proto|board|slides)\/[\w-]+/,src:(e,t)=>`https://www.figma.com/embed?embed_host=docwell&url=${encodeURIComponent(t.href)}`},{pattern:/^https:\/\/codepen\.io\/([\w-]+)\/(?:pen|embed)\/([\w-]+)/,src:e=>`https://codepen.io/${e[1]}/embed/${e[2]}?default-tab=result`},{pattern:/^https:\/\/open\.spotify\.com\/(?:embed\/)?(track|album|playlist|episode|show)\/(\w+)/,src:e=>`https://open.spotify.com/embed/${e[1]}/${e[2]}`,ratio:`audio`},{pattern:/^https:\/\/docs\.google\.com\/(document|spreadsheets|presentation)\/d\/([\w-]+)/,src:e=>`https://docs.google.com/${e[1]}/d/${e[2]}/preview`,ratio:`tall`},{pattern:/^https:\/\/(?:www\.)?google\.com\/maps\/embed\?/,src:(e,t)=>t.href}];function uF(e){let t;try{t=new URL(e.trim())}catch{return null}for(let e of lF){let n=e.pattern.exec(t.href);if(n)return{src:e.src(n,t),ratio:e.ratio??`video`}}return null}function dF(e){try{let t=new URL(e.trim());return t.protocol===`https:`||t.protocol===`http:`?t.href:``}catch{return``}}var fF=e=>{try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}};function pF(e,t,n){let{node:r}=e.view.domAtPos(e.state.selection.from),i=r instanceof HTMLElement?r:r.parentElement??e.view.dom;return new Promise(e=>{let r=t.blocks;cF({anchor:i,value:`https://`,label:n,labels:{done:r.done,cancel:r.cancel,remove:r.remove},onSave:t=>e(dF(t)),onCancel:()=>e(``)})})}async function mF(e,t,n,r){let i=await pF(e,t,t.blocks.embedUrl);i&&(uF(i)?e.chain().focus().insertEmbed(i).run():await gF(e,i,n,r))}async function hF(e,t,n,r){let i=await pF(e,t,t.blocks.linkUrl);i&&await gF(e,i,n,r)}async function gF(e,t,n,r){let i={url:t};if(n)try{i={...await n.preview(t),url:t}}catch(e){r?.(e)}e.chain().focus().insertLinkCard(i).run()}var _F=Jp.create({name:`embed`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){return{url:{default:``,parseHTML:e=>e.getAttribute(`data-url`)??``,renderHTML:e=>({"data-url":e.url})}}},parseHTML(){return[{tag:`div[data-type='embed']`}]},renderHTML({node:e,HTMLAttributes:t}){let n=dF(String(e.attrs.url));return[`div`,A(t,{"data-type":`embed`}),[`a`,{href:n},n]]},addCommands(){return{insertEmbed:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{url:e}})}},addNodeView(){return({node:e})=>{let t=this.options.labels.blocks,n=document.createElement(`figure`);n.className=`dw-embed`,n.setAttribute(`data-type`,`embed`),n.contentEditable=`false`;let r=e=>{let r=dF(e),i=uF(r);if(n.replaceChildren(),!i){let e=document.createElement(`a`);e.href=r,e.target=`_blank`,e.rel=`noopener noreferrer`,e.textContent=r||t.embedInvalid,n.append(e);return}n.dataset.ratio=i.ratio;let a=document.createElement(`iframe`);a.className=`dw-embed__frame`,a.src=i.src,a.title=`${t.embed}: ${fF(r)}`,a.loading=`lazy`,a.allow=`fullscreen; picture-in-picture; encrypted-media; clipboard-write`,a.referrerPolicy=`strict-origin-when-cross-origin`,a.setAttribute(`sandbox`,`allow-scripts allow-same-origin allow-popups allow-presentation`);let o=document.createElement(`figcaption`);o.className=`dw-embed__caption`;let s=document.createElement(`a`);s.href=r,s.target=`_blank`,s.rel=`noopener noreferrer`,s.textContent=fF(r),o.append(s),n.append(a,o)},i=String(e.attrs.url);return r(i),{dom:n,update:e=>e.type.name===`embed`&&(e.attrs.url!==i&&r(i=String(e.attrs.url)),!0),ignoreMutation:()=>!0,stopEvent:e=>e.target instanceof Element&&!!e.target.closest(`a`)}}}}),vF=Jp.create({name:`linkCard`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){let e=e=>({default:``,parseHTML:t=>t.getAttribute(`data-${e}`)??``,renderHTML:t=>({[`data-${e}`]:t[e]})});return{url:e(`url`),title:e(`title`),description:e(`description`),image:e(`image`),site:e(`site`)}},parseHTML(){return[{tag:`div[data-type='link-card']`}]},renderHTML({node:e,HTMLAttributes:t}){let n=dF(String(e.attrs.url));return[`div`,A(t,{"data-type":`link-card`}),[`a`,{href:n},String(e.attrs.title||n)]]},addCommands(){return{insertLinkCard:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{url:e.url,title:e.title??``,description:e.description??``,image:e.image??``,site:e.site??``}})}},addNodeView(){return({node:e})=>{let t=document.createElement(`a`);t.className=`dw-linkcard`,t.setAttribute(`data-type`,`link-card`),t.contentEditable=`false`,t.target=`_blank`,t.rel=`noopener noreferrer`;let n=e=>{let n=dF(String(e.url));t.href=n,t.replaceChildren();let r=document.createElement(`span`);r.className=`dw-linkcard__text`;let i=document.createElement(`span`);if(i.className=`dw-linkcard__title`,i.textContent=String(e.title||``)||fF(n),r.append(i),e.description){let t=document.createElement(`span`);t.className=`dw-linkcard__desc`,t.textContent=String(e.description),r.append(t)}let a=document.createElement(`span`);a.className=`dw-linkcard__site`,a.textContent=String(e.site||``)||fF(n),r.append(a),t.append(r);let o=dF(String(e.image||``));if(o.startsWith(`https:`)){let e=document.createElement(`img`);e.className=`dw-linkcard__image`,e.src=o,e.alt=``,e.loading=`lazy`,e.referrerPolicy=`no-referrer`,e.onerror=()=>e.remove(),t.append(e)}},r=e;return n(e.attrs),t.addEventListener(`click`,e=>{this.editor.view.editable&&!(e.ctrlKey||e.metaKey)&&e.preventDefault()}),{dom:t,update:e=>e.type.name===`linkCard`&&(e.attrs!==r.attrs&&n(e.attrs),r=e,!0),ignoreMutation:()=>!0}}}}),yF=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,bF=Jp.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,A(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=A(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new qp({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=Lu(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Up({find:yF,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});async function xF(e,t,n,r){if(t.upload)for(let i of n){let n=await t.upload(i),a=n.mime.startsWith(`image/`)?{type:`image`,attrs:{src:n.url,alt:n.name}}:{type:`fileAttachment`,attrs:{url:n.url,name:n.name,size:n.size,mime:n.mime,view:jj(n.mime,n.name)?`preview`:`card`}};e.chain().focus().insertContentAt(r??e.state.selection.to,a).run(),r=void 0}}var SF=bF.extend({addOptions(){return{...this.parent(),host:void 0,inline:!1,allowBase64:!1}},addNodeView(){return({node:e})=>{let t=document.createElement(`img`),n=e=>{let n=String(e.attrs.src??``);t.src=this.options.host?this.options.host.resolve(n):n,t.alt=String(e.attrs.alt??``),e.attrs.title&&(t.title=String(e.attrs.title))};return n(e),t.draggable=!0,{dom:t,update:t=>t.type===e.type&&(n(t),!0)}}}});function CF(e){if(!e)return``;let t=[`B`,`KB`,`MB`,`GB`],n=0,r=e;for(;r>=1024&&n({editor:e,commands:t})=>{let n=e.getAttributes(this.name);return!e.isActive(this.name)||!jj(n.mime,n.name)?!1:t.updateAttributes(this.name,{view:n.view===`preview`?`card`:`preview`})}}},parseHTML(){return[{tag:`div[data-type=file]`,getAttrs:e=>({url:e.getAttribute(`data-url`)??``,name:e.getAttribute(`data-name`)??e.textContent??`file`,size:Number(e.getAttribute(`data-size`)??0),mime:e.getAttribute(`data-mime`)??``,view:e.getAttribute(`data-view`)===`preview`?`preview`:`card`})}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,A(t,{"data-type":`file`,"data-url":e.attrs.url,"data-name":e.attrs.name,"data-size":e.attrs.size,"data-mime":e.attrs.mime,"data-view":e.attrs.view}),[`a`,{href:e.attrs.url,download:e.attrs.name},e.attrs.name]]},addNodeView(){return({node:e})=>{let{host:t,loadPdf:n,labels:r}=this.options,i=document.createElement(`div`);i.className=`dw-file-block`,i.setAttribute(`data-type`,`file`);let a=document.createElement(`div`);a.className=`dw-file`;let o=document.createElement(`a`);o.className=`dw-file__name`,o.target=`_blank`,o.rel=`noopener`;let s=document.createElement(`span`);s.className=`dw-file__size`,a.append(o,s),i.append(a);let c=null,l=null,u=``,d=e=>{let a=String(e.attrs.url??``),d=t?t.resolve(a):a;o.href=d,o.textContent=String(e.attrs.name??`file`),s.textContent=CF(Number(e.attrs.size??0)),!(e.attrs.view===`preview`&&jj(e.attrs.mime,e.attrs.name)&&a)||!n||!r?(l?.(),l=null,c?.remove(),c=null,u=``):u!==d&&(l?.(),c||(c=document.createElement(`div`),c.className=`dw-pdf`,c.tabIndex=0,c.setAttribute(`role`,`document`),i.append(c)),c.setAttribute(`aria-label`,String(e.attrs.name??`PDF`)),u=d,l=Mj(c,d,n,r))};return d(e),{dom:i,update:t=>t.type===e.type&&(d(t),!0),stopEvent:e=>!!c&&c.contains(e.target)&&e.type!==`mousedown`,ignoreMutation:()=>!0,destroy:()=>l?.()}}}}),TF=Tp.create({name:`fileDrop`,addOptions(){return{host:void 0,onError:void 0}},addProseMirrorPlugins(){let e=this.options.host;return e?[EF(()=>this.editor,e,this.options.onError)]:[]}});function EF(e,t,n){let r=(r,i)=>{let a=e();return!a||!r.length||!t.upload?!1:(xF(a,t,r,i).catch(n),!0)};return new E({key:new D(`docwellFileDrop`),props:{handlePaste(e,t){return r([...t.clipboardData?.files??[]])},handleDrop(e,t){let n=[...t.dataTransfer?.files??[]];if(!n.length)return!1;let i=e.posAtCoords({left:t.clientX,top:t.clientY});return t.preventDefault(),r(n,i?.pos)}}})}var DF=new D(`dwFind`),OF=``;function kF(e,t,n=!1){if(!t)return[];let r=n?t:t.toLowerCase(),i=[];return e.descendants((e,t)=>{if(!e.isTextblock)return!0;let a=``,o=[];e.forEach((e,n)=>{let r=t+1+n;if(e.isText){let t=e.text??``;for(let e=0;ee.from>=r);return a===-1&&(a=i.length?0:-1),{term:t,caseSensitive:n,matches:i,current:a}}function jF(e,t){return t&&e.setSelection(w.create(e.doc,t.from,t.to)).scrollIntoView(),e}var MF=Tp.create({name:`findReplace`,addCommands(){return{setFind:(e,t=!1)=>({state:n,tr:r,dispatch:i})=>{let a=AF(n.doc,e,t,n.selection.from);return r.setMeta(DF,{term:e,caseSensitive:t,near:n.selection.from}),i&&i(jF(r,a.matches[a.current])),!0},findStep:e=>({state:t,tr:n,dispatch:r})=>{let i=DF.getState(t);if(!i?.matches.length)return!1;let a=(i.current+e+i.matches.length)%i.matches.length;return n.setMeta(DF,{current:a}),r&&r(jF(n,i.matches[a])),!0},replaceCurrent:e=>({state:t,tr:n,dispatch:r})=>{let i=DF.getState(t),a=i?.matches[i.current];if(!i||!a)return!1;if(r){n.insertText(e,a.from,a.to),n.setMeta(DF,{term:i.term,caseSensitive:i.caseSensitive,near:a.from+e.length});let t=AF(n.doc,i.term,i.caseSensitive,a.from+e.length);r(jF(n,t.matches[t.current]))}return!0},replaceAll:e=>({state:t,tr:n,dispatch:r})=>{let i=DF.getState(t);if(!i?.matches.length)return!1;if(r){for(let t of[...i.matches].reverse())n.insertText(e,t.from,t.to);n.setMeta(DF,{term:i.term,caseSensitive:i.caseSensitive,near:0}),r(n)}return!0},clearFind:()=>({tr:e,dispatch:t})=>(t&&t(e.setMeta(DF,{clear:!0})),!0)}},addProseMirrorPlugins(){let e={term:``,caseSensitive:!1,matches:[],current:-1};return[new E({key:DF,state:{init:()=>e,apply(t,n,r,i){let a=t.getMeta(DF);if(a&&`clear`in a)return e;if(a&&`term`in a)return AF(i.doc,a.term,a.caseSensitive,a.near);if(a&&`current`in a)return{...n,current:a.current};if(!n.term||!t.docChanged)return n;let o=n.matches[n.current]?.from??0;return AF(i.doc,n.term,n.caseSensitive,t.mapping.map(o))}},props:{decorations(e){let t=DF.getState(e);return t?.matches.length?xs.create(e.doc,t.matches.map((e,n)=>vs.inline(e.from,e.to,{class:n===t.current?`dw-find dw-find-current`:`dw-find`}))):null}}})]}}),NF={slashMenu:`Insert block`,noMatches:`No matching blocks`,slash:{text:{label:`Text`,description:`Plain paragraph`},h1:{label:`Heading 1`,description:`Big section heading`},h2:{label:`Heading 2`,description:`Medium section heading`},h3:{label:`Heading 3`,description:`Small section heading`},h4:{label:`Heading 4`,description:`Other headings: level 4`},h5:{label:`Heading 5`,description:`Other headings: level 5`},h6:{label:`Heading 6`,description:`Other headings: level 6`},bullet:{label:`Bulleted list`,description:`A simple list`},ordered:{label:`Numbered list`,description:`A list with numbers`},todo:{label:`To-do list`,description:`Tasks to tick off (or type [])`},callout:{label:`Callout`,description:`Set a note apart with an emoji and colour`},table:{label:`Table`,description:`Rows and columns`},quote:{label:`Quote`,description:`Set text apart as a quote`},code:{label:`Code block`,description:`Monospaced code`},divider:{label:`Divider`,description:`A line between sections`},image:{label:`Image`,description:`Upload a picture`},file:{label:`File`,description:`Attach a file to download`},math:{label:`Math block`,description:`A formula on its own line (LaTeX)`},mathInline:{label:`Inline math`,description:`A formula inside the text (LaTeX)`},mermaid:{label:`Mermaid diagram`,description:`Flowcharts and sequences from text`},drawio:{label:`Draw.io diagram`,description:`Draw a diagram with diagrams.net`},excalidraw:{label:`Excalidraw drawing`,description:`Sketch by hand`},toc:{label:`Table of contents`,description:`The page's headings, kept up to date`},pageLink:{label:`Link to page`,description:`Link another page (or type [[)`},toggle:{label:`Toggle`,description:`A heading that hides the blocks under it`},embed:{label:`Embed`,description:`A video, design or document from YouTube, Figma and more`},linkCard:{label:`Link card`,description:`A link with its page's title and picture`},newPage:{label:`New page`,description:`Make a page and link it here`},today:{label:`Today`,description:`Insert today's date`},tomorrow:{label:`Tomorrow`,description:`Insert tomorrow's date`},yesterday:{label:`Yesterday`,description:`Insert yesterday's date`},now:{label:`Now`,description:`Insert the date and time`}},format:{bold:`Bold`,italic:`Italic`,strike:`Strikethrough`,code:`Inline code`,link:`Link`,linkPrompt:`Link address (leave empty to remove the link)`,comment:`Comment`,underline:`Underline`,color:`Colour`,textColor:`Text colour`,highlight:`Highlight`,noColor:`Default`,align:`Align`,alignLeft:`Align left`,alignCenter:`Align centre`,alignRight:`Align right`,math:`Inline math`,linkedPage:`Make a linked page`},colors:{gray:`Grey`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,teal:`Teal`,blue:`Blue`,purple:`Purple`,pink:`Pink`},table:{toolbar:`Table`,dragRow:`Drag to move the row`,moveRowUp:`Move row up`,moveRowDown:`Move row down`,addRowBefore:`Add row above`,addRowAfter:`Add row below`,addColumnBefore:`Add column left`,addColumnAfter:`Add column right`,deleteRow:`Delete row`,deleteColumn:`Delete column`,toggleHeaderRow:`Header row`,mergeCells:`Merge cells`,splitCell:`Split cell`,deleteTable:`Delete table`},blockMenu:{open:`Drag to move, click for actions`,turnInto:`Turn into`,moveUp:`Move up`,moveDown:`Move down`,duplicate:`Duplicate`,copy:`Copy`,delete:`Delete`,showLineNumbers:`Show line numbers`,hideLineNumbers:`Hide line numbers`,showPages:`Show pages`,showAsFile:`Show as file`},mentions:`Mention someone`,noPeople:`Nobody found`,pageLinks:`Link to a page`,noPages:`No pages found`,blocks:{edit:`Edit`,done:`Done`,cancel:`Cancel`,save:`Save`,remove:`Remove`,saving:`Saving…`,latex:`LaTeX formula`,mermaid:`Mermaid diagram source`,mermaidError:`This diagram has an error:`,emptyDrawio:`Empty diagram. Click to draw.`,emptyExcalidraw:`Empty drawing. Click to sketch.`,loadFailed:`The editor could not be loaded.`,toc:`Contents`,tocEmpty:`Add headings to the page to fill the table of contents.`,expand:`Show contents`,collapse:`Hide contents`,embed:`Embedded content`,embedUrl:`Address of the video, design or document`,embedInvalid:`This address can't be embedded.`,linkUrl:`Address of the page to link`,copyBlockLink:`Copy link to this block`,calloutEmoji:`Change emoji`,calloutColor:`Change colour`,pdfLoading:`Loading PDF…`,pdfPage:`Page {n}`},find:{find:`Find in page`,replace:`Replace with`,previous:`Previous match`,next:`Next match`,replaceOne:`Replace`,replaceAll:`Replace all`,matchCase:`Match case`,close:`Close`,count:`{current} of {total}`,none:`No matches`},dates:{today:`Today`,tomorrow:`Tomorrow`,yesterday:`Yesterday`,nextWeek:`Next week`,remindWord:`remind`,remindMe:`Remind me`,reminderAt:`Reminder at 9:00 on the day`,someoneElse:`Someone else set a reminder on this date.`,edit:`Change date`}},I=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15e.replace(PF,`-$1`).toLowerCase(),IF={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},LF=/[&><"']/g,RF=e=>String(e).replace(LF,e=>IF[e]),zF=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?zF(e.body[0]):e:e.type===`font`?zF(e.body):e,BF=new Set([`mathord`,`textord`,`atom`]),VF=e=>BF.has(zF(e).type),HF=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},UF={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format `},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color `,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro `,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness `,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size `,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand `,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function WF(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function GF(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:WF(Array.isArray(e.type)?e.type[0]:e.type)}function KF(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?GF(r):a?a(i):i}var qF=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(UF)){var n=UF[t];n&&KF(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new I(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=HF(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},JF=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return rI[iI[this.id]]}sub(){return rI[aI[this.id]]}fracNum(){return rI[oI[this.id]]}fracDen(){return rI[sI[this.id]]}cramp(){return rI[cI[this.id]]}text(){return rI[lI[this.id]]}isTight(){return this.size>=2}},YF=0,XF=1,ZF=2,QF=3,$F=4,eI=5,tI=6,nI=7,rI=[new JF(YF,0,!1),new JF(XF,0,!0),new JF(ZF,1,!1),new JF(QF,1,!0),new JF($F,2,!1),new JF(eI,2,!0),new JF(tI,3,!1),new JF(nI,3,!0)],iI=[$F,eI,$F,eI,tI,nI,tI,nI],aI=[eI,eI,eI,eI,nI,nI,nI,nI],oI=[ZF,QF,$F,eI,tI,nI,tI,nI],sI=[QF,QF,eI,eI,nI,nI,nI,nI],cI=[XF,XF,QF,QF,eI,eI,nI,nI],lI=[YF,XF,ZF,QF,ZF,QF,ZF,QF],L={DISPLAY:rI[YF],TEXT:rI[ZF],SCRIPT:rI[$F],SCRIPTSCRIPT:rI[tI]},uI=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function dI(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var fI=[];uI.forEach(e=>e.blocks.forEach(e=>fI.push(...e)));function pI(e){for(var t=0;t=fI[t]&&e<=fI[t+1])return!0;return!1}var mI=e=>e+` `+e,hI=80,gI=function(e,t){return`M95,`+(622+e+t)+` +`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=nP(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(w.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>jM(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>MM(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=vu(e.selection.$from,e=>e.type.name===`table`);return PM(e,t&&(e=>{n&&aP(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>LM(e,t),addRowAfter:()=>({state:e,dispatch:t})=>RM(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=vu(e.selection.$from,e=>e.type.name===`table`);return BM(e,t&&(e=>{n&&aP(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>$M(e,t),mergeCells:()=>({state:e,dispatch:t})=>UM(e,t),splitCell:()=>({state:e,dispatch:t})=>WM(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>YM(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>YM(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>XM(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>UM(e,t)?!0:WM(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>KM(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>QM(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>QM(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&DM(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=yM.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:iP,"Mod-Backspace":iP,Delete:iP,"Mod-Delete":iP}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[SN({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:null,lastColumnResizable:this.options.lastColumnResizable})]:[],IN({allowTableNodeSelection:this.options.allowTableNodeSelection}),hP()]},addNodeView(){let e=this.options.View;return e?({node:t,view:n,HTMLAttributes:r})=>{let i=A(this.options.HTMLAttributes,r);return new e(t,this.options.cellMinWidth,n,i)}:null},extendNodeSchema(e){return{tableRole:Nu(k(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),_P=Tp.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(gP.configure(this.options.table)),this.options.tableCell!==!1&&e.push(qN.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(JN.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(YN.configure(this.options.tableRow)),e}}),vP=Tp.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>!Pf(e.textAlign)||!this.options.alignments.includes(e.textAlign)?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}});function yP(){return[Nk.configure({HTMLAttributes:{class:`dw-tasks`}}),Mk.configure({nested:!0})]}function bP(){return[_P.configure({table:{resizable:!0,cellMinWidth:60,HTMLAttributes:{class:`dw-table`}}})]}var xP=vP.configure({types:[`heading`,`paragraph`],alignments:[`left`,`center`,`right`]}),SP=Tp.create({name:`headingShortcuts`,addKeyboardShortcuts(){let e={"Mod-Shift-0":()=>this.editor.commands.setParagraph()};for(let t of[1,2,3,4,5,6])e[`Mod-Shift-${t}`]=()=>this.editor.commands.toggleHeading({level:t});return e}}),CP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,wP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,TP=_p.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||Af(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>Pf(e.color)?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,A(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)(?!\s)([^=]*[^=\s])(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Hp({find:CP,type:this.type})]},addPasteRules(){return[Yp({find:wP,type:this.type})]}}),EP=[`gray`,`red`,`orange`,`yellow`,`green`,`teal`,`blue`,`purple`,`pink`],DP=e=>typeof e==`string`&&EP.includes(e),OP=_p.create({name:`textColor`,addAttributes(){return{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`data-color`);return DP(t)?t:null},renderHTML:e=>e.color?{"data-color":e.color}:{}}}},parseHTML(){return[{tag:`span[data-color]`,getAttrs:e=>DP(e.getAttribute(`data-color`))?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`span`,A(e,{class:`dw-text-color`}),0]},addCommands(){return{setTextColor:e=>({commands:t})=>t.setMark(this.name,{color:e}),unsetTextColor:()=>({commands:e})=>e.unsetMark(this.name)}}}),kP=TP.extend({addOptions(){return{...this.parent(),multicolor:!0}},addAttributes(){return{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`data-color`);return DP(t)?t:null},renderHTML:e=>({"data-color":DP(e.color)?e.color:`yellow`})}}},renderHTML({HTMLAttributes:e}){return[`mark`,A(e,{class:`dw-highlight`}),0]}}),AP=`💡`;function jP(e){let t=e.trim();return t&&[...t].length<=4?t:``}var MP=Jp.create({name:`callout`,group:`block`,content:`block+`,defining:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){return{emoji:{default:AP,parseHTML:e=>jP(e.getAttribute(`data-emoji`)??``)||AP,renderHTML:e=>({"data-emoji":e.emoji})},color:{default:`blue`,parseHTML:e=>{let t=e.getAttribute(`data-color`);return DP(t)?t:`blue`},renderHTML:e=>({"data-color":e.color})}}},parseHTML(){return[{tag:`aside[data-type=callout]`,contentElement:e=>e.querySelector(`:scope > .callout-body`)??e}]},renderHTML({HTMLAttributes:e}){return[`aside`,A(e,{"data-type":`callout`,class:`dw-callout`}),0]},addCommands(){return{setCallout:e=>({commands:t})=>t.wrapIn(this.name,e),unsetCallout:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{let{$from:t,empty:n}=e.state.selection;if(!n||t.parentOffset>0)return!1;for(let n=t.depth-1;n>0;n--){if(t.node(n).type.name===this.name)return t.index(n)!==0||t.start(n+1)!==t.start()?!1:e.commands.lift(this.name);if(t.index(n)!==0)return!1}return!1}}},addNodeView(){return({node:e,getPos:t,editor:n})=>{let r=this.options.labels,i=document.createElement(`aside`);i.className=`dw-callout`,i.setAttribute(`data-type`,`callout`);let a=document.createElement(`div`);a.className=`dw-callout__side`,a.contentEditable=`false`;let o=document.createElement(`button`);o.type=`button`,o.className=`dw-callout__emoji`;let s=document.createElement(`button`);s.type=`button`,s.className=`dw-callout__color`,a.append(o,s);let c=document.createElement(`div`);c.className=`dw-callout__body`,i.append(a,c);let l=e,u=e=>{let r=t();typeof r==`number`&&n.isEditable&&n.view.dispatch(n.state.tr.setNodeMarkup(r,void 0,{...l.attrs,...e}))};o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>{if(!n.isEditable)return;let e=jP(window.prompt(r?.blocks.calloutEmoji??`Emoji`,l.attrs.emoji)??``);e&&u({emoji:e})}),s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`click`,()=>{let e=EP.indexOf(l.attrs.color);u({color:EP[(e+1)%EP.length]})});let d=()=>{i.setAttribute(`data-color`,String(l.attrs.color)),o.textContent=String(l.attrs.emoji);let e=r?.blocks.calloutEmoji??`Emoji`;o.setAttribute(`aria-label`,e),o.title=e;let t=r?.blocks.calloutColor??`Colour`;s.setAttribute(`aria-label`,t),s.title=t};return d(),{dom:i,contentDOM:c,update:t=>t.type===e.type&&(l=t,d(),!0),stopEvent:e=>a.contains(e.target),ignoreMutation:e=>a.contains(e.target)}}}});function NP(e){let t=MS.getState(e);return t?.type&&t.binding&&t.doc?t:null}function PP(e,t){let n=NP(e);if(!n||!t?.from||!t.to)return null;try{let r=e=>jS(n.doc,n.type,ly(gg(e)),n.binding.mapping),i=r(t.from),a=r(t.to);return i===null||a===null||a<=i||a>e.doc.content.size?null:{from:i,to:a}}catch{return null}}var FP=new D(`docwellComments`);function IP(e,t,n){let r=[];for(let i of t){let t=PP(e,i.anchor);t&&r.push(vs.inline(t.from,t.to,{class:i.id===n?`dw-comment is-active`:`dw-comment`,"data-comment":i.id}))}return xs.create(e.doc,r)}var LP=Tp.create({name:`commentHighlights`,addOptions(){return{onSelect:void 0}},addProseMirrorPlugins(){let e=()=>this.options.onSelect;return[new E({key:FP,state:{init:()=>({marks:[],active:``,decos:xs.empty}),apply(e,t,n,r){let i=e.getMeta(FP);if(i)return{...i,decos:IP(r,i.marks,i.active)};if(!e.docChanged||!t.marks.length)return t;let a=e.getMeta(MS)?.isChangeOrigin;return{...t,decos:a?IP(r,t.marks,t.active):t.decos.map(e.mapping,e.doc)}}},props:{decorations:e=>FP.getState(e)?.decos??xs.empty,handleClick(t,n,r){let i=r.target?.closest?.(`[data-comment]`)?.getAttribute(`data-comment`);return i&&e()?.(i),!1}}})]}}),RP=/^(\d{4})-(\d{2})-(\d{2})$/;function zP(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function BP(e){let t=RP.exec(e);if(!t)return null;let n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return zP(n)===e?n:null}function VP(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function HP(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}function UP(e,t,n=new Date){let r=BP(e);if(!r)return e;let i=t.dates,a=HP(VP(n,0),r);return a===0?i.today:a===1?i.tomorrow:a===-1?i.yesterday:new Intl.DateTimeFormat(t.locale,{month:`short`,day:`numeric`,year:r.getFullYear()===n.getFullYear()?void 0:`numeric`}).format(r)}function WP(e,t){let n=BP(e);return n?new Intl.DateTimeFormat(t.locale,{dateStyle:`full`}).format(n):e}function GP(e,t,n,r=new Date){let i=t.dates,a=e.trim().toLowerCase(),o=!1;for(let e of new Set([i.remindWord.toLowerCase(),`remind`])){if(a.startsWith(e)){o=!0,a=a.slice(e.length).trim();break}if(a.length>=3&&e.startsWith(a)){o=!0,a=``;break}}if(o&&!n)return[];let s=VP(r,0);if(!a)return o?[1,0,7].map(e=>({date:zP(VP(s,e)),remind:o})):[{date:zP(s),remind:!1},...n?[{date:zP(VP(s,1)),remind:!0}]:[]];let c=[{words:[i.today,`today`],date:s},{words:[i.tomorrow,`tomorrow`],date:VP(s,1)},{words:[i.nextWeek,`next week`],date:VP(s,7)}];o||c.push({words:[i.yesterday,`yesterday`],date:VP(s,-1)});let l=e=>new Intl.DateTimeFormat(e,{weekday:`long`});for(let e=1;e<=7;e++){let n=VP(s,e);c.push({words:[l(t.locale).format(n),l(`en`).format(n)],date:n})}let u=[];BP(a)&&u.push({date:a,remind:o});for(let e of c)e.words.some(e=>e.toLowerCase().startsWith(a))&&u.push({date:zP(e.date),remind:o});return u.filter((e,t)=>u.findIndex(t=>t.date===e.date)===t).slice(0,5)}function KP(e,t){let n=e.toLowerCase().split(` `),r=[t.dates.remindWord,`remind`,t.dates.nextWeek.split(` `)[0]??``,`next`];return n.length>1&&n.length<=3&&r.some(e=>e&&e.toLowerCase()===n[0])}var qP=Jp.create({name:`dateMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addOptions(){return{labels:void 0,me:()=>void 0}},addAttributes(){return{date:{default:``,parseHTML:e=>e.getAttribute(`data-date`)??``,renderHTML:e=>({"data-date":e.date})},remind:{default:``,parseHTML:e=>e.getAttribute(`data-remind`)??``,renderHTML:e=>e.remind?{"data-remind":e.remind}:{}},tz:{default:``,parseHTML:e=>e.getAttribute(`data-tz`)??``,renderHTML:e=>e.tz?{"data-tz":e.tz}:{}}}},parseHTML(){return[{tag:`span[data-type="date"]`}]},renderHTML({node:e,HTMLAttributes:t}){return[`span`,A({"data-type":`date`,class:`dw-date`},t),UP(e.attrs.date,this.options.labels)]},renderText({node:e}){return UP(e.attrs.date,this.options.labels)},addNodeView(){let{labels:e,me:t}=this.options;return({node:n,editor:r,getPos:i})=>{let a=n,o=document.createElement(`span`);o.dataset.type=`date`,o.className=`dw-date`,o.contentEditable=`false`;let s=null,c=()=>{let t=a.attrs.date,n=a.attrs.remind,r=!!BP(t)&&t{let t=typeof i==`function`?i():void 0;t!==void 0&&r.chain().command(({tr:n})=>(n.setNodeMarkup(t,void 0,{...a.attrs,...e}),!0)).run()};return o.addEventListener(`mousedown`,n=>{r.isEditable&&!s&&(n.preventDefault(),s=XP(o,r,a,e,t(),l,()=>s=null))}),{dom:o,update(e){return e.type===a.type&&(a=e,c(),!0)},ignoreMutation:()=>!0,stopEvent:e=>o.contains(e.target)&&e.type!==`mousedown`,destroy(){s?.()}}}}});function JP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function YP(e,t,n,r){let i={date:n.date,remind:n.remind&&r?r:``,tz:n.remind&&r?JP():``};e.chain().focus().insertContentAt(t,[{type:`dateMention`,attrs:i},{type:`text`,text:` `}]).run()}function XP(e,t,n,r,i,a,o){let s=r.dates,c=document.createElement(`div`);c.className=`dw-date-pop`,c.setAttribute(`role`,`dialog`),c.setAttribute(`aria-label`,s.edit);let l=document.createElement(`input`);l.type=`date`,l.className=`dw-input`,l.value=n.attrs.date,l.setAttribute(`aria-label`,s.edit),l.addEventListener(`change`,()=>{BP(l.value)&&a({date:l.value})}),c.append(l);let u=n.attrs.remind;if(u&&u!==i){let e=document.createElement(`p`);e.className=`dw-date-pop__note`,e.textContent=s.someoneElse,c.append(e)}else if(i){let e=document.createElement(`label`);e.className=`dw-date-pop__check`;let t=document.createElement(`input`);t.type=`checkbox`,t.checked=u===i,t.addEventListener(`change`,()=>a(t.checked?{remind:i,tz:JP()}:{remind:``,tz:``})),e.append(t,document.createTextNode(s.remindMe));let n=document.createElement(`span`);n.className=`dw-date-pop__note`,n.textContent=s.reminderAt,c.append(e,n)}document.body.append(c);let d=wj(e,c,()=>{Oj(e,c,{placement:`bottom-start`,strategy:`fixed`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:t})=>Object.assign(c.style,{left:`${e}px`,top:`${t}px`}))}),f=t=>{!c.contains(t.target)&&!e.contains(t.target)&&m()},p=e=>{e.key===`Escape`&&(e.preventDefault(),m(),t.commands.focus())};function m(){d(),c.remove(),document.removeEventListener(`mousedown`,f,!0),document.removeEventListener(`keydown`,p,!0),o()}return document.addEventListener(`mousedown`,f,!0),document.addEventListener(`keydown`,p,!0),l.focus(),m}function ZP(e){let t=document.createElement(`div`);t.className=`dw-diagram-editor`,t.setAttribute(`role`,`dialog`),t.setAttribute(`aria-modal`,`true`),t.setAttribute(`aria-label`,e);let n=document.createElement(`p`);n.className=`dw-diagram-editor__status`,t.append(n),document.body.append(t);let r=document.body.style.overflow;return document.body.style.overflow=`hidden`,{root:t,status:e=>{n.textContent=e,n.hidden=!e},close:()=>{t.remove(),document.body.style.overflow=r}}}async function QP(e,t){let n=await fetch(e.resolve(t));if(!n.ok)throw Error(`loading the drawing failed (${n.status})`);return n.text()}function $P(e,t){return new File([e],t,{type:`image/svg+xml`})}function eF(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}function tF(e,t,n){return new Promise(r=>{let i=ZP(n.slash.drawio?.label??`Draw.io`),a=document.createElement(`iframe`),o=new URL(e);for(let[e,t]of Object.entries({embed:`1`,proto:`json`,spin:`1`,saveAndExit:`1`,noExitBtn:`0`}))o.searchParams.set(e,t);a.src=o.toString(),a.className=`dw-diagram-editor__frame`,a.title=n.slash.drawio?.label??`Draw.io`;let s=document.createElement(`div`);s.className=`dw-diagram-editor__bar`;let c=document.createElement(`button`);c.type=`button`,c.className=`dw-source__btn`,c.textContent=n.blocks.cancel,c.addEventListener(`click`,()=>d(null)),s.append(c),i.root.append(s,a),i.status(``);let l=e=>a.contentWindow?.postMessage(JSON.stringify(e),o.origin),u=!1,d=e=>{window.removeEventListener(`message`,f),i.close(),r(e)},f=e=>{if(e.source!==a.contentWindow||e.origin!==o.origin||typeof e.data!=`string`)return;let n;try{n=JSON.parse(e.data)}catch{return}switch(n.event){case`init`:l({action:`load`,autosave:0,xml:t?`data:image/svg+xml;base64,${eF(t)}`:``});break;case`save`:u=!0,l({action:`export`,format:`xmlsvg`,spinKey:`saving`});break;case`export`:{let e=n.data??``,t=e.indexOf(`,`),r=e.slice(0,t),i=e.slice(t+1),a=r.includes(`;base64`)?new TextDecoder().decode(Uint8Array.from(atob(i),e=>e.charCodeAt(0))):decodeURIComponent(i);d(u?a:null);break}case`exit`:d(null)}};window.addEventListener(`message`,f)})}async function nF(e,t,n){let r=ZP(n.slash.excalidraw?.label??`Excalidraw`);r.status(``);try{let{openExcalidraw:i}=await e();return await i(r.root,t,n)}finally{r.close()}}var rF=!1;function iF(e){return Jp.create({name:e,group:`block`,atom:!0,draggable:!0,addOptions(){return{host:void 0,loadExcalidraw:void 0,labels:null,drawioUrl:void 0,onError:void 0}},addAttributes(){return{src:{default:``},alt:{default:``}}},parseHTML(){return[{tag:`figure[data-type='${e}']`,getAttrs:e=>({src:e.querySelector(`img`)?.getAttribute(`src`)??``})}]},renderHTML({node:t,HTMLAttributes:n}){return[`figure`,A(n,{"data-type":e}),[`img`,{src:String(t.attrs.src),alt:String(t.attrs.alt||e)}]]},addCommands(){return{insertDiagram:e=>({commands:t})=>(rF=!0,t.insertContent({type:e,attrs:{src:``}}))}},addNodeView(){return({node:t,editor:n,getPos:r})=>{let i=this.options,a=i.labels,o=document.createElement(`figure`);o.className=`dw-diagram dw-diagram--${e}`,o.setAttribute(`data-type`,e);let s=document.createElement(`img`);s.className=`dw-diagram__img`;let c=document.createElement(`p`);c.className=`dw-diagram__empty`,c.textContent=e===`drawio`?a.blocks.emptyDrawio:a.blocks.emptyExcalidraw;let l=document.createElement(`button`);l.type=`button`,l.className=`dw-diagram__edit`,l.textContent=a.blocks.edit,o.append(s,c,l);let u=``,d=t=>{u=String(t.attrs.src??``),s.hidden=!u,c.hidden=!!u,u&&(s.src=i.host?i.host.resolve(u):u,s.alt=String(t.attrs.alt||a.slash[e]?.label||e))};d(t);let f=!1,p=async()=>{if(!f&&m()&&i.host?.upload){f=!0;try{let t=u?await QP(i.host,u):``,o=e===`drawio`?await tF(i.drawioUrl||`https://embed.diagrams.net`,t,a):await nF(i.loadExcalidraw,t,a);if(o===null)return;let s=await i.host.upload($P(o,`${e===`drawio`?`diagram.drawio`:`drawing.excalidraw`}.svg`)),c=typeof r==`function`?r():void 0;c!==void 0&&aF(n,c,e,s.url)}catch(e){i.onError?.(e)}finally{f=!1}}},m=()=>n.isEditable&&!!i.host?.upload&&(e===`drawio`||!!i.loadExcalidraw),h=()=>l.hidden=!m()||!u;return h(),n.on(`update`,h),o.addEventListener(`dblclick`,()=>void p()),c.addEventListener(`click`,()=>void p()),l.addEventListener(`click`,()=>void p()),rF&&(rF=!1,queueMicrotask(()=>void p())),{dom:o,update:t=>t.type.name===e&&(d(t),h(),!0),ignoreMutation:()=>!0,stopEvent:e=>e.target===l||e.target===c,destroy:()=>n.off(`update`,h)}}}})}function aF(e,t,n,r){e.chain().setNodeSelection(t).updateAttributes(n,{src:r}).run()}var oF=iF(`drawio`),sF=iF(`excalidraw`),cF=null;function lF(e){cF?.();let t=document.createElement(`div`);t.className=`dw-source`,t.setAttribute(`role`,`dialog`),t.setAttribute(`aria-label`,e.label);let n=document.createElement(e.multiline?`textarea`:`input`);n.className=`dw-source__field`+(e.monospace?` dw-source__field--mono`:``),n.value=e.value,n.setAttribute(`aria-label`,e.label),n.spellcheck=!1,n instanceof HTMLTextAreaElement&&(n.rows=Math.min(16,Math.max(4,e.value.split(` +`).length+1)));let r=document.createElement(`div`);r.className=`dw-source__actions`;let i=(e,t,n)=>{let r=document.createElement(`button`);return r.type=`button`,r.className=`dw-source__btn ${t}`,r.textContent=e,r.addEventListener(`mousedown`,e=>e.preventDefault()),r.addEventListener(`click`,n),r};e.onRemove&&r.append(i(e.labels.remove,`dw-source__btn--danger`,()=>{u(!0),e.onRemove()}));let a=document.createElement(`span`);a.style.flex=`1`,r.append(a,i(e.labels.cancel,``,()=>u()),i(e.labels.done,`dw-source__btn--primary`,()=>o())),t.append(n,r),document.body.append(t);let o=()=>{let t=n.value;u(!0),e.onSave(t)};n.addEventListener(`input`,()=>e.onInput?.(n.value)),n.addEventListener(`keydown`,t=>{let n=t;n.key===`Escape`?(n.preventDefault(),u()):n.key===`Enter`&&(n.ctrlKey||n.metaKey||!e.multiline)&&(n.preventDefault(),o()),n.stopPropagation()});let s=n=>{!t.contains(n.target)&&!e.anchor.contains(n.target)&&u()};setTimeout(()=>document.addEventListener(`mousedown`,s),0);let c=wj(e.anchor,t,()=>{Oj(e.anchor,t,{placement:`bottom-start`,middleware:[Tj(6),Dj(),Ej({padding:8})]}).then(({x:e,y:n})=>Object.assign(t.style,{left:`${e}px`,top:`${n}px`}))}),l=!1;function u(n=!1){l||(l=!0,c(),document.removeEventListener(`mousedown`,s),t.remove(),cF===d&&(cF=null),n||e.onCancel?.())}let d=()=>u();return cF=d,n.focus(),e.multiline||n.select(),d}var uF=[{pattern:/^https:\/\/(?:www\.|m\.)?youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/|live\/)([\w-]{11})/,src:e=>`https://www.youtube-nocookie.com/embed/${e[1]}`},{pattern:/^https:\/\/youtu\.be\/([\w-]{11})/,src:e=>`https://www.youtube-nocookie.com/embed/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?vimeo\.com\/(?:video\/)?(\d+)/,src:e=>`https://player.vimeo.com/video/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?loom\.com\/(?:share|embed)\/([\da-f]{32})/,src:e=>`https://www.loom.com/embed/${e[1]}`},{pattern:/^https:\/\/(?:www\.)?figma\.com\/(?:file|design|proto|board|slides)\/[\w-]+/,src:(e,t)=>`https://www.figma.com/embed?embed_host=docwell&url=${encodeURIComponent(t.href)}`},{pattern:/^https:\/\/codepen\.io\/([\w-]+)\/(?:pen|embed)\/([\w-]+)/,src:e=>`https://codepen.io/${e[1]}/embed/${e[2]}?default-tab=result`},{pattern:/^https:\/\/open\.spotify\.com\/(?:embed\/)?(track|album|playlist|episode|show)\/(\w+)/,src:e=>`https://open.spotify.com/embed/${e[1]}/${e[2]}`,ratio:`audio`},{pattern:/^https:\/\/docs\.google\.com\/(document|spreadsheets|presentation)\/d\/([\w-]+)/,src:e=>`https://docs.google.com/${e[1]}/d/${e[2]}/preview`,ratio:`tall`},{pattern:/^https:\/\/(?:www\.)?google\.com\/maps\/embed\?/,src:(e,t)=>t.href}];function dF(e){let t;try{t=new URL(e.trim())}catch{return null}for(let e of uF){let n=e.pattern.exec(t.href);if(n)return{src:e.src(n,t),ratio:e.ratio??`video`}}return null}function fF(e){try{let t=new URL(e.trim());return t.protocol===`https:`||t.protocol===`http:`?t.href:``}catch{return``}}var pF=e=>{try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}};function mF(e,t,n){let{node:r}=e.view.domAtPos(e.state.selection.from),i=r instanceof HTMLElement?r:r.parentElement??e.view.dom;return new Promise(e=>{let r=t.blocks;lF({anchor:i,value:`https://`,label:n,labels:{done:r.done,cancel:r.cancel,remove:r.remove},onSave:t=>e(fF(t)),onCancel:()=>e(``)})})}async function hF(e,t,n,r){let i=await mF(e,t,t.blocks.embedUrl);i&&(dF(i)?e.chain().focus().insertEmbed(i).run():await _F(e,i,n,r))}async function gF(e,t,n,r){let i=await mF(e,t,t.blocks.linkUrl);i&&await _F(e,i,n,r)}async function _F(e,t,n,r){let i={url:t};if(n)try{i={...await n.preview(t),url:t}}catch(e){r?.(e)}e.chain().focus().insertLinkCard(i).run()}var vF=Jp.create({name:`embed`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){return{url:{default:``,parseHTML:e=>e.getAttribute(`data-url`)??``,renderHTML:e=>({"data-url":e.url})}}},parseHTML(){return[{tag:`div[data-type='embed']`}]},renderHTML({node:e,HTMLAttributes:t}){let n=fF(String(e.attrs.url));return[`div`,A(t,{"data-type":`embed`}),[`a`,{href:n},n]]},addCommands(){return{insertEmbed:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{url:e}})}},addNodeView(){return({node:e})=>{let t=this.options.labels.blocks,n=document.createElement(`figure`);n.className=`dw-embed`,n.setAttribute(`data-type`,`embed`),n.contentEditable=`false`;let r=e=>{let r=fF(e),i=dF(r);if(n.replaceChildren(),!i){let e=document.createElement(`a`);e.href=r,e.target=`_blank`,e.rel=`noopener noreferrer`,e.textContent=r||t.embedInvalid,n.append(e);return}n.dataset.ratio=i.ratio;let a=document.createElement(`iframe`);a.className=`dw-embed__frame`,a.src=i.src,a.title=`${t.embed}: ${pF(r)}`,a.loading=`lazy`,a.allow=`fullscreen; picture-in-picture; encrypted-media; clipboard-write`,a.referrerPolicy=`strict-origin-when-cross-origin`,a.setAttribute(`sandbox`,`allow-scripts allow-same-origin allow-popups allow-presentation`);let o=document.createElement(`figcaption`);o.className=`dw-embed__caption`;let s=document.createElement(`a`);s.href=r,s.target=`_blank`,s.rel=`noopener noreferrer`,s.textContent=pF(r),o.append(s),n.append(a,o)},i=String(e.attrs.url);return r(i),{dom:n,update:e=>e.type.name===`embed`&&(e.attrs.url!==i&&r(i=String(e.attrs.url)),!0),ignoreMutation:()=>!0,stopEvent:e=>e.target instanceof Element&&!!e.target.closest(`a`)}}}}),yF=Jp.create({name:`linkCard`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},addAttributes(){let e=e=>({default:``,parseHTML:t=>t.getAttribute(`data-${e}`)??``,renderHTML:t=>({[`data-${e}`]:t[e]})});return{url:e(`url`),title:e(`title`),description:e(`description`),image:e(`image`),site:e(`site`)}},parseHTML(){return[{tag:`div[data-type='link-card']`}]},renderHTML({node:e,HTMLAttributes:t}){let n=fF(String(e.attrs.url));return[`div`,A(t,{"data-type":`link-card`}),[`a`,{href:n},String(e.attrs.title||n)]]},addCommands(){return{insertLinkCard:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{url:e.url,title:e.title??``,description:e.description??``,image:e.image??``,site:e.site??``}})}},addNodeView(){return({node:e})=>{let t=document.createElement(`a`);t.className=`dw-linkcard`,t.setAttribute(`data-type`,`link-card`),t.contentEditable=`false`,t.target=`_blank`,t.rel=`noopener noreferrer`;let n=e=>{let n=fF(String(e.url));t.href=n,t.replaceChildren();let r=document.createElement(`span`);r.className=`dw-linkcard__text`;let i=document.createElement(`span`);if(i.className=`dw-linkcard__title`,i.textContent=String(e.title||``)||pF(n),r.append(i),e.description){let t=document.createElement(`span`);t.className=`dw-linkcard__desc`,t.textContent=String(e.description),r.append(t)}let a=document.createElement(`span`);a.className=`dw-linkcard__site`,a.textContent=String(e.site||``)||pF(n),r.append(a),t.append(r);let o=fF(String(e.image||``));if(o.startsWith(`https:`)){let e=document.createElement(`img`);e.className=`dw-linkcard__image`,e.src=o,e.alt=``,e.loading=`lazy`,e.referrerPolicy=`no-referrer`,e.onerror=()=>e.remove(),t.append(e)}},r=e;return n(e.attrs),t.addEventListener(`click`,e=>{this.editor.view.editable&&!(e.ctrlKey||e.metaKey)&&e.preventDefault()}),{dom:t,update:e=>e.type.name===`linkCard`&&(e.attrs!==r.attrs&&n(e.attrs),r=e,!0),ignoreMutation:()=>!0}}}}),bF=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,xF=Jp.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,A(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=A(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new qp({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=Lu(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Up({find:bF,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});async function SF(e,t,n,r){if(t.upload)for(let i of n){let n=await t.upload(i),a=n.mime.startsWith(`image/`)?{type:`image`,attrs:{src:n.url,alt:n.name}}:{type:`fileAttachment`,attrs:{url:n.url,name:n.name,size:n.size,mime:n.mime,view:jj(n.mime,n.name)?`preview`:`card`}};e.chain().focus().insertContentAt(r??e.state.selection.to,a).run(),r=void 0}}var CF=xF.extend({addOptions(){return{...this.parent(),host:void 0,inline:!1,allowBase64:!1}},addNodeView(){return({node:e})=>{let t=document.createElement(`img`),n=e=>{let n=String(e.attrs.src??``);t.src=this.options.host?this.options.host.resolve(n):n,t.alt=String(e.attrs.alt??``),e.attrs.title&&(t.title=String(e.attrs.title))};return n(e),t.draggable=!0,{dom:t,update:t=>t.type===e.type&&(n(t),!0)}}}});function wF(e){if(!e)return``;let t=[`B`,`KB`,`MB`,`GB`],n=0,r=e;for(;r>=1024&&n({editor:e,commands:t})=>{let n=e.getAttributes(this.name);return!e.isActive(this.name)||!jj(n.mime,n.name)?!1:t.updateAttributes(this.name,{view:n.view===`preview`?`card`:`preview`})}}},parseHTML(){return[{tag:`div[data-type=file]`,getAttrs:e=>({url:e.getAttribute(`data-url`)??``,name:e.getAttribute(`data-name`)??e.textContent??`file`,size:Number(e.getAttribute(`data-size`)??0),mime:e.getAttribute(`data-mime`)??``,view:e.getAttribute(`data-view`)===`preview`?`preview`:`card`})}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,A(t,{"data-type":`file`,"data-url":e.attrs.url,"data-name":e.attrs.name,"data-size":e.attrs.size,"data-mime":e.attrs.mime,"data-view":e.attrs.view}),[`a`,{href:e.attrs.url,download:e.attrs.name},e.attrs.name]]},addNodeView(){return({node:e})=>{let{host:t,loadPdf:n,labels:r}=this.options,i=document.createElement(`div`);i.className=`dw-file-block`,i.setAttribute(`data-type`,`file`);let a=document.createElement(`div`);a.className=`dw-file`;let o=document.createElement(`a`);o.className=`dw-file__name`,o.target=`_blank`,o.rel=`noopener`;let s=document.createElement(`span`);s.className=`dw-file__size`,a.append(o,s),i.append(a);let c=null,l=null,u=``,d=e=>{let a=String(e.attrs.url??``),d=t?t.resolve(a):a;o.href=d,o.textContent=String(e.attrs.name??`file`),s.textContent=wF(Number(e.attrs.size??0)),!(e.attrs.view===`preview`&&jj(e.attrs.mime,e.attrs.name)&&a)||!n||!r?(l?.(),l=null,c?.remove(),c=null,u=``):u!==d&&(l?.(),c||(c=document.createElement(`div`),c.className=`dw-pdf`,c.tabIndex=0,c.setAttribute(`role`,`document`),i.append(c)),c.setAttribute(`aria-label`,String(e.attrs.name??`PDF`)),u=d,l=Mj(c,d,n,r))};return d(e),{dom:i,update:t=>t.type===e.type&&(d(t),!0),stopEvent:e=>!!c&&c.contains(e.target)&&e.type!==`mousedown`,ignoreMutation:()=>!0,destroy:()=>l?.()}}}}),EF=Tp.create({name:`fileDrop`,addOptions(){return{host:void 0,onError:void 0}},addProseMirrorPlugins(){let e=this.options.host;return e?[DF(()=>this.editor,e,this.options.onError)]:[]}});function DF(e,t,n){let r=(r,i)=>{let a=e();return!a||!r.length||!t.upload?!1:(SF(a,t,r,i).catch(n),!0)};return new E({key:new D(`docwellFileDrop`),props:{handlePaste(e,t){return r([...t.clipboardData?.files??[]])},handleDrop(e,t){let n=[...t.dataTransfer?.files??[]];if(!n.length)return!1;let i=e.posAtCoords({left:t.clientX,top:t.clientY});return t.preventDefault(),r(n,i?.pos)}}})}var OF=new D(`dwFind`),kF=``;function AF(e,t,n=!1){if(!t)return[];let r=n?t:t.toLowerCase(),i=[];return e.descendants((e,t)=>{if(!e.isTextblock)return!0;let a=``,o=[];e.forEach((e,n)=>{let r=t+1+n;if(e.isText){let t=e.text??``;for(let e=0;ee.from>=r);return a===-1&&(a=i.length?0:-1),{term:t,caseSensitive:n,matches:i,current:a}}function MF(e,t){return t&&e.setSelection(w.create(e.doc,t.from,t.to)).scrollIntoView(),e}var NF=Tp.create({name:`findReplace`,addCommands(){return{setFind:(e,t=!1)=>({state:n,tr:r,dispatch:i})=>{let a=jF(n.doc,e,t,n.selection.from);return r.setMeta(OF,{term:e,caseSensitive:t,near:n.selection.from}),i&&i(MF(r,a.matches[a.current])),!0},findStep:e=>({state:t,tr:n,dispatch:r})=>{let i=OF.getState(t);if(!i?.matches.length)return!1;let a=(i.current+e+i.matches.length)%i.matches.length;return n.setMeta(OF,{current:a}),r&&r(MF(n,i.matches[a])),!0},replaceCurrent:e=>({state:t,tr:n,dispatch:r})=>{let i=OF.getState(t),a=i?.matches[i.current];if(!i||!a)return!1;if(r){n.insertText(e,a.from,a.to),n.setMeta(OF,{term:i.term,caseSensitive:i.caseSensitive,near:a.from+e.length});let t=jF(n.doc,i.term,i.caseSensitive,a.from+e.length);r(MF(n,t.matches[t.current]))}return!0},replaceAll:e=>({state:t,tr:n,dispatch:r})=>{let i=OF.getState(t);if(!i?.matches.length)return!1;if(r){for(let t of[...i.matches].reverse())n.insertText(e,t.from,t.to);n.setMeta(OF,{term:i.term,caseSensitive:i.caseSensitive,near:0}),r(n)}return!0},clearFind:()=>({tr:e,dispatch:t})=>(t&&t(e.setMeta(OF,{clear:!0})),!0)}},addProseMirrorPlugins(){let e={term:``,caseSensitive:!1,matches:[],current:-1};return[new E({key:OF,state:{init:()=>e,apply(t,n,r,i){let a=t.getMeta(OF);if(a&&`clear`in a)return e;if(a&&`term`in a)return jF(i.doc,a.term,a.caseSensitive,a.near);if(a&&`current`in a)return{...n,current:a.current};if(!n.term||!t.docChanged)return n;let o=n.matches[n.current]?.from??0;return jF(i.doc,n.term,n.caseSensitive,t.mapping.map(o))}},props:{decorations(e){let t=OF.getState(e);return t?.matches.length?xs.create(e.doc,t.matches.map((e,n)=>vs.inline(e.from,e.to,{class:n===t.current?`dw-find dw-find-current`:`dw-find`}))):null}}})]}}),PF={slashMenu:`Insert block`,noMatches:`No matching blocks`,slash:{text:{label:`Text`,description:`Plain paragraph`},h1:{label:`Heading 1`,description:`Big section heading`},h2:{label:`Heading 2`,description:`Medium section heading`},h3:{label:`Heading 3`,description:`Small section heading`},otherHeadings:{label:`Other headings`,description:`Headings 4 to 6`},h4:{label:`Heading 4`,description:`A heading below level 3`},h5:{label:`Heading 5`,description:`A heading below level 4`},h6:{label:`Heading 6`,description:`The smallest heading`},bullet:{label:`Bulleted list`,description:`A simple list`},ordered:{label:`Numbered list`,description:`A list with numbers`},todo:{label:`To-do list`,description:`Tasks to tick off (or type [])`},callout:{label:`Callout`,description:`Set a note apart with an emoji and colour`},table:{label:`Table`,description:`Rows and columns`},quote:{label:`Quote`,description:`Set text apart as a quote`},code:{label:`Code block`,description:`Monospaced code`},divider:{label:`Divider`,description:`A line between sections`},image:{label:`Image`,description:`Upload a picture`},file:{label:`File`,description:`Attach a file to download`},math:{label:`Math block`,description:`A formula on its own line (LaTeX)`},mathInline:{label:`Inline math`,description:`A formula inside the text (LaTeX)`},mermaid:{label:`Mermaid diagram`,description:`Flowcharts and sequences from text`},drawio:{label:`Draw.io diagram`,description:`Draw a diagram with diagrams.net`},excalidraw:{label:`Excalidraw drawing`,description:`Sketch by hand`},toc:{label:`Table of contents`,description:`The page's headings, kept up to date`},pageLink:{label:`Link to page`,description:`Link another page (or type [[)`},toggle:{label:`Toggle`,description:`A heading that hides the blocks under it`},embed:{label:`Embed`,description:`A video, design or document from YouTube, Figma and more`},linkCard:{label:`Link card`,description:`A link with its page's title and picture`},newPage:{label:`New page`,description:`Make a page and link it here`},today:{label:`Today`,description:`Insert today's date`},tomorrow:{label:`Tomorrow`,description:`Insert tomorrow's date`},yesterday:{label:`Yesterday`,description:`Insert yesterday's date`},now:{label:`Now`,description:`Insert the date and time`}},format:{bold:`Bold`,italic:`Italic`,strike:`Strikethrough`,code:`Inline code`,link:`Link`,linkPrompt:`Link address (leave empty to remove the link)`,comment:`Comment`,underline:`Underline`,color:`Colour`,textColor:`Text colour`,highlight:`Highlight`,noColor:`Default`,align:`Align`,alignLeft:`Align left`,alignCenter:`Align centre`,alignRight:`Align right`,math:`Inline math`,linkedPage:`Make a linked page`},colors:{gray:`Grey`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,teal:`Teal`,blue:`Blue`,purple:`Purple`,pink:`Pink`},table:{toolbar:`Table`,dragRow:`Drag to move the row`,dragColumn:`Drag to move the column`,moveRowUp:`Move row up`,moveRowDown:`Move row down`,moveColumnLeft:`Move column left`,moveColumnRight:`Move column right`,addRowBefore:`Add row above`,addRowAfter:`Add row below`,addColumnBefore:`Add column left`,addColumnAfter:`Add column right`,deleteRow:`Delete row`,deleteColumn:`Delete column`,toggleHeaderRow:`Header row`,mergeCells:`Merge cells`,splitCell:`Split cell`,deleteTable:`Delete table`},blockMenu:{open:`Drag to move, click for actions`,turnInto:`Turn into`,moveUp:`Move up`,moveDown:`Move down`,duplicate:`Duplicate`,copy:`Copy`,delete:`Delete`,showLineNumbers:`Show line numbers`,hideLineNumbers:`Hide line numbers`,showPages:`Show pages`,showAsFile:`Show as file`},mentions:`Mention someone`,noPeople:`Nobody found`,pageLinks:`Link to a page`,noPages:`No pages found`,blocks:{edit:`Edit`,done:`Done`,cancel:`Cancel`,save:`Save`,remove:`Remove`,saving:`Saving…`,latex:`LaTeX formula`,mermaid:`Mermaid diagram source`,mermaidError:`This diagram has an error:`,emptyDrawio:`Empty diagram. Click to draw.`,emptyExcalidraw:`Empty drawing. Click to sketch.`,loadFailed:`The editor could not be loaded.`,toc:`Contents`,tocEmpty:`Add headings to the page to fill the table of contents.`,expand:`Show contents`,collapse:`Hide contents`,embed:`Embedded content`,embedUrl:`Address of the video, design or document`,embedInvalid:`This address can't be embedded.`,linkUrl:`Address of the page to link`,copyBlockLink:`Copy link to this block`,calloutEmoji:`Change emoji`,calloutColor:`Change colour`,pdfLoading:`Loading PDF…`,pdfPage:`Page {n}`},find:{find:`Find in page`,replace:`Replace with`,previous:`Previous match`,next:`Next match`,replaceOne:`Replace`,replaceAll:`Replace all`,matchCase:`Match case`,close:`Close`,count:`{current} of {total}`,none:`No matches`},dates:{today:`Today`,tomorrow:`Tomorrow`,yesterday:`Yesterday`,nextWeek:`Next week`,remindWord:`remind`,remindMe:`Remind me`,reminderAt:`Reminder at 9:00 on the day`,someoneElse:`Someone else set a reminder on this date.`,edit:`Change date`}},I=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15e.replace(FF,`-$1`).toLowerCase(),LF={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},RF=/[&><"']/g,zF=e=>String(e).replace(RF,e=>LF[e]),BF=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?BF(e.body[0]):e:e.type===`font`?BF(e.body):e,VF=new Set([`mathord`,`textord`,`atom`]),HF=e=>VF.has(BF(e).type),UF=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},WF={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format `},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color `,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro `,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness `,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size `,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand `,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function GF(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function KF(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:GF(Array.isArray(e.type)?e.type[0]:e.type)}function qF(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?KF(r):a?a(i):i}var JF=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(WF)){var n=WF[t];n&&qF(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new I(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=UF(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},YF=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return iI[aI[this.id]]}sub(){return iI[oI[this.id]]}fracNum(){return iI[sI[this.id]]}fracDen(){return iI[cI[this.id]]}cramp(){return iI[lI[this.id]]}text(){return iI[uI[this.id]]}isTight(){return this.size>=2}},XF=0,ZF=1,QF=2,$F=3,eI=4,tI=5,nI=6,rI=7,iI=[new YF(XF,0,!1),new YF(ZF,0,!0),new YF(QF,1,!1),new YF($F,1,!0),new YF(eI,2,!1),new YF(tI,2,!0),new YF(nI,3,!1),new YF(rI,3,!0)],aI=[eI,tI,eI,tI,nI,rI,nI,rI],oI=[tI,tI,tI,tI,rI,rI,rI,rI],sI=[QF,$F,eI,tI,nI,rI,nI,rI],cI=[$F,$F,tI,tI,rI,rI,rI,rI],lI=[ZF,ZF,$F,$F,tI,tI,rI,rI],uI=[XF,ZF,QF,$F,QF,$F,QF,$F],L={DISPLAY:iI[XF],TEXT:iI[QF],SCRIPT:iI[eI],SCRIPTSCRIPT:iI[nI]},dI=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function fI(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var pI=[];dI.forEach(e=>e.blocks.forEach(e=>pI.push(...e)));function mI(e){for(var t=0;t=pI[t]&&e<=pI[t+1])return!0;return!1}var hI=e=>e+` `+e,gI=80,_I=function(e,t){return`M95,`+(622+e+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -170,7 +170,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},_I=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},vI=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+` -`+e+` @@ -180,7 +180,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},vI=function(e,t){return`M983 `+(10+e+t)+` +M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},yI=function(e,t){return`M983 `+(10+e+t)+` l`+e/3.13+` -`+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -189,7 +189,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},yI=function(e,t){return`M424,`+(2398+e+t)+` +M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},bI=function(e,t){return`M424,`+(2398+e+t)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -199,18 +199,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+` -h400000v`+(40+e)+`h-400000z`},bI=function(e,t){return`M473,`+(2713+e+t)+` +h400000v`+(40+e)+`h-400000z`},xI=function(e,t){return`M473,`+(2713+e+t)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},xI=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},SI=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+` +606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},SI=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},CI=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+` H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},CI=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=gI(t,hI);break;case`sqrtSize1`:r=_I(t,hI);break;case`sqrtSize2`:r=vI(t,hI);break;case`sqrtSize3`:r=yI(t,hI);break;case`sqrtSize4`:r=bI(t,hI);break;case`sqrtTall`:r=SI(t,hI,n)}return r},wI=function(e,t){switch(e){case`⎜`:return mI(`M291 0 H417 V`+t+` H291z`);case`∣`:return mI(`M145 0 H188 V`+t+` H145z`);case`∥`:return mI(`M145 0 H188 V`+t+` H145z`)+mI(`M367 0 H410 V`+t+` H367z`);case`⎟`:return mI(`M457 0 H583 V`+t+` H457z`);case`⎢`:return mI(`M319 0 H403 V`+t+` H319z`);case`⎥`:return mI(`M263 0 H347 V`+t+` H263z`);case`⎪`:return mI(`M384 0 H504 V`+t+` H384z`);case`⏐`:return mI(`M312 0 H355 V`+t+` H312z`);case`‖`:return mI(`M257 0 H300 V`+t+` H257z`)+mI(`M478 0 H521 V`+t+` H478z`);default:return``}},TI={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},wI=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=_I(t,gI);break;case`sqrtSize1`:r=vI(t,gI);break;case`sqrtSize2`:r=yI(t,gI);break;case`sqrtSize3`:r=bI(t,gI);break;case`sqrtSize4`:r=xI(t,gI);break;case`sqrtTall`:r=CI(t,gI,n)}return r},TI=function(e,t){switch(e){case`⎜`:return hI(`M291 0 H417 V`+t+` H291z`);case`∣`:return hI(`M145 0 H188 V`+t+` H145z`);case`∥`:return hI(`M145 0 H188 V`+t+` H145z`)+hI(`M367 0 H410 V`+t+` H367z`);case`⎟`:return hI(`M457 0 H583 V`+t+` H457z`);case`⎢`:return hI(`M319 0 H403 V`+t+` H319z`);case`⎥`:return hI(`M263 0 H347 V`+t+` H263z`);case`⎪`:return hI(`M384 0 H504 V`+t+` H384z`);case`⏐`:return hI(`M312 0 H355 V`+t+` H312z`);case`‖`:return hI(`M257 0 H300 V`+t+` H257z`)+hI(`M478 0 H521 V`+t+` H478z`);default:return``}},EI={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -256,10 +256,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:mI(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:mI(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:mI(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:mI(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:hI(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:hI(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:hI(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:hI(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:mI(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:hI(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -308,7 +308,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:mI(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:mI(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:mI(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:hI(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:hI(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:hI(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -381,7 +381,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},EI=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},DI=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -409,18 +409,18 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function DI(e){return`toText`in e}var OI=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t{if(DI(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},kI={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},AI={ex:!0,em:!0,mu:!0},jI=function(e){return typeof e!=`string`&&(e=e.unit),e in kI||e in AI||e===`ex`},MI=function(e,t){var n;if(e.unit in kI)n=kI[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new I(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},R=function(e){return+e.toFixed(4)+`em`},NI=function(e){return e.filter(e=>e).join(` `)},PI=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=FF(n)+`:`+r+`;`)}return t},FI=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},II=function(e){var t=document.createElement(e);t.className=NI(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r/=\x00-\x1f]/,RI=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+RF(NI(this.classes))+`"`);var n=PI(this.style);n&&(t+=` style="`+RF(n)+`"`);for(var r of Object.keys(this.attributes)){if(LI.test(r))throw new I(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+RF(this.attributes[r])+`"`}t+=`>`;for(var i=0;i`,t},zI=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,FI.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return II.call(this,`span`)}toMarkup(){return RI.call(this,`span`)}},BI=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,FI.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return II.call(this,`a`)}toMarkup(){return RI.call(this,`a`)}},VI=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=``+RF(this.alt)+``,e}},HI={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},UI=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=dI(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=HI[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=R(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=NI(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`0&&(n+=`margin-right:`+R(this.italic)+`;`),n+=PI(this.style),n&&(e=!0,t+=` style="`+RF(n)+`"`);var r=RF(this.text);return e?(t+=`>`,t+=r,t+=``,t):r}},WI=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n`;for(var n=0;n`,e}},GI=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,TI[this.pathName]),e}toMarkup(){return this.alternate?``:``}},KI=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=``,e}};function qI(e){if(e instanceof UI)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function JI(e){if(e instanceof zI)return e;throw Error(`Expected span but got `+String(e)+`.`)}var YI=e=>e instanceof zI||e instanceof BI||e instanceof OI,XI={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ZI={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},QI={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function $I(e,t){XI[e]=t}function eL(e,t,n){if(!XI[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=XI[t][r];if(!i&&e[0]in QI&&(r=QI[e[0]].charCodeAt(0),i=XI[t][r]),!i&&n===`text`&&pI(r)&&(i=XI[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var tL={};function nL(e){var t=e>=5?0:e>=3?1:2;if(!tL[t]){var n=tL[t]={cssEmPerMu:ZI.quad[t]/18};for(var r of Object.keys(ZI))n[r]=ZI[r][t]}return tL[t]}var rL={math:{},text:{}};function z(e,t,n,r,i,a){rL[e][i]={font:t,group:n,replace:r},a&&r&&(rL[e][r]=rL[e][i])}var B=`math`,V=`text`,H=`main`,U=`ams`,iL=`accent-token`,W=`bin`,aL=`close`,oL=`inner`,G=`mathord`,sL=`op-token`,cL=`open`,lL=`punct`,K=`rel`,uL=`spacing`,q=`textord`;z(B,H,K,`≡`,`\\equiv`,!0),z(B,H,K,`≺`,`\\prec`,!0),z(B,H,K,`≻`,`\\succ`,!0),z(B,H,K,`∼`,`\\sim`,!0),z(B,H,K,`⊥`,`\\perp`),z(B,H,K,`⪯`,`\\preceq`,!0),z(B,H,K,`⪰`,`\\succeq`,!0),z(B,H,K,`≃`,`\\simeq`,!0),z(B,H,K,`∣`,`\\mid`,!0),z(B,H,K,`≪`,`\\ll`,!0),z(B,H,K,`≫`,`\\gg`,!0),z(B,H,K,`≍`,`\\asymp`,!0),z(B,H,K,`∥`,`\\parallel`),z(B,H,K,`⋈`,`\\bowtie`,!0),z(B,H,K,`⌣`,`\\smile`,!0),z(B,H,K,`⊑`,`\\sqsubseteq`,!0),z(B,H,K,`⊒`,`\\sqsupseteq`,!0),z(B,H,K,`≐`,`\\doteq`,!0),z(B,H,K,`⌢`,`\\frown`,!0),z(B,H,K,`∋`,`\\ni`,!0),z(B,H,K,`∝`,`\\propto`,!0),z(B,H,K,`⊢`,`\\vdash`,!0),z(B,H,K,`⊣`,`\\dashv`,!0),z(B,H,K,`∋`,`\\owns`),z(B,H,lL,`.`,`\\ldotp`),z(B,H,lL,`⋅`,`\\cdotp`),z(B,H,lL,`⋅`,`·`),z(V,H,q,`⋅`,`·`),z(B,H,q,`#`,`\\#`),z(V,H,q,`#`,`\\#`),z(B,H,q,`&`,`\\&`),z(V,H,q,`&`,`\\&`),z(B,H,q,`ℵ`,`\\aleph`,!0),z(B,H,q,`∀`,`\\forall`,!0),z(B,H,q,`ℏ`,`\\hbar`,!0),z(B,H,q,`∃`,`\\exists`,!0),z(B,H,q,`∇`,`\\nabla`,!0),z(B,H,q,`♭`,`\\flat`,!0),z(B,H,q,`ℓ`,`\\ell`,!0),z(B,H,q,`♮`,`\\natural`,!0),z(B,H,q,`♣`,`\\clubsuit`,!0),z(B,H,q,`℘`,`\\wp`,!0),z(B,H,q,`♯`,`\\sharp`,!0),z(B,H,q,`♢`,`\\diamondsuit`,!0),z(B,H,q,`ℜ`,`\\Re`,!0),z(B,H,q,`♡`,`\\heartsuit`,!0),z(B,H,q,`ℑ`,`\\Im`,!0),z(B,H,q,`♠`,`\\spadesuit`,!0),z(B,H,q,`§`,`\\S`,!0),z(V,H,q,`§`,`\\S`),z(B,H,q,`¶`,`\\P`,!0),z(V,H,q,`¶`,`\\P`),z(B,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\textdagger`),z(B,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\textdaggerdbl`),z(B,H,aL,`⎱`,`\\rmoustache`,!0),z(B,H,cL,`⎰`,`\\lmoustache`,!0),z(B,H,aL,`⟯`,`\\rgroup`,!0),z(B,H,cL,`⟮`,`\\lgroup`,!0),z(B,H,W,`∓`,`\\mp`,!0),z(B,H,W,`⊖`,`\\ominus`,!0),z(B,H,W,`⊎`,`\\uplus`,!0),z(B,H,W,`⊓`,`\\sqcap`,!0),z(B,H,W,`∗`,`\\ast`),z(B,H,W,`⊔`,`\\sqcup`,!0),z(B,H,W,`◯`,`\\bigcirc`,!0),z(B,H,W,`∙`,`\\bullet`,!0),z(B,H,W,`‡`,`\\ddagger`),z(B,H,W,`≀`,`\\wr`,!0),z(B,H,W,`⨿`,`\\amalg`),z(B,H,W,`&`,`\\And`),z(B,H,K,`⟵`,`\\longleftarrow`,!0),z(B,H,K,`⇐`,`\\Leftarrow`,!0),z(B,H,K,`⟸`,`\\Longleftarrow`,!0),z(B,H,K,`⟶`,`\\longrightarrow`,!0),z(B,H,K,`⇒`,`\\Rightarrow`,!0),z(B,H,K,`⟹`,`\\Longrightarrow`,!0),z(B,H,K,`↔`,`\\leftrightarrow`,!0),z(B,H,K,`⟷`,`\\longleftrightarrow`,!0),z(B,H,K,`⇔`,`\\Leftrightarrow`,!0),z(B,H,K,`⟺`,`\\Longleftrightarrow`,!0),z(B,H,K,`↦`,`\\mapsto`,!0),z(B,H,K,`⟼`,`\\longmapsto`,!0),z(B,H,K,`↗`,`\\nearrow`,!0),z(B,H,K,`↩`,`\\hookleftarrow`,!0),z(B,H,K,`↪`,`\\hookrightarrow`,!0),z(B,H,K,`↘`,`\\searrow`,!0),z(B,H,K,`↼`,`\\leftharpoonup`,!0),z(B,H,K,`⇀`,`\\rightharpoonup`,!0),z(B,H,K,`↙`,`\\swarrow`,!0),z(B,H,K,`↽`,`\\leftharpoondown`,!0),z(B,H,K,`⇁`,`\\rightharpoondown`,!0),z(B,H,K,`↖`,`\\nwarrow`,!0),z(B,H,K,`⇌`,`\\rightleftharpoons`,!0),z(B,U,K,`≮`,`\\nless`,!0),z(B,U,K,``,`\\@nleqslant`),z(B,U,K,``,`\\@nleqq`),z(B,U,K,`⪇`,`\\lneq`,!0),z(B,U,K,`≨`,`\\lneqq`,!0),z(B,U,K,``,`\\@lvertneqq`),z(B,U,K,`⋦`,`\\lnsim`,!0),z(B,U,K,`⪉`,`\\lnapprox`,!0),z(B,U,K,`⊀`,`\\nprec`,!0),z(B,U,K,`⋠`,`\\npreceq`,!0),z(B,U,K,`⋨`,`\\precnsim`,!0),z(B,U,K,`⪹`,`\\precnapprox`,!0),z(B,U,K,`≁`,`\\nsim`,!0),z(B,U,K,``,`\\@nshortmid`),z(B,U,K,`∤`,`\\nmid`,!0),z(B,U,K,`⊬`,`\\nvdash`,!0),z(B,U,K,`⊭`,`\\nvDash`,!0),z(B,U,K,`⋪`,`\\ntriangleleft`),z(B,U,K,`⋬`,`\\ntrianglelefteq`,!0),z(B,U,K,`⊊`,`\\subsetneq`,!0),z(B,U,K,``,`\\@varsubsetneq`),z(B,U,K,`⫋`,`\\subsetneqq`,!0),z(B,U,K,``,`\\@varsubsetneqq`),z(B,U,K,`≯`,`\\ngtr`,!0),z(B,U,K,``,`\\@ngeqslant`),z(B,U,K,``,`\\@ngeqq`),z(B,U,K,`⪈`,`\\gneq`,!0),z(B,U,K,`≩`,`\\gneqq`,!0),z(B,U,K,``,`\\@gvertneqq`),z(B,U,K,`⋧`,`\\gnsim`,!0),z(B,U,K,`⪊`,`\\gnapprox`,!0),z(B,U,K,`⊁`,`\\nsucc`,!0),z(B,U,K,`⋡`,`\\nsucceq`,!0),z(B,U,K,`⋩`,`\\succnsim`,!0),z(B,U,K,`⪺`,`\\succnapprox`,!0),z(B,U,K,`≆`,`\\ncong`,!0),z(B,U,K,``,`\\@nshortparallel`),z(B,U,K,`∦`,`\\nparallel`,!0),z(B,U,K,`⊯`,`\\nVDash`,!0),z(B,U,K,`⋫`,`\\ntriangleright`),z(B,U,K,`⋭`,`\\ntrianglerighteq`,!0),z(B,U,K,``,`\\@nsupseteqq`),z(B,U,K,`⊋`,`\\supsetneq`,!0),z(B,U,K,``,`\\@varsupsetneq`),z(B,U,K,`⫌`,`\\supsetneqq`,!0),z(B,U,K,``,`\\@varsupsetneqq`),z(B,U,K,`⊮`,`\\nVdash`,!0),z(B,U,K,`⪵`,`\\precneqq`,!0),z(B,U,K,`⪶`,`\\succneqq`,!0),z(B,U,K,``,`\\@nsubseteqq`),z(B,U,W,`⊴`,`\\unlhd`),z(B,U,W,`⊵`,`\\unrhd`),z(B,U,K,`↚`,`\\nleftarrow`,!0),z(B,U,K,`↛`,`\\nrightarrow`,!0),z(B,U,K,`⇍`,`\\nLeftarrow`,!0),z(B,U,K,`⇏`,`\\nRightarrow`,!0),z(B,U,K,`↮`,`\\nleftrightarrow`,!0),z(B,U,K,`⇎`,`\\nLeftrightarrow`,!0),z(B,U,K,`△`,`\\vartriangle`),z(B,U,q,`ℏ`,`\\hslash`),z(B,U,q,`▽`,`\\triangledown`),z(B,U,q,`◊`,`\\lozenge`),z(B,U,q,`Ⓢ`,`\\circledS`),z(B,U,q,`®`,`\\circledR`),z(V,U,q,`®`,`\\circledR`),z(B,U,q,`∡`,`\\measuredangle`,!0),z(B,U,q,`∄`,`\\nexists`),z(B,U,q,`℧`,`\\mho`),z(B,U,q,`Ⅎ`,`\\Finv`,!0),z(B,U,q,`⅁`,`\\Game`,!0),z(B,U,q,`‵`,`\\backprime`),z(B,U,q,`▲`,`\\blacktriangle`),z(B,U,q,`▼`,`\\blacktriangledown`),z(B,U,q,`■`,`\\blacksquare`),z(B,U,q,`⧫`,`\\blacklozenge`),z(B,U,q,`★`,`\\bigstar`),z(B,U,q,`∢`,`\\sphericalangle`,!0),z(B,U,q,`∁`,`\\complement`,!0),z(B,U,q,`ð`,`\\eth`,!0),z(V,H,q,`ð`,`ð`),z(B,U,q,`╱`,`\\diagup`),z(B,U,q,`╲`,`\\diagdown`),z(B,U,q,`□`,`\\square`),z(B,U,q,`□`,`\\Box`),z(B,U,q,`◊`,`\\Diamond`),z(B,U,q,`¥`,`\\yen`,!0),z(V,U,q,`¥`,`\\yen`,!0),z(B,U,q,`✓`,`\\checkmark`,!0),z(V,U,q,`✓`,`\\checkmark`),z(B,U,q,`ℶ`,`\\beth`,!0),z(B,U,q,`ℸ`,`\\daleth`,!0),z(B,U,q,`ℷ`,`\\gimel`,!0),z(B,U,q,`ϝ`,`\\digamma`,!0),z(B,U,q,`ϰ`,`\\varkappa`),z(B,U,cL,`┌`,`\\@ulcorner`,!0),z(B,U,aL,`┐`,`\\@urcorner`,!0),z(B,U,cL,`└`,`\\@llcorner`,!0),z(B,U,aL,`┘`,`\\@lrcorner`,!0),z(B,U,K,`≦`,`\\leqq`,!0),z(B,U,K,`⩽`,`\\leqslant`,!0),z(B,U,K,`⪕`,`\\eqslantless`,!0),z(B,U,K,`≲`,`\\lesssim`,!0),z(B,U,K,`⪅`,`\\lessapprox`,!0),z(B,U,K,`≊`,`\\approxeq`,!0),z(B,U,W,`⋖`,`\\lessdot`),z(B,U,K,`⋘`,`\\lll`,!0),z(B,U,K,`≶`,`\\lessgtr`,!0),z(B,U,K,`⋚`,`\\lesseqgtr`,!0),z(B,U,K,`⪋`,`\\lesseqqgtr`,!0),z(B,U,K,`≑`,`\\doteqdot`),z(B,U,K,`≓`,`\\risingdotseq`,!0),z(B,U,K,`≒`,`\\fallingdotseq`,!0),z(B,U,K,`∽`,`\\backsim`,!0),z(B,U,K,`⋍`,`\\backsimeq`,!0),z(B,U,K,`⫅`,`\\subseteqq`,!0),z(B,U,K,`⋐`,`\\Subset`,!0),z(B,U,K,`⊏`,`\\sqsubset`,!0),z(B,U,K,`≼`,`\\preccurlyeq`,!0),z(B,U,K,`⋞`,`\\curlyeqprec`,!0),z(B,U,K,`≾`,`\\precsim`,!0),z(B,U,K,`⪷`,`\\precapprox`,!0),z(B,U,K,`⊲`,`\\vartriangleleft`),z(B,U,K,`⊴`,`\\trianglelefteq`),z(B,U,K,`⊨`,`\\vDash`,!0),z(B,U,K,`⊪`,`\\Vvdash`,!0),z(B,U,K,`⌣`,`\\smallsmile`),z(B,U,K,`⌢`,`\\smallfrown`),z(B,U,K,`≏`,`\\bumpeq`,!0),z(B,U,K,`≎`,`\\Bumpeq`,!0),z(B,U,K,`≧`,`\\geqq`,!0),z(B,U,K,`⩾`,`\\geqslant`,!0),z(B,U,K,`⪖`,`\\eqslantgtr`,!0),z(B,U,K,`≳`,`\\gtrsim`,!0),z(B,U,K,`⪆`,`\\gtrapprox`,!0),z(B,U,W,`⋗`,`\\gtrdot`),z(B,U,K,`⋙`,`\\ggg`,!0),z(B,U,K,`≷`,`\\gtrless`,!0),z(B,U,K,`⋛`,`\\gtreqless`,!0),z(B,U,K,`⪌`,`\\gtreqqless`,!0),z(B,U,K,`≖`,`\\eqcirc`,!0),z(B,U,K,`≗`,`\\circeq`,!0),z(B,U,K,`≜`,`\\triangleq`,!0),z(B,U,K,`∼`,`\\thicksim`),z(B,U,K,`≈`,`\\thickapprox`),z(B,U,K,`⫆`,`\\supseteqq`,!0),z(B,U,K,`⋑`,`\\Supset`,!0),z(B,U,K,`⊐`,`\\sqsupset`,!0),z(B,U,K,`≽`,`\\succcurlyeq`,!0),z(B,U,K,`⋟`,`\\curlyeqsucc`,!0),z(B,U,K,`≿`,`\\succsim`,!0),z(B,U,K,`⪸`,`\\succapprox`,!0),z(B,U,K,`⊳`,`\\vartriangleright`),z(B,U,K,`⊵`,`\\trianglerighteq`),z(B,U,K,`⊩`,`\\Vdash`,!0),z(B,U,K,`∣`,`\\shortmid`),z(B,U,K,`∥`,`\\shortparallel`),z(B,U,K,`≬`,`\\between`,!0),z(B,U,K,`⋔`,`\\pitchfork`,!0),z(B,U,K,`∝`,`\\varpropto`),z(B,U,K,`◀`,`\\blacktriangleleft`),z(B,U,K,`∴`,`\\therefore`,!0),z(B,U,K,`∍`,`\\backepsilon`),z(B,U,K,`▶`,`\\blacktriangleright`),z(B,U,K,`∵`,`\\because`,!0),z(B,U,K,`⋘`,`\\llless`),z(B,U,K,`⋙`,`\\gggtr`),z(B,U,W,`⊲`,`\\lhd`),z(B,U,W,`⊳`,`\\rhd`),z(B,U,K,`≂`,`\\eqsim`,!0),z(B,H,K,`⋈`,`\\Join`),z(B,U,K,`≑`,`\\Doteq`,!0),z(B,U,W,`∔`,`\\dotplus`,!0),z(B,U,W,`∖`,`\\smallsetminus`),z(B,U,W,`⋒`,`\\Cap`,!0),z(B,U,W,`⋓`,`\\Cup`,!0),z(B,U,W,`⩞`,`\\doublebarwedge`,!0),z(B,U,W,`⊟`,`\\boxminus`,!0),z(B,U,W,`⊞`,`\\boxplus`,!0),z(B,U,W,`⋇`,`\\divideontimes`,!0),z(B,U,W,`⋉`,`\\ltimes`,!0),z(B,U,W,`⋊`,`\\rtimes`,!0),z(B,U,W,`⋋`,`\\leftthreetimes`,!0),z(B,U,W,`⋌`,`\\rightthreetimes`,!0),z(B,U,W,`⋏`,`\\curlywedge`,!0),z(B,U,W,`⋎`,`\\curlyvee`,!0),z(B,U,W,`⊝`,`\\circleddash`,!0),z(B,U,W,`⊛`,`\\circledast`,!0),z(B,U,W,`⋅`,`\\centerdot`),z(B,U,W,`⊺`,`\\intercal`,!0),z(B,U,W,`⋒`,`\\doublecap`),z(B,U,W,`⋓`,`\\doublecup`),z(B,U,W,`⊠`,`\\boxtimes`,!0),z(B,U,K,`⇢`,`\\dashrightarrow`,!0),z(B,U,K,`⇠`,`\\dashleftarrow`,!0),z(B,U,K,`⇇`,`\\leftleftarrows`,!0),z(B,U,K,`⇆`,`\\leftrightarrows`,!0),z(B,U,K,`⇚`,`\\Lleftarrow`,!0),z(B,U,K,`↞`,`\\twoheadleftarrow`,!0),z(B,U,K,`↢`,`\\leftarrowtail`,!0),z(B,U,K,`↫`,`\\looparrowleft`,!0),z(B,U,K,`⇋`,`\\leftrightharpoons`,!0),z(B,U,K,`↶`,`\\curvearrowleft`,!0),z(B,U,K,`↺`,`\\circlearrowleft`,!0),z(B,U,K,`↰`,`\\Lsh`,!0),z(B,U,K,`⇈`,`\\upuparrows`,!0),z(B,U,K,`↿`,`\\upharpoonleft`,!0),z(B,U,K,`⇃`,`\\downharpoonleft`,!0),z(B,H,K,`⊶`,`\\origof`,!0),z(B,H,K,`⊷`,`\\imageof`,!0),z(B,U,K,`⊸`,`\\multimap`,!0),z(B,U,K,`↭`,`\\leftrightsquigarrow`,!0),z(B,U,K,`⇉`,`\\rightrightarrows`,!0),z(B,U,K,`⇄`,`\\rightleftarrows`,!0),z(B,U,K,`↠`,`\\twoheadrightarrow`,!0),z(B,U,K,`↣`,`\\rightarrowtail`,!0),z(B,U,K,`↬`,`\\looparrowright`,!0),z(B,U,K,`↷`,`\\curvearrowright`,!0),z(B,U,K,`↻`,`\\circlearrowright`,!0),z(B,U,K,`↱`,`\\Rsh`,!0),z(B,U,K,`⇊`,`\\downdownarrows`,!0),z(B,U,K,`↾`,`\\upharpoonright`,!0),z(B,U,K,`⇂`,`\\downharpoonright`,!0),z(B,U,K,`⇝`,`\\rightsquigarrow`,!0),z(B,U,K,`⇝`,`\\leadsto`),z(B,U,K,`⇛`,`\\Rrightarrow`,!0),z(B,U,K,`↾`,`\\restriction`),z(B,H,q,`‘`,"`"),z(B,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\textdollar`),z(B,H,q,`%`,`\\%`),z(V,H,q,`%`,`\\%`),z(B,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\textunderscore`),z(B,H,q,`∠`,`\\angle`,!0),z(B,H,q,`∞`,`\\infty`,!0),z(B,H,q,`′`,`\\prime`),z(B,H,q,`△`,`\\triangle`),z(B,H,q,`Γ`,`\\Gamma`,!0),z(B,H,q,`Δ`,`\\Delta`,!0),z(B,H,q,`Θ`,`\\Theta`,!0),z(B,H,q,`Λ`,`\\Lambda`,!0),z(B,H,q,`Ξ`,`\\Xi`,!0),z(B,H,q,`Π`,`\\Pi`,!0),z(B,H,q,`Σ`,`\\Sigma`,!0),z(B,H,q,`Υ`,`\\Upsilon`,!0),z(B,H,q,`Φ`,`\\Phi`,!0),z(B,H,q,`Ψ`,`\\Psi`,!0),z(B,H,q,`Ω`,`\\Omega`,!0),z(B,H,q,`A`,`Α`),z(B,H,q,`B`,`Β`),z(B,H,q,`E`,`Ε`),z(B,H,q,`Z`,`Ζ`),z(B,H,q,`H`,`Η`),z(B,H,q,`I`,`Ι`),z(B,H,q,`K`,`Κ`),z(B,H,q,`M`,`Μ`),z(B,H,q,`N`,`Ν`),z(B,H,q,`O`,`Ο`),z(B,H,q,`P`,`Ρ`),z(B,H,q,`T`,`Τ`),z(B,H,q,`X`,`Χ`),z(B,H,q,`¬`,`\\neg`,!0),z(B,H,q,`¬`,`\\lnot`),z(B,H,q,`⊤`,`\\top`),z(B,H,q,`⊥`,`\\bot`),z(B,H,q,`∅`,`\\emptyset`),z(B,U,q,`∅`,`\\varnothing`),z(B,H,G,`α`,`\\alpha`,!0),z(B,H,G,`β`,`\\beta`,!0),z(B,H,G,`γ`,`\\gamma`,!0),z(B,H,G,`δ`,`\\delta`,!0),z(B,H,G,`ϵ`,`\\epsilon`,!0),z(B,H,G,`ζ`,`\\zeta`,!0),z(B,H,G,`η`,`\\eta`,!0),z(B,H,G,`θ`,`\\theta`,!0),z(B,H,G,`ι`,`\\iota`,!0),z(B,H,G,`κ`,`\\kappa`,!0),z(B,H,G,`λ`,`\\lambda`,!0),z(B,H,G,`μ`,`\\mu`,!0),z(B,H,G,`ν`,`\\nu`,!0),z(B,H,G,`ξ`,`\\xi`,!0),z(B,H,G,`ο`,`\\omicron`,!0),z(B,H,G,`π`,`\\pi`,!0),z(B,H,G,`ρ`,`\\rho`,!0),z(B,H,G,`σ`,`\\sigma`,!0),z(B,H,G,`τ`,`\\tau`,!0),z(B,H,G,`υ`,`\\upsilon`,!0),z(B,H,G,`ϕ`,`\\phi`,!0),z(B,H,G,`χ`,`\\chi`,!0),z(B,H,G,`ψ`,`\\psi`,!0),z(B,H,G,`ω`,`\\omega`,!0),z(B,H,G,`ε`,`\\varepsilon`,!0),z(B,H,G,`ϑ`,`\\vartheta`,!0),z(B,H,G,`ϖ`,`\\varpi`,!0),z(B,H,G,`ϱ`,`\\varrho`,!0),z(B,H,G,`ς`,`\\varsigma`,!0),z(B,H,G,`φ`,`\\varphi`,!0),z(B,H,W,`∗`,`*`,!0),z(B,H,W,`+`,`+`),z(B,H,W,`−`,`-`,!0),z(B,H,W,`⋅`,`\\cdot`,!0),z(B,H,W,`∘`,`\\circ`,!0),z(B,H,W,`÷`,`\\div`,!0),z(B,H,W,`±`,`\\pm`,!0),z(B,H,W,`×`,`\\times`,!0),z(B,H,W,`∩`,`\\cap`,!0),z(B,H,W,`∪`,`\\cup`,!0),z(B,H,W,`∖`,`\\setminus`,!0),z(B,H,W,`∧`,`\\land`),z(B,H,W,`∨`,`\\lor`),z(B,H,W,`∧`,`\\wedge`,!0),z(B,H,W,`∨`,`\\vee`,!0),z(B,H,q,`√`,`\\surd`),z(B,H,cL,`⟨`,`\\langle`,!0),z(B,H,cL,`∣`,`\\lvert`),z(B,H,cL,`∥`,`\\lVert`),z(B,H,aL,`?`,`?`),z(B,H,aL,`!`,`!`),z(B,H,aL,`⟩`,`\\rangle`,!0),z(B,H,aL,`∣`,`\\rvert`),z(B,H,aL,`∥`,`\\rVert`),z(B,H,K,`=`,`=`),z(B,H,K,`:`,`:`),z(B,H,K,`≈`,`\\approx`,!0),z(B,H,K,`≅`,`\\cong`,!0),z(B,H,K,`≥`,`\\ge`),z(B,H,K,`≥`,`\\geq`,!0),z(B,H,K,`←`,`\\gets`),z(B,H,K,`>`,`\\gt`,!0),z(B,H,K,`∈`,`\\in`,!0),z(B,H,K,``,`\\@not`),z(B,H,K,`⊂`,`\\subset`,!0),z(B,H,K,`⊃`,`\\supset`,!0),z(B,H,K,`⊆`,`\\subseteq`,!0),z(B,H,K,`⊇`,`\\supseteq`,!0),z(B,U,K,`⊈`,`\\nsubseteq`,!0),z(B,U,K,`⊉`,`\\nsupseteq`,!0),z(B,H,K,`⊨`,`\\models`),z(B,H,K,`←`,`\\leftarrow`,!0),z(B,H,K,`≤`,`\\le`),z(B,H,K,`≤`,`\\leq`,!0),z(B,H,K,`<`,`\\lt`,!0),z(B,H,K,`→`,`\\rightarrow`,!0),z(B,H,K,`→`,`\\to`),z(B,U,K,`≱`,`\\ngeq`,!0),z(B,U,K,`≰`,`\\nleq`,!0),z(B,H,uL,`\xA0`,`\\ `),z(B,H,uL,`\xA0`,`\\space`),z(B,H,uL,`\xA0`,`\\nobreakspace`),z(V,H,uL,`\xA0`,`\\ `),z(V,H,uL,`\xA0`,` `),z(V,H,uL,`\xA0`,`\\space`),z(V,H,uL,`\xA0`,`\\nobreakspace`),z(B,H,uL,``,`\\nobreak`),z(B,H,uL,``,`\\allowbreak`),z(B,H,lL,`,`,`,`),z(B,H,lL,`;`,`;`),z(B,U,W,`⊼`,`\\barwedge`,!0),z(B,U,W,`⊻`,`\\veebar`,!0),z(B,H,W,`⊙`,`\\odot`,!0),z(B,H,W,`⊕`,`\\oplus`,!0),z(B,H,W,`⊗`,`\\otimes`,!0),z(B,H,q,`∂`,`\\partial`,!0),z(B,H,W,`⊘`,`\\oslash`,!0),z(B,U,W,`⊚`,`\\circledcirc`,!0),z(B,U,W,`⊡`,`\\boxdot`,!0),z(B,H,W,`△`,`\\bigtriangleup`),z(B,H,W,`▽`,`\\bigtriangledown`),z(B,H,W,`†`,`\\dagger`),z(B,H,W,`⋄`,`\\diamond`),z(B,H,W,`⋆`,`\\star`),z(B,H,W,`◃`,`\\triangleleft`),z(B,H,W,`▹`,`\\triangleright`),z(B,H,cL,`{`,`\\{`),z(V,H,q,`{`,`\\{`),z(V,H,q,`{`,`\\textbraceleft`),z(B,H,aL,`}`,`\\}`),z(V,H,q,`}`,`\\}`),z(V,H,q,`}`,`\\textbraceright`),z(B,H,cL,`{`,`\\lbrace`),z(B,H,aL,`}`,`\\rbrace`),z(B,H,cL,`[`,`\\lbrack`,!0),z(V,H,q,`[`,`\\lbrack`,!0),z(B,H,aL,`]`,`\\rbrack`,!0),z(V,H,q,`]`,`\\rbrack`,!0),z(B,H,cL,`(`,`\\lparen`,!0),z(B,H,aL,`)`,`\\rparen`,!0),z(V,H,q,`<`,`\\textless`,!0),z(V,H,q,`>`,`\\textgreater`,!0),z(B,H,cL,`⌊`,`\\lfloor`,!0),z(B,H,aL,`⌋`,`\\rfloor`,!0),z(B,H,cL,`⌈`,`\\lceil`,!0),z(B,H,aL,`⌉`,`\\rceil`,!0),z(B,H,q,`\\`,`\\backslash`),z(B,H,q,`∣`,`|`),z(B,H,q,`∣`,`\\vert`),z(V,H,q,`|`,`\\textbar`,!0),z(B,H,q,`∥`,`\\|`),z(B,H,q,`∥`,`\\Vert`),z(V,H,q,`∥`,`\\textbardbl`),z(V,H,q,`~`,`\\textasciitilde`),z(V,H,q,`\\`,`\\textbackslash`),z(V,H,q,`^`,`\\textasciicircum`),z(B,H,K,`↑`,`\\uparrow`,!0),z(B,H,K,`⇑`,`\\Uparrow`,!0),z(B,H,K,`↓`,`\\downarrow`,!0),z(B,H,K,`⇓`,`\\Downarrow`,!0),z(B,H,K,`↕`,`\\updownarrow`,!0),z(B,H,K,`⇕`,`\\Updownarrow`,!0),z(B,H,sL,`∐`,`\\coprod`),z(B,H,sL,`⋁`,`\\bigvee`),z(B,H,sL,`⋀`,`\\bigwedge`),z(B,H,sL,`⨄`,`\\biguplus`),z(B,H,sL,`⋂`,`\\bigcap`),z(B,H,sL,`⋃`,`\\bigcup`),z(B,H,sL,`∫`,`\\int`),z(B,H,sL,`∫`,`\\intop`),z(B,H,sL,`∬`,`\\iint`),z(B,H,sL,`∭`,`\\iiint`),z(B,H,sL,`∏`,`\\prod`),z(B,H,sL,`∑`,`\\sum`),z(B,H,sL,`⨂`,`\\bigotimes`),z(B,H,sL,`⨁`,`\\bigoplus`),z(B,H,sL,`⨀`,`\\bigodot`),z(B,H,sL,`∮`,`\\oint`),z(B,H,sL,`∯`,`\\oiint`),z(B,H,sL,`∰`,`\\oiiint`),z(B,H,sL,`⨆`,`\\bigsqcup`),z(B,H,sL,`∫`,`\\smallint`),z(V,H,oL,`…`,`\\textellipsis`),z(B,H,oL,`…`,`\\mathellipsis`),z(V,H,oL,`…`,`\\ldots`,!0),z(B,H,oL,`…`,`\\ldots`,!0),z(B,H,oL,`⋯`,`\\@cdots`,!0),z(B,H,oL,`⋱`,`\\ddots`,!0),z(B,H,q,`⋮`,`\\varvdots`),z(V,H,q,`⋮`,`\\varvdots`),z(B,H,iL,`ˊ`,`\\acute`),z(B,H,iL,`ˋ`,`\\grave`),z(B,H,iL,`¨`,`\\ddot`),z(B,H,iL,`~`,`\\tilde`),z(B,H,iL,`ˉ`,`\\bar`),z(B,H,iL,`˘`,`\\breve`),z(B,H,iL,`ˇ`,`\\check`),z(B,H,iL,`^`,`\\hat`),z(B,H,iL,`⃗`,`\\vec`),z(B,H,iL,`˙`,`\\dot`),z(B,H,iL,`˚`,`\\mathring`),z(B,H,G,``,`\\@imath`),z(B,H,G,``,`\\@jmath`),z(B,H,q,`ı`,`ı`),z(B,H,q,`ȷ`,`ȷ`),z(V,H,q,`ı`,`\\i`,!0),z(V,H,q,`ȷ`,`\\j`,!0),z(V,H,q,`ß`,`\\ss`,!0),z(V,H,q,`æ`,`\\ae`,!0),z(V,H,q,`œ`,`\\oe`,!0),z(V,H,q,`ø`,`\\o`,!0),z(V,H,q,`Æ`,`\\AE`,!0),z(V,H,q,`Œ`,`\\OE`,!0),z(V,H,q,`Ø`,`\\O`,!0),z(V,H,iL,`ˊ`,`\\'`),z(V,H,iL,`ˋ`,"\\`"),z(V,H,iL,`ˆ`,`\\^`),z(V,H,iL,`˜`,`\\~`),z(V,H,iL,`ˉ`,`\\=`),z(V,H,iL,`˘`,`\\u`),z(V,H,iL,`˙`,`\\.`),z(V,H,iL,`¸`,`\\c`),z(V,H,iL,`˚`,`\\r`),z(V,H,iL,`ˇ`,`\\v`),z(V,H,iL,`¨`,`\\"`),z(V,H,iL,`˝`,`\\H`),z(V,H,iL,`◯`,`\\textcircled`);var dL={"--":!0,"---":!0,"``":!0,"''":!0};z(V,H,q,`–`,`--`,!0),z(V,H,q,`–`,`\\textendash`),z(V,H,q,`—`,`---`,!0),z(V,H,q,`—`,`\\textemdash`),z(V,H,q,`‘`,"`",!0),z(V,H,q,`‘`,`\\textquoteleft`),z(V,H,q,`’`,`'`,!0),z(V,H,q,`’`,`\\textquoteright`),z(V,H,q,`“`,"``",!0),z(V,H,q,`“`,`\\textquotedblleft`),z(V,H,q,`”`,`''`,!0),z(V,H,q,`”`,`\\textquotedblright`),z(B,H,q,`°`,`\\degree`,!0),z(V,H,q,`°`,`\\degree`),z(V,H,q,`°`,`\\textdegree`,!0),z(B,H,q,`£`,`\\pounds`),z(B,H,q,`£`,`\\mathsterling`,!0),z(V,H,q,`£`,`\\pounds`),z(V,H,q,`£`,`\\textsterling`,!0),z(B,U,q,`✠`,`\\maltese`),z(V,U,q,`✠`,`\\maltese`);for(var fL=`0123456789/@."`,pL=0;pL{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return BL[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return VL[Math.floor((r-120782)/10)];if(r===120485||r===120486)return BL[0];if(120486{if(NI(e.classes)!==NI(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},YL=e=>{for(var t=0;tt&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Y=function(e,t,n,r){var i=new zI(e,t,n,r);return XL(i),i},ZL=(e,t,n,r)=>new zI(e,t,n,r),QL=function(e,t,n){var r=Y([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=R(r.height),r.maxFontSize=1,r},$L=function(e,t,n,r){var i=new BI(e,t,n,r);return XL(i),i},eR=function(e){var t=new OI(e);return XL(t),t},tR=function(e,t){return e instanceof OI?Y([],[e],t):e},nR=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a{var n=Y([`mspace`],[],t),r=MI(e,t);return n.style.marginRight=R(r),n},aR=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},oR={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},sR={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},cR=function(e,t){var n=sR[e],r=n[0],i=n[1],a=n[2],o=ZL([`katex-overlay`],[new WI([new GI(r)],{width:R(i),height:R(a),style:`width:`+R(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=R(a),o.style.width=R(i),o},lR={number:3,unit:`mu`},uR={number:4,unit:`mu`},dR={number:5,unit:`mu`},fR={mord:{mop:lR,mbin:uR,mrel:dR,minner:lR},mop:{mord:lR,mop:lR,mrel:dR,minner:lR},mbin:{mord:uR,mop:uR,mopen:uR,minner:uR},mrel:{mord:dR,mop:dR,mopen:dR,minner:dR},mopen:{},mclose:{mop:lR,mbin:uR,mrel:dR,minner:lR},mpunct:{mord:lR,mop:lR,mrel:dR,mopen:lR,mclose:lR,mpunct:lR,minner:lR},minner:{mord:lR,mop:lR,mbin:uR,mrel:dR,mopen:lR,mpunct:lR,minner:lR}},pR={mord:{mop:lR},mop:{mord:lR,mop:lR},mbin:{},mrel:{},mopen:{},mclose:{mop:lR},mpunct:{},minner:{mop:lR}},mR={},hR={},gR={};function X(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a{var n=t.classes[0],r=e.classes[0];n===`mbin`&&xR.has(r)?t.classes[0]=`mord`:r===`mbin`&&bR.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),TR(i,(e,t)=>{var n=OR(t),r=OR(e),i=n&&r?e.hasClass(`mtight`)?pR[n]?.[r]:fR[n]?.[r]:null;if(i)return iR(i,c)},{node:u},d,f),i},TR=function(e,t,n,r,i){r&&e.push(r);for(var a=0;an=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},ER=function(e){return e instanceof OI||e instanceof BI||e instanceof zI&&e.hasClass(`enclosing`)?e:null},DR=function(e,t){var n=ER(e);if(n){var r=n.children;if(r.length){if(t===`right`)return DR(r[r.length-1],`right`);if(t===`left`)return DR(r[0],`left`)}}return e},OR=function(e,t){return e?(t&&(e=DR(e,t)),CR[e.classes[0]]||null):null},kR=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return Y(t.concat(n))},AR=function(e,t,n){if(!e)return Y();if(hR[e.type]){var r=hR[e.type](e,t);if(n&&t.size!==n.size){r=Y(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new I(`Got group of unknown type: '`+e.type+`'`)};function jR(e,t){var n=Y([`katex-base`],e,t),r=Y([`katex-strut`]);return r.style.height=R(n.height+n.depth),n.depth&&(r.style.verticalAlign=R(-n.depth)),n.children.unshift(r),n}function MR(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=wR(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s0&&(a.push(jR(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(jR(o,t));var l;n?(l=jR(wR(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=Y([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=R(u.height+u.depth),u.depth&&(d.style.verticalAlign=R(-u.depth))}return u}function NR(e){return new OI(e)}var Z=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=NI(this.classes));for(var i=0;i0&&(e+=` class ="`+RF(NI(this.classes))+`"`),e+=`>`;for(var i=0;i`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},PR=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return RF(this.toText())}toText(){return this.text}},FR=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,R(this.width)),e}toMarkup(){return this.character?``+this.character+``:``}toText(){return this.character?this.character:` `}},IR=new Set([`\\imath`,`\\jmath`]),LR=new Set([`mrow`,`mtable`]),RR=function(e,t,n){var r,i;return rL[t][e]&&rL[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(dL,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=rL[t][e].replace),new PR(e)},zR=function(e){return e.length===1?e[0]:new Z(`mrow`,e)},BR={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},VR=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=BR[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(IR.has(a))return null;if(rL[r][a]){var o=rL[r][a].replace;o&&(a=o)}var s=oR[n].fontName;return eL(a,s,r)?oR[n].variant:null};function HR(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof PR&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof PR&&n.text===`,`}return!1}var UR=function(e,t,n){if(e.length===1){var r=GR(e[0],t);return n&&r instanceof Z&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o=1&&(a.type===`mn`||HR(a))){var c=s.children[0];c instanceof Z&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof PR&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof PR&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},WR=function(e,t,n){return zR(UR(e,t,n))},GR=function(e,t){if(!e)return new Z(`mrow`);if(gR[e.type])return gR[e.type](e,t);throw new I(`Got group of unknown type: '`+e.type+`'`)};function KR(e,t,n,r,i){var a=UR(e,n),o=a.length===1&&a[0]instanceof Z&&LR.has(a[0].type)?a[0]:new Z(`mrow`,a),s=new Z(`annotation`,[new PR(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Z(`math`,[new Z(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),Y([i?`katex`:`katex-mathml`],[c])}var qR=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],JR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],YR=function(e,t){return t.size<2?e:qR[e-1][t.size-1]},XR=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=JR[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:YR(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:JR[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=YR(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=nL(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};XR.BASESIZE=6;var ZR=function(e){return new XR({style:e.displayMode?L.DISPLAY:L.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},QR=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=Y(n,[e])}return e},$R=function(e,t,n){var r=ZR(n),i;return n.output===`mathml`?KR(e,t,r,n.displayMode,!0):(i=n.output===`html`?Y([`katex`],[MR(e,r)]):Y([`katex`],[KR(e,t,r,n.displayMode,!1),MR(e,r)]),QR(i,n))},ez=function(e,t,n){return QR(Y([`katex`],[MR(e,ZR(n))]),n)},tz={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},nz=function(e){var t=new Z(`mo`,[new PR(tz[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},rz={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},iz=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),az=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(iz.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:ZL([],[new WI([new GI(o)],{width:`100%`,height:R(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=rz[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support - `+h+` children.`);for(var v=0;v0&&(i.style.minWidth=R(a)),i},oz=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=Y([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new KI({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new KI({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=ZL([],[new WI(c,{width:`100%`,height:R(o)})],i)}return a.height=o,a.style.height=R(o),a},sz=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],cz=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],lz=new Set(sz),uz=new Set(cz);function dz(e){return lz.has(e)}function Q(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function fz(e){var t=pz(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function pz(e){return e.type===`atom`||uz.has(e.type)?e:null}function mz(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new I(t,e);return r}var hz=e=>{if(e instanceof UI)return e;if(YI(e)&&e.children.length===1)return hz(e.children[0])},gz=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Q(e.base,`accent`),n=r.base,e.base=n,i=JI(AR(e,t)),e.base=r):(r=Q(e,`accent`),n=r.base);var a=AR(n,t.havingCrampedStyle()),o=r.isShifty&&VF(n),s=0;o&&(s=hz(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=az(r,t),u=rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+R(2*s)+`)`,marginLeft:R(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=cR(`vec`,t),f=sR.vec[1]):(d=qL({type:`textord`,mode:r.mode,text:r.label},t),d=qI(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=Y([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=R(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=Y([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},_z=(e,t)=>{var n=e.isStretchy?nz(e.label):new Z(`mo`,[RR(e.label,e.mode)]),r=new Z(`mover`,[GR(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},vz=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));X({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=vR(t[0]),r=!vz.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:gz,mathmlBuilder:_z}),X({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),X({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=AR(e.base,t),r=az(e,t),i=e.label===`\\utilde`?.12:0;return Y([`mord`,`accentunder`],[rR({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=nz(e.label),r=new Z(`munder`,[GR(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var yz=e=>{var t=new Z(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};X({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=tR(AR(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=tR(AR(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=az(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=rR({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=rR({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return Y([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=nz(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=yz(GR(e.body,t));r=e.below?new Z(`munderover`,[n,yz(GR(e.below,t)),i]):new Z(`mover`,[n,i])}else e.below?r=new Z(`munder`,[n,yz(GR(e.below,t))]):(r=yz(),r=new Z(`mover`,[n,r]));return r}});function bz(e,t){var n=wR(e.body,t,!0);return Y([e.mclass],n,t)}function xz(e,t){var n,r=UR(e.body,t);return e.mclass===`minner`?n=new Z(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Z(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Z(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}X({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:yR(i),isCharacterBox:VF(i)}},htmlBuilder:bz,mathmlBuilder:xz});var Sz=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};X({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:Sz(t[0]),body:yR(t[1]),isCharacterBox:VF(t[1])}}}),X({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Sz(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:yR(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:VF(c)}}}),X({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:Sz(t[0]),body:yR(t[0])}},htmlBuilder(e,t){var n=wR(e.body,t,!0),r=Y([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Z(`mstyle`,UR(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Cz={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},wz=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Tz=e=>e.type===`textord`&&e.text===`@`,Ez=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Dz(e,t,n){var r=Cz[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function Oz(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new I(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;aAV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;pAV=|." after @`,o[c])}var m={type:`styling`,body:[Dz(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=wz()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}X({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=tR(AR(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=R(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Z(`mrow`,[GR(e.label,t)]);return n=new Z(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Z(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),X({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=tR(AR(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Z(`mrow`,[GR(e.fragment,t)])}}),X({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=mz(Q(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new I(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new I(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),X({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=Q(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:yR(i)}},htmlBuilder:(e,t)=>eR(wR(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Z(`mstyle`,UR(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),X({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=Q(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),X({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var r=e.parser,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Q(i,`size`).value}},htmlBuilder(e,t){var n=Y([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=R(MI(e.size,t)))),n},mathmlBuilder(e,t){var n=new Z(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,R(MI(e.size,t)))),n}});var kz={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},Az=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new I(`Expected a control sequence`,e);return t},jz=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Mz=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};X({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(kz[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=kz[r.text]),Q(t.parseFunction(),`internal`);throw new I(`Invalid token after macro prefix`,r)}}),X({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new I(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new I(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new I(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new I(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===kz[n]),{type:`internal`,mode:t.mode}}}),X({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=Az(t.gullet.popToken());return t.gullet.consumeSpaces(),Mz(t,r,jz(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),X({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=Az(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Mz(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Nz=function(e,t,n){var r=eL(rL.math[e]&&rL.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Pz=function(e,t,n,r){var i=n.havingBaseStyle(t),a=Y(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Fz=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=R(i),e.height-=i,e.depth+=i},Iz=function(e,t,n,r,i,a){var o=Pz(WL(e,`Main-Regular`,i,r),t,r,a);return n&&Fz(o,r,t),o},Lz=function(e,t,n,r){return WL(e,`Size`+t+`-Regular`,n,r)},Rz=function(e,t,n,r,i,a){var o=Lz(e,t,i,r),s=Pz(Y([`delimsizing`,`size`+t],[o],r),L.TEXT,r,a);return n&&Fz(s,r,L.TEXT),s},zz=function(e,t,n){return{type:`elem`,elem:Y([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[Y([],[WL(e,t,n)])])}},Bz=function(e,t,n){var r=XI[`Size4-Regular`][e.charCodeAt(0)]?XI[`Size4-Regular`][e.charCodeAt(0)][4]:XI[`Size1-Regular`][e.charCodeAt(0)][4],i=ZL([],[new WI([new GI(`inner`,wI(e,Math.round(1e3*t)))],{width:R(r),height:R(t),style:`width:`+R(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=R(t),i.style.width=R(r),{type:`elem`,elem:i}},Vz=.008,Hz={type:`kern`,size:-1*Vz},Uz=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),Wz=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Gz=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Uz.has(e)?(c=`∣`,u=`vert`,d=333):Wz.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=Nz(o,f,i),m=p.height+p.depth,h=Nz(c,f,i),g=h.height+h.depth,_=Nz(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Nz(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,ee=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,te=r.fontMetrics().axisHeight;n&&(te*=r.sizeMultiplier);var ne=ee/2-te,re=[];if(u.length>0){var ie=ee-m-v,ae=Math.round(ee*1e3),oe=EI(u,Math.round(ie*1e3)),se=new GI(u,oe),ce=R(d/1e3),le=R(ae/1e3),ue=ZL([],[new WI([se],{width:ce,height:le,viewBox:`0 0 `+d+` `+ae})],r);ue.height=ae/1e3,ue.style.width=ce,ue.style.height=le,re.push({type:`elem`,elem:ue})}else{if(re.push(zz(l,f,i)),re.push(Hz),s===null){var de=ee-m-v+2*Vz;re.push(Bz(c,de,r))}else{var fe=(ee-m-v-y)/2+2*Vz;re.push(Bz(c,fe,r)),re.push(Hz),re.push(zz(s,f,i)),re.push(Hz),re.push(Bz(c,fe,r))}re.push(Hz),re.push(zz(o,f,i))}var pe=r.havingBaseStyle(L.TEXT);return Pz(Y([`delimsizing`,`mult`],[rR({positionType:`bottom`,positionData:ne,children:re})],pe),L.TEXT,r,a)},Kz=80,qz=.08,Jz=function(e,t,n,r,i){return ZL([`hide-tail`],[new WI([new GI(e,CI(e,r,n))],{width:`400em`,height:R(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Yz=function(e,t){var n=t.havingBaseSizing(),r=aB(`\\surd`,e*n.sizeMultiplier,rB,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+Kz,e<1?i=1:e<1.4&&(i=.7),s=(1+a+qz)/i,c=(1+a)/i,o=Jz(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+Kz)*$z[r.size],c=($z[r.size]+a)/i,s=($z[r.size]+a+qz)/i,o=Jz(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+qz,c=e+a,l=Math.floor(1e3*e+a)+Kz,o=Jz(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=R(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Xz=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Zz=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),Qz=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),$z=[0,1.2,1.8,2.4,3],eB=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Xz.has(e)||Qz.has(e))return Rz(e,t,!1,n,r,i);if(Zz.has(e))return Gz(e,$z[t],!1,n,r,i);throw new I(`Illegal delimiter: '`+e+`'`)},tB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],nB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`stack`}],rB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],iB=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},aB=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);it)return a}return n[n.length-1]},oB=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Qz.has(e)?tB:Xz.has(e)?rB:nB,s=aB(e,t,o,r);return s.type===`small`?Iz(e,s.style,n,r,i,a):s.type===`large`?Rz(e,s.size,n,r,i,a):Gz(e,t,n,r,i,a)},sB=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return oB(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},cB={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},lB=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function uB(e){return`isMiddle`in e}function dB(e,t){var n=pz(e);if(n&&lB.has(n.text))return n;throw n?new I(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new I(`Invalid delimiter type '`+e.type+`'`,e)}X({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=dB(vR(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:cB[e.funcName].size,mclass:cB[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?Y([e.mclass]):eB(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(RR(e.delim,e.mode));var n=new Z(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=R($z[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function fB(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}X({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new I(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:dB(t[0],e).text,color:n}}}),X({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=dB(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Q(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{fB(e);for(var n=wR(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o{fB(e);var n=UR(e.body,t);if(e.left!==`.`){var r=new Z(`mo`,[RR(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Z(`mo`,[RR(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return zR(n)}}),X({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=dB(t[0],e);if(!e.parser.leftrightDepth)throw new I(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=kR(t,[]):(n=eB(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Z(`mo`,[e.delim===`\\vert`||e.delim===`|`?RR(`|`,`text`):RR(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),X({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Q(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=tR(AR(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=VF(e.body);if(r===`sout`)a=Y([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=MI({number:.6,unit:`pt`},t),l=MI({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=R(d/2+c);var f=Math.floor(1e3*d*i);a=ZL([`hide-tail`],[new WI([new GI(`phase`,xI(f))],{width:`400em`,height:R(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=R(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=oz(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=R(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=R(h),a.style.borderRightWidth=R(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=rR({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=rR({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?Y([`mord`,`cancel-lap`],[g],t):Y([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Z(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[GR(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+R(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),X({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Q(t[0],`color-token`).color,o=Q(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),X({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),X({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),X({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),X({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var pB={};function mB(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c{if(!e.parser.settings.displayMode)throw new I(`{`+e.envName+`} can be used only in display mode.`)},bB=new Set([`gather`,`gather*`]);function xB(e){if(!e.includes(`ed`))return!e.includes(`*`)}function SB(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new I(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new _B(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(vB(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var ee=e.fetch().text;if(ee===`&`){if(d&&m.length===d){if(l||s)throw new I(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(ee===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n0&&(ne+=g,xe))for(n=0;n=o)){var ye=void 0;(r>0||e.hskipBeforeAndAfter)&&(ye=pe?.pregap??d,ye!==0&&(oe=Y([`arraycolsep`],[]),oe.style.width=R(ye),ae.push(oe)));var be=[];for(n=0;n0){for(var De=QL(`katex-hline`,t,l),Oe=QL(`katex-hdashline`,t,l),ke=[{type:`elem`,elem:Ee,shift:0}];c.length>0;){var Ae=c.pop(),je=Ae.pos-re;Ae.isDashed?ke.push({type:`elem`,elem:Oe,shift:je}):ke.push({type:`elem`,elem:De,shift:je})}Ee=rR({positionType:`individualShift`,children:ke})}if(ce.length===0)return Y([`mord`],[Ee],t);var Me=Y([`katex-tag`],[rR({positionType:`individualShift`,children:ce})],t);return eR([Ee,Me])},TB={c:`center `,l:`left `,r:`right `},EB=function(e,t){for(var n=[],r=new Z(`mtd`,[],[`mtr-glue`]),i=new Z(`mtd`,[],[`mml-eqn-num`]),a=0;a0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=TB[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S0?`left `:``,d+=te[te.length-1].length>0?`right `:``;for(var ne=1;ne0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};mB({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(pz(t[0])?[t[0]]:Q(t[0],`ordgroup`).body).map(function(e){var t=fz(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new I(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return SB(e.parser,r,CB(e.envName))},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new I(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=SB(e.parser,r,CB(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=SB(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(pz(t[0])?[t[0]]:Q(t[0],`ordgroup`).body).map(function(e){var t=fz(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new I(`Unknown column alignment: `+t,e)});if(n.length>1)throw new I(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=SB(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new I(`{subarray} can contain only one column`);return i},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=SB(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},CB(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:DB,htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){bB.has(e.envName)&&yB(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:xB(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return SB(e.parser,t,`display`)},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:DB,htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){yB(e);var t={autoTag:xB(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return SB(e.parser,t,`display`)},htmlBuilder:wB,mathmlBuilder:EB}),mB({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return yB(e),Oz(e.parser)},htmlBuilder:wB,mathmlBuilder:EB}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),X({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new I(e.funcName+` valid only within array environment`)}});var OB=pB;X({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new I(`Invalid environment name`,i);var a=mz(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(OB,a))throw new I(`No such environment: `+a,i);var o=OB[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Q(n.parseFunction(),`environment`);if(p.name!==a)throw new I(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var kB=(e,t)=>{var n=e.font,r=t.withFont(n);return AR(e.body,r)},AB=(e,t)=>{var n=e.font,r=t.withFont(n);return GR(e.body,r)},jB={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};X({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=vR(t[0]),a=r in jB?jB[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:kB,mathmlBuilder:AB}),X({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:Sz(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:VF(r)}}}),X({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var MB=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=AR(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d){var n=new Z(`mfrac`,[GR(e.numer,t),GR(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=MI(e.barSize,t);n.setAttribute(`linethickness`,R(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Z(`mo`,[new PR(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Z(`mo`,[new PR(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return zR(i)}return n},PB=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;X({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),PB({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:MB,mathmlBuilder:NB}),X({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var FB=[`display`,`text`,`script`,`scriptscript`],IB=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};X({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=vR(t[0]),o=a.type===`atom`&&a.family===`open`?IB(a.text):null,s=vR(t[1]),c=s.type===`atom`&&s.family===`close`?IB(s.text):null,l=Q(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Q(p.body[0],`textord`);f=FB[Number(m.text)]}}else p=Q(p,`textord`),f=FB[Number(p.text)];return PB({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),X({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Q(t[0],`size`).value,token:r}}}),X({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=Q(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var LB=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?AR(e.sup,t.havingStyle(n.sup()),t):AR(e.sub,t.havingStyle(n.sub()),t),i=Q(e.base,`horizBrace`)):i=Q(e,`horizBrace`);var a=AR(i.base,t.havingBaseStyle(L.DISPLAY)),o=az(i,t),s=i.isOver?rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):rR({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=Y([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):rR({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return Y([`minner`,i.isOver?`mover`:`munder`],[s],t)};X({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:LB,mathmlBuilder:(e,t)=>{var n=nz(e.label);return new Z(e.isOver?`mover`:`munder`,[GR(e.base,t),n])}}),X({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=Q(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:yR(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=wR(e.body,t,!1);return $L(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=WR(e.body,t);return n instanceof Z||(n=new Z(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),X({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=Q(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a{var n=e.parser,r=e.funcName;e.token;var i=Q(t[0],`raw`).string,a=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d{var n=wR(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Y(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>WR(e.body,t)}),X({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:yR(t[0]),mathml:yR(t[1])}),htmlBuilder:(e,t)=>eR(wR(e.html,t,!1)),mathmlBuilder:(e,t)=>WR(e.mathml,t)});var RB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new I(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!jI(n))throw new I(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};X({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Q(n[0],`raw`).string.split(`,`),l=0;l{var n=MI(e.height,t),r=0;e.totalheight.number>0&&(r=MI(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=MI(e.width,t));var a={height:R(n+r)};i>0&&(a.width=R(i)),r>0&&(a.verticalAlign=R(-r));var o=new VI(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Z(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=MI(e.height,t),i=0;if(e.totalheight.number>0&&(i=MI(e.totalheight,t)-r,n.setAttribute(`valign`,R(-i))),n.setAttribute(`height`,R(r+i)),e.width.number>0){var a=MI(e.width,t);n.setAttribute(`width`,R(a))}return n.setAttribute(`src`,e.src),n}}),X({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=Q(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return iR(e.dimension,t)},mathmlBuilder(e,t){return new FR(MI(e.dimension,t))}}),X({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=Y([],[AR(e.body,t)]),n=Y([`katex-inner`],[n],t)):n=Y([`katex-inner`],[AR(e.body,t)]);var r=Y([`katex-fix`],[]),i=Y([e.alignment],[n,r],t),a=Y([`katex-strut`]);return a.style.height=R(i.height+i.depth),i.depth&&(a.style.verticalAlign=R(-i.depth)),i.children.unshift(a),i=Y([`katex-thinbox`],[i],t),Y([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Z(`mpadded`,[GR(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),X({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),X({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new I(`Mismatched `+e.funcName)}});var zB=(e,t)=>{switch(t.style.size){case L.DISPLAY.size:return e.display;case L.TEXT.size:return e.text;case L.SCRIPT.size:return e.script;case L.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};X({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:yR(t[0]),text:yR(t[1]),script:yR(t[2]),scriptscript:yR(t[3])}),htmlBuilder:(e,t)=>eR(wR(zB(e,t),t,!1)),mathmlBuilder:(e,t)=>WR(zB(e,t),t)});var BB=(e,t,n,r,i,a,o)=>{e=Y([],[e]);var s=n&&VF(n),c,l;if(t){var u=AR(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=AR(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=rR({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=rR({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=rR({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=Y([`mspace`],[],r);m.style.marginRight=R(a),p.unshift(m)}return Y([`mop`,`op-limits`],p,r)},VB=new Set([`\\smallint`]),HB=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Q(e.base,`op`),i=!0):a=Q(e,`op`);var o=t.style,s=!1;o.size===L.DISPLAY.size&&a.symbol&&!VB.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=WL(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=cR(d+`Size`+(s?`2`:`1`),t);c=rR({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=wR(a.body,t,!0);p.length===1&&p[0]instanceof UI?(c=p[0],c.classes[0]=`mop`):c=Y([`mop`],p,t)}else{for(var m=[],h=1;h{var n;if(e.symbol)n=new Z(`mo`,[RR(e.name,e.mode)]),VB.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Z(`mo`,UR(e.body,t));else{n=new Z(`mi`,[new PR(e.name.slice(1))]);var r=new Z(`mo`,[RR(`⁡`,`text`)]);n=e.parentIsSupSub?new Z(`mrow`,[n,r]):NR([n,r])}return n},WB={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};X({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=WB[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:HB,mathmlBuilder:UB}),X({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:yR(r)}}});var GB={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};X({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),X({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),X({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=GB[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var KB=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Q(e.base,`operatorname`),i=!0):a=Q(e,`operatorname`);var o;if(a.body.length>0){for(var s=wR(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:yR(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:KB,mathmlBuilder:(e,t)=>{for(var n=UR(e.body,t.withFont(`mathrm`)),r=!0,i=0;ie.toText()).join(``))]);var s=new Z(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Z(`mo`,[RR(`⁡`,`text`)]);return e.parentIsSupSub?new Z(`mrow`,[s,c]):NR([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),_R({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?eR(wR(e.body,t,!1)):Y([`mord`],wR(e.body,t,!0),t)},mathmlBuilder(e,t){return WR(e.body,t,!0)}}),X({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=AR(e.body,t.havingCrampedStyle()),r=QL(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return Y([`mord`,`katex-overline`],[rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Z(`mo`,[new PR(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Z(`mover`,[GR(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),X({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:yR(r)}},htmlBuilder:(e,t)=>eR(wR(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Z(`mphantom`,UR(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),X({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>Y([`mord`,`rlap`],[Y([`katex-inner`],[AR(e.body,t.withPhantom())]),Y([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Z(`mpadded`,[new Z(`mphantom`,UR(yR(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),X({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=Q(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=AR(e.body,t);return rR({positionType:`shift`,positionData:-MI(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Z(`mpadded`,[GR(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var qB=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});X({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:qB,htmlBuilder(e,t){return Y([`mord`,`reflectbox`],[AR(e.body,t)],t)},mathmlBuilder(e,t){return GR(e.body,t)}}),X({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:qB}),X({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),X({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=Q(t[0],`size`),o=Q(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Q(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Y([`mord`,`katex-rule`],[],t),r=MI(e.width,t),i=MI(e.height,t),a=e.shift?MI(e.shift,t):0;return n.style.borderRightWidth=R(r),n.style.borderTopWidth=R(i),n.style.bottom=R(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=MI(e.width,t),r=MI(e.height,t),i=e.shift?MI(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Z(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,R(n)),o.setAttribute(`height`,R(r));var s=new Z(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,R(i)):(s.setAttribute(`height`,R(i)),s.setAttribute(`depth`,R(-i))),s.setAttribute(`voffset`,R(i)),s}});function JB(e,t,n){for(var r=wR(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:YB.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return JB(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Z(`mstyle`,UR(e.body,n));return r.setAttribute(`mathsize`,R(n.sizeMultiplier)),r}}),X({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&Q(n[0],`ordgroup`);if(o)for(var s,c=0;c{var n=Y([],[AR(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Y([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r{var n=new Z(`mpadded`,[GR(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),X({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=AR(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=tR(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=R(l);var f=rR({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(L.SCRIPTSCRIPT),m=AR(e.index,p,t);return Y([`mord`,`sqrt`],[Y([`katex-root`],[rR({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return Y([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Z(`mroot`,[GR(n,t),GR(r,t)]):new Z(`msqrt`,[GR(n,t)])}});var XB={display:L.DISPLAY,text:L.TEXT,script:L.SCRIPT,scriptscript:L.SCRIPTSCRIPT};function ZB(e){return e in XB}X({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!ZB(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=XB[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),JB(e.body,r,t)},mathmlBuilder(e,t){var n=XB[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Z(`mstyle`,UR(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var QB=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===L.DISPLAY.size||n.alwaysHandleSupSub)?HB:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===L.DISPLAY.size||n.limits)?KB:null:n.type===`accent`?VF(n.base)?gz:null:n.type===`horizBrace`&&!e.sub===n.isOver?LB:null:null};_R({type:`supsub`,htmlBuilder(e,t){var n=QB(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=AR(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&VF(r);if(i){var p=t.havingStyle(t.style.sup());s=AR(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=AR(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===L.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=R(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof UI||y)&&(v=R(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)0&&(u+=S,d-=S)}b=rR({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=rR({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=rR({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return Y([OR(o,`right`)||`mord`],[o,Y([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[GR(e.base,t)];e.sub&&a.push(GR(e.sub,t)),e.sup&&a.push(GR(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===L.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===L.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===L.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===L.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===L.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===L.DISPLAY)?`munder`:`msub`}return new Z(o,a)}}),_R({type:`atom`,htmlBuilder(e,t){return GL(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Z(`mo`,[RR(e.text,e.mode)]);if(e.family===`bin`){var r=VR(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var $B={mi:`italic`,mn:`normal`,mtext:`normal`};_R({type:`mathord`,htmlBuilder(e,t){return qL(e,t)},mathmlBuilder(e,t){var n=new Z(`mi`,[RR(e.text,e.mode,t)]),r=VR(e,t)||`italic`;return r!==$B[n.type]&&n.setAttribute(`mathvariant`,r),n}}),_R({type:`textord`,htmlBuilder(e,t){return qL(e,t)},mathmlBuilder(e,t){var n=RR(e.text,e.mode,t),r=VR(e,t)||`normal`,i=e.mode===`text`?new Z(`mtext`,[n]):/[0-9]/.test(e.text)?new Z(`mn`,[n]):e.text===`\\prime`?new Z(`mo`,[n]):new Z(`mi`,[n]);return r!==$B[i.type]&&i.setAttribute(`mathvariant`,r),i}});var eV=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),tV=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);_R({type:`spacing`,htmlBuilder(e,t){var n=tV.get(e.text),r=eV.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=qL(e,t);return a.classes.push(i),a}return Y([`mspace`,i],[GL(e.text,e.mode,t)],t)}if(r)return Y([`mspace`,r],[],t);throw new I(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(tV.has(e.text))n=new Z(`mtext`,[new PR(`\xA0`)]);else if(eV.has(e.text))return new Z(`mspace`);else throw new I(`Unknown type of space "`+e.text+`"`);return n}});var nV=()=>{var e=new Z(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};_R({type:`tag`,mathmlBuilder(e,t){var n=new Z(`mtable`,[new Z(`mtr`,[nV(),new Z(`mtd`,[WR(e.body,t)]),nV(),new Z(`mtd`,[WR(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var rV={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},iV={"\\textbf":`textbf`,"\\textmd":`textmd`},aV={"\\textit":`textit`,"\\textup":`textup`},oV=(e,t)=>{var n=e.font;return n?rV[n]?t.withTextFontFamily(rV[n]):iV[n]?t.withTextFontWeight(iV[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(aV[n]):t};X({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:yR(i),font:r}},htmlBuilder(e,t){var n=oV(e,t);return Y([`mord`,`text`],wR(e.body,n,!0),n)},mathmlBuilder(e,t){var n=oV(e,t);return WR(e.body,n)}}),X({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=AR(e.body,t),r=QL(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return Y([`mord`,`katex-underline`],[rR({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Z(`mo`,[new PR(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Z(`munder`,[GR(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),X({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=AR(e.body,t),r=t.fontMetrics().axisHeight;return rR({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Z(`mrow`,[new Z(`mpadded`,[GR(e.body,t)],[`vcenter`])])}}),X({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new I(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=sV(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?`␣`:`\xA0`),cV=mR,lV=`[ \r - ]`,uV=`\\\\[a-zA-Z@]+`,dV=`\\\\[^\ud800-\udfff]`,fV=`(`+uV+`)`+lV+`*`,pV=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function OI(e){return`toText`in e}var kI=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t{if(OI(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},AI={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},jI={ex:!0,em:!0,mu:!0},MI=function(e){return typeof e!=`string`&&(e=e.unit),e in AI||e in jI||e===`ex`},NI=function(e,t){var n;if(e.unit in AI)n=AI[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new I(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},R=function(e){return+e.toFixed(4)+`em`},PI=function(e){return e.filter(e=>e).join(` `)},FI=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=IF(n)+`:`+r+`;`)}return t},II=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},LI=function(e){var t=document.createElement(e);t.className=PI(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r/=\x00-\x1f]/,zI=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+zF(PI(this.classes))+`"`);var n=FI(this.style);n&&(t+=` style="`+zF(n)+`"`);for(var r of Object.keys(this.attributes)){if(RI.test(r))throw new I(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+zF(this.attributes[r])+`"`}t+=`>`;for(var i=0;i`,t},BI=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,II.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return LI.call(this,`span`)}toMarkup(){return zI.call(this,`span`)}},VI=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,II.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return LI.call(this,`a`)}toMarkup(){return zI.call(this,`a`)}},HI=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=``+zF(this.alt)+``,e}},UI={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},WI=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=fI(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=UI[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=R(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=PI(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`0&&(n+=`margin-right:`+R(this.italic)+`;`),n+=FI(this.style),n&&(e=!0,t+=` style="`+zF(n)+`"`);var r=zF(this.text);return e?(t+=`>`,t+=r,t+=``,t):r}},GI=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n`;for(var n=0;n`,e}},KI=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,EI[this.pathName]),e}toMarkup(){return this.alternate?``:``}},qI=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=``,e}};function JI(e){if(e instanceof WI)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function YI(e){if(e instanceof BI)return e;throw Error(`Expected span but got `+String(e)+`.`)}var XI=e=>e instanceof BI||e instanceof VI||e instanceof kI,ZI={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},QI={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},$I={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function eL(e,t){ZI[e]=t}function tL(e,t,n){if(!ZI[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=ZI[t][r];if(!i&&e[0]in $I&&(r=$I[e[0]].charCodeAt(0),i=ZI[t][r]),!i&&n===`text`&&mI(r)&&(i=ZI[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nL={};function rL(e){var t=e>=5?0:e>=3?1:2;if(!nL[t]){var n=nL[t]={cssEmPerMu:QI.quad[t]/18};for(var r of Object.keys(QI))n[r]=QI[r][t]}return nL[t]}var iL={math:{},text:{}};function z(e,t,n,r,i,a){iL[e][i]={font:t,group:n,replace:r},a&&r&&(iL[e][r]=iL[e][i])}var B=`math`,V=`text`,H=`main`,U=`ams`,aL=`accent-token`,W=`bin`,oL=`close`,sL=`inner`,G=`mathord`,cL=`op-token`,lL=`open`,uL=`punct`,K=`rel`,dL=`spacing`,q=`textord`;z(B,H,K,`≡`,`\\equiv`,!0),z(B,H,K,`≺`,`\\prec`,!0),z(B,H,K,`≻`,`\\succ`,!0),z(B,H,K,`∼`,`\\sim`,!0),z(B,H,K,`⊥`,`\\perp`),z(B,H,K,`⪯`,`\\preceq`,!0),z(B,H,K,`⪰`,`\\succeq`,!0),z(B,H,K,`≃`,`\\simeq`,!0),z(B,H,K,`∣`,`\\mid`,!0),z(B,H,K,`≪`,`\\ll`,!0),z(B,H,K,`≫`,`\\gg`,!0),z(B,H,K,`≍`,`\\asymp`,!0),z(B,H,K,`∥`,`\\parallel`),z(B,H,K,`⋈`,`\\bowtie`,!0),z(B,H,K,`⌣`,`\\smile`,!0),z(B,H,K,`⊑`,`\\sqsubseteq`,!0),z(B,H,K,`⊒`,`\\sqsupseteq`,!0),z(B,H,K,`≐`,`\\doteq`,!0),z(B,H,K,`⌢`,`\\frown`,!0),z(B,H,K,`∋`,`\\ni`,!0),z(B,H,K,`∝`,`\\propto`,!0),z(B,H,K,`⊢`,`\\vdash`,!0),z(B,H,K,`⊣`,`\\dashv`,!0),z(B,H,K,`∋`,`\\owns`),z(B,H,uL,`.`,`\\ldotp`),z(B,H,uL,`⋅`,`\\cdotp`),z(B,H,uL,`⋅`,`·`),z(V,H,q,`⋅`,`·`),z(B,H,q,`#`,`\\#`),z(V,H,q,`#`,`\\#`),z(B,H,q,`&`,`\\&`),z(V,H,q,`&`,`\\&`),z(B,H,q,`ℵ`,`\\aleph`,!0),z(B,H,q,`∀`,`\\forall`,!0),z(B,H,q,`ℏ`,`\\hbar`,!0),z(B,H,q,`∃`,`\\exists`,!0),z(B,H,q,`∇`,`\\nabla`,!0),z(B,H,q,`♭`,`\\flat`,!0),z(B,H,q,`ℓ`,`\\ell`,!0),z(B,H,q,`♮`,`\\natural`,!0),z(B,H,q,`♣`,`\\clubsuit`,!0),z(B,H,q,`℘`,`\\wp`,!0),z(B,H,q,`♯`,`\\sharp`,!0),z(B,H,q,`♢`,`\\diamondsuit`,!0),z(B,H,q,`ℜ`,`\\Re`,!0),z(B,H,q,`♡`,`\\heartsuit`,!0),z(B,H,q,`ℑ`,`\\Im`,!0),z(B,H,q,`♠`,`\\spadesuit`,!0),z(B,H,q,`§`,`\\S`,!0),z(V,H,q,`§`,`\\S`),z(B,H,q,`¶`,`\\P`,!0),z(V,H,q,`¶`,`\\P`),z(B,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\textdagger`),z(B,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\textdaggerdbl`),z(B,H,oL,`⎱`,`\\rmoustache`,!0),z(B,H,lL,`⎰`,`\\lmoustache`,!0),z(B,H,oL,`⟯`,`\\rgroup`,!0),z(B,H,lL,`⟮`,`\\lgroup`,!0),z(B,H,W,`∓`,`\\mp`,!0),z(B,H,W,`⊖`,`\\ominus`,!0),z(B,H,W,`⊎`,`\\uplus`,!0),z(B,H,W,`⊓`,`\\sqcap`,!0),z(B,H,W,`∗`,`\\ast`),z(B,H,W,`⊔`,`\\sqcup`,!0),z(B,H,W,`◯`,`\\bigcirc`,!0),z(B,H,W,`∙`,`\\bullet`,!0),z(B,H,W,`‡`,`\\ddagger`),z(B,H,W,`≀`,`\\wr`,!0),z(B,H,W,`⨿`,`\\amalg`),z(B,H,W,`&`,`\\And`),z(B,H,K,`⟵`,`\\longleftarrow`,!0),z(B,H,K,`⇐`,`\\Leftarrow`,!0),z(B,H,K,`⟸`,`\\Longleftarrow`,!0),z(B,H,K,`⟶`,`\\longrightarrow`,!0),z(B,H,K,`⇒`,`\\Rightarrow`,!0),z(B,H,K,`⟹`,`\\Longrightarrow`,!0),z(B,H,K,`↔`,`\\leftrightarrow`,!0),z(B,H,K,`⟷`,`\\longleftrightarrow`,!0),z(B,H,K,`⇔`,`\\Leftrightarrow`,!0),z(B,H,K,`⟺`,`\\Longleftrightarrow`,!0),z(B,H,K,`↦`,`\\mapsto`,!0),z(B,H,K,`⟼`,`\\longmapsto`,!0),z(B,H,K,`↗`,`\\nearrow`,!0),z(B,H,K,`↩`,`\\hookleftarrow`,!0),z(B,H,K,`↪`,`\\hookrightarrow`,!0),z(B,H,K,`↘`,`\\searrow`,!0),z(B,H,K,`↼`,`\\leftharpoonup`,!0),z(B,H,K,`⇀`,`\\rightharpoonup`,!0),z(B,H,K,`↙`,`\\swarrow`,!0),z(B,H,K,`↽`,`\\leftharpoondown`,!0),z(B,H,K,`⇁`,`\\rightharpoondown`,!0),z(B,H,K,`↖`,`\\nwarrow`,!0),z(B,H,K,`⇌`,`\\rightleftharpoons`,!0),z(B,U,K,`≮`,`\\nless`,!0),z(B,U,K,``,`\\@nleqslant`),z(B,U,K,``,`\\@nleqq`),z(B,U,K,`⪇`,`\\lneq`,!0),z(B,U,K,`≨`,`\\lneqq`,!0),z(B,U,K,``,`\\@lvertneqq`),z(B,U,K,`⋦`,`\\lnsim`,!0),z(B,U,K,`⪉`,`\\lnapprox`,!0),z(B,U,K,`⊀`,`\\nprec`,!0),z(B,U,K,`⋠`,`\\npreceq`,!0),z(B,U,K,`⋨`,`\\precnsim`,!0),z(B,U,K,`⪹`,`\\precnapprox`,!0),z(B,U,K,`≁`,`\\nsim`,!0),z(B,U,K,``,`\\@nshortmid`),z(B,U,K,`∤`,`\\nmid`,!0),z(B,U,K,`⊬`,`\\nvdash`,!0),z(B,U,K,`⊭`,`\\nvDash`,!0),z(B,U,K,`⋪`,`\\ntriangleleft`),z(B,U,K,`⋬`,`\\ntrianglelefteq`,!0),z(B,U,K,`⊊`,`\\subsetneq`,!0),z(B,U,K,``,`\\@varsubsetneq`),z(B,U,K,`⫋`,`\\subsetneqq`,!0),z(B,U,K,``,`\\@varsubsetneqq`),z(B,U,K,`≯`,`\\ngtr`,!0),z(B,U,K,``,`\\@ngeqslant`),z(B,U,K,``,`\\@ngeqq`),z(B,U,K,`⪈`,`\\gneq`,!0),z(B,U,K,`≩`,`\\gneqq`,!0),z(B,U,K,``,`\\@gvertneqq`),z(B,U,K,`⋧`,`\\gnsim`,!0),z(B,U,K,`⪊`,`\\gnapprox`,!0),z(B,U,K,`⊁`,`\\nsucc`,!0),z(B,U,K,`⋡`,`\\nsucceq`,!0),z(B,U,K,`⋩`,`\\succnsim`,!0),z(B,U,K,`⪺`,`\\succnapprox`,!0),z(B,U,K,`≆`,`\\ncong`,!0),z(B,U,K,``,`\\@nshortparallel`),z(B,U,K,`∦`,`\\nparallel`,!0),z(B,U,K,`⊯`,`\\nVDash`,!0),z(B,U,K,`⋫`,`\\ntriangleright`),z(B,U,K,`⋭`,`\\ntrianglerighteq`,!0),z(B,U,K,``,`\\@nsupseteqq`),z(B,U,K,`⊋`,`\\supsetneq`,!0),z(B,U,K,``,`\\@varsupsetneq`),z(B,U,K,`⫌`,`\\supsetneqq`,!0),z(B,U,K,``,`\\@varsupsetneqq`),z(B,U,K,`⊮`,`\\nVdash`,!0),z(B,U,K,`⪵`,`\\precneqq`,!0),z(B,U,K,`⪶`,`\\succneqq`,!0),z(B,U,K,``,`\\@nsubseteqq`),z(B,U,W,`⊴`,`\\unlhd`),z(B,U,W,`⊵`,`\\unrhd`),z(B,U,K,`↚`,`\\nleftarrow`,!0),z(B,U,K,`↛`,`\\nrightarrow`,!0),z(B,U,K,`⇍`,`\\nLeftarrow`,!0),z(B,U,K,`⇏`,`\\nRightarrow`,!0),z(B,U,K,`↮`,`\\nleftrightarrow`,!0),z(B,U,K,`⇎`,`\\nLeftrightarrow`,!0),z(B,U,K,`△`,`\\vartriangle`),z(B,U,q,`ℏ`,`\\hslash`),z(B,U,q,`▽`,`\\triangledown`),z(B,U,q,`◊`,`\\lozenge`),z(B,U,q,`Ⓢ`,`\\circledS`),z(B,U,q,`®`,`\\circledR`),z(V,U,q,`®`,`\\circledR`),z(B,U,q,`∡`,`\\measuredangle`,!0),z(B,U,q,`∄`,`\\nexists`),z(B,U,q,`℧`,`\\mho`),z(B,U,q,`Ⅎ`,`\\Finv`,!0),z(B,U,q,`⅁`,`\\Game`,!0),z(B,U,q,`‵`,`\\backprime`),z(B,U,q,`▲`,`\\blacktriangle`),z(B,U,q,`▼`,`\\blacktriangledown`),z(B,U,q,`■`,`\\blacksquare`),z(B,U,q,`⧫`,`\\blacklozenge`),z(B,U,q,`★`,`\\bigstar`),z(B,U,q,`∢`,`\\sphericalangle`,!0),z(B,U,q,`∁`,`\\complement`,!0),z(B,U,q,`ð`,`\\eth`,!0),z(V,H,q,`ð`,`ð`),z(B,U,q,`╱`,`\\diagup`),z(B,U,q,`╲`,`\\diagdown`),z(B,U,q,`□`,`\\square`),z(B,U,q,`□`,`\\Box`),z(B,U,q,`◊`,`\\Diamond`),z(B,U,q,`¥`,`\\yen`,!0),z(V,U,q,`¥`,`\\yen`,!0),z(B,U,q,`✓`,`\\checkmark`,!0),z(V,U,q,`✓`,`\\checkmark`),z(B,U,q,`ℶ`,`\\beth`,!0),z(B,U,q,`ℸ`,`\\daleth`,!0),z(B,U,q,`ℷ`,`\\gimel`,!0),z(B,U,q,`ϝ`,`\\digamma`,!0),z(B,U,q,`ϰ`,`\\varkappa`),z(B,U,lL,`┌`,`\\@ulcorner`,!0),z(B,U,oL,`┐`,`\\@urcorner`,!0),z(B,U,lL,`└`,`\\@llcorner`,!0),z(B,U,oL,`┘`,`\\@lrcorner`,!0),z(B,U,K,`≦`,`\\leqq`,!0),z(B,U,K,`⩽`,`\\leqslant`,!0),z(B,U,K,`⪕`,`\\eqslantless`,!0),z(B,U,K,`≲`,`\\lesssim`,!0),z(B,U,K,`⪅`,`\\lessapprox`,!0),z(B,U,K,`≊`,`\\approxeq`,!0),z(B,U,W,`⋖`,`\\lessdot`),z(B,U,K,`⋘`,`\\lll`,!0),z(B,U,K,`≶`,`\\lessgtr`,!0),z(B,U,K,`⋚`,`\\lesseqgtr`,!0),z(B,U,K,`⪋`,`\\lesseqqgtr`,!0),z(B,U,K,`≑`,`\\doteqdot`),z(B,U,K,`≓`,`\\risingdotseq`,!0),z(B,U,K,`≒`,`\\fallingdotseq`,!0),z(B,U,K,`∽`,`\\backsim`,!0),z(B,U,K,`⋍`,`\\backsimeq`,!0),z(B,U,K,`⫅`,`\\subseteqq`,!0),z(B,U,K,`⋐`,`\\Subset`,!0),z(B,U,K,`⊏`,`\\sqsubset`,!0),z(B,U,K,`≼`,`\\preccurlyeq`,!0),z(B,U,K,`⋞`,`\\curlyeqprec`,!0),z(B,U,K,`≾`,`\\precsim`,!0),z(B,U,K,`⪷`,`\\precapprox`,!0),z(B,U,K,`⊲`,`\\vartriangleleft`),z(B,U,K,`⊴`,`\\trianglelefteq`),z(B,U,K,`⊨`,`\\vDash`,!0),z(B,U,K,`⊪`,`\\Vvdash`,!0),z(B,U,K,`⌣`,`\\smallsmile`),z(B,U,K,`⌢`,`\\smallfrown`),z(B,U,K,`≏`,`\\bumpeq`,!0),z(B,U,K,`≎`,`\\Bumpeq`,!0),z(B,U,K,`≧`,`\\geqq`,!0),z(B,U,K,`⩾`,`\\geqslant`,!0),z(B,U,K,`⪖`,`\\eqslantgtr`,!0),z(B,U,K,`≳`,`\\gtrsim`,!0),z(B,U,K,`⪆`,`\\gtrapprox`,!0),z(B,U,W,`⋗`,`\\gtrdot`),z(B,U,K,`⋙`,`\\ggg`,!0),z(B,U,K,`≷`,`\\gtrless`,!0),z(B,U,K,`⋛`,`\\gtreqless`,!0),z(B,U,K,`⪌`,`\\gtreqqless`,!0),z(B,U,K,`≖`,`\\eqcirc`,!0),z(B,U,K,`≗`,`\\circeq`,!0),z(B,U,K,`≜`,`\\triangleq`,!0),z(B,U,K,`∼`,`\\thicksim`),z(B,U,K,`≈`,`\\thickapprox`),z(B,U,K,`⫆`,`\\supseteqq`,!0),z(B,U,K,`⋑`,`\\Supset`,!0),z(B,U,K,`⊐`,`\\sqsupset`,!0),z(B,U,K,`≽`,`\\succcurlyeq`,!0),z(B,U,K,`⋟`,`\\curlyeqsucc`,!0),z(B,U,K,`≿`,`\\succsim`,!0),z(B,U,K,`⪸`,`\\succapprox`,!0),z(B,U,K,`⊳`,`\\vartriangleright`),z(B,U,K,`⊵`,`\\trianglerighteq`),z(B,U,K,`⊩`,`\\Vdash`,!0),z(B,U,K,`∣`,`\\shortmid`),z(B,U,K,`∥`,`\\shortparallel`),z(B,U,K,`≬`,`\\between`,!0),z(B,U,K,`⋔`,`\\pitchfork`,!0),z(B,U,K,`∝`,`\\varpropto`),z(B,U,K,`◀`,`\\blacktriangleleft`),z(B,U,K,`∴`,`\\therefore`,!0),z(B,U,K,`∍`,`\\backepsilon`),z(B,U,K,`▶`,`\\blacktriangleright`),z(B,U,K,`∵`,`\\because`,!0),z(B,U,K,`⋘`,`\\llless`),z(B,U,K,`⋙`,`\\gggtr`),z(B,U,W,`⊲`,`\\lhd`),z(B,U,W,`⊳`,`\\rhd`),z(B,U,K,`≂`,`\\eqsim`,!0),z(B,H,K,`⋈`,`\\Join`),z(B,U,K,`≑`,`\\Doteq`,!0),z(B,U,W,`∔`,`\\dotplus`,!0),z(B,U,W,`∖`,`\\smallsetminus`),z(B,U,W,`⋒`,`\\Cap`,!0),z(B,U,W,`⋓`,`\\Cup`,!0),z(B,U,W,`⩞`,`\\doublebarwedge`,!0),z(B,U,W,`⊟`,`\\boxminus`,!0),z(B,U,W,`⊞`,`\\boxplus`,!0),z(B,U,W,`⋇`,`\\divideontimes`,!0),z(B,U,W,`⋉`,`\\ltimes`,!0),z(B,U,W,`⋊`,`\\rtimes`,!0),z(B,U,W,`⋋`,`\\leftthreetimes`,!0),z(B,U,W,`⋌`,`\\rightthreetimes`,!0),z(B,U,W,`⋏`,`\\curlywedge`,!0),z(B,U,W,`⋎`,`\\curlyvee`,!0),z(B,U,W,`⊝`,`\\circleddash`,!0),z(B,U,W,`⊛`,`\\circledast`,!0),z(B,U,W,`⋅`,`\\centerdot`),z(B,U,W,`⊺`,`\\intercal`,!0),z(B,U,W,`⋒`,`\\doublecap`),z(B,U,W,`⋓`,`\\doublecup`),z(B,U,W,`⊠`,`\\boxtimes`,!0),z(B,U,K,`⇢`,`\\dashrightarrow`,!0),z(B,U,K,`⇠`,`\\dashleftarrow`,!0),z(B,U,K,`⇇`,`\\leftleftarrows`,!0),z(B,U,K,`⇆`,`\\leftrightarrows`,!0),z(B,U,K,`⇚`,`\\Lleftarrow`,!0),z(B,U,K,`↞`,`\\twoheadleftarrow`,!0),z(B,U,K,`↢`,`\\leftarrowtail`,!0),z(B,U,K,`↫`,`\\looparrowleft`,!0),z(B,U,K,`⇋`,`\\leftrightharpoons`,!0),z(B,U,K,`↶`,`\\curvearrowleft`,!0),z(B,U,K,`↺`,`\\circlearrowleft`,!0),z(B,U,K,`↰`,`\\Lsh`,!0),z(B,U,K,`⇈`,`\\upuparrows`,!0),z(B,U,K,`↿`,`\\upharpoonleft`,!0),z(B,U,K,`⇃`,`\\downharpoonleft`,!0),z(B,H,K,`⊶`,`\\origof`,!0),z(B,H,K,`⊷`,`\\imageof`,!0),z(B,U,K,`⊸`,`\\multimap`,!0),z(B,U,K,`↭`,`\\leftrightsquigarrow`,!0),z(B,U,K,`⇉`,`\\rightrightarrows`,!0),z(B,U,K,`⇄`,`\\rightleftarrows`,!0),z(B,U,K,`↠`,`\\twoheadrightarrow`,!0),z(B,U,K,`↣`,`\\rightarrowtail`,!0),z(B,U,K,`↬`,`\\looparrowright`,!0),z(B,U,K,`↷`,`\\curvearrowright`,!0),z(B,U,K,`↻`,`\\circlearrowright`,!0),z(B,U,K,`↱`,`\\Rsh`,!0),z(B,U,K,`⇊`,`\\downdownarrows`,!0),z(B,U,K,`↾`,`\\upharpoonright`,!0),z(B,U,K,`⇂`,`\\downharpoonright`,!0),z(B,U,K,`⇝`,`\\rightsquigarrow`,!0),z(B,U,K,`⇝`,`\\leadsto`),z(B,U,K,`⇛`,`\\Rrightarrow`,!0),z(B,U,K,`↾`,`\\restriction`),z(B,H,q,`‘`,"`"),z(B,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\textdollar`),z(B,H,q,`%`,`\\%`),z(V,H,q,`%`,`\\%`),z(B,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\textunderscore`),z(B,H,q,`∠`,`\\angle`,!0),z(B,H,q,`∞`,`\\infty`,!0),z(B,H,q,`′`,`\\prime`),z(B,H,q,`△`,`\\triangle`),z(B,H,q,`Γ`,`\\Gamma`,!0),z(B,H,q,`Δ`,`\\Delta`,!0),z(B,H,q,`Θ`,`\\Theta`,!0),z(B,H,q,`Λ`,`\\Lambda`,!0),z(B,H,q,`Ξ`,`\\Xi`,!0),z(B,H,q,`Π`,`\\Pi`,!0),z(B,H,q,`Σ`,`\\Sigma`,!0),z(B,H,q,`Υ`,`\\Upsilon`,!0),z(B,H,q,`Φ`,`\\Phi`,!0),z(B,H,q,`Ψ`,`\\Psi`,!0),z(B,H,q,`Ω`,`\\Omega`,!0),z(B,H,q,`A`,`Α`),z(B,H,q,`B`,`Β`),z(B,H,q,`E`,`Ε`),z(B,H,q,`Z`,`Ζ`),z(B,H,q,`H`,`Η`),z(B,H,q,`I`,`Ι`),z(B,H,q,`K`,`Κ`),z(B,H,q,`M`,`Μ`),z(B,H,q,`N`,`Ν`),z(B,H,q,`O`,`Ο`),z(B,H,q,`P`,`Ρ`),z(B,H,q,`T`,`Τ`),z(B,H,q,`X`,`Χ`),z(B,H,q,`¬`,`\\neg`,!0),z(B,H,q,`¬`,`\\lnot`),z(B,H,q,`⊤`,`\\top`),z(B,H,q,`⊥`,`\\bot`),z(B,H,q,`∅`,`\\emptyset`),z(B,U,q,`∅`,`\\varnothing`),z(B,H,G,`α`,`\\alpha`,!0),z(B,H,G,`β`,`\\beta`,!0),z(B,H,G,`γ`,`\\gamma`,!0),z(B,H,G,`δ`,`\\delta`,!0),z(B,H,G,`ϵ`,`\\epsilon`,!0),z(B,H,G,`ζ`,`\\zeta`,!0),z(B,H,G,`η`,`\\eta`,!0),z(B,H,G,`θ`,`\\theta`,!0),z(B,H,G,`ι`,`\\iota`,!0),z(B,H,G,`κ`,`\\kappa`,!0),z(B,H,G,`λ`,`\\lambda`,!0),z(B,H,G,`μ`,`\\mu`,!0),z(B,H,G,`ν`,`\\nu`,!0),z(B,H,G,`ξ`,`\\xi`,!0),z(B,H,G,`ο`,`\\omicron`,!0),z(B,H,G,`π`,`\\pi`,!0),z(B,H,G,`ρ`,`\\rho`,!0),z(B,H,G,`σ`,`\\sigma`,!0),z(B,H,G,`τ`,`\\tau`,!0),z(B,H,G,`υ`,`\\upsilon`,!0),z(B,H,G,`ϕ`,`\\phi`,!0),z(B,H,G,`χ`,`\\chi`,!0),z(B,H,G,`ψ`,`\\psi`,!0),z(B,H,G,`ω`,`\\omega`,!0),z(B,H,G,`ε`,`\\varepsilon`,!0),z(B,H,G,`ϑ`,`\\vartheta`,!0),z(B,H,G,`ϖ`,`\\varpi`,!0),z(B,H,G,`ϱ`,`\\varrho`,!0),z(B,H,G,`ς`,`\\varsigma`,!0),z(B,H,G,`φ`,`\\varphi`,!0),z(B,H,W,`∗`,`*`,!0),z(B,H,W,`+`,`+`),z(B,H,W,`−`,`-`,!0),z(B,H,W,`⋅`,`\\cdot`,!0),z(B,H,W,`∘`,`\\circ`,!0),z(B,H,W,`÷`,`\\div`,!0),z(B,H,W,`±`,`\\pm`,!0),z(B,H,W,`×`,`\\times`,!0),z(B,H,W,`∩`,`\\cap`,!0),z(B,H,W,`∪`,`\\cup`,!0),z(B,H,W,`∖`,`\\setminus`,!0),z(B,H,W,`∧`,`\\land`),z(B,H,W,`∨`,`\\lor`),z(B,H,W,`∧`,`\\wedge`,!0),z(B,H,W,`∨`,`\\vee`,!0),z(B,H,q,`√`,`\\surd`),z(B,H,lL,`⟨`,`\\langle`,!0),z(B,H,lL,`∣`,`\\lvert`),z(B,H,lL,`∥`,`\\lVert`),z(B,H,oL,`?`,`?`),z(B,H,oL,`!`,`!`),z(B,H,oL,`⟩`,`\\rangle`,!0),z(B,H,oL,`∣`,`\\rvert`),z(B,H,oL,`∥`,`\\rVert`),z(B,H,K,`=`,`=`),z(B,H,K,`:`,`:`),z(B,H,K,`≈`,`\\approx`,!0),z(B,H,K,`≅`,`\\cong`,!0),z(B,H,K,`≥`,`\\ge`),z(B,H,K,`≥`,`\\geq`,!0),z(B,H,K,`←`,`\\gets`),z(B,H,K,`>`,`\\gt`,!0),z(B,H,K,`∈`,`\\in`,!0),z(B,H,K,``,`\\@not`),z(B,H,K,`⊂`,`\\subset`,!0),z(B,H,K,`⊃`,`\\supset`,!0),z(B,H,K,`⊆`,`\\subseteq`,!0),z(B,H,K,`⊇`,`\\supseteq`,!0),z(B,U,K,`⊈`,`\\nsubseteq`,!0),z(B,U,K,`⊉`,`\\nsupseteq`,!0),z(B,H,K,`⊨`,`\\models`),z(B,H,K,`←`,`\\leftarrow`,!0),z(B,H,K,`≤`,`\\le`),z(B,H,K,`≤`,`\\leq`,!0),z(B,H,K,`<`,`\\lt`,!0),z(B,H,K,`→`,`\\rightarrow`,!0),z(B,H,K,`→`,`\\to`),z(B,U,K,`≱`,`\\ngeq`,!0),z(B,U,K,`≰`,`\\nleq`,!0),z(B,H,dL,`\xA0`,`\\ `),z(B,H,dL,`\xA0`,`\\space`),z(B,H,dL,`\xA0`,`\\nobreakspace`),z(V,H,dL,`\xA0`,`\\ `),z(V,H,dL,`\xA0`,` `),z(V,H,dL,`\xA0`,`\\space`),z(V,H,dL,`\xA0`,`\\nobreakspace`),z(B,H,dL,``,`\\nobreak`),z(B,H,dL,``,`\\allowbreak`),z(B,H,uL,`,`,`,`),z(B,H,uL,`;`,`;`),z(B,U,W,`⊼`,`\\barwedge`,!0),z(B,U,W,`⊻`,`\\veebar`,!0),z(B,H,W,`⊙`,`\\odot`,!0),z(B,H,W,`⊕`,`\\oplus`,!0),z(B,H,W,`⊗`,`\\otimes`,!0),z(B,H,q,`∂`,`\\partial`,!0),z(B,H,W,`⊘`,`\\oslash`,!0),z(B,U,W,`⊚`,`\\circledcirc`,!0),z(B,U,W,`⊡`,`\\boxdot`,!0),z(B,H,W,`△`,`\\bigtriangleup`),z(B,H,W,`▽`,`\\bigtriangledown`),z(B,H,W,`†`,`\\dagger`),z(B,H,W,`⋄`,`\\diamond`),z(B,H,W,`⋆`,`\\star`),z(B,H,W,`◃`,`\\triangleleft`),z(B,H,W,`▹`,`\\triangleright`),z(B,H,lL,`{`,`\\{`),z(V,H,q,`{`,`\\{`),z(V,H,q,`{`,`\\textbraceleft`),z(B,H,oL,`}`,`\\}`),z(V,H,q,`}`,`\\}`),z(V,H,q,`}`,`\\textbraceright`),z(B,H,lL,`{`,`\\lbrace`),z(B,H,oL,`}`,`\\rbrace`),z(B,H,lL,`[`,`\\lbrack`,!0),z(V,H,q,`[`,`\\lbrack`,!0),z(B,H,oL,`]`,`\\rbrack`,!0),z(V,H,q,`]`,`\\rbrack`,!0),z(B,H,lL,`(`,`\\lparen`,!0),z(B,H,oL,`)`,`\\rparen`,!0),z(V,H,q,`<`,`\\textless`,!0),z(V,H,q,`>`,`\\textgreater`,!0),z(B,H,lL,`⌊`,`\\lfloor`,!0),z(B,H,oL,`⌋`,`\\rfloor`,!0),z(B,H,lL,`⌈`,`\\lceil`,!0),z(B,H,oL,`⌉`,`\\rceil`,!0),z(B,H,q,`\\`,`\\backslash`),z(B,H,q,`∣`,`|`),z(B,H,q,`∣`,`\\vert`),z(V,H,q,`|`,`\\textbar`,!0),z(B,H,q,`∥`,`\\|`),z(B,H,q,`∥`,`\\Vert`),z(V,H,q,`∥`,`\\textbardbl`),z(V,H,q,`~`,`\\textasciitilde`),z(V,H,q,`\\`,`\\textbackslash`),z(V,H,q,`^`,`\\textasciicircum`),z(B,H,K,`↑`,`\\uparrow`,!0),z(B,H,K,`⇑`,`\\Uparrow`,!0),z(B,H,K,`↓`,`\\downarrow`,!0),z(B,H,K,`⇓`,`\\Downarrow`,!0),z(B,H,K,`↕`,`\\updownarrow`,!0),z(B,H,K,`⇕`,`\\Updownarrow`,!0),z(B,H,cL,`∐`,`\\coprod`),z(B,H,cL,`⋁`,`\\bigvee`),z(B,H,cL,`⋀`,`\\bigwedge`),z(B,H,cL,`⨄`,`\\biguplus`),z(B,H,cL,`⋂`,`\\bigcap`),z(B,H,cL,`⋃`,`\\bigcup`),z(B,H,cL,`∫`,`\\int`),z(B,H,cL,`∫`,`\\intop`),z(B,H,cL,`∬`,`\\iint`),z(B,H,cL,`∭`,`\\iiint`),z(B,H,cL,`∏`,`\\prod`),z(B,H,cL,`∑`,`\\sum`),z(B,H,cL,`⨂`,`\\bigotimes`),z(B,H,cL,`⨁`,`\\bigoplus`),z(B,H,cL,`⨀`,`\\bigodot`),z(B,H,cL,`∮`,`\\oint`),z(B,H,cL,`∯`,`\\oiint`),z(B,H,cL,`∰`,`\\oiiint`),z(B,H,cL,`⨆`,`\\bigsqcup`),z(B,H,cL,`∫`,`\\smallint`),z(V,H,sL,`…`,`\\textellipsis`),z(B,H,sL,`…`,`\\mathellipsis`),z(V,H,sL,`…`,`\\ldots`,!0),z(B,H,sL,`…`,`\\ldots`,!0),z(B,H,sL,`⋯`,`\\@cdots`,!0),z(B,H,sL,`⋱`,`\\ddots`,!0),z(B,H,q,`⋮`,`\\varvdots`),z(V,H,q,`⋮`,`\\varvdots`),z(B,H,aL,`ˊ`,`\\acute`),z(B,H,aL,`ˋ`,`\\grave`),z(B,H,aL,`¨`,`\\ddot`),z(B,H,aL,`~`,`\\tilde`),z(B,H,aL,`ˉ`,`\\bar`),z(B,H,aL,`˘`,`\\breve`),z(B,H,aL,`ˇ`,`\\check`),z(B,H,aL,`^`,`\\hat`),z(B,H,aL,`⃗`,`\\vec`),z(B,H,aL,`˙`,`\\dot`),z(B,H,aL,`˚`,`\\mathring`),z(B,H,G,``,`\\@imath`),z(B,H,G,``,`\\@jmath`),z(B,H,q,`ı`,`ı`),z(B,H,q,`ȷ`,`ȷ`),z(V,H,q,`ı`,`\\i`,!0),z(V,H,q,`ȷ`,`\\j`,!0),z(V,H,q,`ß`,`\\ss`,!0),z(V,H,q,`æ`,`\\ae`,!0),z(V,H,q,`œ`,`\\oe`,!0),z(V,H,q,`ø`,`\\o`,!0),z(V,H,q,`Æ`,`\\AE`,!0),z(V,H,q,`Œ`,`\\OE`,!0),z(V,H,q,`Ø`,`\\O`,!0),z(V,H,aL,`ˊ`,`\\'`),z(V,H,aL,`ˋ`,"\\`"),z(V,H,aL,`ˆ`,`\\^`),z(V,H,aL,`˜`,`\\~`),z(V,H,aL,`ˉ`,`\\=`),z(V,H,aL,`˘`,`\\u`),z(V,H,aL,`˙`,`\\.`),z(V,H,aL,`¸`,`\\c`),z(V,H,aL,`˚`,`\\r`),z(V,H,aL,`ˇ`,`\\v`),z(V,H,aL,`¨`,`\\"`),z(V,H,aL,`˝`,`\\H`),z(V,H,aL,`◯`,`\\textcircled`);var fL={"--":!0,"---":!0,"``":!0,"''":!0};z(V,H,q,`–`,`--`,!0),z(V,H,q,`–`,`\\textendash`),z(V,H,q,`—`,`---`,!0),z(V,H,q,`—`,`\\textemdash`),z(V,H,q,`‘`,"`",!0),z(V,H,q,`‘`,`\\textquoteleft`),z(V,H,q,`’`,`'`,!0),z(V,H,q,`’`,`\\textquoteright`),z(V,H,q,`“`,"``",!0),z(V,H,q,`“`,`\\textquotedblleft`),z(V,H,q,`”`,`''`,!0),z(V,H,q,`”`,`\\textquotedblright`),z(B,H,q,`°`,`\\degree`,!0),z(V,H,q,`°`,`\\degree`),z(V,H,q,`°`,`\\textdegree`,!0),z(B,H,q,`£`,`\\pounds`),z(B,H,q,`£`,`\\mathsterling`,!0),z(V,H,q,`£`,`\\pounds`),z(V,H,q,`£`,`\\textsterling`,!0),z(B,U,q,`✠`,`\\maltese`),z(V,U,q,`✠`,`\\maltese`);for(var pL=`0123456789/@."`,mL=0;mL{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return VL[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return HL[Math.floor((r-120782)/10)];if(r===120485||r===120486)return VL[0];if(120486{if(PI(e.classes)!==PI(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},XL=e=>{for(var t=0;tt&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Y=function(e,t,n,r){var i=new BI(e,t,n,r);return ZL(i),i},QL=(e,t,n,r)=>new BI(e,t,n,r),$L=function(e,t,n){var r=Y([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=R(r.height),r.maxFontSize=1,r},eR=function(e,t,n,r){var i=new VI(e,t,n,r);return ZL(i),i},tR=function(e){var t=new kI(e);return ZL(t),t},nR=function(e,t){return e instanceof kI?Y([],[e],t):e},rR=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a{var n=Y([`mspace`],[],t),r=NI(e,t);return n.style.marginRight=R(r),n},oR=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},sR={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},cR={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},lR=function(e,t){var n=cR[e],r=n[0],i=n[1],a=n[2],o=QL([`katex-overlay`],[new GI([new KI(r)],{width:R(i),height:R(a),style:`width:`+R(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=R(a),o.style.width=R(i),o},uR={number:3,unit:`mu`},dR={number:4,unit:`mu`},fR={number:5,unit:`mu`},pR={mord:{mop:uR,mbin:dR,mrel:fR,minner:uR},mop:{mord:uR,mop:uR,mrel:fR,minner:uR},mbin:{mord:dR,mop:dR,mopen:dR,minner:dR},mrel:{mord:fR,mop:fR,mopen:fR,minner:fR},mopen:{},mclose:{mop:uR,mbin:dR,mrel:fR,minner:uR},mpunct:{mord:uR,mop:uR,mrel:fR,mopen:uR,mclose:uR,mpunct:uR,minner:uR},minner:{mord:uR,mop:uR,mbin:dR,mrel:fR,mopen:uR,mpunct:uR,minner:uR}},mR={mord:{mop:uR},mop:{mord:uR,mop:uR},mbin:{},mrel:{},mopen:{},mclose:{mop:uR},mpunct:{},minner:{mop:uR}},hR={},gR={},_R={};function X(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a{var n=t.classes[0],r=e.classes[0];n===`mbin`&&SR.has(r)?t.classes[0]=`mord`:r===`mbin`&&xR.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),ER(i,(e,t)=>{var n=kR(t),r=kR(e),i=n&&r?e.hasClass(`mtight`)?mR[n]?.[r]:pR[n]?.[r]:null;if(i)return aR(i,c)},{node:u},d,f),i},ER=function(e,t,n,r,i){r&&e.push(r);for(var a=0;an=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},DR=function(e){return e instanceof kI||e instanceof VI||e instanceof BI&&e.hasClass(`enclosing`)?e:null},OR=function(e,t){var n=DR(e);if(n){var r=n.children;if(r.length){if(t===`right`)return OR(r[r.length-1],`right`);if(t===`left`)return OR(r[0],`left`)}}return e},kR=function(e,t){return e?(t&&(e=OR(e,t)),wR[e.classes[0]]||null):null},AR=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return Y(t.concat(n))},jR=function(e,t,n){if(!e)return Y();if(gR[e.type]){var r=gR[e.type](e,t);if(n&&t.size!==n.size){r=Y(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new I(`Got group of unknown type: '`+e.type+`'`)};function MR(e,t){var n=Y([`katex-base`],e,t),r=Y([`katex-strut`]);return r.style.height=R(n.height+n.depth),n.depth&&(r.style.verticalAlign=R(-n.depth)),n.children.unshift(r),n}function NR(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=TR(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s0&&(a.push(MR(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(MR(o,t));var l;n?(l=MR(TR(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=Y([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=R(u.height+u.depth),u.depth&&(d.style.verticalAlign=R(-u.depth))}return u}function PR(e){return new kI(e)}var Z=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=PI(this.classes));for(var i=0;i0&&(e+=` class ="`+zF(PI(this.classes))+`"`),e+=`>`;for(var i=0;i`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},FR=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return zF(this.toText())}toText(){return this.text}},IR=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,R(this.width)),e}toMarkup(){return this.character?``+this.character+``:``}toText(){return this.character?this.character:` `}},LR=new Set([`\\imath`,`\\jmath`]),RR=new Set([`mrow`,`mtable`]),zR=function(e,t,n){var r,i;return iL[t][e]&&iL[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(fL,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=iL[t][e].replace),new FR(e)},BR=function(e){return e.length===1?e[0]:new Z(`mrow`,e)},VR={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},HR=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=VR[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(LR.has(a))return null;if(iL[r][a]){var o=iL[r][a].replace;o&&(a=o)}var s=sR[n].fontName;return tL(a,s,r)?sR[n].variant:null};function UR(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof FR&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof FR&&n.text===`,`}return!1}var WR=function(e,t,n){if(e.length===1){var r=KR(e[0],t);return n&&r instanceof Z&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o=1&&(a.type===`mn`||UR(a))){var c=s.children[0];c instanceof Z&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof FR&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof FR&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},GR=function(e,t,n){return BR(WR(e,t,n))},KR=function(e,t){if(!e)return new Z(`mrow`);if(_R[e.type])return _R[e.type](e,t);throw new I(`Got group of unknown type: '`+e.type+`'`)};function qR(e,t,n,r,i){var a=WR(e,n),o=a.length===1&&a[0]instanceof Z&&RR.has(a[0].type)?a[0]:new Z(`mrow`,a),s=new Z(`annotation`,[new FR(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Z(`math`,[new Z(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),Y([i?`katex`:`katex-mathml`],[c])}var JR=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],YR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],XR=function(e,t){return t.size<2?e:JR[e-1][t.size-1]},ZR=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=YR[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:XR(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:YR[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=XR(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=rL(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};ZR.BASESIZE=6;var QR=function(e){return new ZR({style:e.displayMode?L.DISPLAY:L.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},$R=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=Y(n,[e])}return e},ez=function(e,t,n){var r=QR(n),i;return n.output===`mathml`?qR(e,t,r,n.displayMode,!0):(i=n.output===`html`?Y([`katex`],[NR(e,r)]):Y([`katex`],[qR(e,t,r,n.displayMode,!1),NR(e,r)]),$R(i,n))},tz=function(e,t,n){return $R(Y([`katex`],[NR(e,QR(n))]),n)},nz={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},rz=function(e){var t=new Z(`mo`,[new FR(nz[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},iz={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},az=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),oz=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(az.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:QL([],[new GI([new KI(o)],{width:`100%`,height:R(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=iz[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support + `+h+` children.`);for(var v=0;v0&&(i.style.minWidth=R(a)),i},sz=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=Y([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new qI({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new qI({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=QL([],[new GI(c,{width:`100%`,height:R(o)})],i)}return a.height=o,a.style.height=R(o),a},cz=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],lz=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],uz=new Set(cz),dz=new Set(lz);function fz(e){return uz.has(e)}function Q(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function pz(e){var t=mz(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function mz(e){return e.type===`atom`||dz.has(e.type)?e:null}function hz(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new I(t,e);return r}var gz=e=>{if(e instanceof WI)return e;if(XI(e)&&e.children.length===1)return gz(e.children[0])},_z=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Q(e.base,`accent`),n=r.base,e.base=n,i=YI(jR(e,t)),e.base=r):(r=Q(e,`accent`),n=r.base);var a=jR(n,t.havingCrampedStyle()),o=r.isShifty&&HF(n),s=0;o&&(s=gz(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=oz(r,t),u=iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+R(2*s)+`)`,marginLeft:R(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=lR(`vec`,t),f=cR.vec[1]):(d=JL({type:`textord`,mode:r.mode,text:r.label},t),d=JI(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=Y([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=R(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=Y([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},vz=(e,t)=>{var n=e.isStretchy?rz(e.label):new Z(`mo`,[zR(e.label,e.mode)]),r=new Z(`mover`,[KR(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},yz=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));X({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=yR(t[0]),r=!yz.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:_z,mathmlBuilder:vz}),X({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),X({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=jR(e.base,t),r=oz(e,t),i=e.label===`\\utilde`?.12:0;return Y([`mord`,`accentunder`],[iR({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=rz(e.label),r=new Z(`munder`,[KR(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var bz=e=>{var t=new Z(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};X({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=nR(jR(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=nR(jR(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=oz(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=iR({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=iR({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return Y([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=rz(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=bz(KR(e.body,t));r=e.below?new Z(`munderover`,[n,bz(KR(e.below,t)),i]):new Z(`mover`,[n,i])}else e.below?r=new Z(`munder`,[n,bz(KR(e.below,t))]):(r=bz(),r=new Z(`mover`,[n,r]));return r}});function xz(e,t){var n=TR(e.body,t,!0);return Y([e.mclass],n,t)}function Sz(e,t){var n,r=WR(e.body,t);return e.mclass===`minner`?n=new Z(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Z(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Z(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}X({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:bR(i),isCharacterBox:HF(i)}},htmlBuilder:xz,mathmlBuilder:Sz});var Cz=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};X({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:Cz(t[0]),body:bR(t[1]),isCharacterBox:HF(t[1])}}}),X({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Cz(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:bR(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:HF(c)}}}),X({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:Cz(t[0]),body:bR(t[0])}},htmlBuilder(e,t){var n=TR(e.body,t,!0),r=Y([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Z(`mstyle`,WR(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var wz={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Tz=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Ez=e=>e.type===`textord`&&e.text===`@`,Dz=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Oz(e,t,n){var r=wz[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function kz(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new I(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;aAV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;pAV=|." after @`,o[c])}var m={type:`styling`,body:[Oz(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Tz()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}X({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=nR(jR(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=R(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Z(`mrow`,[KR(e.label,t)]);return n=new Z(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Z(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),X({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=nR(jR(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Z(`mrow`,[KR(e.fragment,t)])}}),X({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=hz(Q(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new I(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new I(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),X({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=Q(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:bR(i)}},htmlBuilder:(e,t)=>tR(TR(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Z(`mstyle`,WR(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),X({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=Q(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),X({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var r=e.parser,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Q(i,`size`).value}},htmlBuilder(e,t){var n=Y([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=R(NI(e.size,t)))),n},mathmlBuilder(e,t){var n=new Z(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,R(NI(e.size,t)))),n}});var Az={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},jz=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new I(`Expected a control sequence`,e);return t},Mz=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Nz=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};X({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(Az[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=Az[r.text]),Q(t.parseFunction(),`internal`);throw new I(`Invalid token after macro prefix`,r)}}),X({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new I(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new I(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new I(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new I(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===Az[n]),{type:`internal`,mode:t.mode}}}),X({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=jz(t.gullet.popToken());return t.gullet.consumeSpaces(),Nz(t,r,Mz(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),X({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=jz(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Nz(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Pz=function(e,t,n){var r=tL(iL.math[e]&&iL.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Fz=function(e,t,n,r){var i=n.havingBaseStyle(t),a=Y(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Iz=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=R(i),e.height-=i,e.depth+=i},Lz=function(e,t,n,r,i,a){var o=Fz(GL(e,`Main-Regular`,i,r),t,r,a);return n&&Iz(o,r,t),o},Rz=function(e,t,n,r){return GL(e,`Size`+t+`-Regular`,n,r)},zz=function(e,t,n,r,i,a){var o=Rz(e,t,i,r),s=Fz(Y([`delimsizing`,`size`+t],[o],r),L.TEXT,r,a);return n&&Iz(s,r,L.TEXT),s},Bz=function(e,t,n){return{type:`elem`,elem:Y([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[Y([],[GL(e,t,n)])])}},Vz=function(e,t,n){var r=ZI[`Size4-Regular`][e.charCodeAt(0)]?ZI[`Size4-Regular`][e.charCodeAt(0)][4]:ZI[`Size1-Regular`][e.charCodeAt(0)][4],i=QL([],[new GI([new KI(`inner`,TI(e,Math.round(1e3*t)))],{width:R(r),height:R(t),style:`width:`+R(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=R(t),i.style.width=R(r),{type:`elem`,elem:i}},Hz=.008,Uz={type:`kern`,size:-1*Hz},Wz=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),Gz=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Kz=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Wz.has(e)?(c=`∣`,u=`vert`,d=333):Gz.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=Pz(o,f,i),m=p.height+p.depth,h=Pz(c,f,i),g=h.height+h.depth,_=Pz(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Pz(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,ee=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,te=r.fontMetrics().axisHeight;n&&(te*=r.sizeMultiplier);var ne=ee/2-te,re=[];if(u.length>0){var ie=ee-m-v,ae=Math.round(ee*1e3),oe=DI(u,Math.round(ie*1e3)),se=new KI(u,oe),ce=R(d/1e3),le=R(ae/1e3),ue=QL([],[new GI([se],{width:ce,height:le,viewBox:`0 0 `+d+` `+ae})],r);ue.height=ae/1e3,ue.style.width=ce,ue.style.height=le,re.push({type:`elem`,elem:ue})}else{if(re.push(Bz(l,f,i)),re.push(Uz),s===null){var de=ee-m-v+2*Hz;re.push(Vz(c,de,r))}else{var fe=(ee-m-v-y)/2+2*Hz;re.push(Vz(c,fe,r)),re.push(Uz),re.push(Bz(s,f,i)),re.push(Uz),re.push(Vz(c,fe,r))}re.push(Uz),re.push(Bz(o,f,i))}var pe=r.havingBaseStyle(L.TEXT);return Fz(Y([`delimsizing`,`mult`],[iR({positionType:`bottom`,positionData:ne,children:re})],pe),L.TEXT,r,a)},qz=80,Jz=.08,Yz=function(e,t,n,r,i){return QL([`hide-tail`],[new GI([new KI(e,wI(e,r,n))],{width:`400em`,height:R(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Xz=function(e,t){var n=t.havingBaseSizing(),r=oB(`\\surd`,e*n.sizeMultiplier,iB,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+qz,e<1?i=1:e<1.4&&(i=.7),s=(1+a+Jz)/i,c=(1+a)/i,o=Yz(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+qz)*eB[r.size],c=(eB[r.size]+a)/i,s=(eB[r.size]+a+Jz)/i,o=Yz(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+Jz,c=e+a,l=Math.floor(1e3*e+a)+qz,o=Yz(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=R(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Zz=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Qz=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),$z=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),eB=[0,1.2,1.8,2.4,3],tB=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Zz.has(e)||$z.has(e))return zz(e,t,!1,n,r,i);if(Qz.has(e))return Kz(e,eB[t],!1,n,r,i);throw new I(`Illegal delimiter: '`+e+`'`)},nB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],rB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`stack`}],iB=[{type:`small`,style:L.SCRIPTSCRIPT},{type:`small`,style:L.SCRIPT},{type:`small`,style:L.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],aB=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},oB=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);it)return a}return n[n.length-1]},sB=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=$z.has(e)?nB:Zz.has(e)?iB:rB,s=oB(e,t,o,r);return s.type===`small`?Lz(e,s.style,n,r,i,a):s.type===`large`?zz(e,s.size,n,r,i,a):Kz(e,t,n,r,i,a)},cB=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return sB(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},lB={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},uB=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function dB(e){return`isMiddle`in e}function fB(e,t){var n=mz(e);if(n&&uB.has(n.text))return n;throw n?new I(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new I(`Invalid delimiter type '`+e.type+`'`,e)}X({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=fB(yR(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:lB[e.funcName].size,mclass:lB[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?Y([e.mclass]):tB(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(zR(e.delim,e.mode));var n=new Z(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=R(eB[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function pB(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}X({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new I(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:fB(t[0],e).text,color:n}}}),X({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=fB(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Q(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{pB(e);for(var n=TR(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o{pB(e);var n=WR(e.body,t);if(e.left!==`.`){var r=new Z(`mo`,[zR(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Z(`mo`,[zR(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return BR(n)}}),X({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=fB(t[0],e);if(!e.parser.leftrightDepth)throw new I(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=AR(t,[]):(n=tB(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Z(`mo`,[e.delim===`\\vert`||e.delim===`|`?zR(`|`,`text`):zR(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),X({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Q(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=nR(jR(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=HF(e.body);if(r===`sout`)a=Y([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=NI({number:.6,unit:`pt`},t),l=NI({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=R(d/2+c);var f=Math.floor(1e3*d*i);a=QL([`hide-tail`],[new GI([new KI(`phase`,SI(f))],{width:`400em`,height:R(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=R(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=sz(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=R(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=R(h),a.style.borderRightWidth=R(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=iR({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=iR({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?Y([`mord`,`cancel-lap`],[g],t):Y([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Z(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[KR(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+R(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),X({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Q(t[0],`color-token`).color,o=Q(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),X({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),X({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),X({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),X({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var mB={};function hB(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c{if(!e.parser.settings.displayMode)throw new I(`{`+e.envName+`} can be used only in display mode.`)},xB=new Set([`gather`,`gather*`]);function SB(e){if(!e.includes(`ed`))return!e.includes(`*`)}function CB(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new I(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new vB(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(yB(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var ee=e.fetch().text;if(ee===`&`){if(d&&m.length===d){if(l||s)throw new I(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(ee===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n0&&(ne+=g,xe))for(n=0;n=o)){var ye=void 0;(r>0||e.hskipBeforeAndAfter)&&(ye=pe?.pregap??d,ye!==0&&(oe=Y([`arraycolsep`],[]),oe.style.width=R(ye),ae.push(oe)));var be=[];for(n=0;n0){for(var De=$L(`katex-hline`,t,l),Oe=$L(`katex-hdashline`,t,l),ke=[{type:`elem`,elem:Ee,shift:0}];c.length>0;){var Ae=c.pop(),je=Ae.pos-re;Ae.isDashed?ke.push({type:`elem`,elem:Oe,shift:je}):ke.push({type:`elem`,elem:De,shift:je})}Ee=iR({positionType:`individualShift`,children:ke})}if(ce.length===0)return Y([`mord`],[Ee],t);var Me=Y([`katex-tag`],[iR({positionType:`individualShift`,children:ce})],t);return tR([Ee,Me])},EB={c:`center `,l:`left `,r:`right `},DB=function(e,t){for(var n=[],r=new Z(`mtd`,[],[`mtr-glue`]),i=new Z(`mtd`,[],[`mml-eqn-num`]),a=0;a0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=EB[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S0?`left `:``,d+=te[te.length-1].length>0?`right `:``;for(var ne=1;ne0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};hB({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(mz(t[0])?[t[0]]:Q(t[0],`ordgroup`).body).map(function(e){var t=pz(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new I(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return CB(e.parser,r,wB(e.envName))},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new I(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=CB(e.parser,r,wB(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=CB(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(mz(t[0])?[t[0]]:Q(t[0],`ordgroup`).body).map(function(e){var t=pz(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new I(`Unknown column alignment: `+t,e)});if(n.length>1)throw new I(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=CB(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new I(`{subarray} can contain only one column`);return i},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=CB(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},wB(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:OB,htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){xB.has(e.envName)&&bB(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:SB(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return CB(e.parser,t,`display`)},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:OB,htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){bB(e);var t={autoTag:SB(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return CB(e.parser,t,`display`)},htmlBuilder:TB,mathmlBuilder:DB}),hB({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return bB(e),kz(e.parser)},htmlBuilder:TB,mathmlBuilder:DB}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),X({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new I(e.funcName+` valid only within array environment`)}});var kB=mB;X({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new I(`Invalid environment name`,i);var a=hz(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(kB,a))throw new I(`No such environment: `+a,i);var o=kB[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Q(n.parseFunction(),`environment`);if(p.name!==a)throw new I(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var AB=(e,t)=>{var n=e.font,r=t.withFont(n);return jR(e.body,r)},jB=(e,t)=>{var n=e.font,r=t.withFont(n);return KR(e.body,r)},MB={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};X({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=yR(t[0]),a=r in MB?MB[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:AB,mathmlBuilder:jB}),X({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:Cz(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:HF(r)}}}),X({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var NB=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=jR(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d){var n=new Z(`mfrac`,[KR(e.numer,t),KR(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=NI(e.barSize,t);n.setAttribute(`linethickness`,R(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Z(`mo`,[new FR(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Z(`mo`,[new FR(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return BR(i)}return n},FB=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;X({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),FB({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:NB,mathmlBuilder:PB}),X({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var IB=[`display`,`text`,`script`,`scriptscript`],LB=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};X({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=yR(t[0]),o=a.type===`atom`&&a.family===`open`?LB(a.text):null,s=yR(t[1]),c=s.type===`atom`&&s.family===`close`?LB(s.text):null,l=Q(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Q(p.body[0],`textord`);f=IB[Number(m.text)]}}else p=Q(p,`textord`),f=IB[Number(p.text)];return FB({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),X({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Q(t[0],`size`).value,token:r}}}),X({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=Q(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var RB=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?jR(e.sup,t.havingStyle(n.sup()),t):jR(e.sub,t.havingStyle(n.sub()),t),i=Q(e.base,`horizBrace`)):i=Q(e,`horizBrace`);var a=jR(i.base,t.havingBaseStyle(L.DISPLAY)),o=oz(i,t),s=i.isOver?iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):iR({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=Y([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):iR({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return Y([`minner`,i.isOver?`mover`:`munder`],[s],t)};X({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:RB,mathmlBuilder:(e,t)=>{var n=rz(e.label);return new Z(e.isOver?`mover`:`munder`,[KR(e.base,t),n])}}),X({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=Q(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:bR(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=TR(e.body,t,!1);return eR(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=GR(e.body,t);return n instanceof Z||(n=new Z(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),X({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=Q(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a{var n=e.parser,r=e.funcName;e.token;var i=Q(t[0],`raw`).string,a=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d{var n=TR(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Y(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>GR(e.body,t)}),X({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:bR(t[0]),mathml:bR(t[1])}),htmlBuilder:(e,t)=>tR(TR(e.html,t,!1)),mathmlBuilder:(e,t)=>GR(e.mathml,t)});var zB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new I(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!MI(n))throw new I(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};X({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Q(n[0],`raw`).string.split(`,`),l=0;l{var n=NI(e.height,t),r=0;e.totalheight.number>0&&(r=NI(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=NI(e.width,t));var a={height:R(n+r)};i>0&&(a.width=R(i)),r>0&&(a.verticalAlign=R(-r));var o=new HI(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Z(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=NI(e.height,t),i=0;if(e.totalheight.number>0&&(i=NI(e.totalheight,t)-r,n.setAttribute(`valign`,R(-i))),n.setAttribute(`height`,R(r+i)),e.width.number>0){var a=NI(e.width,t);n.setAttribute(`width`,R(a))}return n.setAttribute(`src`,e.src),n}}),X({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=Q(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return aR(e.dimension,t)},mathmlBuilder(e,t){return new IR(NI(e.dimension,t))}}),X({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=Y([],[jR(e.body,t)]),n=Y([`katex-inner`],[n],t)):n=Y([`katex-inner`],[jR(e.body,t)]);var r=Y([`katex-fix`],[]),i=Y([e.alignment],[n,r],t),a=Y([`katex-strut`]);return a.style.height=R(i.height+i.depth),i.depth&&(a.style.verticalAlign=R(-i.depth)),i.children.unshift(a),i=Y([`katex-thinbox`],[i],t),Y([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Z(`mpadded`,[KR(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),X({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),X({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new I(`Mismatched `+e.funcName)}});var BB=(e,t)=>{switch(t.style.size){case L.DISPLAY.size:return e.display;case L.TEXT.size:return e.text;case L.SCRIPT.size:return e.script;case L.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};X({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:bR(t[0]),text:bR(t[1]),script:bR(t[2]),scriptscript:bR(t[3])}),htmlBuilder:(e,t)=>tR(TR(BB(e,t),t,!1)),mathmlBuilder:(e,t)=>GR(BB(e,t),t)});var VB=(e,t,n,r,i,a,o)=>{e=Y([],[e]);var s=n&&HF(n),c,l;if(t){var u=jR(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=jR(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=iR({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=iR({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=iR({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=Y([`mspace`],[],r);m.style.marginRight=R(a),p.unshift(m)}return Y([`mop`,`op-limits`],p,r)},HB=new Set([`\\smallint`]),UB=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Q(e.base,`op`),i=!0):a=Q(e,`op`);var o=t.style,s=!1;o.size===L.DISPLAY.size&&a.symbol&&!HB.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=GL(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=lR(d+`Size`+(s?`2`:`1`),t);c=iR({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=TR(a.body,t,!0);p.length===1&&p[0]instanceof WI?(c=p[0],c.classes[0]=`mop`):c=Y([`mop`],p,t)}else{for(var m=[],h=1;h{var n;if(e.symbol)n=new Z(`mo`,[zR(e.name,e.mode)]),HB.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Z(`mo`,WR(e.body,t));else{n=new Z(`mi`,[new FR(e.name.slice(1))]);var r=new Z(`mo`,[zR(`⁡`,`text`)]);n=e.parentIsSupSub?new Z(`mrow`,[n,r]):PR([n,r])}return n},GB={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};X({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=GB[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:UB,mathmlBuilder:WB}),X({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:bR(r)}}});var KB={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};X({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),X({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),X({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=KB[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var qB=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Q(e.base,`operatorname`),i=!0):a=Q(e,`operatorname`);var o;if(a.body.length>0){for(var s=TR(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:bR(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:qB,mathmlBuilder:(e,t)=>{for(var n=WR(e.body,t.withFont(`mathrm`)),r=!0,i=0;ie.toText()).join(``))]);var s=new Z(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Z(`mo`,[zR(`⁡`,`text`)]);return e.parentIsSupSub?new Z(`mrow`,[s,c]):PR([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),vR({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?tR(TR(e.body,t,!1)):Y([`mord`],TR(e.body,t,!0),t)},mathmlBuilder(e,t){return GR(e.body,t,!0)}}),X({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=jR(e.body,t.havingCrampedStyle()),r=$L(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return Y([`mord`,`katex-overline`],[iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Z(`mo`,[new FR(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Z(`mover`,[KR(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),X({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:bR(r)}},htmlBuilder:(e,t)=>tR(TR(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Z(`mphantom`,WR(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),X({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>Y([`mord`,`rlap`],[Y([`katex-inner`],[jR(e.body,t.withPhantom())]),Y([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Z(`mpadded`,[new Z(`mphantom`,WR(bR(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),X({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=Q(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=jR(e.body,t);return iR({positionType:`shift`,positionData:-NI(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Z(`mpadded`,[KR(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var JB=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});X({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:JB,htmlBuilder(e,t){return Y([`mord`,`reflectbox`],[jR(e.body,t)],t)},mathmlBuilder(e,t){return KR(e.body,t)}}),X({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:JB}),X({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),X({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=Q(t[0],`size`),o=Q(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Q(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Y([`mord`,`katex-rule`],[],t),r=NI(e.width,t),i=NI(e.height,t),a=e.shift?NI(e.shift,t):0;return n.style.borderRightWidth=R(r),n.style.borderTopWidth=R(i),n.style.bottom=R(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=NI(e.width,t),r=NI(e.height,t),i=e.shift?NI(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Z(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,R(n)),o.setAttribute(`height`,R(r));var s=new Z(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,R(i)):(s.setAttribute(`height`,R(i)),s.setAttribute(`depth`,R(-i))),s.setAttribute(`voffset`,R(i)),s}});function YB(e,t,n){for(var r=TR(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:XB.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return YB(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Z(`mstyle`,WR(e.body,n));return r.setAttribute(`mathsize`,R(n.sizeMultiplier)),r}}),X({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&Q(n[0],`ordgroup`);if(o)for(var s,c=0;c{var n=Y([],[jR(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Y([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r{var n=new Z(`mpadded`,[KR(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),X({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=jR(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=nR(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=R(l);var f=iR({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(L.SCRIPTSCRIPT),m=jR(e.index,p,t);return Y([`mord`,`sqrt`],[Y([`katex-root`],[iR({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return Y([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Z(`mroot`,[KR(n,t),KR(r,t)]):new Z(`msqrt`,[KR(n,t)])}});var ZB={display:L.DISPLAY,text:L.TEXT,script:L.SCRIPT,scriptscript:L.SCRIPTSCRIPT};function QB(e){return e in ZB}X({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!QB(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=ZB[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),YB(e.body,r,t)},mathmlBuilder(e,t){var n=ZB[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Z(`mstyle`,WR(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var $B=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===L.DISPLAY.size||n.alwaysHandleSupSub)?UB:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===L.DISPLAY.size||n.limits)?qB:null:n.type===`accent`?HF(n.base)?_z:null:n.type===`horizBrace`&&!e.sub===n.isOver?RB:null:null};vR({type:`supsub`,htmlBuilder(e,t){var n=$B(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=jR(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&HF(r);if(i){var p=t.havingStyle(t.style.sup());s=jR(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=jR(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===L.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=R(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof WI||y)&&(v=R(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)0&&(u+=S,d-=S)}b=iR({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=iR({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=iR({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return Y([kR(o,`right`)||`mord`],[o,Y([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[KR(e.base,t)];e.sub&&a.push(KR(e.sub,t)),e.sup&&a.push(KR(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===L.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===L.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===L.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===L.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===L.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===L.DISPLAY)?`munder`:`msub`}return new Z(o,a)}}),vR({type:`atom`,htmlBuilder(e,t){return KL(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Z(`mo`,[zR(e.text,e.mode)]);if(e.family===`bin`){var r=HR(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var eV={mi:`italic`,mn:`normal`,mtext:`normal`};vR({type:`mathord`,htmlBuilder(e,t){return JL(e,t)},mathmlBuilder(e,t){var n=new Z(`mi`,[zR(e.text,e.mode,t)]),r=HR(e,t)||`italic`;return r!==eV[n.type]&&n.setAttribute(`mathvariant`,r),n}}),vR({type:`textord`,htmlBuilder(e,t){return JL(e,t)},mathmlBuilder(e,t){var n=zR(e.text,e.mode,t),r=HR(e,t)||`normal`,i=e.mode===`text`?new Z(`mtext`,[n]):/[0-9]/.test(e.text)?new Z(`mn`,[n]):e.text===`\\prime`?new Z(`mo`,[n]):new Z(`mi`,[n]);return r!==eV[i.type]&&i.setAttribute(`mathvariant`,r),i}});var tV=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),nV=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);vR({type:`spacing`,htmlBuilder(e,t){var n=nV.get(e.text),r=tV.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=JL(e,t);return a.classes.push(i),a}return Y([`mspace`,i],[KL(e.text,e.mode,t)],t)}if(r)return Y([`mspace`,r],[],t);throw new I(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(nV.has(e.text))n=new Z(`mtext`,[new FR(`\xA0`)]);else if(tV.has(e.text))return new Z(`mspace`);else throw new I(`Unknown type of space "`+e.text+`"`);return n}});var rV=()=>{var e=new Z(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};vR({type:`tag`,mathmlBuilder(e,t){var n=new Z(`mtable`,[new Z(`mtr`,[rV(),new Z(`mtd`,[GR(e.body,t)]),rV(),new Z(`mtd`,[GR(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var iV={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},aV={"\\textbf":`textbf`,"\\textmd":`textmd`},oV={"\\textit":`textit`,"\\textup":`textup`},sV=(e,t)=>{var n=e.font;return n?iV[n]?t.withTextFontFamily(iV[n]):aV[n]?t.withTextFontWeight(aV[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(oV[n]):t};X({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:bR(i),font:r}},htmlBuilder(e,t){var n=sV(e,t);return Y([`mord`,`text`],TR(e.body,n,!0),n)},mathmlBuilder(e,t){var n=sV(e,t);return GR(e.body,n)}}),X({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=jR(e.body,t),r=$L(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return Y([`mord`,`katex-underline`],[iR({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Z(`mo`,[new FR(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Z(`munder`,[KR(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),X({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=jR(e.body,t),r=t.fontMetrics().axisHeight;return iR({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Z(`mrow`,[new Z(`mpadded`,[KR(e.body,t)],[`vcenter`])])}}),X({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new I(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=cV(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?`␣`:`\xA0`),lV=hR,uV=`[ \r + ]`,dV=`\\\\[a-zA-Z@]+`,fV=`\\\\[^\ud800-\udfff]`,pV=`(`+dV+`)`+uV+`*`,mV=`\\\\( |[ \r ]+ -?)[ \r ]*`,mV=`[̀-ͯ]`,hV=RegExp(mV+`+$`),gV=`(`+lV+`+)|`+(pV+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(mV+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(mV+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+fV)+(`|`+dV+`)`),_V=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(gV,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new _B(`EOF`,new gB(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new I(`Unexpected character: '`+e[t]+`'`,new _B(e[t],new gB(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new _B(r,new gB(this,t,this.tokenRegex.lastIndex))}},vV=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new I(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},yV=hB;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var bV={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new I("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=bV[t.text],r==null||r>=n)throw new I(`Invalid base-`+n+` digit `+t.text);for(var i;(i=bV[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new I(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new I(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new I(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new I(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>xV(e,!1,!0,!1)),$(`\\renewcommand`,e=>xV(e,!0,!1,!1)),$(`\\providecommand`,e=>xV(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),cV[n],rL.math[n],rL.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var SV={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},CV=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in SV?t=SV[n]:(n.slice(0,4)===`\\not`||n in rL.math&&CV.has(rL.math[n].group))&&(t=`\\dotsb`),t});var wV={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in wV?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in wV&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in wV?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new I(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var TV=R(XI[`Main-Regular`][84][1]-.7*XI[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+TV+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+TV+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var EV=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,EV(!1)),$(`\\bra@set`,EV(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var DV={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},OV=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new vV(yV,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new _V(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new _B(`EOF`,n.loc)),this.pushTokens(r),new _B(``,gB.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new I(`Extra }`,i)}else if(i.text===`EOF`)throw new I(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new I(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;rthis.settings.maxExpand)throw new I(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new I(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new I(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new I(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new _B(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new _V(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(cV,e)||Object.prototype.hasOwnProperty.call(rL.math,e)||Object.prototype.hasOwnProperty.call(rL.text,e)||Object.prototype.hasOwnProperty.call(DV,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(cV,e)&&!cV[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},kV=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,AV=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),jV={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},MV={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},NV=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new OV(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new I(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new _B(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&cV[i.text]&&cV[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r=128)this.settings.strict&&(pI(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:gB.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;ce.getAttribute(`data-latex`),renderHTML:e=>({"data-latex":e.latex})}}},addCommands(){return{insertBlockMath:e=>({commands:t,editor:n})=>{let{latex:r,pos:i}=e;return r?t.insertContentAt(i??n.state.selection.from,{type:this.name,attrs:{latex:r}}):!1},deleteBlockMath:e=>({editor:t,tr:n})=>{let r=e?.pos??t.state.selection.$from.pos,i=t.state.doc.nodeAt(r);return!i||i.type.name!==this.name?!1:(n.delete(r,r+i.nodeSize),!0)},updateBlockMath:e=>({editor:t,tr:n})=>{let r=e?.latex,i=e?.pos;i===void 0&&(i=t.state.selection.$from.pos);let a=t.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(n.setNodeMarkup(i,this.type,{...a.attrs,latex:r??a.attrs.latex}),!0)}}},parseHTML(){return[{tag:`div[data-type="block-math"]`}]},renderHTML({HTMLAttributes:e}){return[`div`,A(e,{"data-type":`block-math`})]},parseMarkdown:e=>({type:`blockMath`,attrs:{latex:e.latex}}),renderMarkdown:e=>[`$$`,e.attrs?.latex||``,`$$`].join(` -`),markdownTokenizer:{name:`blockMath`,level:`block`,start:e=>e.indexOf(`$$`),tokenize:e=>{let t=e.match(/^\$\$([^$]+)\$\$/);if(!t)return;let[n,r]=t;return{type:`blockMath`,raw:n,latex:r.trim()}}},addInputRules(){return[new lp({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:e,range:t,match:n})=>{let[,r]=n,{tr:i}=e,a=e.doc.resolve(t.from),o=this.type.create({latex:r}),s=a.depth>0&&a.parent.isTextblock&&t.from===a.start()&&t.to===a.end()&&a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),this.type)?{from:a.before(),to:a.after()}:t;i.replaceWith(s.from,s.to,o)}})]},addNodeView(){let{katexOptions:e}=this.options;return({node:t,getPos:n})=>{let r=document.createElement(`div`),i=document.createElement(`div`);r.className=`tiptap-mathematics-render`,this.editor.isEditable&&r.classList.add(`tiptap-mathematics-render--editable`),i.className=`block-math-inner`,r.dataset.type=`block-math`,r.setAttribute(`data-latex`,t.attrs.latex),r.appendChild(i);function a(){try{BV.render(t.attrs.latex,i,e),r.classList.remove(`block-math-error`)}catch{r.textContent=t.attrs.latex,r.classList.add(`block-math-error`)}}let o=e=>{e.preventDefault(),e.stopPropagation();let r=n();r!=null&&this.options.onClick&&this.options.onClick(t,r)};return this.options.onClick&&r.addEventListener(`click`,o),a(),{dom:r,destroy(){r.removeEventListener(`click`,o)}}}}}),HV=e=>{let t=/\$\$([^$\n]+?)\$\$(?!\$)/g,n=t.exec(e);for(;n!==null;){if(n.index===0||e[n.index-1]!==`$`)return{index:n.index,text:n[0],data:{latex:n[1]}};t.lastIndex=n.index+1,n=t.exec(e)}return null},UV=Jp.create({name:`inlineMath`,group:`inline`,inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`),renderHTML:e=>({"data-latex":e.latex})}}},addCommands(){return{insertInlineMath:e=>({editor:t,tr:n})=>{let r=e.latex,i=e?.pos??t.state.selection.from;return r?(n.replaceWith(i,i,this.type.create({latex:r})),!0):!1},deleteInlineMath:e=>({editor:t,tr:n})=>{let r=e?.pos??t.state.selection.$from.pos,i=t.state.doc.nodeAt(r);return!i||i.type.name!==this.name?!1:(n.delete(r,r+i.nodeSize),!0)},updateInlineMath:e=>({editor:t,tr:n})=>{let r=e?.latex,i=e?.pos;i===void 0&&(i=t.state.selection.$from.pos);let a=t.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(n.setNodeMarkup(i,this.type,{...a.attrs,latex:r}),!0)}}},parseHTML(){return[{tag:`span[data-type="inline-math"]`}]},renderHTML({HTMLAttributes:e}){return[`span`,A(e,{"data-type":`inline-math`})]},parseMarkdown:e=>({type:`inlineMath`,attrs:{latex:e.latex}}),renderMarkdown:e=>`$${e.attrs?.latex||``}$`,markdownTokenizer:{name:`inlineMath`,level:`inline`,start:e=>e.indexOf(`$`),tokenize:e=>{let t=e.match(/^\$([^$]+)\$(?!\$)/);if(!t)return;let[n,r]=t;return{type:`inlineMath`,raw:n,latex:r.trim()}}},addInputRules(){return[new lp({find:HV,handler:({state:e,range:t,match:n})=>{let r=n.data?.latex;if(typeof r!=`string`)return null;let{tr:i}=e,a=t.from,o=t.to;i.replaceWith(a,o,this.type.create({latex:r}))}})]},addNodeView(){let{katexOptions:e}=this.options;return({node:t,getPos:n})=>{let r=document.createElement(`span`);r.className=`tiptap-mathematics-render`,this.editor.isEditable&&r.classList.add(`tiptap-mathematics-render--editable`),r.dataset.type=`inline-math`,r.setAttribute(`data-latex`,t.attrs.latex);function i(){try{BV.render(t.attrs.latex,r,e),r.classList.remove(`inline-math-error`)}catch{r.textContent=t.attrs.latex,r.classList.add(`inline-math-error`)}}let a=e=>{e.preventDefault(),e.stopPropagation();let r=n();r!=null&&this.options.onClick&&this.options.onClick(t,r)};return this.options.onClick&&r.addEventListener(`click`,a),i(),{dom:r,destroy(){r.removeEventListener(`click`,a)}}}}}),WV=Tp.create({name:`Mathematics`,addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[VV.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),UV.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});function GV(e,t){let n=n=>(r,i)=>{let a=t();if(!a?.isEditable)return;let o=a.view.nodeDOM(i);if(!(o instanceof HTMLElement))return;let s=e.blocks;cF({anchor:o,value:String(r.attrs.latex??``),label:s.latex,multiline:n===`block`,monospace:!0,labels:{done:s.done,cancel:s.cancel,remove:s.remove},onSave:e=>{let t=a.chain().setNodeSelection(i);e.trim()?(n===`inline`?t.updateInlineMath({latex:e,pos:i}):t.updateBlockMath({latex:e,pos:i})).focus().run():(n===`inline`?t.deleteInlineMath({pos:i}):t.deleteBlockMath({pos:i})).focus().run()},onRemove:()=>{let e=a.chain();(n===`inline`?e.deleteInlineMath({pos:i}):e.deleteBlockMath({pos:i})).focus().run()}})};return WV.configure({katexOptions:{throwOnError:!1,strict:!1,trust:!1},inlineOptions:{onClick:n(`inline`)},blockOptions:{onClick:n(`block`)}})}function KV(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=kf(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.map(kf).join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function qV(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,` -`);return/\s/.test(n)}):!1}function JV(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function YV(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:JV(e)}function XV({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!qV(r)}function ZV({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function QV({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),xs.create(a.doc,[vs.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function $V({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(yf.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function eH({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function tH({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[Tj({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(Dj()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function nH(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function rH({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&nH(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=wj(c,o,()=>{Oj(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function iH({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=eH({editor:e,items:n}),v=tH({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,ee=b.query!==x.query,te=b.text!==x.text,ne=b.range.from!==x.range.from||b.range.to!==x.range.to,re=ee||te||ne;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&re)S=`updated`;else return;let ie=S===`stopped`?b:x,ae=n.dom.querySelector(`[data-decoration-id="${ie.decorationId}"]`),oe=m(n,ae),se=i===0||(ie.query?ie.query.length>=i:!1),ce=(S===`started`||S===`updated`)&&se;if(g={editor:e,range:ie.range,query:ie.query||``,text:ie.text||``,items:o??[],command:t=>p({editor:e,range:ie.range,props:t}),decorationNode:ae,clientRect:oe,loading:ce,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:rH({getReferenceRect:oe,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var le;r==null||(le=r.onBeforeStart)==null||le.call(r,g)}if(S===`updated`){var ue;r==null||(ue=r.onBeforeUpdate)==null||ue.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!ce)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(ie.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var aH=new D(`suggestion`);function oH({pluginKey:e=aH,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:ee=()=>!0,findSuggestionMatch:te=KV,shouldShow:ne,shouldResetDismissed:re}){let ie=S?.(),ae=r&&!i,oe=(n,r)=>YV(t,n,r,e);function se(e){return XV({...e,editor:t,shouldResetDismissed:re,effectiveAllowSpaces:ae})}let ce=t=>ZV({view:t,pluginKeyRef:e});return new E({key:e,view:()=>iH({editor:t,pluginKey:e,items:f,renderer:ie,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:oe,dispatchExit:ce}),state:$V({editor:t,char:n,effectiveAllowSpaces:ae,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:te,allow:ee,shouldShow:ne,shouldKeepDismissed:se,pluginKey:e}),props:QV({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:ie,dispatchExit:ce})})}var sH=oH;function cH({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r=`@`}){return{editor:e,char:r,pluginKey:new D,command:({editor:e,range:t,props:i})=>{var a,o;let s=e.view.state.selection.$to.nodeAfter;s!=null&&(a=s.text)!=null&&a.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:`text`,text:` `}]).run(),(o=e.view.dom.ownerDocument.defaultView)==null||(o=o.getSelection())==null||o.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}}function lH(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>cH({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function uH(e,t){let n=lH(e);return n.find(e=>e.char===t)||(n.length?n[0]:null)}var dH=Jp.create({name:`mention`,priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){return`${t?.char??`@`}${e.attrs.label??e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){return[`span`,A(this.HTMLAttributes,e.HTMLAttributes),`${n?.char??`@`}${t.attrs.label??t.attrs.id}`]},suggestions:[],suggestion:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute(`data-label`),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:`@`,parseHTML:e=>e.getAttribute(`data-mention-suggestion-char`),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=uH(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),[`span`,A({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=A({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return typeof i==`string`?[`span`,A({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},...$f({nodeName:`mention`,name:`@`,selfClosing:!0,allowedAttributes:[`id`,`label`,{name:`mentionSuggestionChar`,skipIfDefault:`@`}],parseAttributes:e=>{let t={},n=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i===`char`?`mentionSuggestionChar`:i]=a??o,r=n.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e===`mentionSuggestionChar`?`char`:e}="${t}"`).join(` `)}),renderText({node:e}){let t={options:this.options,node:e,suggestion:uH(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel===void 0?this.options.renderText(t):(console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),this.options.renderLabel(t))},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;if(!i)return!1;let o=new le,s=0;return t.doc.nodesBetween(a-1,a,(e,t)=>{if(e.type.name===this.name)return n=!0,o=e,s=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?``:o.attrs.mentionSuggestionChar,s,s+o.nodeSize),n})}},addProseMirrorPlugins(){return lH(this).map(oH)}});function fH(e,t){return dH.configure({HTMLAttributes:{class:`dw-mention`},renderText:({node:e})=>`@${e.attrs.label??e.attrs.id}`,suggestion:{char:`@`,allow:()=>!!t,findSuggestionMatch:t=>{let n=KV({...t,allowSpaces:!0});return n&&GP(n.query,e)?n:KV({...t,allowSpaces:!1})},items:async({query:n})=>{if(!t)return[];let r=WP(n,e,!!t.me).map(e=>({date:e})),i=(await t.search(n).catch(()=>[])).map(e=>({person:e}));return n.trim()?[...r,...i].slice(0,8):[...i.slice(0,6),...r]},render:Ij({label:e.mentions,empty:e.noPeople,toItem:t=>`person`in t?{label:t.person.label,description:t.person.hint,icon:`at`}:{label:HP(t.date.date,e),description:t.date.remind?`${e.dates.remindMe} · ${UP(t.date.date,e)}`:UP(t.date.date,e),icon:t.date.remind?`bell`:`calendar`},pick:(e,n)=>{`person`in n?e.command({id:n.person.id,label:n.person.label}):JP(e.editor,e.range,n.date,t?.me)}})}})}var pH=`flowchart LR - Idea --> Draft --> Review --> Published`,mH=null;function hH(e){return mH??=e().then(e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:document.documentElement.classList.contains(`dark`)?`dark`:`neutral`,fontFamily:`inherit`}),e)),mH}var gH=0;async function _H(e,t,n,r){if(e.classList.remove(`dw-mermaid__body--error`),!t.trim())e.textContent=``;else if(r)try{let{svg:n}=await(await hH(r)).render(`dw-mermaid-${++gH}`,t);e.innerHTML=n}catch(t){e.classList.add(`dw-mermaid__body--error`),e.textContent=`${n.blocks.mermaidError} ${t instanceof Error?t.message:String(t)}`}else{let n=document.createElement(`pre`);n.className=`dw-mermaid__source`,n.textContent=t,e.replaceChildren(n)}}var vH=Jp.create({name:`mermaid`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null,load:void 0}},addAttributes(){return{code:{default:``,parseHTML:e=>e.getAttribute(`data-code`)??e.textContent??``,renderHTML:e=>({"data-code":e.code})}}},parseHTML(){return[{tag:`div[data-type='mermaid']`},{tag:`pre.mermaid`}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,A(t,{"data-type":`mermaid`}),[`pre`,{},String(e.attrs.code)]]},addCommands(){return{insertMermaid:(e=pH)=>({commands:t})=>t.insertContent({type:this.name,attrs:{code:e}})}},addNodeView(){return({node:e,editor:t,getPos:n})=>{let r=this.options.labels,i=this.options.load,a=document.createElement(`div`);a.className=`dw-mermaid`,a.setAttribute(`data-type`,`mermaid`);let o=document.createElement(`div`);o.className=`dw-mermaid__body`,a.append(o);let s=String(e.attrs.code);return _H(o,s,r,i),a.addEventListener(`click`,()=>{if(!t.isEditable)return;let e=typeof n==`function`?n():void 0;if(e===void 0)return;let c=r.blocks;cF({anchor:a,value:s,label:c.mermaid,multiline:!0,monospace:!0,labels:{done:c.done,cancel:c.cancel,remove:c.remove},onInput:e=>void _H(o,e,r,i),onSave:n=>{t.chain().setNodeSelection(e).updateAttributes(`mermaid`,{code:n}).run(),_H(o,n,r,i)},onRemove:()=>t.chain().setNodeSelection(e).deleteSelection().focus().run(),onCancel:()=>void _H(o,s,r,i)})}),{dom:a,update:e=>e.type.name===`mermaid`&&(e.attrs.code!==s&&(s=String(e.attrs.code),_H(o,s,r,i)),!0),ignoreMutation:()=>!0,stopEvent:()=>!1}}}}),yH=e=>`/p/${encodeURIComponent(e)}`,bH=/^\/p\/([A-Za-z0-9_-]+)\/?(?:[?#].*)?$/;function xH(e){return bH.exec(e)?.[1]??``}function SH(e,t,n,r=`Untitled`){let i=`${n.icon?`${n.icon} `:``}${n.title||r}`;e.chain().focus().deleteRange(t).insertContent([{type:`text`,text:i,marks:[{type:`link`,attrs:{href:yH(n.id)}}]},{type:`text`,text:` `}]).run()}async function CH(e,t,n){if(!t.create)return;let{from:r,to:i,empty:a}=e.state.selection,o=a?``:e.state.doc.textBetween(r,i,` `).trim().slice(0,200),s=await t.create(o);a||!o?SH(e,{from:r,to:r},s,n):e.chain().focus().setTextSelection({from:r,to:i}).setLink({href:yH(s.id)}).run()}var wH=Tp.create({name:`pageLinks`,addOptions(){return{host:void 0,labels:null,onNavigate:void 0}},addProseMirrorPlugins(){let{host:e,onNavigate:t}=this.options,n=this.options.labels,r=[];return e&&r.push(sH({editor:this.editor,pluginKey:new D(`pageLinks`),char:`[[`,allowSpaces:!0,allow:({state:e,range:t})=>!e.doc.resolve(t.from).parent.type.spec.code,items:async({query:t})=>(await e.search(t).catch(()=>[])).slice(0,8),render:Ij({label:n.pageLinks,empty:n.noPages,toItem:e=>({label:`${e.icon?`${e.icon} `:``}${e.title||`…`}`,description:e.hint,icon:`page`}),pick:(e,t)=>SH(e.editor,e.range,t)})})),t&&r.push(new E({key:new D(`pageLinkClicks`),props:{handleClick:(e,n,r)=>{let i=(r.target?.closest?.(`a[href]`))?.getAttribute(`href`)??``;return!xH(i)||e.editable&&!(r.ctrlKey||r.metaKey)?!1:(r.preventDefault(),t(i),!0)}}})),r}});function TH(e){return new Promise(t=>{let n=document.createElement(`input`);n.type=`file`,n.accept=e,n.multiple=!0,n.onchange=()=>t([...n.files??[]]),n.click()})}function EH(e,t,n,r,i=!1,a){let o=(t,n,r,i)=>({id:t,icon:n,keywords:r,label:e.slash[t]?.label??t,description:e.slash[t]?.description??``,run:i}),s=[o(`text`,`text`,[`paragraph`,`p`],(e,t)=>e.chain().focus().deleteRange(t).setParagraph().run()),o(`h1`,`heading`,[`heading`,`title`,`#`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:1}).run()),o(`h2`,`heading`,[`heading`,`subtitle`,`##`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:2}).run()),o(`h3`,`heading`,[`heading`,`###`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:3}).run()),...[4,5,6].map(e=>o(`h${e}`,`heading`,[`heading`,`other headings`,`#`.repeat(e)],(t,n)=>t.chain().focus().deleteRange(n).setHeading({level:e}).run())),o(`bullet`,`list`,[`list`,`ul`,`-`],(e,t)=>e.chain().focus().deleteRange(t).toggleBulletList().run()),o(`ordered`,`list-ordered`,[`list`,`ol`,`1.`],(e,t)=>e.chain().focus().deleteRange(t).toggleOrderedList().run()),o(`todo`,`todo`,[`task`,`checkbox`,`checklist`,`[]`],(e,t)=>e.chain().focus().deleteRange(t).toggleTaskList().run()),o(`callout`,`callout`,[`note`,`info`,`tip`,`warning`,`aside`,`box`],(e,t)=>e.chain().focus().deleteRange(t).setCallout().run()),o(`table`,`table`,[`grid`,`rows`,`columns`,`spreadsheet`],(e,t)=>e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()),o(`quote`,`quote`,[`blockquote`,`>`],(e,t)=>e.chain().focus().deleteRange(t).toggleBlockquote().run()),o(`code`,`code`,[`codeblock`,"```",`snippet`],(e,t)=>e.chain().focus().deleteRange(t).toggleCodeBlock().run()),o(`toggle`,`chevron-right`,[`details`,`collapse`,`expand`,`fold`,`>`],(e,t)=>e.chain().focus().deleteRange(t).setDetails().run()),o(`divider`,`divider`,[`hr`,`rule`,`line`,`---`],(e,t)=>e.chain().focus().deleteRange(t).setHorizontalRule().run()),o(`toc`,`list`,[`contents`,`outline`,`headings`,`index`],(e,t)=>e.chain().focus().deleteRange(t).insertTableOfContents().run()),o(`math`,`sigma`,[`latex`,`formula`,`equation`,`katex`,`$$`],(e,t)=>e.chain().focus().deleteRange(t).insertBlockMath({latex:`E = mc^2`}).run()),o(`mathInline`,`sigma`,[`latex`,`formula`,`equation`,`$`],(e,t)=>e.chain().focus().deleteRange(t).insertInlineMath({latex:`x^2`}).run()),o(`mermaid`,`diagram`,[`diagram`,`flowchart`,`chart`,`sequence`,`graph`],(e,t)=>e.chain().focus().deleteRange(t).insertMermaid().run()),o(`embed`,`video`,[`video`,`youtube`,`vimeo`,`figma`,`loom`,`iframe`,`map`],(t,r)=>{t.chain().focus().deleteRange(r).run(),mF(t,e,a,n)}),o(`linkCard`,`link`,[`bookmark`,`preview`,`card`,`url`,`web`],(t,r)=>{t.chain().focus().deleteRange(r).run(),hF(t,e,a,n)})],c=e=>{let t=new Date;return RP(new Date(t.getFullYear(),t.getMonth(),t.getDate()+e))};if(s.push(o(`today`,`calendar`,[`date`,`day`],(e,t)=>JP(e,t,{date:c(0),remind:!1})),o(`tomorrow`,`calendar`,[`date`,`day`],(e,t)=>JP(e,t,{date:c(1),remind:!1})),o(`yesterday`,`calendar`,[`date`,`day`],(e,t)=>JP(e,t,{date:c(-1),remind:!1})),o(`now`,`clock`,[`time`,`date`,`timestamp`],(t,n)=>{JP(t,n,{date:c(0),remind:!1});let r=new Intl.DateTimeFormat(e.locale,{hour:`numeric`,minute:`2-digit`}).format(new Date);t.chain().focus().insertContent(`${r} `).run()})),r&&(s.push(o(`pageLink`,`link`,[`page`,`link`,`[[`,`wiki`],(e,t)=>e.chain().focus().deleteRange(t).insertContent(`[[`).run())),r.create&&s.push(o(`newPage`,`page-plus`,[`page`,`doc`,`subpage`,`create`],(e,t)=>{e.chain().focus().deleteRange(t).run(),CH(e,r,``).catch(n)}))),t?.upload){let e=e=>(r,i)=>{r.chain().focus().deleteRange(i).run(),TH(e).then(e=>xF(r,t,e).catch(n))};s.push(o(`image`,`image`,[`picture`,`photo`,`img`],e(`image/*`)),o(`file`,`paperclip`,[`attachment`,`upload`,`pdf`],e(``)),o(`drawio`,`diagram`,[`diagram`,`diagrams.net`,`draw`,`chart`,`uml`],(e,t)=>e.chain().focus().deleteRange(t).insertDiagram(`drawio`).run())),i&&s.push(o(`excalidraw`,`pencil`,[`drawing`,`sketch`,`whiteboard`,`draw`],(e,t)=>e.chain().focus().deleteRange(t).insertDiagram(`excalidraw`).run()))}return s}function DH(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.label.toLowerCase().includes(n)||e.id.startsWith(n)||e.keywords.some(e=>e.toLowerCase().startsWith(n))):e}var OH=Tp.create({name:`slashMenu`,addOptions(){return{commands:[],labels:void 0}},addProseMirrorPlugins(){return[sH({editor:this.editor,pluginKey:new D(`slashMenu`),char:`/`,allowSpaces:!1,startOfLine:!1,allow:({state:e,range:t})=>!e.doc.resolve(t.from).parent.type.spec.code,items:({query:e})=>DH(this.options.commands,e),render:Ij({label:this.options.labels.slashMenu,empty:this.options.labels.noMatches,showQuery:!0,toItem:e=>({label:e.label,description:e.description,icon:e.icon}),pick:(e,t)=>t.run(e.editor,e.range)})})]}});function kH(e){let t=!0;return e.forEach(e=>e.forEach(e=>t&&=(e.attrs.rowspan??1)<=1)),t}function AH(e,t,n,r){let i=e.doc.nodeAt(t);if(!i||i.type.name!==`table`||!kH(i))return null;let a=[];if(i.forEach(e=>a.push(e)),n===r||n<0||r<0||n>=a.length||r>=a.length)return null;let[o]=a.splice(n,1);a.splice(r,0,o);let c=e.tr.replaceWith(t,t+i.nodeSize,i.copy(s.fromArray(a))),l=t+1;for(let e=0;e0;e--)if(n.node(e).type.name===`table`)return{tablePos:n.before(e),index:n.index(e)};return null}var MH=Tp.create({name:`tableRows`,addOptions(){return{labels:null}},addCommands(){return{moveTableRow:e=>({state:t,dispatch:n})=>{let r=jH(t,t.selection.from);if(!r)return!1;let i=AH(t,r.tablePos,r.index,r.index+e);return i?(n?.(i),!0):!1}}},addKeyboardShortcuts(){return{"Mod-Alt-ArrowUp":()=>this.editor.commands.moveTableRow(-1),"Mod-Alt-ArrowDown":()=>this.editor.commands.moveTableRow(1)}},addProseMirrorPlugins(){let e=this.options.labels?.table.dragRow??`Drag to move the row`;return[new E({key:new D(`tableRows`),view:t=>new NH(t,e)})]}}),NH=class{view;grip=document.createElement(`button`);line=document.createElement(`div`);row=null;drag=null;constructor(e,t){this.view=e;let n=this.grip;n.type=`button`,n.className=`dw-row-grip`,n.contentEditable=`false`,n.setAttribute(`aria-label`,t),n.title=t,n.hidden=!0,n.tabIndex=-1,n.addEventListener(`pointerdown`,this.start),n.addEventListener(`mouseleave`,this.leave),this.line.className=`dw-row-drop`,this.line.hidden=!0,e.dom.addEventListener(`mousemove`,this.move),e.dom.addEventListener(`mouseleave`,this.leave)}get host(){let e=this.view.dom.parentElement;return e&&this.grip.parentElement!==e&&(e.classList.add(`dw-block-host`),e.append(this.grip,this.line)),e}hide=()=>{this.drag||(this.grip.hidden=!0,this.row=null)};leave=e=>{let t=e.relatedTarget;t&&(this.grip.contains(t)||this.view.dom.contains(t))||this.hide()};move=e=>{if(this.drag)return;let t=e.target?.closest?.(`tr`),n=this.host;if(!this.view.editable||!n||!(t instanceof HTMLTableRowElement)||!this.view.dom.contains(t))return this.hide();let r=this.locate(t),i=r&&this.view.state.doc.nodeAt(r.tablePos);if(!r||!i||i.childCount<2||!kH(i))return this.hide();this.row=t;let a=t.getBoundingClientRect(),o=n.getBoundingClientRect();Object.assign(this.grip.style,{top:`${a.top-o.top+a.height/2-11}px`,left:`${a.left-o.left-7}px`}),this.grip.hidden=!1};locate(e){try{return jH(this.view.state,this.view.posAtDOM(e,0))}catch{return null}}start=e=>{if(!this.row||e.button!==0)return;let t=this.locate(this.row),n=this.row.parentElement;if(!t||!n)return;e.preventDefault(),this.grip.setPointerCapture(e.pointerId);let r=[...n.children].filter(e=>e instanceof HTMLTableRowElement);this.drag={tablePos:t.tablePos,from:t.index,rows:r,to:t.index},this.row.classList.add(`dw-row-dragging`),this.grip.addEventListener(`pointermove`,this.dragMove),this.grip.addEventListener(`pointerup`,this.drop),this.grip.addEventListener(`pointercancel`,this.cancel)};dragMove=e=>{let t=this.drag,n=this.host;if(!t||!n)return;let r=t.rows.length;for(let[n,i]of t.rows.entries()){let t=i.getBoundingClientRect();if(e.clientYt.from?r-1:r;let i=n.getBoundingClientRect(),a=t.rows[0].getBoundingClientRect(),o=r{let e=this.drag;if(this.cancel(),!e||e.to===e.from)return;let t=AH(this.view.state,e.tablePos,e.from,e.to);t&&this.view.dispatch(t),this.view.focus()};cancel=()=>{this.row?.classList.remove(`dw-row-dragging`),this.drag=null,this.line.hidden=!0,this.grip.removeEventListener(`pointermove`,this.dragMove),this.grip.removeEventListener(`pointerup`,this.drop),this.grip.removeEventListener(`pointercancel`,this.cancel),this.hide()};update(){this.row&&!this.row.isConnected&&this.hide()}destroy(){this.cancel(),this.grip.remove(),this.line.remove(),this.view.dom.removeEventListener(`mousemove`,this.move),this.view.dom.removeEventListener(`mouseleave`,this.leave)}};function PH(e){let t=[];return e.descendants((e,n)=>e.type.name!==`heading`||(t.push({level:Number(e.attrs.level)||1,text:e.textContent.trim(),pos:n}),!1)),t}function FH(e,t){let n=e.view.nodeDOM(t);n instanceof HTMLElement&&n.scrollIntoView({behavior:`smooth`,block:`start`}),e.isEditable&&e.commands.setTextSelection(t+1)}var IH=Jp.create({name:`tableOfContents`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},parseHTML(){return[{tag:`nav[data-type='toc']`}]},renderHTML(){return[`nav`,{"data-type":`toc`}]},addCommands(){return{insertTableOfContents:()=>({commands:e})=>e.insertContent({type:this.name})}},addNodeView(){return({editor:e})=>{let t=this.options.labels.blocks,n=document.createElement(`nav`);n.className=`dw-toc`,n.setAttribute(`data-type`,`toc`),n.setAttribute(`aria-label`,t.toc),n.contentEditable=`false`;let r=document.createElement(`p`);r.className=`dw-toc__title`,r.textContent=t.toc;let i=document.createElement(`ol`);i.className=`dw-toc__list`,n.append(r,i);let a=``,o=()=>{let n=PH(e.state.doc),r=JSON.stringify(n.map(e=>[e.level,e.text]));if(r===a){i.querySelectorAll(`a`).forEach((e,t)=>e.dataset.pos=String(n[t]?.pos??0));return}if(a=r,i.replaceChildren(),!n.length){let e=document.createElement(`li`);e.className=`dw-toc__empty`,e.textContent=t.tocEmpty,i.append(e);return}let o=Math.min(...n.map(e=>e.level));for(let t of n){let n=document.createElement(`li`);n.style.paddingLeft=`${(t.level-o)*1}rem`;let r=document.createElement(`a`);r.href=`#`,r.textContent=t.text||`…`,r.dataset.pos=String(t.pos),r.addEventListener(`click`,t=>{t.preventDefault(),FH(e,Number(r.dataset.pos))}),n.append(r),i.append(n)}};return o(),e.on(`update`,o),{dom:n,update:e=>e.type.name===`tableOfContents`,ignoreMutation:()=>!0,stopEvent:e=>e.target instanceof Element&&!!e.target.closest(`a`),destroy:()=>e.off(`update`,o)}}}}),LH=(e,t)=>{let n=t.view.domAtPos(e).node,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;return r?r.offsetParent!==null:!1},RH=(e,t,n)=>{for(let r=e.depth;r>0;--r){let i=e.node(r),a=t(i),o=LH(e.start(r),n);if(a&&o)return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:i}}},zH=(e,t)=>{let{state:n,view:r,extensionManager:i}=e,{schema:a,selection:o}=n,{empty:s,$anchor:c}=o,l=!!i.extensions.find(e=>e.name===`gapCursor`);if(!s||c.parent.type!==a.nodes.detailsSummary||!l||t===`right`&&c.parentOffset!==c.parent.nodeSize-2)return!1;let u=yu(e=>e.type===a.nodes.details)(o);if(!u)return!1;let d=gu(u.node,e=>e.type===a.nodes.detailsContent);if(!d.length||LH(u.start+d[0].pos+1,e))return!1;let f=n.doc.resolve(u.pos+u.node.nodeSize),p=Nw.findFrom(f,1,!1);if(!p)return!1;let{tr:m}=n,h=new Nw(p);return m.setSelection(h),m.scrollIntoView(),r.dispatch(m),!0},BH=Jp.create({name:`details`,content:`detailsSummary detailsContent`,group:`block`,defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:`is-open`,HTMLAttributes:{},renderToggleButton:({element:e,isOpen:t})=>{e.setAttribute(`aria-label`,t?`Collapse details content`:`Expand details content`)}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:e=>e.hasAttribute(`open`),renderHTML:({open:e})=>e?{open:``}:{}}}:[]},parseHTML(){return[{tag:`details`}]},renderHTML({HTMLAttributes:e}){return[`details`,A(this.options.HTMLAttributes,e),0]},...Xf({nodeName:`details`,content:`block`}),addNodeView(){return({editor:e,getPos:t,node:n,HTMLAttributes:r})=>{let i=document.createElement(`div`),a=A(this.options.HTMLAttributes,r,{"data-type":this.name});Object.entries(a).forEach(([e,t])=>i.setAttribute(e,t));let o=document.createElement(`button`);o.type=`button`;let s=e=>{this.options.renderToggleButton({element:o,...e})};i.append(o);let c=document.createElement(`div`);i.append(c);let l=e=>{let{setToValue:t,node:r=n}=e||{};if(t!==void 0){if(t){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}}else i.classList.toggle(this.options.openClassName);let a=i.classList.contains(this.options.openClassName);s({isOpen:a,node:r});let o=new Event(`toggleDetailsContent`);c.querySelector(`:scope > div[data-type="detailsContent"]`)?.dispatchEvent(o)};return s({isOpen:!!n.attrs.open,node:n}),n.attrs.open&&setTimeout(()=>l()),o.addEventListener(`click`,()=>{if(l(),!this.options.persist)e.commands.focus(void 0,{scrollIntoView:!1});else if(e.isEditable&&typeof t==`function`){let{from:n,to:r}=e.state.selection;e.chain().command(({tr:e})=>{let n=t();if(typeof n!=`number`)return!1;let r=e.doc.nodeAt(n);return r?.type===this.type&&(e.setNodeMarkup(n,void 0,{open:!r.attrs.open}),!0)}).setTextSelection({from:n,to:r}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:c,ignoreMutation(e){if(e.type===`selection`)return!1;let t=e.target,n=i.contains(t);return o.contains(t)||!n||i===t},update:e=>e.type===this.type&&(e.attrs.open===void 0?s({isOpen:i.classList.contains(this.options.openClassName),node:e}):l({setToValue:e.attrs.open,node:e}),!0)}}},addCommands(){return{setDetails:()=>({state:e,chain:t})=>{let{schema:n,selection:r}=e,{$from:i,$to:a}=r,o=i.blockRange(a);if(!o)return!1;let s=e.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(s.content))return!1;let c=s.toJSON()?.content||[];return t().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:`detailsSummary`},{type:`detailsContent`,content:c}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:e,chain:t})=>{let{selection:n,schema:r}=e,i=yu(e=>e.type===this.type)(n);if(!i)return!1;let a=gu(i.node,e=>e.type===r.nodes.detailsSummary),o=gu(i.node,e=>e.type===r.nodes.detailsContent);if(!a.length||!o.length)return!1;let s=a[0],c=o[0],l=i.pos,u=e.doc.resolve(l),d={from:l,to:l+i.node.nodeSize},f=c.node.content.toJSON()||[],p=[u.parent.type.contentMatch.defaultType?.create(null,s.node.content).toJSON(),...f];return t().insertContentAt(d,p).setTextSelection(l+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:e,selection:t}=this.editor.state,{empty:n,$anchor:r}=t;return!n||r.parent.type!==e.nodes.detailsSummary?!1:r.parentOffset===0?this.editor.commands.unsetDetails():this.editor.commands.command(({tr:e})=>{let t=r.pos-1,n=r.pos;return e.delete(t,n),!0})},Enter:({editor:e})=>{let{state:t,view:n}=e,{schema:r,selection:i}=t,{$head:a}=i;if(a.parent.type!==r.nodes.detailsSummary)return!1;let o=LH(a.after()+1,e),s=o?t.doc.nodeAt(a.after()):a.node(-2);if(!s)return!1;let c=o?0:a.indexAfter(-1),l=Ll(s.contentMatchAt(c));if(!l||!s.canReplaceWith(c,c,l))return!1;let u=l.createAndFill();if(!u)return!1;let d=o?a.after()+1:a.after(-1),f=t.tr.replaceWith(d,d,u),p=f.doc.resolve(d),m=C.near(p,1);return f.setSelection(m),f.scrollIntoView(),n.dispatch(f),!0},ArrowRight:({editor:e})=>zH(e,`right`),ArrowDown:({editor:e})=>zH(e,`down`)}},addProseMirrorPlugins(){return[new E({key:new D(`detailsSelection`),appendTransaction:(e,t,n)=>{let{editor:r,type:i}=this;if(r.view.composing||!e.some(e=>e.selectionSet)||!t.selection.empty||!n.selection.empty||!sd(n,i.name))return;let{$from:a}=n.selection;if(LH(a.pos,r))return;let o=RH(a,e=>e.type===i,r);if(!o)return;let s=gu(o.node,e=>e.type===n.schema.nodes.detailsSummary);if(!s.length)return;let c=s[0],l=(t.selection.from{let t=document.createElement(`div`),n=A(this.options.HTMLAttributes,e,{"data-type":this.name,hidden:`hidden`});return Object.entries(n).forEach(([e,n])=>t.setAttribute(e,n)),t.addEventListener(`toggleDetailsContent`,()=>{t.toggleAttribute(`hidden`)}),{dom:t,contentDOM:t,ignoreMutation(e){return e.type===`selection`?!1:!t.contains(e.target)||t===e.target},update:e=>e.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t,{$from:i,empty:a}=r,o=yu(e=>e.type===this.type)(r);if(!a||!o||!o.node.childCount)return!1;let s=i.index(o.depth),{childCount:c}=o.node;if(c!==s+1)return!1;let l=o.node.type.contentMatch.defaultType?.createAndFill();if(!l)return!1;let u=t.doc.resolve(o.pos+1),d=c-1,f=o.node.child(d),p=u.posAtIndex(d,o.depth);if(!f.eq(l))return!1;let m=i.node(-3);if(!m)return!1;let h=i.indexAfter(-3),g=Ll(m.contentMatchAt(h));if(!g||!m.canReplaceWith(h,h,g))return!1;let _=g.createAndFill();if(!_)return!1;let{tr:v}=t,y=i.after(-2);v.replaceWith(y,y,_);let b=v.doc.resolve(y),x=C.near(b,1);v.setSelection(x);let S=p,ee=p+f.nodeSize;return v.delete(S,ee),v.scrollIntoView(),n.dispatch(v),!0}}},...Xf({nodeName:`detailsContent`})}),HH=Jp.create({name:`detailsSummary`,content:`text*`,defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`summary`}]},renderHTML({HTMLAttributes:e}){return[`summary`,A(this.options.HTMLAttributes,e),0]},...Xf({nodeName:`detailsSummary`,content:`inline`})});function UH(e){return[BH.configure({persist:!1,HTMLAttributes:{class:`dw-toggle`},renderToggleButton:({element:t,isOpen:n})=>{t.setAttribute(`aria-label`,n?e.blocks.collapse:e.blocks.expand),t.setAttribute(`aria-expanded`,String(n))}}),HH,VH]}function WH(e={}){let t=e.labels??NF,n=null,r=Tp.create({name:`editorRef`,onCreate(){n=this.editor}}),i={host:e.files,labels:t,drawioUrl:e.drawioUrl,loadExcalidraw:e.loadExcalidraw,onError:e.onError},a=[r,Hk.configure({heading:{levels:[1,2,3,4,5,6]},codeBlock:!1,link:{openOnClick:!1,autolink:!0},undoRedo:!e.collab&&void 0}),lT.configure({placeholder:e.placeholder??`Type '/' for commands…`}),SF.configure({host:e.files}),wF.configure({host:e.files,loadPdf:e.loadPdf,labels:t}),Aj.configure({lineNumbers:e.codeLineNumbers??!1}),xP,bP,DP,OP,...vP(),...yP(),MH.configure({labels:t}),jP.configure({labels:t}),TF.configure({host:e.files,onError:e.onError}),fH(t,e.mentions),KP.configure({labels:t,me:()=>e.mentions?.me}),OH.configure({commands:EH(t,e.files,e.onError,e.pages,!!e.loadExcalidraw,e.links),labels:t}),IP.configure({onSelect:e.onCommentSelect}),GV(t,()=>n),vH.configure({labels:t,load:e.loadMermaid}),IH.configure({labels:t}),aF.configure(i),oF.configure(i),wH.configure({host:e.pages,labels:t,onNavigate:e.onNavigate}),...UH(t),_F.configure({labels:t}),vF.configure({labels:t}),qj.configure({labels:t,link:e.blockLink,onCopied:e.onBlockLinkCopied}),MF];return e.collab&&a.push(Tw.configure({document:e.collab.provider.doc}),Aw.configure({provider:e.collab.provider,user:e.collab.user,render:GH})),a}function GH(e){let t=typeof e.color==`string`&&/^#[0-9a-f]{3,8}$/i.test(e.color)?e.color:`#888`,n=document.createElement(`span`);n.classList.add(`collaboration-carets__caret`),n.style.borderColor=t;let r=document.createElement(`div`);return r.classList.add(`collaboration-carets__label`),r.setAttribute(`aria-hidden`,`true`),r.style.backgroundColor=t,r.textContent=typeof e.name==`string`?e.name:``,n.append(r),n}var KH=3e4,qH=class extends um{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=Mh();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&JH(this,t,`timeout`)},dm(KH/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Mh()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),Qh(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},JH=(e,t,n)=>{let r=[];for(let n=0;n0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},YH=(e,t,n=e.states)=>{let r=t.length,i=Mm();j(i,r);for(let a=0;a{let r=fh(t),i=Mh(),a=[],o=[],s=[],c=[],l=M(r);for(let t=0;t0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},ZH=(e,t)=>{j(e,0),Wm(e,Gv(t))},QH=(e,t,n)=>{j(e,1),Wm(e,zv(t,n))},$H=(e,t,n)=>QH(t,n,hh(e)),eU=(e,t,n,r)=>{try{Iv(t,hh(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},tU=(e,t)=>{j(e,2),Wm(e,t)},nU=eU,rU=(e,t,n,r,i)=>{let a=M(e);switch(a){case 0:$H(e,t,n);break;case 1:eU(e,n,r,i);break;case 2:nU(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},iU=0,aU=1,oU=4401,sU=4404,cU=4409,lU=class{opts;doc=new bv;awareness=new qH(this.doc);status=`connecting`;synced=!1;ws=null;retries=0;retryTimer;destroyed=!1;listeners=new Set;constructor(e){this.opts=e,this.doc.on(`update`,this.onDocUpdate),this.awareness.on(`update`,this.onAwarenessUpdate),window.addEventListener(`beforeunload`,this.onUnload),this.connect()}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.destroyed||(this.destroyed=!0,this.listeners.clear(),clearTimeout(this.retryTimer),window.removeEventListener(`beforeunload`,this.onUnload),JH(this.awareness,[this.doc.clientID],`local`),this.doc.off(`update`,this.onDocUpdate),this.awareness.off(`update`,this.onAwarenessUpdate),this.ws?.close(),this.awareness.destroy(),this.doc.destroy(),this.listeners.clear())}set(e,t=this.synced){(e!==this.status||t!==this.synced)&&(this.status=e,this.synced=t,this.listeners.forEach(e=>e()))}connect(){let e=new WebSocket(`${this.opts.url}?page=${encodeURIComponent(this.opts.page)}`);e.binaryType=`arraybuffer`,this.ws=e,e.onopen=()=>{e.send(this.opts.token()??``);let t=Mm();j(t,iU),ZH(t,this.doc),e.send(Fm(t)),this.awareness.getLocalState()!==null&&this.sendAwareness([this.doc.clientID])},e.onmessage=e=>this.onMessage(new Uint8Array(e.data)),e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=[...this.awareness.getStates().keys()].filter(e=>e!==this.doc.clientID);JH(this.awareness,n,this),this.destroyed||(t.code===oU||t.code===sU?this.set(`denied`,!1):t.code===cU?this.set(`changed`):(this.set(`offline`),this.retryTimer=setTimeout(()=>this.connect(),Math.min(1e3*2**this.retries++,3e4))))}}onMessage(e){let t=fh(e),n=M(t);if(n===iU){let e=Mm();j(e,iU);let n=rU(t,e,this.doc,this);Pm(e)>1&&this.ws?.send(Fm(e)),n===1&&(this.retries=0,this.set(`connected`,!0))}else n===aU&&XH(this.awareness,hh(t),this)}onDocUpdate=(e,t)=>{if(t===this||this.ws?.readyState!==WebSocket.OPEN)return;let n=Mm();j(n,iU),tU(n,e),this.ws.send(Fm(n))};onAwarenessUpdate=({added:e,updated:t,removed:n},r)=>{r!==this&&this.sendAwareness([...e,...t,...n])};sendAwareness(e){if(this.ws?.readyState!==WebSocket.OPEN)return;let t=Mm();j(t,aU),Wm(t,YH(this.awareness,e)),this.ws.send(Fm(t))}onUnload=()=>JH(this.awareness,[this.doc.clientID],`unload`)},uU={bold:e=>e.chain().focus().toggleBold().run(),italic:e=>e.chain().focus().toggleItalic().run(),strike:e=>e.chain().focus().toggleStrike().run(),code:e=>e.chain().focus().toggleCode().run(),heading1:e=>e.chain().focus().toggleHeading({level:1}).run(),heading2:e=>e.chain().focus().toggleHeading({level:2}).run(),heading3:e=>e.chain().focus().toggleHeading({level:3}).run(),bulletList:e=>e.chain().focus().toggleBulletList().run(),orderedList:e=>e.chain().focus().toggleOrderedList().run(),blockquote:e=>e.chain().focus().toggleBlockquote().run(),codeBlock:e=>e.chain().focus().toggleCodeBlock().run(),underline:e=>e.chain().focus().toggleUnderline().run(),taskList:e=>e.chain().focus().toggleTaskList().run(),callout:e=>e.isActive(`callout`)?e.chain().focus().unsetCallout().run():e.chain().focus().setCallout().run(),table:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),undo:e=>e.chain().focus().undo().run(),redo:e=>e.chain().focus().redo().run()},dU=[[`bold`,e=>e.isActive(`bold`)],[`italic`,e=>e.isActive(`italic`)],[`strike`,e=>e.isActive(`strike`)],[`code`,e=>e.isActive(`code`)],[`heading1`,e=>e.isActive(`heading`,{level:1})],[`heading2`,e=>e.isActive(`heading`,{level:2})],[`heading3`,e=>e.isActive(`heading`,{level:3})],[`bulletList`,e=>e.isActive(`bulletList`)],[`orderedList`,e=>e.isActive(`orderedList`)],[`blockquote`,e=>e.isActive(`blockquote`)],[`codeBlock`,e=>e.isActive(`codeBlock`)],[`underline`,e=>e.isActive(`underline`)],[`taskList`,e=>e.isActive(`taskList`)],[`callout`,e=>e.isActive(`callout`)],[`table`,e=>e.isActive(`table`)]],fU=class{el;send;editor;provider=null;lastState=``;editable=!0;constructor(e,t){this.el=e,this.send=t,this.editor=this.create({}),t({type:`ready`,version:2})}receive(e){try{let t=typeof e==`string`?JSON.parse(e):e;this.handle(t)}catch(e){this.send({type:`error`,message:e instanceof Error?e.message:String(e)})}}get content(){return this.editor.getJSON()}destroy(){this.editor.destroy(),this.provider?.destroy()}handle(e){switch(e.type){case`hello`:this.send({type:`ready`,version:2}),this.lastState=``,this.reportState(this.editor);return;case`setContent`:this.editor.commands.setContent(e.content??``,{emitUpdate:!1}),this.reportState(this.editor);return;case`setEditable`:this.editable=e.editable,this.editor.setEditable(e.editable);return;case`setTheme`:document.documentElement.classList.toggle(`dark`,e.dark);return;case`setLayout`:{let t=document.documentElement.classList;t.toggle(`dw-full-width`,e.fullWidth),t.toggle(`dw-font-serif`,e.font===`serif`),t.toggle(`dw-font-mono`,e.font===`mono`);return}case`command`:{let t=uU[e.command];if(!t)throw Error(`unknown command ${e.command}`);t(this.editor);return}case`focus`:this.editor.commands.focus();return;case`blur`:this.editor.commands.blur();return;case`connect`:this.connect(e);return;default:throw Error(`unknown message ${e.type}`)}}connect(e){this.provider?.destroy();let t=new lU({url:e.url,page:e.page,token:()=>e.token});t.onChange(()=>this.send({type:`collab`,status:t.status})),this.provider=t,this.editor.destroy(),this.editor=this.create({collab:{provider:t,user:e.user}})}create(e){return this.el.replaceChildren(),new Vp({element:this.el,editable:this.editable,extensions:WH({...e,onNavigate:e=>this.send({type:`navigate`,path:e})}),editorProps:{attributes:{class:`dw-prose`}},onUpdate:({editor:e})=>this.send({type:`change`,content:e.getJSON()}),onSelectionUpdate:({editor:e})=>this.reportState(e),onTransaction:({editor:e})=>this.reportState(e),onFocus:({editor:e})=>this.reportState(e),onBlur:({editor:e})=>this.reportState(e)})}reportState(e){let t={active:dU.filter(([,t])=>t(e)).map(([e])=>e),canUndo:e.can().undo(),canRedo:e.can().redo(),focused:e.isFocused},n=JSON.stringify(t);n!==this.lastState&&(this.lastState=n,this.send({type:`state`,state:t}))}};function pU(e){let t=JSON.stringify(e);window.DocwellNative?window.DocwellNative.postMessage(t):(window.parent.postMessage(t,`*`),console.debug(`[docwell bridge]`,e))}var mU=new fU(document.getElementById(`editor`),pU);window.docwell={receive:e=>mU.receive(e)}; +?)[ \r ]*`,hV=`[̀-ͯ]`,gV=RegExp(hV+`+$`),_V=`(`+uV+`+)|`+(mV+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(hV+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(hV+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+pV)+(`|`+fV+`)`),vV=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(_V,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new vB(`EOF`,new _B(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new I(`Unexpected character: '`+e[t]+`'`,new vB(e[t],new _B(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new vB(r,new _B(this,t,this.tokenRegex.lastIndex))}},yV=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new I(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},bV=gB;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var xV={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new I("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=xV[t.text],r==null||r>=n)throw new I(`Invalid base-`+n+` digit `+t.text);for(var i;(i=xV[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new I(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new I(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new I(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new I(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>SV(e,!1,!0,!1)),$(`\\renewcommand`,e=>SV(e,!0,!1,!1)),$(`\\providecommand`,e=>SV(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),lV[n],iL.math[n],iL.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var CV={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},wV=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in CV?t=CV[n]:(n.slice(0,4)===`\\not`||n in iL.math&&wV.has(iL.math[n].group))&&(t=`\\dotsb`),t});var TV={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in TV?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in TV&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in TV?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new I(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var EV=R(ZI[`Main-Regular`][84][1]-.7*ZI[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+EV+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+EV+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var DV=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,DV(!1)),$(`\\bra@set`,DV(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var OV={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},kV=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yV(bV,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new vV(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new vB(`EOF`,n.loc)),this.pushTokens(r),new vB(``,_B.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new I(`Extra }`,i)}else if(i.text===`EOF`)throw new I(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new I(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;rthis.settings.maxExpand)throw new I(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new I(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new I(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new I(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new vB(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new vV(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(lV,e)||Object.prototype.hasOwnProperty.call(iL.math,e)||Object.prototype.hasOwnProperty.call(iL.text,e)||Object.prototype.hasOwnProperty.call(OV,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(lV,e)&&!lV[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},AV=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,jV=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),MV={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},NV={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},PV=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new kV(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new I(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new vB(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&lV[i.text]&&lV[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r=128)this.settings.strict&&(mI(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:_B.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;ce.getAttribute(`data-latex`),renderHTML:e=>({"data-latex":e.latex})}}},addCommands(){return{insertBlockMath:e=>({commands:t,editor:n})=>{let{latex:r,pos:i}=e;return r?t.insertContentAt(i??n.state.selection.from,{type:this.name,attrs:{latex:r}}):!1},deleteBlockMath:e=>({editor:t,tr:n})=>{let r=e?.pos??t.state.selection.$from.pos,i=t.state.doc.nodeAt(r);return!i||i.type.name!==this.name?!1:(n.delete(r,r+i.nodeSize),!0)},updateBlockMath:e=>({editor:t,tr:n})=>{let r=e?.latex,i=e?.pos;i===void 0&&(i=t.state.selection.$from.pos);let a=t.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(n.setNodeMarkup(i,this.type,{...a.attrs,latex:r??a.attrs.latex}),!0)}}},parseHTML(){return[{tag:`div[data-type="block-math"]`}]},renderHTML({HTMLAttributes:e}){return[`div`,A(e,{"data-type":`block-math`})]},parseMarkdown:e=>({type:`blockMath`,attrs:{latex:e.latex}}),renderMarkdown:e=>[`$$`,e.attrs?.latex||``,`$$`].join(` +`),markdownTokenizer:{name:`blockMath`,level:`block`,start:e=>e.indexOf(`$$`),tokenize:e=>{let t=e.match(/^\$\$([^$]+)\$\$/);if(!t)return;let[n,r]=t;return{type:`blockMath`,raw:n,latex:r.trim()}}},addInputRules(){return[new lp({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:e,range:t,match:n})=>{let[,r]=n,{tr:i}=e,a=e.doc.resolve(t.from),o=this.type.create({latex:r}),s=a.depth>0&&a.parent.isTextblock&&t.from===a.start()&&t.to===a.end()&&a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),this.type)?{from:a.before(),to:a.after()}:t;i.replaceWith(s.from,s.to,o)}})]},addNodeView(){let{katexOptions:e}=this.options;return({node:t,getPos:n})=>{let r=document.createElement(`div`),i=document.createElement(`div`);r.className=`tiptap-mathematics-render`,this.editor.isEditable&&r.classList.add(`tiptap-mathematics-render--editable`),i.className=`block-math-inner`,r.dataset.type=`block-math`,r.setAttribute(`data-latex`,t.attrs.latex),r.appendChild(i);function a(){try{VV.render(t.attrs.latex,i,e),r.classList.remove(`block-math-error`)}catch{r.textContent=t.attrs.latex,r.classList.add(`block-math-error`)}}let o=e=>{e.preventDefault(),e.stopPropagation();let r=n();r!=null&&this.options.onClick&&this.options.onClick(t,r)};return this.options.onClick&&r.addEventListener(`click`,o),a(),{dom:r,destroy(){r.removeEventListener(`click`,o)}}}}}),UV=e=>{let t=/\$\$([^$\n]+?)\$\$(?!\$)/g,n=t.exec(e);for(;n!==null;){if(n.index===0||e[n.index-1]!==`$`)return{index:n.index,text:n[0],data:{latex:n[1]}};t.lastIndex=n.index+1,n=t.exec(e)}return null},WV=Jp.create({name:`inlineMath`,group:`inline`,inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`),renderHTML:e=>({"data-latex":e.latex})}}},addCommands(){return{insertInlineMath:e=>({editor:t,tr:n})=>{let r=e.latex,i=e?.pos??t.state.selection.from;return r?(n.replaceWith(i,i,this.type.create({latex:r})),!0):!1},deleteInlineMath:e=>({editor:t,tr:n})=>{let r=e?.pos??t.state.selection.$from.pos,i=t.state.doc.nodeAt(r);return!i||i.type.name!==this.name?!1:(n.delete(r,r+i.nodeSize),!0)},updateInlineMath:e=>({editor:t,tr:n})=>{let r=e?.latex,i=e?.pos;i===void 0&&(i=t.state.selection.$from.pos);let a=t.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(n.setNodeMarkup(i,this.type,{...a.attrs,latex:r}),!0)}}},parseHTML(){return[{tag:`span[data-type="inline-math"]`}]},renderHTML({HTMLAttributes:e}){return[`span`,A(e,{"data-type":`inline-math`})]},parseMarkdown:e=>({type:`inlineMath`,attrs:{latex:e.latex}}),renderMarkdown:e=>`$${e.attrs?.latex||``}$`,markdownTokenizer:{name:`inlineMath`,level:`inline`,start:e=>e.indexOf(`$`),tokenize:e=>{let t=e.match(/^\$([^$]+)\$(?!\$)/);if(!t)return;let[n,r]=t;return{type:`inlineMath`,raw:n,latex:r.trim()}}},addInputRules(){return[new lp({find:UV,handler:({state:e,range:t,match:n})=>{let r=n.data?.latex;if(typeof r!=`string`)return null;let{tr:i}=e,a=t.from,o=t.to;i.replaceWith(a,o,this.type.create({latex:r}))}})]},addNodeView(){let{katexOptions:e}=this.options;return({node:t,getPos:n})=>{let r=document.createElement(`span`);r.className=`tiptap-mathematics-render`,this.editor.isEditable&&r.classList.add(`tiptap-mathematics-render--editable`),r.dataset.type=`inline-math`,r.setAttribute(`data-latex`,t.attrs.latex);function i(){try{VV.render(t.attrs.latex,r,e),r.classList.remove(`inline-math-error`)}catch{r.textContent=t.attrs.latex,r.classList.add(`inline-math-error`)}}let a=e=>{e.preventDefault(),e.stopPropagation();let r=n();r!=null&&this.options.onClick&&this.options.onClick(t,r)};return this.options.onClick&&r.addEventListener(`click`,a),i(),{dom:r,destroy(){r.removeEventListener(`click`,a)}}}}}),GV=Tp.create({name:`Mathematics`,addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[HV.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),WV.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});function KV(e,t){let n=n=>(r,i)=>{let a=t();if(!a?.isEditable)return;let o=a.view.nodeDOM(i);if(!(o instanceof HTMLElement))return;let s=e.blocks;lF({anchor:o,value:String(r.attrs.latex??``),label:s.latex,multiline:n===`block`,monospace:!0,labels:{done:s.done,cancel:s.cancel,remove:s.remove},onSave:e=>{let t=a.chain().setNodeSelection(i);e.trim()?(n===`inline`?t.updateInlineMath({latex:e,pos:i}):t.updateBlockMath({latex:e,pos:i})).focus().run():(n===`inline`?t.deleteInlineMath({pos:i}):t.deleteBlockMath({pos:i})).focus().run()},onRemove:()=>{let e=a.chain();(n===`inline`?e.deleteInlineMath({pos:i}):e.deleteBlockMath({pos:i})).focus().run()}})};return GV.configure({katexOptions:{throwOnError:!1,strict:!1,trust:!1},inlineOptions:{onClick:n(`inline`)},blockOptions:{onClick:n(`block`)}})}function qV(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=kf(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.map(kf).join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function JV(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,` +`);return/\s/.test(n)}):!1}function YV(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function XV(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:YV(e)}function ZV({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!JV(r)}function QV({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function $V({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),xs.create(a.doc,[vs.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function eH({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(yf.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function tH({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function nH({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[Tj({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(Dj()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function rH(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function iH({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&rH(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=wj(c,o,()=>{Oj(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function aH({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=tH({editor:e,items:n}),v=nH({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,ee=b.query!==x.query,te=b.text!==x.text,ne=b.range.from!==x.range.from||b.range.to!==x.range.to,re=ee||te||ne;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&re)S=`updated`;else return;let ie=S===`stopped`?b:x,ae=n.dom.querySelector(`[data-decoration-id="${ie.decorationId}"]`),oe=m(n,ae),se=i===0||(ie.query?ie.query.length>=i:!1),ce=(S===`started`||S===`updated`)&&se;if(g={editor:e,range:ie.range,query:ie.query||``,text:ie.text||``,items:o??[],command:t=>p({editor:e,range:ie.range,props:t}),decorationNode:ae,clientRect:oe,loading:ce,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:iH({getReferenceRect:oe,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var le;r==null||(le=r.onBeforeStart)==null||le.call(r,g)}if(S===`updated`){var ue;r==null||(ue=r.onBeforeUpdate)==null||ue.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!ce)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(ie.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var oH=new D(`suggestion`);function sH({pluginKey:e=oH,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:ee=()=>!0,findSuggestionMatch:te=qV,shouldShow:ne,shouldResetDismissed:re}){let ie=S?.(),ae=r&&!i,oe=(n,r)=>XV(t,n,r,e);function se(e){return ZV({...e,editor:t,shouldResetDismissed:re,effectiveAllowSpaces:ae})}let ce=t=>QV({view:t,pluginKeyRef:e});return new E({key:e,view:()=>aH({editor:t,pluginKey:e,items:f,renderer:ie,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:oe,dispatchExit:ce}),state:eH({editor:t,char:n,effectiveAllowSpaces:ae,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:te,allow:ee,shouldShow:ne,shouldKeepDismissed:se,pluginKey:e}),props:$V({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:ie,dispatchExit:ce})})}var cH=sH;function lH({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r=`@`}){return{editor:e,char:r,pluginKey:new D,command:({editor:e,range:t,props:i})=>{var a,o;let s=e.view.state.selection.$to.nodeAfter;s!=null&&(a=s.text)!=null&&a.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:`text`,text:` `}]).run(),(o=e.view.dom.ownerDocument.defaultView)==null||(o=o.getSelection())==null||o.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}}function uH(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>lH({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function dH(e,t){let n=uH(e);return n.find(e=>e.char===t)||(n.length?n[0]:null)}var fH=Jp.create({name:`mention`,priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){return`${t?.char??`@`}${e.attrs.label??e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){return[`span`,A(this.HTMLAttributes,e.HTMLAttributes),`${n?.char??`@`}${t.attrs.label??t.attrs.id}`]},suggestions:[],suggestion:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute(`data-label`),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:`@`,parseHTML:e=>e.getAttribute(`data-mention-suggestion-char`),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=dH(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),[`span`,A({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=A({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return typeof i==`string`?[`span`,A({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},...$f({nodeName:`mention`,name:`@`,selfClosing:!0,allowedAttributes:[`id`,`label`,{name:`mentionSuggestionChar`,skipIfDefault:`@`}],parseAttributes:e=>{let t={},n=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i===`char`?`mentionSuggestionChar`:i]=a??o,r=n.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e===`mentionSuggestionChar`?`char`:e}="${t}"`).join(` `)}),renderText({node:e}){let t={options:this.options,node:e,suggestion:dH(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel===void 0?this.options.renderText(t):(console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),this.options.renderLabel(t))},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;if(!i)return!1;let o=new le,s=0;return t.doc.nodesBetween(a-1,a,(e,t)=>{if(e.type.name===this.name)return n=!0,o=e,s=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?``:o.attrs.mentionSuggestionChar,s,s+o.nodeSize),n})}},addProseMirrorPlugins(){return uH(this).map(sH)}});function pH(e,t){return fH.configure({HTMLAttributes:{class:`dw-mention`},renderText:({node:e})=>`@${e.attrs.label??e.attrs.id}`,suggestion:{char:`@`,allow:()=>!!t,findSuggestionMatch:t=>{let n=qV({...t,allowSpaces:!0});return n&&KP(n.query,e)?n:qV({...t,allowSpaces:!1})},items:async({query:n})=>{if(!t)return[];let r=GP(n,e,!!t.me).map(e=>({date:e})),i=(await t.search(n).catch(()=>[])).map(e=>({person:e}));return n.trim()?[...r,...i].slice(0,8):[...i.slice(0,6),...r]},render:Ij({label:e.mentions,empty:e.noPeople,toItem:t=>`person`in t?{label:t.person.label,description:t.person.hint,icon:`at`}:{label:UP(t.date.date,e),description:t.date.remind?`${e.dates.remindMe} · ${WP(t.date.date,e)}`:WP(t.date.date,e),icon:t.date.remind?`bell`:`calendar`},pick:(e,n)=>{`person`in n?e.command({id:n.person.id,label:n.person.label}):YP(e.editor,e.range,n.date,t?.me)}})}})}var mH=`flowchart LR + Idea --> Draft --> Review --> Published`,hH=null;function gH(e){return hH??=e().then(e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:document.documentElement.classList.contains(`dark`)?`dark`:`neutral`,fontFamily:`inherit`}),e)),hH}var _H=0;async function vH(e,t,n,r){if(e.classList.remove(`dw-mermaid__body--error`),!t.trim())e.textContent=``;else if(r)try{let{svg:n}=await(await gH(r)).render(`dw-mermaid-${++_H}`,t);e.innerHTML=n}catch(t){e.classList.add(`dw-mermaid__body--error`),e.textContent=`${n.blocks.mermaidError} ${t instanceof Error?t.message:String(t)}`}else{let n=document.createElement(`pre`);n.className=`dw-mermaid__source`,n.textContent=t,e.replaceChildren(n)}}var yH=Jp.create({name:`mermaid`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null,load:void 0}},addAttributes(){return{code:{default:``,parseHTML:e=>e.getAttribute(`data-code`)??e.textContent??``,renderHTML:e=>({"data-code":e.code})}}},parseHTML(){return[{tag:`div[data-type='mermaid']`},{tag:`pre.mermaid`}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,A(t,{"data-type":`mermaid`}),[`pre`,{},String(e.attrs.code)]]},addCommands(){return{insertMermaid:(e=mH)=>({commands:t})=>t.insertContent({type:this.name,attrs:{code:e}})}},addNodeView(){return({node:e,editor:t,getPos:n})=>{let r=this.options.labels,i=this.options.load,a=document.createElement(`div`);a.className=`dw-mermaid`,a.setAttribute(`data-type`,`mermaid`);let o=document.createElement(`div`);o.className=`dw-mermaid__body`,a.append(o);let s=String(e.attrs.code);return vH(o,s,r,i),a.addEventListener(`click`,()=>{if(!t.isEditable)return;let e=typeof n==`function`?n():void 0;if(e===void 0)return;let c=r.blocks;lF({anchor:a,value:s,label:c.mermaid,multiline:!0,monospace:!0,labels:{done:c.done,cancel:c.cancel,remove:c.remove},onInput:e=>void vH(o,e,r,i),onSave:n=>{t.chain().setNodeSelection(e).updateAttributes(`mermaid`,{code:n}).run(),vH(o,n,r,i)},onRemove:()=>t.chain().setNodeSelection(e).deleteSelection().focus().run(),onCancel:()=>void vH(o,s,r,i)})}),{dom:a,update:e=>e.type.name===`mermaid`&&(e.attrs.code!==s&&(s=String(e.attrs.code),vH(o,s,r,i)),!0),ignoreMutation:()=>!0,stopEvent:()=>!1}}}}),bH=e=>`/p/${encodeURIComponent(e)}`,xH=/^\/p\/([A-Za-z0-9_-]+)\/?(?:[?#].*)?$/;function SH(e){return xH.exec(e)?.[1]??``}function CH(e,t,n,r=`Untitled`){let i=`${n.icon?`${n.icon} `:``}${n.title||r}`;e.chain().focus().deleteRange(t).insertContent([{type:`text`,text:i,marks:[{type:`link`,attrs:{href:bH(n.id)}}]},{type:`text`,text:` `}]).run()}async function wH(e,t,n){if(!t.create)return;let{from:r,to:i,empty:a}=e.state.selection,o=a?``:e.state.doc.textBetween(r,i,` `).trim().slice(0,200),s=await t.create(o);a||!o?CH(e,{from:r,to:r},s,n):e.chain().focus().setTextSelection({from:r,to:i}).setLink({href:bH(s.id)}).run()}var TH=Tp.create({name:`pageLinks`,addOptions(){return{host:void 0,labels:null,onNavigate:void 0}},addProseMirrorPlugins(){let{host:e,onNavigate:t}=this.options,n=this.options.labels,r=[];return e&&r.push(cH({editor:this.editor,pluginKey:new D(`pageLinks`),char:`[[`,allowSpaces:!0,allow:({state:e,range:t})=>!e.doc.resolve(t.from).parent.type.spec.code,items:async({query:t})=>(await e.search(t).catch(()=>[])).slice(0,8),render:Ij({label:n.pageLinks,empty:n.noPages,toItem:e=>({label:`${e.icon?`${e.icon} `:``}${e.title||`…`}`,description:e.hint,icon:`page`}),pick:(e,t)=>CH(e.editor,e.range,t)})})),t&&r.push(new E({key:new D(`pageLinkClicks`),props:{handleClick:(e,n,r)=>{let i=(r.target?.closest?.(`a[href]`))?.getAttribute(`href`)??``;return!SH(i)||e.editable&&!(r.ctrlKey||r.metaKey)?!1:(r.preventDefault(),t(i),!0)}}})),r}});function EH(e){return new Promise(t=>{let n=document.createElement(`input`);n.type=`file`,n.accept=e,n.multiple=!0,n.onchange=()=>t([...n.files??[]]),n.click()})}function DH(e,t,n,r,i=!1,a){let o=(t,n,r,i)=>({id:t,icon:n,keywords:r,label:e.slash[t]?.label??t,description:e.slash[t]?.description??``,run:i}),s=[o(`text`,`text`,[`paragraph`,`p`],(e,t)=>e.chain().focus().deleteRange(t).setParagraph().run()),o(`h1`,`heading`,[`heading`,`title`,`#`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:1}).run()),o(`h2`,`heading`,[`heading`,`subtitle`,`##`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:2}).run()),o(`h3`,`heading`,[`heading`,`###`],(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:3}).run()),{...o(`otherHeadings`,`heading`,[`other`,`more headings`,`smaller`],()=>{}),children:[4,5,6].map(e=>o(`h${e}`,`heading`,[`heading`,`#`.repeat(e)],(t,n)=>t.chain().focus().deleteRange(n).setHeading({level:e}).run()))},o(`bullet`,`list`,[`list`,`ul`,`-`],(e,t)=>e.chain().focus().deleteRange(t).toggleBulletList().run()),o(`ordered`,`list-ordered`,[`list`,`ol`,`1.`],(e,t)=>e.chain().focus().deleteRange(t).toggleOrderedList().run()),o(`todo`,`todo`,[`task`,`checkbox`,`checklist`,`[]`],(e,t)=>e.chain().focus().deleteRange(t).toggleTaskList().run()),o(`callout`,`callout`,[`note`,`info`,`tip`,`warning`,`aside`,`box`],(e,t)=>e.chain().focus().deleteRange(t).setCallout().run()),o(`table`,`table`,[`grid`,`rows`,`columns`,`spreadsheet`],(e,t)=>e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()),o(`quote`,`quote`,[`blockquote`,`>`],(e,t)=>e.chain().focus().deleteRange(t).toggleBlockquote().run()),o(`code`,`code`,[`codeblock`,"```",`snippet`],(e,t)=>e.chain().focus().deleteRange(t).toggleCodeBlock().run()),o(`toggle`,`chevron-right`,[`details`,`collapse`,`expand`,`fold`,`>`],(e,t)=>e.chain().focus().deleteRange(t).setDetails().run()),o(`divider`,`divider`,[`hr`,`rule`,`line`,`---`],(e,t)=>e.chain().focus().deleteRange(t).setHorizontalRule().run()),o(`toc`,`list`,[`contents`,`outline`,`headings`,`index`],(e,t)=>e.chain().focus().deleteRange(t).insertTableOfContents().run()),o(`math`,`sigma`,[`latex`,`formula`,`equation`,`katex`,`$$`],(e,t)=>e.chain().focus().deleteRange(t).insertBlockMath({latex:`E = mc^2`}).run()),o(`mathInline`,`sigma`,[`latex`,`formula`,`equation`,`$`],(e,t)=>e.chain().focus().deleteRange(t).insertInlineMath({latex:`x^2`}).run()),o(`mermaid`,`diagram`,[`diagram`,`flowchart`,`chart`,`sequence`,`graph`],(e,t)=>e.chain().focus().deleteRange(t).insertMermaid().run()),o(`embed`,`video`,[`video`,`youtube`,`vimeo`,`figma`,`loom`,`iframe`,`map`],(t,r)=>{t.chain().focus().deleteRange(r).run(),hF(t,e,a,n)}),o(`linkCard`,`link`,[`bookmark`,`preview`,`card`,`url`,`web`],(t,r)=>{t.chain().focus().deleteRange(r).run(),gF(t,e,a,n)})],c=e=>{let t=new Date;return zP(new Date(t.getFullYear(),t.getMonth(),t.getDate()+e))};if(s.push(o(`today`,`calendar`,[`date`,`day`],(e,t)=>YP(e,t,{date:c(0),remind:!1})),o(`tomorrow`,`calendar`,[`date`,`day`],(e,t)=>YP(e,t,{date:c(1),remind:!1})),o(`yesterday`,`calendar`,[`date`,`day`],(e,t)=>YP(e,t,{date:c(-1),remind:!1})),o(`now`,`clock`,[`time`,`date`,`timestamp`],(t,n)=>{YP(t,n,{date:c(0),remind:!1});let r=new Intl.DateTimeFormat(e.locale,{hour:`numeric`,minute:`2-digit`}).format(new Date);t.chain().focus().insertContent(`${r} `).run()})),r&&(s.push(o(`pageLink`,`link`,[`page`,`link`,`[[`,`wiki`],(e,t)=>e.chain().focus().deleteRange(t).insertContent(`[[`).run())),r.create&&s.push(o(`newPage`,`page-plus`,[`page`,`doc`,`subpage`,`create`],(e,t)=>{e.chain().focus().deleteRange(t).run(),wH(e,r,``).catch(n)}))),t?.upload){let e=e=>(r,i)=>{r.chain().focus().deleteRange(i).run(),EH(e).then(e=>SF(r,t,e).catch(n))};s.push(o(`image`,`image`,[`picture`,`photo`,`img`],e(`image/*`)),o(`file`,`paperclip`,[`attachment`,`upload`,`pdf`],e(``)),o(`drawio`,`diagram`,[`diagram`,`diagrams.net`,`draw`,`chart`,`uml`],(e,t)=>e.chain().focus().deleteRange(t).insertDiagram(`drawio`).run())),i&&s.push(o(`excalidraw`,`pencil`,[`drawing`,`sketch`,`whiteboard`,`draw`],(e,t)=>e.chain().focus().deleteRange(t).insertDiagram(`excalidraw`).run()))}return s}function OH(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=e=>e.label.toLowerCase().includes(n)||e.id.startsWith(n)||e.keywords.some(e=>e.toLowerCase().startsWith(n));return e.flatMap(e=>{let t=e.children?.filter(r)??[];return t.length?t:r(e)?[e]:[]})}var kH=Tp.create({name:`slashMenu`,addOptions(){return{commands:[],labels:void 0}},addProseMirrorPlugins(){return[cH({editor:this.editor,pluginKey:new D(`slashMenu`),char:`/`,allowSpaces:!1,startOfLine:!1,allow:({state:e,range:t})=>!e.doc.resolve(t.from).parent.type.spec.code,items:({query:e})=>OH(this.options.commands,e),render:Ij({label:this.options.labels.slashMenu,empty:this.options.labels.noMatches,showQuery:!0,toItem:e=>({label:e.label,description:e.description,icon:e.icon}),children:e=>e.children,pick:(e,t)=>t.run(e.editor,e.range)})})]}});function AH(e,t){let n=!0,r=e.firstChild?.childCount??0;return e.forEach(e=>{t===`column`&&e.childCount!==r&&(n=!1),e.forEach(e=>{((t===`row`?e.attrs.rowspan:e.attrs.colspan)??1)>1&&(n=!1)})}),n}function jH(e,t,n){let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}var MH=e=>{let t=[];return e.forEach(e=>t.push(e)),t};function NH(e,t,n,r,i,a=0){let o=e.doc.nodeAt(t);if(!o||o.type.name!==`table`||!AH(o,n))return null;let c=MH(o),l=n===`row`?c.length:c[0]?.childCount??0;if(r===i||r<0||i<0||r>=l||i>=l)return null;let u=n===`row`?jH(c,r,i):c.map(e=>e.copy(s.fromArray(jH(MH(e),r,i)))),d=e.tr.replaceWith(t,t+o.nodeSize,o.copy(s.fromArray(u))),[f,p]=n===`row`?[i,0]:[Math.min(a,u.length-1),i],m=t+1;for(let e=0;e0;e--)if(n.node(e).type.name===`table`)return{tablePos:n.before(e),row:n.index(e),column:e+1<=n.depth?n.index(e+1):0};return null}var FH=Tp.create({name:`tableMove`,addOptions(){return{labels:null}},addCommands(){let e=e=>t=>({state:n,dispatch:r})=>{let i=PH(n,n.selection.from);if(!i)return!1;let a=e===`row`?i.row:i.column,o=NH(n,i.tablePos,e,a,a+t,i.row);return o?(r?.(o),!0):!1};return{moveTableRow:e(`row`),moveTableColumn:e(`column`)}},addKeyboardShortcuts(){return{"Mod-Alt-ArrowUp":()=>this.editor.commands.moveTableRow(-1),"Mod-Alt-ArrowDown":()=>this.editor.commands.moveTableRow(1),"Mod-Alt-ArrowLeft":()=>this.editor.commands.moveTableColumn(-1),"Mod-Alt-ArrowRight":()=>this.editor.commands.moveTableColumn(1)}},addProseMirrorPlugins(){let e=this.options.labels?.table;return[new E({key:new D(`tableMove`),view:t=>new IH(t,{row:e?.dragRow??`Drag to move the row`,column:e?.dragColumn??`Drag to move the column`})})]}}),IH=class{view;grips={row:document.createElement(`button`),column:document.createElement(`button`)};line=document.createElement(`div`);cell=null;drag=null;constructor(e,t){this.view=e;for(let e of[`row`,`column`]){let n=this.grips[e];n.type=`button`,n.className=`dw-table-grip dw-table-grip--${e}`,n.contentEditable=`false`,n.setAttribute(`aria-label`,t[e]),n.title=t[e],n.hidden=!0,n.tabIndex=-1,n.addEventListener(`pointerdown`,t=>this.start(t,e)),n.addEventListener(`mouseleave`,this.leave)}this.line.className=`dw-table-drop`,this.line.hidden=!0,e.dom.addEventListener(`mousemove`,this.move),e.dom.addEventListener(`mouseleave`,this.leave)}get host(){let e=this.view.dom.parentElement;return e&&this.line.parentElement!==e&&(e.classList.add(`dw-block-host`),e.append(this.grips.row,this.grips.column,this.line)),e}hide=()=>{this.drag||(this.grips.row.hidden=!0,this.grips.column.hidden=!0,this.cell=null)};leave=e=>{let t=e.relatedTarget;t&&(this.grips.row.contains(t)||this.grips.column.contains(t)||this.view.dom.contains(t))||this.hide()};move=e=>{if(this.drag)return;let t=e.target?.closest?.(`td, th`),n=this.host;if(!this.view.editable||!n||!(t instanceof HTMLTableCellElement)||!this.view.dom.contains(t))return this.hide();let r=this.locate(t),i=r&&this.view.state.doc.nodeAt(r.tablePos);if(!r||!i)return this.hide();this.cell=t;let a=n.getBoundingClientRect(),o=t.closest(`table`).getBoundingClientRect(),s=t.parentElement.getBoundingClientRect(),c=t.getBoundingClientRect(),l=i.childCount>1&&AH(i,`row`),u=(i.firstChild?.childCount??0)>1&&AH(i,`column`);Object.assign(this.grips.row.style,{top:`${s.top-a.top+s.height/2-11}px`,left:`${o.left-a.left-7}px`}),Object.assign(this.grips.column.style,{top:`${o.top-a.top-7}px`,left:`${c.left-a.left+c.width/2-11}px`}),this.grips.row.hidden=!l,this.grips.column.hidden=!u};locate(e){try{return PH(this.view.state,this.view.posAtDOM(e,0))}catch{return null}}start(e,t){let n=this.cell;if(!n||e.button!==0)return;let r=this.locate(n),i=n.parentElement?.parentElement;if(!r||!i)return;e.preventDefault();let a=this.grips[t];a.setPointerCapture(e.pointerId);let o=[...i.children].filter(e=>e instanceof HTMLTableRowElement),s=t===`row`?r.row:r.column,c=t===`row`?o:[...o[0]?.children??[]],l=t===`row`?[o[s]]:o.map(e=>e.children[s]).filter(Boolean);for(let e of l)e.classList.add(`dw-table-dragging`);this.drag={axis:t,tablePos:r.tablePos,from:s,slots:c,dimmed:l,to:s,cursorRow:r.row},a.addEventListener(`pointermove`,this.dragMove),a.addEventListener(`pointerup`,this.drop),a.addEventListener(`pointercancel`,this.cancel)}dragMove=e=>{let t=this.drag,n=this.host;if(!t||!n)return;let r=t.axis===`row`,i=r?e.clientY:e.clientX,a=t.slots.length;for(let[e,n]of t.slots.entries()){let t=n.getBoundingClientRect();if(i<(r?t.top+t.height/2:t.left+t.width/2)){a=e;break}}t.to=a>t.from?a-1:a;let o=n.getBoundingClientRect(),s=t.slots[0].closest(`table`).getBoundingClientRect(),c=t.slots.at(-1).getBoundingClientRect(),l=t.slots[a]?.getBoundingClientRect(),u=r?l?.top??c.bottom:l?.left??c.right;Object.assign(this.line.style,r?{top:`${u-o.top-1}px`,left:`${s.left-o.left}px`,width:`${s.width}px`,height:`2px`}:{top:`${s.top-o.top}px`,left:`${u-o.left-1}px`,width:`2px`,height:`${s.height}px`}),this.line.hidden=t.to===t.from};drop=()=>{let e=this.drag;if(this.cancel(),!e||e.to===e.from)return;let t=NH(this.view.state,e.tablePos,e.axis,e.from,e.to,e.cursorRow);t&&this.view.dispatch(t),this.view.focus()};cancel=()=>{let e=this.drag;for(let t of e?.dimmed??[])t.classList.remove(`dw-table-dragging`);this.drag=null,this.line.hidden=!0;for(let e of Object.values(this.grips))e.removeEventListener(`pointermove`,this.dragMove),e.removeEventListener(`pointerup`,this.drop),e.removeEventListener(`pointercancel`,this.cancel);this.hide()};update(){this.cell&&!this.cell.isConnected&&this.hide()}destroy(){this.cancel();for(let e of Object.values(this.grips))e.remove();this.line.remove(),this.view.dom.removeEventListener(`mousemove`,this.move),this.view.dom.removeEventListener(`mouseleave`,this.leave)}};function LH(e){let t=[];return e.descendants((e,n)=>e.type.name!==`heading`||(t.push({level:Number(e.attrs.level)||1,text:e.textContent.trim(),pos:n}),!1)),t}function RH(e,t){let n=e.view.nodeDOM(t);n instanceof HTMLElement&&n.scrollIntoView({behavior:`smooth`,block:`start`}),e.isEditable&&e.commands.setTextSelection(t+1)}var zH=Jp.create({name:`tableOfContents`,group:`block`,atom:!0,draggable:!0,addOptions(){return{labels:null}},parseHTML(){return[{tag:`nav[data-type='toc']`}]},renderHTML(){return[`nav`,{"data-type":`toc`}]},addCommands(){return{insertTableOfContents:()=>({commands:e})=>e.insertContent({type:this.name})}},addNodeView(){return({editor:e})=>{let t=this.options.labels.blocks,n=document.createElement(`nav`);n.className=`dw-toc`,n.setAttribute(`data-type`,`toc`),n.setAttribute(`aria-label`,t.toc),n.contentEditable=`false`;let r=document.createElement(`p`);r.className=`dw-toc__title`,r.textContent=t.toc;let i=document.createElement(`ol`);i.className=`dw-toc__list`,n.append(r,i);let a=``,o=()=>{let n=LH(e.state.doc),r=JSON.stringify(n.map(e=>[e.level,e.text]));if(r===a){i.querySelectorAll(`a`).forEach((e,t)=>e.dataset.pos=String(n[t]?.pos??0));return}if(a=r,i.replaceChildren(),!n.length){let e=document.createElement(`li`);e.className=`dw-toc__empty`,e.textContent=t.tocEmpty,i.append(e);return}let o=Math.min(...n.map(e=>e.level));for(let t of n){let n=document.createElement(`li`);n.style.paddingLeft=`${(t.level-o)*1}rem`;let r=document.createElement(`a`);r.href=`#`,r.textContent=t.text||`…`,r.dataset.pos=String(t.pos),r.addEventListener(`click`,t=>{t.preventDefault(),RH(e,Number(r.dataset.pos))}),n.append(r),i.append(n)}};return o(),e.on(`update`,o),{dom:n,update:e=>e.type.name===`tableOfContents`,ignoreMutation:()=>!0,stopEvent:e=>e.target instanceof Element&&!!e.target.closest(`a`),destroy:()=>e.off(`update`,o)}}}}),BH=(e,t)=>{let n=t.view.domAtPos(e).node,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;return r?r.offsetParent!==null:!1},VH=(e,t,n)=>{for(let r=e.depth;r>0;--r){let i=e.node(r),a=t(i),o=BH(e.start(r),n);if(a&&o)return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:i}}},HH=(e,t)=>{let{state:n,view:r,extensionManager:i}=e,{schema:a,selection:o}=n,{empty:s,$anchor:c}=o,l=!!i.extensions.find(e=>e.name===`gapCursor`);if(!s||c.parent.type!==a.nodes.detailsSummary||!l||t===`right`&&c.parentOffset!==c.parent.nodeSize-2)return!1;let u=yu(e=>e.type===a.nodes.details)(o);if(!u)return!1;let d=gu(u.node,e=>e.type===a.nodes.detailsContent);if(!d.length||BH(u.start+d[0].pos+1,e))return!1;let f=n.doc.resolve(u.pos+u.node.nodeSize),p=Nw.findFrom(f,1,!1);if(!p)return!1;let{tr:m}=n,h=new Nw(p);return m.setSelection(h),m.scrollIntoView(),r.dispatch(m),!0},UH=Jp.create({name:`details`,content:`detailsSummary detailsContent`,group:`block`,defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:`is-open`,HTMLAttributes:{},renderToggleButton:({element:e,isOpen:t})=>{e.setAttribute(`aria-label`,t?`Collapse details content`:`Expand details content`)}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:e=>e.hasAttribute(`open`),renderHTML:({open:e})=>e?{open:``}:{}}}:[]},parseHTML(){return[{tag:`details`}]},renderHTML({HTMLAttributes:e}){return[`details`,A(this.options.HTMLAttributes,e),0]},...Xf({nodeName:`details`,content:`block`}),addNodeView(){return({editor:e,getPos:t,node:n,HTMLAttributes:r})=>{let i=document.createElement(`div`),a=A(this.options.HTMLAttributes,r,{"data-type":this.name});Object.entries(a).forEach(([e,t])=>i.setAttribute(e,t));let o=document.createElement(`button`);o.type=`button`;let s=e=>{this.options.renderToggleButton({element:o,...e})};i.append(o);let c=document.createElement(`div`);i.append(c);let l=e=>{let{setToValue:t,node:r=n}=e||{};if(t!==void 0){if(t){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}}else i.classList.toggle(this.options.openClassName);let a=i.classList.contains(this.options.openClassName);s({isOpen:a,node:r});let o=new Event(`toggleDetailsContent`);c.querySelector(`:scope > div[data-type="detailsContent"]`)?.dispatchEvent(o)};return s({isOpen:!!n.attrs.open,node:n}),n.attrs.open&&setTimeout(()=>l()),o.addEventListener(`click`,()=>{if(l(),!this.options.persist)e.commands.focus(void 0,{scrollIntoView:!1});else if(e.isEditable&&typeof t==`function`){let{from:n,to:r}=e.state.selection;e.chain().command(({tr:e})=>{let n=t();if(typeof n!=`number`)return!1;let r=e.doc.nodeAt(n);return r?.type===this.type&&(e.setNodeMarkup(n,void 0,{open:!r.attrs.open}),!0)}).setTextSelection({from:n,to:r}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:c,ignoreMutation(e){if(e.type===`selection`)return!1;let t=e.target,n=i.contains(t);return o.contains(t)||!n||i===t},update:e=>e.type===this.type&&(e.attrs.open===void 0?s({isOpen:i.classList.contains(this.options.openClassName),node:e}):l({setToValue:e.attrs.open,node:e}),!0)}}},addCommands(){return{setDetails:()=>({state:e,chain:t})=>{let{schema:n,selection:r}=e,{$from:i,$to:a}=r,o=i.blockRange(a);if(!o)return!1;let s=e.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(s.content))return!1;let c=s.toJSON()?.content||[];return t().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:`detailsSummary`},{type:`detailsContent`,content:c}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:e,chain:t})=>{let{selection:n,schema:r}=e,i=yu(e=>e.type===this.type)(n);if(!i)return!1;let a=gu(i.node,e=>e.type===r.nodes.detailsSummary),o=gu(i.node,e=>e.type===r.nodes.detailsContent);if(!a.length||!o.length)return!1;let s=a[0],c=o[0],l=i.pos,u=e.doc.resolve(l),d={from:l,to:l+i.node.nodeSize},f=c.node.content.toJSON()||[],p=[u.parent.type.contentMatch.defaultType?.create(null,s.node.content).toJSON(),...f];return t().insertContentAt(d,p).setTextSelection(l+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:e,selection:t}=this.editor.state,{empty:n,$anchor:r}=t;return!n||r.parent.type!==e.nodes.detailsSummary?!1:r.parentOffset===0?this.editor.commands.unsetDetails():this.editor.commands.command(({tr:e})=>{let t=r.pos-1,n=r.pos;return e.delete(t,n),!0})},Enter:({editor:e})=>{let{state:t,view:n}=e,{schema:r,selection:i}=t,{$head:a}=i;if(a.parent.type!==r.nodes.detailsSummary)return!1;let o=BH(a.after()+1,e),s=o?t.doc.nodeAt(a.after()):a.node(-2);if(!s)return!1;let c=o?0:a.indexAfter(-1),l=Ll(s.contentMatchAt(c));if(!l||!s.canReplaceWith(c,c,l))return!1;let u=l.createAndFill();if(!u)return!1;let d=o?a.after()+1:a.after(-1),f=t.tr.replaceWith(d,d,u),p=f.doc.resolve(d),m=C.near(p,1);return f.setSelection(m),f.scrollIntoView(),n.dispatch(f),!0},ArrowRight:({editor:e})=>HH(e,`right`),ArrowDown:({editor:e})=>HH(e,`down`)}},addProseMirrorPlugins(){return[new E({key:new D(`detailsSelection`),appendTransaction:(e,t,n)=>{let{editor:r,type:i}=this;if(r.view.composing||!e.some(e=>e.selectionSet)||!t.selection.empty||!n.selection.empty||!sd(n,i.name))return;let{$from:a}=n.selection;if(BH(a.pos,r))return;let o=VH(a,e=>e.type===i,r);if(!o)return;let s=gu(o.node,e=>e.type===n.schema.nodes.detailsSummary);if(!s.length)return;let c=s[0],l=(t.selection.from{let t=document.createElement(`div`),n=A(this.options.HTMLAttributes,e,{"data-type":this.name,hidden:`hidden`});return Object.entries(n).forEach(([e,n])=>t.setAttribute(e,n)),t.addEventListener(`toggleDetailsContent`,()=>{t.toggleAttribute(`hidden`)}),{dom:t,contentDOM:t,ignoreMutation(e){return e.type===`selection`?!1:!t.contains(e.target)||t===e.target},update:e=>e.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t,{$from:i,empty:a}=r,o=yu(e=>e.type===this.type)(r);if(!a||!o||!o.node.childCount)return!1;let s=i.index(o.depth),{childCount:c}=o.node;if(c!==s+1)return!1;let l=o.node.type.contentMatch.defaultType?.createAndFill();if(!l)return!1;let u=t.doc.resolve(o.pos+1),d=c-1,f=o.node.child(d),p=u.posAtIndex(d,o.depth);if(!f.eq(l))return!1;let m=i.node(-3);if(!m)return!1;let h=i.indexAfter(-3),g=Ll(m.contentMatchAt(h));if(!g||!m.canReplaceWith(h,h,g))return!1;let _=g.createAndFill();if(!_)return!1;let{tr:v}=t,y=i.after(-2);v.replaceWith(y,y,_);let b=v.doc.resolve(y),x=C.near(b,1);v.setSelection(x);let S=p,ee=p+f.nodeSize;return v.delete(S,ee),v.scrollIntoView(),n.dispatch(v),!0}}},...Xf({nodeName:`detailsContent`})}),GH=Jp.create({name:`detailsSummary`,content:`text*`,defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`summary`}]},renderHTML({HTMLAttributes:e}){return[`summary`,A(this.options.HTMLAttributes,e),0]},...Xf({nodeName:`detailsSummary`,content:`inline`})});function KH(e){return[UH.configure({persist:!1,HTMLAttributes:{class:`dw-toggle`},renderToggleButton:({element:t,isOpen:n})=>{t.setAttribute(`aria-label`,n?e.blocks.collapse:e.blocks.expand),t.setAttribute(`aria-expanded`,String(n))}}),GH,WH]}function qH(e={}){let t=e.labels??PF,n=null,r=Tp.create({name:`editorRef`,onCreate(){n=this.editor}}),i={host:e.files,labels:t,drawioUrl:e.drawioUrl,loadExcalidraw:e.loadExcalidraw,onError:e.onError},a=[r,Hk.configure({heading:{levels:[1,2,3,4,5,6]},codeBlock:!1,link:{openOnClick:!1,autolink:!0},undoRedo:!e.collab&&void 0}),lT.configure({placeholder:e.placeholder??`Type '/' for commands…`}),CF.configure({host:e.files}),TF.configure({host:e.files,loadPdf:e.loadPdf,labels:t}),Aj.configure({lineNumbers:e.codeLineNumbers??!1}),SP,xP,OP,kP,...yP(),...bP(),FH.configure({labels:t}),MP.configure({labels:t}),EF.configure({host:e.files,onError:e.onError}),pH(t,e.mentions),qP.configure({labels:t,me:()=>e.mentions?.me}),kH.configure({commands:DH(t,e.files,e.onError,e.pages,!!e.loadExcalidraw,e.links),labels:t}),LP.configure({onSelect:e.onCommentSelect}),KV(t,()=>n),yH.configure({labels:t,load:e.loadMermaid}),zH.configure({labels:t}),oF.configure(i),sF.configure(i),TH.configure({host:e.pages,labels:t,onNavigate:e.onNavigate}),...KH(t),vF.configure({labels:t}),yF.configure({labels:t}),Jj.configure({labels:t,link:e.blockLink,onCopied:e.onBlockLinkCopied}),NF];return e.collab&&a.push(Tw.configure({document:e.collab.provider.doc}),Aw.configure({provider:e.collab.provider,user:e.collab.user,render:JH})),a}function JH(e){let t=typeof e.color==`string`&&/^#[0-9a-f]{3,8}$/i.test(e.color)?e.color:`#888`,n=document.createElement(`span`);n.classList.add(`collaboration-carets__caret`),n.style.borderColor=t;let r=document.createElement(`div`);return r.classList.add(`collaboration-carets__label`),r.setAttribute(`aria-hidden`,`true`),r.style.backgroundColor=t,r.textContent=typeof e.name==`string`?e.name:``,n.append(r),n}var YH=3e4,XH=class extends um{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=Mh();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&ZH(this,t,`timeout`)},dm(YH/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Mh()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),Qh(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},ZH=(e,t,n)=>{let r=[];for(let n=0;n0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},QH=(e,t,n=e.states)=>{let r=t.length,i=Mm();j(i,r);for(let a=0;a{let r=fh(t),i=Mh(),a=[],o=[],s=[],c=[],l=M(r);for(let t=0;t0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},eU=(e,t)=>{j(e,0),Wm(e,Gv(t))},tU=(e,t,n)=>{j(e,1),Wm(e,zv(t,n))},nU=(e,t,n)=>tU(t,n,hh(e)),rU=(e,t,n,r)=>{try{Iv(t,hh(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},iU=(e,t)=>{j(e,2),Wm(e,t)},aU=rU,oU=(e,t,n,r,i)=>{let a=M(e);switch(a){case 0:nU(e,t,n);break;case 1:rU(e,n,r,i);break;case 2:aU(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},sU=0,cU=1,lU=4401,uU=4404,dU=4409,fU=class{opts;doc=new bv;awareness=new XH(this.doc);status=`connecting`;synced=!1;ws=null;retries=0;retryTimer;destroyed=!1;listeners=new Set;constructor(e){this.opts=e,this.doc.on(`update`,this.onDocUpdate),this.awareness.on(`update`,this.onAwarenessUpdate),window.addEventListener(`beforeunload`,this.onUnload),this.connect()}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.destroyed||(this.destroyed=!0,this.listeners.clear(),clearTimeout(this.retryTimer),window.removeEventListener(`beforeunload`,this.onUnload),ZH(this.awareness,[this.doc.clientID],`local`),this.doc.off(`update`,this.onDocUpdate),this.awareness.off(`update`,this.onAwarenessUpdate),this.ws?.close(),this.awareness.destroy(),this.doc.destroy(),this.listeners.clear())}set(e,t=this.synced){(e!==this.status||t!==this.synced)&&(this.status=e,this.synced=t,this.listeners.forEach(e=>e()))}connect(){let e=new WebSocket(`${this.opts.url}?page=${encodeURIComponent(this.opts.page)}`);e.binaryType=`arraybuffer`,this.ws=e,e.onopen=()=>{e.send(this.opts.token()??``);let t=Mm();j(t,sU),eU(t,this.doc),e.send(Fm(t)),this.awareness.getLocalState()!==null&&this.sendAwareness([this.doc.clientID])},e.onmessage=e=>this.onMessage(new Uint8Array(e.data)),e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=[...this.awareness.getStates().keys()].filter(e=>e!==this.doc.clientID);ZH(this.awareness,n,this),this.destroyed||(t.code===lU||t.code===uU?this.set(`denied`,!1):t.code===dU?this.set(`changed`):(this.set(`offline`),this.retryTimer=setTimeout(()=>this.connect(),Math.min(1e3*2**this.retries++,3e4))))}}onMessage(e){let t=fh(e),n=M(t);if(n===sU){let e=Mm();j(e,sU);let n=oU(t,e,this.doc,this);Pm(e)>1&&this.ws?.send(Fm(e)),n===1&&(this.retries=0,this.set(`connected`,!0))}else n===cU&&$H(this.awareness,hh(t),this)}onDocUpdate=(e,t)=>{if(t===this||this.ws?.readyState!==WebSocket.OPEN)return;let n=Mm();j(n,sU),iU(n,e),this.ws.send(Fm(n))};onAwarenessUpdate=({added:e,updated:t,removed:n},r)=>{r!==this&&this.sendAwareness([...e,...t,...n])};sendAwareness(e){if(this.ws?.readyState!==WebSocket.OPEN)return;let t=Mm();j(t,cU),Wm(t,QH(this.awareness,e)),this.ws.send(Fm(t))}onUnload=()=>ZH(this.awareness,[this.doc.clientID],`unload`)},pU={bold:e=>e.chain().focus().toggleBold().run(),italic:e=>e.chain().focus().toggleItalic().run(),strike:e=>e.chain().focus().toggleStrike().run(),code:e=>e.chain().focus().toggleCode().run(),heading1:e=>e.chain().focus().toggleHeading({level:1}).run(),heading2:e=>e.chain().focus().toggleHeading({level:2}).run(),heading3:e=>e.chain().focus().toggleHeading({level:3}).run(),bulletList:e=>e.chain().focus().toggleBulletList().run(),orderedList:e=>e.chain().focus().toggleOrderedList().run(),blockquote:e=>e.chain().focus().toggleBlockquote().run(),codeBlock:e=>e.chain().focus().toggleCodeBlock().run(),underline:e=>e.chain().focus().toggleUnderline().run(),taskList:e=>e.chain().focus().toggleTaskList().run(),callout:e=>e.isActive(`callout`)?e.chain().focus().unsetCallout().run():e.chain().focus().setCallout().run(),table:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),undo:e=>e.chain().focus().undo().run(),redo:e=>e.chain().focus().redo().run()},mU=[[`bold`,e=>e.isActive(`bold`)],[`italic`,e=>e.isActive(`italic`)],[`strike`,e=>e.isActive(`strike`)],[`code`,e=>e.isActive(`code`)],[`heading1`,e=>e.isActive(`heading`,{level:1})],[`heading2`,e=>e.isActive(`heading`,{level:2})],[`heading3`,e=>e.isActive(`heading`,{level:3})],[`bulletList`,e=>e.isActive(`bulletList`)],[`orderedList`,e=>e.isActive(`orderedList`)],[`blockquote`,e=>e.isActive(`blockquote`)],[`codeBlock`,e=>e.isActive(`codeBlock`)],[`underline`,e=>e.isActive(`underline`)],[`taskList`,e=>e.isActive(`taskList`)],[`callout`,e=>e.isActive(`callout`)],[`table`,e=>e.isActive(`table`)]],hU=class{el;send;editor;provider=null;lastState=``;editable=!0;constructor(e,t){this.el=e,this.send=t,this.editor=this.create({}),t({type:`ready`,version:2})}receive(e){try{let t=typeof e==`string`?JSON.parse(e):e;this.handle(t)}catch(e){this.send({type:`error`,message:e instanceof Error?e.message:String(e)})}}get content(){return this.editor.getJSON()}destroy(){this.editor.destroy(),this.provider?.destroy()}handle(e){switch(e.type){case`hello`:this.send({type:`ready`,version:2}),this.lastState=``,this.reportState(this.editor);return;case`setContent`:this.editor.commands.setContent(e.content??``,{emitUpdate:!1}),this.reportState(this.editor);return;case`setEditable`:this.editable=e.editable,this.editor.setEditable(e.editable);return;case`setTheme`:document.documentElement.classList.toggle(`dark`,e.dark);return;case`setLayout`:{let t=document.documentElement.classList;t.toggle(`dw-full-width`,e.fullWidth),t.toggle(`dw-font-serif`,e.font===`serif`),t.toggle(`dw-font-mono`,e.font===`mono`);return}case`command`:{let t=pU[e.command];if(!t)throw Error(`unknown command ${e.command}`);t(this.editor);return}case`focus`:this.editor.commands.focus();return;case`blur`:this.editor.commands.blur();return;case`connect`:this.connect(e);return;default:throw Error(`unknown message ${e.type}`)}}connect(e){this.provider?.destroy();let t=new fU({url:e.url,page:e.page,token:()=>e.token});t.onChange(()=>this.send({type:`collab`,status:t.status})),this.provider=t,this.editor.destroy(),this.editor=this.create({collab:{provider:t,user:e.user}})}create(e){return this.el.replaceChildren(),new Vp({element:this.el,editable:this.editable,extensions:qH({...e,onNavigate:e=>this.send({type:`navigate`,path:e})}),editorProps:{attributes:{class:`dw-prose`}},onUpdate:({editor:e})=>this.send({type:`change`,content:e.getJSON()}),onSelectionUpdate:({editor:e})=>this.reportState(e),onTransaction:({editor:e})=>this.reportState(e),onFocus:({editor:e})=>this.reportState(e),onBlur:({editor:e})=>this.reportState(e)})}reportState(e){let t={active:mU.filter(([,t])=>t(e)).map(([e])=>e),canUndo:e.can().undo(),canRedo:e.can().redo(),focused:e.isFocused},n=JSON.stringify(t);n!==this.lastState&&(this.lastState=n,this.send({type:`state`,state:t}))}};function gU(e){let t=JSON.stringify(e);window.DocwellNative?window.DocwellNative.postMessage(t):(window.parent.postMessage(t,`*`),console.debug(`[docwell bridge]`,e))}var _U=new hU(document.getElementById(`editor`),gU);window.docwell={receive:e=>_U.receive(e)}; diff --git a/Packages/editor/src/DocwellEditor.vue b/Packages/editor/src/DocwellEditor.vue index 127d8ba..f553ad4 100644 --- a/Packages/editor/src/DocwellEditor.vue +++ b/Packages/editor/src/DocwellEditor.vue @@ -6,7 +6,7 @@ import { BubbleMenu } from "@tiptap/vue-3/menus"; import { CellSelection } from "@tiptap/pm/tables"; import { DwIcon, type IconName } from "@docwell/ui"; import { computed, nextTick, onBeforeUnmount, ref, watch } from "vue"; -import { blockHash, ensureBlockId } from "./blocklinks"; +import { copyBlockLink } from "./blocklinks"; import { palette, type PaletteColor } from "./colors"; import { docwellExtensions, type CollabUser } from "./extensions"; import { findKey } from "./find"; @@ -188,13 +188,8 @@ const tools = computed(() => { active: () => false, run: () => { const $from = e.state.selection.$from; - const id = $from.depth >= 1 ? ensureBlockId(e.view, $from.before(1)) : null; - if (!id) return; - const url = blockLink(blockHash(id)); - navigator.clipboard.writeText(url).then( - () => emit("block-link-copied", url), - () => window.prompt("", url), - ); + if ($from.depth >= 1) + void copyBlockLink(e.view, $from.before(1), blockLink, (url) => emit("block-link-copied", url)); }, }); } @@ -215,7 +210,7 @@ function setAlign(a: "left" | "center" | "right") { // The table toolbar sits above the table the cursor is in. type TableTool = { - id: Exclude; + id: Exclude; run: (e: Editor) => boolean; danger?: boolean; }; @@ -226,6 +221,8 @@ const tableTools: TableTool[] = [ { id: "addColumnAfter", run: (e) => e.chain().focus().addColumnAfter().run() }, { id: "moveRowUp", run: (e) => e.chain().focus().moveTableRow(-1).run() }, { id: "moveRowDown", run: (e) => e.chain().focus().moveTableRow(1).run() }, + { id: "moveColumnLeft", run: (e) => e.chain().focus().moveTableColumn(-1).run() }, + { id: "moveColumnRight", run: (e) => e.chain().focus().moveTableColumn(1).run() }, { id: "deleteRow", run: (e) => e.chain().focus().deleteRow().run() }, { id: "deleteColumn", run: (e) => e.chain().focus().deleteColumn().run() }, { id: "toggleHeaderRow", run: (e) => e.chain().focus().toggleHeaderRow().run() }, @@ -533,7 +530,7 @@ defineExpose({ editor, openFind }); plugin-key="tableMenu" :should-show="showTableMenu" :get-referenced-virtual-element="tableElement" - :options="{ placement: 'top-start', offset: 6 }" + :options="{ placement: 'top-start', offset: 12 }" class="flex max-w-[calc(100vw-16px)] flex-wrap items-center gap-0.5 rounded-md border border-line bg-surface-raised p-1 shadow-menu" role="toolbar" :aria-label="labels.table.toolbar" diff --git a/Packages/editor/src/blocklinks.ts b/Packages/editor/src/blocklinks.ts index 1b4a785..1cd5063 100644 --- a/Packages/editor/src/blocklinks.ts +++ b/Packages/editor/src/blocklinks.ts @@ -60,6 +60,28 @@ export function ensureBlockId(view: EditorView, pos: number): string | null { return fresh; } +/** + * Copies the full address of a link to the block at pos, giving the block an + * id first if it needs one. Returns false when the block cannot be linked. + */ +export async function copyBlockLink( + view: EditorView, + pos: number, + link: (hash: string) => string, + onCopied?: (url: string) => void, +): Promise { + const id = ensureBlockId(view, pos); + if (!id) return false; + const url = link(blockHash(id)); + try { + await navigator.clipboard.writeText(url); + onCopied?.(url); + } catch { + window.prompt("", url); + } + return true; +} + function findBlock(doc: PMNode, id: string): number { let found = -1; doc.descendants((node, pos) => { @@ -130,6 +152,26 @@ export const BlockLinks = Extension.create({ ]; }, + addKeyboardShortcuts() { + const { link, onCopied } = this.options; + return { + // Ctrl+Shift+C (as in AFFiNE): copy a link to the block the cursor is in. + // Some browsers keep the key for their developer tools; the toolbar + // and margin buttons do the same everywhere. + "Mod-Shift-c": ({ editor }) => { + if (!link) return false; + const $from = editor.state.selection.$from; + if ($from.depth < 1) return false; + const pos = $from.before(1); + const node = editor.state.doc.nodeAt(pos); + if (!node || !linkable.includes(node.type.name)) return false; + if (!node.attrs.blockId && !editor.isEditable) return false; + void copyBlockLink(editor.view, pos, link, onCopied); + return true; + }, + }; + }, + addProseMirrorPlugins() { const { link, onCopied } = this.options; const labels = this.options.labels!; @@ -284,16 +326,7 @@ class BlockHandle { }; private async copy(at = this.pos) { - if (at < 0 || !this.link) return; - const id = ensureBlockId(this.view, at); - if (!id) return; - const url = this.link(blockHash(id)); - try { - await navigator.clipboard.writeText(url); - this.onCopied?.(url); - } catch { - window.prompt("", url); - } + if (at >= 0 && this.link) await copyBlockLink(this.view, at, this.link, this.onCopied); } update() { diff --git a/Packages/editor/src/blocks.test.ts b/Packages/editor/src/blocks.test.ts index 3b06adc..c4f37a5 100644 --- a/Packages/editor/src/blocks.test.ts +++ b/Packages/editor/src/blocks.test.ts @@ -84,10 +84,18 @@ describe("new blocks", () => { it("offers the new blocks and date shortcuts in the slash menu", () => { const ids = filterCommands(slashCommands(englishLabels), "").map((c) => c.id); - for (const id of ["h4", "h5", "h6", "todo", "callout", "table", "today", "tomorrow", "yesterday", "now"]) { + for (const id of ["otherHeadings", "todo", "callout", "table", "today", "tomorrow", "yesterday", "now"]) { expect(ids).toContain(id); } - expect(filterCommands(slashCommands(englishLabels), "other").map((c) => c.id)).toEqual(["h4", "h5", "h6"]); + // H4-H6 sit in a group, which a search looks into. + const all = slashCommands(englishLabels); + expect(all.find((c) => c.id === "otherHeadings")!.children!.map((c) => c.id)).toEqual(["h4", "h5", "h6"]); + expect(ids).not.toContain("h4"); + expect(filterCommands(all, "other").map((c) => c.id)).toEqual(["otherHeadings"]); + expect(filterCommands(all, "h5").map((c) => c.id)).toEqual(["h5"]); + const headings = filterCommands(all, "heading").map((c) => c.id); + expect(headings).toEqual(expect.arrayContaining(["h1", "h4", "h5", "h6"])); + expect(headings).not.toContain("otherHeadings"); expect(ids).not.toContain("newPage"); const withPages = slashCommands(englishLabels, undefined, undefined, { search: async () => [], @@ -97,6 +105,29 @@ describe("new blocks", () => { }); }); +describe("Ctrl+Shift+C", () => { + it("copies a link to the block the cursor is in, giving it an id", async () => { + const written: string[] = []; + Object.defineProperty(navigator, "clipboard", { + configurable: true, + value: { writeText: async (s: string) => void written.push(s) }, + }); + const copied: string[] = []; + const e = setup("

one

two

", { + blockLink: (hash) => `https://docwell.test/p/x${hash}`, + onBlockLinkCopied: (url) => copied.push(url), + }); + e.commands.setTextSelection(e.state.doc.child(0).nodeSize + 2); + expect(e.commands.keyboardShortcut("Mod-Shift-c")).toBe(true); + await Promise.resolve(); + const id = e.state.doc.child(1).attrs.blockId as string; + expect(id).toMatch(/^[a-z0-9]{8}$/); + expect(written).toEqual([`https://docwell.test/p/x#b-${id}`]); + expect(copied).toEqual(written); + expect(e.state.doc.child(0).attrs.blockId).toBeNull(); + }); +}); + describe("blockActions", () => { const doc = "

one

two

three

"; diff --git a/Packages/editor/src/editor.css b/Packages/editor/src/editor.css index a0c2941..e3890f3 100644 --- a/Packages/editor/src/editor.css +++ b/Packages/editor/src/editor.css @@ -1081,13 +1081,14 @@ .dw-block-menu .dw-suggest__item.is-danger :is(.dw-suggest__label, .dw-suggest__icon) { color: var(--color-danger); } +.dw-suggest__more, .dw-block-menu__more { margin-left: auto; color: var(--color-ink-faint); } -/* ---- Moving table rows (tablerows.ts) ---- */ -.dw-row-grip { +/* ---- Moving table rows and columns (tablemove.ts) ---- */ +.dw-table-grip { position: absolute; z-index: 5; display: grid; @@ -1102,36 +1103,43 @@ cursor: grab; touch-action: none; } -.dw-row-grip::before { +.dw-table-grip--column { + width: 22px; + height: 14px; +} +.dw-table-grip::before { content: ""; width: 4px; height: 10px; background: radial-gradient(circle, currentColor 1px, transparent 1.5px) 0 0 / 4px 4px; } -.dw-row-grip:hover, -.dw-row-grip:active { +.dw-table-grip--column::before { + width: 10px; + height: 4px; +} +.dw-table-grip:hover, +.dw-table-grip:active { color: var(--color-ink); border-color: var(--color-focus-ring); } -.dw-row-grip:active { +.dw-table-grip:active { cursor: grabbing; } -.dw-row-grip[hidden], -.dw-row-drop[hidden] { +.dw-table-grip[hidden], +.dw-table-drop[hidden] { display: none; } -.dw-row-drop { +.dw-table-drop { position: absolute; z-index: 5; - height: 2px; background: var(--color-focus-ring); pointer-events: none; } -.dw-prose tr.dw-row-dragging { +.dw-prose .dw-table-dragging { opacity: 0.45; } @media (max-width: 640px), (hover: none) { - .dw-row-grip { + .dw-table-grip { display: none; } } diff --git a/Packages/editor/src/extensions.ts b/Packages/editor/src/extensions.ts index 9397008..8ce660c 100644 --- a/Packages/editor/src/extensions.ts +++ b/Packages/editor/src/extensions.ts @@ -24,7 +24,7 @@ import { PageLinks, type PageHost } from "./pagelinks"; import type { PdfLoader } from "./pdf"; import { SlashMenu, slashCommands } from "./slash"; import type { CollabProvider } from "./provider"; -import { TableRows } from "./tablerows"; +import { TableMove } from "./tablemove"; import { TableOfContents } from "./toc"; import { docwellToggles } from "./toggle"; @@ -110,7 +110,7 @@ export function docwellExtensions(opts: ExtensionOptions = {}): AnyExtension[] { DocwellHighlight, ...docwellTasks(), ...docwellTables(), - TableRows.configure({ labels }), + TableMove.configure({ labels }), Callout.configure({ labels }), FileDrop.configure({ host: opts.files, onError: opts.onError }), docwellMention(labels, opts.mentions), diff --git a/Packages/editor/src/labels.ts b/Packages/editor/src/labels.ts index 49fb087..ac7107b 100644 --- a/Packages/editor/src/labels.ts +++ b/Packages/editor/src/labels.ts @@ -41,8 +41,12 @@ export interface EditorLabels { toolbar: string; /** The grip on a row's left edge. */ dragRow: string; + /** The grip on a column's top edge. */ + dragColumn: string; moveRowUp: string; moveRowDown: string; + moveColumnLeft: string; + moveColumnRight: string; addRowBefore: string; addRowAfter: string; addColumnBefore: string; @@ -138,9 +142,10 @@ export const englishLabels: EditorLabels = { h1: { label: "Heading 1", description: "Big section heading" }, h2: { label: "Heading 2", description: "Medium section heading" }, h3: { label: "Heading 3", description: "Small section heading" }, - h4: { label: "Heading 4", description: "Other headings: level 4" }, - h5: { label: "Heading 5", description: "Other headings: level 5" }, - h6: { label: "Heading 6", description: "Other headings: level 6" }, + otherHeadings: { label: "Other headings", description: "Headings 4 to 6" }, + h4: { label: "Heading 4", description: "A heading below level 3" }, + h5: { label: "Heading 5", description: "A heading below level 4" }, + h6: { label: "Heading 6", description: "The smallest heading" }, bullet: { label: "Bulleted list", description: "A simple list" }, ordered: { label: "Numbered list", description: "A list with numbers" }, todo: { label: "To-do list", description: "Tasks to tick off (or type [])" }, @@ -201,8 +206,11 @@ export const englishLabels: EditorLabels = { table: { toolbar: "Table", dragRow: "Drag to move the row", + dragColumn: "Drag to move the column", moveRowUp: "Move row up", moveRowDown: "Move row down", + moveColumnLeft: "Move column left", + moveColumnRight: "Move column right", addRowBefore: "Add row above", addRowAfter: "Add row below", addColumnBefore: "Add column left", diff --git a/Packages/editor/src/slash.ts b/Packages/editor/src/slash.ts index be403d1..e39dc51 100644 --- a/Packages/editor/src/slash.ts +++ b/Packages/editor/src/slash.ts @@ -20,6 +20,8 @@ export interface SlashCommand { /** Extra words the filter matches, e.g. "h1" for Heading 1. */ keywords: string[]; run: (editor: Editor, range: Range) => void; + /** A group: picking it opens these instead of running. A search finds them directly too. */ + children?: SlashCommand[]; } /** Opens the system file picker and resolves with the chosen files. */ @@ -67,11 +69,14 @@ export function slashCommands( block("h3", "heading", ["heading", "###"], (e, r) => e.chain().focus().deleteRange(r).setHeading({ level: 3 }).run(), ), - ...([4, 5, 6] as const).map((level) => - block(`h${level}`, "heading", ["heading", "other headings", "#".repeat(level)], (e, r) => - e.chain().focus().deleteRange(r).setHeading({ level }).run(), + { + ...block("otherHeadings", "heading", ["other", "more headings", "smaller"], () => {}), + children: ([4, 5, 6] as const).map((level) => + block(`h${level}`, "heading", ["heading", "#".repeat(level)], (e, r) => + e.chain().focus().deleteRange(r).setHeading({ level }).run(), + ), ), - ), + }, block("bullet", "list", ["list", "ul", "-"], (e, r) => e.chain().focus().deleteRange(r).toggleBulletList().run()), block("ordered", "list-ordered", ["list", "ol", "1."], (e, r) => e.chain().focus().deleteRange(r).toggleOrderedList().run(), @@ -168,14 +173,21 @@ export function slashCommands( return list; } -/** Filters commands by what follows the "/": label, id or keywords. */ +/** + * Filters commands by what follows the "/": label, id or keywords. With a + * query, the commands inside groups are matched and listed on their own. + */ export function filterCommands(commands: SlashCommand[], query: string): SlashCommand[] { const q = query.trim().toLowerCase(); if (!q) return commands; - return commands.filter( - (c) => - c.label.toLowerCase().includes(q) || c.id.startsWith(q) || c.keywords.some((k) => k.toLowerCase().startsWith(q)), - ); + const matches = (c: SlashCommand) => + c.label.toLowerCase().includes(q) || c.id.startsWith(q) || c.keywords.some((k) => k.toLowerCase().startsWith(q)); + return commands.flatMap((c) => { + // A search finds the commands in a group; the group itself when none of them match. + const inside = c.children?.filter(matches) ?? []; + if (inside.length) return inside; + return matches(c) ? [c] : []; + }); } /** Typing "/" at the start of a word opens the block menu. */ @@ -205,6 +217,7 @@ export const SlashMenu = Extension.create<{ commands: SlashCommand[]; labels: Ed empty: this.options.labels.noMatches, showQuery: true, toItem: (c) => ({ label: c.label, description: c.description, icon: c.icon }), + children: (c) => c.children, pick: (p, c) => c.run(p.editor, p.range), }), }), diff --git a/Packages/editor/src/suggestion.ts b/Packages/editor/src/suggestion.ts index 5196697..fe13214 100644 --- a/Packages/editor/src/suggestion.ts +++ b/Packages/editor/src/suggestion.ts @@ -49,16 +49,29 @@ export function floatingList(opts: { toItem: (item: T) => ListItem; pick: (props: SuggestionProps, item: T) => void; showQuery?: boolean; + /** An item that opens a list of its own instead of being picked ("Other headings"). */ + children?: (item: T) => T[] | undefined; }) { return () => { let box: HTMLDivElement | null = null; let stop: (() => void) | null = null; let current: SuggestionProps | null = null; let active = 0; + // The list of a group the user opened, with the group, until the query changes. + let sub: { parent: T; items: T[] } | null = null; + const items = () => sub?.items ?? current?.items ?? []; const choose = (i: number) => { - const item = current?.items[i]; - if (current && item !== undefined) opts.pick(current, item); + const item = items()[i]; + if (!current || item === undefined) return; + const kids = opts.children?.(item); + if (kids?.length) { + sub = { parent: item, items: kids }; + active = 0; + draw(); + return; + } + opts.pick(current, item); }; const draw = () => { @@ -71,7 +84,15 @@ export function floatingList(opts: { q.textContent = `/${p.query}`; box.append(q); } - if (!p.items.length) { + if (sub) { + // The open group, which ArrowLeft or Escape leaves. + const head = document.createElement("div"); + head.className = "dw-suggest__query"; + head.textContent = `‹ ${opts.toItem(sub.parent).label}`; + box.append(head); + } + const list = items(); + if (!list.length) { const empty = document.createElement("div"); empty.className = "dw-suggest__empty"; empty.setAttribute("role", "status"); @@ -79,7 +100,7 @@ export function floatingList(opts: { box.append(empty); return; } - p.items.forEach((raw, i) => { + list.forEach((raw, i) => { const it = opts.toItem(raw); const row = document.createElement("div"); row.className = i === active ? "dw-suggest__item is-active" : "dw-suggest__item"; @@ -106,6 +127,12 @@ export function floatingList(opts: { text.append(desc); } row.append(glyph, text); + if (opts.children?.(raw)?.length) { + row.setAttribute("aria-haspopup", "listbox"); + const more = svgIcon("chevron-right", 14); + more.classList.add("dw-suggest__more"); + row.append(more); + } box!.append(row); }); box.querySelector(".is-active")?.scrollIntoView({ block: "nearest" }); @@ -139,6 +166,7 @@ export function floatingList(opts: { onStart(p: SuggestionProps) { current = p; active = 0; + sub = null; box = document.createElement("div"); box.className = "dw-suggest"; box.setAttribute("role", "listbox"); @@ -148,13 +176,27 @@ export function floatingList(opts: { place(); }, onUpdate(p: SuggestionProps) { - if (p.items !== current?.items) active = 0; + if (p.items !== current?.items) { + active = 0; + sub = null; + } current = p; draw(); place(); }, onKeyDown({ event }: SuggestionKeyDownProps) { - const n = current?.items.length ?? 0; + const n = items().length; + if (sub && (event.key === "Escape" || event.key === "ArrowLeft")) { + sub = null; + active = 0; + draw(); + return true; + } + const at = items()[active]; + if (event.key === "ArrowRight" && at !== undefined && opts.children?.(at)?.length) { + choose(active); + return true; + } if (event.key === "Escape") { close(); return true; diff --git a/Packages/editor/src/tablemove.test.ts b/Packages/editor/src/tablemove.test.ts new file mode 100644 index 0000000..8db2a0e --- /dev/null +++ b/Packages/editor/src/tablemove.test.ts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +import { Editor } from "@tiptap/core"; +import { afterEach, describe, expect, it } from "vitest"; +import { docwellExtensions } from "./extensions"; +import { moveInTable } from "./tablemove"; + +let editor: Editor | undefined; +afterEach(() => editor?.destroy()); + +/** A table after a paragraph; each row is its cells' text. */ +const table = (rows: string[][]) => + `

before

${rows.map((r) => `${r.map((c) => ``).join("")}`).join("")}

${c}

`; + +function setup(html: string) { + editor = new Editor({ extensions: docwellExtensions(), content: html }); + return editor; +} + +const grid = (e: Editor) => { + const out: string[][] = []; + e.state.doc.descendants((n) => { + if (n.type.name === "tableRow") out.push(Array.from({ length: n.childCount }, (_, i) => n.child(i).textContent)); + return n.type.name !== "tableRow"; + }); + return out; +}; + +const tablePos = (e: Editor) => e.state.doc.child(0).nodeSize; + +/** A position inside the cell at row, column. */ +function inCell(e: Editor, row: number, column: number) { + let pos = -1; + let r = 0; + e.state.doc.descendants((n, p) => { + if (pos >= 0) return false; + if (n.type.name !== "tableRow") return true; + if (r++ === row) { + pos = p + 1; + for (let i = 0; i < column; i++) pos += n.child(i).nodeSize; + pos += 2; + } + return false; + }); + return pos; +} + +const abc = [ + ["a", "a2"], + ["b", "b2"], + ["c", "c2"], +]; + +describe("moving table rows", () => { + it("moves a row to another place and keeps the cursor in it", () => { + const e = setup(table(abc)); + e.view.dispatch(moveInTable(e.state, tablePos(e), "row", 0, 2)!); + expect(grid(e).map((r) => r[0])).toEqual(["b", "c", "a"]); + expect(e.state.selection.$from.parent.textContent).toBe("a"); + }); + + it("moves the cursor's row up and down with the commands", () => { + const e = setup(table(abc)); + e.commands.setTextSelection(inCell(e, 1, 0)); + expect(e.commands.moveTableRow(-1)).toBe(true); + expect(grid(e).map((r) => r[0])).toEqual(["b", "a", "c"]); + expect(e.commands.moveTableRow(-1)).toBe(false); + e.commands.moveTableRow(1); + e.commands.moveTableRow(1); + expect(grid(e).map((r) => r[0])).toEqual(["a", "c", "b"]); + expect(e.commands.moveTableRow(1)).toBe(false); + }); + + it("does nothing outside a table, or where a cell spans rows", () => { + const e = setup( + "

before

x

a

b

", + ); + expect(moveInTable(e.state, tablePos(e), "row", 0, 1)).toBeNull(); + e.commands.setTextSelection(2); + expect(e.commands.moveTableRow(1)).toBe(false); + }); +}); + +describe("moving table columns", () => { + const cols = [ + ["n", "r", "x"], + ["ada", "lead", "1"], + ]; + + it("moves a column in every row and keeps the cursor in its cell", () => { + const e = setup(table(cols)); + e.view.dispatch(moveInTable(e.state, tablePos(e), "column", 0, 2, 1)!); + expect(grid(e)).toEqual([ + ["r", "x", "n"], + ["lead", "1", "ada"], + ]); + expect(e.state.selection.$from.parent.textContent).toBe("ada"); + }); + + it("moves the cursor's column left and right with the commands", () => { + const e = setup(table(cols)); + e.commands.setTextSelection(inCell(e, 1, 1)); + expect(e.commands.moveTableColumn(1)).toBe(true); + expect(grid(e)[0]).toEqual(["n", "x", "r"]); + expect(e.state.selection.$from.parent.textContent).toBe("lead"); + expect(e.commands.moveTableColumn(1)).toBe(false); + e.commands.moveTableColumn(-1); + e.commands.moveTableColumn(-1); + expect(grid(e)[1]).toEqual(["lead", "ada", "1"]); + }); + + it("does nothing where a cell spans columns", () => { + const e = setup( + "

before

x

a

b

", + ); + expect(moveInTable(e.state, tablePos(e), "column", 0, 1)).toBeNull(); + }); +}); diff --git a/Packages/editor/src/tablemove.ts b/Packages/editor/src/tablemove.ts new file mode 100644 index 0000000..381aec9 --- /dev/null +++ b/Packages/editor/src/tablemove.ts @@ -0,0 +1,344 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +import { Extension } from "@tiptap/core"; +import { Fragment, type Node as PMNode } from "@tiptap/pm/model"; +import { Plugin, PluginKey, Selection, type EditorState, type Transaction } from "@tiptap/pm/state"; +import type { EditorView } from "@tiptap/pm/view"; +import type { EditorLabels } from "./labels"; + +declare module "@tiptap/core" { + interface Commands { + tableMove: { + /** Moves the table row the selection is in one place up (-1) or down (1). */ + moveTableRow: (direction: -1 | 1) => ReturnType; + /** Moves the table column the selection is in one place left (-1) or right (1). */ + moveTableColumn: (direction: -1 | 1) => ReturnType; + }; + } +} + +export type Axis = "row" | "column"; + +/** + * Whether rows (or columns) can move: cells spanning several of them would + * be pulled apart, and columns need every row to have the same cells. + */ +export function movable(table: PMNode, axis: Axis): boolean { + let ok = true; + const width = table.firstChild?.childCount ?? 0; + table.forEach((row) => { + if (axis === "column" && row.childCount !== width) ok = false; + row.forEach((cell) => { + const span = axis === "row" ? cell.attrs.rowspan : cell.attrs.colspan; + if ((span ?? 1) > 1) ok = false; + }); + }); + return ok; +} + +function moved(list: T[], from: number, to: number): T[] { + const out = [...list]; + const [item] = out.splice(from, 1); + out.splice(to, 0, item!); + return out; +} + +const children = (n: PMNode) => { + const out: PMNode[] = []; + n.forEach((c) => out.push(c)); + return out; +}; + +/** + * A transaction that moves row (or column) from of the table at tablePos to + * index to, as an index in the table as it will be, leaving the cursor in + * the moved row or column. Null when nothing would change or it cannot move. + */ +export function moveInTable( + state: EditorState, + tablePos: number, + axis: Axis, + from: number, + to: number, + /** The row the cursor goes to when a column moves. */ + cursorRow = 0, +): Transaction | null { + const table = state.doc.nodeAt(tablePos); + if (!table || table.type.name !== "table" || !movable(table, axis)) return null; + const rows = children(table); + const count = axis === "row" ? rows.length : (rows[0]?.childCount ?? 0); + if (from === to || from < 0 || to < 0 || from >= count || to >= count) return null; + const newRows = + axis === "row" ? moved(rows, from, to) : rows.map((r) => r.copy(Fragment.fromArray(moved(children(r), from, to)))); + const tr = state.tr.replaceWith(tablePos, tablePos + table.nodeSize, table.copy(Fragment.fromArray(newRows))); + // The cell to put the cursor in: the moved row's first, or the moved column's in cursorRow. + const [row, col] = axis === "row" ? [to, 0] : [Math.min(cursorRow, newRows.length - 1), to]; + let pos = tablePos + 1; + for (let i = 0; i < row; i++) pos += newRows[i]!.nodeSize; + pos += 1; + for (let i = 0; i < col; i++) pos += newRows[row]!.child(i).nodeSize; + return tr.setSelection(Selection.near(tr.doc.resolve(pos + 1))).scrollIntoView(); +} + +/** The table around pos, and the row and column pos is in, or null. */ +function cellAt(state: EditorState, pos: number): { tablePos: number; row: number; column: number } | null { + const $pos = state.doc.resolve(pos); + for (let d = $pos.depth; d > 0; d--) { + if ($pos.node(d).type.name === "table") { + return { tablePos: $pos.before(d), row: $pos.index(d), column: d + 1 <= $pos.depth ? $pos.index(d + 1) : 0 }; + } + } + return null; +} + +/** + * Moving table rows and columns: grips on the left edge of the row and the + * top edge of the column under the pointer drag them to another place, and + * the commands move them from the keyboard (Ctrl+Alt+arrows) or a toolbar. + */ +export const TableMove = Extension.create<{ labels: EditorLabels | null }>({ + name: "tableMove", + + addOptions() { + return { labels: null }; + }, + + addCommands() { + const command = + (axis: Axis) => + (direction: -1 | 1) => + ({ state, dispatch }: { state: EditorState; dispatch?: (tr: Transaction) => void }) => { + const at = cellAt(state, state.selection.from); + if (!at) return false; + const index = axis === "row" ? at.row : at.column; + const tr = moveInTable(state, at.tablePos, axis, index, index + direction, at.row); + if (!tr) return false; + dispatch?.(tr); + return true; + }; + return { moveTableRow: command("row"), moveTableColumn: command("column") }; + }, + + addKeyboardShortcuts() { + return { + "Mod-Alt-ArrowUp": () => this.editor.commands.moveTableRow(-1), + "Mod-Alt-ArrowDown": () => this.editor.commands.moveTableRow(1), + "Mod-Alt-ArrowLeft": () => this.editor.commands.moveTableColumn(-1), + "Mod-Alt-ArrowRight": () => this.editor.commands.moveTableColumn(1), + }; + }, + + addProseMirrorPlugins() { + const t = this.options.labels?.table; + return [ + new Plugin({ + key: new PluginKey("tableMove"), + view: (view) => + new TableGrips(view, { + row: t?.dragRow ?? "Drag to move the row", + column: t?.dragColumn ?? "Drag to move the column", + }), + }), + ]; + }, +}); + +interface Drag { + axis: Axis; + tablePos: number; + from: number; + /** The rows, or the first row's cells, as they are on screen. */ + slots: HTMLElement[]; + /** The cells being moved, dimmed while dragging. */ + dimmed: HTMLElement[]; + to: number; + cursorRow: number; +} + +/** The grips beside the row and column under the pointer, and the line showing where a dragged one will go. */ +class TableGrips { + private grips: Record = { + row: document.createElement("button"), + column: document.createElement("button"), + }; + private line = document.createElement("div"); + private cell: HTMLTableCellElement | null = null; + private drag: Drag | null = null; + + constructor( + private view: EditorView, + labels: Record, + ) { + for (const axis of ["row", "column"] as const) { + const g = this.grips[axis]; + g.type = "button"; + g.className = `dw-table-grip dw-table-grip--${axis}`; + g.contentEditable = "false"; + g.setAttribute("aria-label", labels[axis]); + g.title = labels[axis]; + g.hidden = true; + // Keyboard and screen reader users move rows and columns with the table toolbar or Ctrl+Alt+arrows. + g.tabIndex = -1; + g.addEventListener("pointerdown", (e) => this.start(e, axis)); + g.addEventListener("mouseleave", this.leave); + } + this.line.className = "dw-table-drop"; + this.line.hidden = true; + view.dom.addEventListener("mousemove", this.move); + view.dom.addEventListener("mouseleave", this.leave); + } + + private get host(): HTMLElement | null { + const host = this.view.dom.parentElement; + if (host && this.line.parentElement !== host) { + host.classList.add("dw-block-host"); + host.append(this.grips.row, this.grips.column, this.line); + } + return host; + } + + private hide = () => { + if (this.drag) return; + this.grips.row.hidden = true; + this.grips.column.hidden = true; + this.cell = null; + }; + + private leave = (e: MouseEvent) => { + const to = e.relatedTarget as Node | null; + if (to && (this.grips.row.contains(to) || this.grips.column.contains(to) || this.view.dom.contains(to))) return; + this.hide(); + }; + + private move = (e: MouseEvent) => { + if (this.drag) return; + const cell = (e.target as HTMLElement | null)?.closest?.("td, th"); + const host = this.host; + if (!this.view.editable || !host || !(cell instanceof HTMLTableCellElement) || !this.view.dom.contains(cell)) { + return this.hide(); + } + const at = this.locate(cell); + const table = at && this.view.state.doc.nodeAt(at.tablePos); + if (!at || !table) return this.hide(); + this.cell = cell; + const hostBox = host.getBoundingClientRect(); + const tableBox = cell.closest("table")!.getBoundingClientRect(); + const rowBox = cell.parentElement!.getBoundingClientRect(); + const cellBox = cell.getBoundingClientRect(); + const showRow = table.childCount > 1 && movable(table, "row"); + const showColumn = (table.firstChild?.childCount ?? 0) > 1 && movable(table, "column"); + Object.assign(this.grips.row.style, { + top: `${rowBox.top - hostBox.top + rowBox.height / 2 - 11}px`, + left: `${tableBox.left - hostBox.left - 7}px`, + }); + Object.assign(this.grips.column.style, { + top: `${tableBox.top - hostBox.top - 7}px`, + left: `${cellBox.left - hostBox.left + cellBox.width / 2 - 11}px`, + }); + this.grips.row.hidden = !showRow; + this.grips.column.hidden = !showColumn; + }; + + private locate(cell: HTMLTableCellElement) { + try { + return cellAt(this.view.state, this.view.posAtDOM(cell, 0)); + } catch { + return null; + } + } + + private start(e: PointerEvent, axis: Axis) { + const cell = this.cell; + if (!cell || e.button !== 0) return; + const at = this.locate(cell); + const tbody = cell.parentElement?.parentElement; + if (!at || !tbody) return; + e.preventDefault(); + const grip = this.grips[axis]; + grip.setPointerCapture(e.pointerId); + const rows = [...tbody.children].filter((r): r is HTMLTableRowElement => r instanceof HTMLTableRowElement); + const from = axis === "row" ? at.row : at.column; + const slots = axis === "row" ? rows : ([...(rows[0]?.children ?? [])] as HTMLElement[]); + const dimmed = axis === "row" ? [rows[from]!] : rows.map((r) => r.children[from] as HTMLElement).filter(Boolean); + for (const el of dimmed) el.classList.add("dw-table-dragging"); + this.drag = { axis, tablePos: at.tablePos, from, slots, dimmed, to: from, cursorRow: at.row }; + grip.addEventListener("pointermove", this.dragMove); + grip.addEventListener("pointerup", this.drop); + grip.addEventListener("pointercancel", this.cancel); + } + + /** Shows the line at the gap nearest the pointer. */ + private dragMove = (e: PointerEvent) => { + const d = this.drag; + const host = this.host; + if (!d || !host) return; + const rowAxis = d.axis === "row"; + const point = rowAxis ? e.clientY : e.clientX; + let gap = d.slots.length; + for (const [i, el] of d.slots.entries()) { + const b = el.getBoundingClientRect(); + if (point < (rowAxis ? b.top + b.height / 2 : b.left + b.width / 2)) { + gap = i; + break; + } + } + // A gap next to the moving one itself leaves it where it is. + d.to = gap > d.from ? gap - 1 : gap; + const hostBox = host.getBoundingClientRect(); + const table = d.slots[0]!.closest("table")!.getBoundingClientRect(); + const last = d.slots.at(-1)!.getBoundingClientRect(); + const next = d.slots[gap]?.getBoundingClientRect(); + const edge = rowAxis ? (next?.top ?? last.bottom) : (next?.left ?? last.right); + Object.assign( + this.line.style, + rowAxis + ? { + top: `${edge - hostBox.top - 1}px`, + left: `${table.left - hostBox.left}px`, + width: `${table.width}px`, + height: "2px", + } + : { + top: `${table.top - hostBox.top}px`, + left: `${edge - hostBox.left - 1}px`, + width: "2px", + height: `${table.height}px`, + }, + ); + this.line.hidden = d.to === d.from; + }; + + private drop = () => { + const d = this.drag; + this.cancel(); + if (!d || d.to === d.from) return; + const tr = moveInTable(this.view.state, d.tablePos, d.axis, d.from, d.to, d.cursorRow); + if (tr) this.view.dispatch(tr); + this.view.focus(); + }; + + private cancel = () => { + const d = this.drag; + for (const el of d?.dimmed ?? []) el.classList.remove("dw-table-dragging"); + this.drag = null; + this.line.hidden = true; + for (const g of Object.values(this.grips)) { + g.removeEventListener("pointermove", this.dragMove); + g.removeEventListener("pointerup", this.drop); + g.removeEventListener("pointercancel", this.cancel); + } + this.hide(); + }; + + update() { + if (this.cell && !this.cell.isConnected) this.hide(); + } + + destroy() { + this.cancel(); + for (const g of Object.values(this.grips)) g.remove(); + this.line.remove(); + this.view.dom.removeEventListener("mousemove", this.move); + this.view.dom.removeEventListener("mouseleave", this.leave); + } +} diff --git a/Packages/editor/src/tablerows.test.ts b/Packages/editor/src/tablerows.test.ts deleted file mode 100644 index 0fd7b62..0000000 --- a/Packages/editor/src/tablerows.test.ts +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later - -import { Editor } from "@tiptap/core"; -import { afterEach, describe, expect, it } from "vitest"; -import { docwellExtensions } from "./extensions"; -import { moveRow } from "./tablerows"; - -let editor: Editor | undefined; -afterEach(() => editor?.destroy()); - -const table = (rows: string[]) => - `

before

${rows.map((r) => ``).join("")}

${r}

${r}2

`; - -function setup(html: string) { - editor = new Editor({ extensions: docwellExtensions(), content: html }); - return editor; -} - -const rowTexts = (e: Editor) => { - const out: string[] = []; - e.state.doc.descendants((n) => { - if (n.type.name === "tableRow") out.push(n.firstChild!.textContent); - return n.type.name !== "tableRow"; - }); - return out; -}; - -const tablePos = (e: Editor) => e.state.doc.child(0).nodeSize; - -/** A position inside the first cell of row index. */ -function inRow(e: Editor, index: number) { - let pos = -1; - let seen = 0; - e.state.doc.descendants((n, p) => { - if (pos >= 0) return false; - if (n.type.name === "tableRow" && seen++ === index) pos = p + 3; - return true; - }); - return pos; -} - -describe("moving table rows", () => { - it("moves a row to another place and keeps the cursor in it", () => { - const e = setup(table(["a", "b", "c"])); - e.view.dispatch(moveRow(e.state, tablePos(e), 0, 2)!); - expect(rowTexts(e)).toEqual(["b", "c", "a"]); - expect(e.state.selection.$from.parent.textContent).toBe("a"); - e.view.dispatch(moveRow(e.state, tablePos(e), 2, 1)!); - expect(rowTexts(e)).toEqual(["b", "a", "c"]); - }); - - it("moves the cursor's row up and down from the keyboard command", () => { - const e = setup(table(["a", "b", "c"])); - e.commands.setTextSelection(inRow(e, 1)); - expect(e.commands.moveTableRow(-1)).toBe(true); - expect(rowTexts(e)).toEqual(["b", "a", "c"]); - expect(e.commands.moveTableRow(-1)).toBe(false); - e.commands.moveTableRow(1); - e.commands.moveTableRow(1); - expect(rowTexts(e)).toEqual(["a", "c", "b"]); - expect(e.commands.moveTableRow(1)).toBe(false); - }); - - it("does nothing outside a table, or where a cell spans rows", () => { - const e = setup( - "

before

x

a

b

", - ); - expect(moveRow(e.state, tablePos(e), 0, 1)).toBeNull(); - e.commands.setTextSelection(2); - expect(e.commands.moveTableRow(1)).toBe(false); - }); -}); diff --git a/Packages/editor/src/tablerows.ts b/Packages/editor/src/tablerows.ts deleted file mode 100644 index e0183ed..0000000 --- a/Packages/editor/src/tablerows.ts +++ /dev/null @@ -1,242 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later - -import { Extension } from "@tiptap/core"; -import { Fragment, type Node as PMNode } from "@tiptap/pm/model"; -import { Plugin, PluginKey, Selection, type EditorState, type Transaction } from "@tiptap/pm/state"; -import type { EditorView } from "@tiptap/pm/view"; -import type { EditorLabels } from "./labels"; - -declare module "@tiptap/core" { - interface Commands { - tableRows: { - /** Moves the table row the selection is in one place up (-1) or down (1). */ - moveTableRow: (direction: -1 | 1) => ReturnType; - }; - } -} - -/** Whether a row can move: rows joined by a cell spanning several rows cannot be pulled apart. */ -export function rowsMovable(table: PMNode): boolean { - let ok = true; - table.forEach((row) => row.forEach((cell) => (ok &&= (cell.attrs.rowspan ?? 1) <= 1))); - return ok; -} - -/** - * A transaction that moves row from of the table at tablePos to index to (an - * index in the table as it will be), leaving the cursor in the moved row. - * Null when nothing would change or the rows cannot move. - */ -export function moveRow(state: EditorState, tablePos: number, from: number, to: number): Transaction | null { - const table = state.doc.nodeAt(tablePos); - if (!table || table.type.name !== "table" || !rowsMovable(table)) return null; - const rows: PMNode[] = []; - table.forEach((r) => rows.push(r)); - if (from === to || from < 0 || to < 0 || from >= rows.length || to >= rows.length) return null; - const [row] = rows.splice(from, 1); - rows.splice(to, 0, row!); - const tr = state.tr.replaceWith(tablePos, tablePos + table.nodeSize, table.copy(Fragment.fromArray(rows))); - let rowStart = tablePos + 1; - for (let i = 0; i < to; i++) rowStart += rows[i]!.nodeSize; - return tr.setSelection(Selection.near(tr.doc.resolve(rowStart + 1))).scrollIntoView(); -} - -/** The table around $pos and the index of the row $pos is in, or null. */ -function rowAt(state: EditorState, pos: number): { tablePos: number; index: number } | null { - const $pos = state.doc.resolve(pos); - for (let d = $pos.depth; d > 0; d--) { - if ($pos.node(d).type.name === "table") return { tablePos: $pos.before(d), index: $pos.index(d) }; - } - return null; -} - -/** - * Moving table rows: a grip on the left edge of the row under the pointer - * drags the row to another place, and moveTableRow moves it from the - * keyboard or a toolbar. - */ -export const TableRows = Extension.create<{ labels: EditorLabels | null }>({ - name: "tableRows", - - addOptions() { - return { labels: null }; - }, - - addCommands() { - return { - moveTableRow: - (direction) => - ({ state, dispatch }) => { - const at = rowAt(state, state.selection.from); - if (!at) return false; - const tr = moveRow(state, at.tablePos, at.index, at.index + direction); - if (!tr) return false; - dispatch?.(tr); - return true; - }, - }; - }, - - addKeyboardShortcuts() { - return { - "Mod-Alt-ArrowUp": () => this.editor.commands.moveTableRow(-1), - "Mod-Alt-ArrowDown": () => this.editor.commands.moveTableRow(1), - }; - }, - - addProseMirrorPlugins() { - const label = this.options.labels?.table.dragRow ?? "Drag to move the row"; - return [new Plugin({ key: new PluginKey("tableRows"), view: (view) => new RowGrip(view, label) })]; - }, -}); - -/** The grip beside the table row under the pointer, and the line showing where a dragged row will go. */ -class RowGrip { - private grip = document.createElement("button"); - private line = document.createElement("div"); - private row: HTMLTableRowElement | null = null; - private drag: { tablePos: number; from: number; rows: HTMLTableRowElement[]; to: number } | null = null; - - constructor( - private view: EditorView, - label: string, - ) { - const g = this.grip; - g.type = "button"; - g.className = "dw-row-grip"; - g.contentEditable = "false"; - g.setAttribute("aria-label", label); - g.title = label; - g.hidden = true; - // Keyboard and screen reader users move rows with the table toolbar or Ctrl+Alt+arrows. - g.tabIndex = -1; - g.addEventListener("pointerdown", this.start); - g.addEventListener("mouseleave", this.leave); - this.line.className = "dw-row-drop"; - this.line.hidden = true; - view.dom.addEventListener("mousemove", this.move); - view.dom.addEventListener("mouseleave", this.leave); - } - - private get host(): HTMLElement | null { - const host = this.view.dom.parentElement; - if (host && this.grip.parentElement !== host) { - host.classList.add("dw-block-host"); - host.append(this.grip, this.line); - } - return host; - } - - private hide = () => { - if (this.drag) return; - this.grip.hidden = true; - this.row = null; - }; - - private leave = (e: MouseEvent) => { - const to = e.relatedTarget as Node | null; - if (to && (this.grip.contains(to) || this.view.dom.contains(to))) return; - this.hide(); - }; - - private move = (e: MouseEvent) => { - if (this.drag) return; - const tr = (e.target as HTMLElement | null)?.closest?.("tr"); - const host = this.host; - if (!this.view.editable || !host || !(tr instanceof HTMLTableRowElement) || !this.view.dom.contains(tr)) { - return this.hide(); - } - const at = this.locate(tr); - const table = at && this.view.state.doc.nodeAt(at.tablePos); - if (!at || !table || table.childCount < 2 || !rowsMovable(table)) return this.hide(); - this.row = tr; - const box = tr.getBoundingClientRect(); - const hostBox = host.getBoundingClientRect(); - Object.assign(this.grip.style, { - top: `${box.top - hostBox.top + box.height / 2 - 11}px`, - left: `${box.left - hostBox.left - 7}px`, - }); - this.grip.hidden = false; - }; - - private locate(tr: HTMLTableRowElement) { - try { - return rowAt(this.view.state, this.view.posAtDOM(tr, 0)); - } catch { - return null; - } - } - - private start = (e: PointerEvent) => { - if (!this.row || e.button !== 0) return; - const at = this.locate(this.row); - const tbody = this.row.parentElement; - if (!at || !tbody) return; - e.preventDefault(); - this.grip.setPointerCapture(e.pointerId); - const rows = [...tbody.children].filter((r): r is HTMLTableRowElement => r instanceof HTMLTableRowElement); - this.drag = { tablePos: at.tablePos, from: at.index, rows, to: at.index }; - this.row.classList.add("dw-row-dragging"); - this.grip.addEventListener("pointermove", this.dragMove); - this.grip.addEventListener("pointerup", this.drop); - this.grip.addEventListener("pointercancel", this.cancel); - }; - - /** Shows the line at the gap between rows nearest the pointer. */ - private dragMove = (e: PointerEvent) => { - const d = this.drag; - const host = this.host; - if (!d || !host) return; - let gap = d.rows.length; - for (const [i, r] of d.rows.entries()) { - const b = r.getBoundingClientRect(); - if (e.clientY < b.top + b.height / 2) { - gap = i; - break; - } - } - // A gap next to the row itself leaves it where it is. - d.to = gap > d.from ? gap - 1 : gap; - const hostBox = host.getBoundingClientRect(); - const first = d.rows[0]!.getBoundingClientRect(); - const edge = - gap < d.rows.length ? d.rows[gap]!.getBoundingClientRect().top : d.rows.at(-1)!.getBoundingClientRect().bottom; - Object.assign(this.line.style, { - top: `${edge - hostBox.top - 1}px`, - left: `${first.left - hostBox.left}px`, - width: `${first.width}px`, - }); - this.line.hidden = d.to === d.from; - }; - - private drop = () => { - const d = this.drag; - this.cancel(); - if (!d || d.to === d.from) return; - const tr = moveRow(this.view.state, d.tablePos, d.from, d.to); - if (tr) this.view.dispatch(tr); - this.view.focus(); - }; - - private cancel = () => { - this.row?.classList.remove("dw-row-dragging"); - this.drag = null; - this.line.hidden = true; - this.grip.removeEventListener("pointermove", this.dragMove); - this.grip.removeEventListener("pointerup", this.drop); - this.grip.removeEventListener("pointercancel", this.cancel); - this.hide(); - }; - - update() { - if (this.row && !this.row.isConnected) this.hide(); - } - - destroy() { - this.cancel(); - this.grip.remove(); - this.line.remove(); - this.view.dom.removeEventListener("mousemove", this.move); - this.view.dom.removeEventListener("mouseleave", this.leave); - } -} diff --git a/Server/internal/api/api.gen.go b/Server/internal/api/api.gen.go index b0512af..9a04ce4 100644 --- a/Server/internal/api/api.gen.go +++ b/Server/internal/api/api.gen.go @@ -503,6 +503,7 @@ func (e CreateApiTokenJSONBodyScope) Valid() bool { // Defines values for ExportPageParamsFormat. const ( + ExportPageParamsFormatDocx ExportPageParamsFormat = "docx" ExportPageParamsFormatHtml ExportPageParamsFormat = "html" ExportPageParamsFormatMarkdown ExportPageParamsFormat = "markdown" ExportPageParamsFormatPdf ExportPageParamsFormat = "pdf" @@ -511,6 +512,8 @@ const ( // Valid indicates whether the value is a known member of the ExportPageParamsFormat enum. func (e ExportPageParamsFormat) Valid() bool { switch e { + case ExportPageParamsFormatDocx: + return true case ExportPageParamsFormatHtml: return true case ExportPageParamsFormatMarkdown: diff --git a/Server/internal/convert/blocks_test.go b/Server/internal/convert/blocks_test.go index 1ba5517..e39fe2d 100644 --- a/Server/internal/convert/blocks_test.go +++ b/Server/internal/convert/blocks_test.go @@ -3,7 +3,11 @@ package convert import ( + "archive/zip" "bytes" + "encoding/xml" + "errors" + "io" "strings" "testing" ) @@ -151,3 +155,93 @@ func TestNearestPalette(t *testing.T) { } } } + +func TestDOCXRoundTrip(t *testing.T) { + src := mustParse(t, phaseA) + data, err := DOCX("Blocks", src, DOCXOptions{}) + if err != nil { + t.Fatal(err) + } + doc, _, err := FromDOCX(data) + if err != nil { + t.Fatal(err) + } + title, body := Title(doc) + if title != "Blocks" { + t.Errorf("title = %q", title) + } + if got, want := Markdown(body, Options{}), Markdown(src, Options{}); got != want { + t.Errorf("word round trip:\n%s\nwant\n%s", got, want) + } + j := asJSON(t, body) + for _, want := range []string{ + `"textAlign":"right"`, `"textAlign":"center"`, + `{"type":"textColor","attrs":{"color":"red"}}`, `{"type":"highlight","attrs":{"color":"green"}}`, + `{"type":"callout","attrs":{"color":"red","emoji":"🔥"}`, `"type":"tableHeader"`, + } { + if !strings.Contains(j, want) { + t.Errorf("word import lacks %s:\n%s", want, j) + } + } +} + +func TestDOCXListsCodeLinksAndImages(t *testing.T) { + src := mustParse(t, sample) + data, err := DOCX("", src, DOCXOptions{ + Options: Options{FileURL: func(p string) string { return "https://api.docwell.test" + p }}, + Image: func(string) ([]byte, error) { return pngOf(t, 4, 2), nil }, + }) + if err != nil { + t.Fatal(err) + } + doc, assets, err := FromDOCX(data) + if err != nil { + t.Fatal(err) + } + md := Markdown(doc, Options{}) + for _, want := range []string{ + `## Plan & \`, + "[a link](https://docwell.test/x)", + "- one\n\n 1. nested\n- two", + "```\nx := 1 < 2\n```", + "> quoted", + "![diagram](asset:0)", + } { + if !strings.Contains(md, want) { + t.Errorf("markdown lacks %q:\n%s", want, md) + } + } + if strings.Contains(md, "javascript:") { + t.Error("unsafe link kept") + } + if len(assets) != 1 { + t.Errorf("assets = %d", len(assets)) + } +} + +func TestDOCXIsWellFormed(t *testing.T) { + data, err := DOCX("A & ", mustParse(t, phaseA), DOCXOptions{}) + if err != nil { + t.Fatal(err) + } + zr, err := zip.NewReader(bytes.NewReader(data), int64(len(data))) + if err != nil { + t.Fatal(err) + } + for _, f := range zr.File { + if !strings.HasSuffix(f.Name, ".xml") && !strings.HasSuffix(f.Name, ".rels") { + continue + } + rc, _ := f.Open() + d := xml.NewDecoder(rc) + for { + if _, err := d.Token(); err != nil { + if !errors.Is(err, io.EOF) { + t.Errorf("%s: %v", f.Name, err) + } + break + } + } + _ = rc.Close() + } +} diff --git a/Server/internal/convert/docx.go b/Server/internal/convert/docx.go index 6f6a3c4..7b994cd 100644 --- a/Server/internal/convert/docx.go +++ b/Server/internal/convert/docx.go @@ -357,9 +357,11 @@ var headingStyle = regexp.MustCompile(`^heading\s*([1-9])$`) // para is a Word paragraph after its style is known. type para struct { - kind string // paragraph, heading, quote, code, list + kind string // paragraph, heading, quote, code, list, callout, task level int // heading level, or list depth align string // "center" or "right", or "" for the default + color string // a callout's palette colour + checked bool // a ticked to-do ordered bool inline []Node text string // code paragraphs keep their plain text @@ -406,6 +408,22 @@ func (d *docxReader) blocks(nodes []*xnode) []Node { if inl := trimInline(p.inline); len(inl) > 0 { out = append(out, withAlign(Node{Type: "heading", Attrs: map[string]any{"level": float64(min(p.level, 6))}, Content: inl}, p.align)) } + case "callout": + // Paragraphs in the Callout style with the same shading are one callout. + q := Node{Type: "paragraph", Content: trimInline(p.inline)} + if l := len(out) - 1; l >= 0 && out[l].Type == "callout" && out[l].attr("color") == p.color { + out[l].Content = append(out[l].Content, q) + } else { + emoji, body := liftEmoji([]Node{q}) + out = append(out, newCallout(emoji, p.color, body)) + } + case "task": + item := Node{Type: "taskItem", Attrs: map[string]any{"checked": p.checked}, Content: []Node{{Type: "paragraph", Content: trimInline(p.inline)}}} + if l := len(out) - 1; l >= 0 && out[l].Type == "taskList" { + out[l].Content = append(out[l].Content, item) + } else { + out = append(out, Node{Type: "taskList", Content: []Node{item}}) + } case "quote": if inl := trimInline(p.inline); len(inl) > 0 { q := Node{Type: "paragraph", Content: inl} @@ -512,6 +530,9 @@ func (d *docxReader) paragraph(p *xnode) para { out.kind, out.level = "heading", outline case name == "subtitle": out.kind, out.level = "heading", 2 + case name == "callout": + out.kind = "callout" + out.color = paletteNamed(paletteBackground, ppr.child("shd").attrValue("fill")) case strings.Contains(name, "quote"): out.kind = "quote" case strings.Contains(name, "code") || strings.Contains(name, "preformatted") || name == "source": @@ -541,6 +562,12 @@ func (d *docxReader) paragraph(p *xnode) para { if out.kind == "code" { out.text = PlainText(Node{Content: r.inline}) } + // A paragraph starting with a ballot box is a to-do (how DOCX writes them). + if out.kind == "paragraph" || out.kind == "list" { + if checked, rest, ok := ballot(out.inline); ok { + out.kind, out.checked, out.inline = "task", checked, rest + } + } return out } @@ -621,6 +648,46 @@ func (r *runReader) children(nodes []*xnode, marks []Mark) { } } +// paletteNamed is the palette colour whose value in table is hex ("rrggbb"), or "". +func paletteNamed(table map[string]string, hex string) string { + for name, v := range table { + if strings.EqualFold(strings.TrimPrefix(v, "#"), hex) { + return name + } + } + return "" +} + +func (n *xnode) attrValue(key string) string { + if n == nil { + return "" + } + return n.attrs[key] +} + +// ballot takes a leading "☐ " or "☒ " off a paragraph and tells whether it was ticked. +func ballot(inline []Node) (checked bool, rest []Node, ok bool) { + i := 0 + for i < len(inline) && inline[i].Type == "text" && strings.TrimSpace(inline[i].Text) == "" { + i++ + } + if i == len(inline) || inline[i].Type != "text" { + return false, inline, false + } + t := strings.TrimLeft(inline[i].Text, " ") + for box, on := range map[string]bool{"☐": false, "☒": true, "☑": true} { + if after, found := strings.CutPrefix(t, box); found { + rest = append([]Node{}, inline[i:]...) + rest[0].Text = strings.TrimLeft(after, "  ") + if rest[0].Text == "" { + rest = rest[1:] + } + return on, rest, true + } + } + return false, inline, false +} + // wordHighlight maps Word's highlight colours to the palette. var wordHighlight = map[string]string{ "yellow": "yellow", "darkYellow": "yellow", "green": "green", "darkGreen": "green", "cyan": "teal", @@ -679,6 +746,10 @@ func (r *runReader) run(n *xnode, marks []Mark) { if c, ok := wordHighlight[rpr.val("highlight")]; ok { marks = withMark(marks, Mark{Type: "highlight", Attrs: map[string]any{"color": c}}) } + // Shading in a palette colour is a highlight too (how DOCX writes them). + if c := paletteNamed(paletteBackground, rpr.child("shd").attrValue("fill")); c != "" { + marks = withMark(marks, Mark{Type: "highlight", Attrs: map[string]any{"color": c}}) + } } if r.link != "" { marks = withLink(marks, r.link) diff --git a/Server/internal/convert/docx_export.go b/Server/internal/convert/docx_export.go new file mode 100644 index 0000000..b92ac2d --- /dev/null +++ b/Server/internal/convert/docx_export.go @@ -0,0 +1,685 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +package convert + +import ( + "archive/zip" + "bytes" + "fmt" + "strconv" + "strings" + "time" +) + +// DOCXOptions adjust a Word export. +type DOCXOptions struct { + Options + // BaseURL makes server paths (/p/, attachments) absolute links. + BaseURL string + // Image loads an image by its document URL; nil, or an error, leaves a + // link to the image in its place. + Image func(src string) ([]byte, error) +} + +// DOCX renders a page as a Word document with the title on top. Headings, +// lists, to-dos, quotes, callouts, code, tables, alignment, text colours and +// highlights, links and images are kept in a form FromDOCX reads back. +// Diagrams and embeds become links, formulas their LaTeX. +func DOCX(title string, doc Node, o DOCXOptions) ([]byte, error) { + w := &docxWriter{o: o} + if strings.TrimSpace(title) != "" { + w.para(paraProps{style: "Title"}, func() { w.text(title, runProps{}) }) + } + w.blocks(doc.Content, blockCtx{}) + return w.pack(title) +} + +// ---- Package --------------------------------------------------------------- + +const ( + docxTypes = ` +` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + docxRootRels = ` +` + + `` + + `` + + `` + relStyles = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" + relNumbering = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" + relLink = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" + relImage = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" +) + +func (w *docxWriter) pack(title string) ([]byte, error) { + var buf bytes.Buffer + z := zip.NewWriter(&buf) + put := func(name, body string) error { + f, err := z.Create(name) + if err == nil { + _, err = f.Write([]byte(body)) + } + return err + } + rels := ` +` + + `` + + `` + for _, r := range w.rels { + mode := "" + if r.external { + mode = ` TargetMode="External"` + } + rels += `` + } + rels += `` + document := ` +` + + w.b.String() + + `` + + `` + + `` + core := ` +` + + `` + xmlText(title) + `Docwell` + + `` + time.Now().UTC().Format(time.RFC3339) + `` + + `` + for _, p := range []struct{ name, body string }{ + {"[Content_Types].xml", docxTypes}, {"_rels/.rels", docxRootRels}, {"docProps/core.xml", core}, + {"word/document.xml", document}, {"word/_rels/document.xml.rels", rels}, + {"word/styles.xml", docxStyles}, {"word/numbering.xml", w.numbering()}, + } { + if err := put(p.name, p.body); err != nil { + return nil, err + } + } + for _, m := range w.media { + f, err := z.Create("word/media/" + m.name) + if err != nil { + return nil, err + } + if _, err := f.Write(m.data); err != nil { + return nil, err + } + } + if err := z.Close(); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// The styles FromDOCX recognises by name: headings, Title, Quote, Code and +// Callout, plus the Hyperlink character style and a bordered table style. +var docxStyles = func() string { + var b strings.Builder + b.WriteString(` +` + + `` + + `` + + `` + + `` + + `` + + ``) + sizes := []int{36, 30, 26, 24, 22, 20} + for i, sz := range sizes { + fmt.Fprintf(&b, ``+ + ``+ + ``, i+1, i+1, i, sz) + } + b.WriteString(`` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + `` + + ``) + return b.String() +}() + +// numbering lists a bulleted and a numbered pattern, and one list instance +// per list in the document so each numbered list counts from its own start. +func (w *docxWriter) numbering() string { + var b strings.Builder + b.WriteString(` +`) + bullets := []string{"•", "◦", "▪"} + for abs, ordered := range []bool{false, true} { + fmt.Fprintf(&b, ``, abs+1) + for lvl := range 9 { + if ordered { + fmt.Fprintf(&b, ``, lvl, lvl+1) + } else { + fmt.Fprintf(&b, ``, lvl, bullets[lvl%3]) + } + fmt.Fprintf(&b, ``, 720+lvl*360) + } + b.WriteString(``) + } + for i, n := range w.nums { + abs := 1 + if n.ordered { + abs = 2 + } + fmt.Fprintf(&b, ``, i+1, abs) + if n.ordered && n.start != 1 { + fmt.Fprintf(&b, ``, n.level, n.start) + } + b.WriteString(``) + } + b.WriteString(``) + return b.String() +} + +// ---- Document -------------------------------------------------------------- + +type docxRel struct { + id, typ, target string + external bool +} + +type docxNum struct { + ordered bool + level int + start int +} + +type docxWriter struct { + o DOCXOptions + b strings.Builder + rels []docxRel + media []struct { + name string + data []byte + } + nums []docxNum + images int +} + +// blockCtx is what surrounds a block: a quote, a callout, list depth. +type blockCtx struct { + quote bool + callout string // the callout's colour, "" outside one + depth int // list nesting, for indentation +} + +type paraProps struct { + style string + align string + numID int + ilvl int + indent int // left indent in twips + shading string // background "rrggbb" + border string // left border colour "rrggbb" + rule bool // a horizontal line under the paragraph +} + +type runProps struct { + bold, italic, underline, strike, code bool + color, shade, href string +} + +func (w *docxWriter) rel(typ, target string, external bool) string { + id := "rId" + strconv.Itoa(len(w.rels)+3) + w.rels = append(w.rels, docxRel{id: id, typ: typ, target: target, external: external}) + return id +} + +// link makes a document URL something Word can open, or "". +func (w *docxWriter) link(href string) string { + href = w.o.file(href) + if strings.HasPrefix(href, "/") && !strings.HasPrefix(href, "//") { + if w.o.BaseURL == "" { + return "" + } + href = strings.TrimRight(w.o.BaseURL, "/") + href + } + if !safeURL.MatchString(href) || strings.HasPrefix(href, "#") { + return "" + } + return href +} + +func (w *docxWriter) para(p paraProps, content func()) { + w.b.WriteString("") + if p.style != "" { + w.b.WriteString(``) + } + if p.numID > 0 { + fmt.Fprintf(&w.b, ``, p.ilvl, p.numID) + } + if p.border != "" || p.rule { + w.b.WriteString("") + if p.border != "" { + w.b.WriteString(``) + } + if p.rule { + w.b.WriteString(``) + } + w.b.WriteString("") + } + if p.shading != "" { + w.b.WriteString(``) + } + if p.indent > 0 { + fmt.Fprintf(&w.b, ``, p.indent) + } + if p.align != "" { + w.b.WriteString(``) + } + w.b.WriteString("") + if content != nil { + content() + } + w.b.WriteString("") +} + +// textPara is the paragraph style a text block gets where it is. +func (w *docxWriter) textPara(ctx blockCtx) paraProps { + switch { + case ctx.callout != "": + bg := strings.TrimPrefix(paletteBackground[ctx.callout], "#") + fg := strings.TrimPrefix(paletteText[ctx.callout], "#") + return paraProps{style: "Callout", shading: bg, border: fg} + case ctx.quote: + return paraProps{style: "Quote"} + case ctx.depth > 0: + return paraProps{indent: 720 + (ctx.depth-1)*360} + } + return paraProps{} +} + +func (w *docxWriter) blocks(nodes []Node, ctx blockCtx) { + for _, n := range nodes { + w.block(n, ctx) + } +} + +func (w *docxWriter) block(n Node, ctx blockCtx) { + switch n.Type { + case "paragraph": + p := w.textPara(ctx) + p.align = docxAlign(n) + w.para(p, func() { w.inline(n.Content, runProps{}) }) + case "heading": + level := min(max(n.intAttr("level", 1), 1), 6) + w.para(paraProps{style: "Heading" + strconv.Itoa(level), align: docxAlign(n)}, func() { w.inline(n.Content, runProps{}) }) + case "bulletList", "orderedList": + w.list(n, ctx) + case "taskList": + // FromDOCX reads paragraphs starting with a ballot box back as to-dos. + for _, item := range n.Content { + box := "☐ " + if item.Attrs["checked"] == true { + box = "☒ " + } + for i, c := range item.Content { + if i == 0 && c.Type == "paragraph" { + p := paraProps{style: "ListParagraph", indent: 360 + ctx.depth*360} + w.para(p, func() { + w.text(box, runProps{}) + w.inline(c.Content, runProps{}) + }) + continue + } + w.block(c, blockCtx{depth: ctx.depth + 1}) + } + } + case "blockquote": + ctx.quote = true + w.blocks(n.Content, ctx) + case "callout": + emoji, color := calloutParts(n) + ctx.callout = color + body := n.Content + // The emoji leads the first paragraph, where FromDOCX lifts it off again. + if len(body) > 0 && body[0].Type == "paragraph" { + first := body[0] + first.Content = append([]Node{{Type: "text", Text: emoji + " "}}, first.Content...) + body = append([]Node{first}, body[1:]...) + } else { + body = append([]Node{{Type: "paragraph", Content: []Node{{Type: "text", Text: emoji}}}}, body...) + } + w.blocks(body, ctx) + case "codeBlock": + w.code(PlainText(n)) + case "mermaid": + w.code(n.attr("code")) + case "blockMath": + w.para(paraProps{align: "center"}, func() { w.text(n.attr("latex"), runProps{code: true}) }) + case "horizontalRule": + w.para(paraProps{rule: true}, nil) + case "image": + w.image(n.attr("src"), n.attr("alt")) + case "drawio", "excalidraw": + label := "Draw.io diagram" + if n.Type == "excalidraw" { + label = "Excalidraw drawing" + } + w.para(paraProps{}, func() { w.text(label, runProps{italic: true, href: w.link(n.attr("src"))}) }) + case "fileAttachment": + w.para(paraProps{}, func() { w.text(n.attr("name"), runProps{href: w.link(n.attr("url"))}) }) + case "embed", "linkCard": + title := n.attr("title") + if title == "" { + title = n.attr("url") + } + w.para(paraProps{}, func() { + w.text(title, runProps{href: w.link(n.attr("url"))}) + if d := n.attr("description"); d != "" { + w.b.WriteString("") + w.text(d, runProps{color: "787878"}) + } + }) + case "tableOfContents": + // Word builds its own from the headings (References > Table of Contents). + case "details": + for _, c := range n.Content { + if c.Type == "detailsSummary" { + w.para(w.textPara(ctx), func() { w.inline(c.Content, runProps{bold: true}) }) + } else { + w.blocks(c.Content, ctx) + } + } + case "table": + w.table(n) + default: + w.blocks(n.Content, ctx) + } +} + +func docxAlign(n Node) string { + switch alignOf(n) { + case "center": + return "center" + case "right": + return "right" + } + return "" +} + +// list writes a bulleted or numbered list as numbered paragraphs, nesting +// by level; more blocks in an item follow indented under it. +func (w *docxWriter) list(n Node, ctx blockCtx) { + w.nums = append(w.nums, docxNum{ordered: n.Type == "orderedList", level: ctx.depth, start: n.intAttr("start", 1)}) + id := len(w.nums) + for _, item := range n.Content { + for i, c := range item.Content { + if i == 0 && c.Type == "paragraph" { + w.para(paraProps{style: "ListParagraph", numID: id, ilvl: min(ctx.depth, 8)}, func() { w.inline(c.Content, runProps{}) }) + continue + } + w.block(c, blockCtx{depth: ctx.depth + 1}) + } + } +} + +func (w *docxWriter) code(text string) { + for _, line := range strings.Split(strings.ReplaceAll(text, "\t", " "), "\n") { + w.para(paraProps{style: "Code"}, func() { w.text(line, runProps{}) }) + } + // A little room after the block. + w.para(paraProps{}, nil) +} + +// table writes a bordered table across the page. A row of header cells +// repeats on every page, which is also how FromDOCX tells header rows. +func (w *docxWriter) table(n Node) { + cols := 0 + for _, row := range n.Content { + width := 0 + for _, c := range row.Content { + width += max(c.intAttr("colspan", 1), 1) + } + cols = max(cols, width) + } + if cols == 0 { + return + } + const total = 9026 // the text width of an A4 page with 1" margins, in twips + w.b.WriteString(`` + + ``) + for range cols { + fmt.Fprintf(&w.b, ``, total/cols) + } + w.b.WriteString("") + for _, row := range n.Content { + header := len(row.Content) > 0 + for _, c := range row.Content { + header = header && c.Type == "tableHeader" + } + w.b.WriteString("") + if header { + w.b.WriteString("") + } + for _, c := range row.Content { + span := max(c.intAttr("colspan", 1), 1) + fmt.Fprintf(&w.b, ``, total/cols*span) + if span > 1 { + fmt.Fprintf(&w.b, ``, span) + } + if c.Type == "tableHeader" { + w.b.WriteString(``) + } + w.b.WriteString("") + start := w.b.Len() + for _, b := range c.Content { + if b.Type == "paragraph" && c.Type == "tableHeader" { + w.para(paraProps{style: "TableHeading", align: docxAlign(b)}, func() { w.inline(b.Content, runProps{}) }) + continue + } + w.block(b, blockCtx{}) + } + if w.b.Len() == start || !strings.HasSuffix(w.b.String(), "") { + // A cell must end with a paragraph. + w.para(paraProps{}, nil) + } + w.b.WriteString("") + } + w.b.WriteString("") + } + w.b.WriteString("") + // Word joins tables that touch; a paragraph keeps the next block apart. + w.para(paraProps{}, nil) +} + +func (w *docxWriter) inline(nodes []Node, base runProps) { + for _, n := range nodes { + switch n.Type { + case "text": + p := base + for _, m := range n.Marks { + switch m.Type { + case "bold": + p.bold = true + case "italic": + p.italic = true + case "underline": + p.underline = true + case "strike": + p.strike = true + case "code": + p.code = true + case "textColor": + if c, ok := paletteText[m.attr("color")]; ok { + p.color = strings.TrimPrefix(c, "#") + } + case "highlight": + c, ok := paletteBackground[m.attr("color")] + if !ok { + c = paletteBackground["yellow"] + } + p.shade = strings.TrimPrefix(c, "#") + case "link": + p.href = w.link(m.attr("href")) + } + } + w.text(n.Text, p) + case "hardBreak": + w.b.WriteString("") + case "inlineMath": + w.text(n.attr("latex"), runProps{code: true}) + case "mention": + w.text("@"+mentionLabel(n), runProps{bold: true}) + case "dateMention": + w.text(n.attr("date"), runProps{bold: true}) + default: + w.inline(n.Content, base) + } + } +} + +// text writes one run, inside a hyperlink when it links somewhere. +func (w *docxWriter) text(s string, p runProps) { + if s == "" { + return + } + if p.href != "" { + w.b.WriteString(``) + } + w.b.WriteString("") + if p.href != "" { + w.b.WriteString(``) + } + if p.code { + w.b.WriteString(``) + } + if p.bold { + w.b.WriteString("") + } + if p.italic { + w.b.WriteString("") + } + if p.strike { + w.b.WriteString("") + } + if p.color != "" { + w.b.WriteString(``) + } + if p.underline { + w.b.WriteString(``) + } + if p.shade != "" { + w.b.WriteString(``) + } + w.b.WriteString("") + for i, line := range strings.Split(s, "\n") { + if i > 0 { + w.b.WriteString("") + } + for j, part := range strings.Split(line, "\t") { + if j > 0 { + w.b.WriteString("") + } + if part != "" { + w.b.WriteString(`` + xmlText(part) + ``) + } + } + } + w.b.WriteString("") + if p.href != "" { + w.b.WriteString("") + } +} + +// image embeds a picture at its size (96 pixels to the inch), shrunk to the +// page width, or links to it when it cannot be loaded. +func (w *docxWriter) image(src, alt string) { + fallback := func() { + text := "Image" + if alt != "" { + text += ": " + alt + } + w.para(paraProps{}, func() { w.text("["+text+"]", runProps{italic: true, href: w.link(src)}) }) + } + if w.o.Image == nil || src == "" { + fallback() + return + } + data, err := w.o.Image(src) + if err != nil { + fallback() + return + } + kind, body, px, py, err := pdfImage(data) + if err != nil { + fallback() + return + } + const emuPerPx, maxW = 9525, 5731510 // 6.27" in EMU + cx, cy := int64(px)*emuPerPx, int64(py)*emuPerPx + if cx > maxW { + cx, cy = maxW, cy*maxW/cx + } + w.images++ + ext := "png" + if kind == "JPG" { + ext = "jpeg" + } + name := "image" + strconv.Itoa(w.images) + "." + ext + w.media = append(w.media, struct { + name string + data []byte + }{name, body}) + rid := w.rel(relImage, "media/"+name, false) + id := strconv.Itoa(w.images) + w.para(paraProps{}, func() { + fmt.Fprintf(&w.b, ``+ + ``+ + ``+ + ``+ + ``+ + ``+ + ``+ + ``, + cx, cy, id, id, xmlText(alt), id, name, rid, cx, cy) + }) +} + +// xmlText escapes text for XML and leaves out the control characters XML +// cannot hold. +func xmlText(s string) string { + var b strings.Builder + for _, r := range s { + switch { + case r == '&': + b.WriteString("&") + case r == '<': + b.WriteString("<") + case r == '>': + b.WriteString(">") + case r == '"': + b.WriteString(""") + case r < 0x20 && r != '\t' && r != '\n' && r != '\r', r == 0xFFFE, r == 0xFFFF: + default: + b.WriteRune(r) + } + } + return b.String() +} diff --git a/Server/internal/directory/transfer.go b/Server/internal/directory/transfer.go index c163f03..1bae3a3 100644 --- a/Server/internal/directory/transfer.go +++ b/Server/internal/directory/transfer.go @@ -60,8 +60,8 @@ func exportName(title, ext string) string { return name + ext } -// ExportPage renders a page as Markdown ("markdown"), HTML ("html") or PDF -// ("pdf") (viewer). +// ExportPage renders a page as Markdown ("markdown"), HTML ("html"), PDF +// ("pdf") or Word ("docx") (viewer). func (s *Service) ExportPage(ctx context.Context, c access.Caller, id, format string) (Export, error) { p, _, err := s.pageFor(ctx, c, id) if err != nil { @@ -96,11 +96,24 @@ func (s *Service) ExportPage(ctx context.Context, c access.Caller, id, format st return Export{}, err } return Export{Filename: exportName(p.Title, ".pdf"), ContentType: "application/pdf", Body: body}, nil + case "docx": + body, err := convert.DOCX(p.Title, doc, convert.DOCXOptions{ + Options: opts, BaseURL: s.publicURL, + Image: func(src string) ([]byte, error) { return s.pdfImage(ctx, c, src) }, + }) + if err != nil { + return Export{}, err + } + return Export{ + Filename: exportName(p.Title, ".docx"), + ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + Body: body, + }, nil } - return Export{}, apperr.InvalidFields(map[string]string{"format": "Format must be markdown, html or pdf."}) + return Export{}, apperr.InvalidFields(map[string]string{"format": "Format must be markdown, html, pdf or docx."}) } -// pdfImage loads an attachment the caller can read for a PDF export. Images +// pdfImage loads an attachment the caller can read for a PDF or Word export. Images // on other sites are not fetched: the server would make requests on a // reader's behalf to wherever a document points. func (s *Service) pdfImage(ctx context.Context, c access.Caller, src string) ([]byte, error) { diff --git a/Web-App/frontend/src/locales/de.json b/Web-App/frontend/src/locales/de.json index 5120d2a..19d50dd 100644 --- a/Web-App/frontend/src/locales/de.json +++ b/Web-App/frontend/src/locales/de.json @@ -283,6 +283,7 @@ "exportMarkdown": "Als Markdown exportieren", "exportHtml": "Als HTML exportieren", "exportPdf": "Als PDF exportieren", + "exportDocx": "Als Word exportieren", "backlinks": "Verlinkt von {n} Seite | Verlinkt von {n} Seiten", "find": "Suchen und ersetzen", "fullWidth": "Volle Breite", @@ -496,17 +497,21 @@ "label": "Linkkarte", "description": "Ein Link mit Titel und Bild seiner Seite" }, + "otherHeadings": { + "label": "Weitere Überschriften", + "description": "Überschriften 4 bis 6" + }, "h4": { "label": "Überschrift 4", - "description": "Weitere Überschriften: Ebene 4" + "description": "Eine Überschrift unter Ebene 3" }, "h5": { "label": "Überschrift 5", - "description": "Weitere Überschriften: Ebene 5" + "description": "Eine Überschrift unter Ebene 4" }, "h6": { "label": "Überschrift 6", - "description": "Weitere Überschriften: Ebene 6" + "description": "Die kleinste Überschrift" }, "todo": { "label": "Aufgabenliste", @@ -604,8 +609,11 @@ "table": { "toolbar": "Tabelle", "dragRow": "Ziehen, um die Zeile zu verschieben", + "dragColumn": "Ziehen, um die Spalte zu verschieben", "moveRowUp": "Zeile nach oben", "moveRowDown": "Zeile nach unten", + "moveColumnLeft": "Spalte nach links", + "moveColumnRight": "Spalte nach rechts", "addRowBefore": "Zeile darüber", "addRowAfter": "Zeile darunter", "addColumnBefore": "Spalte links", diff --git a/Web-App/frontend/src/locales/en.json b/Web-App/frontend/src/locales/en.json index 23ecda2..0af2489 100644 --- a/Web-App/frontend/src/locales/en.json +++ b/Web-App/frontend/src/locales/en.json @@ -283,6 +283,7 @@ "exportMarkdown": "Export as Markdown", "exportHtml": "Export as HTML", "exportPdf": "Export as PDF", + "exportDocx": "Export as Word", "backlinks": "Linked from {n} page | Linked from {n} pages", "find": "Find and replace", "fullWidth": "Full width", @@ -496,17 +497,21 @@ "label": "Link card", "description": "A link with its page's title and picture" }, + "otherHeadings": { + "label": "Other headings", + "description": "Headings 4 to 6" + }, "h4": { "label": "Heading 4", - "description": "Other headings: level 4" + "description": "A heading below level 3" }, "h5": { "label": "Heading 5", - "description": "Other headings: level 5" + "description": "A heading below level 4" }, "h6": { "label": "Heading 6", - "description": "Other headings: level 6" + "description": "The smallest heading" }, "todo": { "label": "To-do list", @@ -604,8 +609,11 @@ "table": { "toolbar": "Table", "dragRow": "Drag to move the row", + "dragColumn": "Drag to move the column", "moveRowUp": "Move row up", "moveRowDown": "Move row down", + "moveColumnLeft": "Move column left", + "moveColumnRight": "Move column right", "addRowBefore": "Add row above", "addRowAfter": "Add row below", "addColumnBefore": "Add column left", diff --git a/Web-App/frontend/src/locales/es.json b/Web-App/frontend/src/locales/es.json index 416a2ee..0e59bc2 100644 --- a/Web-App/frontend/src/locales/es.json +++ b/Web-App/frontend/src/locales/es.json @@ -283,6 +283,7 @@ "exportMarkdown": "Exportar como Markdown", "exportHtml": "Exportar como HTML", "exportPdf": "Exportar como PDF", + "exportDocx": "Exportar como Word", "backlinks": "Enlazada desde {n} página | Enlazada desde {n} páginas", "find": "Buscar y reemplazar", "fullWidth": "Ancho completo", @@ -496,17 +497,21 @@ "label": "Tarjeta de enlace", "description": "Un enlace con el título y la imagen de su página" }, + "otherHeadings": { + "label": "Otros encabezados", + "description": "Encabezados 4 a 6" + }, "h4": { "label": "Encabezado 4", - "description": "Otros encabezados: nivel 4" + "description": "Un encabezado bajo el nivel 3" }, "h5": { "label": "Encabezado 5", - "description": "Otros encabezados: nivel 5" + "description": "Un encabezado bajo el nivel 4" }, "h6": { "label": "Encabezado 6", - "description": "Otros encabezados: nivel 6" + "description": "El encabezado más pequeño" }, "todo": { "label": "Lista de tareas", @@ -604,8 +609,11 @@ "table": { "toolbar": "Tabla", "dragRow": "Arrastra para mover la fila", + "dragColumn": "Arrastra para mover la columna", "moveRowUp": "Subir fila", "moveRowDown": "Bajar fila", + "moveColumnLeft": "Mover columna a la izquierda", + "moveColumnRight": "Mover columna a la derecha", "addRowBefore": "Fila encima", "addRowAfter": "Fila debajo", "addColumnBefore": "Columna a la izquierda", diff --git a/Web-App/frontend/src/locales/fr.json b/Web-App/frontend/src/locales/fr.json index dcf9d0d..8be7aa6 100644 --- a/Web-App/frontend/src/locales/fr.json +++ b/Web-App/frontend/src/locales/fr.json @@ -283,6 +283,7 @@ "exportMarkdown": "Exporter en Markdown", "exportHtml": "Exporter en HTML", "exportPdf": "Exporter en PDF", + "exportDocx": "Exporter en Word", "backlinks": "Liée depuis {n} page | Liée depuis {n} pages", "find": "Rechercher et remplacer", "fullWidth": "Pleine largeur", @@ -496,17 +497,21 @@ "label": "Carte de lien", "description": "Un lien avec le titre et l’image de sa page" }, + "otherHeadings": { + "label": "Autres titres", + "description": "Titres 4 à 6" + }, "h4": { "label": "Titre 4", - "description": "Autres titres : niveau 4" + "description": "Un titre sous le niveau 3" }, "h5": { "label": "Titre 5", - "description": "Autres titres : niveau 5" + "description": "Un titre sous le niveau 4" }, "h6": { "label": "Titre 6", - "description": "Autres titres : niveau 6" + "description": "Le plus petit titre" }, "todo": { "label": "Liste de tâches", @@ -604,8 +609,11 @@ "table": { "toolbar": "Tableau", "dragRow": "Glisser pour déplacer la ligne", + "dragColumn": "Glisser pour déplacer la colonne", "moveRowUp": "Monter la ligne", "moveRowDown": "Descendre la ligne", + "moveColumnLeft": "Colonne à gauche", + "moveColumnRight": "Colonne à droite", "addRowBefore": "Ligne au-dessus", "addRowAfter": "Ligne en dessous", "addColumnBefore": "Colonne à gauche", diff --git a/Web-App/frontend/src/locales/pl.json b/Web-App/frontend/src/locales/pl.json index 4e69bdc..c057b34 100644 --- a/Web-App/frontend/src/locales/pl.json +++ b/Web-App/frontend/src/locales/pl.json @@ -283,6 +283,7 @@ "exportMarkdown": "Eksportuj jako Markdown", "exportHtml": "Eksportuj jako HTML", "exportPdf": "Eksportuj jako PDF", + "exportDocx": "Eksportuj jako Word", "backlinks": "Linkuje tu {n} strona | Linkują tu {n} strony | Linkuje tu {n} stron", "find": "Znajdź i zamień", "fullWidth": "Pełna szerokość", @@ -496,17 +497,21 @@ "label": "Karta linku", "description": "Link z tytułem i obrazkiem strony" }, + "otherHeadings": { + "label": "Inne nagłówki", + "description": "Nagłówki od 4 do 6" + }, "h4": { "label": "Nagłówek 4", - "description": "Inne nagłówki: poziom 4" + "description": "Nagłówek poniżej poziomu 3" }, "h5": { "label": "Nagłówek 5", - "description": "Inne nagłówki: poziom 5" + "description": "Nagłówek poniżej poziomu 4" }, "h6": { "label": "Nagłówek 6", - "description": "Inne nagłówki: poziom 6" + "description": "Najmniejszy nagłówek" }, "todo": { "label": "Lista zadań", @@ -604,8 +609,11 @@ "table": { "toolbar": "Tabela", "dragRow": "Przeciągnij, aby przenieść wiersz", + "dragColumn": "Przeciągnij, aby przenieść kolumnę", "moveRowUp": "Wiersz wyżej", "moveRowDown": "Wiersz niżej", + "moveColumnLeft": "Kolumna w lewo", + "moveColumnRight": "Kolumna w prawo", "addRowBefore": "Wiersz powyżej", "addRowAfter": "Wiersz poniżej", "addColumnBefore": "Kolumna z lewej", diff --git a/Web-App/frontend/src/views/page/PageView.vue b/Web-App/frontend/src/views/page/PageView.vue index 0247e44..839cd5c 100644 --- a/Web-App/frontend/src/views/page/PageView.vue +++ b/Web-App/frontend/src/views/page/PageView.vue @@ -380,7 +380,7 @@ const toggleFavorite = () => if (page.value?.id === p.id) page.value = { ...page.value, favorite: !p.favorite }; }); -const exportAs = (format: "markdown" | "html" | "pdf") => +const exportAs = (format: "markdown" | "html" | "pdf" | "docx") => run(async () => { // Save first, so the file has the latest title. await saveTitle(); @@ -429,6 +429,7 @@ const menu = computed(() => [ { label: t("page.exportMarkdown"), icon: "download", onSelect: () => exportAs("markdown") }, { label: t("page.exportHtml"), icon: "download", onSelect: () => exportAs("html") }, { label: t("page.exportPdf"), icon: "download", onSelect: () => exportAs("pdf") }, + { label: t("page.exportDocx"), icon: "download", onSelect: () => exportAs("docx") }, ]); const addChild = () => diff --git a/api/openapi.yaml b/api/openapi.yaml index 187e44a..fbcf7f9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1794,14 +1794,16 @@ paths: get: operationId: exportPage tags: [pages] - summary: Download the page as Markdown, HTML or PDF + summary: Download the page as Markdown, HTML, PDF or Word description: >- Attachment links point at DOCWELL_PUBLIC_URL and need a file token to open. PDFs are A4 with a bookmark per heading; images stored on the page are drawn in, diagrams become a link to their file and Mermaid charts show their source. + Word files (docx) embed the page's images the same way and keep headings, lists, + to-dos, callouts, tables, colours and alignment in a form Docwell imports back. security: [{ bearer: [] }] parameters: - - { name: format, in: query, schema: { type: string, enum: [markdown, html, pdf], default: markdown } } + - { name: format, in: query, schema: { type: string, enum: [markdown, html, pdf, docx], default: markdown } } responses: "200": description: The file @@ -1812,6 +1814,8 @@ paths: schema: { type: string } application/pdf: schema: { type: string, format: binary } + application/vnd.openxmlformats-officedocument.wordprocessingml.document: + schema: { type: string, format: binary } "400": { $ref: "#/components/responses/Error" } "404": { $ref: "#/components/responses/Error" } /api/v1/spaces/{id}/import: