@pie-element/extended-text-entry 15.1.2-next.7 → 15.1.2-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -205,13 +205,13 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
205
205
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
206
206
  `),[i,a]=bN(r);if(i.length===0)return;let o=xN(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
207
207
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(CN,this.editor.getAttributes(wN)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Zk({find:TN,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Zk({find:TN,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(wN)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),DN=/^\s*(\[([( |x])?\])\s$/,ON=lA.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}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,yO(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)=>sA(e,t,`- [${e.attrs?.checked?`x`:` `}] `),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`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};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=bO(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[Zk({find:DN,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),kN=lA.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`,yO(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,`
208
- `):``,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=oA(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);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=oA(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()}}});Ik.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(tN.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(iN.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(hN.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(EN.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(ON.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(kN.configure(this.options.taskList)),e}});var AN=`&nbsp;`,jN=`\xA0`,MN=lA.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,yO(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===AN||n[0].text===AN||n[0].raw===jN||n[0].text===jN)&&r.length===1&&r[0].type===`text`&&(r[0].text===AN||r[0].text===jN)?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){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?AN:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),NN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,PN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,FN=Dk.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`,yO(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[Jk({find:NN,type:this.type})]},addPasteRules(){return[uA({find:PN,type:this.type})]}}),IN=lA.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),LN=Dk.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`,yO(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.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function RN(e={}){return new uu({view(t){return new zN(t,e)}})}var zN=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=wl(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},BN=class e extends H{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):H.near(r)}content(){return B.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new VN(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!UN(e)||!WN(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!W.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};BN.prototype.visible=!1,BN.findFrom=BN.findGapCursorFrom,H.jsonID(`gapcursor`,BN);var VN=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return BN.valid(t)?new BN(t):H.near(t)}};function HN(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function UN(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||HN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function WN(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||HN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function GN(){return new uu({props:{decorations:XN,createSelectionBetween(e,t,n){return t.pos==n.pos&&BN.valid(n)?new BN(n):null},handleClick:JN,handleKeyDown:KN,handleDOMEvents:{beforeinput:YN}}})}var KN=f_({ArrowLeft:qN(`horiz`,-1),ArrowRight:qN(`horiz`,1),ArrowUp:qN(`vert`,-1),ArrowDown:qN(`vert`,1)});function qN(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof U){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=BN.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new BN(c))),!0):!1}}function JN(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!BN.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&W.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new BN(r))),!0)}function YN(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof BN))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=z.empty;for(let e=r.length-1;e>=0;e--)i=z.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new B(i,0,0));return a.setSelection(U.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function XN(e){if(!(e.selection instanceof BN))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,ZT.create(e.doc,[JT.widget(e.selection.head,t,{key:`gapcursor`})])}var ZN=200,QN=function(){};QN.prototype.append=function(e){return e.length?(e=QN.from(e),!this.length&&e||e.length<ZN&&this.leafAppend(e)||this.length<ZN&&e.leafPrepend(this)||this.appendInner(e)):this},QN.prototype.prepend=function(e){return e.length?QN.from(e).append(this):this},QN.prototype.appendInner=function(e){return new eP(this,e)},QN.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?QN.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},QN.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},QN.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},QN.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},QN.from=function(e){return e instanceof QN?e:e&&e.length?new $N(e):QN.empty};var $N=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=ZN)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=ZN)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(QN);QN.empty=new $N([]);var eP=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(QN),tP=500,nP=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new iP(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new iP(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new iP(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>oP&&(s=rP(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Hc;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new iP(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new iP(i,o,l))}else r.push(new iP(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new iP(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>tP&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new iP(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(QN.from(i.reverse()),a)}};nP.empty=new nP(QN.empty,0);function rP(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var iP=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},aP=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},oP=20;function sP(e,t,n,r){let i=n.getMeta(hP),a;if(i)return i.historyState;n.getMeta(gP)&&(e=new aP(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(hP))return o.getMeta(hP).redo?new aP(e.done.addTransform(n,void 0,r,mP(t)),e.undone,lP(n.mapping.maps),e.prevTime,e.prevComposition):new aP(e.done,e.undone.addTransform(n,void 0,r,mP(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!cP(n,e.prevRanges)),s=o?uP(e.prevRanges,n.mapping):lP(n.mapping.maps);return new aP(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,mP(t)),nP.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new aP(e.done.rebased(n,a),e.undone.rebased(n,a),uP(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new aP(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),uP(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function cP(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function lP(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function uP(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function dP(e,t,n){let r=mP(t),i=hP.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new aP(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(hP,{redo:n,historyState:c})}var fP=!1,pP=null;function mP(e){let t=e.plugins;if(pP!=t){fP=!1,pP=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){fP=!0;break}}return fP}var hP=new pu(`history`),gP=new pu(`closeHistory`);function _P(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new uu({key:hP,state:{init(){return new aP(nP.empty,nP.empty,null,0,-1)},apply(t,n,r){return sP(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?yP:n==`historyRedo`?bP:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function vP(e,t){return(n,r)=>{let i=hP.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=dP(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var yP=vP(!1,!0),bP=vP(!0,!0);Ik.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new uu({key:new pu(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var xP=Ik.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[RN(this.options)]}});Ik.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new uu({key:new pu(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return ZT.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(JT.node(t,t+e.nodeSize,{class:this.options.className}))}),ZT.create(e,a)}}})]}});var SP=Ik.create({name:`gapCursor`,addProseMirrorPlugins(){return[GN()]},extendNodeSchema(e){return{allowGapCursor:pO(lO(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),CP=`placeholder`,wP=new pu(`tiptap__placeholder`),TP=200;function EP(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),JT.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function DP({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty,c={emptyEditor:t.emptyEditorClass,emptyNode:t.emptyNodeClass};if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),l=i.depth>0?i.node(1):i.nodeAfter,u=i.depth>0?i.before(1):a;if(l&&l.type.isTextblock&&KO(l)){let r=a>=u&&a<=u+l.nodeSize;o.push(EP({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:c,node:l,pos:u}))}}else{let i=wP.getState(e.state),l=i?.topPos??0,u=i?.bottomPos??r.content.size;r.nodesBetween(l,u,(r,i)=>{let l=a>=i&&a<=i+r.nodeSize,u=!r.isLeaf&&KO(r);return r.type.isTextblock&&(l||!t.showOnlyCurrent)&&u&&o.push(EP({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:l,placeholder:t.placeholder,classes:c,node:r,pos:i})),t.includeChildren})}return ZT.create(r,o)}function OP(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function kP(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function AP(e){let t=e;for(;t;){if(kP(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function jP(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function MP({doc:e,view:t,scrollContainer:n}){let r=t.dom.getBoundingClientRect(),i=n?jP(n):{top:0,bottom:window.innerHeight},a=Math.max(r.top,i.top)-TP,o=Math.min(r.bottom,i.bottom)+TP;if(a>=o)return{top:0,bottom:e.content.size};let s=getComputedStyle(t.dom).direction===`rtl`?Math.max(r.right-2,r.left+2):r.left+2,c=t.posAtCoords({left:s,top:a+2}),l=t.posAtCoords({left:s,top:o-2});return{top:c?c.pos:0,bottom:l?l.pos:e.content.size}}var NP={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(wP);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function PP(e){let t=AP(e.dom),n=()=>{let n=MP({view:e,doc:e.state.doc,scrollContainer:t}),r=wP.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(wP,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};return t.addEventListener(`scroll`,a,{passive:!0}),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a)}}}function FP({editor:e,options:t}){let n=t.dataAttribute?`data-${OP(t.dataAttribute)}`:`data-${CP}`;return new uu({key:wP,state:NP,view:PP,props:{decorations:({doc:r,selection:i})=>DP({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}Ik.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:CP,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[FP({editor:this.editor,options:this.options})]}}),Ik.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new uu({key:new pu(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||qO(n.selection)||e.view.dragging?null:ZT.create(n.doc,[JT.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function IP({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var LP=Ik.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new pu(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new uu({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!IP({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!IP({node:r,types:n})}}})]}}),RP=Ik.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yP(e,t),redo:()=>({state:e,dispatch:t})=>bP(e,t)}},addProseMirrorPlugins(){return[_P(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),zP=Ik.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(vA.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(pA.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(tN.configure(this.options.bulletList)),this.options.code!==!1&&e.push(xA.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(TA.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(EA.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(xP.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(SP.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(DA.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(OA.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(RP.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(kA.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(PA.configure(this.options.italic)),this.options.listItem!==!1&&e.push(iN.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(hN.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(YM.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(EN.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(MN.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(FN.configure(this.options.strike)),this.options.text!==!1&&e.push(IN.configure(this.options.text)),this.options.underline!==!1&&e.push(LN.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(LP.configure(this.options?.trailingNode)),e}}),BP=20,VP=(e,t=0)=>{let n=[];return!e.children.length||t>BP||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...VP(e,t+1))}),n},HP=e=>{if(!e.children.length)return;let t=VP(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},UP=$y.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&HP(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),WP=sb.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`background-color`)return t.replace(/['"]+/g,``)}}}return e.style.backgroundColor?.replace(/['"]+/g,``)},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),GP=sb.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`color`)return t.replace(/['"]+/g,``)}}}return e.style.color?.replace(/['"]+/g,``)},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),KP=sb.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),qP=sb.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),JP=sb.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}}),YP=sb.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(WP.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(GP.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(KP.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(qP.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(JP.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(UP.configure(this.options.textStyle)),e}}),XP=sb.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new uu({key:new pu(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});sb.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[RN(this.options)]}}),sb.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new uu({key:new pu(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return fg.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(lg.node(t,t+e.nodeSize,{class:this.options.className}))}),fg.create(e,a)}}})]}}),sb.create({name:`gapCursor`,addProseMirrorPlugins(){return[GN()]},extendNodeSchema(e){return{allowGapCursor:Lv(Nv(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});var ZP=`placeholder`,QP=new pu(`tiptap__placeholder`),$P=200;function eF(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),lg.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function tF({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty,c={emptyEditor:t.emptyEditorClass,emptyNode:t.emptyNodeClass};if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),l=i.depth>0?i.node(1):i.nodeAfter,u=i.depth>0?i.before(1):a;if(l&&l.type.isTextblock&&hy(l)){let r=a>=u&&a<=u+l.nodeSize;o.push(eF({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:c,node:l,pos:u}))}}else{let i=QP.getState(e.state),l=i?.topPos??0,u=i?.bottomPos??r.content.size;r.nodesBetween(l,u,(r,i)=>{let l=a>=i&&a<=i+r.nodeSize,u=!r.isLeaf&&hy(r);return r.type.isTextblock&&(l||!t.showOnlyCurrent)&&u&&o.push(eF({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:l,placeholder:t.placeholder,classes:c,node:r,pos:i})),t.includeChildren})}return fg.create(r,o)}function nF(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function rF(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function iF(e){let t=e;for(;t;){if(rF(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function aF(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function oF({doc:e,view:t,scrollContainer:n}){let r=t.dom.getBoundingClientRect(),i=n?aF(n):{top:0,bottom:window.innerHeight},a=Math.max(r.top,i.top)-$P,o=Math.min(r.bottom,i.bottom)+$P;if(a>=o)return{top:0,bottom:e.content.size};let s=getComputedStyle(t.dom).direction===`rtl`?Math.max(r.right-2,r.left+2):r.left+2,c=t.posAtCoords({left:s,top:a+2}),l=t.posAtCoords({left:s,top:o-2});return{top:c?c.pos:0,bottom:l?l.pos:e.content.size}}var sF={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(QP);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function cF(e){let t=iF(e.dom),n=()=>{let n=oF({view:e,doc:e.state.doc,scrollContainer:t}),r=QP.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(QP,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};return t.addEventListener(`scroll`,a,{passive:!0}),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a)}}}function lF({editor:e,options:t}){let n=t.dataAttribute?`data-${nF(t.dataAttribute)}`:`data-${ZP}`;return new uu({key:QP,state:sF,view:cF,props:{decorations:({doc:r,selection:i})=>tF({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}var uF=sb.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ZP,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[lF({editor:this.editor,options:this.options})]}});sb.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new uu({key:new pu(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||gy(n.selection)||e.view.dragging?null:fg.create(n.doc,[lg.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function dF({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}sb.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new pu(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new uu({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!dF({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!dF({node:r,types:n})}}})]}}),sb.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yP(e,t),redo:()=>({state:e,dispatch:t})=>bP(e,t)}},addProseMirrorPlugins(){return[_P(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var fF=$y.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sup`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),pF=$y.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sub`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),mF=sb.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=>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`)}}}),hF=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,gF=Lb.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`,Vv(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;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new Eb({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Cb({find:hF,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),_F=uF,vF=e=>String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),yF=e=>{let t=document.createElement(`div`);t.innerHTML=e;let n=Array.from(t.children);return n.length<2||!n.every(e=>e.tagName===`DIV`)||!n.every(e=>e.attributes.length===0)||!n.every(e=>Array.from(e.children).every(e=>{let t=e.tagName;return[`SPAN`,`B`,`I`,`EM`,`STRONG`,`U`,`SUB`,`SUP`,`A`,`CODE`,`BR`].includes(t)}))?e:`<p>${n.map(e=>e.innerHTML).join(`<br>`)}</p>`},bF=e=>{let t=String(e??``).trim();return t?/<[^>]+>/.test(t)?yF(t):`<div>${vF(t)}</div>`:`<div></div>`},xF,SF;if(typeof WeakMap<`u`){let e=new WeakMap;xF=t=>e.get(t),SF=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;xF=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},SF=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var CF=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return xF(e)||SF(e,wF(e))}};function wF(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=TF(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new CF(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&EF(s,o,e),s}function TF(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function EF(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=DF(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function DF(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function OF(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var kF=new pu(`selectingCells`);function AF(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function jF(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 MF(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 NF(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=AF(t.$head)||PF(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function PF(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 FF(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function IF(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function LF(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function RF(e,t,n){let r=e.node(-1),i=CF.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 zF(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 BF(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function VF(e,t,n){let r=OF(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var HF=class e extends H{constructor(e,t=e){let n=e.node(-1),r=CF.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=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 Gl(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(FF(r)&&FF(i)&&LF(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 U.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=CF.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;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=zF(e,0,l)),u>0&&(e=zF(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(z.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new B(z.from(o),1,1)}replace(e,t=B.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?B.empty:t)}let i=H.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new B(z.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=CF.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)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=CF.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.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=CF.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)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=CF.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.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new UF(this.$anchorCell.pos,this.$headCell.pos)}};HF.prototype.visible=!1,H.jsonID(`cell`,HF);var UF=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&LF(t,n)?new HF(t,n):H.near(n,1)}};function WF(e){if(!(e.selection instanceof HF))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(JT.node(n,n+e.nodeSize,{class:`selectedCell`}))}),ZT.create(e.doc,t)}function GF({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function KF({$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 qF(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof W&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=HF.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=HF.rowSelection(e,e)}else if(!n){let e=CF.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=HF.create(i,t+1,n)}}else r instanceof U&&GF(r)?a=U.create(i,r.from):r instanceof U&&KF(r)&&(a=U.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var JF=new pu(`fix-tables`);function YF(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?YF(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function XF(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=ZF(e,t,r,n))};return t?t.doc!=e.doc&&YF(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ZF(e,t,n,r){let i=CF.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,zF(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=OF(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(JF,{fixTables:!0})}function QF(e){let t=e.selection,n=NF(e),r=n.node(-1),i=n.start(-1),a=CF.get(r);return{...t instanceof HF?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function $F(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;VF(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,BF(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?OF(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function eI(e,t){if(!MF(e))return!1;if(t){let n=QF(e);t($F(e.tr,n,n.left))}return!0}function tI(e,t){if(!MF(e))return!1;if(t){let n=QF(e);t($F(e.tr,n,n.right))}return!0}function nI(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,zF(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function rI(e,t){if(!MF(e))return!1;if(t){let n=QF(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;nI(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=CF.get(e)}t(r)}return!0}function iI(e,t,n){let r=OF(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function aI(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;iI(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?OF(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,OF(r.type.schema).row.create(null,o)),e}function oI(e,t){if(!MF(e))return!1;if(t){let n=QF(e);t(aI(e.tr,n,n.top))}return!0}function sI(e,t){if(!MF(e))return!1;if(t){let n=QF(e);t(aI(e.tr,n,n.bottom))}return!0}function cI(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&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(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function lI(e,t){if(!MF(e))return!1;if(t){let n=QF(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;cI(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=CF.get(n.table)}t(r)}return!0}function uI(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function dI({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function fI(e,t){let n=e.selection;if(!(n instanceof HF)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=QF(e),{map:i}=r;if(dI(i,r))return!1;if(t){let n=e.tr,a={},o=z.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{uI(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...BF(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=uI(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new HF(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function pI(e,t){let n=OF(e.schema);return mI(({node:e})=>n[e.type.spec.tableRole])(e,t)}function mI(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof HF){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=jF(r.$from),!i)return!1;a=AF(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=QF(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof HF&&u.setSelection(new HF(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function hI(e,t){return function(n,r){if(!MF(n))return!1;let i=NF(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof HF?n.selection.forEachCell((n,r)=>{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 gI(e){return function(t,n){if(!MF(t))return!1;if(n){let r=OF(t.schema),i=QF(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<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function _I(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function vI(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?gI(e):function(t,n){if(!MF(t))return!1;if(n){let r=OF(t.schema),i=QF(t),a=t.tr,o=_I(`row`,i,r),s=_I(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}vI(`row`,{useDeprecatedLogic:!0}),vI(`column`,{useDeprecatedLogic:!0});var yI=vI(`cell`,{useDeprecatedLogic:!0});function bI(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()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function xI(e){return function(t,n){if(!MF(t))return!1;let r=bI(NF(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(U.between(e,IF(e))).scrollIntoView())}return!0}}function SI(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>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 CI(e,t){let n=e.selection;if(!(n instanceof HF))return!1;if(t){let r=e.tr,i=OF(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 B(i,0,0))}),r.docChanged&&t(r)}return!0}function wI(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<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=EI(OF(o).row,new B(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?EI(OF(o).row,new B(t,n,r)).content:t);else return null;return TI(o,s)}function TI(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(z.empty),n[i]<r){let a=OF(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(z.from(o))}return{height:t.length,width:r,rows:t}}function EI(e,t){let n=e.createAndFill();return new Ul(n).replace(0,n.content.size,t).doc}function DI({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(zF(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(z.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(z.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function OI(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=OF(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,z.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function kI(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function AI(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,zF(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(zF(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function jI(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=CF.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=CF.get(a),f=d.mapping.maps.length}OI(d,o,a,n,l,u,f)&&p(),kI(d,o,a,n,c,l,s,f)&&p(),kI(d,o,a,n,c,l,u,f)&&p(),AI(d,o,a,n,s,u,c,f)&&p(),AI(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new B(i.rows[e-s],0,0))}p(),d.setSelection(new HF(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var MI=f_({ArrowLeft:PI(`horiz`,-1),ArrowRight:PI(`horiz`,1),ArrowUp:PI(`vert`,-1),ArrowDown:PI(`vert`,1),"Shift-ArrowLeft":FI(`horiz`,-1),"Shift-ArrowRight":FI(`horiz`,1),"Shift-ArrowUp":FI(`vert`,-1),"Shift-ArrowDown":FI(`vert`,1),Backspace:CI,"Mod-Backspace":CI,Delete:CI,"Mod-Delete":CI});function NI(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function PI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof HF)return NI(n,r,H.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=zI(i,e,t);if(o==null)return!1;if(e==`horiz`)return NI(n,r,H.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=RF(i,e,t),s;return s=a?H.near(a,1):t<0?H.near(n.doc.resolve(i.before(-1)),-1):H.near(n.doc.resolve(i.after(-1)),1),NI(n,r,s)}}}function FI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof HF)o=a;else{let r=zI(i,e,t);if(r==null)return!1;o=new HF(n.doc.resolve(r))}let s=RF(o.$headCell,e,t);return s?NI(n,r,new HF(o.$anchorCell,s)):!1}}function II(e,t){let n=e.state.doc,r=AF(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new HF(r))),!0):!1}function LI(e,t,n){if(!MF(e.state))return!1;let r=wI(n),i=e.state.selection;if(i instanceof HF){r||={width:1,height:1,rows:[z.from(EI(OF(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=CF.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=DI(r,o.right-o.left,o.bottom-o.top),jI(e.state,e.dispatch,a,o,r),!0}else if(r){let t=NF(e.state),n=t.start(-1);return jI(e.state,e.dispatch,n,CF.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function RI(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=BI(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof HF)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=AF(e.state.selection.$anchor))!=null&&VI(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=VI(e,n),i=kF.getState(e.state)==null;if(!r||!LF(t,r))if(i)r=t;else return;let a=new HF(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(kF,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),kF.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(kF,-1))}function o(r){let o=r,s=kF.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(BI(e,o.target)!=n&&(c=VI(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 zI(e,t,n){if(!(e.state.selection instanceof U))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 BI(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function VI(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&&AF(e.state.doc.resolve(r))||AF(e.state.doc.resolve(i))}var HI=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`)),UI(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,UI(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function UI(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;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var WI=new pu(`tableColumnResizing`);function GI({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=HI,lastColumnResizable:i=!0}={}){let a=new uu({key:WI,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=OF(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new KI(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=WI.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{qI(t,n,e,i)},mouseleave:e=>{JI(e)},mousedown:(e,r)=>{YI(e,r,t,n)}},decorations:e=>{let t=WI.getState(e);if(t&&t.activeHandle>-1)return iL(e,t.activeHandle)},nodeViews:{}}});return a}var KI=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(WI);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 FF(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function qI(e,t,n,r){if(!e.editable)return;let i=WI.getState(e.state);if(i&&!i.dragging){let a=ZI(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=QI(e,t,`left`,n):i-t.clientX<=n&&(o=QI(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=CF.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}eL(e,o)}}}function JI(e){if(!e.editable)return;let t=WI.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&eL(e,-1)}function YI(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=WI.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=XI(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(WI,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=WI.getState(e.state);r?.dragging&&(tL(e,r.activeHandle,$I(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(WI,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=WI.getState(e.state);if(i&&i.dragging){let a=$I(i.dragging,t,n);nL(e,i.activeHandle,a,r)}}return nL(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function XI(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;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function ZI(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function QI(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=AF(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=CF.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function $I(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function eL(e,t){e.dispatch(e.state.tr.setMeta(WI,{setHandle:t}))}function tL(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=CF.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():rL(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function nL(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=CF.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&UI(a,c.firstChild,c,r,s,n)}function rL(e){return Array(e).fill(0)}function iL(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return ZT.empty;let a=CF.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,WI.getState(e)?.dragging&&n.push(JT.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(JT.widget(s,c))}}return ZT.create(e.doc,n)}function aL({allowTableNodeSelection:e=!1}={}){return new uu({key:kF,state:{init(){return null},apply(e,t){let n=e.getMeta(kF);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:WF,handleDOMEvents:{mousedown:RI},createSelectionBetween(e){return kF.getState(e.state)==null?null:e.state.selection},handleTripleClick:II,handleKeyDown:MI,handlePaste:LI},appendTransaction(t,n,r){return qF(r,XF(r,n),e)}})}var oL=Lb.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Vv(this.options.HTMLAttributes,e),0]}}),sL=Lb.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Vv(this.options.HTMLAttributes,e),0]}}),cL=Lb.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Vv(this.options.HTMLAttributes,e),0]}});function lL(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function uL(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=lL(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=lL(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var dL=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),uL(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,uL(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function fL(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=lL(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function pL(e,t){return t?e.createChecked(null,t):e.createAndFill()}function mL(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function hL(e,t,n,r,i){let a=mL(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=pL(a.cell,i);if(e&&s.push(e),r){let e=pL(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function gL(e){return e instanceof HF}var _L=({editor:e})=>{let{selection:t}=e.state;if(!gL(t))return!1;let n=0;return jv(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):!1};function vL(e){return(e||``).replace(/\s+/g,` `).trim()}function yL(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=vL(i),o=e.type===`tableHeader`;n.push({text:a,isHeader:o})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=`
208
+ `):``,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=oA(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);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=oA(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()}}});Ik.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(tN.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(iN.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(hN.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(EN.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(ON.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(kN.configure(this.options.taskList)),e}});var AN=`&nbsp;`,jN=`\xA0`,MN=lA.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,yO(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===AN||n[0].text===AN||n[0].raw===jN||n[0].text===jN)&&r.length===1&&r[0].type===`text`&&(r[0].text===AN||r[0].text===jN)?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){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?AN:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),NN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,PN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,FN=Dk.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`,yO(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[Jk({find:NN,type:this.type})]},addPasteRules(){return[uA({find:PN,type:this.type})]}}),IN=lA.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),LN=Dk.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`,yO(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.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function RN(e={}){return new uu({view(t){return new zN(t,e)}})}var zN=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=wl(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},BN=class e extends H{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):H.near(r)}content(){return B.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new VN(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!UN(e)||!WN(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!W.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};BN.prototype.visible=!1,BN.findFrom=BN.findGapCursorFrom,H.jsonID(`gapcursor`,BN);var VN=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return BN.valid(t)?new BN(t):H.near(t)}};function HN(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function UN(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||HN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function WN(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||HN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function GN(){return new uu({props:{decorations:XN,createSelectionBetween(e,t,n){return t.pos==n.pos&&BN.valid(n)?new BN(n):null},handleClick:JN,handleKeyDown:KN,handleDOMEvents:{beforeinput:YN}}})}var KN=f_({ArrowLeft:qN(`horiz`,-1),ArrowRight:qN(`horiz`,1),ArrowUp:qN(`vert`,-1),ArrowDown:qN(`vert`,1)});function qN(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof U){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=BN.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new BN(c))),!0):!1}}function JN(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!BN.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&W.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new BN(r))),!0)}function YN(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof BN))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=z.empty;for(let e=r.length-1;e>=0;e--)i=z.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new B(i,0,0));return a.setSelection(U.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function XN(e){if(!(e.selection instanceof BN))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,ZT.create(e.doc,[JT.widget(e.selection.head,t,{key:`gapcursor`})])}var ZN=200,QN=function(){};QN.prototype.append=function(e){return e.length?(e=QN.from(e),!this.length&&e||e.length<ZN&&this.leafAppend(e)||this.length<ZN&&e.leafPrepend(this)||this.appendInner(e)):this},QN.prototype.prepend=function(e){return e.length?QN.from(e).append(this):this},QN.prototype.appendInner=function(e){return new eP(this,e)},QN.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?QN.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},QN.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},QN.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},QN.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},QN.from=function(e){return e instanceof QN?e:e&&e.length?new $N(e):QN.empty};var $N=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=ZN)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=ZN)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(QN);QN.empty=new $N([]);var eP=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(QN),tP=500,nP=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new iP(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new iP(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new iP(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>oP&&(s=rP(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Hc;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new iP(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new iP(i,o,l))}else r.push(new iP(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new iP(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>tP&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new iP(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(QN.from(i.reverse()),a)}};nP.empty=new nP(QN.empty,0);function rP(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var iP=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},aP=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},oP=20;function sP(e,t,n,r){let i=n.getMeta(hP),a;if(i)return i.historyState;n.getMeta(gP)&&(e=new aP(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(hP))return o.getMeta(hP).redo?new aP(e.done.addTransform(n,void 0,r,mP(t)),e.undone,lP(n.mapping.maps),e.prevTime,e.prevComposition):new aP(e.done,e.undone.addTransform(n,void 0,r,mP(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!cP(n,e.prevRanges)),s=o?uP(e.prevRanges,n.mapping):lP(n.mapping.maps);return new aP(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,mP(t)),nP.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new aP(e.done.rebased(n,a),e.undone.rebased(n,a),uP(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new aP(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),uP(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function cP(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function lP(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function uP(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function dP(e,t,n){let r=mP(t),i=hP.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new aP(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(hP,{redo:n,historyState:c})}var fP=!1,pP=null;function mP(e){let t=e.plugins;if(pP!=t){fP=!1,pP=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){fP=!0;break}}return fP}var hP=new pu(`history`),gP=new pu(`closeHistory`);function _P(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new uu({key:hP,state:{init(){return new aP(nP.empty,nP.empty,null,0,-1)},apply(t,n,r){return sP(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?yP:n==`historyRedo`?bP:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function vP(e,t){return(n,r)=>{let i=hP.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=dP(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var yP=vP(!1,!0),bP=vP(!0,!0);Ik.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new uu({key:new pu(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var xP=Ik.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[RN(this.options)]}});Ik.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new uu({key:new pu(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return ZT.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(JT.node(t,t+e.nodeSize,{class:this.options.className}))}),ZT.create(e,a)}}})]}});var SP=Ik.create({name:`gapCursor`,addProseMirrorPlugins(){return[GN()]},extendNodeSchema(e){return{allowGapCursor:pO(lO(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),CP=`placeholder`,wP=new pu(`tiptap__placeholder`),TP=200;function EP(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),JT.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function DP({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty,c={emptyEditor:t.emptyEditorClass,emptyNode:t.emptyNodeClass};if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),l=i.depth>0?i.node(1):i.nodeAfter,u=i.depth>0?i.before(1):a;if(l&&l.type.isTextblock&&KO(l)){let r=a>=u&&a<=u+l.nodeSize;o.push(EP({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:c,node:l,pos:u}))}}else{let i=wP.getState(e.state),l=i?.topPos??0,u=i?.bottomPos??r.content.size;r.nodesBetween(l,u,(r,i)=>{let l=a>=i&&a<=i+r.nodeSize,u=!r.isLeaf&&KO(r);return r.type.isTextblock&&(l||!t.showOnlyCurrent)&&u&&o.push(EP({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:l,placeholder:t.placeholder,classes:c,node:r,pos:i})),t.includeChildren})}return ZT.create(r,o)}function OP(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function kP(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function AP(e){let t=e;for(;t;){if(kP(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function jP(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function MP({doc:e,view:t,scrollContainer:n}){let r=t.dom.getBoundingClientRect(),i=n?jP(n):{top:0,bottom:window.innerHeight},a=Math.max(r.top,i.top)-TP,o=Math.min(r.bottom,i.bottom)+TP;if(a>=o)return{top:0,bottom:e.content.size};let s=getComputedStyle(t.dom).direction===`rtl`?Math.max(r.right-2,r.left+2):r.left+2,c=t.posAtCoords({left:s,top:a+2}),l=t.posAtCoords({left:s,top:o-2});return{top:c?c.pos:0,bottom:l?l.pos:e.content.size}}var NP={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(wP);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function PP(e){let t=AP(e.dom),n=()=>{let n=MP({view:e,doc:e.state.doc,scrollContainer:t}),r=wP.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(wP,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};return t.addEventListener(`scroll`,a,{passive:!0}),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a)}}}function FP({editor:e,options:t}){let n=t.dataAttribute?`data-${OP(t.dataAttribute)}`:`data-${CP}`;return new uu({key:wP,state:NP,view:PP,props:{decorations:({doc:r,selection:i})=>DP({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}Ik.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:CP,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[FP({editor:this.editor,options:this.options})]}}),Ik.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new uu({key:new pu(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||qO(n.selection)||e.view.dragging?null:ZT.create(n.doc,[JT.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function IP({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var LP=Ik.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new pu(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new uu({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!IP({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!IP({node:r,types:n})}}})]}}),RP=Ik.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yP(e,t),redo:()=>({state:e,dispatch:t})=>bP(e,t)}},addProseMirrorPlugins(){return[_P(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),zP=Ik.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(vA.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(pA.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(tN.configure(this.options.bulletList)),this.options.code!==!1&&e.push(xA.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(TA.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(EA.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(xP.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(SP.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(DA.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(OA.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(RP.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(kA.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(PA.configure(this.options.italic)),this.options.listItem!==!1&&e.push(iN.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(hN.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(YM.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(EN.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(MN.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(FN.configure(this.options.strike)),this.options.text!==!1&&e.push(IN.configure(this.options.text)),this.options.underline!==!1&&e.push(LN.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(LP.configure(this.options?.trailingNode)),e}}),BP=20,VP=(e,t=0)=>{let n=[];return!e.children.length||t>BP||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...VP(e,t+1))}),n},HP=e=>{if(!e.children.length)return;let t=VP(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},UP=$y.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&HP(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),WP=sb.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`background-color`)return t.replace(/['"]+/g,``)}}}return e.style.backgroundColor?.replace(/['"]+/g,``)},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),GP=sb.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`color`)return t.replace(/['"]+/g,``)}}}return e.style.color?.replace(/['"]+/g,``)},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),KP=sb.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),qP=sb.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),JP=sb.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}}),YP=sb.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(WP.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(GP.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(KP.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(qP.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(JP.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(UP.configure(this.options.textStyle)),e}}),XP=sb.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new uu({key:new pu(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});sb.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[RN(this.options)]}}),sb.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new uu({key:new pu(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return fg.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(lg.node(t,t+e.nodeSize,{class:this.options.className}))}),fg.create(e,a)}}})]}}),sb.create({name:`gapCursor`,addProseMirrorPlugins(){return[GN()]},extendNodeSchema(e){return{allowGapCursor:Lv(Nv(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});var ZP=`placeholder`,QP=new pu(`tiptap__placeholder`);function $P(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),lg.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function eF(e,t){return typeof e==`function`?e(t):e}function tF({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&hy(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push($P({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:eF(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function nF({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&hy(c)){let r=a>=l&&a<=l+c.nodeSize;o.push($P({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:eF(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...tF({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return fg.create(r,o)}function rF(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function iF(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function aF(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function oF(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function sF(e,t){let n=aF(e,t.from,t.to);return n.push(iF(e,rF(e,t.from))),t.to>t.from?n.push(iF(e,rF(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(iF(e,rF(e,Math.min(t.from+1,e.content.size)))),n}function cF(e,t,n){let r=[];if(e.docChanged){let t=iy(e);for(let e of t)r.push(...sF(n.doc,e.newRange))}return e.selectionSet&&(r.push(iF(n.doc,rF(n.doc,e.mapping.map(t.selection.anchor)))),r.push(iF(n.doc,rF(n.doc,n.selection.anchor)))),oF(r)}function lF(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function uF({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=lF(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=tF({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function dF({editor:e,options:t,dataAttribute:n}){return{init(r,i){return nF({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??fg.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:uF({decorations:i.map(r.mapping,r.doc),ranges:cF(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function fF(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function pF({editor:e,options:t}){let n=t.dataAttribute?`data-${fF(t.dataAttribute)}`:`data-${ZP}`,r=t.showOnlyCurrent&&!t.includeChildren;return new uu({key:QP,...r?{}:{state:dF({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>nF({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?fg.empty:QP.getState(n)??fg.empty}})}var mF=sb.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ZP,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[pF({editor:this.editor,options:this.options})]}});function hF(e,t){return!e.selection.empty&&!gy(e.selection)&&t.isEditable}function gF(e,t){return hF(e,t)&&!t.isFocused&&!t.view.dragging}function _F(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function vF(e){e.focus()}sb.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new uu({key:new pu(`selection`),props:{decorations(n){return gF(n,e)?fg.create(n.doc,[lg.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return hF(t.state,e)&&_F(),!1},focus(t){return hF(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&vF(t)}),!1}}}})]}});function yF({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}sb.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new pu(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new uu({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!yF({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!yF({node:r,types:n})}}})]}}),sb.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yP(e,t),redo:()=>({state:e,dispatch:t})=>bP(e,t)}},addProseMirrorPlugins(){return[_P(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var bF=$y.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sup`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),xF=$y.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sub`,Vv(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),SF=sb.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=>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`)}}}),CF=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,wF=Lb.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`,Vv(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;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new Eb({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Cb({find:CF,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),TF=mF,EF=e=>String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),DF=e=>{let t=document.createElement(`div`);t.innerHTML=e;let n=Array.from(t.children);return n.length<2||!n.every(e=>e.tagName===`DIV`)||!n.every(e=>e.attributes.length===0)||!n.every(e=>Array.from(e.children).every(e=>{let t=e.tagName;return[`SPAN`,`B`,`I`,`EM`,`STRONG`,`U`,`SUB`,`SUP`,`A`,`CODE`,`BR`].includes(t)}))?e:`<p>${n.map(e=>e.innerHTML).join(`<br>`)}</p>`},OF=e=>{let t=String(e??``).trim();return t?/<[^>]+>/.test(t)?DF(t):`<div>${EF(t)}</div>`:`<div></div>`},kF,AF;if(typeof WeakMap<`u`){let e=new WeakMap;kF=t=>e.get(t),AF=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;kF=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},AF=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var jF=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return kF(e)||AF(e,MF(e))}};function MF(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=NF(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new jF(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&PF(s,o,e),s}function NF(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function PF(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=FF(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function FF(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function IF(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var LF=new pu(`selectingCells`);function RF(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function zF(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 BF(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 VF(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=RF(t.$head)||HF(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function HF(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 UF(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function WF(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function GF(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function KF(e,t,n){let r=e.node(-1),i=jF.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 qF(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 JF(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function YF(e,t,n){let r=IF(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var XF=class e extends H{constructor(e,t=e){let n=e.node(-1),r=jF.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=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 Gl(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(UF(r)&&UF(i)&&GF(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 U.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=jF.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;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=qF(e,0,l)),u>0&&(e=qF(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(z.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new B(z.from(o),1,1)}replace(e,t=B.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?B.empty:t)}let i=H.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new B(z.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=jF.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)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=jF.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.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=jF.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)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=jF.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.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new ZF(this.$anchorCell.pos,this.$headCell.pos)}};XF.prototype.visible=!1,H.jsonID(`cell`,XF);var ZF=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&GF(t,n)?new XF(t,n):H.near(n,1)}};function QF(e){if(!(e.selection instanceof XF))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(JT.node(n,n+e.nodeSize,{class:`selectedCell`}))}),ZT.create(e.doc,t)}function $F({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function eI({$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 tI(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof W&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=XF.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=XF.rowSelection(e,e)}else if(!n){let e=jF.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=XF.create(i,t+1,n)}}else r instanceof U&&$F(r)?a=U.create(i,r.from):r instanceof U&&eI(r)&&(a=U.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var nI=new pu(`fix-tables`);function rI(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?rI(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function iI(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=aI(e,t,r,n))};return t?t.doc!=e.doc&&rI(t.doc,e.doc,0,r):e.doc.descendants(r),n}function aI(e,t,n,r){let i=jF.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,qF(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=IF(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(nI,{fixTables:!0})}function oI(e){let t=e.selection,n=VF(e),r=n.node(-1),i=n.start(-1),a=jF.get(r);return{...t instanceof XF?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function sI(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;YF(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,JF(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?IF(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function cI(e,t){if(!BF(e))return!1;if(t){let n=oI(e);t(sI(e.tr,n,n.left))}return!0}function lI(e,t){if(!BF(e))return!1;if(t){let n=oI(e);t(sI(e.tr,n,n.right))}return!0}function uI(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,qF(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function dI(e,t){if(!BF(e))return!1;if(t){let n=oI(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;uI(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=jF.get(e)}t(r)}return!0}function fI(e,t,n){let r=IF(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function pI(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;fI(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?IF(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,IF(r.type.schema).row.create(null,o)),e}function mI(e,t){if(!BF(e))return!1;if(t){let n=oI(e);t(pI(e.tr,n,n.top))}return!0}function hI(e,t){if(!BF(e))return!1;if(t){let n=oI(e);t(pI(e.tr,n,n.bottom))}return!0}function gI(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&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(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function _I(e,t){if(!BF(e))return!1;if(t){let n=oI(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;gI(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=jF.get(n.table)}t(r)}return!0}function vI(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function yI({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function bI(e,t){let n=e.selection;if(!(n instanceof XF)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=oI(e),{map:i}=r;if(yI(i,r))return!1;if(t){let n=e.tr,a={},o=z.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{vI(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...JF(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=vI(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new XF(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function xI(e,t){let n=IF(e.schema);return SI(({node:e})=>n[e.type.spec.tableRole])(e,t)}function SI(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof XF){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=zF(r.$from),!i)return!1;a=RF(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=oI(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof XF&&u.setSelection(new XF(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function CI(e,t){return function(n,r){if(!BF(n))return!1;let i=VF(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof XF?n.selection.forEachCell((n,r)=>{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 wI(e){return function(t,n){if(!BF(t))return!1;if(n){let r=IF(t.schema),i=oI(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<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function TI(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function EI(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?wI(e):function(t,n){if(!BF(t))return!1;if(n){let r=IF(t.schema),i=oI(t),a=t.tr,o=TI(`row`,i,r),s=TI(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}EI(`row`,{useDeprecatedLogic:!0}),EI(`column`,{useDeprecatedLogic:!0});var DI=EI(`cell`,{useDeprecatedLogic:!0});function OI(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()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function kI(e){return function(t,n){if(!BF(t))return!1;let r=OI(VF(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(U.between(e,WF(e))).scrollIntoView())}return!0}}function AI(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>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 jI(e,t){let n=e.selection;if(!(n instanceof XF))return!1;if(t){let r=e.tr,i=IF(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 B(i,0,0))}),r.docChanged&&t(r)}return!0}function MI(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<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=PI(IF(o).row,new B(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?PI(IF(o).row,new B(t,n,r)).content:t);else return null;return NI(o,s)}function NI(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(z.empty),n[i]<r){let a=IF(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(z.from(o))}return{height:t.length,width:r,rows:t}}function PI(e,t){let n=e.createAndFill();return new Ul(n).replace(0,n.content.size,t).doc}function FI({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(qF(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(z.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(z.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function II(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=IF(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,z.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function LI(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function RI(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,qF(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(qF(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function zI(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=jF.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=jF.get(a),f=d.mapping.maps.length}II(d,o,a,n,l,u,f)&&p(),LI(d,o,a,n,c,l,s,f)&&p(),LI(d,o,a,n,c,l,u,f)&&p(),RI(d,o,a,n,s,u,c,f)&&p(),RI(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new B(i.rows[e-s],0,0))}p(),d.setSelection(new XF(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var BI=f_({ArrowLeft:HI(`horiz`,-1),ArrowRight:HI(`horiz`,1),ArrowUp:HI(`vert`,-1),ArrowDown:HI(`vert`,1),"Shift-ArrowLeft":UI(`horiz`,-1),"Shift-ArrowRight":UI(`horiz`,1),"Shift-ArrowUp":UI(`vert`,-1),"Shift-ArrowDown":UI(`vert`,1),Backspace:jI,"Mod-Backspace":jI,Delete:jI,"Mod-Delete":jI});function VI(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function HI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof XF)return VI(n,r,H.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=qI(i,e,t);if(o==null)return!1;if(e==`horiz`)return VI(n,r,H.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=KF(i,e,t),s;return s=a?H.near(a,1):t<0?H.near(n.doc.resolve(i.before(-1)),-1):H.near(n.doc.resolve(i.after(-1)),1),VI(n,r,s)}}}function UI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof XF)o=a;else{let r=qI(i,e,t);if(r==null)return!1;o=new XF(n.doc.resolve(r))}let s=KF(o.$headCell,e,t);return s?VI(n,r,new XF(o.$anchorCell,s)):!1}}function WI(e,t){let n=e.state.doc,r=RF(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new XF(r))),!0):!1}function GI(e,t,n){if(!BF(e.state))return!1;let r=MI(n),i=e.state.selection;if(i instanceof XF){r||={width:1,height:1,rows:[z.from(PI(IF(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=jF.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=FI(r,o.right-o.left,o.bottom-o.top),zI(e.state,e.dispatch,a,o,r),!0}else if(r){let t=VF(e.state),n=t.start(-1);return zI(e.state,e.dispatch,n,jF.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function KI(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=JI(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof XF)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=RF(e.state.selection.$anchor))!=null&&YI(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=YI(e,n),i=LF.getState(e.state)==null;if(!r||!GF(t,r))if(i)r=t;else return;let a=new XF(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(LF,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),LF.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(LF,-1))}function o(r){let o=r,s=LF.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(JI(e,o.target)!=n&&(c=YI(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 qI(e,t,n){if(!(e.state.selection instanceof U))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 JI(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function YI(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&&RF(e.state.doc.resolve(r))||RF(e.state.doc.resolve(i))}var XI=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`)),ZI(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,ZI(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function ZI(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;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var QI=new pu(`tableColumnResizing`);function $I({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=XI,lastColumnResizable:i=!0}={}){let a=new uu({key:QI,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=IF(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new eL(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=QI.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{tL(t,n,e,i)},mouseleave:e=>{nL(e)},mousedown:(e,r)=>{rL(e,r,t,n)}},decorations:e=>{let t=QI.getState(e);if(t&&t.activeHandle>-1)return fL(e,t.activeHandle)},nodeViews:{}}});return a}var eL=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(QI);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 UF(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function tL(e,t,n,r){if(!e.editable)return;let i=QI.getState(e.state);if(i&&!i.dragging){let a=aL(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=oL(e,t,`left`,n):i-t.clientX<=n&&(o=oL(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=jF.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}cL(e,o)}}}function nL(e){if(!e.editable)return;let t=QI.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&cL(e,-1)}function rL(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=QI.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=iL(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(QI,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=QI.getState(e.state);r?.dragging&&(lL(e,r.activeHandle,sL(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(QI,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=QI.getState(e.state);if(i&&i.dragging){let a=sL(i.dragging,t,n);uL(e,i.activeHandle,a,r)}}return uL(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function iL(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;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function aL(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function oL(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=RF(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=jF.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function sL(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function cL(e,t){e.dispatch(e.state.tr.setMeta(QI,{setHandle:t}))}function lL(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=jF.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():dL(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function uL(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=jF.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&ZI(a,c.firstChild,c,r,s,n)}function dL(e){return Array(e).fill(0)}function fL(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return ZT.empty;let a=jF.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,QI.getState(e)?.dragging&&n.push(JT.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(JT.widget(s,c))}}return ZT.create(e.doc,n)}function pL({allowTableNodeSelection:e=!1}={}){return new uu({key:LF,state:{init(){return null},apply(e,t){let n=e.getMeta(LF);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:QF,handleDOMEvents:{mousedown:KI},createSelectionBetween(e){return LF.getState(e.state)==null?null:e.state.selection},handleTripleClick:WI,handleKeyDown:BI,handlePaste:GI},appendTransaction(t,n,r){return tI(r,iI(r,n),e)}})}var mL=Lb.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Vv(this.options.HTMLAttributes,e),0]}}),hL=Lb.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Vv(this.options.HTMLAttributes,e),0]}}),gL=Lb.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Vv(this.options.HTMLAttributes,e),0]}});function _L(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function vL(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=_L(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=_L(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var yL=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),vL(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,vL(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function bL(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=_L(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function xL(e,t){return t?e.createChecked(null,t):e.createAndFill()}function SL(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function CL(e,t,n,r,i){let a=SL(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=xL(a.cell,i);if(e&&s.push(e),r){let e=xL(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function wL(e){return e instanceof XF}var TL=({editor:e})=>{let{selection:t}=e.state;if(!wL(t))return!1;let n=0;return jv(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):!1};function EL(e){return(e||``).replace(/\s+/g,` `).trim()}function DL(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=EL(i),o=e.type===`tableHeader`;n.push({text:a,isHeader:o})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=`
209
209
  `,d=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return u+=`| ${d.map((e,t)=>s(e,o[t])).join(` | `)} |
210
210
  `,u+=`| ${o.map(e=>`-`.repeat(Math.max(3,e))).join(` | `)} |
211
211
  `,(l?i.slice(1):i).forEach(e=>{u+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
212
- `}),u}var bL=yL,xL=Lb.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:dL,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=fL(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Vv(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[];if(e.header){let r=[];e.header.forEach(e=>{r.push(t.createNode(`tableHeader`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}return e.rows&&e.rows.forEach(e=>{let r=[];e.forEach(e=>{r.push(t.createNode(`tableCell`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>bL(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=hL(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(U.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>eI(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>tI(e,t),deleteColumn:()=>({state:e,dispatch:t})=>rI(e,t),addRowBefore:()=>({state:e,dispatch:t})=>oI(e,t),addRowAfter:()=>({state:e,dispatch:t})=>sI(e,t),deleteRow:()=>({state:e,dispatch:t})=>lI(e,t),deleteTable:()=>({state:e,dispatch:t})=>SI(e,t),mergeCells:()=>({state:e,dispatch:t})=>fI(e,t),splitCell:()=>({state:e,dispatch:t})=>pI(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>vI(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>vI(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>yI(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>fI(e,t)?!0:pI(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>hI(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>xI(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>xI(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&XF(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=HF.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:_L,"Mod-Backspace":_L,Delete:_L,"Mod-Delete":_L}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[GI({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],aL({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:Lv(Nv(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});sb.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(xL.configure(this.options.table)),this.options.tableCell!==!1&&e.push(oL.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(sL.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(cL.configure(this.options.tableRow)),e}});var SL=(e,t)=>{let n=t?.border!=null&&t.border!==``?t.border:`1`;e.setAttribute(`border`,n),e.style.setProperty(`color`,`var(--pie-text, black)`),e.style.setProperty(`background-color`,`var(--pie-background, rgba(255, 255, 255))`)},CL=class extends dL{constructor(e,t,n){super(e,t,n),SL(this.table,e.attrs)}update(e){let t=super.update(e);return t&&SL(this.table,e.attrs),t}},wL=xL.extend({addOptions(){return{...this.parent?.(),resizable:!0,handleWidth:0,View:CL}},addAttributes(){return{border:{default:`1`}}},renderHTML(e){let t=this.parent(e),{border:n}=e.HTMLAttributes,r=`${t[1].style}${t[1].style.match(/.*; */)?``:`;`}`;return t[1].style=`${r}
212
+ `}),u}var OL=DL,kL=Lb.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:yL,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=bL(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Vv(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[];if(e.header){let r=[];e.header.forEach(e=>{r.push(t.createNode(`tableHeader`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}return e.rows&&e.rows.forEach(e=>{let r=[];e.forEach(e=>{r.push(t.createNode(`tableCell`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>OL(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=CL(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(U.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>cI(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>lI(e,t),deleteColumn:()=>({state:e,dispatch:t})=>dI(e,t),addRowBefore:()=>({state:e,dispatch:t})=>mI(e,t),addRowAfter:()=>({state:e,dispatch:t})=>hI(e,t),deleteRow:()=>({state:e,dispatch:t})=>_I(e,t),deleteTable:()=>({state:e,dispatch:t})=>AI(e,t),mergeCells:()=>({state:e,dispatch:t})=>bI(e,t),splitCell:()=>({state:e,dispatch:t})=>xI(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>EI(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>EI(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>DI(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>bI(e,t)?!0:xI(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>CI(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>kI(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>kI(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&iI(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=XF.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:TL,"Mod-Backspace":TL,Delete:TL,"Mod-Delete":TL}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[$I({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],pL({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:Lv(Nv(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});sb.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(kL.configure(this.options.table)),this.options.tableCell!==!1&&e.push(mL.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(hL.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(gL.configure(this.options.tableRow)),e}});var AL=(e,t)=>{let n=t?.border!=null&&t.border!==``?t.border:`1`;e.setAttribute(`border`,n),e.style.setProperty(`color`,`var(--pie-text, black)`),e.style.setProperty(`background-color`,`var(--pie-background, rgba(255, 255, 255))`)},jL=class extends yL{constructor(e,t,n){super(e,t,n),AL(this.table,e.attrs)}update(e){let t=super.update(e);return t&&AL(this.table,e.attrs),t}},ML=kL.extend({addOptions(){return{...this.parent?.(),resizable:!0,handleWidth:0,View:jL}},addAttributes(){return{border:{default:`1`}}},renderHTML(e){let t=this.parent(e),{border:n}=e.HTMLAttributes,r=`${t[1].style}${t[1].style.match(/.*; */)?``:`;`}`;return t[1].style=`${r}
213
213
  color: var(--pie-text, black);
214
- background-color: var(--pie-background, rgba(255, 255, 255))`,t[1].border=n||`1`,t}}),TL=`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`,EL=oL.extend({content:TL}),DL=sL.extend({content:TL}),OL=Lb.create({name:`div`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`div`}]},renderHTML({HTMLAttributes:e}){return[`div`,e,0]},addKeyboardShortcuts(){let e=e=>{for(let t=e.depth;t>=0;--t)if(e.node(t).type.name===`listItem`)return!0;return!1};return{Enter:()=>{let{state:t}=this.editor,{$from:n}=t.selection;return n.parent.type.name!==`div`||e(n)?!1:this.editor.chain().focus().setNode(`paragraph`).splitBlock().run()},Backspace:()=>{let{state:e}=this.editor,{$from:t,empty:n}=e.selection;if(t.parent.type.name!==`div`||!n)return!1;let r=t.parent.textContent;if(r.length===0)return e.doc.childCount===1;if(r.length===1&&t.parentOffset===1){let{tr:n}=e;return n.delete(t.pos-1,t.pos),this.editor.view.dispatch(n),!0}return!1}}}}),kL=sb.create({name:`ensureEmptyRootIsDiv`,addProseMirrorPlugins(){return[new uu({key:new pu(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r}=n;if(r.childCount!==1)return null;let i=r.firstChild;if(i.type.name!==`paragraph`||i.content.size>0)return null;let a=n.schema.nodes.div;if(!a)return null;let o=i.nodeSize;return n.tr.replaceWith(0,o,a.create())}})]}}),AL=sb.create({name:`ensureListItemContentIsDiv`,addProseMirrorPlugins(){return[new uu({key:new pu(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r,schema:i}=n,a=i.nodes.div;if(!a)return null;let o=[];if(r.descendants((e,t)=>{if(e.type.name!==`listItem`)return;let n=1;e.forEach(e=>{e.type.name===`paragraph`&&o.push({pos:t+n,attrs:e.attrs}),n+=e.nodeSize})}),o.length===0)return null;let s=n.tr;return o.sort((e,t)=>t.pos-e.pos).forEach(({pos:e,attrs:t})=>s.setNodeMarkup(e,a,t)),s}})]}});function jL(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function ML(e){return Zr(`MuiSvgIcon`,e)}Qr(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]);var NL=e=>{let{color:t,fontSize:n,classes:r}=e;return A({root:[`root`,t!==`inherit`&&`color${R(t)}`,`fontSize${R(n)}`]},ML,r)},PL=L(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${R(n.color)}`],t[`fontSize${R(n.fontSize)}`]]}})(Ro(({theme:e})=>({userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,flexShrink:0,transition:e.transitions?.create?.(`fill`,{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:`currentColor`}},{props:{fontSize:`inherit`},style:{fontSize:`inherit`}},{props:{fontSize:`small`},style:{fontSize:e.typography?.pxToRem?.(20)||`1.25rem`}},{props:{fontSize:`medium`},style:{fontSize:e.typography?.pxToRem?.(24)||`1.5rem`}},{props:{fontSize:`large`},style:{fontSize:e.typography?.pxToRem?.(35)||`2.1875rem`}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:`action`},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:`disabled`},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:`inherit`},style:{color:void 0}}]}))),FL=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiSvgIcon`}),{children:r,className:i,color:a=`inherit`,component:o=`svg`,fontSize:s=`medium`,htmlColor:c,inheritViewBox:l=!1,titleAccess:u,viewBox:d=`0 0 24 24`,...f}=n,p=N.isValidElement(r)&&r.type===`svg`,m={...n,color:a,component:o,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:p},h={};l||(h.viewBox=d);let g=NL(m);return(0,F.jsxs)(PL,{as:o,className:k(g.root,i),focusable:`false`,color:c,"aria-hidden":!u||void 0,role:u?`img`:void 0,ref:t,...h,...f,...p&&r.props,ownerState:m,children:[p?r.props.children:r,u?(0,F.jsx)(`title`,{children:u}):null]})});FL.muiName=`SvgIcon`;function IL(e,t){function n(t,n){return(0,F.jsx)(FL,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=FL.muiName,N.memo(N.forwardRef(n))}function LL(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var RL=LL,zL=ya;function BL(e){return e&&e.ownerDocument||document}var VL=BL;function HL(e){return BL(e).defaultView||window}var UL=HL;function WL(e,t){typeof e==`function`?e(t):e&&(e.current=t)}var GL=fi,KL=Ki;function qL(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=N.useRef(t!==void 0),[o,s]=N.useState(n);return[a?t:o,N.useCallback(e=>{a||s(e)},[])]}var JL=qL;function YL(e){let t=N.useRef(e);return fi(()=>{t.current=e}),N.useRef((...e)=>(0,t.current)(...e)).current}var XL=YL;function ZL(...e){let t=N.useRef(void 0),n=N.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return N.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var QL=ZL;function $L(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}function eR(e,t){if(!e)return t;function n(e,t){let n={};return Object.keys(t).forEach(r=>{$L(r,t[r])&&typeof e[r]==`function`&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if(typeof e==`function`||typeof t==`function`)return r=>{let i=typeof t==`function`?t(r):t,a=typeof e==`function`?e({...r,...i}):e,o=k(r?.className,i?.className,a?.className),s=n(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};let r=t,i=n(e,r),a=k(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function tR(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var nR={};function rR(e,t){let n=N.useRef(nR);return n.current===nR&&(n.current=e(t)),n}var iR=class e{static create(){return new e}static use(){let t=rR(e.create).current,[n,r]=N.useState(!1);return t.shouldMount=n,t.setShouldMount=r,N.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=oR(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function aR(){return iR.use()}function oR(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function sR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function cR(e,t){return cR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cR(e,t)}function lR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cR(e,t)}function uR(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function dR(e,t){e.classList?e.classList.add(t):uR(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function fR(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function pR(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=fR(e.className,t):e.setAttribute(`class`,fR(e.className&&e.className.baseVal||``,t))}var mR={disabled:!1},hR=N.createContext(null),gR=function(e){return e.scrollTop},_R=`unmounted`,vR=`exited`,yR=`entering`,bR=`entered`,xR=`exiting`,SR=function(e){lR(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=vR,r.appearStatus=yR):o=bR:o=t.unmountOnExit||t.mountOnEnter?_R:vR,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:vR}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=yR):(n===`entering`||n===`entered`)&&(t=xR)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Rx.findDOMNode(this);n&&gR(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:_R})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[Rx.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||mR.disabled){this.safeSetState({status:bR},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:yR},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:bR},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Rx.findDOMNode(this);if(!t||mR.disabled){this.safeSetState({status:vR},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:xR},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:vR},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Rx.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=sR(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return N.createElement(hR.Provider,{value:null},typeof n==`function`?n(e,r):N.cloneElement(N.Children.only(n),r))},t}(N.Component);SR.contextType=hR,SR.propTypes={};function CR(){}SR.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:CR,onEntering:CR,onEntered:CR,onExit:CR,onExiting:CR,onExited:CR},SR.UNMOUNTED=_R,SR.EXITED=vR,SR.ENTERING=yR,SR.ENTERED=bR,SR.EXITING=xR;var wR=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return dR(e,t)})},TR=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return pR(e,t)})},ER=function(e){lR(t,e);function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.removeClasses(i,`exit`),t.addClass(i,a?`appear`:`enter`,`base`),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.addClass(i,a,`active`),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.removeClasses(i,a),t.addClass(i,a,`done`),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`appear`),t.removeClasses(n,`enter`),t.addClass(n,`exit`,`base`),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,`exit`,`active`),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`exit`),t.addClass(n,`exit`,`done`),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r=typeof n==`string`,i=r&&n?n+`-`:``,a=r?``+i+e:n[e];return{baseClassName:a,activeClassName:r?a+`-active`:n[e+`Active`],doneClassName:r?a+`-done`:n[e+`Done`]}},t}var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+`ClassName`],i=this.getClassNames(`enter`).doneClassName;t===`appear`&&n===`done`&&i&&(r+=` `+i),n===`active`&&e&&gR(e),r&&(this.appliedClasses[t][n]=r,wR(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,a=n.done;this.appliedClasses[t]={},r&&TR(e,r),i&&TR(e,i),a&&TR(e,a)},n.render=function(){var e=this.props;e.classNames;var t=sR(e,[`classNames`]);return N.createElement(SR,gt({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(N.Component);ER.defaultProps={classNames:``},ER.propTypes={};function DR(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function OR(e,t){var n=function(e){return t&&(0,N.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&N.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function kR(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function AR(e,t,n){return n[t]==null?e.props[t]:n[t]}function jR(e,t){return OR(e.children,function(n){return(0,N.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:AR(n,`appear`,e),enter:AR(n,`enter`,e),exit:AR(n,`exit`,e)})})}function MR(e,t,n){var r=OR(e.children),i=kR(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,N.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,N.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,N.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:AR(o,`exit`,e),enter:AR(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,N.cloneElement)(o,{in:!1}):c&&s&&(0,N.isValidElement)(l)&&(i[a]=(0,N.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:AR(o,`exit`,e),enter:AR(o,`enter`,e)}))}}),i}var NR=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},PR={component:`div`,childFactory:function(e){return e}},FR=function(e){lR(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(DR(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?jR(e,r):MR(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=OR(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=gt({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=sR(e,[`component`,`childFactory`]),i=this.state.contextValue,a=NR(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?N.createElement(hR.Provider,{value:i},a):N.createElement(hR.Provider,{value:i},N.createElement(t,r,a))},t}(N.Component);FR.propTypes={},FR.defaultProps=PR;var IR=[];function LR(e){N.useEffect(e,IR)}var RR=class e{static create(){return new e}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function zR(){let e=rR(RR.create).current;return LR(e.disposeEffect),e}function BR(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=N.useState(!1),f=k(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=k(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),N.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,F.jsx)(`span`,{className:f,style:p,children:(0,F.jsx)(`span`,{className:m})})}var VR=Qr(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),HR=550,UR=pr`
214
+ background-color: var(--pie-background, rgba(255, 255, 255))`,t[1].border=n||`1`,t}}),NL=`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`,PL=mL.extend({content:NL}),FL=hL.extend({content:NL}),IL=Lb.create({name:`div`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`div`}]},renderHTML({HTMLAttributes:e}){return[`div`,e,0]},addKeyboardShortcuts(){let e=e=>{for(let t=e.depth;t>=0;--t)if(e.node(t).type.name===`listItem`)return!0;return!1};return{Enter:()=>{let{state:t}=this.editor,{$from:n}=t.selection;return n.parent.type.name!==`div`||e(n)?!1:this.editor.chain().focus().setNode(`paragraph`).splitBlock().run()},Backspace:()=>{let{state:e}=this.editor,{$from:t,empty:n}=e.selection;if(t.parent.type.name!==`div`||!n)return!1;let r=t.parent.textContent;if(r.length===0)return e.doc.childCount===1;if(r.length===1&&t.parentOffset===1){let{tr:n}=e;return n.delete(t.pos-1,t.pos),this.editor.view.dispatch(n),!0}return!1}}}}),LL=sb.create({name:`ensureEmptyRootIsDiv`,addProseMirrorPlugins(){return[new uu({key:new pu(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r}=n;if(r.childCount!==1)return null;let i=r.firstChild;if(i.type.name!==`paragraph`||i.content.size>0)return null;let a=n.schema.nodes.div;if(!a)return null;let o=i.nodeSize;return n.tr.replaceWith(0,o,a.create())}})]}}),RL=sb.create({name:`ensureListItemContentIsDiv`,addProseMirrorPlugins(){return[new uu({key:new pu(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r,schema:i}=n,a=i.nodes.div;if(!a)return null;let o=[];if(r.descendants((e,t)=>{if(e.type.name!==`listItem`)return;let n=1;e.forEach(e=>{e.type.name===`paragraph`&&o.push({pos:t+n,attrs:e.attrs}),n+=e.nodeSize})}),o.length===0)return null;let s=n.tr;return o.sort((e,t)=>t.pos-e.pos).forEach(({pos:e,attrs:t})=>s.setNodeMarkup(e,a,t)),s}})]}});function zL(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function BL(e){return Zr(`MuiSvgIcon`,e)}Qr(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]);var VL=e=>{let{color:t,fontSize:n,classes:r}=e;return A({root:[`root`,t!==`inherit`&&`color${R(t)}`,`fontSize${R(n)}`]},BL,r)},HL=L(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${R(n.color)}`],t[`fontSize${R(n.fontSize)}`]]}})(Ro(({theme:e})=>({userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,flexShrink:0,transition:e.transitions?.create?.(`fill`,{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:`currentColor`}},{props:{fontSize:`inherit`},style:{fontSize:`inherit`}},{props:{fontSize:`small`},style:{fontSize:e.typography?.pxToRem?.(20)||`1.25rem`}},{props:{fontSize:`medium`},style:{fontSize:e.typography?.pxToRem?.(24)||`1.5rem`}},{props:{fontSize:`large`},style:{fontSize:e.typography?.pxToRem?.(35)||`2.1875rem`}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:`action`},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:`disabled`},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:`inherit`},style:{color:void 0}}]}))),UL=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiSvgIcon`}),{children:r,className:i,color:a=`inherit`,component:o=`svg`,fontSize:s=`medium`,htmlColor:c,inheritViewBox:l=!1,titleAccess:u,viewBox:d=`0 0 24 24`,...f}=n,p=N.isValidElement(r)&&r.type===`svg`,m={...n,color:a,component:o,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:p},h={};l||(h.viewBox=d);let g=VL(m);return(0,F.jsxs)(HL,{as:o,className:k(g.root,i),focusable:`false`,color:c,"aria-hidden":!u||void 0,role:u?`img`:void 0,ref:t,...h,...f,...p&&r.props,ownerState:m,children:[p?r.props.children:r,u?(0,F.jsx)(`title`,{children:u}):null]})});UL.muiName=`SvgIcon`;function WL(e,t){function n(t,n){return(0,F.jsx)(UL,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=UL.muiName,N.memo(N.forwardRef(n))}function GL(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var KL=GL,qL=ya;function JL(e){return e&&e.ownerDocument||document}var YL=JL;function XL(e){return JL(e).defaultView||window}var ZL=XL;function QL(e,t){typeof e==`function`?e(t):e&&(e.current=t)}var $L=fi,eR=Ki;function tR(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=N.useRef(t!==void 0),[o,s]=N.useState(n);return[a?t:o,N.useCallback(e=>{a||s(e)},[])]}var nR=tR;function rR(e){let t=N.useRef(e);return fi(()=>{t.current=e}),N.useRef((...e)=>(0,t.current)(...e)).current}var iR=rR;function aR(...e){let t=N.useRef(void 0),n=N.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return N.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var oR=aR;function sR(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}function cR(e,t){if(!e)return t;function n(e,t){let n={};return Object.keys(t).forEach(r=>{sR(r,t[r])&&typeof e[r]==`function`&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if(typeof e==`function`||typeof t==`function`)return r=>{let i=typeof t==`function`?t(r):t,a=typeof e==`function`?e({...r,...i}):e,o=k(r?.className,i?.className,a?.className),s=n(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};let r=t,i=n(e,r),a=k(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function lR(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var uR={};function dR(e,t){let n=N.useRef(uR);return n.current===uR&&(n.current=e(t)),n}var fR=class e{static create(){return new e}static use(){let t=dR(e.create).current,[n,r]=N.useState(!1);return t.shouldMount=n,t.setShouldMount=r,N.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=mR(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function pR(){return fR.use()}function mR(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function hR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gR(e,t){return gR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gR(e,t)}function _R(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gR(e,t)}function vR(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function yR(e,t){e.classList?e.classList.add(t):vR(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function bR(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function xR(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=bR(e.className,t):e.setAttribute(`class`,bR(e.className&&e.className.baseVal||``,t))}var SR={disabled:!1},CR=N.createContext(null),wR=function(e){return e.scrollTop},TR=`unmounted`,ER=`exited`,DR=`entering`,OR=`entered`,kR=`exiting`,AR=function(e){_R(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=ER,r.appearStatus=DR):o=OR:o=t.unmountOnExit||t.mountOnEnter?TR:ER,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:ER}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=DR):(n===`entering`||n===`entered`)&&(t=kR)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Rx.findDOMNode(this);n&&wR(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:TR})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[Rx.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||SR.disabled){this.safeSetState({status:OR},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:DR},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:OR},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Rx.findDOMNode(this);if(!t||SR.disabled){this.safeSetState({status:ER},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:kR},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:ER},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Rx.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=hR(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return N.createElement(CR.Provider,{value:null},typeof n==`function`?n(e,r):N.cloneElement(N.Children.only(n),r))},t}(N.Component);AR.contextType=CR,AR.propTypes={};function jR(){}AR.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:jR,onEntering:jR,onEntered:jR,onExit:jR,onExiting:jR,onExited:jR},AR.UNMOUNTED=TR,AR.EXITED=ER,AR.ENTERING=DR,AR.ENTERED=OR,AR.EXITING=kR;var MR=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return yR(e,t)})},NR=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return xR(e,t)})},PR=function(e){_R(t,e);function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.removeClasses(i,`exit`),t.addClass(i,a?`appear`:`enter`,`base`),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.addClass(i,a,`active`),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.removeClasses(i,a),t.addClass(i,a,`done`),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`appear`),t.removeClasses(n,`enter`),t.addClass(n,`exit`,`base`),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,`exit`,`active`),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`exit`),t.addClass(n,`exit`,`done`),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r=typeof n==`string`,i=r&&n?n+`-`:``,a=r?``+i+e:n[e];return{baseClassName:a,activeClassName:r?a+`-active`:n[e+`Active`],doneClassName:r?a+`-done`:n[e+`Done`]}},t}var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+`ClassName`],i=this.getClassNames(`enter`).doneClassName;t===`appear`&&n===`done`&&i&&(r+=` `+i),n===`active`&&e&&wR(e),r&&(this.appliedClasses[t][n]=r,MR(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,a=n.done;this.appliedClasses[t]={},r&&NR(e,r),i&&NR(e,i),a&&NR(e,a)},n.render=function(){var e=this.props;e.classNames;var t=hR(e,[`classNames`]);return N.createElement(AR,gt({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(N.Component);PR.defaultProps={classNames:``},PR.propTypes={};function FR(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function IR(e,t){var n=function(e){return t&&(0,N.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&N.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function LR(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function RR(e,t,n){return n[t]==null?e.props[t]:n[t]}function zR(e,t){return IR(e.children,function(n){return(0,N.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:RR(n,`appear`,e),enter:RR(n,`enter`,e),exit:RR(n,`exit`,e)})})}function BR(e,t,n){var r=IR(e.children),i=LR(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,N.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,N.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,N.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:RR(o,`exit`,e),enter:RR(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,N.cloneElement)(o,{in:!1}):c&&s&&(0,N.isValidElement)(l)&&(i[a]=(0,N.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:RR(o,`exit`,e),enter:RR(o,`enter`,e)}))}}),i}var VR=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},HR={component:`div`,childFactory:function(e){return e}},UR=function(e){_R(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(FR(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?zR(e,r):BR(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=IR(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=gt({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=hR(e,[`component`,`childFactory`]),i=this.state.contextValue,a=VR(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?N.createElement(CR.Provider,{value:i},a):N.createElement(CR.Provider,{value:i},N.createElement(t,r,a))},t}(N.Component);UR.propTypes={},UR.defaultProps=HR;var WR=[];function GR(e){N.useEffect(e,WR)}var KR=class e{static create(){return new e}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function qR(){let e=dR(KR.create).current;return GR(e.disposeEffect),e}function JR(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=N.useState(!1),f=k(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=k(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),N.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,F.jsx)(`span`,{className:f,style:p,children:(0,F.jsx)(`span`,{className:m})})}var YR=Qr(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),XR=550,ZR=pr`
215
215
  0% {
216
216
  transform: scale(0);
217
217
  opacity: 0.1;
@@ -221,7 +221,7 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
221
221
  transform: scale(1);
222
222
  opacity: 0.3;
223
223
  }
224
- `,WR=pr`
224
+ `,QR=pr`
225
225
  0% {
226
226
  opacity: 1;
227
227
  }
@@ -229,7 +229,7 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
229
229
  100% {
230
230
  opacity: 0;
231
231
  }
232
- `,GR=pr`
232
+ `,$R=pr`
233
233
  0% {
234
234
  transform: scale(1);
235
235
  }
@@ -241,23 +241,23 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
241
241
  100% {
242
242
  transform: scale(1);
243
243
  }
244
- `,KR=L(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),qR=L(BR,{name:`MuiTouchRipple`,slot:`Ripple`})`
244
+ `,ez=L(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),tz=L(JR,{name:`MuiTouchRipple`,slot:`Ripple`})`
245
245
  opacity: 0;
246
246
  position: absolute;
247
247
 
248
- &.${VR.rippleVisible} {
248
+ &.${YR.rippleVisible} {
249
249
  opacity: 0.3;
250
250
  transform: scale(1);
251
- animation-name: ${UR};
252
- animation-duration: ${HR}ms;
251
+ animation-name: ${ZR};
252
+ animation-duration: ${XR}ms;
253
253
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
254
254
  }
255
255
 
256
- &.${VR.ripplePulsate} {
256
+ &.${YR.ripplePulsate} {
257
257
  animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
258
258
  }
259
259
 
260
- & .${VR.child} {
260
+ & .${YR.child} {
261
261
  opacity: 1;
262
262
  display: block;
263
263
  width: 100%;
@@ -266,25 +266,25 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
266
266
  background-color: currentColor;
267
267
  }
268
268
 
269
- & .${VR.childLeaving} {
269
+ & .${YR.childLeaving} {
270
270
  opacity: 0;
271
- animation-name: ${WR};
272
- animation-duration: ${HR}ms;
271
+ animation-name: ${QR};
272
+ animation-duration: ${XR}ms;
273
273
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
274
274
  }
275
275
 
276
- & .${VR.childPulsate} {
276
+ & .${YR.childPulsate} {
277
277
  position: absolute;
278
278
  /* @noflip */
279
279
  left: 0px;
280
280
  top: 0;
281
- animation-name: ${GR};
281
+ animation-name: ${$R};
282
282
  animation-duration: 2500ms;
283
283
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
284
284
  animation-iteration-count: infinite;
285
285
  animation-delay: 200ms;
286
286
  }
287
- `,JR=N.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=zo({props:e,name:`MuiTouchRipple`}),[o,s]=N.useState([]),c=N.useRef(0),l=N.useRef(null);N.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=N.useRef(!1),d=zR(),f=N.useRef(null),p=N.useRef(null),m=N.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,F.jsx)(qR,{classes:{ripple:k(r.ripple,VR.ripple),rippleVisible:k(r.rippleVisible,VR.rippleVisible),ripplePulsate:k(r.ripplePulsate,VR.ripplePulsate),child:k(r.child,VR.child),childLeaving:k(r.childLeaving,VR.childLeaving),childPulsate:k(r.childPulsate,VR.childPulsate)},timeout:HR,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=N.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:p.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,h,g;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),h=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),h=Math.round(n-c.top)}if(a)g=Math.sqrt((2*c.width**2+c.height**2)/3),g%2==0&&(g+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-h),h)*2+2;g=Math.sqrt(e**2+t**2)}e?.touches?f.current===null&&(f.current=()=>{m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},d.start(80,()=>{f.current&&=(f.current(),null)})):m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},[n,m,d]),g=N.useCallback(()=>{h({},{pulsate:!0})},[h]),_=N.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&f.current){f.current(),f.current=null,d.start(0,()=>{_(e,t)});return}f.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return N.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:_}),[g,h,_]),(0,F.jsx)(KR,{className:k(VR.root,r.root,i),ref:p,...a,children:(0,F.jsx)(FR,{component:null,exit:!0,children:o})})});function YR(e){return Zr(`MuiButtonBase`,e)}var XR=Qr(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),ZR=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,a=A({root:[`root`,t&&`disabled`,n&&`focusVisible`]},YR,i);return n&&r&&(a.root+=` ${r}`),a},QR=L(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${XR.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),$R=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:f,LinkComponent:p=`a`,onBlur:m,onClick:h,onContextMenu:g,onDragLeave:_,onFocus:v,onFocusVisible:y,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:C,onMouseUp:w,onTouchEnd:T,onTouchMove:E,onTouchStart:D,tabIndex:O=0,TouchRippleProps:A,touchRippleRef:j,type:M,...ee}=n,te=N.useRef(null),ne=aR(),re=QL(ne.ref,j),[ie,P]=N.useState(!1);c&&ie&&P(!1),N.useImperativeHandle(r,()=>({focusVisible:()=>{P(!0),te.current.focus()}}),[]);let ae=ne.shouldMount&&!l&&!c;N.useEffect(()=>{ie&&d&&!l&&ne.pulsate()},[l,d,ie,ne]);let oe=ez(ne,`start`,S,u),se=ez(ne,`stop`,g,u),ce=ez(ne,`stop`,_,u),le=ez(ne,`stop`,w,u),ue=ez(ne,`stop`,e=>{ie&&e.preventDefault(),C&&C(e)},u),de=ez(ne,`start`,D,u),fe=ez(ne,`stop`,T,u),pe=ez(ne,`stop`,E,u),me=ez(ne,`stop`,e=>{tR(e.target)||P(!1),m&&m(e)},!1),he=XL(e=>{te.current||=e.currentTarget,tR(e.target)&&(P(!0),y&&y(e)),v&&v(e)}),ge=()=>{let e=te.current;return e?e.tagName!==`BUTTON`&&!(e.tagName===`A`&&e.href):s&&s!==`button`},_e=XL(e=>{d&&!e.repeat&&ie&&e.key===` `&&ne.stop(e,()=>{ne.start(e)}),e.target===e.currentTarget&&ge()&&e.key===` `&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&ge()&&e.key===`Enter`&&!c&&(e.preventDefault(),h&&h(e))}),ve=XL(e=>{d&&e.key===` `&&ie&&!e.defaultPrevented&&ne.stop(e,()=>{ne.pulsate(e)}),x&&x(e),h&&e.target===e.currentTarget&&ge()&&e.key===` `&&!e.defaultPrevented&&!c&&h(e)}),ye=s;ye===`button`&&(ee.href||ee.to)&&(ye=p);let be={};if(ye===`button`){let e=!!ee.formAction;be.type=M===void 0&&!e?`button`:M,be.disabled=c}else!ee.href&&!ee.to&&(be.role=`button`),c&&(be[`aria-disabled`]=c);let xe=QL(t,te),Se={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,tabIndex:O,focusVisible:ie},Ce=ZR(Se);return(0,F.jsxs)(QR,{as:ye,className:k(Ce.root,o),ownerState:Se,onBlur:me,onClick:h,onContextMenu:se,onFocus:he,onKeyDown:_e,onKeyUp:ve,onMouseDown:oe,onMouseLeave:ue,onMouseUp:le,onDragLeave:ce,onTouchEnd:fe,onTouchMove:pe,onTouchStart:de,ref:xe,tabIndex:c?-1:O,type:M,...be,...ee,children:[a,ae?(0,F.jsx)(JR,{ref:re,center:i,...A}):null]})});function ez(e,t,n,r=!1){return XL(i=>(n&&n(i),r||e[t](i),!0))}function tz(e){return Zr(`MuiCircularProgress`,e)}Qr(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDeterminate`,`circleIndeterminate`,`circleDisableShrink`]);var nz=44,rz=pr`
287
+ `,nz=N.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=zo({props:e,name:`MuiTouchRipple`}),[o,s]=N.useState([]),c=N.useRef(0),l=N.useRef(null);N.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=N.useRef(!1),d=qR(),f=N.useRef(null),p=N.useRef(null),m=N.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,F.jsx)(tz,{classes:{ripple:k(r.ripple,YR.ripple),rippleVisible:k(r.rippleVisible,YR.rippleVisible),ripplePulsate:k(r.ripplePulsate,YR.ripplePulsate),child:k(r.child,YR.child),childLeaving:k(r.childLeaving,YR.childLeaving),childPulsate:k(r.childPulsate,YR.childPulsate)},timeout:XR,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=N.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:p.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,h,g;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),h=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),h=Math.round(n-c.top)}if(a)g=Math.sqrt((2*c.width**2+c.height**2)/3),g%2==0&&(g+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-h),h)*2+2;g=Math.sqrt(e**2+t**2)}e?.touches?f.current===null&&(f.current=()=>{m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},d.start(80,()=>{f.current&&=(f.current(),null)})):m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},[n,m,d]),g=N.useCallback(()=>{h({},{pulsate:!0})},[h]),_=N.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&f.current){f.current(),f.current=null,d.start(0,()=>{_(e,t)});return}f.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return N.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:_}),[g,h,_]),(0,F.jsx)(ez,{className:k(YR.root,r.root,i),ref:p,...a,children:(0,F.jsx)(UR,{component:null,exit:!0,children:o})})});function rz(e){return Zr(`MuiButtonBase`,e)}var iz=Qr(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),az=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,a=A({root:[`root`,t&&`disabled`,n&&`focusVisible`]},rz,i);return n&&r&&(a.root+=` ${r}`),a},oz=L(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${iz.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),sz=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:f,LinkComponent:p=`a`,onBlur:m,onClick:h,onContextMenu:g,onDragLeave:_,onFocus:v,onFocusVisible:y,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:C,onMouseUp:w,onTouchEnd:T,onTouchMove:E,onTouchStart:D,tabIndex:O=0,TouchRippleProps:A,touchRippleRef:j,type:M,...ee}=n,te=N.useRef(null),ne=pR(),re=oR(ne.ref,j),[ie,P]=N.useState(!1);c&&ie&&P(!1),N.useImperativeHandle(r,()=>({focusVisible:()=>{P(!0),te.current.focus()}}),[]);let ae=ne.shouldMount&&!l&&!c;N.useEffect(()=>{ie&&d&&!l&&ne.pulsate()},[l,d,ie,ne]);let oe=cz(ne,`start`,S,u),se=cz(ne,`stop`,g,u),ce=cz(ne,`stop`,_,u),le=cz(ne,`stop`,w,u),ue=cz(ne,`stop`,e=>{ie&&e.preventDefault(),C&&C(e)},u),de=cz(ne,`start`,D,u),fe=cz(ne,`stop`,T,u),pe=cz(ne,`stop`,E,u),me=cz(ne,`stop`,e=>{lR(e.target)||P(!1),m&&m(e)},!1),he=iR(e=>{te.current||=e.currentTarget,lR(e.target)&&(P(!0),y&&y(e)),v&&v(e)}),ge=()=>{let e=te.current;return e?e.tagName!==`BUTTON`&&!(e.tagName===`A`&&e.href):s&&s!==`button`},_e=iR(e=>{d&&!e.repeat&&ie&&e.key===` `&&ne.stop(e,()=>{ne.start(e)}),e.target===e.currentTarget&&ge()&&e.key===` `&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&ge()&&e.key===`Enter`&&!c&&(e.preventDefault(),h&&h(e))}),ve=iR(e=>{d&&e.key===` `&&ie&&!e.defaultPrevented&&ne.stop(e,()=>{ne.pulsate(e)}),x&&x(e),h&&e.target===e.currentTarget&&ge()&&e.key===` `&&!e.defaultPrevented&&!c&&h(e)}),ye=s;ye===`button`&&(ee.href||ee.to)&&(ye=p);let be={};if(ye===`button`){let e=!!ee.formAction;be.type=M===void 0&&!e?`button`:M,be.disabled=c}else!ee.href&&!ee.to&&(be.role=`button`),c&&(be[`aria-disabled`]=c);let xe=oR(t,te),Se={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,tabIndex:O,focusVisible:ie},Ce=az(Se);return(0,F.jsxs)(oz,{as:ye,className:k(Ce.root,o),ownerState:Se,onBlur:me,onClick:h,onContextMenu:se,onFocus:he,onKeyDown:_e,onKeyUp:ve,onMouseDown:oe,onMouseLeave:ue,onMouseUp:le,onDragLeave:ce,onTouchEnd:fe,onTouchMove:pe,onTouchStart:de,ref:xe,tabIndex:c?-1:O,type:M,...be,...ee,children:[a,ae?(0,F.jsx)(nz,{ref:re,center:i,...A}):null]})});function cz(e,t,n,r=!1){return iR(i=>(n&&n(i),r||e[t](i),!0))}function lz(e){return Zr(`MuiCircularProgress`,e)}Qr(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDeterminate`,`circleIndeterminate`,`circleDisableShrink`]);var uz=44,dz=pr`
288
288
  0% {
289
289
  transform: rotate(0deg);
290
290
  }
@@ -292,7 +292,7 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
292
292
  100% {
293
293
  transform: rotate(360deg);
294
294
  }
295
- `,iz=pr`
295
+ `,fz=pr`
296
296
  0% {
297
297
  stroke-dasharray: 1px, 200px;
298
298
  stroke-dashoffset: 0;
@@ -307,29 +307,29 @@ ${n}`}}),s}function cA(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants
307
307
  stroke-dasharray: 1px, 200px;
308
308
  stroke-dashoffset: -126px;
309
309
  }
310
- `,az=typeof rz==`string`?null:fr`
311
- animation: ${rz} 1.4s linear infinite;
312
- `,oz=typeof iz==`string`?null:fr`
313
- animation: ${iz} 1.4s ease-in-out infinite;
314
- `,sz=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return A({root:[`root`,n,`color${R(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,`circle${R(n)}`,i&&`circleDisableShrink`]},tz,t)},cz=L(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${R(n.color)}`]]}})(Ro(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:az||{animation:`${rz} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),lz=L(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),uz=L(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${R(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Ro(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:oz||{animation:`${iz} 1.4s ease-in-out infinite`}}]}))),dz=L(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(Ro(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),fz=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,size:s=40,style:c,thickness:l=3.6,value:u=0,variant:d=`indeterminate`,...f}=n,p={...n,color:i,disableShrink:a,size:s,thickness:l,value:u,variant:d,enableTrackSlot:o},m=sz(p),h={},g={},_={};if(d===`determinate`){let e=2*Math.PI*((nz-l)/2);h.strokeDasharray=e.toFixed(3),_[`aria-valuenow`]=Math.round(u),h.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform=`rotate(-90deg)`}return(0,F.jsx)(cz,{className:k(m.root,r),style:{width:s,height:s,...g,...c},ownerState:p,ref:t,role:`progressbar`,..._,...f,children:(0,F.jsxs)(lz,{className:m.svg,ownerState:p,viewBox:`${nz/2} ${nz/2} ${nz} ${nz}`,children:[o?(0,F.jsx)(dz,{className:m.track,ownerState:p,cx:nz,cy:nz,r:(nz-l)/2,fill:`none`,strokeWidth:l,"aria-hidden":`true`}):null,(0,F.jsx)(uz,{className:m.circle,style:h,ownerState:p,cx:nz,cy:nz,r:(nz-l)/2,fill:`none`,strokeWidth:l})]})})});function pz(e){return Zr(`MuiIconButton`,e)}var mz=Qr(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),hz=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return A({root:[`root`,o&&`loading`,n&&`disabled`,r!=="default"&&`color${R(r)}`,i&&`edge${R(i)}`,`size${R(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},pz,t)},gz=L($R,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${R(n.color)}`],n.edge&&t[`edge${R(n.edge)}`],t[`size${R(n.size)}`]]}})(Ro(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),Ro(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${mz.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${mz.loading}`]:{color:`transparent`}}))),_z=L(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),vz=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:a,color:o=`default`,disabled:s=!1,disableFocusRipple:c=!1,size:l=`medium`,id:u,loading:d=null,loadingIndicator:f,...p}=n,m=KL(u),h=f??(0,F.jsx)(fz,{"aria-labelledby":m,color:`inherit`,size:16}),g={...n,edge:r,color:o,disabled:s,disableFocusRipple:c,loading:d,loadingIndicator:h,size:l},_=hz(g);return(0,F.jsxs)(gz,{id:d?m:u,className:k(_.root,a),centerRipple:!0,focusRipple:!c,disabled:s||d,ref:t,...p,ownerState:g,children:[typeof d==`boolean`&&(0,F.jsx)(`span`,{className:_.loadingWrapper,style:{display:`contents`},children:(0,F.jsx)(_z,{className:_.loadingIndicator,ownerState:g,children:d&&h})}),i]})}),yz=IL((0,F.jsx)(`path`,{d:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z`}),`Delete`),bz=`pie-toolbar`,xz=IL((0,F.jsx)(`path`,{d:`M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`}),`Check`),Sz=L(vz)({verticalAlign:`top`,width:`28px`,height:`28px`,color:`var(--editable-html-toolbar-check, #00bb00)`,padding:`4px`}),Cz=({onClick:e,doneButtonRef:t})=>(0,F.jsx)(Sz,{"aria-label":`Done`,buttonRef:t,onClick:e,children:(0,F.jsx)(xz,{})});Cz.propTypes={onClick:p.func,doneButtonRef:p.func};var wz=Cz,Tz=L(`div`,{shouldForwardProp:e=>![`showDone`,`toolbarAlignment`,`isFocused`,`autoWidth`,`isHidden`].includes(e)})(({showDone:e,toolbarAlignment:t,isFocused:n,autoWidth:r,isHidden:i})=>({position:`absolute`,zIndex:10,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:e?`280px`:`265px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:1,...t===`right`&&{right:0},...r?{width:`auto`}:{width:`100%`},...i&&{visibility:`hidden`}})),Ez=L(vz)({width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`}),Dz=L(`div`)({display:`flex`});function Oz(e){let{children:t,deletable:n,toolbarOpts:r,autoWidth:i,isFocused:a,doneButtonRef:o,onDelete:s,showDone:c,onDone:l,style:u}=e,d=r.minWidth===void 0?{}:{minWidth:r.minWidth};return(0,F.jsxs)(Tz,{className:bz,showDone:c,toolbarAlignment:r.alignment,isFocused:r.alwaysVisible||a,autoWidth:i,isHidden:r.isHidden===!0,style:{...d,...u},children:[t,(0,F.jsxs)(Dz,{children:[n&&(0,F.jsx)(Ez,{"aria-label":`Delete`,onMouseDown:e=>s?.(e),children:(0,F.jsx)(yz,{})}),c&&(0,F.jsx)(wz,{doneButtonRef:o,onClick:l})]})]})}var kz=`toolbarOpenedChanged`,Az=(e,t)=>{let n=!!t;e._toolbarOpened!==n&&(e._toolbarOpened=n,e?.view&&e?.state?.tr&&e.view.dispatch(e.state.tr.setMeta(kz,!0)))},jz=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s}=o,{respAreaToolbar:c,error:l}=i,u=r(),[d,f]=(0,N.useState)(!1),p=c([n,u],t,()=>{}),m=(0,N.useRef)(null),h;if(l){let e=l(),t=parseInt(o.index,10);h=!!e?.[t]?.[0]}return(0,N.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&f(a):f(a)},[t,n,a]),(0,N.useEffect)(()=>{let e=e=>{!(e.target.closest(`.insert-character-dialog`)||e.target.closest(`[data-toolbar-for]`))&&m.current&&!m.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&f(!1)};return d?document.addEventListener(`mousedown`,e):document.removeEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,F.jsxs)(rS,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline-flex`,minHeight:`55px`,position:`relative`,cursor:`pointer`},children:[(0,F.jsx)(`div`,{...o,style:{display:`inline-flex`,width:`100%`,minHeight:`46px`,height:`46px`,backgroundColor:`#FFF`,border:`1px solid ${h?`red`:`#C0C3CF`}`,boxSizing:`border-box`,borderRadius:`4px`,overflow:`hidden`,padding:`12px 21px`,margin:`0 4px`,minWidth:`178px`,visibility:d?`hidden`:`visible`},onClick:()=>f(!0),dangerouslySetInnerHTML:{__html:s||`<div>&nbsp;</div>`}}),d&&(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`div`,{ref:m,className:`absolute z-50 bg-white shadow-lg rounded p-2`,style:{zIndex:1},children:(0,F.jsx)(p,{})}),t._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(Oz,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),Az(t,!1),t.view.dispatch(e),f(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};jz.propTypes={attributes:p.object,error:p.any,value:p.string,isFocused:p.bool};var Mz=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Nz(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Pz(e){return`nodeType`in e}function Fz(e){return e?Nz(e)?e:Pz(e)?e.ownerDocument?.defaultView??window:window:window}function Iz(e){let{Document:t}=Fz(e);return e instanceof t}function Lz(e){return!Nz(e)&&e instanceof Fz(e).HTMLElement}function Rz(e){return e instanceof Fz(e).SVGElement}function zz(e){return e?Nz(e)?e.document:Pz(e)?Iz(e)?e:Lz(e)||Rz(e)?e.ownerDocument:document:document:document}var Bz=Mz?N.useLayoutEffect:N.useEffect;function Vz(e){let t=(0,N.useRef)(e);return Bz(()=>{t.current=e}),(0,N.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}function Hz(e,t){t===void 0&&(t=[e]);let n=(0,N.useRef)(e);return Bz(()=>{n.current!==e&&(n.current=e)},t),n}function Uz(e){let t=Vz(e),n=(0,N.useRef)(null);return[n,(0,N.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var Wz={};function Gz(e,t){return(0,N.useMemo)(()=>{if(t)return t;let n=Wz[e]==null?0:Wz[e]+1;return Wz[e]=n,e+`-`+n},[e,t])}function Kz(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var qz=Kz(1),Jz=Kz(-1);function Yz(e){return`clientX`in e&&`clientY`in e}function Xz(e){if(!e)return!1;let{KeyboardEvent:t}=Fz(e.target);return t&&e instanceof t}function Zz(e){if(!e)return!1;let{TouchEvent:t}=Fz(e.target);return t&&e instanceof t}function Qz(e){if(Zz(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Yz(e)?{x:e.clientX,y:e.clientY}:null}var $z;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})($z||={});function eB(){}var tB=Object.freeze({x:0,y:0});function nB(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function rB(e,t,n){let r=nB(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var iB={ignoreTransform:!1};function aB(e,t){t===void 0&&(t=iB);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Fz(e).getComputedStyle(e);t&&(n=rB(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function oB(e,t){return t===void 0&&(t=Fz(e).getComputedStyle(e)),t.position===`fixed`}function sB(e,t){t===void 0&&(t=Fz(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function cB(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Iz(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Lz(i)||Rz(i)||n.includes(i))return n;let a=Fz(e).getComputedStyle(i);return i!==e&&sB(i,a)&&n.push(i),oB(i,a)?n:r(i.parentNode)}return e?r(e):n}function lB(e){let[t]=cB(e,1);return t??null}var uB;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(uB||={});function dB(e){return!Mz||!e?!1:e===document.scrollingElement}function fB(e){let t={x:0,y:0},n=dB(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}function pB(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function mB(e,t){if(t===void 0&&(t=aB),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);lB(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var hB=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function gB(e){let{EventTarget:t}=Fz(e);return e instanceof t?e:zz(e)}function _B(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var vB;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(vB||={});function yB(e){e.preventDefault()}function bB(e){e.stopPropagation()}var xB;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(xB||={});var SB={start:[xB.Space,xB.Enter],cancel:[xB.Esc],end:[xB.Space,xB.Enter,xB.Tab]},CB=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case xB.Right:return{...n,x:n.x+25};case xB.Left:return{...n,x:n.x-25};case xB.Down:return{...n,y:n.y+25};case xB.Up:return{...n,y:n.y-25}}},wB=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new hB(zz(t)),this.windowListeners=new hB(Fz(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vB.Resize,this.handleCancel),this.windowListeners.add(vB.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vB.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&mB(n),t(tB)}handleKeyDown(e){if(Xz(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=SB,coordinateGetter:a=CB,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:tB;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Jz(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=fB(n),p=pB(n),m={x:Math.min(i===xB.Right?p.right-p.width/2:p.right,Math.max(i===xB.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===xB.Down?p.bottom-p.height/2:p.bottom,Math.max(i===xB.Down?p.top:p.top+p.height/2,u.y))},h=i===xB.Right&&!s||i===xB.Left&&!c,g=i===xB.Down&&!l||i===xB.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===xB.Right&&e<=d.x||i===xB.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===xB.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===xB.Down&&e<=d.y||i===xB.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===xB.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,qz(Jz(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};wB.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=SB,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function TB(e){return!!(e&&`distance`in e)}function EB(e){return!!(e&&`delay`in e)}var DB=class{constructor(e,t,n){n===void 0&&(n=gB(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=zz(i),this.documentListeners=new hB(this.document),this.listeners=new hB(n),this.windowListeners=new hB(Fz(i)),this.initialCoordinates=Qz(r)??tB,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(vB.Resize,this.handleCancel),this.windowListeners.add(vB.DragStart,yB),this.windowListeners.add(vB.VisibilityChange,this.handleCancel),this.windowListeners.add(vB.ContextMenu,yB),this.documentListeners.add(vB.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(EB(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(TB(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(vB.Click,bB,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vB.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Qz(e)??tB,s=Jz(n,o);if(!t&&a){if(TB(a)){if(a.tolerance!=null&&_B(s,a.tolerance))return this.handleCancel();if(_B(s,a.distance))return this.handleStart()}if(EB(a)&&_B(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===xB.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},OB={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},kB=class extends DB{constructor(e){let{event:t}=e,n=zz(t.target);super(e,OB,n)}};kB.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var AB={move:{name:`mousemove`},end:{name:`mouseup`}},jB;(function(e){e[e.RightClick=2]=`RightClick`})(jB||={});var MB=class extends DB{constructor(e){super(e,AB,zz(e.event.target))}};MB.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===jB.RightClick?!1:(r?.({event:n}),!0)}}];var NB={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},PB=class extends DB{constructor(e){super(e,NB)}static setup(){return window.addEventListener(NB.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(NB.move.name,e)};function e(){}}};PB.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var FB;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(FB||={});var IB;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(IB||={}),uB.Backward,uB.Forward,uB.Backward,uB.Forward;var LB;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(LB||={});var RB;(function(e){e.Optimized=`optimized`})(RB||={});function zB(e){let{callback:t,disabled:n}=e,r=Vz(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function BB(e,t){return(0,N.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}LB.WhileDragging,RB.Optimized;var VB={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:eB,draggableNodes:new Map,over:null,measureDroppableContainers:eB},HB=(0,N.createContext)(VB),UB=(0,N.createContext)({...tB,scaleX:1,scaleY:1}),WB;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(WB||={});var GB=(0,N.createContext)(null),KB=`button`,qB=`Draggable`;function JB(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Gz(qB),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,N.useContext)(HB),{role:p=KB,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,N.useContext)(g?UB:GB),[v,y]=Uz(),[b,x]=Uz(),S=BB(o,t),C=Hz(n);return Bz(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,N.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===KB?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}var YB=`Droppable`,XB={timeout:25};function ZB(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Gz(YB),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,N.useContext)(HB),u=(0,N.useRef)({disabled:n}),d=(0,N.useRef)(!1),f=(0,N.useRef)(null),p=(0,N.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...XB,...i},_=Hz(h??r),v=zB({callback:(0,N.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Uz((0,N.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Hz(t);return(0,N.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,N.useEffect)(()=>(s({type:$z.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:$z.UnregisterDroppable,key:a,id:r})),[r]),(0,N.useEffect)(()=>{n!==u.current.disabled&&(s({type:$z.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}var QB=e=>typeof e==`string`?e:typeof e==`number`?`${e}px`:`30px`,$B=({size:e,children:t})=>(e=QB(e),(0,F.jsx)(`div`,{style:{height:e,width:e,display:`inline-block`,position:`relative`},children:t}));$B.propTypes={size:p.number,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired};var eV=({size:e,children:t,sx:n})=>(0,F.jsx)($B,{size:e,children:(0,F.jsx)(`svg`,{preserveAspectRatio:`xMinYMin meet`,viewBox:`0 0 44 40`,style:{enableBackground:`new 0 0 44 40`,...n},children:t})});eV.propTypes={size:p.oneOfType([p.string,p.number]),children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,sx:p.object};var tV=({fill:e})=>(0,F.jsx)(`polygon`,{points:`17.4,26.9 10.1,20.6 12.8,17.5 16.3,20.5 22.3,9.7 25.9,11.7`,fill:e});tV.propTypes={fill:p.string.isRequired};var nV=({fill:e})=>(0,F.jsx)(`polygon`,{transform:`translate(2, 0)`,points:`34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3`,fill:e});nV.propTypes={fill:p.string.isRequired};var rV=({fill:e})=>(0,F.jsx)(`path`,{transform:`translate(1, 0)`,d:`M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z`,fill:e});rV.propTypes={fill:p.string.isRequired};var iV=({fill:e})=>(0,F.jsx)(`circle`,{transform:`translate(-3,0)`,cx:`23`,cy:`20.4`,r:`16`,fill:e});iV.propTypes={fill:p.string.isRequired};var aV=({fill:e})=>(0,F.jsx)(`rect`,{x:`3.6`,y:`4.1`,width:`32`,height:`32`,fill:e});aV.propTypes={fill:p.string.isRequired};var oV=(e,t)=>{class n extends N.Component{static propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,size:p.oneOfType([p.number,p.string]),fg:p.string,bg:p.string};static defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,size:30,fg:`#4aaf46`,bg:`#f8ffe2`};render(){let{iconSet:n,shape:r,category:i,open:a,size:o,fg:s,bg:c}=this.props,l=n===`check`?(0,F.jsx)(e,{fill:s}):(0,F.jsx)(t,{fill:s}),u=n===`check`?(0,F.jsx)(e,{fill:c}):(0,F.jsx)(t,{fill:c});return a?(0,F.jsx)(eV,{size:o,children:u}):(0,F.jsxs)(eV,{size:o,children:[i===`feedback`?r===`round`?(0,F.jsx)(rV,{fill:c}):(0,F.jsx)(nV,{fill:c}):r===`round`?(0,F.jsx)(iV,{fill:c}):(0,F.jsx)(aV,{fill:c}),l]})}}return n},sV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(1, 0)`,children:[(0,F.jsx)(`path`,{d:`M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2
315
- c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z`,fill:e}),(0,F.jsx)(`rect`,{x:`21.1`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.7`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e})]});sV.propTypes={fill:p.string.isRequired};var cV=({fill:e,x:t=0,y:n=0})=>(0,F.jsx)(`polygon`,{transform:`translate(${t}, ${n})`,points:`19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4`,fill:e});cV.propTypes={fill:p.string.isRequired,x:p.number,y:p.number};var lV=oV(cV,sV);lV.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},lV.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#f8ffe2`,size:30};var uV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(0.5, 0.5)`,children:[(0,F.jsx)(`rect`,{x:`11`,y:`17.3`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)`,width:`16.6`,height:`3.7`,fill:e}),(0,F.jsx)(`rect`,{x:`17.4`,y:`10.7`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)`,width:`3.7`,height:`16.6`,fill:e})]});uV.propTypes={fill:p.string.isRequired};var dV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(1,0)`,children:[(0,F.jsx)(`rect`,{x:`21`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.7`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.2`,y:`22.5`,width:`13`,height:`3.3`,fill:e})]});dV.propTypes={fill:p.string.isRequired};var fV=oV(uV,dV);fV.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},fV.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#fcb733`,bg:`#fbf2e3`,size:30};var pV=({fill:e})=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`rect`,{x:`19.3`,y:`10.3`,width:`4.5`,height:`12.7`,fill:e}),(0,F.jsx)(`rect`,{x:`19.3`,y:`26.2`,width:`4.5`,height:`4.5`,fill:e})]});pV.propTypes={fill:p.string.isRequired};var mV=({fill:e})=>(0,F.jsx)(`polygon`,{points:`14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5`,fill:e});mV.propTypes={fill:p.string.isRequired};var hV=({fill:e})=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`rect`,{x:`23.8`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,F.jsx)(`rect`,{x:`16`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,F.jsx)(`path`,{d:`M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0
316
- C25.7,26.4,25,27.1,24.2,27.1z`,fill:e})]});hV.propTypes={fill:p.string.isRequired};var gV=class extends N.Component{constructor(e){super(e);let{fg:t=`#464146`,bg:n=`white`}=this.props;this.icons={check:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(pV,{fill:t})]}),emoji:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(hV,{fill:t})]}),feedback:{check:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(hV,{fill:t})]}),emoji:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(hV,{fill:t})]}),square:{check:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(pV,{fill:t})]}),emoji:(0,F.jsxs)(eV,{children:[(0,F.jsx)(mV,{fill:n}),(0,F.jsx)(hV,{fill:t})]}),open:{check:(0,F.jsx)(eV,{children:(0,F.jsx)(pV,{fill:n})}),emoji:(0,F.jsx)(eV,{children:(0,F.jsx)(hV,{fill:n})})}}}}}render(){let{iconSet:e,category:t,shape:n,open:r}=this.props;return t===void 0?this.icons[e]:n===void 0?this.icons.feedback[e]:r===!0?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}};gV.propTypes={iconSet:p.oneOf([`emoji`,`check`,void 0]),shape:p.oneOf([`square`,void 0]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string},gV.defaultProps={iconSet:`check`,shape:void 0,category:void 0,open:!1,fg:`#464146`,bg:`white`};var _V=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(0, 0)`,children:[(0,F.jsx)(`polygon`,{points:`27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6`,fill:e}),(0,F.jsx)(`polygon`,{points:`16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3`,fill:e})]});_V.propTypes={fill:p.string.isRequired};var vV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(2, 0)`,children:[(0,F.jsx)(`rect`,{x:`20.6`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,F.jsx)(`rect`,{x:`11.5`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,F.jsx)(`rect`,{x:`10.9`,y:`22.9`,transform:`matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)`,width:`14.3`,height:`3.7`,fill:e})]});vV.propTypes={fill:p.string.isRequired};var yV=oV(_V,vV);yV.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},yV.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#c1e1ac`,size:30};function bV(e){return typeof e==`string`}function xV(e){return e?.ref||null}var SV=e=>e.scrollTop;function CV(e,t){return n=>{if(t){let r=e.current;n===void 0?t(r):t(r,n)}}}function wV(e,t,n,r,i,a){let o=e===`exited`&&!t?r:n[e]||n.exited;return i||a?{...o,...i,...a}:o}function TV(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n==`number`?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r==`object`?r[t.mode]:r),delay:i.transitionDelay}}function EV(e){return`scale(${e}, ${e**2})`}var DV={entering:{opacity:1,transform:EV(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:EV(.75)},exited:{opacity:0,transform:EV(.75)}},OV={opacity:0,transform:EV(.75),visibility:`hidden`},kV=N.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:a,in:o,onEnter:s,onEntered:c,onEntering:l,onExit:u,onExited:d,onExiting:f,style:p,timeout:m=`auto`,...h}=e,g=zR(),_=N.useRef(),v=Mo(),y=N.useRef(null),b=QL(y,xV(i),t),x=CV(y,l),S=CV(y,(e,t)=>{SV(e);let{duration:n,delay:r,easing:i}=TV({style:p,timeout:m,easing:a},{mode:`enter`}),o;m===`auto`?(o=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=o):o=n,e.style.transition=[v.transitions.create(`opacity`,{duration:o,delay:r}),v.transitions.create(`transform`,{duration:o*.666,delay:r,easing:i})].join(`,`),s&&s(e,t)}),C=CV(y,c),w=CV(y,f),T=CV(y,e=>{let{duration:t,delay:n,easing:r}=TV({style:p,timeout:m,easing:a},{mode:`exit`}),i;m===`auto`?(i=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=i):i=t,e.style.transition=[v.transitions.create(`opacity`,{duration:i,delay:n}),v.transitions.create(`transform`,{duration:i*.666,delay:n||i*.333,easing:r})].join(`,`),e.style.opacity=0,e.style.transform=EV(.75),u&&u(e)}),E=CV(y,e=>{e.style.transition=``,d&&d(e)});return(0,F.jsx)(SR,{appear:r,in:o,nodeRef:y,onEnter:S,onEntered:C,onEntering:x,onExit:T,onExited:E,onExiting:w,addEndListener:e=>{m===`auto`&&g.start(_.current||0,e),n&&n(y.current,e)},timeout:m===`auto`?null:m,...h,children:(e,{ownerState:t,...n})=>{let r=wV(e,o,DV,OV,p,i.props.style);return N.cloneElement(i,{style:r,ref:b,...n})}})});kV&&(kV.muiSupportAuto=!0);function AV(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function jV(e){let t=BL(e);return t.body===e?HL(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function MV(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function NV(e){return parseFloat(HL(e).getComputedStyle(e).paddingRight)||0}function PV(e){let t=[`TEMPLATE`,`SCRIPT`,`STYLE`,`LINK`,`MAP`,`META`,`NOSCRIPT`,`PICTURE`,`COL`,`COLGROUP`,`PARAM`,`SLOT`,`SOURCE`,`TRACK`].includes(e.tagName),n=e.tagName===`INPUT`&&e.getAttribute(`type`)===`hidden`;return t||n}function FV(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!PV(e);t&&n&&MV(e,i)})}function IV(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function LV(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(jV(r)){let e=AV(HL(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${NV(r)+e}px`;let t=BL(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${NV(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=BL(r).body;else{let t=r.parentElement,n=HL(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function RV(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var zV=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&MV(e.modalRef,!1);let r=RV(t);FV(t,e.mount,e.modalRef,r,!0);let i=IV(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=IV(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=LV(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=IV(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&MV(e.modalRef,t),FV(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&MV(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function BV(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}var VV=BV;function HV(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var UV=HV,WV=`data-mui-focusable`;function GV(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${WV}]`):null}var KV=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function qV(e){let t=parseInt(e.getAttribute(`tabindex`)||``,10);return Number.isNaN(t)?e.contentEditable===`true`||(e.nodeName===`AUDIO`||e.nodeName===`VIDEO`||e.nodeName===`DETAILS`)&&e.getAttribute(`tabindex`)===null?0:e.tabIndex:t}function JV(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function YV(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||JV(e))}function XV(e){let t=[],n=[];return Array.from(e.querySelectorAll(KV)).forEach((e,r)=>{let i=qV(e);i===-1||!YV(e)||(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function ZV(){return!0}function QV(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=XV,isEnabled:o=ZV,open:s}=e,c=N.useRef(!1),l=N.useRef(null),u=N.useRef(null),d=N.useRef(null),f=N.useRef(null),p=N.useRef(!1),m=N.useRef(null),h=ZL(xV(t),m),g=N.useRef(null);N.useEffect(()=>{!s||!m.current||(p.current=!n)},[n,s]),N.useEffect(()=>{if(c.current=!1,!s||!m.current)return;let e=UV(BL(m.current)),t=GV(m.current)??m.current;return VV(m.current,e)||(t.hasAttribute(`tabIndex`)||t.setAttribute(`tabIndex`,`-1`),p.current&&t.focus()),()=>{i||(d.current&&d.current.focus&&(c.current=!0,d.current.focus()),d.current=null)}},[s]),N.useEffect(()=>{if(!s||!m.current)return;let e=BL(m.current),t=t=>{g.current=t,!(r||!o()||t.key!==`Tab`)&&UV(e)===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=m.current;if(t===null)return;let n=UV(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(VV(t,n)||r&&n!==l.current&&n!==u.current)return;if(n!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let i=[];if((n===l.current||n===u.current)&&(i=a(m.current)),i.length>0){let e=!!(g.current?.shiftKey&&g.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=UV(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let _=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0,f.current=e.target;let n=t.props.onFocus;n&&n(e)},v=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0};return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:l,"data-testid":`sentinelStart`}),N.cloneElement(t,{ref:h,onFocus:_}),(0,F.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:u,"data-testid":`sentinelEnd`})]})}function $V(e){return typeof e==`function`?e():e}var eH=N.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=N.useState(null),s=ZL(N.isValidElement(n)?xV(n):null,t);if(fi(()=>{i||o($V(r)||document.body)},[r,i]),fi(()=>{if(a&&!i)return WL(t,a),()=>{WL(t,null)}},[t,a,i]),i){if(N.isValidElement(n)){let e={ref:s};return N.cloneElement(n,e)}return n}return a&&Rx.createPortal(n,a)});function tH(e,t,n){return e===void 0||bV(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function nH(e,t,n){return typeof e==`function`?e(t,n):e}function rH(e,t=[]){if(e===void 0)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]==`function`&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function iH(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function aH(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=k(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=rH({...i,...r}),s=iH(r),c=iH(i),l=t(o),u=k(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function oH(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=nH(d[e],i),{props:{component:h,...g},internalRef:_}=aH({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=ZL(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,tH(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}var sH={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},cH={opacity:0,visibility:`hidden`},lH=N.forwardRef(function(e,t){let n=Mo(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:o,easing:s,in:c,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:p,onExiting:m,style:h,timeout:g=r,..._}=e,v=N.useRef(null),y=QL(v,xV(o),t),b=CV(v,d),x=CV(v,(e,t)=>{SV(e);let r=TV({style:h,timeout:g,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),S=CV(v,u),C=CV(v,m),w=CV(v,e=>{let t=TV({style:h,timeout:g,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),f&&f(e)}),T=CV(v,e=>{e.style.transition=``,p&&p(e)});return(0,F.jsx)(SR,{appear:a,in:c,nodeRef:v,onEnter:x,onEntered:S,onEntering:b,onExit:w,onExited:T,onExiting:C,addEndListener:e=>{i&&i(v.current,e)},timeout:g,..._,children:(e,{ownerState:t,...n})=>{let r=wV(e,c,sH,cH,h,o.props.style);return N.cloneElement(o,{style:r,ref:y,...n})}})});function uH(e){return Zr(`MuiBackdrop`,e)}Qr(`MuiBackdrop`,[`root`,`invisible`]);var dH=e=>{let{classes:t,invisible:n}=e;return A({root:[`root`,n&&`invisible`]},uH,t)},fH=L(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:`fixed`,display:`flex`,alignItems:`center`,justifyContent:`center`,right:0,bottom:0,top:0,left:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,WebkitTapHighlightColor:`transparent`,variants:[{props:{invisible:!0},style:{backgroundColor:`transparent`}}]}),pH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiBackdrop`}),{children:r,className:i,component:a=`div`,invisible:o=!1,open:s,components:c={},componentsProps:l={},slotProps:u={},slots:d={},TransitionComponent:f,transitionDuration:p,...m}=n,h={...n,component:a,invisible:o},g=dH(h),_={component:a,slots:{transition:f,root:c.Root,...d},slotProps:{...l,...u}},[v,y]=oH(`root`,{elementType:fH,externalForwardedProps:_,className:k(g.root,i),ownerState:h}),[b,x]=oH(`transition`,{elementType:lH,externalForwardedProps:_,ownerState:h});return(0,F.jsx)(b,{in:s,timeout:p,...m,...x,children:(0,F.jsx)(v,{"aria-hidden":!0,...y,ref:t,children:r})})});function mH(e){return typeof e==`function`?e():e}function hH(e){return e?e.props.hasOwnProperty(`in`):!1}var gH=()=>{},_H=new zV;function vH(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:o,children:s,onClose:c,open:l,rootRef:u}=e,d=N.useRef({}),f=N.useRef(null),p=N.useRef(null),m=ZL(p,u),[h,g]=N.useState(!l),_=hH(s),v=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(v=!1);let y=()=>BL(f.current),b=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),x=()=>{_H.mount(b(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},S=YL(()=>{let e=mH(t)||y().body;_H.add(b(),e),p.current&&x()}),C=()=>_H.isTopModal(b()),w=YL(e=>{f.current=e,e&&(l&&C()?x():p.current&&MV(p.current,v))}),T=N.useCallback(()=>{_H.remove(b(),v)},[v]);N.useEffect(()=>()=>{T()},[T]),N.useEffect(()=>{l?S():(!_||!i)&&T()},[l,T,_,i,S]);let E=e=>t=>{e.onKeyDown?.(t),!(t.key!==`Escape`||t.which===229||!C())&&(n||(t.stopPropagation(),c&&c(t,`escapeKeyDown`)))},D=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=rH(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:E(r),ref:m}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:D(t),open:l}},getTransitionProps:()=>({onEnter:jL(()=>{g(!1),a&&a()},s?.props.onEnter??gH),onExited:jL(()=>{g(!0),o&&o(),i&&T()},s?.props.onExited??gH)}),rootRef:m,portalRef:w,isTopModal:C,exited:h,hasTransition:_}}function yH(e){return Zr(`MuiModal`,e)}Qr(`MuiModal`,[`root`,`hidden`,`backdrop`]);var bH=e=>{let{open:t,exited:n,classes:r}=e;return A({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},yH,r)},xH=L(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Ro(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),SH=L(pH,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),CH=N.forwardRef(function(e,t){let n=zo({name:`MuiModal`,props:e}),{BackdropComponent:r=SH,BackdropProps:i,classes:a,className:o,closeAfterTransition:s=!1,children:c,container:l,component:u,components:d={},componentsProps:f={},disableAutoFocus:p=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:h=!1,disablePortal:g=!1,disableRestoreFocus:_=!1,disableScrollLock:v=!1,hideBackdrop:y=!1,keepMounted:b=!1,onClose:x,onTransitionEnter:S,onTransitionExited:C,open:w,slotProps:T={},slots:E={},theme:D,...O}=n,A={...n,closeAfterTransition:s,disableAutoFocus:p,disableEnforceFocus:m,disableEscapeKeyDown:h,disablePortal:g,disableRestoreFocus:_,disableScrollLock:v,hideBackdrop:y,keepMounted:b},{getRootProps:j,getBackdropProps:M,getTransitionProps:ee,portalRef:te,isTopModal:ne,exited:re,hasTransition:ie}=vH({...A,rootRef:t}),P={...A,exited:re},ae=bH(P),oe={};if(c.props.tabIndex===void 0&&(oe.tabIndex=`-1`),ie){let{onEnter:e,onExited:t}=ee();oe.onEnter=e,oe.onExited=t}let se={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...T}},[ce,le]=oH(`root`,{ref:t,elementType:xH,externalForwardedProps:{...se,...O,component:u},getSlotProps:j,ownerState:P,className:k(o,ae?.root,!P.open&&P.exited&&ae?.hidden)}),[ue,de]=oH(`backdrop`,{ref:i?.ref,elementType:r,externalForwardedProps:se,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>M({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:k(i?.className,ae?.backdrop),ownerState:P});return!b&&!w&&(!ie||re)?null:(0,F.jsx)(eH,{ref:te,container:l,disablePortal:g,children:(0,F.jsxs)(ce,{...le,children:[!y&&r?(0,F.jsx)(ue,{...de}):null,(0,F.jsx)(QV,{disableEnforceFocus:m,disableAutoFocus:p,disableRestoreFocus:_,isEnabled:ne,open:w,children:N.cloneElement(c,oe)})]})})});function wH(e){return Zr(`MuiPaper`,e)}Qr(`MuiPaper`,`root.rounded.outlined.elevation.elevation0.elevation1.elevation2.elevation3.elevation4.elevation5.elevation6.elevation7.elevation8.elevation9.elevation10.elevation11.elevation12.elevation13.elevation14.elevation15.elevation16.elevation17.elevation18.elevation19.elevation20.elevation21.elevation22.elevation23.elevation24`.split(`.`));var TH=e=>{let{square:t,elevation:n,variant:r,classes:i}=e;return A({root:[`root`,r,!t&&`rounded`,r===`elevation`&&`elevation${n}`]},wH,i)},EH=L(`div`,{name:`MuiPaper`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant===`elevation`&&t[`elevation${n.elevation}`]]}})(Ro(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create(`box-shadow`),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:`outlined`},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:`elevation`},style:{boxShadow:`var(--Paper-shadow)`,backgroundImage:`var(--Paper-overlay)`}}]}))),DH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiPaper`}),r=Mo(),{className:i,component:a=`div`,elevation:o=1,square:s=!1,variant:c=`elevation`,...l}=n,u={...n,component:a,elevation:o,square:s,variant:c},d=TH(u);return(0,F.jsx)(EH,{as:a,ownerState:u,className:k(d.root,i),ref:t,...l,style:{...c===`elevation`&&{"--Paper-shadow":(r.vars||r).shadows[o],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[o]},...!r.vars&&r.palette.mode===`dark`&&{"--Paper-overlay":`linear-gradient(${Ci(`#fff`,fo(o))}, ${Ci(`#fff`,fo(o))})`}},...l.style}})});function OH(e){return Zr(`MuiPopover`,e)}Qr(`MuiPopover`,[`root`,`paper`]);function kH(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.height/2:t===`bottom`&&(n=e.height),n}function AH(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.width/2:t===`right`&&(n=e.width),n}function jH(e){return[e.horizontal,e.vertical].map(e=>typeof e==`number`?`${e}px`:e).join(` `)}function MH(e){return typeof e==`function`?e():e}var NH=e=>{let{classes:t}=e;return A({root:[`root`],paper:[`paper`]},OH,t)},PH=L(CH,{name:`MuiPopover`,slot:`Root`})({}),FH=L(DH,{name:`MuiPopover`,slot:`Paper`})({position:`absolute`,overflowY:`auto`,overflowX:`hidden`,minWidth:16,minHeight:16,maxWidth:`calc(100% - 32px)`,maxHeight:`calc(100% - 32px)`,outline:0}),IH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiPopover`}),{action:r,anchorEl:i,anchorOrigin:a={vertical:`top`,horizontal:`left`},anchorPosition:o,anchorReference:s=`anchorEl`,children:c,className:l,container:u,elevation:d=8,marginThreshold:f=16,open:p,PaperProps:m={},slots:h={},slotProps:g={},transformOrigin:_={vertical:`top`,horizontal:`left`},TransitionComponent:v,transitionDuration:y=`auto`,TransitionProps:b={},disableScrollLock:x=!1,...S}=n,C=N.useRef(),w={...n,anchorOrigin:a,anchorReference:s,elevation:d,marginThreshold:f,transformOrigin:_,TransitionComponent:v,transitionDuration:y,TransitionProps:b},T=NH(w),E=N.useCallback(()=>{if(s===`anchorPosition`)return o;let e=MH(i),t=(e&&e.nodeType===1?e:VL(C.current).body).getBoundingClientRect();return{top:t.top+kH(t,a.vertical),left:t.left+AH(t,a.horizontal)}},[i,a.horizontal,a.vertical,o,s]),D=N.useCallback(e=>({vertical:kH(e,_.vertical),horizontal:AH(e,_.horizontal)}),[_.horizontal,_.vertical]),O=N.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=D(t);if(s===`none`)return{top:null,left:null,transformOrigin:jH(n)};let r=E(),a=r.top-n.vertical,o=r.left-n.horizontal,c=a+t.height,l=o+t.width,u=UL(MH(i)),d=u.innerHeight-f,p=u.innerWidth-f;if(f!==null&&a<f){let e=a-f;a-=e,n.vertical+=e}else if(f!==null&&c>d){let e=c-d;a-=e,n.vertical+=e}if(f!==null&&o<f){let e=o-f;o-=e,n.horizontal+=e}else if(l>p){let e=l-p;o-=e,n.horizontal+=e}return{top:`${Math.round(a)}px`,left:`${Math.round(o)}px`,transformOrigin:jH(n)}},[i,s,E,D,f]),[A,j]=N.useState(p),M=N.useCallback(()=>{let e=C.current;if(!e)return;let t=O(e);t.top!==null&&e.style.setProperty(`top`,t.top),t.left!==null&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,j(!0)},[O]);N.useEffect(()=>(x&&window.addEventListener(`scroll`,M),()=>window.removeEventListener(`scroll`,M)),[i,x,M]);let ee=()=>{M()},te=()=>{j(!1)};N.useEffect(()=>{p&&M()}),N.useImperativeHandle(r,()=>p?{updatePosition:()=>{M()}}:null,[p,M]),N.useEffect(()=>{if(!p)return;let e=RL(()=>{M()}),t=UL(MH(i));return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[i,p,M]);let ne=y,re={slots:{transition:v,...h},slotProps:{transition:b,paper:m,...g}},[ie,P]=oH(`transition`,{elementType:kV,externalForwardedProps:re,ownerState:w,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),ee()},onExited:t=>{e.onExited?.(t),te()}}),additionalProps:{appear:!0,in:p}});y===`auto`&&!ie.muiSupportAuto&&(ne=void 0);let ae=u||(i?VL(MH(i)).body:void 0),[oe,{slots:se,slotProps:ce,...le}]=oH(`root`,{ref:t,elementType:PH,externalForwardedProps:{...re,...S},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:h.backdrop},slotProps:{backdrop:eR(typeof g.backdrop==`function`?g.backdrop(w):g.backdrop,{invisible:!0})},container:ae,open:p},ownerState:w,className:k(T.root,l)}),[ue,de]=oH(`paper`,{ref:C,className:T.paper,elementType:FH,externalForwardedProps:re,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:A?void 0:{opacity:0}},ownerState:w});return(0,F.jsx)(oe,{...le,...!bV(oe)&&{slots:se,slotProps:ce,disableScrollLock:x},children:(0,F.jsx)(ie,{...P,timeout:ne,children:(0,F.jsx)(ue,{...de,children:c})})})}),LH={50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`,A100:`#ff80ab`,A200:`#ff4081`,A400:`#f50057`,A700:`#c51162`},RH={50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`,A100:`#8c9eff`,A200:`#536dfe`,A400:`#3d5afe`,A700:`#304ffe`},zH=s({background:()=>uU,backgroundDark:()=>dU,black:()=>CU,blueGrey100:()=>jU,blueGrey300:()=>MU,blueGrey600:()=>NU,blueGrey900:()=>PU,border:()=>gU,borderDark:()=>vU,borderGray:()=>yU,borderLight:()=>_U,buttonBorder:()=>VU,buttonFocusOutline:()=>AU,buttonHoverBg:()=>HU,correct:()=>KH,correctSecondary:()=>qH,correctTertiary:()=>JH,correctWithIcon:()=>YH,defaults:()=>BH,disabled:()=>WH,disabledSecondary:()=>GH,dropdownBackground:()=>pU,fadedPrimary:()=>aU,focusChecked:()=>EU,focusCheckedBorder:()=>DU,focusUnchecked:()=>OU,focusUncheckedBorder:()=>kU,incorrect:()=>XH,incorrectSecondary:()=>QH,incorrectWithIcon:()=>ZH,keyBoardFocusIndicator:()=>BU,keypadButton:()=>FU,keypadButtonHover:()=>RU,keypadButtonOperator:()=>IU,keypadButtonOperatorHover:()=>zU,keypadEmptyPlaceholder:()=>LU,missing:()=>$H,missingWithIcon:()=>eU,primary:()=>tU,primaryDark:()=>rU,primaryLight:()=>nU,primaryText:()=>iU,secondary:()=>oU,secondaryBackground:()=>fU,secondaryDark:()=>cU,secondaryLight:()=>sU,secondaryText:()=>lU,tableGrid:()=>bU,tableGridLight:()=>xU,tableStripe:()=>SU,tertiary:()=>mU,tertiaryLight:()=>hU,text:()=>UH,transparent:()=>TU,v:()=>VH,visualElementsColors:()=>UU,white:()=>wU}),BH={TEXT:`black`,DISABLED:`grey`,DISABLED_SECONDARY:`#ABABAB`,CORRECT:Da[500],CORRECT_SECONDARY:Da[50],CORRECT_TERTIARY:`#0EA449`,CORRECT_WITH_ICON:`#087D38`,INCORRECT:wa[500],INCORRECT_SECONDARY:Ca[50],INCORRECT_WITH_ICON:`#BF0D00`,MISSING:Ca[700],MISSING_WITH_ICON:`#6A78A1`,PRIMARY:RH[500],PRIMARY_LIGHT:RH[200],PRIMARY_DARK:RH[800],SECONDARY:LH.A400,SECONDARY_LIGHT:LH[200],SECONDARY_DARK:LH[900],TERTIARY:`#146EB3`,TERTIARY_LIGHT:`#D0E2F0`,BACKGROUND:`rgba(255,255,255,0)`,BACKGROUND_DARK:`#ECEDF1`,DROPDOWN_BACKGROUND:`#E0E1E6`,SECONDARY_BACKGROUND:`rgba(241,241,241,1)`,BORDER:`#9A9A9A`,BORDER_LIGHT:`#D1D1D1`,BORDER_DARK:`#646464`,BORDER_GRAY:`#7E8494`,TABLE_GRID:`black`,TABLE_GRID_LIGHT:`#dfe2e5`,TABLE_STRIPE:`#f6f8fa`,BLACK:`#000000`,WHITE:`#ffffff`,TRANSPARENT:`transparent`,FOCUS_CHECKED:`#BBDEFB`,FOCUS_CHECKED_BORDER:`#1565C0`,FOCUS_UNCHECKED:`#E0E0E0`,FOCUS_UNCHECKED_BORDER:`#757575`,BUTTON_FOCUS_OUTLINE:`#3B82F6`,BLUE_GREY100:`#F3F5F7`,BLUE_GREY300:`#C0C3CF`,BLUE_GREY600:`#7E8494`,BLUE_GREY900:`#152452`,FADED_PRIMARY:`#DCDAFB`,KEYPAD_BUTTON:`rgb(188, 194, 229)`,KEYPAD_BUTTON_OPERATOR:`rgb(255, 159, 192)`,KEYPAD_EMPTY_PLACEHOLDER:`rgba(245, 0, 87, 0.4)`,KEYPAD_BUTTON_HOVER:`rgb(214, 218, 239)`,KEYPAD_BUTTON_OPERATOR_HOVER:`rgb(255, 197, 217)`,KEY_BOARD_FOCUS_INDICATOR:`#2B87FF`,BUTTON_BORDER:`rgba(0, 0, 0, 0.23)`,BUTTON_HOVER_BG:`rgba(0, 0, 0, 0.08)`};Object.freeze(BH);var VH=e=>(...t)=>{let n=t.pop();return t.reduceRight((t,n)=>`var(--${e}-${n}, ${t})`,n)},HH=VH(`pie`),UH=()=>HH(`text`,BH.TEXT),WH=()=>HH(`disabled`,BH.DISABLED),GH=()=>HH(`disabled-secondary`,BH.DISABLED_SECONDARY),KH=()=>HH(`correct`,BH.CORRECT),qH=()=>HH(`correct-secondary`,BH.CORRECT_SECONDARY),JH=()=>HH(`correct-tertiary`,BH.CORRECT_TERTIARY),YH=()=>HH(`correct-icon`,BH.CORRECT_WITH_ICON),XH=()=>HH(`incorrect`,BH.INCORRECT),ZH=()=>HH(`incorrect-icon`,BH.INCORRECT_WITH_ICON),QH=()=>HH(`incorrect-secondary`,BH.INCORRECT_SECONDARY),$H=()=>HH(`missing`,BH.MISSING),eU=()=>HH(`missing-icon`,BH.MISSING_WITH_ICON),tU=()=>HH(`primary`,BH.PRIMARY),nU=()=>HH(`primary-light`,BH.PRIMARY_LIGHT),rU=()=>HH(`primary-dark`,BH.PRIMARY_DARK),iU=()=>HH(`primary-text`,`text`,BH.TEXT),aU=()=>HH(`faded-primary`,BH.FADED_PRIMARY),oU=()=>HH(`secondary`,BH.SECONDARY),sU=()=>HH(`secondary-light`,BH.SECONDARY_LIGHT),cU=()=>HH(`secondary-dark`,BH.SECONDARY_DARK),lU=()=>HH(`secondary-text`,`text`,BH.TEXT),uU=()=>HH(`background`,BH.BACKGROUND),dU=()=>HH(`background-dark`,BH.BACKGROUND_DARK),fU=()=>HH(`secondary-background`,BH.SECONDARY_BACKGROUND),pU=()=>HH(`dropdown-background`,BH.DROPDOWN_BACKGROUND),mU=()=>HH(`tertiary`,BH.TERTIARY),hU=()=>HH(`tertiary-light`,BH.TERTIARY_LIGHT),gU=()=>HH(`border`,BH.BORDER),_U=()=>HH(`border-light`,BH.BORDER_LIGHT),vU=()=>HH(`border-dark`,BH.BORDER_DARK),yU=()=>HH(`border-gray`,BH.BORDER_GRAY),bU=()=>HH(`table-grid`,`text`,BH.TABLE_GRID),xU=()=>HH(`table-grid-light`,`border-light`,BH.TABLE_GRID_LIGHT),SU=()=>HH(`table-stripe`,`background-dark`,BH.TABLE_STRIPE),CU=()=>HH(`black`,BH.BLACK),wU=()=>HH(`white`,BH.WHITE),TU=()=>BH.TRANSPARENT,EU=()=>HH(`focus-checked`,BH.FOCUS_CHECKED),DU=()=>HH(`focus-checked-border`,BH.FOCUS_CHECKED_BORDER),OU=()=>HH(`focus-unchecked`,BH.FOCUS_UNCHECKED),kU=()=>HH(`focus-unchecked-border`,BH.FOCUS_UNCHECKED_BORDER),AU=()=>HH(`button-focus-outline`,BH.BUTTON_FOCUS_OUTLINE),jU=()=>HH(`blue-grey-100`,BH.BLUE_GREY100),MU=()=>HH(`blue-grey-300`,BH.BLUE_GREY300),NU=()=>HH(`blue-grey-600`,BH.BLUE_GREY600),PU=()=>HH(`blue-grey-900`,BH.BLUE_GREY900),FU=()=>HH(`keypad-button`,BH.KEYPAD_BUTTON),IU=()=>HH(`keypad-button-operator`,BH.KEYPAD_BUTTON_OPERATOR),LU=()=>HH(`keypad-empty-placeholder`,BH.KEYPAD_EMPTY_PLACEHOLDER),RU=()=>HH(`keypad-button-hover`,BH.KEYPAD_BUTTON_HOVER),zU=()=>HH(`keypad-button-operator-hover`,BH.KEYPAD_BUTTON_OPERATOR_HOVER),BU=()=>HH(`keyboard-focus-indicator`,BH.KEY_BOARD_FOCUS_INDICATOR),VU=()=>HH(`button-border`,BH.BUTTON_BORDER),HU=()=>HH(`button-hover-bg`,BH.BUTTON_HOVER_BG),UU={AXIS_LINE_COLOR:`#5A53C9`,ROLLOVER_FILL_BAR_COLOR:`#050F2D`,GRIDLINES_COLOR:`#8E88EA`,PLOT_FILL_COLOR:`#1463B3`,SHAPES_FILL_COLOR:`#7986cb`},WU=L(`div`)({transformOrigin:`0% 0px 0px`,width:`100%`,display:`block`,overflow:`hidden`,"&.incorrect":{color:`#946202`}}),GU=L(`div`)({WebkitFontSmoothing:`antialiased`,backgroundColor:`var(--feedback-bg-color, ${WH()})`,borderRadius:`4px`,lineHeight:`25px`,margin:`0px`,padding:`10px`,verticalAlign:`middle`,color:`var(--feedback-color, white)`,"&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${KH()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${XH()})`}}),KU=L(`div`)({"&.feedback-enter":{height:`1px`},"&.feedback-enter-active":{height:`45px`,transition:`height 500ms`},"&.feedback-exit":{height:`45px`},"&.feedback-exit-active":{height:`1px`,transition:`height 200ms`}}),qU=class extends N.Component{static propTypes={correctness:p.string,feedback:p.string};nodeRef=N.createRef();renderFeedback(){let{correctness:e,feedback:t}=this.props;return!e||!t?null:(0,F.jsx)(ER,{nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:`feedback`,children:(0,F.jsx)(KU,{ref:this.nodeRef,children:(0,F.jsx)(WU,{children:(0,F.jsx)(GU,{className:e,dangerouslySetInnerHTML:{__html:t}})})})},`hasFeedback`)}render(){return(0,F.jsx)(`div`,{children:(0,F.jsx)(FR,{children:this.renderFeedback()})})}},JU=s({Correct:()=>eW,Incorrect:()=>tW,NothingSubmitted:()=>rW,PartiallyCorrect:()=>nW}),YU=D(`pie-libs:render-ui:response-indicators`),XU=L(`div`)(({hasFeedback:e})=>({cursor:e?`pointer`:`default`})),ZU=L(IH)({cursor:`pointer`}),QU=L(`div`)({padding:`0`,borderRadius:`4px`}),$U=(e,t)=>{class n extends N.Component{constructor(e){super(e),this.state={}}handlePopoverOpen=e=>{YU(`[handlePopoverOpen]`,e.target),this.setState({anchorEl:e.target})};handlePopoverClose=()=>{this.setState({anchorEl:null})};render(){let{feedback:n}=this.props,{anchorEl:r}=this.state;return(0,F.jsxs)(XU,{hasFeedback:!!n,children:[(0,F.jsx)(`span`,{ref:e=>this.icon=e,onClick:this.handlePopoverOpen,children:(0,F.jsx)(e,{})}),n&&(0,F.jsx)(ZU,{PaperComponent:QU,open:!!r,anchorEl:r,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:this.handlePopoverClose,children:(0,F.jsx)(qU,{feedback:n,correctness:t})})]})}}return n.propTypes={feedback:p.string},n},eW=$U(lV,`correct`),tW=$U(fV,`incorrect`),nW=$U(yV,`partially-correct`),rW=$U(gV,`nothing-submitted`);function iW(e){return Zr(`MuiCollapse`,e)}Qr(`MuiCollapse`,[`root`,`horizontal`,`vertical`,`entered`,`hidden`,`wrapper`,`wrapperInner`]);var aW=e=>{let{orientation:t,classes:n}=e;return A({root:[`root`,t],entered:[`entered`],hidden:[`hidden`],wrapper:[`wrapper`,t],wrapperInner:[`wrapperInner`,t]},iW,n)},oW=L(`div`,{name:`MuiCollapse`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.orientation],n.state===`entered`&&t.entered,n.state===`exited`&&!n.in&&n.collapsedSize===`0px`&&t.hidden]}})(Ro(({theme:e})=>({height:0,overflow:`hidden`,transition:e.transitions.create(`height`),variants:[{props:{orientation:`horizontal`},style:{height:`auto`,width:0,transition:e.transitions.create(`width`)}},{props:{state:`entered`},style:{height:`auto`,overflow:`visible`}},{props:{state:`entered`,orientation:`horizontal`},style:{width:`auto`}},{props:({ownerState:e})=>e.state===`exited`&&!e.in&&e.collapsedSize===`0px`,style:{visibility:`hidden`}}]}))),sW=L(`div`,{name:`MuiCollapse`,slot:`Wrapper`})({display:`flex`,width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),cW=L(`div`,{name:`MuiCollapse`,slot:`WrapperInner`})({width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),lW=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiCollapse`}),{addEndListener:r,children:i,className:a,collapsedSize:o=`0px`,component:s,easing:c,in:l,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:m,onExiting:h,orientation:g=`vertical`,slots:_={},slotProps:v={},style:y,timeout:b=eo.standard,TransitionComponent:x=SR,...S}=n,C={...n,orientation:g,collapsedSize:o},w=aW(C),T=Mo(),E=zR(),D=N.useRef(null),O=N.useRef(),A=typeof o==`number`?`${o}px`:o,j=g===`horizontal`,M=j?`width`:`height`,ee=N.useRef(null),te=QL(t,ee),ne=()=>D.current?D.current[j?`clientWidth`:`clientHeight`]:0,re=CV(ee,(e,t)=>{D.current&&j&&(D.current.style.position=`absolute`),e.style[M]=A,u&&u(e,t)}),ie=CV(ee,(e,t)=>{let n=ne();D.current&&j&&(D.current.style.position=``);let{duration:r,easing:i}=TV({style:y,timeout:b,easing:c},{mode:`enter`});if(b===`auto`){let t=T.transitions.getAutoHeightDuration(n);e.style.transitionDuration=`${t}ms`,O.current=t}else e.style.transitionDuration=typeof r==`string`?r:`${r}ms`;e.style[M]=`${n}px`,e.style.transitionTimingFunction=i,f&&f(e,t)}),P=CV(ee,(e,t)=>{e.style[M]=`auto`,d&&d(e,t)}),ae=CV(ee,e=>{e.style[M]=`${ne()}px`,p&&p(e)}),oe=CV(ee,m),se=CV(ee,e=>{let t=ne(),{duration:n,easing:r}=TV({style:y,timeout:b,easing:c},{mode:`exit`});if(b===`auto`){let n=T.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${n}ms`,O.current=n}else e.style.transitionDuration=typeof n==`string`?n:`${n}ms`;e.style[M]=A,e.style.transitionTimingFunction=r,h&&h(e)}),ce=e=>{b===`auto`&&E.start(O.current||0,e),r&&r(ee.current,e)},le={slots:_,slotProps:v,component:s},[ue,de]=oH(`root`,{ref:te,className:k(w.root,a),elementType:oW,externalForwardedProps:le,ownerState:C,additionalProps:{style:{[j?`minWidth`:`minHeight`]:A,...y}}}),[fe,pe]=oH(`wrapper`,{ref:D,className:w.wrapper,elementType:sW,externalForwardedProps:le,ownerState:C}),[me,he]=oH(`wrapperInner`,{className:w.wrapperInner,elementType:cW,externalForwardedProps:le,ownerState:C});return(0,F.jsx)(x,{in:l,onEnter:re,onEntered:P,onEntering:ie,onExit:ae,onExited:oe,onExiting:se,addEndListener:ce,nodeRef:ee,timeout:b===`auto`?null:b,...S,children:(e,{ownerState:t,...n})=>{let r={...C,state:e};return(0,F.jsx)(ue,{...de,className:k(de.className,{entered:w.entered,exited:!l&&A===`0px`&&w.hidden}[e]),ownerState:r,...n,children:(0,F.jsx)(fe,{...pe,ownerState:r,children:(0,F.jsx)(me,{...he,ownerState:r,children:i})})})}})});lW&&(lW.muiSupportAuto=!0);var uW=`https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js`,dW=null;function fW(e){return typeof window>`u`||window.MathJax?.typesetPromise?Promise.resolve():dW||(dW=new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s={loader:{load:i?[`a11y/assistive-mml`]:[]},tex:{packages:[`base`,`ams`,`autoload`],macros:{parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`}},options:{enableMenu:i,enableExplorer:i,enableAssistiveMml:i},startup:{ready:()=>{window.MathJax?.startup.defaultReady&&(window.MathJax.startup.defaultReady(),t())},defaultReady:()=>{}}};r&&s.tex&&(s.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],s.tex.processEscapes=!0),a||(s.chtml={fontURL:``}),window.MathJax=s;let c=document.createElement(`script`);c.src=o||uW,c.async=!0,c.onload=()=>{setTimeout(t,100)},c.onerror=()=>{n(Error(`Failed to load MathJax`))},document.head.appendChild(c)}),dW)}function pW(){let e=window.MathJax?.startup?.document;if(typeof e?.assistiveMml==`function`)try{e.assistiveMml().updateDocument?.()}catch(e){console.warn(`[mathjax-renderer] Failed to attach assistive MathML:`,e)}}function mW(e={}){return async t=>{if(await fW(e),!window.MathJax?.typesetPromise){console.warn(`[mathjax-renderer] MathJax not loaded or missing typesetPromise.`);return}await window.MathJax.typesetPromise([t]),pW()}}var hW=`@pie-lib/math-rendering`,gW=null;function _W(){return gW||=mW({accessibility:!0,useSingleDollar:!0}),gW}function vW(){if(typeof window>`u`)return null;let e=window[hW];return typeof e?.renderMath==`function`?e:null}var yW=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=vW();return r?await r.renderMath?.(n):await _W()(n),t?n.innerHTML:void 0},bW=e=>vW()?.wrapMath?.(e)??e,xW=L(`span`)(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:`pointer`})),SW=L(lW)(({theme:e})=>({paddingTop:e.spacing(2)})),CW=class extends N.Component{static propTypes={className:p.string,children:p.object,labels:p.shape({visible:p.string,hidden:p.string})};static defaultProps={labels:{}};state={expanded:!1};toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};componentDidMount(){yW(this.root)}componentDidUpdate(){yW(this.root)}render(){let{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||`Hide`:e.hidden||`Show`;return(0,F.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,F.jsx)(`div`,{onClick:this.toggleExpanded,children:(0,F.jsx)(xW,{children:r})}),(0,F.jsx)(SW,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})]})}};function wW(e){return Zr(`MuiButton`,e)}var TW=Qr(`MuiButton`,`root.text.textInherit.textPrimary.textSecondary.textSuccess.textError.textInfo.textWarning.outlined.outlinedInherit.outlinedPrimary.outlinedSecondary.outlinedSuccess.outlinedError.outlinedInfo.outlinedWarning.contained.containedInherit.containedPrimary.containedSecondary.containedSuccess.containedError.containedInfo.containedWarning.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.textSizeSmall.textSizeMedium.textSizeLarge.outlinedSizeSmall.outlinedSizeMedium.outlinedSizeLarge.containedSizeSmall.containedSizeMedium.containedSizeLarge.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.iconSizeSmall.iconSizeMedium.iconSizeLarge.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),EW=N.createContext({}),DW=N.createContext(void 0),OW=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=A({root:[`root`,o&&`loading`,a,`${a}${R(t)}`,`size${R(i)}`,`${a}Size${R(i)}`,`color${R(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${R(s)}`],startIcon:[`icon`,`startIcon`,`iconSize${R(i)}`],endIcon:[`icon`,`endIcon`,`iconSize${R(i)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},wW,c);return{...c,...l}},kW=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],AW=L($R,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${R(n.color)}`],t[`size${R(n.size)}`],t[`${n.variant}Size${R(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${TW.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${TW.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${TW.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${TW.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${TW.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${TW.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${TW.loading}`]:{color:`transparent`}}}]}})),jW=L(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${R(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...kW]})),MW=L(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${R(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...kW]})),NW=L(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),PW=L(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),FW=N.forwardRef(function(e,t){let n=N.useContext(EW),r=N.useContext(DW),i=zo({props:di(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:p,fullWidth:m=!1,id:h,loading:g=null,loadingIndicator:_,loadingPosition:v=`center`,size:y=`medium`,startIcon:b,type:x,variant:S=`text`,...C}=i,w=KL(h),T=_??(0,F.jsx)(fz,{"aria-labelledby":w,color:`inherit`,size:16}),E={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:m,loading:g,loadingIndicator:T,loadingPosition:v,size:y,type:x,variant:S},D=OW(E),O=(b||g&&v===`start`)&&(0,F.jsx)(jW,{className:D.startIcon,ownerState:E,children:b||(0,F.jsx)(PW,{className:D.loadingIconPlaceholder,ownerState:E})}),A=(f||g&&v===`end`)&&(0,F.jsx)(MW,{className:D.endIcon,ownerState:E,children:f||(0,F.jsx)(PW,{className:D.loadingIconPlaceholder,ownerState:E})}),j=r||``,M=typeof g==`boolean`?(0,F.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:g&&(0,F.jsx)(NW,{className:D.loadingIndicator,ownerState:E,children:T})}):null,{root:ee,...te}=D;return(0,F.jsxs)(AW,{ownerState:E,className:k(n.className,D.root,c,j),component:s,disabled:l||g,focusRipple:!d,focusVisibleClassName:k(D.focusVisible,p),ref:t,type:x,id:g?w:h,...C,classes:te,children:[O,v!==`end`&&M,a,v===`end`&&M,A]})}),IW=IL((0,F.jsx)(`path`,{d:`M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z`}),`Restore`),LW=IL((0,F.jsx)(`path`,{d:`M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8`}),`Undo`),RW=L(`div`)({display:`flex`,flexDirection:`column`}),zW=L(`div`)({display:`flex`,alignItems:`center`,justifyContent:`center`}),BW=L(`div`)(({theme:e})=>({width:`24px`,height:`24px`,color:`gray`,marginRight:e.spacing(1),display:`flex`,alignItems:`center`})),VW=L(FW)(({theme:e})=>({display:`flex`,alignItems:`center`,marginLeft:e.spacing(3),marginRight:e.spacing(3)})),HW=e=>{class t extends N.Component{static propTypes={session:p.object,onSessionChange:p.func};constructor(e){super(e),this.state={sessionInitialValues:JSON.parse(JSON.stringify(e.session)),session:e.session,changes:[]}}onSessionChange=e=>{this.setState(t=>({session:e,changes:[...t.changes,e]}),()=>this.props.onSessionChange(e))};onUndo=()=>{this.setState(e=>{let t=[...e.changes];return t.pop(),{changes:t,session:t.length?t[t.length-1]:e.sessionInitialValues}},()=>this.props.onSessionChange(this.state.session))};onReset=()=>{this.setState(e=>({session:e.sessionInitialValues,changes:[]}),()=>this.props.onSessionChange(this.state.sessionInitialValues))};render(){let{...t}=this.props,{changes:n,session:r}=this.state;return(0,F.jsxs)(RW,{children:[(0,F.jsxs)(zW,{children:[(0,F.jsxs)(VW,{color:`primary`,disabled:n.length===0,onClick:this.onUndo,children:[(0,F.jsx)(BW,{children:(0,F.jsx)(LW,{})}),`Undo`]}),(0,F.jsxs)(VW,{color:`primary`,disabled:n.length===0,onClick:this.onReset,children:[(0,F.jsx)(BW,{children:(0,F.jsx)(IW,{})}),`Start Over`]})]}),(0,F.jsx)(e,{...t,session:r,onSessionChange:this.onSessionChange})]})}}return t},UW=ko({typography:{fontFamily:`inherit`},palette:{action:{disabled:`rgba(0, 0, 0, 0.54);`}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:`inherit`}}},MuiButton:{styleOverrides:{contained:{backgroundColor:`#e0e0e0`,color:`#000000`,"&:hover":{backgroundColor:`#bdbdbd`}}}}}}),WW=L(`div`)({"& table, th, td":{fontSize:`inherit`}}),GW=class extends N.Component{static propTypes={className:p.string,children:p.array,extraCSSRules:p.shape({names:p.arrayOf(p.string),rules:p.string}),fontSizeFactor:p.number};static defaultProps={extraCSSRules:{},fontSizeFactor:1};constructor(e){super(e),this.classesSheet=document.createElement(`style`)}computeStyle(e){let t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),i=Math.max(n,r),a=e!=null&&typeof e==`number`?e:1;return a===1?null:{fontSize:`${i*a}px`}}render(){let{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:i,...a}=r,o=this.computeStyle(n);return(0,F.jsx)(kr,{injectFirst:!0,children:(0,F.jsxs)(ns,{theme:UW,children:[i?.rules?(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,(0,F.jsx)(WW,{className:`${t} extraCSSRules`,...a,...o&&{style:o},children:e})]})})}},KW=L(GW)({display:`flex`,flexDirection:`column`,position:`relative`}),qW=class extends N.Component{static propTypes={ariaLabel:p.string,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,role:p.string,extraCSSRules:p.shape({names:p.arrayOf(p.string),rules:p.string}),fontSizeFactor:p.number};render(){let{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:a}=this.props;return(0,F.jsx)(KW,{...t?{"aria-label":t,role:n}:{},extraCSSRules:r,fontSizeFactor:i,classes:a,children:e})}},JW=class extends N.Component{static propTypes={tag:p.string,className:p.string,html:p.string};static defaultProps={tag:`div`,html:``};render(){let{tag:e,className:t,html:n}=this.props;return(0,F.jsx)(e||`div`,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}};function YW({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&e[r]===void 0&&(t[r]=n[r]),t),{})}var XW=N.createContext(void 0);function ZW(){return N.useContext(XW)}function QW(e){return Zr(`MuiFormLabel`,e)}var $W=Qr(`MuiFormLabel`,[`root`,`colorSecondary`,`focused`,`disabled`,`error`,`filled`,`required`,`asterisk`]),eG=e=>{let{classes:t,color:n,focused:r,disabled:i,error:a,filled:o,required:s}=e;return A({root:[`root`,`color${R(n)}`,i&&`disabled`,a&&`error`,o&&`filled`,r&&`focused`,s&&`required`],asterisk:[`asterisk`,a&&`error`]},QW,t)},tG=L(`label`,{name:`MuiFormLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color===`secondary`&&t.colorSecondary,n.filled&&t.filled]}})(Ro(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:`1.4375em`,padding:0,position:`relative`,variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{[`&.${$W.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${$W.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${$W.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),nG=L(`span`,{name:`MuiFormLabel`,slot:`Asterisk`})(Ro(({theme:e})=>({[`&.${$W.error}`]:{color:(e.vars||e).palette.error.main}}))),rG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormLabel`}),{children:r,className:i,color:a,component:o=`label`,disabled:s,error:c,filled:l,focused:u,required:d,...f}=n,p=YW({props:n,muiFormControl:ZW(),states:[`color`,`required`,`focused`,`disabled`,`error`,`filled`]}),m={...n,color:p.color||`primary`,component:o,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required},h=eG(m);return(0,F.jsxs)(tG,{as:o,ownerState:m,className:k(h.root,i),ref:t,...f,children:[r,p.required&&(0,F.jsxs)(nG,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[` `,`*`]})]})});function iG(e){return Zr(`MuiInputLabel`,e)}Qr(`MuiInputLabel`,[`root`,`focused`,`disabled`,`error`,`required`,`asterisk`,`formControl`,`sizeSmall`,`shrink`,`animated`,`standard`,`filled`,`outlined`]);var aG=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:a,variant:o,required:s}=e,c=A({root:[`root`,n&&`formControl`,!a&&`animated`,i&&`shrink`,r&&r!==`medium`&&`size${R(r)}`,o],asterisk:[s&&`asterisk`]},iG,t);return{...t,...c}},oG=L(rG,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInputLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${$W.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size===`small`&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Ro(({theme:e})=>({display:`block`,transformOrigin:`top left`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`,variants:[{props:({ownerState:e})=>e.formControl,style:{position:`absolute`,left:0,top:0,transform:`translate(0, 20px) scale(1)`}},{props:{size:`small`},style:{transform:`translate(0, 17px) scale(1)`}},{props:({ownerState:e})=>e.shrink,style:{transform:`translate(0, -1.5px) scale(0.75)`,transformOrigin:`top left`,maxWidth:`133%`}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create([`color`,`transform`,`max-width`],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:`filled`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(12px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`filled`,size:`small`},style:{transform:`translate(12px, 13px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`filled`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,transform:`translate(12px, 7px) scale(0.75)`,maxWidth:`calc(133% - 24px)`}},{props:({variant:e,ownerState:t,size:n})=>e===`filled`&&t.shrink&&n===`small`,style:{transform:`translate(12px, 4px) scale(0.75)`}},{props:{variant:`outlined`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(14px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`outlined`,size:`small`},style:{transform:`translate(14px, 9px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`outlined`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,maxWidth:`calc(133% - 32px)`,transform:`translate(14px, -9px) scale(0.75)`}}]}))),sG=N.forwardRef(function(e,t){let n=zo({name:`MuiInputLabel`,props:e}),{disableAnimation:r=!1,margin:i,shrink:a,variant:o,className:s,...c}=n,l=ZW(),u=a;u===void 0&&l&&(u=l.filled||l.focused||l.adornedStart);let d=YW({props:n,muiFormControl:l,states:[`size`,`variant`,`required`,`focused`]}),f={...n,disableAnimation:r,formControl:l,shrink:u,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=aG(f);return(0,F.jsx)(oG,{"data-shrink":u,ref:t,className:k(p.root,s),...c,ownerState:f,classes:p})});function cG(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function lG(e,t=!1){return e&&(cG(e.value)&&e.value!==``||t&&cG(e.defaultValue)&&e.defaultValue!==``)}function uG(e){return e.startAdornment}function dG(e){return Zr(`MuiFormControl`,e)}Qr(`MuiFormControl`,[`root`,`marginNone`,`marginNormal`,`marginDense`,`fullWidth`,`disabled`]);var fG=e=>{let{classes:t,margin:n,fullWidth:r}=e;return A({root:[`root`,n!==`none`&&`margin${R(n)}`,r&&`fullWidth`]},dG,t)},pG=L(`div`,{name:`MuiFormControl`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${R(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:`inline-flex`,flexDirection:`column`,position:`relative`,minWidth:0,padding:0,margin:0,border:0,verticalAlign:`top`,variants:[{props:{margin:`normal`},style:{marginTop:16,marginBottom:8}},{props:{margin:`dense`},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:`100%`}}]}),mG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormControl`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,error:c=!1,focused:l,fullWidth:u=!1,hiddenLabel:d=!1,margin:f=`none`,required:p=!1,size:m=`medium`,variant:h=`outlined`,...g}=n,_={...n,color:a,component:o,disabled:s,error:c,fullWidth:u,hiddenLabel:d,margin:f,required:p,size:m,variant:h},v=fG(_),[y,b]=N.useState(()=>{let e=!1;return r&&N.Children.forEach(r,t=>{if(!zL(t,[`Input`,`Select`]))return;let n=zL(t,[`Select`])?t.props.input:t;n&&uG(n.props)&&(e=!0)}),e}),[x,S]=N.useState(()=>{let e=!1;return r&&N.Children.forEach(r,t=>{zL(t,[`Input`,`Select`])&&(lG(t.props,!0)||lG(t.props.inputProps,!0))&&(e=!0)}),e}),[C,w]=N.useState(!1);s&&C&&w(!1);let T=l!==void 0&&!s?l:C;N.useRef(!1);let E=N.useCallback(()=>{S(!0)},[]),D=N.useCallback(()=>{S(!1)},[]),O=N.useMemo(()=>({adornedStart:y,setAdornedStart:b,color:a,disabled:s,error:c,filled:x,focused:T,fullWidth:u,hiddenLabel:d,size:m,onBlur:()=>{w(!1)},onFocus:()=>{w(!0)},onEmpty:D,onFilled:E,registerEffect:void 0,required:p,variant:h}),[y,a,s,c,x,T,u,d,void 0,D,E,p,m,h]);return(0,F.jsx)(XW.Provider,{value:O,children:(0,F.jsx)(pG,{as:o,ownerState:_,className:k(v.root,i),ref:t,...g,children:r})})}),hG=L(mG)(({theme:e})=>({margin:0,padding:0,flex:`1 0 auto`,minWidth:e.spacing(4)})),gG=L(sG)(()=>({fontSize:`inherit`,whiteSpace:`nowrap`,margin:0,padding:0,alignSelf:`flex-start`,position:`absolute`,top:0,left:0,transformOrigin:`top left`,pointerEvents:`none`,"&.MuiInputLabel-shrink":{transform:`scale(0.75) translate(0, -0.75em)`},"&:not(.MuiInputLabel-shrink)":{transform:`translate(0, 0)`}})),_G=({label:e,className:t,children:n})=>(0,F.jsxs)(hG,{className:t,children:[(0,F.jsx)(gG,{shrink:!0,children:e}),n]});_G.propTypes={label:p.oneOfType([p.string,p.object]).isRequired,className:p.string,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired};var vG=L(`div`)(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:`collapse`},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:`solid`,borderColor:bU()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:SU()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:SU()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:`.6em 1em`,textAlign:`left`},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:`initial`},"&.prompt":{verticalAlign:`middle`,color:UH()},"&.legend":{width:`100%`,fontSize:`inherit !important`},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${UH()} !important`,display:`flex`,flexDirection:`column`,verticalAlign:`middle`,cursor:`pointer`,"& > p":{margin:`0 0 0 0 !important`}}})),yG=/\\embed\{newLine\}\[\]/g,bG=`\\newline `,xG=`preview-prompt`,SG=class extends N.Component{static propTypes={prompt:p.string,tagName:p.string,className:p.string,onClick:p.func,defaultClassName:p.string,autoplayAudioEnabled:p.bool,customAudioButton:p.shape({playImage:p.string,pauseImage:p.string})};static defaultProps={onClick:()=>{}};promptRef=N.createRef();parsedText=e=>{let{customAudioButton:t}=this.props,n=document.createElement(`div`);n.innerHTML=e;let r=n.querySelector(`audio`);if(r){let e=document.createElement(`source`);if(e.setAttribute(`type`,`audio/mp3`),e.setAttribute(`src`,r.getAttribute(`src`)),r.removeAttribute(`src`),r.setAttribute(`id`,`pie-prompt-audio-player`),r.appendChild(e),t){r.style.display=`none`;let e=document.createElement(`div`);e.id=`play-audio-button`,Object.assign(e.style,{cursor:`pointer`,display:`block`,width:`128px`,height:`128px`,backgroundImage:`url(${t.pauseImage})`,backgroundSize:`cover`,borderRadius:`50%`,border:`1px solid #326295`}),r.parentNode.insertBefore(e,r)}}return n.innerHTML};addCustomAudioButtonControls(){let{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById(`play-audio-button`),r=document.getElementById(`pie-prompt-audio-player`);if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener(`ended`,a)}).catch(e=>{console.error(`Error playing audio`,e)}),!n||!r||!t)return;let i=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},a=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:`1px solid #ccc`})},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:`1px solid #326295`})};n.addEventListener(`click`,i),r.addEventListener(`play`,o),r.addEventListener(`pause`,s),r.addEventListener(`ended`,a),this._handlePlayClick=i,this._handleAudioPlay=o,this._handleAudioPause=s,this._handleAudioEnded=a}removeCustomAudioButtonListeners(){let e=document.getElementById(`play-audio-button`),t=document.querySelector(`audio`);!e||!t||(e.removeEventListener(`click`,this._handlePlayClick),t.removeEventListener(`play`,this._handleAudioPlay),t.removeEventListener(`pause`,this._handleAudioPause),t.removeEventListener(`ended`,this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){let e=this.promptRef.current;e&&typeof yW==`function`&&yW(e)}alignImages(){let e=this.promptRef.current;if(!e)return;let t=e.getElementsByTagName(`img`);if(t&&t.length){for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){let t=e.attributes.alignment.value,n=t===`center`?`center`:t===`right`?`flex-end`:`flex-start`,r=e.parentElement;if(r.tagName===`DIV`&&r.style.display===`flex`&&r.style.width===`100%`)r.style.justifyContent=n;else{let t=document.createElement(`div`);t.style.display=`flex`,t.style.width=`100%`,t.style.justifyContent=n;let i=e.cloneNode(!0);t.appendChild(i),r.replaceChild(t,e)}}}}render(){let{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:i}=this.props,a=`${n||``} ${i||``} ${t===`legend`?`legend`:``} ${xG}`.trim();return(0,F.jsx)(vG,{as:t||`div`,ref:this.promptRef,onClick:r,className:a,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||``).replace(yG,bG)}})}},CG=e=>(0,F.jsx)(F.Fragment,{children:N.Children.map(e.children,t=>N.cloneElement(t,{"data-pie-readable":e.false===void 0}))});CG.propTypes={children:p.node,false:p.bool};var wG=e=>(0,F.jsx)(F.Fragment,{children:N.Children.map(e.children,t=>N.cloneElement(t,{"data-pie-purpose":e.purpose}))});wG.propTypes={children:p.node,purpose:p.string};var TG;typeof window<`u`&&(TG=new DOMParser);var EG=e=>TG.parseFromString(e,`text/html`).body.textContent,DG=e=>{if(!e)return!1;let t=EG(e);return!!(t&&t.trim())},OG;typeof window<`u`&&(OG=new DOMParser);var kG=e=>{if(!e)return!1;let t=OG.parseFromString(e,`text/html`);return!!t.body.querySelector(`img`)||!!t.body.querySelector(`video`)||!!t.body.querySelector(`audio`)},AG=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAJYAyADAREAAhEBAxEB/8QAHgABAQABBQEBAQAAAAAAAAAAAAEIAgMGBwkEBQr/xABiEAACAQIDBAMKCAYMCgYLAQAAAQIDEQQFIQYSMUEHCFETFRYiUmFxkdHhCRRjgaGisfAXMjRTcsEjJDY4QmJ1dpKztMQYMzdEVIKyw9PxQ1hmc3SWJzVFRlZXhJOUldJk/8QAGwEBAQADAQEBAAAAAAAAAAAAAAcEBQYCAQP/xABBEQEAAQIDAgkJBgUFAQEBAAAAAQIDBAYRBSESMUFEYXGCscITNDVRcoGRocEUIjJS0eEVI2KSsjNCU6LwFtLx/9oADAMBAAIRAxEAPwD1TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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`;function jG(e=``,t=2){if(!e)return e;let n=new DOMParser().parseFromString(e,`text/html`);return n.body.querySelectorAll(`[data-heading]`).forEach(e=>{let r=e.getAttribute(`data-heading`)||``,i=parseInt(r.replace(`heading`,``),10);if(!Number.isFinite(i))return;let a=Math.min(6,Math.max(1,t+i-1)),o=n.createElement(`h${a}`);o.setAttribute(`data-heading`,r),Array.from(e.attributes).forEach(e=>{e.name!==`data-heading`&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}function MG(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:nH(n,r),{props:s,internalRef:c}=aH({...a,externalSlotProps:o}),l=ZL(c,o?.ref,e.additionalProps?.ref);return tH(t,{...s,ref:l},r)}var NG=N.createContext({});function PG(e){return Zr(`MuiList`,e)}Qr(`MuiList`,[`root`,`padding`,`dense`,`subheader`]);var FG=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return A({root:[`root`,!n&&`padding`,r&&`dense`,i&&`subheader`]},PG,t)},IG=L(`ul`,{name:`MuiList`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:`none`,margin:0,padding:0,position:`relative`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),LG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiList`}),{children:r,className:i,component:a=`ul`,dense:o=!1,disablePadding:s=!1,subheader:c,...l}=n,u=N.useMemo(()=>({dense:o}),[o]),d={...n,component:a,dense:o,disablePadding:s},f=FG(d);return(0,F.jsx)(NG.Provider,{value:u,children:(0,F.jsxs)(IG,{as:a,className:k(f.root,i),ref:t,ownerState:d,...l,children:[c,r]})})}),RG=AV;function zG(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function BG(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function VG(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(``))}function HG(e,t,n,r,i,a){let o=!1,s=i(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(o)return!1;o=!0}let t=r?!1:s.disabled||s.getAttribute(`aria-disabled`)===`true`;if(!s.hasAttribute(`tabindex`)||!VG(s,a)||t)s=i(e,s,n);else return s.focus(),!0}return!1}var UG=N.forwardRef(function(e,t){let{actions:n,autoFocus:r=!1,autoFocusItem:i=!1,children:a,className:o,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:l,variant:u=`selectedMenu`,...d}=e,f=N.useRef(null),p=N.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});GL(()=>{r&&f.current.focus()},[r]),N.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){let n=`${RG(UL(e))}px`;f.current.style[t===`rtl`?`paddingLeft`:`paddingRight`]=n,f.current.style.width=`calc(100% + ${n})`}return f.current}}),[]);let m=e=>{let t=f.current,n=e.key;if(e.ctrlKey||e.metaKey||e.altKey){l&&l(e);return}let r=UV(VL(t));if(n===`ArrowDown`)e.preventDefault(),HG(t,r,c,s,zG);else if(n===`ArrowUp`)e.preventDefault(),HG(t,r,c,s,BG);else if(n===`Home`)e.preventDefault(),HG(t,null,c,s,zG);else if(n===`End`)e.preventDefault(),HG(t,null,c,s,BG);else if(n.length===1){let i=p.current,a=n.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);let c=r&&!i.repeating&&VG(r,i);i.previousKeyMatched&&(c||HG(t,r,!1,s,zG,i))?e.preventDefault():i.previousKeyMatched=!1}l&&l(e)},h=QL(f,t),g=-1;N.Children.forEach(a,(e,t)=>{if(!N.isValidElement(e)){g===t&&(g+=1,g>=a.length&&(g=-1));return}e.props.disabled||(u===`selectedMenu`&&e.props.selected||g===-1)&&(g=t),g===t&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(g+=1,g>=a.length&&(g=-1))});let _=N.Children.map(a,(e,t)=>{if(t===g){let t={};return i&&(t.autoFocus=!0),e.props.tabIndex===void 0&&u===`selectedMenu`&&(t.tabIndex=0),N.cloneElement(e,t)}return e});return(0,F.jsx)(LG,{role:`menu`,ref:h,className:o,onKeyDown:m,tabIndex:r?0:-1,...d,children:_})});function WG(e){return Zr(`MuiMenu`,e)}Qr(`MuiMenu`,[`root`,`paper`,`list`]);var GG={vertical:`top`,horizontal:`right`},KG={vertical:`top`,horizontal:`left`},qG=e=>{let{classes:t}=e;return A({root:[`root`],paper:[`paper`],list:[`list`]},WG,t)},JG=L(IH,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenu`,slot:`Root`})({}),YG=L(FH,{name:`MuiMenu`,slot:`Paper`})({maxHeight:`calc(100% - 96px)`,WebkitOverflowScrolling:`touch`}),XG=L(UG,{name:`MuiMenu`,slot:`List`})({outline:0}),ZG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiMenu`}),{autoFocus:r=!0,children:i,className:a,disableAutoFocusItem:o=!1,MenuListProps:s={},onClose:c,open:l,PaperProps:u={},PopoverClasses:d,transitionDuration:f=`auto`,TransitionProps:{onEntering:p,...m}={},variant:h=`selectedMenu`,slots:g={},slotProps:_={},...v}=n,y=Ri(),b={...n,autoFocus:r,disableAutoFocusItem:o,MenuListProps:s,onEntering:p,PaperProps:u,transitionDuration:f,TransitionProps:m,variant:h},x=qG(b),S=r&&!o&&l,C=N.useRef(null),w=(e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:y?`rtl`:`ltr`}),p&&p(e,t)},T=e=>{e.key===`Tab`&&(e.preventDefault(),c&&c(e,`tabKeyDown`))},E=-1;N.Children.map(i,(e,t)=>{N.isValidElement(e)&&(e.props.disabled||(h===`selectedMenu`&&e.props.selected||E===-1)&&(E=t))});let D={slots:g,slotProps:{list:s,transition:m,paper:u,..._}},O=MG({elementType:g.root,externalSlotProps:_.root,ownerState:b,className:[x.root,a]}),[A,j]=oH(`paper`,{className:x.paper,elementType:YG,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:b}),[M,ee]=oH(`list`,{className:k(x.list,s.className),elementType:XG,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:e=>({...e,onKeyDown:t=>{T(t),e.onKeyDown?.(t)}}),ownerState:b}),te=typeof D.slotProps.transition==`function`?D.slotProps.transition(b):D.slotProps.transition;return(0,F.jsx)(JG,{onClose:c,anchorOrigin:{vertical:`bottom`,horizontal:y?`right`:`left`},transformOrigin:y?GG:KG,slots:{root:g.root,paper:A,backdrop:g.backdrop,...g.transition&&{transition:g.transition}},slotProps:{root:O,paper:j,backdrop:typeof _.backdrop==`function`?_.backdrop(b):_.backdrop,transition:{...te,onEntering:(...e)=>{w(...e),te?.onEntering?.(...e)}}},open:l,ref:t,transitionDuration:f,ownerState:b,...v,classes:d,children:(0,F.jsx)(M,{actions:C,autoFocus:r&&(E===-1||o),autoFocusItem:S,variant:h,...ee,children:i})})}),QG=({slotProps:e,...t})=>(0,F.jsx)(ZG,{...t,disableScrollLock:!0,hideBackdrop:!0,slotProps:{...e,root:{...e?.root,style:{backgroundColor:`transparent`,pointerEvents:`none`,...e?.root?.style}},paper:{...e?.paper,style:{pointerEvents:`auto`,...e?.paper?.style}}}}),$G=s({Collapsible:()=>CW,EnableAudioAutoplayImage:()=>AG,Feedback:()=>qU,HtmlAndMath:()=>JW,InlineMenu:()=>QG,InputContainer:()=>_G,PreviewLayout:()=>qW,PreviewPrompt:()=>SG,Purpose:()=>wG,Readable:()=>CG,UiLayout:()=>GW,color:()=>zH,hasMedia:()=>kG,hasText:()=>DG,indicators:()=>JU,transformDataHeadings:()=>jG,withUndoReset:()=>HW}),eK=IL((0,F.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),tK=IL((0,F.jsx)(`path`,{d:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2`}),`MoreVert`),nK=e=>{switch(e){case`down`:return 90;case`up`:return-90;case`left`:return 180;default:return 0}},rK=e=>{let{direction:t,style:n}=e;return(0,F.jsx)(eK,{style:{transform:`rotate(${nK(t)}deg)`,...n}})};rK.propTypes={direction:p.string,style:p.object};var iK=({style:e})=>(0,F.jsxs)(`span`,{style:e,children:[(0,F.jsx)(tK,{style:{margin:`0 -16px`}}),(0,F.jsx)(tK,{})]});iK.propTypes={style:p.object},L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`}));var aK=L(`span`)(({theme:e})=>({border:`solid 0px ${e.palette.primary.main}`,"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:`120% !important`},"& mjx-frac":{fontSize:`120% !important`}}));function oK({n:e,children:t,isDragging:n,isOver:r,dragItem:i,value:a,selected:o}){let[s,c]=(0,N.useState)(null),l=(0,N.useRef)(null),u=e=>{l.current&&(l.current.contains(e.target)?l.current.classList.add(`selected`):l.current.classList.remove(`selected`))};(0,N.useEffect)(()=>(document.addEventListener(`click`,u),()=>{document.removeEventListener(`click`,u)}),[]),(0,N.useEffect)(()=>{l.current&&typeof yW==`function`&&yW(l.current)},[a?.value,r,i?.value?.value]),(0,N.useEffect)(()=>{if(r&&l.current&&!s){let e=l.current;c({width:e.offsetWidth,height:e.offsetHeight})}else!r&&s&&c(null)},[r,s]);let d=i&&r?i.value.value:a.value||`\xA0`,f=n?`\xA0`:d,p=f!==`\xA0`,m=i&&r,h=o?`2px solid ${rU()}`:m?`1px solid ${BH.BORDER_DARK}`:`1px solid ${BH.BORDER_LIGHT}`;return(0,F.jsxs)(`div`,{ref:l,className:o?`selected`:void 0,style:{display:`inline-flex`,minWidth:`178px`,minHeight:`36px`,background:m?`${BH.BORDER_LIGHT}`:`${BH.WHITE}`,border:h,boxSizing:`border-box`,borderRadius:`3px`,overflow:`hidden`,position:`relative`,padding:`8px 8px 8px 35px`,width:s?s.width:void 0,height:s?s.height:void 0,touchAction:`none`},"data-key":e.index,contentEditable:!1,children:[p&&(0,F.jsx)(iK,{style:{position:`absolute`,top:`6px`,left:`15px`,color:`#9B9B9B`},contentEditable:!1}),(0,F.jsx)(`span`,{dangerouslySetInnerHTML:{__html:f}}),t]})}oK.propTypes={n:p.object,children:p.node,isDragging:p.bool,isOver:p.bool,dragItem:p.object,value:p.object,selected:p.bool};function sK({value:e,disabled:t,instanceId:n,children:r,n:i,onChange:a,removeResponse:o,duplicates:s,pos:c,selected:l}){let{attributes:u,listeners:d,setNodeRef:f,isDragging:p}=JB({id:`drag-${i.index}`,disabled:t||!e?.value,data:{id:`drag-${i.index}`,value:e,instanceId:n,n:i,pos:c,opts:{duplicates:s},type:`drag-in-the-blank-placed-choice`,fromChoice:!e,onRemove:e=>o(e),onDrop:(e,t)=>{t?.type===`drag-in-the-blank-drop-choice`&&(a(e),!s&&e.fromChoice&&o(e))}}}),{setNodeRef:m,isOver:h,active:g}=ZB({id:`drop-${i.index}`,data:{type:`drag-in-the-blank-drop-choice`,accepts:[`drag-in-the-blank-choice`,`drag-in-the-blank-placed-choice`],instanceId:n,value:e,id:`drop-${i.index}`,pos:c,n:i,opts:{duplicates:s},onDrop:(e,t)=>{if(t?.type===`drag-in-the-blank-drop-choice`&&e.value.id!==t.value.id){if(e.type===`drag-in-the-blank-choice`){a(e),!s&&e.fromChoice&&o(e);return}e.type===`drag-in-the-blank-placed-choice`&&(o(t),a(e),setTimeout(()=>o(e),10))}}}}),_=e=>{f(e),m(e)},v=(0,F.jsx)(oK,{n:i,isDragging:p,isOver:h,dragItem:g?.data?.current,value:e,selected:l,children:r}),y=e?(0,F.jsx)(`span`,{ref:_,...u,...d,children:v}):(0,F.jsx)(`span`,{ref:m,children:v});return(0,F.jsx)(aK,{className:k(h&&`over`),children:y})}sK.propTypes={value:p.object,disabled:p.bool,instanceId:p.string,children:p.node,n:p.object.isRequired,onChange:p.func.isRequired,removeResponse:p.func.isRequired,duplicates:p.bool,selected:p.bool};var cK=(e,t,n,r)=>{let{tr:i}=e.state;i.setNodeMarkup(n,void 0,{...t.attrs,...r.value}),i.isDone=!0,e.view.dispatch(i)},lK=(e,t,n)=>{let{tr:r}=e.state;r.setNodeMarkup(n.pos,void 0,w(t.attrs,[`value`,`id`])),r.isDone=!0,e.view.dispatch(r)},uK=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{inTable:s}=o,c=r();return(0,F.jsx)(rS,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline`,whiteSpace:`normal`},children:(0,F.jsx)(`span`,{...o,style:{display:`inline-flex`,minHeight:`50px`,minWidth:`178px`,position:`relative`,margin:s?`10px`:`0 10px`,cursor:`pointer`},children:(0,F.jsx)(sK,{n:o,dragKey:o.id,targetId:`0`,pos:c,value:o,duplicates:i.duplicates,selected:a,onChange:e=>cK(t,n,c,e),removeResponse:e=>lK(t,n,e)})})})};uK.propTypes={attributes:p.object,data:p.object,n:p.object,nodeProps:p.object,opts:p.object};var dK=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s,error:c}=o,l=s||`<div>&nbsp</div>`,u=r(),d=(0,N.useRef)(null),f=(0,N.useRef)(null),p=(0,N.useRef)(!1),m=(0,N.useRef)(null),h=()=>t._holdInlineDropdownToolbarIndex!=null&&String(t._holdInlineDropdownToolbarIndex)===String(n.attrs.index),[g,_]=(0,N.useState)(!1),[v,y]=(0,N.useState)({top:0,left:0}),b=()=>{h()||(_(!1),i.onInlineDropdownToolbarClose?.(t))},x=i.respAreaToolbar([n,u],t,b),S=()=>{let{tr:e}=t.state,n=e.doc.nodeAt(u);if(!n)return;let{selection:r}=e;r.from===u&&r.to===u+n.nodeSize||(e.setSelection(W.create(e.doc,u)),t.view.dispatch(e))},C=()=>{p.current||(i.onToolbarCloseRequest?(p.current=!0,i.onToolbarCloseRequest([n,u],t,()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,b()},()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,_(!0),setTimeout(S,0)})):b())};(0,N.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&_(!0):g&&C()},[t,n,a]);let w=e=>e.clientX>document.documentElement.clientWidth||e.clientY>document.documentElement.clientHeight||e.target===document.documentElement;return(0,N.useEffect)(()=>{m.current&&typeof yW==`function`&&yW(m.current)},[s]),(0,N.useEffect)(()=>{let e=document.body.getBoundingClientRect(),{from:n}=t.state.selection,r=t.view.coordsAtPos(n);y({top:r.top+Math.abs(e.top)+40,left:r.left});let i=e=>{if(w(e))return;let n=e.target.closest(`[data-toolbar-for]`);!e.target.closest(`[data-inline-dropdown-toolbar]`)&&(!n||n.dataset.toolbarFor!==f.current?.instanceId)&&!t._toolbarOpened&&d.current&&!d.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&C()};return g?document.addEventListener(`mousedown`,i):document.removeEventListener(`mousedown`,i),()=>document.removeEventListener(`mousedown`,i)},[g,n]),(0,F.jsxs)(rS,{className:`inline-dropdown`,"data-selected":a,style:{display:`inline-flex`,height:`50px`,cursor:`pointer`},children:[(0,F.jsxs)(`div`,{ref:m,style:{display:`inline-flex`,minWidth:`178px`,height:`36px`,background:`#FFF`,border:`1px solid #C0C3CF`,boxSizing:`border-box`,borderRadius:`3px`,margin:`0 2px`,position:`relative`,alignItems:`center`},onClick:()=>_(!0),children:[(0,F.jsx)(`div`,{style:{flex:1,overflow:`hidden`,padding:`0 25px 0 8px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},children:(0,F.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`middle`},dangerouslySetInnerHTML:{__html:l}})}),(0,F.jsx)(rK,{direction:`down`,style:{position:`absolute`,top:`5px`,right:`5px`}})]}),g&&(0,F.jsxs)(N.Fragment,{children:[Rx.createPortal((0,F.jsx)(`div`,{ref:d,children:(0,F.jsx)(x,{editorCallback:e=>{f.current=e}})}),t?._tiptapContainerEl||document.body),t._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(Oz,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),Az(t,!1),delete t._holdInlineDropdownToolbarIndex,t.view.dispatch(e),_(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};dK.propTypes={attributes:p.object,selectedItem:p.oneOfType([p.string,p.object])};var fK=s({greaterThan:()=>hK,greaterThanEqual:()=>_K,lessThan:()=>mK,lessThanEqual:()=>gK}),pK=e=>({...e,category:`comparison`}),mK=pK({name:`Less than`,latex:`<`,command:`\\lt`}),hK=pK({name:`Greater than`,latex:`>`,command:`\\gt`}),gK=pK({name:`Less than or equal`,latex:`\\le`,symbol:`<=`,command:`\\le`,ariaLabel:`less than or equal to`}),_K=pK({name:`Greater than or equal`,symbol:`>=`,command:`\\ge`,latex:`\\ge`}),vK=e=>t=>({...t,category:e}),yK=(e=[])=>{let t=[];T(5,()=>t.push([]));let n=e.length,r=0,i=0;for(;i<n;)t[r++].push(e[i++]),r===5&&(r=0);return t},bK=e=>t=>{let n=y(e),r=n.some(e=>e.latex===t.latex),i=n.some(e=>e.name===t.name);return!r&&!i},xK=(e=[],t=[])=>{t=t.filter(bK(e));let n=[];T(5-e.length,()=>e.push([])),T(5,()=>n.push([]));let r=yK(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},SK=s({theta:()=>EK,x:()=>wK,y:()=>TK}),CK=vK(`vars`),wK=CK({name:`X`,latex:`x`,write:`x`}),TK=CK({name:`Y`,latex:`y`,write:`y`}),EK=CK({name:`Theta`,latex:`\\theta`,write:`\\theta`}),DK=s({blankOverBlank:()=>kK,xBlankBlank:()=>jK,xOverBlank:()=>AK}),OK=vK(`fractions`),kK=OK({name:`blank/blank`,latex:`\\frac{}{}`,command:`\\frac`,ariaLabel:`fraction`}),AK=OK({latex:`\\frac{x}{ }`,name:`X/blank`,label:`x/[]`,command:`/`,ariaLabel:`x over blank fraction`}),jK=OK({name:`X (blank/blank)`,latex:`x\\frac{}{}`,label:`x([]/[])`,command:`\\frac`,ariaLabel:`mixed number`}),MK=s({nthRoot:()=>LK,squareRoot:()=>IK,squared:()=>PK,xToPowerOfN:()=>FK}),NK=vK(`exponent`),PK=NK({name:`Squared`,latex:`x^2`,write:`^2`}),FK=NK({name:`X to the power of n`,latex:`x^{}`,command:`^`,ariaLabel:`exponent`}),IK=NK({name:`Square root`,latex:`\\sqrt{}`,command:`\\sqrt`}),LK=NK({name:`Nth root`,latex:`\\sqrt[{}]{}`,command:`\\nthroot`}),RK=s({absValue:()=>VK,approx:()=>GK,brackets:()=>UK,nApprox:()=>KK,notEqual:()=>qK,notSimilar:()=>YK,parenthesis:()=>HK,percentage:()=>WK,plusMinus:()=>BK,similar:()=>JK}),zK=vK(`misc`),BK=zK({name:`Plus or Minus`,latex:`\\pm`,write:`\\pm`}),VK=zK({name:`Absolute Value`,latex:`\\abs{}`,symbol:`| |`,command:`|`}),HK=zK({name:`Parenthesis`,latex:`\\left(\\right)`,symbol:`( )`,command:`(`}),UK=zK({name:`Brackets`,latex:`\\left[\\right]`,symbol:`[ ]`,command:`[`}),WK=zK({name:`Percent`,latex:`%`,command:`%`}),GK=zK({latex:`\\approx`,command:`\\approx`,ariaLabel:`Approximately equal to`}),KK=zK({latex:`\\napprox`,command:`\\napprox`,ariaLabel:`Not pproximately equal to`}),qK=zK({latex:`\\neq`,command:`\\neq`,ariaLabel:`Not equals`}),JK=zK({latex:`\\sim`,command:`\\sim`,ariaLabel:`Similar`}),YK=zK({latex:`\\nsim`,command:`\\nsim`,ariaLabel:`Not similar`}),XK=s({eulers:()=>$K,halfInfinity:()=>tq,infinity:()=>eq,pi:()=>QK}),ZK=vK(`constants`),QK=ZK({name:`Pi`,label:`π`,latex:`\\pi`,command:`\\pi`,category:`constants`}),$K=ZK({name:`Eulers`,label:`e`,latex:`e`,command:`e`,category:`constants`}),eq=ZK({name:`Infinity`,label:`\\infty`,latex:`\\infty`,command:`\\infty`,category:`constants`}),tq=ZK({name:`Half Infinity`,label:`\\propto`,latex:`\\propto`,command:`\\propto`,category:`constants`}),nq=s({cos:()=>aq,cot:()=>lq,csc:()=>cq,sec:()=>sq,sin:()=>iq,tan:()=>oq}),rq=vK(`trigonometry`),iq=rq({name:`sine`,label:`sin`,command:`\\sin`,latex:`\\sin`}),aq=rq({name:`cosine`,label:`cos`,command:`\\cos`,latex:`\\cos`}),oq=rq({name:`tanget`,label:`tan`,command:`\\tan`,latex:`\\tan`}),sq=rq({name:`secant`,label:`sec`,command:`\\sec`,latex:`\\sec`}),cq=rq({name:`cosecant`,label:`csc`,command:`\\csc`,latex:`\\csc`}),lq=rq({name:`cotangent`,label:`cot`,command:`\\cot`,latex:`\\cot`}),uq=s({angle:()=>yq,circledDot:()=>Tq,congruentTo:()=>Oq,degree:()=>Eq,doublePrimeArcSecond:()=>jq,leftArrow:()=>Mq,leftrightArrow:()=>Pq,measureOfAngle:()=>xq,notCongruentTo:()=>kq,notParallel:()=>_q,overArc:()=>bq,overLeftRightArrow:()=>mq,overRightArrow:()=>pq,overline:()=>fq,parallel:()=>gq,parallelogram:()=>wq,perpindicular:()=>vq,primeArcminute:()=>Aq,rightArrow:()=>Nq,segment:()=>hq,similarTo:()=>Dq,square:()=>Cq,triangle:()=>Sq}),dq=e=>({...e,category:`geometry`}),fq=dq({name:`Line`,latex:`\\overline{}`,command:`\\overline`}),pq=dq({name:`Ray`,latex:`\\overrightarrow{}`,command:`\\overrightarrow`}),mq=dq({name:`Segment`,latex:`\\overleftrightarrow{\\overline{}}`,symbol:`AB`,command:`\\overleftrightarrow`}),hq=dq({name:`Segment`,latex:`\\overleftrightarrow{AB}`,write:`\\overleftrightarrow{AB}`,label:`AB`}),gq=dq({name:`Parallel`,latex:`\\parallel`,command:`\\parallel`}),_q=dq({name:`Not Parallel`,latex:`\\nparallel`,command:`\\nparallel`}),vq=dq({name:`Perpendicular`,latex:`\\perp`,command:`\\perpendicular`}),yq=dq({name:`Angle`,latex:`\\angle`,command:`\\angle`}),bq=dq({name:`Over arc`,latex:`\\overarc{\\overline{}}`,command:`\\overarc`}),xq=dq({name:`Measured Angle`,latex:`\\measuredangle`,command:[`m`,`\\angle`]}),Sq=dq({name:`Triangle`,latex:`\\triangle`,command:`\\triangle`}),Cq=dq({name:`Square`,latex:`\\square`,command:`\\square`}),wq=dq({name:`Parallelogram`,latex:`\\parallelogram`,command:`\\parallelogram`}),Tq=dq({name:`Circled Dot`,latex:`\\odot`,command:`\\odot`}),Eq=dq({name:`Degree`,latex:`\\degree`,command:`\\degree`}),Dq=dq({name:`Similar`,command:`\\sim`,latex:`\\sim`}),Oq=dq({name:`Congruent To`,command:`\\cong`,latex:`\\cong`}),kq=dq({name:`Not Congruent To`,command:`\\ncong`,latex:`\\ncong`}),Aq=dq({name:`Prime`,label:`pam`,latex:`'`,write:`'`}),jq=dq({name:`Double Prime`,latex:`''`,write:`''`}),Mq=dq({name:`Left Arrow`,latex:`\\leftarrow`,command:`\\leftarrow`}),Nq=dq({name:`Right Arrow`,latex:`\\rightarrow`,command:`\\rightarrow`}),Pq=dq({name:`Left and Right Arrow`,latex:`\\leftrightarrow`,command:`\\leftrightarrow`}),Fq=s({circleDot:()=>Iq}),Iq=vK(`operators`)({name:`CircleDot`,label:`⋅`,write:`\\cdot`,ariaLabel:`Dot multiplier`}),Lq=s({ln:()=>Vq,log:()=>zq,logSubscript:()=>Bq}),Rq=vK(`log`),zq=Rq({name:`Log`,label:`log`,command:`\\log`,latex:`\\log`}),Bq=Rq({name:`log base n`,label:`log s`,latex:`\\log_{}`,command:[`\\log`,`_`]}),Vq=Rq({name:`natural log`,label:`ln`,command:`\\ln`,latex:`\\ln`}),Hq=s({subscript:()=>Gq,superscript:()=>Wq}),Uq=vK(`sub-sup`),Wq=Uq({name:`Superscript`,latex:`x^{}`,command:`^`}),Gq=Uq({name:`Subscript`,latex:`x_{}`,command:`_`}),Kq=s({mu:()=>Xq,sigma:()=>Zq,smallSigma:()=>Qq,xBar:()=>Jq,yBar:()=>Yq}),qq=vK(`statistics`),Jq=qq({name:`X Bar`,label:`x̄`,latex:`\\overline{x}`,write:`\\overline{x}`}),Yq=qq({name:`Y Bar`,latex:`\\overline{y}`,write:`\\overline{y}`}),Xq=qq({name:`mu`,label:`mu`,latex:`\\mu`,write:`\\mu`}),Zq=qq({name:`Sigma`,ariaLabel:`Uppercase Sigma`,label:`\\Sigma`,latex:`\\Sigma`,write:`\\Sigma`}),Qq=qq({name:`sigma`,ariaLabel:`Lowercase Sigma`,label:`\\sigma`,latex:`\\sigma`,write:`\\sigma`}),$q=s({divide:()=>iJ,equals:()=>tJ,minus:()=>rJ,multiply:()=>aJ,plus:()=>nJ}),eJ=vK(`operators`),tJ=eJ({write:`=`,label:`=`}),nJ=eJ({write:`+`,label:`+`}),rJ=eJ({write:`−`,label:`−`}),iJ=eJ({name:`divide`,label:`÷`,command:`\\divide`,otherNotation:`\\div`}),aJ=eJ({name:`multiply`,label:`×`,command:`\\times`}),oJ=s({doubleCellMatrix:()=>lJ,singleCellMatrix:()=>cJ}),sJ=vK(`matrices`),cJ=sJ({name:`Single Cell Matrix`,label:`[ ]`,write:`\\begin{pmatrix}\\end{pmatrix}`}),lJ=sJ({name:`Double Cell Matrix`,label:`[ ] [ ] \\\\newline [ ] [ ]`,write:`\\begin{bmatrix}&\\\\&\\end{bmatrix}`}),uJ={0:`zero`,1:`one`,2:`two`,3:`three`,4:`four`,5:`five`,6:`six`,7:`seven`,8:`eight`,9:`nine`},dJ=T(10,String).map(e=>({name:uJ[e],write:e,label:e,category:`digit`})).reduce((e,t)=>(e[t.name]=t,e),{comma:{name:`comma`,label:`,`,write:`,`,category:`digit`},decimalPoint:{name:`decimal-point`,label:`.`,write:`.`,category:`digit`}}),fJ=vK(`logic`),pJ=fJ({name:`Therefore`,label:`∴`,write:`∴`}),mJ=fJ({name:`Long division`,latex:`\\longdiv{}`,command:`\\longdiv`}),hJ=vK(`navigation`),gJ=hJ({label:`◀`,keystroke:`Left`,ariaLabel:`Move cursor left`}),_J=hJ({label:`▶`,keystroke:`Right`,ariaLabel:`Move cursor right`}),vJ={label:`⌫`,category:`edit`,keystroke:`Backspace`,ariaLabel:`Delete`},yJ=[[kK,WK,wK,PK,IK],[Iq,TK,Gq,FK,LK],[BK,mK,hK,gK,_K],[QK,EK,HK,UK,VK],[qK,iq,aq,oq,Eq]],bJ=(()=>{let e=[...yJ.map(e=>[...e])];return e[0].push({name:`i`,latex:`i`,write:`i`}),e[1].push(zq),e[2].push(Bq),e[3].push(Vq),e[4].push($K),e})(),xJ=(()=>{let e=[...yJ.map(e=>[...e])];return e[0].push(Xq),e[1].push(Jq),e[2].push(Yq),e[3].push(Zq),e[4].push(Qq),e})(),SJ=[{predicate:e=>e>=3&&e<=5,set:[[mK,hK],[AK,jK],[wK,mJ],[PK,FK]]},{predicate:e=>e>=6&&e<=7,set:[[Eq,mK,hK],[Iq,gK,_K],[wK,TK,PK,FK],[BK,AK,jK,IK],[QK,HK,VK,LK]]},{predicate:e=>e>=8||e===`HS`,set:yJ},{predicate:`non-negative-integers`,set:[[dJ.seven,dJ.eight,dJ.nine],[dJ.four,dJ.five,dJ.six],[dJ.one,dJ.two,dJ.three],[dJ.zero,{name:``,latex:``,write:``},{name:``,latex:``,write:``}],[gJ,_J,vJ]]},{predicate:`integers`,set:[[dJ.seven,dJ.eight,dJ.nine],[dJ.four,dJ.five,dJ.six],[dJ.one,dJ.two,dJ.three],[dJ.zero,{name:``,latex:``,write:``},rJ],[gJ,_J,vJ]]},{predicate:`decimals`,set:[[dJ.seven,dJ.eight,dJ.nine],[dJ.four,dJ.five,dJ.six],[dJ.one,dJ.two,dJ.three],[dJ.zero,dJ.decimalPoint,rJ],[gJ,_J,vJ]]},{predicate:`fractions`,set:[[dJ.seven,dJ.eight,dJ.nine],[dJ.four,dJ.five,dJ.six],[dJ.one,dJ.two,dJ.three],[dJ.zero,kK,rJ],[gJ,_J,vJ]]},{predicate:`geometry`,set:[[kK,Eq,Aq,jq,Oq,Dq],[Iq,yq,xq,Sq,kq,YK],[iq,aq,oq,QK,IK,LK],[cq,sq,lq,EK,Gq,FK],[fq,pq,mq,bq,vq,gq]]},{predicate:`advanced-algebra`,set:bJ},{predicate:`statistics`,set:xJ},{predicate:`item-authoring`,set:[[iJ,kK,mJ,tq,PK,IK,fq,pq,mq,zq],[aJ,Iq,{name:``,latex:``,write:``},Gq,FK,LK,vq,gq,bq,Bq],[BK,QK,EK,Eq,yq,Mq,Nq,Sq,Cq,Vq],[qK,VK,Qq,Xq,pJ,Zq,Pq,iq,aq,oq],[gK,_K,{name:``,latex:``,write:``},{name:``,latex:``,write:``},eq,{name:``,latex:``,write:``},{name:``,latex:``,write:``},cq,sq,lq]]},{predicate:e=>e>=1&&e<=2,set:[]}],CJ=e=>{let t=parseInt(e,10);if(e=isNaN(t)?e:t,!e)return[];let n=SJ.find(t=>typeof t.predicate==`string`?t.predicate===e:t.predicate(e));if(n)return n.set||[];if(e!==`language`)return SJ[2].set},wJ=[...Object.values($q),...Object.values(fK),...Object.values(XK),...Object.values(dJ),...Object.values(MK),...Object.values(DK),...Object.values(uq),...Object.values(Lq),...Object.values(oJ),...Object.values(RK),...Object.values(Fq),...Object.values(Kq),...Object.values(Hq),...Object.values(nq),...Object.values(SK)],TJ=e=>(e||[]).map(e=>{let{latex:t}=e,n=(wJ||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}),EJ=()=>{(Array.from(document.querySelectorAll(`span[mathquill-command-id]`))||[]).forEach(e=>{e&&e.innerText===`∥`&&e.className!==`mq-editable-field`&&(e.style.fontSize=`32px`),(e.innerText===`′`||e.innerText===`′′`)&&!e.hasAttribute(`data-prime`)&&e.setAttribute(`data-prime`,`true`)})},{one:DJ,two:OJ,three:kJ,four:AJ,five:jJ,six:MJ,seven:NJ,eight:PJ,nine:FJ,zero:IJ,comma:LJ,decimalPoint:RJ}=dJ,zJ=[[NJ,PJ,FJ,iJ],[AJ,jJ,MJ,aJ],[DJ,OJ,kJ,rJ],[IJ,RJ,LJ,nJ],[gJ,_J,vJ,tJ]];function K(e){this.elements=Array.isArray(e)?e:[e].filter(Boolean),this.length=this.elements.length;for(var t=0;t<this.elements.length;t++)this[t]=this.elements[t]}K.prototype.addClass=function(e){var t=(e||``).split(/\s+/).filter(Boolean);return this.elements.forEach(function(e){t.forEach(function(t){e.classList.add(t)})}),this},K.prototype.removeClass=function(e){return this.elements.forEach(function(t){e?(e||``).split(/\s+/).filter(Boolean).forEach(function(e){t.classList.remove(e)}):t.className=``}),this},K.prototype.toggleClass=function(e,t){var n=(e||``).split(/\s+/).filter(Boolean),r=arguments.length>1?!!t:null;return this.elements.forEach(function(e){n.forEach(function(t){r===null?e.classList.toggle(t):e.classList.toggle(t,r)})}),this},K.prototype.attr=function(e,t){return t===WJ?this.elements[0]?this.elements[0].getAttribute(e):WJ:(this.elements.forEach(function(n){n.setAttribute(e,t)}),this)},K.prototype.html=function(e){return e===WJ?this.elements[0]?this.elements[0].innerHTML:``:(this.elements.forEach(function(t){t.innerHTML=e}),this)},K.prototype.append=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e){e.appendChild(t)}),this},K.prototype.prepend=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e,n){var r=n===0?t:t.cloneNode(!0);e.insertBefore(r,e.firstChild)}),this},K.prototype.wrapAll=function(e){if(!this.elements.length)return this;var t;if(typeof e==`string`&&e.trim().indexOf(`<`)===0){var n=document.createElement(`div`);n.innerHTML=e.trim(),t=n.firstChild}else if(e instanceof K)t=e.elements[0];else if(e&&e.nodeType)t=e;else return this;var r=this.elements[0],i=r.parentNode;return i&&(i.insertBefore(t,r),this.elements.forEach(function(e){t.appendChild(e)})),this},K.prototype.appendTo=function(e){var t=e instanceof K?e.elements[0]:e;return t&&this.elements.forEach(function(e){t.appendChild(e)}),this},K.prototype.prependTo=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.firstChild;return this.elements.forEach(function(e){t.insertBefore(e,n),n=e}),this},K.prototype.insertBefore=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode;return n&&this.elements.forEach(function(e){n.insertBefore(e,t)}),this},K.prototype.insertAfter=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode,r=t.nextSibling;return n&&this.elements.forEach(function(e){n.insertBefore(e,r),r=e}),this},K.prototype.replaceWith=function(e){var t=[];return e instanceof K?t=e.elements.slice():e&&typeof e.length==`number`&&!e.tagName?t=Array.from(e):e&&e.nodeType&&(t=[e]),this.elements.forEach(function(e){var n=e.parentNode;n&&(t.forEach(function(t){n.insertBefore(t,e)}),n.removeChild(e))}),this},K.prototype.insDirOf=function(e,t){return e===-1?this.insertBefore(t.first()):this.insertAfter(t.last())},K.prototype.insAtDirEnd=function(e,t){return e===-1?this.prependTo(t):this.appendTo(t)},K.prototype.children=function(e){var t=[];return this.elements.forEach(function(n){var r;if(!e)r=Array.from(n.children);else if(e===`:first`)r=n.firstElementChild?[n.firstElementChild]:[];else if(e===`:last`)r=n.lastElementChild?[n.lastElementChild]:[];else{var i=/^:eq\((\d+)\)$/.exec(e);if(i){var a=parseInt(i[1],10),o=Array.from(n.children);r=o[a]?[o[a]]:[]}else r=Array.from(n.querySelectorAll(`:scope > `+e))}t.push.apply(t,r)}),new K(t)},K.prototype.find=function(e){var t=[];return this.elements.forEach(function(n){var r=Array.from(n.querySelectorAll(e));t.push.apply(t,r)}),new K(t)},K.prototype.closest=function(e){return new K(this.elements.map(function(t){return t.closest(e)}).filter(Boolean))},K.prototype.contents=function(){var e=[];return this.elements.forEach(function(t){var n=Array.from(t.childNodes);e.push.apply(e,n)}),new K(e)},K.prototype.filter=function(e){return new K(this.elements.filter(function(t,n){return e(n,t)}))},K.prototype.detach=function(){return this.elements.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this},K.prototype.remove=function(){return this.elements.forEach(function(e){e.remove()}),this},K.prototype.empty=function(){return this.elements.forEach(function(e){e.innerHTML=``}),this};function BJ(e){return(e||``).split(`.`)[0]}K.prototype.on=function(e,t){var n=BJ(e);return this.elements.forEach(function(e){e.addEventListener(n,t)}),this},K.prototype.bind=function(e,t,n){var r=this;if(typeof e==`object`){for(var i in e)e.hasOwnProperty(i)&&r.bind(i,e[i]);return this}var a=typeof t==`function`?t:n;return a===!1&&(a=function(e){e.preventDefault()}),(e||``).split(/\s+/).filter(Boolean).forEach(function(e){var t=BJ(e);r.elements.forEach(function(e){e.addEventListener(t,a)})}),this},K.prototype.off=function(e,t){var n=BJ(e);return this.elements.forEach(function(e){e.removeEventListener(n,t)}),this},K.prototype.unbind=function(e,t){if(e&&e.includes(`.`))this.elements.forEach(function(e){var t=e.cloneNode(!0);e.parentNode&&e.parentNode.replaceChild(t,e)});else if(e&&t){var n=BJ(e);this.elements.forEach(function(e){e.removeEventListener(n,t)})}return this},K.prototype.trigger=function(e){var t=new Event(BJ(e),{bubbles:!0,cancelable:!0});return this.elements.forEach(function(e){e.dispatchEvent(t)}),this},K.prototype.focus=function(e){return typeof e==`function`?this.on(`focus`,e):(this.elements.forEach(function(e){e.focus&&e.focus()}),this)},K.prototype.blur=function(e){return typeof e==`function`?this.on(`blur`,e):(this.elements.forEach(function(e){e.blur&&e.blur()}),this)},[`mousemove`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`click`,`keydown`,`keypress`,`keyup`,`focusout`,`paste`,`cut`,`copy`,`input`,`load`].forEach(function(e){K.prototype[e]=function(t){return this.on(e,t)}}),K.prototype.next=function(e){return new K(this.elements.map(function(e){return e.nextElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.prev=function(e){return new K(this.elements.map(function(e){return e.previousElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.parent=function(){return new K(this.elements.map(function(e){return e.parentElement}).filter(Boolean))},K.prototype.offset=function(){if(!this.elements[0])return{top:0,left:0};var e=this.elements[0].getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft)}},K.prototype.width=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.width)||e.getBoundingClientRect().width},K.prototype.height=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.height)||e.getBoundingClientRect().height},K.prototype.outerWidth=function(){return this.elements[0]?this.elements[0].offsetWidth:0},K.prototype.outerHeight=function(){return this.elements[0]?this.elements[0].offsetHeight:0},K.prototype.innerWidth=function(){return this.elements[0]?this.elements[0].clientWidth:0},K.prototype.innerHeight=function(){return this.elements[0]?this.elements[0].clientHeight:0},K.prototype.css=function(e,t){if(t===WJ){if(typeof e==`string`){var n=this.elements[0];return n?window.getComputedStyle(n).getPropertyValue(e.replace(/([A-Z])/g,`-$1`).toLowerCase()):WJ}}else this.elements.forEach(function(n){n.style[e]=t});return this},K.prototype.scrollTop=function(e){var t=this.elements[0];return e===WJ?t?t===window?window.pageYOffset||document.documentElement.scrollTop:t.scrollTop:0:(t===window?window.scrollTo(window.pageXOffset||0,e):this.elements.forEach(function(t){t.scrollTop=e}),this)},K.prototype.scrollLeft=function(e){var t=this.elements[0];return e===WJ?t?t===window?window.pageXOffset||document.documentElement.scrollLeft:t.scrollLeft:0:(t===window?window.scrollTo(e,window.pageYOffset||0):this.elements.forEach(function(t){t.scrollLeft=e}),this)},K.prototype.each=function(e){return this.elements.forEach(function(t,n){e.call(t,n,t)}),this},K.prototype.eq=function(e){return new K([this.elements[e]])},K.prototype.get=function(e){return e===WJ?this.elements:e<0?this.elements[this.elements.length+e]:this.elements[e]},K.prototype.add=function(e){var t=this.elements.slice();return e instanceof K?t.push.apply(t,e.elements):Array.isArray(e)?t.push.apply(t,e):e&&e.nodeType&&t.push(e),new K(t)},K.prototype.first=function(){return new K([this.elements[0]])},K.prototype.last=function(){return new K([this.elements[this.elements.length-1]])},K.prototype.index=function(e){if(!e){var t=this.elements[0]&&this.elements[0].parentElement;return t?Array.from(t.children).indexOf(this.elements[0]):-1}var n=e instanceof K?e.elements[0]:e;return this.elements.indexOf(n)},K.prototype.is=function(e){return this.elements.some(function(t){return t.matches(e)})},K.prototype.text=function(e){return e===WJ?this.elements.map(function(e){return e.textContent}).join(``):(this.elements.forEach(function(t){t.textContent=e}),this)},K.prototype.val=function(e){var t=this.elements[0];return t?e===WJ?t.value===WJ?t.textContent:t.value:(this.elements.forEach(function(t){t.value===WJ?t.textContent=e:t.value=e}),this):WJ};function VJ(e){var t=Array.isArray(e)?e:[e].filter(Boolean),n=Object.create(K.prototype);n.elements=t,n.length=t.length;for(var r=0;r<t.length;r++)n[r]=t[r];return n}var HJ=function(e,t){var n;if(!e)n=[];else if(e===window||e===document)n=[e];else if(e.nodeType)n=[e];else if(e&&e.current&&e.current.nodeType)n=[e.current];else if(typeof e==`string`&&e[0]===`<`){var r=document.createElement(`div`);r.innerHTML=e.trim(),n=Array.from(r.children)}else if(typeof e==`string`){var i=t instanceof K?t.elements[0]:t||document;n=Array.from(i.querySelectorAll(e))}else n=e instanceof K?e.elements:e.length===WJ?[]:Array.from(e);return VJ(n)};HJ.contains=function(e,t){return e!==t&&e.contains(t)};var UJ=HJ,WJ,GJ=`mathquill-command-id`,KJ=`mathquill-block-id`,qJ=Math.min,JJ=Math.max;function YJ(){}var XJ=[].slice;function ZJ(e){var t=e.length-1;return function(){var n=XJ.call(arguments,0,t),r=XJ.call(arguments,t);return e.apply(this,n.concat([r]))}}var QJ=ZJ(function(e,t){return ZJ(function(n,r){if(e in n)return n[e].apply(n,t.concat(r))})});function $J(e){return ZJ(function(t,n){return typeof t!=`function`&&(t=QJ(t)),e.call(this,function(e){return t.apply(e,[e].concat(n))})})}function q(e){var t=XJ.call(arguments,1);return function(){return e.apply(this,t)}}function eY(e,t){if(!t)throw Error(`prayer failed: `+e)}var J=(function(e,t,n){function r(e){return typeof e==`object`}function i(e){return typeof e==`function`}function a(){}return function o(s,c){c===n&&(c=s,s=Object);function l(){var e=new u;return i(e.init)&&e.init.apply(e,arguments),e}function u(){}l.Bare=u;var d=a[e]=s[e],f=u[e]=l[e]=l.p=new a,p;return f.constructor=l,l.extend=function(e){return o(l,e)},(l.open=function(e){if(p={},i(e)?p=e.call(l,f,d,l,s):r(e)&&(p=e),r(p))for(var n in p)t.call(p,n)&&(f[n]=p[n]);return i(f.init)||(f.init=s),l})(c)}})(`prototype`,{}.hasOwnProperty),Y=-1,X=1;function tY(e){eY(`a direction was passed`,e===Y||e===X)}var nY=J(function(e){e.parent=0,e[Y]=0,e[X]=0,e.init=function(e,t,n){this.parent=e,this[Y]=t,this[X]=n},this.copy=function(e){return nY(e.parent,e[Y],e[X])}}),rY=J(function(e){e[Y]=0,e[X]=0,e.parent=0;var t=0;function n(){return t+=1}this.byId={},e.init=function(){this.id=n(),rY.byId[this.id]=this,this.ends={},this.ends[Y]=0,this.ends[X]=0},e.dispose=function(){delete rY.byId[this.id]},e.toString=function(){return`{{ MathQuill Node #`+this.id+` }}`},e.jQ=HJ(),e.jQadd=function(e){return this.jQ=this.jQ.add(e)},e.jQize=function(e){var e=HJ(e||this.html());function t(e){if(e.getAttribute){var n=e.getAttribute(`mathquill-command-id`),r=e.getAttribute(`mathquill-block-id`);n&&rY.byId[n].jQadd(e),r&&rY.byId[r].jQadd(e)}for(e=e.firstChild;e;e=e.nextSibling)t(e)}for(var n=0;n<e.length;n+=1)t(e[n]);return e},e.createDir=function(e,t){tY(e);var n=this;return n.jQize(),n.jQ.insDirOf(e,t.jQ),t[e]=n.adopt(t.parent,t[Y],t[X]),n},e.createLeftOf=function(e){return this.createDir(Y,e)},e.selectChildren=function(e,t){return lY(e,t)},e.bubble=$J(function(e){for(var t=this;t&&e(t)!==!1;t=t.parent);return this}),e.postOrder=$J(function(e){return(function t(n){n.eachChild(t),e(n)})(this),this}),e.isEmpty=function(){return this.ends[Y]===0&&this.ends[X]===0},e.isStyleBlock=function(){return!1},e.children=function(){return aY(this.ends[Y],this.ends[X])},e.eachChild=function(){var e=this.children();return e.each.apply(e,arguments),this},e.foldChildren=function(e,t){return this.children().fold(e,t)},e.withDirAdopt=function(e,t,n,r){return aY(this,this).withDirAdopt(e,t,n,r),this},e.adopt=function(e,t,n){return aY(this,this).adopt(e,t,n),this},e.disown=function(){return aY(this,this).disown(),this},e.remove=function(){return this.jQ.remove(),this.postOrder(`dispose`),this.disown()}});function iY(e,t,n){eY(`a parent is always present`,e),t&&(t[X]!==n&&(t[X]=n),t.parent!==e&&(t.parent=e)),n&&(n[Y]!==t&&(n[Y]=t),n.parent!==e&&(n.parent=e)),eY(`leftward is properly set up`,(function(){return t?t[X]===n&&t.parent===e:e.ends[Y]===n})()),eY(`rightward is properly set up`,(function(){return n?n[Y]===t&&n.parent===e:e.ends[X]===t})())}var aY=J(function(e){e.init=function(e,t,n){if(n===WJ&&(n=Y),tY(n),eY(`no half-empty fragments`,!e==!t),this.ends={},e){eY(`withDir is passed to Fragment`,e instanceof rY),eY(`oppDir is passed to Fragment`,t instanceof rY),eY(`withDir and oppDir have the same parent`,e.parent===t.parent),this.ends[n]=e,this.ends[-n]=t;var r=this.fold([],function(e,t){return e.push.apply(e,t.jQ.get()),e});this.jQ=this.jQ.add(r)}},e.jQ=HJ(),e.withDirAdopt=function(e,t,n,r){return e===Y?this.adopt(t,n,r):this.adopt(t,r,n)},e.adopt=function(e,t,n){iY(e,t,n);var r=this;r.disowned=!1;var i=r.ends[Y];if(!i)return this;var a=r.ends[X];return t||(e.ends[Y]=i),n?n[Y]=a:e.ends[X]=a,r.ends[X][X]=n,r.each(function(n){n[Y]=t,n.parent=e,t&&(t[X]=n),t=n}),r},e.disown=function(){var e=this,t=e.ends[Y];if(!t||e.disowned)return e;e.disowned=!0;var n=e.ends[X],r=t.parent;return iY(r,t[Y],t),iY(r,n,n[X]),t[Y]?t[Y][X]=n[X]:r.ends[Y]=n[X],n[X]?n[X][Y]=t[Y]:r.ends[X]=t[Y],e},e.remove=function(){return this.jQ.remove(),this.each(`postOrder`,`dispose`),this.disown()},e.each=$J(function(e){var t=this,n=t.ends[Y];if(!n)return t;for(;n!==t.ends[X][X]&&e(n)!==!1;n=n[X]);return t}),e.fold=function(e,t){return this.each(function(n){e=t.call(this,e,n)}),e}}),Z={},oY={},sY={},cY=J(nY,function(e){e.init=function(e,t){this.parent=e,this.options=t;var n=this.jQ=this._jQ=HJ(`<span class="mq-cursor">&#8203;</span>`);this.blink=function(){n.toggleClass(`mq-blink`)},this.upDownCache={}},e.show=function(){return this.jQ=this._jQ.removeClass(`mq-blink`),`intervalId`in this?clearInterval(this.intervalId):(this[X]?this.selection&&this.selection.ends[Y][Y]===this[Y]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[X].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},e.hide=function(){return`intervalId`in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=HJ(),this},e.withDirInsertAt=function(e,t,n,r){var i=this.parent;this.parent=t,this[e]=n,this[-e]=r,i!==t&&i.blur&&i.blur(this)},e.insDirOf=function(e,t){return tY(e),!t||!t.jQ?this:(this.jQ.insDirOf(e,t.jQ),this.withDirInsertAt(e,t.parent,t[e],t),this.parent.jQ.addClass(`mq-hasCursor`),this)},e.insLeftOf=function(e){return this.insDirOf(Y,e)},e.insRightOf=function(e){return this.insDirOf(X,e)},e.insAtDirEnd=function(e,t){return tY(e),this.jQ.insAtDirEnd(e,t.jQ),this.withDirInsertAt(e,t,0,t.ends[e]),t.focus(),this},e.insAtLeftEnd=function(e){return this.insAtDirEnd(Y,e)},e.insAtRightEnd=function(e){return this.insAtDirEnd(X,e)},e.jumpUpDown=function(e,t){var n=this;n.upDownCache[e.id]=nY.copy(n);var r=n.upDownCache[t.id];if(r)r[X]?n.insLeftOf(r[X]):n.insAtRightEnd(r.parent);else{var i=n.offset().left;t.seek(i,n)}},e.offset=function(){var e=this,t=e.jQ.removeClass(`mq-cursor`).offset();return e.jQ.addClass(`mq-cursor`),t},e.unwrapGramp=function(){var e=this.parent.parent,t=e.parent,n=e[X],r=this,i=e[Y];if(e.disown().eachChild(function(r){r.isEmpty()||(r.children().adopt(t,i,n).each(function(t){t.jQ.insertBefore(e.jQ.first())}),i=r.ends[X])}),!this[X])if(this[Y])this[X]=this[Y][X];else for(;!this[X];)if(this.parent=this.parent[X],this.parent)this[X]=this.parent.ends[Y];else{this[X]=e[X],this.parent=t;break}this[X]?this.insLeftOf(this[X]):this.insAtRightEnd(t),e.jQ.remove(),e[Y].siblingDeleted&&e[Y].siblingDeleted(r.options,X),e[X].siblingDeleted&&e[X].siblingDeleted(r.options,Y)},e.startSelection=function(){for(var e=this.anticursor=nY.copy(this),t=e.ancestors={},n=e;n.parent;n=n.parent)t[n.parent.id]=n},e.endSelection=function(){delete this.anticursor},e.select=function(){var e=this.anticursor;if(!e||!e.ancestors||this[Y]===e[Y]&&this.parent===e.parent)return!1;for(var t,n=this;n.parent;n=n.parent)if(n.parent.id in e.ancestors){t=n.parent;break}if(!t)return!1;var r=e.ancestors[t.id],i,a,o=X;if(n[Y]!==r){for(var s=n;s;s=s[X])if(s[X]===r[X]){o=Y,i=n,a=r;break}}return o===X&&(i=r,a=n),i instanceof nY&&(i=i[X]),a instanceof nY&&(a=a[Y]),!i||!a?!1:(this.hide().selection=t.selectChildren(i,a),this.insDirOf(o,this.selection.ends[o]),this.selectionChanged(),!0)},e.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.selectionChanged()),this},e.deleteSelection=function(){this.selection&&(this[Y]=this.selection.ends[Y][Y],this[X]=this.selection.ends[X][X],this.selection.remove(),this.selectionChanged(),delete this.selection)},e.replaceSelection=function(){var e=this.selection;return e&&(this[Y]=e.ends[Y][Y],this[X]=e.ends[X][X],delete this.selection),e},e.depth=function(){for(var e=this,t=0;e=e.parent;)t+=+(e instanceof AY);return t},e.isTooDeep=function(e){if(this.options.maxDepth!==WJ)return this.depth()+(e||0)>this.options.maxDepth},e.howDeep=function(){for(var e=0,t=this;t=t.parent;)e++;return 1+Math.floor(e/2)},e.tooDeep=function(){var e=this.options.maxDepth;return e&&this.howDeep()>e}}),lY=J(aY,function(e,t){e.init=function(){t.init.apply(this,arguments),this.jQ=this.jQ.wrapAll(`<span class="mq-selection"></span>`).parent()},e.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),t.adopt.apply(this,arguments)},e.clear=function(){var e=this.jQ[0];return e&&this.jQ.replaceWith(e.childNodes),this},e.join=function(e){return this.fold(``,function(t,n){return t+n[e]()})}}),uY=J(function(e){e.init=function(e,t,n){this.id=e.id,this.data={},this.root=e,this.container=t,this.options=n,e.controller=this,this.cursor=e.cursor=cY(e,n)},e.handle=function(e,t){var n=this.options.handlers;if(n&&n.fns[e]){var r=n.APIClasses[this.KIND_OF_MQ](this);t===Y||t===X?n.fns[e](t,r):n.fns[e](r)}};var t=[];this.onNotify=function(e){t.push(e)},e.notify=function(){for(var e=0;e<t.length;e+=1)t[e].apply(this.cursor,arguments);return this}}),dY={},fY=J(),pY={},mY=J(),hY={};function gY(){window.console&&console.warn(`You are using the MathQuill API without specifying an interface version, which will fail in v1.0.0. Easiest fix is to do the following before doing anything else:
310
+ `,pz=typeof dz==`string`?null:fr`
311
+ animation: ${dz} 1.4s linear infinite;
312
+ `,mz=typeof fz==`string`?null:fr`
313
+ animation: ${fz} 1.4s ease-in-out infinite;
314
+ `,hz=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return A({root:[`root`,n,`color${R(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,`circle${R(n)}`,i&&`circleDisableShrink`]},lz,t)},gz=L(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${R(n.color)}`]]}})(Ro(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:pz||{animation:`${dz} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),_z=L(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),vz=L(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${R(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Ro(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:mz||{animation:`${fz} 1.4s ease-in-out infinite`}}]}))),yz=L(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(Ro(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),bz=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,size:s=40,style:c,thickness:l=3.6,value:u=0,variant:d=`indeterminate`,...f}=n,p={...n,color:i,disableShrink:a,size:s,thickness:l,value:u,variant:d,enableTrackSlot:o},m=hz(p),h={},g={},_={};if(d===`determinate`){let e=2*Math.PI*((uz-l)/2);h.strokeDasharray=e.toFixed(3),_[`aria-valuenow`]=Math.round(u),h.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform=`rotate(-90deg)`}return(0,F.jsx)(gz,{className:k(m.root,r),style:{width:s,height:s,...g,...c},ownerState:p,ref:t,role:`progressbar`,..._,...f,children:(0,F.jsxs)(_z,{className:m.svg,ownerState:p,viewBox:`${uz/2} ${uz/2} ${uz} ${uz}`,children:[o?(0,F.jsx)(yz,{className:m.track,ownerState:p,cx:uz,cy:uz,r:(uz-l)/2,fill:`none`,strokeWidth:l,"aria-hidden":`true`}):null,(0,F.jsx)(vz,{className:m.circle,style:h,ownerState:p,cx:uz,cy:uz,r:(uz-l)/2,fill:`none`,strokeWidth:l})]})})});function xz(e){return Zr(`MuiIconButton`,e)}var Sz=Qr(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),Cz=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return A({root:[`root`,o&&`loading`,n&&`disabled`,r!=="default"&&`color${R(r)}`,i&&`edge${R(i)}`,`size${R(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},xz,t)},wz=L(sz,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${R(n.color)}`],n.edge&&t[`edge${R(n.edge)}`],t[`size${R(n.size)}`]]}})(Ro(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),Ro(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Sz.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${Sz.loading}`]:{color:`transparent`}}))),Tz=L(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),Ez=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:a,color:o=`default`,disabled:s=!1,disableFocusRipple:c=!1,size:l=`medium`,id:u,loading:d=null,loadingIndicator:f,...p}=n,m=eR(u),h=f??(0,F.jsx)(bz,{"aria-labelledby":m,color:`inherit`,size:16}),g={...n,edge:r,color:o,disabled:s,disableFocusRipple:c,loading:d,loadingIndicator:h,size:l},_=Cz(g);return(0,F.jsxs)(wz,{id:d?m:u,className:k(_.root,a),centerRipple:!0,focusRipple:!c,disabled:s||d,ref:t,...p,ownerState:g,children:[typeof d==`boolean`&&(0,F.jsx)(`span`,{className:_.loadingWrapper,style:{display:`contents`},children:(0,F.jsx)(Tz,{className:_.loadingIndicator,ownerState:g,children:d&&h})}),i]})}),Dz=WL((0,F.jsx)(`path`,{d:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z`}),`Delete`),Oz=`pie-toolbar`,kz=WL((0,F.jsx)(`path`,{d:`M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`}),`Check`),Az=L(Ez)({verticalAlign:`top`,width:`28px`,height:`28px`,color:`var(--editable-html-toolbar-check, #00bb00)`,padding:`4px`}),jz=({onClick:e,doneButtonRef:t})=>(0,F.jsx)(Az,{"aria-label":`Done`,buttonRef:t,onClick:e,children:(0,F.jsx)(kz,{})});jz.propTypes={onClick:p.func,doneButtonRef:p.func};var Mz=jz,Nz=L(`div`,{shouldForwardProp:e=>![`showDone`,`toolbarAlignment`,`isFocused`,`autoWidth`,`isHidden`].includes(e)})(({showDone:e,toolbarAlignment:t,isFocused:n,autoWidth:r,isHidden:i})=>({position:`absolute`,zIndex:10,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:e?`280px`:`265px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:1,...t===`right`&&{right:0},...r?{width:`auto`}:{width:`100%`},...i&&{visibility:`hidden`}})),Pz=L(Ez)({width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`}),Fz=L(`div`)({display:`flex`});function Iz(e){let{children:t,deletable:n,toolbarOpts:r,autoWidth:i,isFocused:a,doneButtonRef:o,onDelete:s,showDone:c,onDone:l,style:u}=e,d=r.minWidth===void 0?{}:{minWidth:r.minWidth};return(0,F.jsxs)(Nz,{className:Oz,showDone:c,toolbarAlignment:r.alignment,isFocused:r.alwaysVisible||a,autoWidth:i,isHidden:r.isHidden===!0,style:{...d,...u},children:[t,(0,F.jsxs)(Fz,{children:[n&&(0,F.jsx)(Pz,{"aria-label":`Delete`,onMouseDown:e=>s?.(e),children:(0,F.jsx)(Dz,{})}),c&&(0,F.jsx)(Mz,{doneButtonRef:o,onClick:l})]})]})}var Lz=`toolbarOpenedChanged`,Rz=(e,t)=>{let n=!!t;e._toolbarOpened!==n&&(e._toolbarOpened=n,e?.view&&e?.state?.tr&&e.view.dispatch(e.state.tr.setMeta(Lz,!0)))},zz=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s}=o,{respAreaToolbar:c,error:l}=i,u=r(),[d,f]=(0,N.useState)(!1),p=c([n,u],t,()=>{}),m=(0,N.useRef)(null),h;if(l){let e=l(),t=parseInt(o.index,10);h=!!e?.[t]?.[0]}return(0,N.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&f(a):f(a)},[t,n,a]),(0,N.useEffect)(()=>{let e=e=>{!(e.target.closest(`.insert-character-dialog`)||e.target.closest(`[data-toolbar-for]`))&&m.current&&!m.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&f(!1)};return d?document.addEventListener(`mousedown`,e):document.removeEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,F.jsxs)(rS,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline-flex`,minHeight:`55px`,position:`relative`,cursor:`pointer`},children:[(0,F.jsx)(`div`,{...o,style:{display:`inline-flex`,width:`100%`,minHeight:`46px`,height:`46px`,backgroundColor:`#FFF`,border:`1px solid ${h?`red`:`#C0C3CF`}`,boxSizing:`border-box`,borderRadius:`4px`,overflow:`hidden`,padding:`12px 21px`,margin:`0 4px`,minWidth:`178px`,visibility:d?`hidden`:`visible`},onClick:()=>f(!0),dangerouslySetInnerHTML:{__html:s||`<div>&nbsp;</div>`}}),d&&(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`div`,{ref:m,className:`absolute z-50 bg-white shadow-lg rounded p-2`,style:{zIndex:1},children:(0,F.jsx)(p,{})}),t._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(Iz,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),Rz(t,!1),t.view.dispatch(e),f(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};zz.propTypes={attributes:p.object,error:p.any,value:p.string,isFocused:p.bool};var Bz=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Vz(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Hz(e){return`nodeType`in e}function Uz(e){return e?Vz(e)?e:Hz(e)?e.ownerDocument?.defaultView??window:window:window}function Wz(e){let{Document:t}=Uz(e);return e instanceof t}function Gz(e){return!Vz(e)&&e instanceof Uz(e).HTMLElement}function Kz(e){return e instanceof Uz(e).SVGElement}function qz(e){return e?Vz(e)?e.document:Hz(e)?Wz(e)?e:Gz(e)||Kz(e)?e.ownerDocument:document:document:document}var Jz=Bz?N.useLayoutEffect:N.useEffect;function Yz(e){let t=(0,N.useRef)(e);return Jz(()=>{t.current=e}),(0,N.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}function Xz(e,t){t===void 0&&(t=[e]);let n=(0,N.useRef)(e);return Jz(()=>{n.current!==e&&(n.current=e)},t),n}function Zz(e){let t=Yz(e),n=(0,N.useRef)(null);return[n,(0,N.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var Qz={};function $z(e,t){return(0,N.useMemo)(()=>{if(t)return t;let n=Qz[e]==null?0:Qz[e]+1;return Qz[e]=n,e+`-`+n},[e,t])}function eB(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var tB=eB(1),nB=eB(-1);function rB(e){return`clientX`in e&&`clientY`in e}function iB(e){if(!e)return!1;let{KeyboardEvent:t}=Uz(e.target);return t&&e instanceof t}function aB(e){if(!e)return!1;let{TouchEvent:t}=Uz(e.target);return t&&e instanceof t}function oB(e){if(aB(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return rB(e)?{x:e.clientX,y:e.clientY}:null}var sB;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(sB||={});function cB(){}var lB=Object.freeze({x:0,y:0});function uB(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dB(e,t,n){let r=uB(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var fB={ignoreTransform:!1};function pB(e,t){t===void 0&&(t=fB);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Uz(e).getComputedStyle(e);t&&(n=dB(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function mB(e,t){return t===void 0&&(t=Uz(e).getComputedStyle(e)),t.position===`fixed`}function hB(e,t){t===void 0&&(t=Uz(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function gB(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Wz(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Gz(i)||Kz(i)||n.includes(i))return n;let a=Uz(e).getComputedStyle(i);return i!==e&&hB(i,a)&&n.push(i),mB(i,a)?n:r(i.parentNode)}return e?r(e):n}function _B(e){let[t]=gB(e,1);return t??null}var vB;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(vB||={});function yB(e){return!Bz||!e?!1:e===document.scrollingElement}function bB(e){let t={x:0,y:0},n=yB(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}function xB(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function SB(e,t){if(t===void 0&&(t=pB),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);_B(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var CB=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function wB(e){let{EventTarget:t}=Uz(e);return e instanceof t?e:qz(e)}function TB(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var EB;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(EB||={});function DB(e){e.preventDefault()}function OB(e){e.stopPropagation()}var kB;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(kB||={});var AB={start:[kB.Space,kB.Enter],cancel:[kB.Esc],end:[kB.Space,kB.Enter,kB.Tab]},jB=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case kB.Right:return{...n,x:n.x+25};case kB.Left:return{...n,x:n.x-25};case kB.Down:return{...n,y:n.y+25};case kB.Up:return{...n,y:n.y-25}}},MB=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new CB(qz(t)),this.windowListeners=new CB(Uz(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(EB.Resize,this.handleCancel),this.windowListeners.add(EB.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(EB.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&SB(n),t(lB)}handleKeyDown(e){if(iB(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=AB,coordinateGetter:a=jB,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:lB;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=nB(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=bB(n),p=xB(n),m={x:Math.min(i===kB.Right?p.right-p.width/2:p.right,Math.max(i===kB.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===kB.Down?p.bottom-p.height/2:p.bottom,Math.max(i===kB.Down?p.top:p.top+p.height/2,u.y))},h=i===kB.Right&&!s||i===kB.Left&&!c,g=i===kB.Down&&!l||i===kB.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===kB.Right&&e<=d.x||i===kB.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===kB.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===kB.Down&&e<=d.y||i===kB.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===kB.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,tB(nB(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};MB.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=AB,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function NB(e){return!!(e&&`distance`in e)}function PB(e){return!!(e&&`delay`in e)}var FB=class{constructor(e,t,n){n===void 0&&(n=wB(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=qz(i),this.documentListeners=new CB(this.document),this.listeners=new CB(n),this.windowListeners=new CB(Uz(i)),this.initialCoordinates=oB(r)??lB,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(EB.Resize,this.handleCancel),this.windowListeners.add(EB.DragStart,DB),this.windowListeners.add(EB.VisibilityChange,this.handleCancel),this.windowListeners.add(EB.ContextMenu,DB),this.documentListeners.add(EB.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(PB(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(NB(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(EB.Click,OB,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(EB.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=oB(e)??lB,s=nB(n,o);if(!t&&a){if(NB(a)){if(a.tolerance!=null&&TB(s,a.tolerance))return this.handleCancel();if(TB(s,a.distance))return this.handleStart()}if(PB(a)&&TB(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===kB.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},IB={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},LB=class extends FB{constructor(e){let{event:t}=e,n=qz(t.target);super(e,IB,n)}};LB.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var RB={move:{name:`mousemove`},end:{name:`mouseup`}},zB;(function(e){e[e.RightClick=2]=`RightClick`})(zB||={});var BB=class extends FB{constructor(e){super(e,RB,qz(e.event.target))}};BB.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zB.RightClick?!1:(r?.({event:n}),!0)}}];var VB={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},HB=class extends FB{constructor(e){super(e,VB)}static setup(){return window.addEventListener(VB.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(VB.move.name,e)};function e(){}}};HB.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var UB;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(UB||={});var WB;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(WB||={}),vB.Backward,vB.Forward,vB.Backward,vB.Forward;var GB;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(GB||={});var KB;(function(e){e.Optimized=`optimized`})(KB||={});function qB(e){let{callback:t,disabled:n}=e,r=Yz(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function JB(e,t){return(0,N.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}GB.WhileDragging,KB.Optimized;var YB={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:cB,draggableNodes:new Map,over:null,measureDroppableContainers:cB},XB=(0,N.createContext)(YB),ZB=(0,N.createContext)({...lB,scaleX:1,scaleY:1}),QB;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(QB||={});var $B=(0,N.createContext)(null),eV=`button`,tV=`Draggable`;function nV(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=$z(tV),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,N.useContext)(XB),{role:p=eV,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,N.useContext)(g?ZB:$B),[v,y]=Zz(),[b,x]=Zz(),S=JB(o,t),C=Xz(n);return Jz(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,N.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===eV?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}var rV=`Droppable`,iV={timeout:25};function aV(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=$z(rV),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,N.useContext)(XB),u=(0,N.useRef)({disabled:n}),d=(0,N.useRef)(!1),f=(0,N.useRef)(null),p=(0,N.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...iV,...i},_=Xz(h??r),v=qB({callback:(0,N.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Zz((0,N.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Xz(t);return(0,N.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,N.useEffect)(()=>(s({type:sB.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:sB.UnregisterDroppable,key:a,id:r})),[r]),(0,N.useEffect)(()=>{n!==u.current.disabled&&(s({type:sB.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}var oV=e=>typeof e==`string`?e:typeof e==`number`?`${e}px`:`30px`,sV=({size:e,children:t})=>(e=oV(e),(0,F.jsx)(`div`,{style:{height:e,width:e,display:`inline-block`,position:`relative`},children:t}));sV.propTypes={size:p.number,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired};var cV=({size:e,children:t,sx:n})=>(0,F.jsx)(sV,{size:e,children:(0,F.jsx)(`svg`,{preserveAspectRatio:`xMinYMin meet`,viewBox:`0 0 44 40`,style:{enableBackground:`new 0 0 44 40`,...n},children:t})});cV.propTypes={size:p.oneOfType([p.string,p.number]),children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,sx:p.object};var lV=({fill:e})=>(0,F.jsx)(`polygon`,{points:`17.4,26.9 10.1,20.6 12.8,17.5 16.3,20.5 22.3,9.7 25.9,11.7`,fill:e});lV.propTypes={fill:p.string.isRequired};var uV=({fill:e})=>(0,F.jsx)(`polygon`,{transform:`translate(2, 0)`,points:`34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3`,fill:e});uV.propTypes={fill:p.string.isRequired};var dV=({fill:e})=>(0,F.jsx)(`path`,{transform:`translate(1, 0)`,d:`M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z`,fill:e});dV.propTypes={fill:p.string.isRequired};var fV=({fill:e})=>(0,F.jsx)(`circle`,{transform:`translate(-3,0)`,cx:`23`,cy:`20.4`,r:`16`,fill:e});fV.propTypes={fill:p.string.isRequired};var pV=({fill:e})=>(0,F.jsx)(`rect`,{x:`3.6`,y:`4.1`,width:`32`,height:`32`,fill:e});pV.propTypes={fill:p.string.isRequired};var mV=(e,t)=>{class n extends N.Component{static propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,size:p.oneOfType([p.number,p.string]),fg:p.string,bg:p.string};static defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,size:30,fg:`#4aaf46`,bg:`#f8ffe2`};render(){let{iconSet:n,shape:r,category:i,open:a,size:o,fg:s,bg:c}=this.props,l=n===`check`?(0,F.jsx)(e,{fill:s}):(0,F.jsx)(t,{fill:s}),u=n===`check`?(0,F.jsx)(e,{fill:c}):(0,F.jsx)(t,{fill:c});return a?(0,F.jsx)(cV,{size:o,children:u}):(0,F.jsxs)(cV,{size:o,children:[i===`feedback`?r===`round`?(0,F.jsx)(dV,{fill:c}):(0,F.jsx)(uV,{fill:c}):r===`round`?(0,F.jsx)(fV,{fill:c}):(0,F.jsx)(pV,{fill:c}),l]})}}return n},hV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(1, 0)`,children:[(0,F.jsx)(`path`,{d:`M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2
315
+ c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z`,fill:e}),(0,F.jsx)(`rect`,{x:`21.1`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.7`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e})]});hV.propTypes={fill:p.string.isRequired};var gV=({fill:e,x:t=0,y:n=0})=>(0,F.jsx)(`polygon`,{transform:`translate(${t}, ${n})`,points:`19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4`,fill:e});gV.propTypes={fill:p.string.isRequired,x:p.number,y:p.number};var _V=mV(gV,hV);_V.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},_V.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#f8ffe2`,size:30};var vV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(0.5, 0.5)`,children:[(0,F.jsx)(`rect`,{x:`11`,y:`17.3`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)`,width:`16.6`,height:`3.7`,fill:e}),(0,F.jsx)(`rect`,{x:`17.4`,y:`10.7`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)`,width:`3.7`,height:`16.6`,fill:e})]});vV.propTypes={fill:p.string.isRequired};var yV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(1,0)`,children:[(0,F.jsx)(`rect`,{x:`21`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.7`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,F.jsx)(`rect`,{x:`12.2`,y:`22.5`,width:`13`,height:`3.3`,fill:e})]});yV.propTypes={fill:p.string.isRequired};var bV=mV(vV,yV);bV.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},bV.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#fcb733`,bg:`#fbf2e3`,size:30};var xV=({fill:e})=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`rect`,{x:`19.3`,y:`10.3`,width:`4.5`,height:`12.7`,fill:e}),(0,F.jsx)(`rect`,{x:`19.3`,y:`26.2`,width:`4.5`,height:`4.5`,fill:e})]});xV.propTypes={fill:p.string.isRequired};var SV=({fill:e})=>(0,F.jsx)(`polygon`,{points:`14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5`,fill:e});SV.propTypes={fill:p.string.isRequired};var CV=({fill:e})=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`rect`,{x:`23.8`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,F.jsx)(`rect`,{x:`16`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,F.jsx)(`path`,{d:`M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0
316
+ C25.7,26.4,25,27.1,24.2,27.1z`,fill:e})]});CV.propTypes={fill:p.string.isRequired};var wV=class extends N.Component{constructor(e){super(e);let{fg:t=`#464146`,bg:n=`white`}=this.props;this.icons={check:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(xV,{fill:t})]}),emoji:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(CV,{fill:t})]}),feedback:{check:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(CV,{fill:t})]}),emoji:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(CV,{fill:t})]}),square:{check:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(xV,{fill:t})]}),emoji:(0,F.jsxs)(cV,{children:[(0,F.jsx)(SV,{fill:n}),(0,F.jsx)(CV,{fill:t})]}),open:{check:(0,F.jsx)(cV,{children:(0,F.jsx)(xV,{fill:n})}),emoji:(0,F.jsx)(cV,{children:(0,F.jsx)(CV,{fill:n})})}}}}}render(){let{iconSet:e,category:t,shape:n,open:r}=this.props;return t===void 0?this.icons[e]:n===void 0?this.icons.feedback[e]:r===!0?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}};wV.propTypes={iconSet:p.oneOf([`emoji`,`check`,void 0]),shape:p.oneOf([`square`,void 0]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string},wV.defaultProps={iconSet:`check`,shape:void 0,category:void 0,open:!1,fg:`#464146`,bg:`white`};var TV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(0, 0)`,children:[(0,F.jsx)(`polygon`,{points:`27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6`,fill:e}),(0,F.jsx)(`polygon`,{points:`16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3`,fill:e})]});TV.propTypes={fill:p.string.isRequired};var EV=({fill:e})=>(0,F.jsxs)(`g`,{transform:`translate(2, 0)`,children:[(0,F.jsx)(`rect`,{x:`20.6`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,F.jsx)(`rect`,{x:`11.5`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,F.jsx)(`rect`,{x:`10.9`,y:`22.9`,transform:`matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)`,width:`14.3`,height:`3.7`,fill:e})]});EV.propTypes={fill:p.string.isRequired};var DV=mV(TV,EV);DV.propTypes={iconSet:p.oneOf([`emoji`,`check`]),shape:p.oneOf([`round`,`square`]),category:p.oneOf([`feedback`,void 0]),open:p.bool,fg:p.string,bg:p.string,size:p.oneOfType([p.string,p.number])},DV.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#c1e1ac`,size:30};function OV(e){return typeof e==`string`}function kV(e){return e?.ref||null}var AV=e=>e.scrollTop;function jV(e,t){return n=>{if(t){let r=e.current;n===void 0?t(r):t(r,n)}}}function MV(e,t,n,r,i,a){let o=e===`exited`&&!t?r:n[e]||n.exited;return i||a?{...o,...i,...a}:o}function NV(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n==`number`?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r==`object`?r[t.mode]:r),delay:i.transitionDelay}}function PV(e){return`scale(${e}, ${e**2})`}var FV={entering:{opacity:1,transform:PV(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:PV(.75)},exited:{opacity:0,transform:PV(.75)}},IV={opacity:0,transform:PV(.75),visibility:`hidden`},LV=N.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:a,in:o,onEnter:s,onEntered:c,onEntering:l,onExit:u,onExited:d,onExiting:f,style:p,timeout:m=`auto`,...h}=e,g=qR(),_=N.useRef(),v=Mo(),y=N.useRef(null),b=oR(y,kV(i),t),x=jV(y,l),S=jV(y,(e,t)=>{AV(e);let{duration:n,delay:r,easing:i}=NV({style:p,timeout:m,easing:a},{mode:`enter`}),o;m===`auto`?(o=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=o):o=n,e.style.transition=[v.transitions.create(`opacity`,{duration:o,delay:r}),v.transitions.create(`transform`,{duration:o*.666,delay:r,easing:i})].join(`,`),s&&s(e,t)}),C=jV(y,c),w=jV(y,f),T=jV(y,e=>{let{duration:t,delay:n,easing:r}=NV({style:p,timeout:m,easing:a},{mode:`exit`}),i;m===`auto`?(i=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=i):i=t,e.style.transition=[v.transitions.create(`opacity`,{duration:i,delay:n}),v.transitions.create(`transform`,{duration:i*.666,delay:n||i*.333,easing:r})].join(`,`),e.style.opacity=0,e.style.transform=PV(.75),u&&u(e)}),E=jV(y,e=>{e.style.transition=``,d&&d(e)});return(0,F.jsx)(AR,{appear:r,in:o,nodeRef:y,onEnter:S,onEntered:C,onEntering:x,onExit:T,onExited:E,onExiting:w,addEndListener:e=>{m===`auto`&&g.start(_.current||0,e),n&&n(y.current,e)},timeout:m===`auto`?null:m,...h,children:(e,{ownerState:t,...n})=>{let r=MV(e,o,FV,IV,p,i.props.style);return N.cloneElement(i,{style:r,ref:b,...n})}})});LV&&(LV.muiSupportAuto=!0);function RV(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function zV(e){let t=JL(e);return t.body===e?XL(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function BV(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function VV(e){return parseFloat(XL(e).getComputedStyle(e).paddingRight)||0}function HV(e){let t=[`TEMPLATE`,`SCRIPT`,`STYLE`,`LINK`,`MAP`,`META`,`NOSCRIPT`,`PICTURE`,`COL`,`COLGROUP`,`PARAM`,`SLOT`,`SOURCE`,`TRACK`].includes(e.tagName),n=e.tagName===`INPUT`&&e.getAttribute(`type`)===`hidden`;return t||n}function UV(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!HV(e);t&&n&&BV(e,i)})}function WV(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function GV(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(zV(r)){let e=RV(XL(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${VV(r)+e}px`;let t=JL(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${VV(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=JL(r).body;else{let t=r.parentElement,n=XL(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function KV(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var qV=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&BV(e.modalRef,!1);let r=KV(t);UV(t,e.mount,e.modalRef,r,!0);let i=WV(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=WV(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=GV(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=WV(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&BV(e.modalRef,t),UV(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&BV(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function JV(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}var YV=JV;function XV(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var ZV=XV,QV=`data-mui-focusable`;function $V(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${QV}]`):null}var eH=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function tH(e){let t=parseInt(e.getAttribute(`tabindex`)||``,10);return Number.isNaN(t)?e.contentEditable===`true`||(e.nodeName===`AUDIO`||e.nodeName===`VIDEO`||e.nodeName===`DETAILS`)&&e.getAttribute(`tabindex`)===null?0:e.tabIndex:t}function nH(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function rH(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||nH(e))}function iH(e){let t=[],n=[];return Array.from(e.querySelectorAll(eH)).forEach((e,r)=>{let i=tH(e);i===-1||!rH(e)||(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function aH(){return!0}function oH(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=iH,isEnabled:o=aH,open:s}=e,c=N.useRef(!1),l=N.useRef(null),u=N.useRef(null),d=N.useRef(null),f=N.useRef(null),p=N.useRef(!1),m=N.useRef(null),h=aR(kV(t),m),g=N.useRef(null);N.useEffect(()=>{!s||!m.current||(p.current=!n)},[n,s]),N.useEffect(()=>{if(c.current=!1,!s||!m.current)return;let e=ZV(JL(m.current)),t=$V(m.current)??m.current;return YV(m.current,e)||(t.hasAttribute(`tabIndex`)||t.setAttribute(`tabIndex`,`-1`),p.current&&t.focus()),()=>{i||(d.current&&d.current.focus&&(c.current=!0,d.current.focus()),d.current=null)}},[s]),N.useEffect(()=>{if(!s||!m.current)return;let e=JL(m.current),t=t=>{g.current=t,!(r||!o()||t.key!==`Tab`)&&ZV(e)===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=m.current;if(t===null)return;let n=ZV(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(YV(t,n)||r&&n!==l.current&&n!==u.current)return;if(n!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let i=[];if((n===l.current||n===u.current)&&(i=a(m.current)),i.length>0){let e=!!(g.current?.shiftKey&&g.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=ZV(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let _=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0,f.current=e.target;let n=t.props.onFocus;n&&n(e)},v=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0};return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:l,"data-testid":`sentinelStart`}),N.cloneElement(t,{ref:h,onFocus:_}),(0,F.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:u,"data-testid":`sentinelEnd`})]})}function sH(e){return typeof e==`function`?e():e}var cH=N.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=N.useState(null),s=aR(N.isValidElement(n)?kV(n):null,t);if(fi(()=>{i||o(sH(r)||document.body)},[r,i]),fi(()=>{if(a&&!i)return QL(t,a),()=>{QL(t,null)}},[t,a,i]),i){if(N.isValidElement(n)){let e={ref:s};return N.cloneElement(n,e)}return n}return a&&Rx.createPortal(n,a)});function lH(e,t,n){return e===void 0||OV(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function uH(e,t,n){return typeof e==`function`?e(t,n):e}function dH(e,t=[]){if(e===void 0)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]==`function`&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function fH(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function pH(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=k(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=dH({...i,...r}),s=fH(r),c=fH(i),l=t(o),u=k(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function mH(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=uH(d[e],i),{props:{component:h,...g},internalRef:_}=pH({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=aR(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,lH(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}var hH={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},gH={opacity:0,visibility:`hidden`},_H=N.forwardRef(function(e,t){let n=Mo(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:o,easing:s,in:c,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:p,onExiting:m,style:h,timeout:g=r,..._}=e,v=N.useRef(null),y=oR(v,kV(o),t),b=jV(v,d),x=jV(v,(e,t)=>{AV(e);let r=NV({style:h,timeout:g,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),S=jV(v,u),C=jV(v,m),w=jV(v,e=>{let t=NV({style:h,timeout:g,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),f&&f(e)}),T=jV(v,e=>{e.style.transition=``,p&&p(e)});return(0,F.jsx)(AR,{appear:a,in:c,nodeRef:v,onEnter:x,onEntered:S,onEntering:b,onExit:w,onExited:T,onExiting:C,addEndListener:e=>{i&&i(v.current,e)},timeout:g,..._,children:(e,{ownerState:t,...n})=>{let r=MV(e,c,hH,gH,h,o.props.style);return N.cloneElement(o,{style:r,ref:y,...n})}})});function vH(e){return Zr(`MuiBackdrop`,e)}Qr(`MuiBackdrop`,[`root`,`invisible`]);var yH=e=>{let{classes:t,invisible:n}=e;return A({root:[`root`,n&&`invisible`]},vH,t)},bH=L(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:`fixed`,display:`flex`,alignItems:`center`,justifyContent:`center`,right:0,bottom:0,top:0,left:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,WebkitTapHighlightColor:`transparent`,variants:[{props:{invisible:!0},style:{backgroundColor:`transparent`}}]}),xH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiBackdrop`}),{children:r,className:i,component:a=`div`,invisible:o=!1,open:s,components:c={},componentsProps:l={},slotProps:u={},slots:d={},TransitionComponent:f,transitionDuration:p,...m}=n,h={...n,component:a,invisible:o},g=yH(h),_={component:a,slots:{transition:f,root:c.Root,...d},slotProps:{...l,...u}},[v,y]=mH(`root`,{elementType:bH,externalForwardedProps:_,className:k(g.root,i),ownerState:h}),[b,x]=mH(`transition`,{elementType:_H,externalForwardedProps:_,ownerState:h});return(0,F.jsx)(b,{in:s,timeout:p,...m,...x,children:(0,F.jsx)(v,{"aria-hidden":!0,...y,ref:t,children:r})})});function SH(e){return typeof e==`function`?e():e}function CH(e){return e?e.props.hasOwnProperty(`in`):!1}var wH=()=>{},TH=new qV;function EH(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:o,children:s,onClose:c,open:l,rootRef:u}=e,d=N.useRef({}),f=N.useRef(null),p=N.useRef(null),m=aR(p,u),[h,g]=N.useState(!l),_=CH(s),v=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(v=!1);let y=()=>JL(f.current),b=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),x=()=>{TH.mount(b(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},S=rR(()=>{let e=SH(t)||y().body;TH.add(b(),e),p.current&&x()}),C=()=>TH.isTopModal(b()),w=rR(e=>{f.current=e,e&&(l&&C()?x():p.current&&BV(p.current,v))}),T=N.useCallback(()=>{TH.remove(b(),v)},[v]);N.useEffect(()=>()=>{T()},[T]),N.useEffect(()=>{l?S():(!_||!i)&&T()},[l,T,_,i,S]);let E=e=>t=>{e.onKeyDown?.(t),!(t.key!==`Escape`||t.which===229||!C())&&(n||(t.stopPropagation(),c&&c(t,`escapeKeyDown`)))},D=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=dH(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:E(r),ref:m}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:D(t),open:l}},getTransitionProps:()=>({onEnter:zL(()=>{g(!1),a&&a()},s?.props.onEnter??wH),onExited:zL(()=>{g(!0),o&&o(),i&&T()},s?.props.onExited??wH)}),rootRef:m,portalRef:w,isTopModal:C,exited:h,hasTransition:_}}function DH(e){return Zr(`MuiModal`,e)}Qr(`MuiModal`,[`root`,`hidden`,`backdrop`]);var OH=e=>{let{open:t,exited:n,classes:r}=e;return A({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},DH,r)},kH=L(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Ro(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),AH=L(xH,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),jH=N.forwardRef(function(e,t){let n=zo({name:`MuiModal`,props:e}),{BackdropComponent:r=AH,BackdropProps:i,classes:a,className:o,closeAfterTransition:s=!1,children:c,container:l,component:u,components:d={},componentsProps:f={},disableAutoFocus:p=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:h=!1,disablePortal:g=!1,disableRestoreFocus:_=!1,disableScrollLock:v=!1,hideBackdrop:y=!1,keepMounted:b=!1,onClose:x,onTransitionEnter:S,onTransitionExited:C,open:w,slotProps:T={},slots:E={},theme:D,...O}=n,A={...n,closeAfterTransition:s,disableAutoFocus:p,disableEnforceFocus:m,disableEscapeKeyDown:h,disablePortal:g,disableRestoreFocus:_,disableScrollLock:v,hideBackdrop:y,keepMounted:b},{getRootProps:j,getBackdropProps:M,getTransitionProps:ee,portalRef:te,isTopModal:ne,exited:re,hasTransition:ie}=EH({...A,rootRef:t}),P={...A,exited:re},ae=OH(P),oe={};if(c.props.tabIndex===void 0&&(oe.tabIndex=`-1`),ie){let{onEnter:e,onExited:t}=ee();oe.onEnter=e,oe.onExited=t}let se={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...T}},[ce,le]=mH(`root`,{ref:t,elementType:kH,externalForwardedProps:{...se,...O,component:u},getSlotProps:j,ownerState:P,className:k(o,ae?.root,!P.open&&P.exited&&ae?.hidden)}),[ue,de]=mH(`backdrop`,{ref:i?.ref,elementType:r,externalForwardedProps:se,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>M({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:k(i?.className,ae?.backdrop),ownerState:P});return!b&&!w&&(!ie||re)?null:(0,F.jsx)(cH,{ref:te,container:l,disablePortal:g,children:(0,F.jsxs)(ce,{...le,children:[!y&&r?(0,F.jsx)(ue,{...de}):null,(0,F.jsx)(oH,{disableEnforceFocus:m,disableAutoFocus:p,disableRestoreFocus:_,isEnabled:ne,open:w,children:N.cloneElement(c,oe)})]})})});function MH(e){return Zr(`MuiPaper`,e)}Qr(`MuiPaper`,`root.rounded.outlined.elevation.elevation0.elevation1.elevation2.elevation3.elevation4.elevation5.elevation6.elevation7.elevation8.elevation9.elevation10.elevation11.elevation12.elevation13.elevation14.elevation15.elevation16.elevation17.elevation18.elevation19.elevation20.elevation21.elevation22.elevation23.elevation24`.split(`.`));var NH=e=>{let{square:t,elevation:n,variant:r,classes:i}=e;return A({root:[`root`,r,!t&&`rounded`,r===`elevation`&&`elevation${n}`]},MH,i)},PH=L(`div`,{name:`MuiPaper`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant===`elevation`&&t[`elevation${n.elevation}`]]}})(Ro(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create(`box-shadow`),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:`outlined`},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:`elevation`},style:{boxShadow:`var(--Paper-shadow)`,backgroundImage:`var(--Paper-overlay)`}}]}))),FH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiPaper`}),r=Mo(),{className:i,component:a=`div`,elevation:o=1,square:s=!1,variant:c=`elevation`,...l}=n,u={...n,component:a,elevation:o,square:s,variant:c},d=NH(u);return(0,F.jsx)(PH,{as:a,ownerState:u,className:k(d.root,i),ref:t,...l,style:{...c===`elevation`&&{"--Paper-shadow":(r.vars||r).shadows[o],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[o]},...!r.vars&&r.palette.mode===`dark`&&{"--Paper-overlay":`linear-gradient(${Ci(`#fff`,fo(o))}, ${Ci(`#fff`,fo(o))})`}},...l.style}})});function IH(e){return Zr(`MuiPopover`,e)}Qr(`MuiPopover`,[`root`,`paper`]);function LH(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.height/2:t===`bottom`&&(n=e.height),n}function RH(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.width/2:t===`right`&&(n=e.width),n}function zH(e){return[e.horizontal,e.vertical].map(e=>typeof e==`number`?`${e}px`:e).join(` `)}function BH(e){return typeof e==`function`?e():e}var VH=e=>{let{classes:t}=e;return A({root:[`root`],paper:[`paper`]},IH,t)},HH=L(jH,{name:`MuiPopover`,slot:`Root`})({}),UH=L(FH,{name:`MuiPopover`,slot:`Paper`})({position:`absolute`,overflowY:`auto`,overflowX:`hidden`,minWidth:16,minHeight:16,maxWidth:`calc(100% - 32px)`,maxHeight:`calc(100% - 32px)`,outline:0}),WH=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiPopover`}),{action:r,anchorEl:i,anchorOrigin:a={vertical:`top`,horizontal:`left`},anchorPosition:o,anchorReference:s=`anchorEl`,children:c,className:l,container:u,elevation:d=8,marginThreshold:f=16,open:p,PaperProps:m={},slots:h={},slotProps:g={},transformOrigin:_={vertical:`top`,horizontal:`left`},TransitionComponent:v,transitionDuration:y=`auto`,TransitionProps:b={},disableScrollLock:x=!1,...S}=n,C=N.useRef(),w={...n,anchorOrigin:a,anchorReference:s,elevation:d,marginThreshold:f,transformOrigin:_,TransitionComponent:v,transitionDuration:y,TransitionProps:b},T=VH(w),E=N.useCallback(()=>{if(s===`anchorPosition`)return o;let e=BH(i),t=(e&&e.nodeType===1?e:YL(C.current).body).getBoundingClientRect();return{top:t.top+LH(t,a.vertical),left:t.left+RH(t,a.horizontal)}},[i,a.horizontal,a.vertical,o,s]),D=N.useCallback(e=>({vertical:LH(e,_.vertical),horizontal:RH(e,_.horizontal)}),[_.horizontal,_.vertical]),O=N.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=D(t);if(s===`none`)return{top:null,left:null,transformOrigin:zH(n)};let r=E(),a=r.top-n.vertical,o=r.left-n.horizontal,c=a+t.height,l=o+t.width,u=ZL(BH(i)),d=u.innerHeight-f,p=u.innerWidth-f;if(f!==null&&a<f){let e=a-f;a-=e,n.vertical+=e}else if(f!==null&&c>d){let e=c-d;a-=e,n.vertical+=e}if(f!==null&&o<f){let e=o-f;o-=e,n.horizontal+=e}else if(l>p){let e=l-p;o-=e,n.horizontal+=e}return{top:`${Math.round(a)}px`,left:`${Math.round(o)}px`,transformOrigin:zH(n)}},[i,s,E,D,f]),[A,j]=N.useState(p),M=N.useCallback(()=>{let e=C.current;if(!e)return;let t=O(e);t.top!==null&&e.style.setProperty(`top`,t.top),t.left!==null&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,j(!0)},[O]);N.useEffect(()=>(x&&window.addEventListener(`scroll`,M),()=>window.removeEventListener(`scroll`,M)),[i,x,M]);let ee=()=>{M()},te=()=>{j(!1)};N.useEffect(()=>{p&&M()}),N.useImperativeHandle(r,()=>p?{updatePosition:()=>{M()}}:null,[p,M]),N.useEffect(()=>{if(!p)return;let e=KL(()=>{M()}),t=ZL(BH(i));return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[i,p,M]);let ne=y,re={slots:{transition:v,...h},slotProps:{transition:b,paper:m,...g}},[ie,P]=mH(`transition`,{elementType:LV,externalForwardedProps:re,ownerState:w,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),ee()},onExited:t=>{e.onExited?.(t),te()}}),additionalProps:{appear:!0,in:p}});y===`auto`&&!ie.muiSupportAuto&&(ne=void 0);let ae=u||(i?YL(BH(i)).body:void 0),[oe,{slots:se,slotProps:ce,...le}]=mH(`root`,{ref:t,elementType:HH,externalForwardedProps:{...re,...S},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:h.backdrop},slotProps:{backdrop:cR(typeof g.backdrop==`function`?g.backdrop(w):g.backdrop,{invisible:!0})},container:ae,open:p},ownerState:w,className:k(T.root,l)}),[ue,de]=mH(`paper`,{ref:C,className:T.paper,elementType:UH,externalForwardedProps:re,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:A?void 0:{opacity:0}},ownerState:w});return(0,F.jsx)(oe,{...le,...!OV(oe)&&{slots:se,slotProps:ce,disableScrollLock:x},children:(0,F.jsx)(ie,{...P,timeout:ne,children:(0,F.jsx)(ue,{...de,children:c})})})}),GH={50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`,A100:`#ff80ab`,A200:`#ff4081`,A400:`#f50057`,A700:`#c51162`},KH={50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`,A100:`#8c9eff`,A200:`#536dfe`,A400:`#3d5afe`,A700:`#304ffe`},qH=s({background:()=>vU,backgroundDark:()=>yU,black:()=>jU,blueGrey100:()=>zU,blueGrey300:()=>BU,blueGrey600:()=>VU,blueGrey900:()=>HU,border:()=>wU,borderDark:()=>EU,borderGray:()=>DU,borderLight:()=>TU,buttonBorder:()=>YU,buttonFocusOutline:()=>RU,buttonHoverBg:()=>XU,correct:()=>eU,correctSecondary:()=>tU,correctTertiary:()=>nU,correctWithIcon:()=>rU,defaults:()=>JH,disabled:()=>QH,disabledSecondary:()=>$H,dropdownBackground:()=>xU,fadedPrimary:()=>pU,focusChecked:()=>PU,focusCheckedBorder:()=>FU,focusUnchecked:()=>IU,focusUncheckedBorder:()=>LU,incorrect:()=>iU,incorrectSecondary:()=>oU,incorrectWithIcon:()=>aU,keyBoardFocusIndicator:()=>JU,keypadButton:()=>UU,keypadButtonHover:()=>KU,keypadButtonOperator:()=>WU,keypadButtonOperatorHover:()=>qU,keypadEmptyPlaceholder:()=>GU,missing:()=>sU,missingWithIcon:()=>cU,primary:()=>lU,primaryDark:()=>dU,primaryLight:()=>uU,primaryText:()=>fU,secondary:()=>mU,secondaryBackground:()=>bU,secondaryDark:()=>gU,secondaryLight:()=>hU,secondaryText:()=>_U,tableGrid:()=>OU,tableGridLight:()=>kU,tableStripe:()=>AU,tertiary:()=>SU,tertiaryLight:()=>CU,text:()=>ZH,transparent:()=>NU,v:()=>YH,visualElementsColors:()=>ZU,white:()=>MU}),JH={TEXT:`black`,DISABLED:`grey`,DISABLED_SECONDARY:`#ABABAB`,CORRECT:Da[500],CORRECT_SECONDARY:Da[50],CORRECT_TERTIARY:`#0EA449`,CORRECT_WITH_ICON:`#087D38`,INCORRECT:wa[500],INCORRECT_SECONDARY:Ca[50],INCORRECT_WITH_ICON:`#BF0D00`,MISSING:Ca[700],MISSING_WITH_ICON:`#6A78A1`,PRIMARY:KH[500],PRIMARY_LIGHT:KH[200],PRIMARY_DARK:KH[800],SECONDARY:GH.A400,SECONDARY_LIGHT:GH[200],SECONDARY_DARK:GH[900],TERTIARY:`#146EB3`,TERTIARY_LIGHT:`#D0E2F0`,BACKGROUND:`rgba(255,255,255,0)`,BACKGROUND_DARK:`#ECEDF1`,DROPDOWN_BACKGROUND:`#E0E1E6`,SECONDARY_BACKGROUND:`rgba(241,241,241,1)`,BORDER:`#9A9A9A`,BORDER_LIGHT:`#D1D1D1`,BORDER_DARK:`#646464`,BORDER_GRAY:`#7E8494`,TABLE_GRID:`black`,TABLE_GRID_LIGHT:`#dfe2e5`,TABLE_STRIPE:`#f6f8fa`,BLACK:`#000000`,WHITE:`#ffffff`,TRANSPARENT:`transparent`,FOCUS_CHECKED:`#BBDEFB`,FOCUS_CHECKED_BORDER:`#1565C0`,FOCUS_UNCHECKED:`#E0E0E0`,FOCUS_UNCHECKED_BORDER:`#757575`,BUTTON_FOCUS_OUTLINE:`#3B82F6`,BLUE_GREY100:`#F3F5F7`,BLUE_GREY300:`#C0C3CF`,BLUE_GREY600:`#7E8494`,BLUE_GREY900:`#152452`,FADED_PRIMARY:`#DCDAFB`,KEYPAD_BUTTON:`rgb(188, 194, 229)`,KEYPAD_BUTTON_OPERATOR:`rgb(255, 159, 192)`,KEYPAD_EMPTY_PLACEHOLDER:`rgba(245, 0, 87, 0.4)`,KEYPAD_BUTTON_HOVER:`rgb(214, 218, 239)`,KEYPAD_BUTTON_OPERATOR_HOVER:`rgb(255, 197, 217)`,KEY_BOARD_FOCUS_INDICATOR:`#2B87FF`,BUTTON_BORDER:`rgba(0, 0, 0, 0.23)`,BUTTON_HOVER_BG:`rgba(0, 0, 0, 0.08)`};Object.freeze(JH);var YH=e=>(...t)=>{let n=t.pop();return t.reduceRight((t,n)=>`var(--${e}-${n}, ${t})`,n)},XH=YH(`pie`),ZH=()=>XH(`text`,JH.TEXT),QH=()=>XH(`disabled`,JH.DISABLED),$H=()=>XH(`disabled-secondary`,JH.DISABLED_SECONDARY),eU=()=>XH(`correct`,JH.CORRECT),tU=()=>XH(`correct-secondary`,JH.CORRECT_SECONDARY),nU=()=>XH(`correct-tertiary`,JH.CORRECT_TERTIARY),rU=()=>XH(`correct-icon`,JH.CORRECT_WITH_ICON),iU=()=>XH(`incorrect`,JH.INCORRECT),aU=()=>XH(`incorrect-icon`,JH.INCORRECT_WITH_ICON),oU=()=>XH(`incorrect-secondary`,JH.INCORRECT_SECONDARY),sU=()=>XH(`missing`,JH.MISSING),cU=()=>XH(`missing-icon`,JH.MISSING_WITH_ICON),lU=()=>XH(`primary`,JH.PRIMARY),uU=()=>XH(`primary-light`,JH.PRIMARY_LIGHT),dU=()=>XH(`primary-dark`,JH.PRIMARY_DARK),fU=()=>XH(`primary-text`,`text`,JH.TEXT),pU=()=>XH(`faded-primary`,JH.FADED_PRIMARY),mU=()=>XH(`secondary`,JH.SECONDARY),hU=()=>XH(`secondary-light`,JH.SECONDARY_LIGHT),gU=()=>XH(`secondary-dark`,JH.SECONDARY_DARK),_U=()=>XH(`secondary-text`,`text`,JH.TEXT),vU=()=>XH(`background`,JH.BACKGROUND),yU=()=>XH(`background-dark`,JH.BACKGROUND_DARK),bU=()=>XH(`secondary-background`,JH.SECONDARY_BACKGROUND),xU=()=>XH(`dropdown-background`,JH.DROPDOWN_BACKGROUND),SU=()=>XH(`tertiary`,JH.TERTIARY),CU=()=>XH(`tertiary-light`,JH.TERTIARY_LIGHT),wU=()=>XH(`border`,JH.BORDER),TU=()=>XH(`border-light`,JH.BORDER_LIGHT),EU=()=>XH(`border-dark`,JH.BORDER_DARK),DU=()=>XH(`border-gray`,JH.BORDER_GRAY),OU=()=>XH(`table-grid`,`text`,JH.TABLE_GRID),kU=()=>XH(`table-grid-light`,`border-light`,JH.TABLE_GRID_LIGHT),AU=()=>XH(`table-stripe`,`background-dark`,JH.TABLE_STRIPE),jU=()=>XH(`black`,JH.BLACK),MU=()=>XH(`white`,JH.WHITE),NU=()=>JH.TRANSPARENT,PU=()=>XH(`focus-checked`,JH.FOCUS_CHECKED),FU=()=>XH(`focus-checked-border`,JH.FOCUS_CHECKED_BORDER),IU=()=>XH(`focus-unchecked`,JH.FOCUS_UNCHECKED),LU=()=>XH(`focus-unchecked-border`,JH.FOCUS_UNCHECKED_BORDER),RU=()=>XH(`button-focus-outline`,JH.BUTTON_FOCUS_OUTLINE),zU=()=>XH(`blue-grey-100`,JH.BLUE_GREY100),BU=()=>XH(`blue-grey-300`,JH.BLUE_GREY300),VU=()=>XH(`blue-grey-600`,JH.BLUE_GREY600),HU=()=>XH(`blue-grey-900`,JH.BLUE_GREY900),UU=()=>XH(`keypad-button`,JH.KEYPAD_BUTTON),WU=()=>XH(`keypad-button-operator`,JH.KEYPAD_BUTTON_OPERATOR),GU=()=>XH(`keypad-empty-placeholder`,JH.KEYPAD_EMPTY_PLACEHOLDER),KU=()=>XH(`keypad-button-hover`,JH.KEYPAD_BUTTON_HOVER),qU=()=>XH(`keypad-button-operator-hover`,JH.KEYPAD_BUTTON_OPERATOR_HOVER),JU=()=>XH(`keyboard-focus-indicator`,JH.KEY_BOARD_FOCUS_INDICATOR),YU=()=>XH(`button-border`,JH.BUTTON_BORDER),XU=()=>XH(`button-hover-bg`,JH.BUTTON_HOVER_BG),ZU={AXIS_LINE_COLOR:`#5A53C9`,ROLLOVER_FILL_BAR_COLOR:`#050F2D`,GRIDLINES_COLOR:`#8E88EA`,PLOT_FILL_COLOR:`#1463B3`,SHAPES_FILL_COLOR:`#7986cb`},QU=L(`div`)({transformOrigin:`0% 0px 0px`,width:`100%`,display:`block`,overflow:`hidden`,"&.incorrect":{color:`#946202`}}),$U=L(`div`)({WebkitFontSmoothing:`antialiased`,backgroundColor:`var(--feedback-bg-color, ${QH()})`,borderRadius:`4px`,lineHeight:`25px`,margin:`0px`,padding:`10px`,verticalAlign:`middle`,color:`var(--feedback-color, white)`,"&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${eU()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${iU()})`}}),eW=L(`div`)({"&.feedback-enter":{height:`1px`},"&.feedback-enter-active":{height:`45px`,transition:`height 500ms`},"&.feedback-exit":{height:`45px`},"&.feedback-exit-active":{height:`1px`,transition:`height 200ms`}}),tW=class extends N.Component{static propTypes={correctness:p.string,feedback:p.string};nodeRef=N.createRef();renderFeedback(){let{correctness:e,feedback:t}=this.props;return!e||!t?null:(0,F.jsx)(PR,{nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:`feedback`,children:(0,F.jsx)(eW,{ref:this.nodeRef,children:(0,F.jsx)(QU,{children:(0,F.jsx)($U,{className:e,dangerouslySetInnerHTML:{__html:t}})})})},`hasFeedback`)}render(){return(0,F.jsx)(`div`,{children:(0,F.jsx)(UR,{children:this.renderFeedback()})})}},nW=s({Correct:()=>cW,Incorrect:()=>lW,NothingSubmitted:()=>dW,PartiallyCorrect:()=>uW}),rW=D(`pie-libs:render-ui:response-indicators`),iW=L(`div`)(({hasFeedback:e})=>({cursor:e?`pointer`:`default`})),aW=L(WH)({cursor:`pointer`}),oW=L(`div`)({padding:`0`,borderRadius:`4px`}),sW=(e,t)=>{class n extends N.Component{constructor(e){super(e),this.state={}}handlePopoverOpen=e=>{rW(`[handlePopoverOpen]`,e.target),this.setState({anchorEl:e.target})};handlePopoverClose=()=>{this.setState({anchorEl:null})};render(){let{feedback:n}=this.props,{anchorEl:r}=this.state;return(0,F.jsxs)(iW,{hasFeedback:!!n,children:[(0,F.jsx)(`span`,{ref:e=>this.icon=e,onClick:this.handlePopoverOpen,children:(0,F.jsx)(e,{})}),n&&(0,F.jsx)(aW,{PaperComponent:oW,open:!!r,anchorEl:r,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:this.handlePopoverClose,children:(0,F.jsx)(tW,{feedback:n,correctness:t})})]})}}return n.propTypes={feedback:p.string},n},cW=sW(_V,`correct`),lW=sW(bV,`incorrect`),uW=sW(DV,`partially-correct`),dW=sW(wV,`nothing-submitted`);function fW(e){return Zr(`MuiCollapse`,e)}Qr(`MuiCollapse`,[`root`,`horizontal`,`vertical`,`entered`,`hidden`,`wrapper`,`wrapperInner`]);var pW=e=>{let{orientation:t,classes:n}=e;return A({root:[`root`,t],entered:[`entered`],hidden:[`hidden`],wrapper:[`wrapper`,t],wrapperInner:[`wrapperInner`,t]},fW,n)},mW=L(`div`,{name:`MuiCollapse`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.orientation],n.state===`entered`&&t.entered,n.state===`exited`&&!n.in&&n.collapsedSize===`0px`&&t.hidden]}})(Ro(({theme:e})=>({height:0,overflow:`hidden`,transition:e.transitions.create(`height`),variants:[{props:{orientation:`horizontal`},style:{height:`auto`,width:0,transition:e.transitions.create(`width`)}},{props:{state:`entered`},style:{height:`auto`,overflow:`visible`}},{props:{state:`entered`,orientation:`horizontal`},style:{width:`auto`}},{props:({ownerState:e})=>e.state===`exited`&&!e.in&&e.collapsedSize===`0px`,style:{visibility:`hidden`}}]}))),hW=L(`div`,{name:`MuiCollapse`,slot:`Wrapper`})({display:`flex`,width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),gW=L(`div`,{name:`MuiCollapse`,slot:`WrapperInner`})({width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),_W=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiCollapse`}),{addEndListener:r,children:i,className:a,collapsedSize:o=`0px`,component:s,easing:c,in:l,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:m,onExiting:h,orientation:g=`vertical`,slots:_={},slotProps:v={},style:y,timeout:b=eo.standard,TransitionComponent:x=AR,...S}=n,C={...n,orientation:g,collapsedSize:o},w=pW(C),T=Mo(),E=qR(),D=N.useRef(null),O=N.useRef(),A=typeof o==`number`?`${o}px`:o,j=g===`horizontal`,M=j?`width`:`height`,ee=N.useRef(null),te=oR(t,ee),ne=()=>D.current?D.current[j?`clientWidth`:`clientHeight`]:0,re=jV(ee,(e,t)=>{D.current&&j&&(D.current.style.position=`absolute`),e.style[M]=A,u&&u(e,t)}),ie=jV(ee,(e,t)=>{let n=ne();D.current&&j&&(D.current.style.position=``);let{duration:r,easing:i}=NV({style:y,timeout:b,easing:c},{mode:`enter`});if(b===`auto`){let t=T.transitions.getAutoHeightDuration(n);e.style.transitionDuration=`${t}ms`,O.current=t}else e.style.transitionDuration=typeof r==`string`?r:`${r}ms`;e.style[M]=`${n}px`,e.style.transitionTimingFunction=i,f&&f(e,t)}),P=jV(ee,(e,t)=>{e.style[M]=`auto`,d&&d(e,t)}),ae=jV(ee,e=>{e.style[M]=`${ne()}px`,p&&p(e)}),oe=jV(ee,m),se=jV(ee,e=>{let t=ne(),{duration:n,easing:r}=NV({style:y,timeout:b,easing:c},{mode:`exit`});if(b===`auto`){let n=T.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${n}ms`,O.current=n}else e.style.transitionDuration=typeof n==`string`?n:`${n}ms`;e.style[M]=A,e.style.transitionTimingFunction=r,h&&h(e)}),ce=e=>{b===`auto`&&E.start(O.current||0,e),r&&r(ee.current,e)},le={slots:_,slotProps:v,component:s},[ue,de]=mH(`root`,{ref:te,className:k(w.root,a),elementType:mW,externalForwardedProps:le,ownerState:C,additionalProps:{style:{[j?`minWidth`:`minHeight`]:A,...y}}}),[fe,pe]=mH(`wrapper`,{ref:D,className:w.wrapper,elementType:hW,externalForwardedProps:le,ownerState:C}),[me,he]=mH(`wrapperInner`,{className:w.wrapperInner,elementType:gW,externalForwardedProps:le,ownerState:C});return(0,F.jsx)(x,{in:l,onEnter:re,onEntered:P,onEntering:ie,onExit:ae,onExited:oe,onExiting:se,addEndListener:ce,nodeRef:ee,timeout:b===`auto`?null:b,...S,children:(e,{ownerState:t,...n})=>{let r={...C,state:e};return(0,F.jsx)(ue,{...de,className:k(de.className,{entered:w.entered,exited:!l&&A===`0px`&&w.hidden}[e]),ownerState:r,...n,children:(0,F.jsx)(fe,{...pe,ownerState:r,children:(0,F.jsx)(me,{...he,ownerState:r,children:i})})})}})});_W&&(_W.muiSupportAuto=!0);var vW=`https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js`,yW=null;function bW(e){return typeof window>`u`||window.MathJax?.typesetPromise?Promise.resolve():yW||(yW=new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s={loader:{load:i?[`a11y/assistive-mml`]:[]},tex:{packages:[`base`,`ams`,`autoload`],macros:{parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`}},options:{enableMenu:i,enableExplorer:i,enableAssistiveMml:i},startup:{ready:()=>{window.MathJax?.startup.defaultReady&&(window.MathJax.startup.defaultReady(),t())},defaultReady:()=>{}}};r&&s.tex&&(s.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],s.tex.processEscapes=!0),a||(s.chtml={fontURL:``}),window.MathJax=s;let c=document.createElement(`script`);c.src=o||vW,c.async=!0,c.onload=()=>{setTimeout(t,100)},c.onerror=()=>{n(Error(`Failed to load MathJax`))},document.head.appendChild(c)}),yW)}function xW(){let e=window.MathJax?.startup?.document;if(typeof e?.assistiveMml==`function`)try{e.assistiveMml().updateDocument?.()}catch(e){console.warn(`[mathjax-renderer] Failed to attach assistive MathML:`,e)}}function SW(e={}){return async t=>{if(await bW(e),!window.MathJax?.typesetPromise){console.warn(`[mathjax-renderer] MathJax not loaded or missing typesetPromise.`);return}await window.MathJax.typesetPromise([t]),xW()}}var CW=`@pie-lib/math-rendering`,wW=null;function TW(){return wW||=SW({accessibility:!0,useSingleDollar:!0}),wW}function EW(){if(typeof window>`u`)return null;let e=window[CW];return typeof e?.renderMath==`function`?e:null}var DW=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=EW();return r?await r.renderMath?.(n):await TW()(n),t?n.innerHTML:void 0},OW=e=>EW()?.wrapMath?.(e)??e,kW=L(`span`)(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:`pointer`})),AW=L(_W)(({theme:e})=>({paddingTop:e.spacing(2)})),jW=class extends N.Component{static propTypes={className:p.string,children:p.object,labels:p.shape({visible:p.string,hidden:p.string})};static defaultProps={labels:{}};state={expanded:!1};toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};componentDidMount(){DW(this.root)}componentDidUpdate(){DW(this.root)}render(){let{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||`Hide`:e.hidden||`Show`;return(0,F.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,F.jsx)(`div`,{onClick:this.toggleExpanded,children:(0,F.jsx)(kW,{children:r})}),(0,F.jsx)(AW,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})]})}};function MW(e){return Zr(`MuiButton`,e)}var NW=Qr(`MuiButton`,`root.text.textInherit.textPrimary.textSecondary.textSuccess.textError.textInfo.textWarning.outlined.outlinedInherit.outlinedPrimary.outlinedSecondary.outlinedSuccess.outlinedError.outlinedInfo.outlinedWarning.contained.containedInherit.containedPrimary.containedSecondary.containedSuccess.containedError.containedInfo.containedWarning.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.textSizeSmall.textSizeMedium.textSizeLarge.outlinedSizeSmall.outlinedSizeMedium.outlinedSizeLarge.containedSizeSmall.containedSizeMedium.containedSizeLarge.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.iconSizeSmall.iconSizeMedium.iconSizeLarge.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),PW=N.createContext({}),FW=N.createContext(void 0),IW=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=A({root:[`root`,o&&`loading`,a,`${a}${R(t)}`,`size${R(i)}`,`${a}Size${R(i)}`,`color${R(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${R(s)}`],startIcon:[`icon`,`startIcon`,`iconSize${R(i)}`],endIcon:[`icon`,`endIcon`,`iconSize${R(i)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},MW,c);return{...c,...l}},LW=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],RW=L(sz,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${R(n.color)}`],t[`size${R(n.size)}`],t[`${n.variant}Size${R(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${NW.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${NW.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${NW.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${NW.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${NW.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${NW.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${NW.loading}`]:{color:`transparent`}}}]}})),zW=L(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${R(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...LW]})),BW=L(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${R(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...LW]})),VW=L(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),HW=L(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),UW=N.forwardRef(function(e,t){let n=N.useContext(PW),r=N.useContext(FW),i=zo({props:di(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:p,fullWidth:m=!1,id:h,loading:g=null,loadingIndicator:_,loadingPosition:v=`center`,size:y=`medium`,startIcon:b,type:x,variant:S=`text`,...C}=i,w=eR(h),T=_??(0,F.jsx)(bz,{"aria-labelledby":w,color:`inherit`,size:16}),E={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:m,loading:g,loadingIndicator:T,loadingPosition:v,size:y,type:x,variant:S},D=IW(E),O=(b||g&&v===`start`)&&(0,F.jsx)(zW,{className:D.startIcon,ownerState:E,children:b||(0,F.jsx)(HW,{className:D.loadingIconPlaceholder,ownerState:E})}),A=(f||g&&v===`end`)&&(0,F.jsx)(BW,{className:D.endIcon,ownerState:E,children:f||(0,F.jsx)(HW,{className:D.loadingIconPlaceholder,ownerState:E})}),j=r||``,M=typeof g==`boolean`?(0,F.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:g&&(0,F.jsx)(VW,{className:D.loadingIndicator,ownerState:E,children:T})}):null,{root:ee,...te}=D;return(0,F.jsxs)(RW,{ownerState:E,className:k(n.className,D.root,c,j),component:s,disabled:l||g,focusRipple:!d,focusVisibleClassName:k(D.focusVisible,p),ref:t,type:x,id:g?w:h,...C,classes:te,children:[O,v!==`end`&&M,a,v===`end`&&M,A]})}),WW=WL((0,F.jsx)(`path`,{d:`M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z`}),`Restore`),GW=WL((0,F.jsx)(`path`,{d:`M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8`}),`Undo`),KW=L(`div`)({display:`flex`,flexDirection:`column`}),qW=L(`div`)({display:`flex`,alignItems:`center`,justifyContent:`center`}),JW=L(`div`)(({theme:e})=>({width:`24px`,height:`24px`,color:`gray`,marginRight:e.spacing(1),display:`flex`,alignItems:`center`})),YW=L(UW)(({theme:e})=>({display:`flex`,alignItems:`center`,marginLeft:e.spacing(3),marginRight:e.spacing(3)})),XW=e=>{class t extends N.Component{static propTypes={session:p.object,onSessionChange:p.func};constructor(e){super(e),this.state={sessionInitialValues:JSON.parse(JSON.stringify(e.session)),session:e.session,changes:[]}}onSessionChange=e=>{this.setState(t=>({session:e,changes:[...t.changes,e]}),()=>this.props.onSessionChange(e))};onUndo=()=>{this.setState(e=>{let t=[...e.changes];return t.pop(),{changes:t,session:t.length?t[t.length-1]:e.sessionInitialValues}},()=>this.props.onSessionChange(this.state.session))};onReset=()=>{this.setState(e=>({session:e.sessionInitialValues,changes:[]}),()=>this.props.onSessionChange(this.state.sessionInitialValues))};render(){let{...t}=this.props,{changes:n,session:r}=this.state;return(0,F.jsxs)(KW,{children:[(0,F.jsxs)(qW,{children:[(0,F.jsxs)(YW,{color:`primary`,disabled:n.length===0,onClick:this.onUndo,children:[(0,F.jsx)(JW,{children:(0,F.jsx)(GW,{})}),`Undo`]}),(0,F.jsxs)(YW,{color:`primary`,disabled:n.length===0,onClick:this.onReset,children:[(0,F.jsx)(JW,{children:(0,F.jsx)(WW,{})}),`Start Over`]})]}),(0,F.jsx)(e,{...t,session:r,onSessionChange:this.onSessionChange})]})}}return t},ZW=ko({typography:{fontFamily:`inherit`},palette:{action:{disabled:`rgba(0, 0, 0, 0.54);`}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:`inherit`}}},MuiButton:{styleOverrides:{contained:{backgroundColor:`#e0e0e0`,color:`#000000`,"&:hover":{backgroundColor:`#bdbdbd`}}}}}}),QW=L(`div`)({"& table, th, td":{fontSize:`inherit`}}),$W=class extends N.Component{static propTypes={className:p.string,children:p.array,extraCSSRules:p.shape({names:p.arrayOf(p.string),rules:p.string}),fontSizeFactor:p.number};static defaultProps={extraCSSRules:{},fontSizeFactor:1};constructor(e){super(e),this.classesSheet=document.createElement(`style`)}computeStyle(e){let t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),i=Math.max(n,r),a=e!=null&&typeof e==`number`?e:1;return a===1?null:{fontSize:`${i*a}px`}}render(){let{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:i,...a}=r,o=this.computeStyle(n);return(0,F.jsx)(kr,{injectFirst:!0,children:(0,F.jsxs)(ns,{theme:ZW,children:[i?.rules?(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,(0,F.jsx)(QW,{className:`${t} extraCSSRules`,...a,...o&&{style:o},children:e})]})})}},eG=L($W)({display:`flex`,flexDirection:`column`,position:`relative`}),tG=class extends N.Component{static propTypes={ariaLabel:p.string,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,role:p.string,extraCSSRules:p.shape({names:p.arrayOf(p.string),rules:p.string}),fontSizeFactor:p.number};render(){let{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:a}=this.props;return(0,F.jsx)(eG,{...t?{"aria-label":t,role:n}:{},extraCSSRules:r,fontSizeFactor:i,classes:a,children:e})}},nG=class extends N.Component{static propTypes={tag:p.string,className:p.string,html:p.string};static defaultProps={tag:`div`,html:``};render(){let{tag:e,className:t,html:n}=this.props;return(0,F.jsx)(e||`div`,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}};function rG({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&e[r]===void 0&&(t[r]=n[r]),t),{})}var iG=N.createContext(void 0);function aG(){return N.useContext(iG)}function oG(e){return Zr(`MuiFormLabel`,e)}var sG=Qr(`MuiFormLabel`,[`root`,`colorSecondary`,`focused`,`disabled`,`error`,`filled`,`required`,`asterisk`]),cG=e=>{let{classes:t,color:n,focused:r,disabled:i,error:a,filled:o,required:s}=e;return A({root:[`root`,`color${R(n)}`,i&&`disabled`,a&&`error`,o&&`filled`,r&&`focused`,s&&`required`],asterisk:[`asterisk`,a&&`error`]},oG,t)},lG=L(`label`,{name:`MuiFormLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color===`secondary`&&t.colorSecondary,n.filled&&t.filled]}})(Ro(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:`1.4375em`,padding:0,position:`relative`,variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{[`&.${sG.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${sG.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${sG.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),uG=L(`span`,{name:`MuiFormLabel`,slot:`Asterisk`})(Ro(({theme:e})=>({[`&.${sG.error}`]:{color:(e.vars||e).palette.error.main}}))),dG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormLabel`}),{children:r,className:i,color:a,component:o=`label`,disabled:s,error:c,filled:l,focused:u,required:d,...f}=n,p=rG({props:n,muiFormControl:aG(),states:[`color`,`required`,`focused`,`disabled`,`error`,`filled`]}),m={...n,color:p.color||`primary`,component:o,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required},h=cG(m);return(0,F.jsxs)(lG,{as:o,ownerState:m,className:k(h.root,i),ref:t,...f,children:[r,p.required&&(0,F.jsxs)(uG,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[` `,`*`]})]})});function fG(e){return Zr(`MuiInputLabel`,e)}Qr(`MuiInputLabel`,[`root`,`focused`,`disabled`,`error`,`required`,`asterisk`,`formControl`,`sizeSmall`,`shrink`,`animated`,`standard`,`filled`,`outlined`]);var pG=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:a,variant:o,required:s}=e,c=A({root:[`root`,n&&`formControl`,!a&&`animated`,i&&`shrink`,r&&r!==`medium`&&`size${R(r)}`,o],asterisk:[s&&`asterisk`]},fG,t);return{...t,...c}},mG=L(dG,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInputLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${sG.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size===`small`&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Ro(({theme:e})=>({display:`block`,transformOrigin:`top left`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`,variants:[{props:({ownerState:e})=>e.formControl,style:{position:`absolute`,left:0,top:0,transform:`translate(0, 20px) scale(1)`}},{props:{size:`small`},style:{transform:`translate(0, 17px) scale(1)`}},{props:({ownerState:e})=>e.shrink,style:{transform:`translate(0, -1.5px) scale(0.75)`,transformOrigin:`top left`,maxWidth:`133%`}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create([`color`,`transform`,`max-width`],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:`filled`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(12px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`filled`,size:`small`},style:{transform:`translate(12px, 13px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`filled`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,transform:`translate(12px, 7px) scale(0.75)`,maxWidth:`calc(133% - 24px)`}},{props:({variant:e,ownerState:t,size:n})=>e===`filled`&&t.shrink&&n===`small`,style:{transform:`translate(12px, 4px) scale(0.75)`}},{props:{variant:`outlined`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(14px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`outlined`,size:`small`},style:{transform:`translate(14px, 9px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`outlined`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,maxWidth:`calc(133% - 32px)`,transform:`translate(14px, -9px) scale(0.75)`}}]}))),hG=N.forwardRef(function(e,t){let n=zo({name:`MuiInputLabel`,props:e}),{disableAnimation:r=!1,margin:i,shrink:a,variant:o,className:s,...c}=n,l=aG(),u=a;u===void 0&&l&&(u=l.filled||l.focused||l.adornedStart);let d=rG({props:n,muiFormControl:l,states:[`size`,`variant`,`required`,`focused`]}),f={...n,disableAnimation:r,formControl:l,shrink:u,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=pG(f);return(0,F.jsx)(mG,{"data-shrink":u,ref:t,className:k(p.root,s),...c,ownerState:f,classes:p})});function gG(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function _G(e,t=!1){return e&&(gG(e.value)&&e.value!==``||t&&gG(e.defaultValue)&&e.defaultValue!==``)}function vG(e){return e.startAdornment}function yG(e){return Zr(`MuiFormControl`,e)}Qr(`MuiFormControl`,[`root`,`marginNone`,`marginNormal`,`marginDense`,`fullWidth`,`disabled`]);var bG=e=>{let{classes:t,margin:n,fullWidth:r}=e;return A({root:[`root`,n!==`none`&&`margin${R(n)}`,r&&`fullWidth`]},yG,t)},xG=L(`div`,{name:`MuiFormControl`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${R(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:`inline-flex`,flexDirection:`column`,position:`relative`,minWidth:0,padding:0,margin:0,border:0,verticalAlign:`top`,variants:[{props:{margin:`normal`},style:{marginTop:16,marginBottom:8}},{props:{margin:`dense`},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:`100%`}}]}),SG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormControl`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,error:c=!1,focused:l,fullWidth:u=!1,hiddenLabel:d=!1,margin:f=`none`,required:p=!1,size:m=`medium`,variant:h=`outlined`,...g}=n,_={...n,color:a,component:o,disabled:s,error:c,fullWidth:u,hiddenLabel:d,margin:f,required:p,size:m,variant:h},v=bG(_),[y,b]=N.useState(()=>{let e=!1;return r&&N.Children.forEach(r,t=>{if(!qL(t,[`Input`,`Select`]))return;let n=qL(t,[`Select`])?t.props.input:t;n&&vG(n.props)&&(e=!0)}),e}),[x,S]=N.useState(()=>{let e=!1;return r&&N.Children.forEach(r,t=>{qL(t,[`Input`,`Select`])&&(_G(t.props,!0)||_G(t.props.inputProps,!0))&&(e=!0)}),e}),[C,w]=N.useState(!1);s&&C&&w(!1);let T=l!==void 0&&!s?l:C;N.useRef(!1);let E=N.useCallback(()=>{S(!0)},[]),D=N.useCallback(()=>{S(!1)},[]),O=N.useMemo(()=>({adornedStart:y,setAdornedStart:b,color:a,disabled:s,error:c,filled:x,focused:T,fullWidth:u,hiddenLabel:d,size:m,onBlur:()=>{w(!1)},onFocus:()=>{w(!0)},onEmpty:D,onFilled:E,registerEffect:void 0,required:p,variant:h}),[y,a,s,c,x,T,u,d,void 0,D,E,p,m,h]);return(0,F.jsx)(iG.Provider,{value:O,children:(0,F.jsx)(xG,{as:o,ownerState:_,className:k(v.root,i),ref:t,...g,children:r})})}),CG=L(SG)(({theme:e})=>({margin:0,padding:0,flex:`1 0 auto`,minWidth:e.spacing(4)})),wG=L(hG)(()=>({fontSize:`inherit`,whiteSpace:`nowrap`,margin:0,padding:0,alignSelf:`flex-start`,position:`absolute`,top:0,left:0,transformOrigin:`top left`,pointerEvents:`none`,"&.MuiInputLabel-shrink":{transform:`scale(0.75) translate(0, -0.75em)`},"&:not(.MuiInputLabel-shrink)":{transform:`translate(0, 0)`}})),TG=({label:e,className:t,children:n})=>(0,F.jsxs)(CG,{className:t,children:[(0,F.jsx)(wG,{shrink:!0,children:e}),n]});TG.propTypes={label:p.oneOfType([p.string,p.object]).isRequired,className:p.string,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired};var EG=L(`div`)(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:`collapse`},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:`solid`,borderColor:OU()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:AU()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:AU()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:`.6em 1em`,textAlign:`left`},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:`initial`},"&.prompt":{verticalAlign:`middle`,color:ZH()},"&.legend":{width:`100%`,fontSize:`inherit !important`},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${ZH()} !important`,display:`flex`,flexDirection:`column`,verticalAlign:`middle`,cursor:`pointer`,"& > p":{margin:`0 0 0 0 !important`}}})),DG=/\\embed\{newLine\}\[\]/g,OG=`\\newline `,kG=`preview-prompt`,AG=class extends N.Component{static propTypes={prompt:p.string,tagName:p.string,className:p.string,onClick:p.func,defaultClassName:p.string,autoplayAudioEnabled:p.bool,customAudioButton:p.shape({playImage:p.string,pauseImage:p.string})};static defaultProps={onClick:()=>{}};promptRef=N.createRef();parsedText=e=>{let{customAudioButton:t}=this.props,n=document.createElement(`div`);n.innerHTML=e;let r=n.querySelector(`audio`);if(r){let e=document.createElement(`source`);if(e.setAttribute(`type`,`audio/mp3`),e.setAttribute(`src`,r.getAttribute(`src`)),r.removeAttribute(`src`),r.setAttribute(`id`,`pie-prompt-audio-player`),r.appendChild(e),t){r.style.display=`none`;let e=document.createElement(`div`);e.id=`play-audio-button`,Object.assign(e.style,{cursor:`pointer`,display:`block`,width:`128px`,height:`128px`,backgroundImage:`url(${t.pauseImage})`,backgroundSize:`cover`,borderRadius:`50%`,border:`1px solid #326295`}),r.parentNode.insertBefore(e,r)}}return n.innerHTML};addCustomAudioButtonControls(){let{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById(`play-audio-button`),r=document.getElementById(`pie-prompt-audio-player`);if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener(`ended`,a)}).catch(e=>{console.error(`Error playing audio`,e)}),!n||!r||!t)return;let i=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},a=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:`1px solid #ccc`})},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:`1px solid #326295`})};n.addEventListener(`click`,i),r.addEventListener(`play`,o),r.addEventListener(`pause`,s),r.addEventListener(`ended`,a),this._handlePlayClick=i,this._handleAudioPlay=o,this._handleAudioPause=s,this._handleAudioEnded=a}removeCustomAudioButtonListeners(){let e=document.getElementById(`play-audio-button`),t=document.querySelector(`audio`);!e||!t||(e.removeEventListener(`click`,this._handlePlayClick),t.removeEventListener(`play`,this._handleAudioPlay),t.removeEventListener(`pause`,this._handleAudioPause),t.removeEventListener(`ended`,this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){let e=this.promptRef.current;e&&typeof DW==`function`&&DW(e)}alignImages(){let e=this.promptRef.current;if(!e)return;let t=e.getElementsByTagName(`img`);if(t&&t.length){for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){let t=e.attributes.alignment.value,n=t===`center`?`center`:t===`right`?`flex-end`:`flex-start`,r=e.parentElement;if(r.tagName===`DIV`&&r.style.display===`flex`&&r.style.width===`100%`)r.style.justifyContent=n;else{let t=document.createElement(`div`);t.style.display=`flex`,t.style.width=`100%`,t.style.justifyContent=n;let i=e.cloneNode(!0);t.appendChild(i),r.replaceChild(t,e)}}}}render(){let{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:i}=this.props,a=`${n||``} ${i||``} ${t===`legend`?`legend`:``} ${kG}`.trim();return(0,F.jsx)(EG,{as:t||`div`,ref:this.promptRef,onClick:r,className:a,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||``).replace(DG,OG)}})}},jG=e=>(0,F.jsx)(F.Fragment,{children:N.Children.map(e.children,t=>N.cloneElement(t,{"data-pie-readable":e.false===void 0}))});jG.propTypes={children:p.node,false:p.bool};var MG=e=>(0,F.jsx)(F.Fragment,{children:N.Children.map(e.children,t=>N.cloneElement(t,{"data-pie-purpose":e.purpose}))});MG.propTypes={children:p.node,purpose:p.string};var NG;typeof window<`u`&&(NG=new DOMParser);var PG=e=>NG.parseFromString(e,`text/html`).body.textContent,FG=e=>{if(!e)return!1;let t=PG(e);return!!(t&&t.trim())},IG;typeof window<`u`&&(IG=new DOMParser);var LG=e=>{if(!e)return!1;let t=IG.parseFromString(e,`text/html`);return!!t.body.querySelector(`img`)||!!t.body.querySelector(`video`)||!!t.body.querySelector(`audio`)},RG=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAJYAyADAREAAhEBAxEB/8QAHgABAQABBQEBAQAAAAAAAAAAAAEIAgMGBwkEBQr/xABiEAACAQIDBAMKCAYMCgYLAQAAAQIDEQQFIQYSMUEHCFETFRYiUmFxkdHhCRRjgaGisfAXMjRTcsEjJDY4QmJ1dpKztMQYMzdEVIKyw9PxQ1hmc3SWJzVFRlZXhJOUldJk/8QAGwEBAQADAQEBAAAAAAAAAAAAAAcEBQYCAQP/xABBEQEAAQIDAgkJBgUFAQEBAAAAAQIDBAYRBSESMUFEYXGCscITNDVRcoGRocEUIjJS0eEVI2KSsjNCU6LwFtLx/9oADAMBAAIRAxEAPwD1TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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`;function zG(e=``,t=2){if(!e)return e;let n=new DOMParser().parseFromString(e,`text/html`);return n.body.querySelectorAll(`[data-heading]`).forEach(e=>{let r=e.getAttribute(`data-heading`)||``,i=parseInt(r.replace(`heading`,``),10);if(!Number.isFinite(i))return;let a=Math.min(6,Math.max(1,t+i-1)),o=n.createElement(`h${a}`);o.setAttribute(`data-heading`,r),Array.from(e.attributes).forEach(e=>{e.name!==`data-heading`&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}function BG(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:uH(n,r),{props:s,internalRef:c}=pH({...a,externalSlotProps:o}),l=aR(c,o?.ref,e.additionalProps?.ref);return lH(t,{...s,ref:l},r)}var VG=N.createContext({});function HG(e){return Zr(`MuiList`,e)}Qr(`MuiList`,[`root`,`padding`,`dense`,`subheader`]);var UG=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return A({root:[`root`,!n&&`padding`,r&&`dense`,i&&`subheader`]},HG,t)},WG=L(`ul`,{name:`MuiList`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:`none`,margin:0,padding:0,position:`relative`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),GG=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiList`}),{children:r,className:i,component:a=`ul`,dense:o=!1,disablePadding:s=!1,subheader:c,...l}=n,u=N.useMemo(()=>({dense:o}),[o]),d={...n,component:a,dense:o,disablePadding:s},f=UG(d);return(0,F.jsx)(VG.Provider,{value:u,children:(0,F.jsxs)(WG,{as:a,className:k(f.root,i),ref:t,ownerState:d,...l,children:[c,r]})})}),KG=RV;function qG(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function JG(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function YG(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(``))}function XG(e,t,n,r,i,a){let o=!1,s=i(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(o)return!1;o=!0}let t=r?!1:s.disabled||s.getAttribute(`aria-disabled`)===`true`;if(!s.hasAttribute(`tabindex`)||!YG(s,a)||t)s=i(e,s,n);else return s.focus(),!0}return!1}var ZG=N.forwardRef(function(e,t){let{actions:n,autoFocus:r=!1,autoFocusItem:i=!1,children:a,className:o,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:l,variant:u=`selectedMenu`,...d}=e,f=N.useRef(null),p=N.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});$L(()=>{r&&f.current.focus()},[r]),N.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){let n=`${KG(ZL(e))}px`;f.current.style[t===`rtl`?`paddingLeft`:`paddingRight`]=n,f.current.style.width=`calc(100% + ${n})`}return f.current}}),[]);let m=e=>{let t=f.current,n=e.key;if(e.ctrlKey||e.metaKey||e.altKey){l&&l(e);return}let r=ZV(YL(t));if(n===`ArrowDown`)e.preventDefault(),XG(t,r,c,s,qG);else if(n===`ArrowUp`)e.preventDefault(),XG(t,r,c,s,JG);else if(n===`Home`)e.preventDefault(),XG(t,null,c,s,qG);else if(n===`End`)e.preventDefault(),XG(t,null,c,s,JG);else if(n.length===1){let i=p.current,a=n.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);let c=r&&!i.repeating&&YG(r,i);i.previousKeyMatched&&(c||XG(t,r,!1,s,qG,i))?e.preventDefault():i.previousKeyMatched=!1}l&&l(e)},h=oR(f,t),g=-1;N.Children.forEach(a,(e,t)=>{if(!N.isValidElement(e)){g===t&&(g+=1,g>=a.length&&(g=-1));return}e.props.disabled||(u===`selectedMenu`&&e.props.selected||g===-1)&&(g=t),g===t&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(g+=1,g>=a.length&&(g=-1))});let _=N.Children.map(a,(e,t)=>{if(t===g){let t={};return i&&(t.autoFocus=!0),e.props.tabIndex===void 0&&u===`selectedMenu`&&(t.tabIndex=0),N.cloneElement(e,t)}return e});return(0,F.jsx)(GG,{role:`menu`,ref:h,className:o,onKeyDown:m,tabIndex:r?0:-1,...d,children:_})});function QG(e){return Zr(`MuiMenu`,e)}Qr(`MuiMenu`,[`root`,`paper`,`list`]);var $G={vertical:`top`,horizontal:`right`},eK={vertical:`top`,horizontal:`left`},tK=e=>{let{classes:t}=e;return A({root:[`root`],paper:[`paper`],list:[`list`]},QG,t)},nK=L(WH,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenu`,slot:`Root`})({}),rK=L(UH,{name:`MuiMenu`,slot:`Paper`})({maxHeight:`calc(100% - 96px)`,WebkitOverflowScrolling:`touch`}),iK=L(ZG,{name:`MuiMenu`,slot:`List`})({outline:0}),aK=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiMenu`}),{autoFocus:r=!0,children:i,className:a,disableAutoFocusItem:o=!1,MenuListProps:s={},onClose:c,open:l,PaperProps:u={},PopoverClasses:d,transitionDuration:f=`auto`,TransitionProps:{onEntering:p,...m}={},variant:h=`selectedMenu`,slots:g={},slotProps:_={},...v}=n,y=Ri(),b={...n,autoFocus:r,disableAutoFocusItem:o,MenuListProps:s,onEntering:p,PaperProps:u,transitionDuration:f,TransitionProps:m,variant:h},x=tK(b),S=r&&!o&&l,C=N.useRef(null),w=(e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:y?`rtl`:`ltr`}),p&&p(e,t)},T=e=>{e.key===`Tab`&&(e.preventDefault(),c&&c(e,`tabKeyDown`))},E=-1;N.Children.map(i,(e,t)=>{N.isValidElement(e)&&(e.props.disabled||(h===`selectedMenu`&&e.props.selected||E===-1)&&(E=t))});let D={slots:g,slotProps:{list:s,transition:m,paper:u,..._}},O=BG({elementType:g.root,externalSlotProps:_.root,ownerState:b,className:[x.root,a]}),[A,j]=mH(`paper`,{className:x.paper,elementType:rK,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:b}),[M,ee]=mH(`list`,{className:k(x.list,s.className),elementType:iK,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:e=>({...e,onKeyDown:t=>{T(t),e.onKeyDown?.(t)}}),ownerState:b}),te=typeof D.slotProps.transition==`function`?D.slotProps.transition(b):D.slotProps.transition;return(0,F.jsx)(nK,{onClose:c,anchorOrigin:{vertical:`bottom`,horizontal:y?`right`:`left`},transformOrigin:y?$G:eK,slots:{root:g.root,paper:A,backdrop:g.backdrop,...g.transition&&{transition:g.transition}},slotProps:{root:O,paper:j,backdrop:typeof _.backdrop==`function`?_.backdrop(b):_.backdrop,transition:{...te,onEntering:(...e)=>{w(...e),te?.onEntering?.(...e)}}},open:l,ref:t,transitionDuration:f,ownerState:b,...v,classes:d,children:(0,F.jsx)(M,{actions:C,autoFocus:r&&(E===-1||o),autoFocusItem:S,variant:h,...ee,children:i})})}),oK=({slotProps:e,...t})=>(0,F.jsx)(aK,{...t,disableScrollLock:!0,hideBackdrop:!0,slotProps:{...e,root:{...e?.root,style:{backgroundColor:`transparent`,pointerEvents:`none`,...e?.root?.style}},paper:{...e?.paper,style:{pointerEvents:`auto`,...e?.paper?.style}}}}),sK=s({Collapsible:()=>jW,EnableAudioAutoplayImage:()=>RG,Feedback:()=>tW,HtmlAndMath:()=>nG,InlineMenu:()=>oK,InputContainer:()=>TG,PreviewLayout:()=>tG,PreviewPrompt:()=>AG,Purpose:()=>MG,Readable:()=>jG,UiLayout:()=>$W,color:()=>qH,hasMedia:()=>LG,hasText:()=>FG,indicators:()=>nW,transformDataHeadings:()=>zG,withUndoReset:()=>XW}),cK=WL((0,F.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),lK=WL((0,F.jsx)(`path`,{d:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2`}),`MoreVert`),uK=e=>{switch(e){case`down`:return 90;case`up`:return-90;case`left`:return 180;default:return 0}},dK=e=>{let{direction:t,style:n}=e;return(0,F.jsx)(cK,{style:{transform:`rotate(${uK(t)}deg)`,...n}})};dK.propTypes={direction:p.string,style:p.object};var fK=({style:e})=>(0,F.jsxs)(`span`,{style:e,children:[(0,F.jsx)(lK,{style:{margin:`0 -16px`}}),(0,F.jsx)(lK,{})]});fK.propTypes={style:p.object},L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`}));var pK=L(`span`)(({theme:e})=>({border:`solid 0px ${e.palette.primary.main}`,"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:`120% !important`},"& mjx-frac":{fontSize:`120% !important`}}));function mK({n:e,children:t,isDragging:n,isOver:r,dragItem:i,value:a,selected:o}){let[s,c]=(0,N.useState)(null),l=(0,N.useRef)(null),u=e=>{l.current&&(l.current.contains(e.target)?l.current.classList.add(`selected`):l.current.classList.remove(`selected`))};(0,N.useEffect)(()=>(document.addEventListener(`click`,u),()=>{document.removeEventListener(`click`,u)}),[]),(0,N.useEffect)(()=>{l.current&&typeof DW==`function`&&DW(l.current)},[a?.value,r,i?.value?.value]),(0,N.useEffect)(()=>{if(r&&l.current&&!s){let e=l.current;c({width:e.offsetWidth,height:e.offsetHeight})}else!r&&s&&c(null)},[r,s]);let d=i&&r?i.value.value:a.value||`\xA0`,f=n?`\xA0`:d,p=f!==`\xA0`,m=i&&r,h=o?`2px solid ${dU()}`:m?`1px solid ${JH.BORDER_DARK}`:`1px solid ${JH.BORDER_LIGHT}`;return(0,F.jsxs)(`div`,{ref:l,className:o?`selected`:void 0,style:{display:`inline-flex`,minWidth:`178px`,minHeight:`36px`,background:m?`${JH.BORDER_LIGHT}`:`${JH.WHITE}`,border:h,boxSizing:`border-box`,borderRadius:`3px`,overflow:`hidden`,position:`relative`,padding:`8px 8px 8px 35px`,width:s?s.width:void 0,height:s?s.height:void 0,touchAction:`none`},"data-key":e.index,contentEditable:!1,children:[p&&(0,F.jsx)(fK,{style:{position:`absolute`,top:`6px`,left:`15px`,color:`#9B9B9B`},contentEditable:!1}),(0,F.jsx)(`span`,{dangerouslySetInnerHTML:{__html:f}}),t]})}mK.propTypes={n:p.object,children:p.node,isDragging:p.bool,isOver:p.bool,dragItem:p.object,value:p.object,selected:p.bool};function hK({value:e,disabled:t,instanceId:n,children:r,n:i,onChange:a,removeResponse:o,duplicates:s,pos:c,selected:l}){let{attributes:u,listeners:d,setNodeRef:f,isDragging:p}=nV({id:`drag-${i.index}`,disabled:t||!e?.value,data:{id:`drag-${i.index}`,value:e,instanceId:n,n:i,pos:c,opts:{duplicates:s},type:`drag-in-the-blank-placed-choice`,fromChoice:!e,onRemove:e=>o(e),onDrop:(e,t)=>{t?.type===`drag-in-the-blank-drop-choice`&&(a(e),!s&&e.fromChoice&&o(e))}}}),{setNodeRef:m,isOver:h,active:g}=aV({id:`drop-${i.index}`,data:{type:`drag-in-the-blank-drop-choice`,accepts:[`drag-in-the-blank-choice`,`drag-in-the-blank-placed-choice`],instanceId:n,value:e,id:`drop-${i.index}`,pos:c,n:i,opts:{duplicates:s},onDrop:(e,t)=>{if(t?.type===`drag-in-the-blank-drop-choice`&&e.value.id!==t.value.id){if(e.type===`drag-in-the-blank-choice`){a(e),!s&&e.fromChoice&&o(e);return}e.type===`drag-in-the-blank-placed-choice`&&(o(t),a(e),setTimeout(()=>o(e),10))}}}}),_=e=>{f(e),m(e)},v=(0,F.jsx)(mK,{n:i,isDragging:p,isOver:h,dragItem:g?.data?.current,value:e,selected:l,children:r}),y=e?(0,F.jsx)(`span`,{ref:_,...u,...d,children:v}):(0,F.jsx)(`span`,{ref:m,children:v});return(0,F.jsx)(pK,{className:k(h&&`over`),children:y})}hK.propTypes={value:p.object,disabled:p.bool,instanceId:p.string,children:p.node,n:p.object.isRequired,onChange:p.func.isRequired,removeResponse:p.func.isRequired,duplicates:p.bool,selected:p.bool};var gK=(e,t,n,r)=>{let{tr:i}=e.state;i.setNodeMarkup(n,void 0,{...t.attrs,...r.value}),i.isDone=!0,e.view.dispatch(i)},_K=(e,t,n)=>{let{tr:r}=e.state;r.setNodeMarkup(n.pos,void 0,w(t.attrs,[`value`,`id`])),r.isDone=!0,e.view.dispatch(r)},vK=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{inTable:s}=o,c=r();return(0,F.jsx)(rS,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline`,whiteSpace:`normal`},children:(0,F.jsx)(`span`,{...o,style:{display:`inline-flex`,minHeight:`50px`,minWidth:`178px`,position:`relative`,margin:s?`10px`:`0 10px`,cursor:`pointer`},children:(0,F.jsx)(hK,{n:o,dragKey:o.id,targetId:`0`,pos:c,value:o,duplicates:i.duplicates,selected:a,onChange:e=>gK(t,n,c,e),removeResponse:e=>_K(t,n,e)})})})};vK.propTypes={attributes:p.object,data:p.object,n:p.object,nodeProps:p.object,opts:p.object};var yK=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s,error:c}=o,l=s||`<div>&nbsp</div>`,u=r(),d=(0,N.useRef)(null),f=(0,N.useRef)(null),p=(0,N.useRef)(!1),m=(0,N.useRef)(null),h=()=>t._holdInlineDropdownToolbarIndex!=null&&String(t._holdInlineDropdownToolbarIndex)===String(n.attrs.index),[g,_]=(0,N.useState)(!1),[v,y]=(0,N.useState)({top:0,left:0}),b=()=>{h()||(_(!1),i.onInlineDropdownToolbarClose?.(t))},x=i.respAreaToolbar([n,u],t,b),S=()=>{let{tr:e}=t.state,n=e.doc.nodeAt(u);if(!n)return;let{selection:r}=e;r.from===u&&r.to===u+n.nodeSize||(e.setSelection(W.create(e.doc,u)),t.view.dispatch(e))},C=()=>{p.current||(i.onToolbarCloseRequest?(p.current=!0,i.onToolbarCloseRequest([n,u],t,()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,b()},()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,_(!0),setTimeout(S,0)})):b())};(0,N.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&_(!0):g&&C()},[t,n,a]);let w=e=>e.clientX>document.documentElement.clientWidth||e.clientY>document.documentElement.clientHeight||e.target===document.documentElement;return(0,N.useEffect)(()=>{m.current&&typeof DW==`function`&&DW(m.current)},[s]),(0,N.useEffect)(()=>{let e=document.body.getBoundingClientRect(),{from:n}=t.state.selection,r=t.view.coordsAtPos(n);y({top:r.top+Math.abs(e.top)+40,left:r.left});let i=e=>{if(w(e))return;let n=e.target.closest(`[data-toolbar-for]`);!e.target.closest(`[data-inline-dropdown-toolbar]`)&&(!n||n.dataset.toolbarFor!==f.current?.instanceId)&&!t._toolbarOpened&&d.current&&!d.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&C()};return g?document.addEventListener(`mousedown`,i):document.removeEventListener(`mousedown`,i),()=>document.removeEventListener(`mousedown`,i)},[g,n]),(0,F.jsxs)(rS,{className:`inline-dropdown`,"data-selected":a,style:{display:`inline-flex`,height:`50px`,cursor:`pointer`},children:[(0,F.jsxs)(`div`,{ref:m,style:{display:`inline-flex`,minWidth:`178px`,height:`36px`,background:`#FFF`,border:`1px solid #C0C3CF`,boxSizing:`border-box`,borderRadius:`3px`,margin:`0 2px`,position:`relative`,alignItems:`center`},onClick:()=>_(!0),children:[(0,F.jsx)(`div`,{style:{flex:1,overflow:`hidden`,padding:`0 25px 0 8px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},children:(0,F.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`middle`},dangerouslySetInnerHTML:{__html:l}})}),(0,F.jsx)(dK,{direction:`down`,style:{position:`absolute`,top:`5px`,right:`5px`}})]}),g&&(0,F.jsxs)(N.Fragment,{children:[Rx.createPortal((0,F.jsx)(`div`,{ref:d,children:(0,F.jsx)(x,{editorCallback:e=>{f.current=e}})}),t?._tiptapContainerEl||document.body),t._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(Iz,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),Rz(t,!1),delete t._holdInlineDropdownToolbarIndex,t.view.dispatch(e),_(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};yK.propTypes={attributes:p.object,selectedItem:p.oneOfType([p.string,p.object])};var bK=s({greaterThan:()=>CK,greaterThanEqual:()=>TK,lessThan:()=>SK,lessThanEqual:()=>wK}),xK=e=>({...e,category:`comparison`}),SK=xK({name:`Less than`,latex:`<`,command:`\\lt`}),CK=xK({name:`Greater than`,latex:`>`,command:`\\gt`}),wK=xK({name:`Less than or equal`,latex:`\\le`,symbol:`<=`,command:`\\le`,ariaLabel:`less than or equal to`}),TK=xK({name:`Greater than or equal`,symbol:`>=`,command:`\\ge`,latex:`\\ge`}),EK=e=>t=>({...t,category:e}),DK=(e=[])=>{let t=[];T(5,()=>t.push([]));let n=e.length,r=0,i=0;for(;i<n;)t[r++].push(e[i++]),r===5&&(r=0);return t},OK=e=>t=>{let n=y(e),r=n.some(e=>e.latex===t.latex),i=n.some(e=>e.name===t.name);return!r&&!i},kK=(e=[],t=[])=>{t=t.filter(OK(e));let n=[];T(5-e.length,()=>e.push([])),T(5,()=>n.push([]));let r=DK(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},AK=s({theta:()=>PK,x:()=>MK,y:()=>NK}),jK=EK(`vars`),MK=jK({name:`X`,latex:`x`,write:`x`}),NK=jK({name:`Y`,latex:`y`,write:`y`}),PK=jK({name:`Theta`,latex:`\\theta`,write:`\\theta`}),FK=s({blankOverBlank:()=>LK,xBlankBlank:()=>zK,xOverBlank:()=>RK}),IK=EK(`fractions`),LK=IK({name:`blank/blank`,latex:`\\frac{}{}`,command:`\\frac`,ariaLabel:`fraction`}),RK=IK({latex:`\\frac{x}{ }`,name:`X/blank`,label:`x/[]`,command:`/`,ariaLabel:`x over blank fraction`}),zK=IK({name:`X (blank/blank)`,latex:`x\\frac{}{}`,label:`x([]/[])`,command:`\\frac`,ariaLabel:`mixed number`}),BK=s({nthRoot:()=>GK,squareRoot:()=>WK,squared:()=>HK,xToPowerOfN:()=>UK}),VK=EK(`exponent`),HK=VK({name:`Squared`,latex:`x^2`,write:`^2`}),UK=VK({name:`X to the power of n`,latex:`x^{}`,command:`^`,ariaLabel:`exponent`}),WK=VK({name:`Square root`,latex:`\\sqrt{}`,command:`\\sqrt`}),GK=VK({name:`Nth root`,latex:`\\sqrt[{}]{}`,command:`\\nthroot`}),KK=s({absValue:()=>YK,approx:()=>$K,brackets:()=>ZK,nApprox:()=>eq,notEqual:()=>tq,notSimilar:()=>rq,parenthesis:()=>XK,percentage:()=>QK,plusMinus:()=>JK,similar:()=>nq}),qK=EK(`misc`),JK=qK({name:`Plus or Minus`,latex:`\\pm`,write:`\\pm`}),YK=qK({name:`Absolute Value`,latex:`\\abs{}`,symbol:`| |`,command:`|`}),XK=qK({name:`Parenthesis`,latex:`\\left(\\right)`,symbol:`( )`,command:`(`}),ZK=qK({name:`Brackets`,latex:`\\left[\\right]`,symbol:`[ ]`,command:`[`}),QK=qK({name:`Percent`,latex:`%`,command:`%`}),$K=qK({latex:`\\approx`,command:`\\approx`,ariaLabel:`Approximately equal to`}),eq=qK({latex:`\\napprox`,command:`\\napprox`,ariaLabel:`Not pproximately equal to`}),tq=qK({latex:`\\neq`,command:`\\neq`,ariaLabel:`Not equals`}),nq=qK({latex:`\\sim`,command:`\\sim`,ariaLabel:`Similar`}),rq=qK({latex:`\\nsim`,command:`\\nsim`,ariaLabel:`Not similar`}),iq=s({eulers:()=>sq,halfInfinity:()=>lq,infinity:()=>cq,pi:()=>oq}),aq=EK(`constants`),oq=aq({name:`Pi`,label:`π`,latex:`\\pi`,command:`\\pi`,category:`constants`}),sq=aq({name:`Eulers`,label:`e`,latex:`e`,command:`e`,category:`constants`}),cq=aq({name:`Infinity`,label:`\\infty`,latex:`\\infty`,command:`\\infty`,category:`constants`}),lq=aq({name:`Half Infinity`,label:`\\propto`,latex:`\\propto`,command:`\\propto`,category:`constants`}),uq=s({cos:()=>pq,cot:()=>_q,csc:()=>gq,sec:()=>hq,sin:()=>fq,tan:()=>mq}),dq=EK(`trigonometry`),fq=dq({name:`sine`,label:`sin`,command:`\\sin`,latex:`\\sin`}),pq=dq({name:`cosine`,label:`cos`,command:`\\cos`,latex:`\\cos`}),mq=dq({name:`tanget`,label:`tan`,command:`\\tan`,latex:`\\tan`}),hq=dq({name:`secant`,label:`sec`,command:`\\sec`,latex:`\\sec`}),gq=dq({name:`cosecant`,label:`csc`,command:`\\csc`,latex:`\\csc`}),_q=dq({name:`cotangent`,label:`cot`,command:`\\cot`,latex:`\\cot`}),vq=s({angle:()=>Dq,circledDot:()=>Nq,congruentTo:()=>Iq,degree:()=>Pq,doublePrimeArcSecond:()=>zq,leftArrow:()=>Bq,leftrightArrow:()=>Hq,measureOfAngle:()=>kq,notCongruentTo:()=>Lq,notParallel:()=>Tq,overArc:()=>Oq,overLeftRightArrow:()=>Sq,overRightArrow:()=>xq,overline:()=>bq,parallel:()=>wq,parallelogram:()=>Mq,perpindicular:()=>Eq,primeArcminute:()=>Rq,rightArrow:()=>Vq,segment:()=>Cq,similarTo:()=>Fq,square:()=>jq,triangle:()=>Aq}),yq=e=>({...e,category:`geometry`}),bq=yq({name:`Line`,latex:`\\overline{}`,command:`\\overline`}),xq=yq({name:`Ray`,latex:`\\overrightarrow{}`,command:`\\overrightarrow`}),Sq=yq({name:`Segment`,latex:`\\overleftrightarrow{\\overline{}}`,symbol:`AB`,command:`\\overleftrightarrow`}),Cq=yq({name:`Segment`,latex:`\\overleftrightarrow{AB}`,write:`\\overleftrightarrow{AB}`,label:`AB`}),wq=yq({name:`Parallel`,latex:`\\parallel`,command:`\\parallel`}),Tq=yq({name:`Not Parallel`,latex:`\\nparallel`,command:`\\nparallel`}),Eq=yq({name:`Perpendicular`,latex:`\\perp`,command:`\\perpendicular`}),Dq=yq({name:`Angle`,latex:`\\angle`,command:`\\angle`}),Oq=yq({name:`Over arc`,latex:`\\overarc{\\overline{}}`,command:`\\overarc`}),kq=yq({name:`Measured Angle`,latex:`\\measuredangle`,command:[`m`,`\\angle`]}),Aq=yq({name:`Triangle`,latex:`\\triangle`,command:`\\triangle`}),jq=yq({name:`Square`,latex:`\\square`,command:`\\square`}),Mq=yq({name:`Parallelogram`,latex:`\\parallelogram`,command:`\\parallelogram`}),Nq=yq({name:`Circled Dot`,latex:`\\odot`,command:`\\odot`}),Pq=yq({name:`Degree`,latex:`\\degree`,command:`\\degree`}),Fq=yq({name:`Similar`,command:`\\sim`,latex:`\\sim`}),Iq=yq({name:`Congruent To`,command:`\\cong`,latex:`\\cong`}),Lq=yq({name:`Not Congruent To`,command:`\\ncong`,latex:`\\ncong`}),Rq=yq({name:`Prime`,label:`pam`,latex:`'`,write:`'`}),zq=yq({name:`Double Prime`,latex:`''`,write:`''`}),Bq=yq({name:`Left Arrow`,latex:`\\leftarrow`,command:`\\leftarrow`}),Vq=yq({name:`Right Arrow`,latex:`\\rightarrow`,command:`\\rightarrow`}),Hq=yq({name:`Left and Right Arrow`,latex:`\\leftrightarrow`,command:`\\leftrightarrow`}),Uq=s({circleDot:()=>Wq}),Wq=EK(`operators`)({name:`CircleDot`,label:`⋅`,write:`\\cdot`,ariaLabel:`Dot multiplier`}),Gq=s({ln:()=>Yq,log:()=>qq,logSubscript:()=>Jq}),Kq=EK(`log`),qq=Kq({name:`Log`,label:`log`,command:`\\log`,latex:`\\log`}),Jq=Kq({name:`log base n`,label:`log s`,latex:`\\log_{}`,command:[`\\log`,`_`]}),Yq=Kq({name:`natural log`,label:`ln`,command:`\\ln`,latex:`\\ln`}),Xq=s({subscript:()=>$q,superscript:()=>Qq}),Zq=EK(`sub-sup`),Qq=Zq({name:`Superscript`,latex:`x^{}`,command:`^`}),$q=Zq({name:`Subscript`,latex:`x_{}`,command:`_`}),eJ=s({mu:()=>iJ,sigma:()=>aJ,smallSigma:()=>oJ,xBar:()=>nJ,yBar:()=>rJ}),tJ=EK(`statistics`),nJ=tJ({name:`X Bar`,label:`x̄`,latex:`\\overline{x}`,write:`\\overline{x}`}),rJ=tJ({name:`Y Bar`,latex:`\\overline{y}`,write:`\\overline{y}`}),iJ=tJ({name:`mu`,label:`mu`,latex:`\\mu`,write:`\\mu`}),aJ=tJ({name:`Sigma`,ariaLabel:`Uppercase Sigma`,label:`\\Sigma`,latex:`\\Sigma`,write:`\\Sigma`}),oJ=tJ({name:`sigma`,ariaLabel:`Lowercase Sigma`,label:`\\sigma`,latex:`\\sigma`,write:`\\sigma`}),sJ=s({divide:()=>fJ,equals:()=>lJ,minus:()=>dJ,multiply:()=>pJ,plus:()=>uJ}),cJ=EK(`operators`),lJ=cJ({write:`=`,label:`=`}),uJ=cJ({write:`+`,label:`+`}),dJ=cJ({write:`−`,label:`−`}),fJ=cJ({name:`divide`,label:`÷`,command:`\\divide`,otherNotation:`\\div`}),pJ=cJ({name:`multiply`,label:`×`,command:`\\times`}),mJ=s({doubleCellMatrix:()=>_J,singleCellMatrix:()=>gJ}),hJ=EK(`matrices`),gJ=hJ({name:`Single Cell Matrix`,label:`[ ]`,write:`\\begin{pmatrix}\\end{pmatrix}`}),_J=hJ({name:`Double Cell Matrix`,label:`[ ] [ ] \\\\newline [ ] [ ]`,write:`\\begin{bmatrix}&\\\\&\\end{bmatrix}`}),vJ={0:`zero`,1:`one`,2:`two`,3:`three`,4:`four`,5:`five`,6:`six`,7:`seven`,8:`eight`,9:`nine`},yJ=T(10,String).map(e=>({name:vJ[e],write:e,label:e,category:`digit`})).reduce((e,t)=>(e[t.name]=t,e),{comma:{name:`comma`,label:`,`,write:`,`,category:`digit`},decimalPoint:{name:`decimal-point`,label:`.`,write:`.`,category:`digit`}}),bJ=EK(`logic`),xJ=bJ({name:`Therefore`,label:`∴`,write:`∴`}),SJ=bJ({name:`Long division`,latex:`\\longdiv{}`,command:`\\longdiv`}),CJ=EK(`navigation`),wJ=CJ({label:`◀`,keystroke:`Left`,ariaLabel:`Move cursor left`}),TJ=CJ({label:`▶`,keystroke:`Right`,ariaLabel:`Move cursor right`}),EJ={label:`⌫`,category:`edit`,keystroke:`Backspace`,ariaLabel:`Delete`},DJ=[[LK,QK,MK,HK,WK],[Wq,NK,$q,UK,GK],[JK,SK,CK,wK,TK],[oq,PK,XK,ZK,YK],[tq,fq,pq,mq,Pq]],OJ=(()=>{let e=[...DJ.map(e=>[...e])];return e[0].push({name:`i`,latex:`i`,write:`i`}),e[1].push(qq),e[2].push(Jq),e[3].push(Yq),e[4].push(sq),e})(),kJ=(()=>{let e=[...DJ.map(e=>[...e])];return e[0].push(iJ),e[1].push(nJ),e[2].push(rJ),e[3].push(aJ),e[4].push(oJ),e})(),AJ=[{predicate:e=>e>=3&&e<=5,set:[[SK,CK],[RK,zK],[MK,SJ],[HK,UK]]},{predicate:e=>e>=6&&e<=7,set:[[Pq,SK,CK],[Wq,wK,TK],[MK,NK,HK,UK],[JK,RK,zK,WK],[oq,XK,YK,GK]]},{predicate:e=>e>=8||e===`HS`,set:DJ},{predicate:`non-negative-integers`,set:[[yJ.seven,yJ.eight,yJ.nine],[yJ.four,yJ.five,yJ.six],[yJ.one,yJ.two,yJ.three],[yJ.zero,{name:``,latex:``,write:``},{name:``,latex:``,write:``}],[wJ,TJ,EJ]]},{predicate:`integers`,set:[[yJ.seven,yJ.eight,yJ.nine],[yJ.four,yJ.five,yJ.six],[yJ.one,yJ.two,yJ.three],[yJ.zero,{name:``,latex:``,write:``},dJ],[wJ,TJ,EJ]]},{predicate:`decimals`,set:[[yJ.seven,yJ.eight,yJ.nine],[yJ.four,yJ.five,yJ.six],[yJ.one,yJ.two,yJ.three],[yJ.zero,yJ.decimalPoint,dJ],[wJ,TJ,EJ]]},{predicate:`fractions`,set:[[yJ.seven,yJ.eight,yJ.nine],[yJ.four,yJ.five,yJ.six],[yJ.one,yJ.two,yJ.three],[yJ.zero,LK,dJ],[wJ,TJ,EJ]]},{predicate:`geometry`,set:[[LK,Pq,Rq,zq,Iq,Fq],[Wq,Dq,kq,Aq,Lq,rq],[fq,pq,mq,oq,WK,GK],[gq,hq,_q,PK,$q,UK],[bq,xq,Sq,Oq,Eq,wq]]},{predicate:`advanced-algebra`,set:OJ},{predicate:`statistics`,set:kJ},{predicate:`item-authoring`,set:[[fJ,LK,SJ,lq,HK,WK,bq,xq,Sq,qq],[pJ,Wq,{name:``,latex:``,write:``},$q,UK,GK,Eq,wq,Oq,Jq],[JK,oq,PK,Pq,Dq,Bq,Vq,Aq,jq,Yq],[tq,YK,oJ,iJ,xJ,aJ,Hq,fq,pq,mq],[wK,TK,{name:``,latex:``,write:``},{name:``,latex:``,write:``},cq,{name:``,latex:``,write:``},{name:``,latex:``,write:``},gq,hq,_q]]},{predicate:e=>e>=1&&e<=2,set:[]}],jJ=e=>{let t=parseInt(e,10);if(e=isNaN(t)?e:t,!e)return[];let n=AJ.find(t=>typeof t.predicate==`string`?t.predicate===e:t.predicate(e));if(n)return n.set||[];if(e!==`language`)return AJ[2].set},MJ=[...Object.values(sJ),...Object.values(bK),...Object.values(iq),...Object.values(yJ),...Object.values(BK),...Object.values(FK),...Object.values(vq),...Object.values(Gq),...Object.values(mJ),...Object.values(KK),...Object.values(Uq),...Object.values(eJ),...Object.values(Xq),...Object.values(uq),...Object.values(AK)],NJ=e=>(e||[]).map(e=>{let{latex:t}=e,n=(MJ||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}),PJ=()=>{(Array.from(document.querySelectorAll(`span[mathquill-command-id]`))||[]).forEach(e=>{e&&e.innerText===`∥`&&e.className!==`mq-editable-field`&&(e.style.fontSize=`32px`),(e.innerText===`′`||e.innerText===`′′`)&&!e.hasAttribute(`data-prime`)&&e.setAttribute(`data-prime`,`true`)})},{one:FJ,two:IJ,three:LJ,four:RJ,five:zJ,six:BJ,seven:VJ,eight:HJ,nine:UJ,zero:WJ,comma:GJ,decimalPoint:KJ}=yJ,qJ=[[VJ,HJ,UJ,fJ],[RJ,zJ,BJ,pJ],[FJ,IJ,LJ,dJ],[WJ,KJ,GJ,uJ],[wJ,TJ,EJ,lJ]];function K(e){this.elements=Array.isArray(e)?e:[e].filter(Boolean),this.length=this.elements.length;for(var t=0;t<this.elements.length;t++)this[t]=this.elements[t]}K.prototype.addClass=function(e){var t=(e||``).split(/\s+/).filter(Boolean);return this.elements.forEach(function(e){t.forEach(function(t){e.classList.add(t)})}),this},K.prototype.removeClass=function(e){return this.elements.forEach(function(t){e?(e||``).split(/\s+/).filter(Boolean).forEach(function(e){t.classList.remove(e)}):t.className=``}),this},K.prototype.toggleClass=function(e,t){var n=(e||``).split(/\s+/).filter(Boolean),r=arguments.length>1?!!t:null;return this.elements.forEach(function(e){n.forEach(function(t){r===null?e.classList.toggle(t):e.classList.toggle(t,r)})}),this},K.prototype.attr=function(e,t){return t===QJ?this.elements[0]?this.elements[0].getAttribute(e):QJ:(this.elements.forEach(function(n){n.setAttribute(e,t)}),this)},K.prototype.html=function(e){return e===QJ?this.elements[0]?this.elements[0].innerHTML:``:(this.elements.forEach(function(t){t.innerHTML=e}),this)},K.prototype.append=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e){e.appendChild(t)}),this},K.prototype.prepend=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e,n){var r=n===0?t:t.cloneNode(!0);e.insertBefore(r,e.firstChild)}),this},K.prototype.wrapAll=function(e){if(!this.elements.length)return this;var t;if(typeof e==`string`&&e.trim().indexOf(`<`)===0){var n=document.createElement(`div`);n.innerHTML=e.trim(),t=n.firstChild}else if(e instanceof K)t=e.elements[0];else if(e&&e.nodeType)t=e;else return this;var r=this.elements[0],i=r.parentNode;return i&&(i.insertBefore(t,r),this.elements.forEach(function(e){t.appendChild(e)})),this},K.prototype.appendTo=function(e){var t=e instanceof K?e.elements[0]:e;return t&&this.elements.forEach(function(e){t.appendChild(e)}),this},K.prototype.prependTo=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.firstChild;return this.elements.forEach(function(e){t.insertBefore(e,n),n=e}),this},K.prototype.insertBefore=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode;return n&&this.elements.forEach(function(e){n.insertBefore(e,t)}),this},K.prototype.insertAfter=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode,r=t.nextSibling;return n&&this.elements.forEach(function(e){n.insertBefore(e,r),r=e}),this},K.prototype.replaceWith=function(e){var t=[];return e instanceof K?t=e.elements.slice():e&&typeof e.length==`number`&&!e.tagName?t=Array.from(e):e&&e.nodeType&&(t=[e]),this.elements.forEach(function(e){var n=e.parentNode;n&&(t.forEach(function(t){n.insertBefore(t,e)}),n.removeChild(e))}),this},K.prototype.insDirOf=function(e,t){return e===-1?this.insertBefore(t.first()):this.insertAfter(t.last())},K.prototype.insAtDirEnd=function(e,t){return e===-1?this.prependTo(t):this.appendTo(t)},K.prototype.children=function(e){var t=[];return this.elements.forEach(function(n){var r;if(!e)r=Array.from(n.children);else if(e===`:first`)r=n.firstElementChild?[n.firstElementChild]:[];else if(e===`:last`)r=n.lastElementChild?[n.lastElementChild]:[];else{var i=/^:eq\((\d+)\)$/.exec(e);if(i){var a=parseInt(i[1],10),o=Array.from(n.children);r=o[a]?[o[a]]:[]}else r=Array.from(n.querySelectorAll(`:scope > `+e))}t.push.apply(t,r)}),new K(t)},K.prototype.find=function(e){var t=[];return this.elements.forEach(function(n){var r=Array.from(n.querySelectorAll(e));t.push.apply(t,r)}),new K(t)},K.prototype.closest=function(e){return new K(this.elements.map(function(t){return t.closest(e)}).filter(Boolean))},K.prototype.contents=function(){var e=[];return this.elements.forEach(function(t){var n=Array.from(t.childNodes);e.push.apply(e,n)}),new K(e)},K.prototype.filter=function(e){return new K(this.elements.filter(function(t,n){return e(n,t)}))},K.prototype.detach=function(){return this.elements.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this},K.prototype.remove=function(){return this.elements.forEach(function(e){e.remove()}),this},K.prototype.empty=function(){return this.elements.forEach(function(e){e.innerHTML=``}),this};function JJ(e){return(e||``).split(`.`)[0]}K.prototype.on=function(e,t){var n=JJ(e);return this.elements.forEach(function(e){e.addEventListener(n,t)}),this},K.prototype.bind=function(e,t,n){var r=this;if(typeof e==`object`){for(var i in e)e.hasOwnProperty(i)&&r.bind(i,e[i]);return this}var a=typeof t==`function`?t:n;return a===!1&&(a=function(e){e.preventDefault()}),(e||``).split(/\s+/).filter(Boolean).forEach(function(e){var t=JJ(e);r.elements.forEach(function(e){e.addEventListener(t,a)})}),this},K.prototype.off=function(e,t){var n=JJ(e);return this.elements.forEach(function(e){e.removeEventListener(n,t)}),this},K.prototype.unbind=function(e,t){if(e&&e.includes(`.`))this.elements.forEach(function(e){var t=e.cloneNode(!0);e.parentNode&&e.parentNode.replaceChild(t,e)});else if(e&&t){var n=JJ(e);this.elements.forEach(function(e){e.removeEventListener(n,t)})}return this},K.prototype.trigger=function(e){var t=new Event(JJ(e),{bubbles:!0,cancelable:!0});return this.elements.forEach(function(e){e.dispatchEvent(t)}),this},K.prototype.focus=function(e){return typeof e==`function`?this.on(`focus`,e):(this.elements.forEach(function(e){e.focus&&e.focus()}),this)},K.prototype.blur=function(e){return typeof e==`function`?this.on(`blur`,e):(this.elements.forEach(function(e){e.blur&&e.blur()}),this)},[`mousemove`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`click`,`keydown`,`keypress`,`keyup`,`focusout`,`paste`,`cut`,`copy`,`input`,`load`].forEach(function(e){K.prototype[e]=function(t){return this.on(e,t)}}),K.prototype.next=function(e){return new K(this.elements.map(function(e){return e.nextElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.prev=function(e){return new K(this.elements.map(function(e){return e.previousElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.parent=function(){return new K(this.elements.map(function(e){return e.parentElement}).filter(Boolean))},K.prototype.offset=function(){if(!this.elements[0])return{top:0,left:0};var e=this.elements[0].getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft)}},K.prototype.width=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.width)||e.getBoundingClientRect().width},K.prototype.height=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.height)||e.getBoundingClientRect().height},K.prototype.outerWidth=function(){return this.elements[0]?this.elements[0].offsetWidth:0},K.prototype.outerHeight=function(){return this.elements[0]?this.elements[0].offsetHeight:0},K.prototype.innerWidth=function(){return this.elements[0]?this.elements[0].clientWidth:0},K.prototype.innerHeight=function(){return this.elements[0]?this.elements[0].clientHeight:0},K.prototype.css=function(e,t){if(t===QJ){if(typeof e==`string`){var n=this.elements[0];return n?window.getComputedStyle(n).getPropertyValue(e.replace(/([A-Z])/g,`-$1`).toLowerCase()):QJ}}else this.elements.forEach(function(n){n.style[e]=t});return this},K.prototype.scrollTop=function(e){var t=this.elements[0];return e===QJ?t?t===window?window.pageYOffset||document.documentElement.scrollTop:t.scrollTop:0:(t===window?window.scrollTo(window.pageXOffset||0,e):this.elements.forEach(function(t){t.scrollTop=e}),this)},K.prototype.scrollLeft=function(e){var t=this.elements[0];return e===QJ?t?t===window?window.pageXOffset||document.documentElement.scrollLeft:t.scrollLeft:0:(t===window?window.scrollTo(e,window.pageYOffset||0):this.elements.forEach(function(t){t.scrollLeft=e}),this)},K.prototype.each=function(e){return this.elements.forEach(function(t,n){e.call(t,n,t)}),this},K.prototype.eq=function(e){return new K([this.elements[e]])},K.prototype.get=function(e){return e===QJ?this.elements:e<0?this.elements[this.elements.length+e]:this.elements[e]},K.prototype.add=function(e){var t=this.elements.slice();return e instanceof K?t.push.apply(t,e.elements):Array.isArray(e)?t.push.apply(t,e):e&&e.nodeType&&t.push(e),new K(t)},K.prototype.first=function(){return new K([this.elements[0]])},K.prototype.last=function(){return new K([this.elements[this.elements.length-1]])},K.prototype.index=function(e){if(!e){var t=this.elements[0]&&this.elements[0].parentElement;return t?Array.from(t.children).indexOf(this.elements[0]):-1}var n=e instanceof K?e.elements[0]:e;return this.elements.indexOf(n)},K.prototype.is=function(e){return this.elements.some(function(t){return t.matches(e)})},K.prototype.text=function(e){return e===QJ?this.elements.map(function(e){return e.textContent}).join(``):(this.elements.forEach(function(t){t.textContent=e}),this)},K.prototype.val=function(e){var t=this.elements[0];return t?e===QJ?t.value===QJ?t.textContent:t.value:(this.elements.forEach(function(t){t.value===QJ?t.textContent=e:t.value=e}),this):QJ};function YJ(e){var t=Array.isArray(e)?e:[e].filter(Boolean),n=Object.create(K.prototype);n.elements=t,n.length=t.length;for(var r=0;r<t.length;r++)n[r]=t[r];return n}var XJ=function(e,t){var n;if(!e)n=[];else if(e===window||e===document)n=[e];else if(e.nodeType)n=[e];else if(e&&e.current&&e.current.nodeType)n=[e.current];else if(typeof e==`string`&&e[0]===`<`){var r=document.createElement(`div`);r.innerHTML=e.trim(),n=Array.from(r.children)}else if(typeof e==`string`){var i=t instanceof K?t.elements[0]:t||document;n=Array.from(i.querySelectorAll(e))}else n=e instanceof K?e.elements:e.length===QJ?[]:Array.from(e);return YJ(n)};XJ.contains=function(e,t){return e!==t&&e.contains(t)};var ZJ=XJ,QJ,$J=`mathquill-command-id`,eY=`mathquill-block-id`,tY=Math.min,nY=Math.max;function rY(){}var iY=[].slice;function aY(e){var t=e.length-1;return function(){var n=iY.call(arguments,0,t),r=iY.call(arguments,t);return e.apply(this,n.concat([r]))}}var oY=aY(function(e,t){return aY(function(n,r){if(e in n)return n[e].apply(n,t.concat(r))})});function sY(e){return aY(function(t,n){return typeof t!=`function`&&(t=oY(t)),e.call(this,function(e){return t.apply(e,[e].concat(n))})})}function q(e){var t=iY.call(arguments,1);return function(){return e.apply(this,t)}}function cY(e,t){if(!t)throw Error(`prayer failed: `+e)}var J=(function(e,t,n){function r(e){return typeof e==`object`}function i(e){return typeof e==`function`}function a(){}return function o(s,c){c===n&&(c=s,s=Object);function l(){var e=new u;return i(e.init)&&e.init.apply(e,arguments),e}function u(){}l.Bare=u;var d=a[e]=s[e],f=u[e]=l[e]=l.p=new a,p;return f.constructor=l,l.extend=function(e){return o(l,e)},(l.open=function(e){if(p={},i(e)?p=e.call(l,f,d,l,s):r(e)&&(p=e),r(p))for(var n in p)t.call(p,n)&&(f[n]=p[n]);return i(f.init)||(f.init=s),l})(c)}})(`prototype`,{}.hasOwnProperty),Y=-1,X=1;function lY(e){cY(`a direction was passed`,e===Y||e===X)}var uY=J(function(e){e.parent=0,e[Y]=0,e[X]=0,e.init=function(e,t,n){this.parent=e,this[Y]=t,this[X]=n},this.copy=function(e){return uY(e.parent,e[Y],e[X])}}),dY=J(function(e){e[Y]=0,e[X]=0,e.parent=0;var t=0;function n(){return t+=1}this.byId={},e.init=function(){this.id=n(),dY.byId[this.id]=this,this.ends={},this.ends[Y]=0,this.ends[X]=0},e.dispose=function(){delete dY.byId[this.id]},e.toString=function(){return`{{ MathQuill Node #`+this.id+` }}`},e.jQ=XJ(),e.jQadd=function(e){return this.jQ=this.jQ.add(e)},e.jQize=function(e){var e=XJ(e||this.html());function t(e){if(e.getAttribute){var n=e.getAttribute(`mathquill-command-id`),r=e.getAttribute(`mathquill-block-id`);n&&dY.byId[n].jQadd(e),r&&dY.byId[r].jQadd(e)}for(e=e.firstChild;e;e=e.nextSibling)t(e)}for(var n=0;n<e.length;n+=1)t(e[n]);return e},e.createDir=function(e,t){lY(e);var n=this;return n.jQize(),n.jQ.insDirOf(e,t.jQ),t[e]=n.adopt(t.parent,t[Y],t[X]),n},e.createLeftOf=function(e){return this.createDir(Y,e)},e.selectChildren=function(e,t){return _Y(e,t)},e.bubble=sY(function(e){for(var t=this;t&&e(t)!==!1;t=t.parent);return this}),e.postOrder=sY(function(e){return(function t(n){n.eachChild(t),e(n)})(this),this}),e.isEmpty=function(){return this.ends[Y]===0&&this.ends[X]===0},e.isStyleBlock=function(){return!1},e.children=function(){return pY(this.ends[Y],this.ends[X])},e.eachChild=function(){var e=this.children();return e.each.apply(e,arguments),this},e.foldChildren=function(e,t){return this.children().fold(e,t)},e.withDirAdopt=function(e,t,n,r){return pY(this,this).withDirAdopt(e,t,n,r),this},e.adopt=function(e,t,n){return pY(this,this).adopt(e,t,n),this},e.disown=function(){return pY(this,this).disown(),this},e.remove=function(){return this.jQ.remove(),this.postOrder(`dispose`),this.disown()}});function fY(e,t,n){cY(`a parent is always present`,e),t&&(t[X]!==n&&(t[X]=n),t.parent!==e&&(t.parent=e)),n&&(n[Y]!==t&&(n[Y]=t),n.parent!==e&&(n.parent=e)),cY(`leftward is properly set up`,(function(){return t?t[X]===n&&t.parent===e:e.ends[Y]===n})()),cY(`rightward is properly set up`,(function(){return n?n[Y]===t&&n.parent===e:e.ends[X]===t})())}var pY=J(function(e){e.init=function(e,t,n){if(n===QJ&&(n=Y),lY(n),cY(`no half-empty fragments`,!e==!t),this.ends={},e){cY(`withDir is passed to Fragment`,e instanceof dY),cY(`oppDir is passed to Fragment`,t instanceof dY),cY(`withDir and oppDir have the same parent`,e.parent===t.parent),this.ends[n]=e,this.ends[-n]=t;var r=this.fold([],function(e,t){return e.push.apply(e,t.jQ.get()),e});this.jQ=this.jQ.add(r)}},e.jQ=XJ(),e.withDirAdopt=function(e,t,n,r){return e===Y?this.adopt(t,n,r):this.adopt(t,r,n)},e.adopt=function(e,t,n){fY(e,t,n);var r=this;r.disowned=!1;var i=r.ends[Y];if(!i)return this;var a=r.ends[X];return t||(e.ends[Y]=i),n?n[Y]=a:e.ends[X]=a,r.ends[X][X]=n,r.each(function(n){n[Y]=t,n.parent=e,t&&(t[X]=n),t=n}),r},e.disown=function(){var e=this,t=e.ends[Y];if(!t||e.disowned)return e;e.disowned=!0;var n=e.ends[X],r=t.parent;return fY(r,t[Y],t),fY(r,n,n[X]),t[Y]?t[Y][X]=n[X]:r.ends[Y]=n[X],n[X]?n[X][Y]=t[Y]:r.ends[X]=t[Y],e},e.remove=function(){return this.jQ.remove(),this.each(`postOrder`,`dispose`),this.disown()},e.each=sY(function(e){var t=this,n=t.ends[Y];if(!n)return t;for(;n!==t.ends[X][X]&&e(n)!==!1;n=n[X]);return t}),e.fold=function(e,t){return this.each(function(n){e=t.call(this,e,n)}),e}}),Z={},mY={},hY={},gY=J(uY,function(e){e.init=function(e,t){this.parent=e,this.options=t;var n=this.jQ=this._jQ=XJ(`<span class="mq-cursor">&#8203;</span>`);this.blink=function(){n.toggleClass(`mq-blink`)},this.upDownCache={}},e.show=function(){return this.jQ=this._jQ.removeClass(`mq-blink`),`intervalId`in this?clearInterval(this.intervalId):(this[X]?this.selection&&this.selection.ends[Y][Y]===this[Y]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[X].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},e.hide=function(){return`intervalId`in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=XJ(),this},e.withDirInsertAt=function(e,t,n,r){var i=this.parent;this.parent=t,this[e]=n,this[-e]=r,i!==t&&i.blur&&i.blur(this)},e.insDirOf=function(e,t){return lY(e),!t||!t.jQ?this:(this.jQ.insDirOf(e,t.jQ),this.withDirInsertAt(e,t.parent,t[e],t),this.parent.jQ.addClass(`mq-hasCursor`),this)},e.insLeftOf=function(e){return this.insDirOf(Y,e)},e.insRightOf=function(e){return this.insDirOf(X,e)},e.insAtDirEnd=function(e,t){return lY(e),this.jQ.insAtDirEnd(e,t.jQ),this.withDirInsertAt(e,t,0,t.ends[e]),t.focus(),this},e.insAtLeftEnd=function(e){return this.insAtDirEnd(Y,e)},e.insAtRightEnd=function(e){return this.insAtDirEnd(X,e)},e.jumpUpDown=function(e,t){var n=this;n.upDownCache[e.id]=uY.copy(n);var r=n.upDownCache[t.id];if(r)r[X]?n.insLeftOf(r[X]):n.insAtRightEnd(r.parent);else{var i=n.offset().left;t.seek(i,n)}},e.offset=function(){var e=this,t=e.jQ.removeClass(`mq-cursor`).offset();return e.jQ.addClass(`mq-cursor`),t},e.unwrapGramp=function(){var e=this.parent.parent,t=e.parent,n=e[X],r=this,i=e[Y];if(e.disown().eachChild(function(r){r.isEmpty()||(r.children().adopt(t,i,n).each(function(t){t.jQ.insertBefore(e.jQ.first())}),i=r.ends[X])}),!this[X])if(this[Y])this[X]=this[Y][X];else for(;!this[X];)if(this.parent=this.parent[X],this.parent)this[X]=this.parent.ends[Y];else{this[X]=e[X],this.parent=t;break}this[X]?this.insLeftOf(this[X]):this.insAtRightEnd(t),e.jQ.remove(),e[Y].siblingDeleted&&e[Y].siblingDeleted(r.options,X),e[X].siblingDeleted&&e[X].siblingDeleted(r.options,Y)},e.startSelection=function(){for(var e=this.anticursor=uY.copy(this),t=e.ancestors={},n=e;n.parent;n=n.parent)t[n.parent.id]=n},e.endSelection=function(){delete this.anticursor},e.select=function(){var e=this.anticursor;if(!e||!e.ancestors||this[Y]===e[Y]&&this.parent===e.parent)return!1;for(var t,n=this;n.parent;n=n.parent)if(n.parent.id in e.ancestors){t=n.parent;break}if(!t)return!1;var r=e.ancestors[t.id],i,a,o=X;if(n[Y]!==r){for(var s=n;s;s=s[X])if(s[X]===r[X]){o=Y,i=n,a=r;break}}return o===X&&(i=r,a=n),i instanceof uY&&(i=i[X]),a instanceof uY&&(a=a[Y]),!i||!a?!1:(this.hide().selection=t.selectChildren(i,a),this.insDirOf(o,this.selection.ends[o]),this.selectionChanged(),!0)},e.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.selectionChanged()),this},e.deleteSelection=function(){this.selection&&(this[Y]=this.selection.ends[Y][Y],this[X]=this.selection.ends[X][X],this.selection.remove(),this.selectionChanged(),delete this.selection)},e.replaceSelection=function(){var e=this.selection;return e&&(this[Y]=e.ends[Y][Y],this[X]=e.ends[X][X],delete this.selection),e},e.depth=function(){for(var e=this,t=0;e=e.parent;)t+=+(e instanceof RY);return t},e.isTooDeep=function(e){if(this.options.maxDepth!==QJ)return this.depth()+(e||0)>this.options.maxDepth},e.howDeep=function(){for(var e=0,t=this;t=t.parent;)e++;return 1+Math.floor(e/2)},e.tooDeep=function(){var e=this.options.maxDepth;return e&&this.howDeep()>e}}),_Y=J(pY,function(e,t){e.init=function(){t.init.apply(this,arguments),this.jQ=this.jQ.wrapAll(`<span class="mq-selection"></span>`).parent()},e.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),t.adopt.apply(this,arguments)},e.clear=function(){var e=this.jQ[0];return e&&this.jQ.replaceWith(e.childNodes),this},e.join=function(e){return this.fold(``,function(t,n){return t+n[e]()})}}),vY=J(function(e){e.init=function(e,t,n){this.id=e.id,this.data={},this.root=e,this.container=t,this.options=n,e.controller=this,this.cursor=e.cursor=gY(e,n)},e.handle=function(e,t){var n=this.options.handlers;if(n&&n.fns[e]){var r=n.APIClasses[this.KIND_OF_MQ](this);t===Y||t===X?n.fns[e](t,r):n.fns[e](r)}};var t=[];this.onNotify=function(e){t.push(e)},e.notify=function(){for(var e=0;e<t.length;e+=1)t[e].apply(this.cursor,arguments);return this}}),yY={},bY=J(),xY={},SY=J(),CY={};function wY(){window.console&&console.warn(`You are using the MathQuill API without specifying an interface version, which will fail in v1.0.0. Easiest fix is to do the following before doing anything else:
317
317
 
318
318
  MathQuill = MathQuill.getInterface(1);
319
319
  // now MathQuill.MathField() works like it used to
320
320
 
321
321
  See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
322
- https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)}function _Y(e){return gY(),DX(e)}_Y.prototype=mY.p,_Y.VERSION=`v1.2.1-beta.1`,_Y.interfaceVersion=function(e){if(e!==1)throw`Only interface version 1 supported. You specified: `+e;return gY=function(){window.console&&console.warn(`You called MathQuill.interfaceVersion(1); to specify the interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:
322
+ https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)}function TY(e){return wY(),FX(e)}TY.prototype=SY.p,TY.VERSION=`v1.2.1-beta.1`,TY.interfaceVersion=function(e){if(e!==1)throw`Only interface version 1 supported. You specified: `+e;return wY=function(){window.console&&console.warn(`You called MathQuill.interfaceVersion(1); to specify the interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:
323
323
 
324
324
  MathQuill = MathQuill.getInterface(1);
325
325
  // now MathQuill.MathField() works like it used to
326
326
 
327
327
  See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
328
- https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)},gY(),_Y},_Y.getInterface=bY;var vY=bY.MIN=1,yY=bY.MAX=3;function bY(e){if(!(vY<=e&&e<=yY))throw`Only interface versions between `+vY+` and `+yY+` supported. You specified: `+e;if(e<3&&typeof window<`u`&&!window.jQuery)throw`MathQuill interface version `+e+` requires jQuery 1.5.2+ to be loaded first`;function t(e){if(!e||!e.nodeType)return null;var t=HJ(e).children(`.mq-root-block`).attr(KJ),r=t&&rY.byId[t].controller;return r?n[r.KIND_OF_MQ](r):null}var n={};t.L=Y,t.R=X,t.saneKeyboardEvents=wY;function r(e,t){for(var r in t&&t.handlers&&(t.handlers={fns:t.handlers,APIClasses:n}),t)if(t.hasOwnProperty(r)){var i=t[r],a=pY[r];e[r]=a?a(i):i}}t.config=function(e){return r(fY.p,e),this},t.registerEmbed=function(e,t){if(!/^[a-z][a-z0-9]*$/i.test(e))throw`Embed name must start with letter and be only letters and digits`;hY[e]=t};var i=n.AbstractMathQuill=J(mY,function(t){t.init=function(e){this.__controller=e,this.__options=e.options,this.id=e.id,this.data=e.data},t.parseLatex=function(e){return this.__controller.parseLatex(e)},t.__mathquillify=function(t){var n=this.__controller,r=n.root,i=n.container;n.createTextarea();var a=i.addClass(t).contents().detach();r.jQ=HJ(`<span class="mq-root-block"/>`).attr(KJ,r.id).appendTo(i),this.latex(a.text()),this.revert=function(){var t=i.empty().unbind(`.mathquill`).removeClass(`mq-editable-field mq-math-mode mq-text-mode`).append(a);return e>=3?t[0]:t}},t.config=function(e){return r(this.__options,e),this},t.el=function(){return this.__controller.container[0]},t.text=function(){return this.__controller.exportText()},t.latex=function(e){return arguments.length>0?(this.__controller.renderLatexMath(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},t.html=function(){return this.__controller.root.jQ.html().replace(/ mathquill-(?:command|block)-id="?\d+"?/g,``).replace(/<span class="?mq-cursor( mq-blink)?"?>.?<\/span>/i,``).replace(/ mq-hasCursor|mq-hasCursor ?/,``).replace(/ class=(""|(?= |>))/g,``)},t.reflow=function(){return this.__controller.root.postOrder(`reflow`),this}});for(var a in t.prototype=i.prototype,n.EditableField=J(i,function(e,t){e.__mathquillify=function(){return t.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},e.focus=function(){return this.__controller.textarea.focus(),this},e.blur=function(){return this.__controller.textarea.blur(),this},e.write=function(e){return this.__controller.writeLatex(e),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},e.empty=function(){var e=this.__controller.root,t=this.__controller.cursor;return e.eachChild(`postOrder`,`dispose`),e.ends[Y]=e.ends[X]=0,e.jQ.empty(),delete t.selection,t.insAtRightEnd(e),this},e.cmd=function(e){var t=this.__controller.notify(),n=t.cursor;if(/^\\[a-z]+$/i.test(e)&&!n.isTooDeep()){e=e.slice(1);var r=Z[e];r&&(e=r(e),n.selection&&e.replaces(n.replaceSelection()),e.createLeftOf(n.show()),this.__controller.scrollHoriz())}else n.parent.write(n,e);return t.blurred&&n.hide().parent.blur(),this},e.select=function(){var e=this.__controller;for(e.notify(`move`).cursor.insAtRightEnd(e.root);e.cursor[Y];)e.selectLeft();return this},e.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},e.moveToDirEnd=function(e){return this.__controller.notify(`move`).cursor.insAtDirEnd(e,this.__controller.root),this},e.moveToLeftEnd=function(){return this.moveToDirEnd(Y)},e.moveToRightEnd=function(){return this.moveToDirEnd(X)},e.keystroke=function(e){for(var e=e.replace(/^\s+|\s+$/g,``).split(/\s+/),t=0;t<e.length;t+=1)this.__controller.keystroke(e[t],{preventDefault:YJ});return this},e.typedText=function(e){for(var t=0;t<e.length;t+=1)this.__controller.typedText(e.charAt(t));return this},e.dropEmbedded=function(e,t,n){var r=e-HJ(window).scrollLeft(),i=t-HJ(window).scrollTop(),a=document.elementFromPoint(r,i);this.__controller.seek(HJ(a),e,t),TX().setOptions(n).createLeftOf(this.__controller.cursor)},e.clickAt=function(e,t,n){n||=document.elementFromPoint(e,t);var r=this.__controller,i=r.root;return UJ.contains(i.jQ[0],n)||(n=i.jQ[0]),r.seek(HJ(n),e+pageXOffset,t+pageYOffset),r.blurred&&this.focus(),this},e.ignoreNextMousedown=function(e){return this.__controller.cursor.options.ignoreNextMousedown=e,this}}),t.EditableField=function(){throw`wtf don't call me, I'm 'abstract'`},t.EditableField.prototype=n.EditableField.prototype,dY)(function(r,i){var a=n[r]=i(n);t[r]=function(n,i){var o=t(n);if(o instanceof a||!n||!n.nodeType)return o;var s=uY(a.RootBlock(),HJ(n),fY());return s.KIND_OF_MQ=r,a(s).__mathquillify(i,e)},t[r].prototype=a.prototype})(a,dY[a]);return t}_Y.noConflict=function(){return window.MathQuill=xY,_Y};var xY=window.MathQuill;window.MathQuill=_Y;function SY(e){for(var t=`moveOutOf deleteOutOf selectOutOf upOutOf downOutOf`.split(` `),n=0;n<t.length;n+=1)(function(t){e[t]=function(e){this.controller.handle(t,e)}})(t[n]);e.reflow=function(){this.controller.handle(`reflow`),this.controller.handle(`edited`),this.controller.handle(`edit`)}}var CY=J(function(e,t,n){function r(e,t){throw e=e?`'`+e+`'`:`EOF`,`Parse Error: `+t+` at `+e}e.init=function(e){this._=e},e.parse=function(e){return this.skip(o)._(``+e,t,r);function t(e,t){return t}},e.or=function(e){eY(`or is passed a parser`,e instanceof n);var t=this;return n(function(n,r,i){return t._(n,r,a);function a(t){return e._(n,r,i)}})},e.then=function(e){var t=this;return n(function(r,i,a){return t._(r,o,a);function o(t,r){var o=e instanceof n?e:e(r);return eY(`a parser is returned`,o instanceof n),o._(t,i,a)}})},e.many=function(){var e=this;return n(function(t,n,r){for(var i=[];e._(t,a,o););return n(t,i);function a(e,n){return t=e,i.push(n),!0}function o(){return!1}})},e.times=function(e,t){arguments.length<2&&(t=e);var r=this;return n(function(n,i,a){for(var o=[],s=!0,c,l=0;l<e;l+=1)if(s=r._(n,u,d),!s)return a(n,c);for(;l<t&&s;l+=1)s=r._(n,u,f);return i(n,o);function u(e,t){return o.push(t),n=e,!0}function d(e,t){return c=t,n=e,!1}function f(e,t){return!1}})},e.result=function(e){return this.then(a(e))},e.atMost=function(e){return this.times(0,e)},e.atLeast=function(e){var t=this;return t.times(e).then(function(e){return t.many().map(function(t){return e.concat(t)})})},e.map=function(e){return this.then(function(t){return a(e(t))})},e.skip=function(e){return this.then(function(t){return e.result(t)})},this.string=function(e){var t=e.length,r=`expected '`+e+`'`;return n(function(n,i,a){var o=n.slice(0,t);return o===e?i(n.slice(t),o):a(n,r)})};var i=this.regex=function(e){eY(`regexp parser is anchored`,e.toString().charAt(1)===`^`);var t=`expected `+e;return n(function(n,r,i){var a=e.exec(n);if(a){var o=a[0];return r(n.slice(o.length),o)}else return i(n,t)})},a=n.succeed=function(e){return n(function(t,n){return n(t,e)})};n.fail=function(e){return n(function(t,n,r){return r(t,e)})},n.letter=i(/^[a-z]/i),n.letters=i(/^[a-z]*/i),n.digit=i(/^[0-9]/),n.digits=i(/^[0-9]*/),n.whitespace=i(/^\s+/),n.optWhitespace=i(/^\s*/),n.any=n(function(e,t,n){return e?t(e.slice(1),e.charAt(0)):n(e,`expected any character`)}),n.all=n(function(e,t,n){return t(``,e)});var o=n.eof=n(function(e,t,n){return e?n(e,`expected EOF`):t(e,e)})}),wY=function(){var e={8:`Backspace`,9:`Tab`,10:`Enter`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Esc`,32:`Spacebar`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,45:`Insert`,46:`Del`,144:`NumLock`};function t(t){var n=t.which||t.keyCode,r=e[n],i,a=[];return t.ctrlKey&&a.push(`Ctrl`),t.originalEvent&&t.originalEvent.metaKey&&a.push(`Meta`),t.altKey&&a.push(`Alt`),t.shiftKey&&a.push(`Shift`),i=r||String.fromCharCode(n),!a.length&&!r?i:(a.push(i),a.join(`-`))}return function(e,n){var r=null,i=null,a=UJ(e),o=UJ(n.container||a),s=YJ,c;function l(e){s=e,clearTimeout(c),c=setTimeout(e)}function u(e){l(function(t){s=YJ,clearTimeout(c),e(t)})}o.bind(`keydown keypress input keyup focusout paste`,function(e){s(e)});function d(e){s(),s=YJ,clearTimeout(c),a.val(e),e&&a[0]&&a[0].select&&a[0].select(),f=!!e}var f=!1;function p(){var e=a[0];return`selectionStart`in e&&e.selectionStart!==e.selectionEnd}function m(){n.keystroke(t(r),r)}function h(e){r=e,i=null,f&&u(function(e){!(e&&e.type===`focusout`)&&a[0]&&a[0].select&&a[0].select()}),m()}function g(e){r&&i&&m(),i=e,l(v)}function _(e){r&&!i&&l(v)}function v(){if(!p()){var e=a.val();e.length===1?(a.val(``),n.typedText(e)):e&&a[0]&&a[0].select&&a[0].select()}}function y(){r=i=null}function b(e){a.focus(),l(x)}function x(){var e=a.val();a.val(``),e&&n.paste(e)}return o.bind({keydown:h,keypress:g,keyup:_,focusout:y,cut:function(){u(function(){n.cut()})},copy:function(){u(function(){n.copy()})},paste:b}),{select:d}}}();uY.open(function(e,t){e.exportText=function(){return this.root.foldChildren(``,function(e,t){return e+t.text()})}}),uY.open(function(e){e.focusBlurEvents=function(){var e=this,t=e.root,n=e.cursor,r;e.textarea.focus(function(){e.blurred=!1,clearTimeout(r),e.container.addClass(`mq-focused`),n.parent||n.insAtRightEnd(t),n.selection?(n.selection.jQ.removeClass(`mq-blur`),e.selectionChanged()):n.show()}).blur(function(){e.blurred=!0,r=setTimeout(function(){t.postOrder(`intentionalBlur`),n.clearSelection().endSelection(),a()}),HJ(window).bind(`blur`,i)});function i(){clearTimeout(r),n.selection&&n.selection.jQ.addClass(`mq-blur`),a()}function a(){n.hide().parent.blur(),e.container.removeClass(`mq-focused`),HJ(window).unbind(`blur`,i)}e.blurred=!0,n.hide().parent.blur()}}),uY.open(function(e){e.keystroke=function(e,t){this.cursor.parent.keystroke(e,t,this)}}),rY.open(function(e){e.keystroke=function(e,t,n){var r=n.cursor;switch(e){case`Ctrl-Shift-Backspace`:case`Ctrl-Backspace`:n.ctrlDeleteDir(Y);break;case`Shift-Backspace`:case`Backspace`:n.backspace();break;case`Esc`:case`Tab`:n.escapeDir(X,e,t);return;case`Shift-Tab`:case`Shift-Esc`:n.escapeDir(Y,e,t);return;case`End`:n.notify(`move`).cursor.insAtRightEnd(r.parent);break;case`Ctrl-End`:n.notify(`move`).cursor.insAtRightEnd(n.root);break;case`Shift-End`:for(;r[X];)n.selectRight();break;case`Ctrl-Shift-End`:for(;r[X]||r.parent!==n.root;)n.selectRight();break;case`Home`:n.notify(`move`).cursor.insAtLeftEnd(r.parent);break;case`Ctrl-Home`:n.notify(`move`).cursor.insAtLeftEnd(n.root);break;case`Shift-Home`:for(;r[Y];)n.selectLeft();break;case`Ctrl-Shift-Home`:for(;r[Y]||r.parent!==n.root;)n.selectLeft();break;case`Left`:n.moveLeft();break;case`Shift-Left`:n.selectLeft();break;case`Ctrl-Left`:break;case`Right`:n.moveRight();break;case`Shift-Right`:n.selectRight();break;case`Ctrl-Right`:break;case`Up`:n.moveUp();break;case`Down`:n.moveDown();break;case`Shift-Up`:if(r[Y])for(;r[Y];)n.selectLeft();else n.selectLeft();case`Shift-Down`:if(r[X])for(;r[X];)n.selectRight();else n.selectRight();case`Ctrl-Up`:break;case`Ctrl-Down`:break;case`Ctrl-Shift-Del`:case`Ctrl-Del`:n.ctrlDeleteDir(X);break;case`Shift-Del`:case`Del`:n.deleteForward();break;case`Meta-A`:case`Ctrl-A`:for(n.notify(`move`).cursor.insAtRightEnd(n.root);r[Y];)n.selectLeft();break;default:return}t.preventDefault(),n.scrollHoriz()},e.moveOutOf=e.moveTowards=e.deleteOutOf=e.deleteTowards=e.unselectInto=e.selectOutOf=e.selectTowards=function(){eY(`overridden or never called on this node`)}}),uY.open(function(e){this.onNotify(function(e){(e===`move`||e===`upDown`)&&this.show().clearSelection()}),e.escapeDir=function(e,t,n){tY(e);var r=this.cursor;if(r.parent!==this.root&&n.preventDefault(),r.parent!==this.root)return r.parent.moveOutOf(e,r),this.notify(`move`)},pY.leftRightIntoCmdGoes=function(e){if(e&&e!==`up`&&e!==`down`)throw`"up" or "down" required for leftRightIntoCmdGoes option, got "`+e+`"`;return e},e.moveDir=function(e){tY(e);var t=this.cursor,n=t.options.leftRightIntoCmdGoes;return t.selection?t.insDirOf(e,t.selection.ends[e]):t[e]?t[e].moveTowards(e,t,n):t.parent.moveOutOf(e,t,n),this.notify(`move`)},e.moveLeft=function(){return this.moveDir(Y)},e.moveRight=function(){return this.moveDir(X)},e.moveUp=function(){return t(this,`up`)},e.moveDown=function(){return t(this,`down`)};function t(e,t){var n=e.notify(`upDown`).cursor,r=t+`Into`,i=t+`OutOf`;return n[X][r]?n.insAtLeftEnd(n[X][r]):n[Y][r]?n.insAtRightEnd(n[Y][r]):n.parent.bubble(function(e){var t=e[i];if(t&&(typeof t==`function`&&(t=e[i](n)),t instanceof rY&&n.jumpUpDown(e,t),t!==!0))return!1}),e}this.onNotify(function(e){e!==`upDown`&&(this.upDownCache={})}),this.onNotify(function(e){e===`edit`&&this.show().deleteSelection()}),e.deleteDir=function(e){tY(e);var t=this.cursor,n=t.selection;return this.notify(`edit`),n||(t[e]?t[e].deleteTowards(e,t):t.parent.deleteOutOf(e,t)),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this},e.ctrlDeleteDir=function(e){tY(e);var t=this.cursor;return!t[e]||t.selection?this.deleteDir(e):(this.notify(`edit`),e===Y?aY(t.parent.ends[Y],t[Y]).remove():aY(t[X],t.parent.ends[X]).remove(),t.insAtDirEnd(e,t.parent),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this)},e.backspace=function(){return this.deleteDir(Y)},e.deleteForward=function(){return this.deleteDir(X)},this.onNotify(function(e){e!==`select`&&this.endSelection()}),e.selectDir=function(e){var t=this.notify(`select`).cursor,n=t.selection;tY(e),t.anticursor||t.startSelection();var r=t[e];r?n&&n.ends[e]===r&&t.anticursor[-e]!==r?r.unselectInto(e,t):r.selectTowards(e,t):t.parent.selectOutOf(e,t),t.clearSelection(),t.select()||t.show()},e.selectLeft=function(){return this.selectDir(Y)},e.selectRight=function(){return this.selectDir(X)}});var TY=/[\\]{2,}/gm,EY=(function(){function e(e){var t=AY();return e.adopt(t,0,0),t}function t(e){for(var t=e[0]||AY(),n=1;n<e.length;n+=1)e[n].children().adopt(t,t.ends[X],0);return t}var n=CY.string,r=CY.regex,i=CY.letter,a=CY.any,o=CY.optWhitespace,s=CY.succeed,c=CY.fail,l=i.map(function(e){return zY(e)}),u=r(/^[^${}\\_^]/).map(function(e){return Q(e)}),d=r(/^\\not\\[a-z]+/).then(function(e){return sY[e]&&sY[e]().parser()||c(`unknown compound command: `+e)}),f=r(/^[^\\a-eg-zA-Z]/).or(n(`\\`).then(r(/^begin\{.?matrix\}/).or(r(/^[a-z]+/i)).or(r(/^\s+/).result(` `)).or(a))).then(function(e){e=e.replace(/^begin\{(.?matrix)\}$/,`$1`);var t=Z[e];return t?t(e).parser():c(`unknown command: \\`+e)}),p=d.or(f).or(l).or(u),m=n(`{`).then(function(){return g}).skip(n(`}`)),h=o.then(m.or(p.map(e))),g=h.many().map(t).skip(o),_=n(`[`).then(h.then(function(e){return e.join(`latex`)===`]`?c():s(e)}).many().map(t).skip(o)).skip(n(`]`)),v=g;return v.block=h,v.optBlock=_,v})();uY.open(function(e,t){e.exportLatex=function(){return this.root.latex().replace(/(\\[a-z]+) (?![a-z])/gi,`$1`)},e.parseLatex=function(e){return EY.parse(e).postOrder(`finalizeTree`,fY.p).join(`latex`).trim()},pY.maxDepth=function(e){return typeof e==`number`?e:WJ},e.writeLatex=function(e){var t=this.notify(`edit`).cursor,n=CY.all,r=CY.eof,i=EY.skip(r).or(n.result(!1)).parse(e);return i&&!i.isEmpty()&&i.prepareInsertionAt(t)&&(i.children().adopt(t.parent,t[Y],t[X]),i.jQize().insertBefore(t.jQ),t[Y]=i.ends[X],i.finalizeInsert(t.options,t),i.ends[X][X].siblingCreated&&i.ends[X][X].siblingCreated(t.options,Y),i.ends[Y][Y].siblingCreated&&i.ends[Y][Y].siblingCreated(t.options,X),t.parent.bubble(`reflow`)),this},e.renderLatexMath=function(e){e&&e.replace&&(e=e.replace(TY,`\\`));var t=this.root,n=this.cursor;n.options;var r=t.jQ,i=CY.all,a=CY.eof,o=EY.skip(a).or(i.result(!1)).parse(e);if(t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,o&&o.prepareInsertionAt(n)){o.children().adopt(t,0,0);var s=o.join(`html`);r.html(s),t.jQize(r.children()),t.finalizeInsert(n.options)}else r.empty();delete n.selection,n.insAtRightEnd(t)},e.renderLatexText=function(e){var t=this.root,n=this.cursor;t.jQ.children().slice(1).remove(),t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,delete n.selection,n.show().insAtRightEnd(t);var r=CY.regex,i=CY.string,a=CY.eof,o=CY.all,s=i(`$`).then(EY).skip(i(`$`).or(a)).map(function(e){var t=FY(n);t.createBlocks();var r=t.ends[Y];return e.children().adopt(r,0,0),t}),c=i(`\\$`).result(`$`).or(r(/^[^$]/)).map(Q),l=s.or(c).many().skip(a).or(o.result(!1)).parse(e);if(l){for(var u=0;u<l.length;u+=1)l[u].adopt(t,t.ends[X],0);t.jQize().appendTo(t.jQ),t.finalizeInsert(n.options)}}}),uY.open(function(e){fY.p.ignoreNextMousedown=YJ,e.delegateMouseEvents=function(){var e=this.root.jQ;this.container.bind(`mousedown.mathquill`,function(t){var n=HJ(t.target).closest(`.mq-root-block`),r=rY.byId[n.attr(KJ)||e.attr(KJ)].controller,i=r.cursor;i.blink;var a=r.textareaSpan,o=r.textarea;if(t.preventDefault(),t.target.unselectable=!0,i.options.ignoreNextMousedown(t))return;i.options.ignoreNextMousedown=YJ;function s(e){i.anticursor||i.startSelection(),r.seek(HJ(e.target),e.pageX,e.pageY).cursor.select(),e.target&&HJ(e.target.ownerDocument).unbind(`mousemove`,c)}function c(e){return delete e.target,s(e)}function l(e){!i.selection&&!r.editable&&a.detach(),n.unbind(`mousemove`,s),HJ(e.target.ownerDocument).unbind(`mousemove`,c).unbind(`mouseup`,l)}if(a.parent().length===0)return!1;r.blurred&&(r.editable||n.prepend(a),document.body.focus(),o.focus()),t.preventDefault(),t.target.unselectable=!0,i.show(),r.seek(HJ(t.target),t.pageX,t.pageY).cursor.startSelection(),n.mousemove(s),HJ(t.target.ownerDocument).mousemove(c).mouseup(l)})}}),uY.open(function(e){e.seek=function(e,t,n){var r=this.notify(`select`).cursor;if(e){var i=e.attr(KJ)||e.attr(GJ);if(!i){var a=e.parent();i=a.attr(KJ)||a.attr(GJ)}}var o=i&&rY.byId[i]?rY.byId[i]:this.root;return r.clearSelection().show(),o.seek(t,r),this.scrollHoriz(),this}}),uY.open(function(e){e.scrollHoriz=function(){var e=this.cursor,t=e.selection,n=this.root.jQ[0].getBoundingClientRect();if(t){var r=t.jQ[0].getBoundingClientRect(),i=r.left-(n.left+20),a=r.right-(n.right-20);if(t.ends[Y]===e[X])if(i<0)var o=i;else if(a>0)if(r.left-a<n.left+20)var o=i;else var o=a;else return;else if(a>0)var o=a;else if(i<0)if(r.right-i>n.right-20)var o=a;else var o=i;else return}else{var s=e.jQ[0].getBoundingClientRect().left;if(s>n.right-20)var o=s-(n.right-20);else if(s<n.left+20)var o=s-(n.left+20);else return}this.root.jQ.stop&&typeof this.root.jQ.stop==`function`&&this.root.jQ.stop().animate({scrollLeft:`+=`+o},100)}}),uY.open(function(e){fY.p.substituteTextarea=function(){return HJ(`<textarea autocapitalize=off autocomplete=off autocorrect=off spellcheck=false x-palm-disable-ste-all=true />`)[0]},e.createTextarea=function(){var e=this.textareaSpan=HJ(`<span class="mq-textarea"></span>`),t=this.options.substituteTextarea();if(!t.nodeType)throw`substituteTextarea() must return a DOM element, got `+t;t=this.textarea=HJ(t).appendTo(e);var n=this;n.cursor.selectionChanged=function(){n.selectionChanged()}},e.selectionChanged=function(){var e=this;$Y(e.container[0]),e.textareaSelectionTimeout===WJ&&(e.textareaSelectionTimeout=setTimeout(function(){e.setTextareaSelection()}))},e.setTextareaSelection=function(){this.textareaSelectionTimeout=WJ;var e=``;this.cursor.selection&&(e=this.cursor.selection.join(`latex`),this.options.statelessClipboard&&(e=`$`+e+`$`)),this.selectFn(e)},e.staticMathTextareaEvents=function(){var e=this;e.root;var t=e.cursor,n=e.textarea,r=e.textareaSpan;this.container.prepend(UJ(`<span class="mq-selectable">`).text(`$`+e.exportLatex()+`$`)),e.blurred=!0,n.bind(`cut paste`,!1).bind(`copy`,function(){e.setTextareaSelection()}).focus(function(){e.blurred=!1}).blur(function(){t.selection&&t.selection.clear(),setTimeout(i)});function i(){r.detach(),e.blurred=!0}e.selectFn=function(e){n.val(e),e&&n.select()}},fY.p.substituteKeyboardEvents=wY,e.editablesTextareaEvents=function(){var e=this,t=e.textarea,n=e.textareaSpan,r=this.options.substituteKeyboardEvents(t,this);this.selectFn=function(e){r.select(e)},this.container.prepend(n),this.focusBlurEvents()},e.typedText=function(e){if(e===`
329
- `)return this.handle(`enter`);var t=this.notify().cursor;t.parent.write(t,e),this.scrollHoriz()},e.cut=function(){var e=this,t=e.cursor;t.selection&&setTimeout(function(){e.notify(`edit`),t.parent.bubble(`reflow`)})},e.copy=function(){this.setTextareaSelection()},e.paste=function(e){this.options.statelessClipboard&&(e=e.slice(0,1)===`$`&&e.slice(-1)===`$`?e.slice(1,-1):`\\text{`+e+`}`),this.writeLatex(e).cursor.show()}});var DY=J(rY,function(e,t){e.finalizeInsert=function(e,t){var n=this;n.postOrder(`finalizeTree`,e),n.postOrder(`contactWeld`,t),n.postOrder(`blur`),n.postOrder(`reflow`),n[X].siblingCreated&&n[X].siblingCreated(e,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e,X),n.bubble(`reflow`)},e.prepareInsertionAt=function(e){var t=e.options.maxDepth;if(t!==WJ){var n=e.depth();if(n>t)return!1;this.removeNodesDeeperThan(t-n)}return!0},e.removeNodesDeeperThan=function(e){for(var t=0,n=[[this,t]],r;n.length;)r=n.shift(),r[0].children().each(function(i){var a=+(i instanceof AY);t=r[1]+a,t<=e?n.push([i,t]):(a?i.children():i).remove()})}}),OY=J(DY,function(e,t){e.init=function(e,n,r){var i=this;t.init.call(i),i.ctrlSeq||=e,n&&(i.htmlTemplate=n),r&&(i.textTemplate=r)},e.replaces=function(e){e.disown(),this.replacedFragment=e},e.isEmpty=function(){return this.foldChildren(!0,function(e,t){return e&&t.isEmpty()})},e.parser=function(){var e=EY.block,t=this;return e.times(t.numBlocks()).map(function(e){t.blocks=e;for(var n=0;n<e.length;n+=1)e[n].adopt(t,t.ends[X],0);return t})},e.createLeftOf=function(e){var n=this,r=n.replacedFragment;n.createBlocks(),t.createLeftOf.call(n,e),r&&(r.adopt(n.ends[Y],0,0),r.jQ.appendTo(n.ends[Y].jQ),n.placeCursor(e),n.prepareInsertionAt(e)),n.finalizeInsert(e.options),n.placeCursor(e)},e.createBlocks=function(){for(var e=this,t=e.numBlocks(),n=e.blocks=Array(t),r=0;r<t;r+=1)(n[r]=AY()).adopt(e,e.ends[X],0)},e.placeCursor=function(e){e.insAtRightEnd(this.foldChildren(this.ends[Y],function(e,t){return e.isEmpty()?e:t}))},e.moveTowards=function(e,t,n){var r=n&&this[n+`Into`];t.insAtDirEnd(-e,r||this.ends[-e])},e.deleteTowards=function(e,t){this.isEmpty()?t[e]=this.remove()[e]:this.moveTowards(e,t,null)},e.selectTowards=function(e,t){t[-e]=this,t[e]=this[e]},e.selectChildren=function(){return lY(this,this)},e.unselectInto=function(e,t){t.insAtDirEnd(-e,t.anticursor.ancestors[this.id])},e.seek=function(e,t){function n(e){var t={};return t[Y]=e.jQ.offset().left,t[X]=t[Y]+e.jQ.outerWidth(),t}var r=this,i=n(r);if(e<i[Y])return t.insLeftOf(r);if(e>i[X])return t.insRightOf(r);var a=i[Y];r.eachChild(function(o){var s=n(o);if(e<s[Y])return e-a<s[Y]-e?o[Y]?t.insAtRightEnd(o[Y]):t.insLeftOf(r):t.insAtLeftEnd(o),!1;if(e>s[X])o[X]?a=s[X]:i[X]-e<e-s[X]?t.insRightOf(r):t.insAtRightEnd(o);else return o.seek(e,t),!1})},e.numBlocks=function(){var e=this.htmlTemplate.match(/&\d+/g);return e?e.length:0},e.html=function(){var e=this,t=e.blocks,n=` mathquill-command-id=`+e.id,r=e.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);eY(`no unmatched angle brackets`,r.join(``)===this.htmlTemplate);for(var i=0,a=r[0];a;i+=1,a=r[i])if(a.slice(-2)===`/>`)r[i]=a.slice(0,-2)+n+`/>`;else if(a.charAt(0)===`<`){eY(`not an unmatched top-level close tag`,a.charAt(1)!==`/`),r[i]=a.slice(0,-1)+n+`>`;var o=1;do i+=1,a=r[i],eY(`no missing close tags`,a),a.slice(0,2)===`</`?--o:a.charAt(0)===`<`&&a.slice(-2)!==`/>`&&(o+=1);while(o>0)}return r.join(``).replace(/>&(\d+)/g,function(e,n){return` mathquill-block-id=`+t[n].id+`>`+t[n].join(`html`)})},e.latex=function(){return this.foldChildren(this.ctrlSeq,function(e,t){return e+`{`+(t.latex()||` `)+`}`})},e.textTemplate=[``],e.text=function(){var e=this,t=0;return e.foldChildren(e.textTemplate[t],function(n,r){t+=1;var i=r.text();return n&&e.textTemplate[t]===`(`&&i[0]===`(`&&i.slice(-1)===`)`?n+i.slice(1,-1)+e.textTemplate[t]:n+i+(e.textTemplate[t]||``)})}}),kY=J(OY,function(e,t){e.init=function(e,n,r){r||=e&&e.length>1?e.slice(1):e,t.init.call(this,e,n,[r])},e.parser=function(){return CY.succeed(this)},e.numBlocks=function(){return 0},e.replaces=function(e){e.remove()},e.createBlocks=YJ,e.moveTowards=function(e,t){t.jQ.insDirOf(e,this.jQ),t[-e]=this,t[e]=this[e]},e.deleteTowards=function(e,t){t[e]=this.remove()[e]},e.seek=function(e,t){e-this.jQ.offset().left<this.jQ.outerWidth()/2?t.insLeftOf(this):t.insRightOf(this)},e.latex=function(){return this.ctrlSeq},e.text=function(){return this.textTemplate},e.placeCursor=YJ,e.isEmpty=function(){return!0}}),Q=J(kY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span>`+(n||e)+`</span>`)}}),$=J(kY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-binary-operator">`+n+`</span>`,r)}}),AY=J(DY,function(e,t){e.join=function(e){return this.foldChildren(``,function(t,n){return t+n[e]()})},e.html=function(){return this.join(`html`)},e.latex=function(){return this.join(`latex`)},e.text=function(){return this.ends[Y]===this.ends[X]&&this.ends[Y]!==0?this.ends[Y].text():this.join(`text`)},e.keystroke=function(e,n,r){if(r.options.spaceBehavesLikeTab&&(e===`Spacebar`||e===`Shift-Spacebar`)){n.preventDefault(),r.escapeDir(e===`Shift-Spacebar`?Y:X,e,n);return}return t.keystroke.apply(this,arguments)},e.moveOutOf=function(e,t,n){!(n&&this.parent[n+`Into`])&&this[e]?t.insAtDirEnd(-e,this[e]):t.insDirOf(e,this.parent)},e.selectOutOf=function(e,t){t.insDirOf(e,this.parent)},e.deleteOutOf=function(e,t){t.unwrapGramp()},e.seek=function(e,t){var n=this.ends[X];if(!n||n.jQ.offset().left+n.jQ.outerWidth()<e)return t.insAtRightEnd(this);if(e<this.ends[Y].jQ.offset().left)return t.insAtLeftEnd(this);for(;e<n.jQ.offset().left;)n=n[Y];return n.seek(e,t)},e.chToCmd=function(e,t){var n;return e.match(/^[a-eg-zA-Z]$/)?zY(e):/^\d$/.test(e)?LY(e):t&&t.typingSlashWritesDivisionSymbol&&e===`/`?Z[`÷`](e):t&&t.typingAsteriskWritesTimesSymbol&&e===`*`?Z[`×`](e):(n=oY[e]||Z[e])?n(e):Q(e)},e.write=function(e,t){var n;if(e.tooDeep())return!1;n=this.chToCmd(t,e.options),e.selection&&n.replaces(e.replaceSelection()),e.isTooDeep()||n.createLeftOf(e.show())},e.focus=function(){return this.jQ.addClass(`mq-hasCursor`),this.jQ.removeClass(`mq-empty`),this},e.blur=function(){return this.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.jQ.addClass(`mq-empty`),this}});fY.p.mouseEvents=!0,dY.StaticMath=function(e){return J(e.AbstractMathQuill,function(t,n){this.RootBlock=AY,t.__mathquillify=function(e,t){return this.config(e),n.__mathquillify.call(this,`mq-math-mode`),this.__options.mouseEvents&&(this.__controller.delegateMouseEvents(),this.__controller.staticMathTextareaEvents()),this},t.init=function(){n.init.apply(this,arguments),this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField)},t.latex=function(){var t=n.latex.apply(this,arguments);return arguments.length>0&&this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField),t}})};var jY=J(AY,SY);dY.MathField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=jY,e.__mathquillify=function(e,n){return this.config(e),n>1&&(this.__controller.root.reflow=YJ),t.__mathquillify.call(this,`mq-editable-field mq-math-mode`),delete this.__controller.root.reflow,this}})};var MY=J(rY,function(e,t){e.ctrlSeq=`\\text`,e.replaces=function(e){e instanceof aY?this.replacedText=e.remove().jQ.text():typeof e==`string`&&(this.replacedText=e)},e.jQadd=function(e){t.jQadd.call(this,e),this.ends[Y]&&this.ends[Y].jQadd(this.jQ[0].firstChild)},e.createLeftOf=function(e){var n=this;if(t.createLeftOf.call(this,e),n[X].siblingCreated&&n[X].siblingCreated(e.options,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e.options,X),n.bubble(`reflow`),e.insAtRightEnd(n),n.replacedText)for(var r=0;r<n.replacedText.length;r+=1)n.write(e,n.replacedText.charAt(r))},e.parser=function(){var e=this,t=CY.string,n=CY.regex;return CY.optWhitespace.then(t(`{`)).then(n(/^[^}]*/)).skip(t(`}`)).map(function(t){return t.length===0?aY():(NY(t).adopt(e,0,0),e)})},e.textContents=function(){return this.foldChildren(``,function(e,t){return e+t.text})},e.text=function(){return`"`+this.textContents()+`"`},e.latex=function(){var e=this.textContents();return e.length===0?``:`\\text{`+e.replace(/\\/g,`\\backslash `).replace(/[{}]/g,`\\$&`)+`}`},e.html=function(){return`<span class="mq-text-mode" mathquill-command-id=`+this.id+`>`+this.textContents()+`</span>`},e.moveTowards=function(e,t){t.insAtDirEnd(-e,this)},e.moveOutOf=function(e,t){t.insDirOf(e,this)},e.unselectInto=e.moveTowards,e.selectTowards=OY.prototype.selectTowards,e.deleteTowards=OY.prototype.deleteTowards,e.selectOutOf=function(e,t){t.insDirOf(e,this)},e.deleteOutOf=function(e,t){this.isEmpty()&&t.insRightOf(this)},e.write=function(e,n){if(e.show().deleteSelection(),n!==`$`)e[Y]?(e[Y].appendText(n),this.bubble(`reflow`)):NY(n).createLeftOf(e);else if(this.isEmpty())e.insRightOf(this),Q(`\\$`,`$`).createLeftOf(e);else if(!e[X])e.insRightOf(this);else if(!e[Y])e.insLeftOf(this);else{var r=MY(),i=this.ends[Y];i.disown().jQ.detach(),i.adopt(r,0,0),e.insLeftOf(this),t.createLeftOf.call(r,e)}},e.seek=function(e,t){t.hide();var r=n(this),i=this.jQ.width()/this.text.length,a=Math.round((e-this.jQ.offset().left)/i);a<=0?t.insAtLeftEnd(this):a>=r.text.length?t.insAtRightEnd(this):t.insLeftOf(r.splitRight(a));for(var o=e-t.show().offset().left,s=o&&o<0?Y:X,c=s;t[s]&&o*c>0;)t[s].moveTowards(s,t),c=o,o=e-t.offset().left;if(s*o<-s*c&&t[-s].moveTowards(-s,t),!t.anticursor)this.anticursorPosition=t[Y]&&t[Y].text.length;else if(t.anticursor.parent===this){var l=t[Y]&&t[Y].text.length;if(this.anticursorPosition===l)t.anticursor=nY.copy(t);else{if(this.anticursorPosition<l){var u=t[Y].splitRight(this.anticursorPosition);t[Y]=u}else var u=t[X].splitRight(this.anticursorPosition-l);t.anticursor=nY(this,u[Y],u)}}},e.blur=function(e){AY.prototype.blur.call(this),e&&(this.textContents()===``?(this.remove(),e[Y]===this?e[Y]=this[Y]:e[X]===this&&(e[X]=this[X])):n(this))};function n(e){e.jQ[0].normalize();var t=e.jQ.contents().filter(function(e,t){return t.nodeType===3})[0];t||={data:``},eY(`only node in TextBlock span is Text node`,t.nodeType===3);var n=NY(t.data);return n.jQadd(t),e.children().disown(),n.adopt(e,0,0)}e.focus=AY.prototype.focus}),NY=J(rY,function(e,t){e.init=function(e){t.init.call(this),this.text=e},e.jQadd=function(e){this.dom=e,this.jQ=HJ(e)},e.jQize=function(){return this.jQadd(document.createTextNode(this.text))},e.appendText=function(e){this.text+=e,this.dom.appendData(e)},e.prependText=function(e){this.text=e+this.text,this.dom.insertData(0,e)},e.insTextAtDirEnd=function(e,t){tY(t),t===X?this.appendText(e):this.prependText(e)},e.splitRight=function(e){var t=NY(this.text.slice(e)).adopt(this.parent,this,this[X]);return t.jQadd(this.dom.splitText(e)),this.text=this.text.slice(0,e),t};function n(e,t){return t.charAt(e===Y?0:-1+t.length)}e.moveTowards=function(e,t){tY(e);var r=n(-e,this.text),i=this[-e];return i?i.insTextAtDirEnd(r,e):NY(r).createDir(-e,t),this.deleteTowards(e,t)},e.latex=function(){return this.text},e.deleteTowards=function(e,t){this.text.length>1?e===X?(this.dom.deleteData(0,1),this.text=this.text.slice(1)):(this.dom.deleteData(-1+this.text.length,1),this.text=this.text.slice(0,-1)):(this.remove(),this.jQ.remove(),t[e]=this[e])},e.selectTowards=function(e,t){tY(e);var r=t.anticursor,i=n(-e,this.text);if(r[e]===this){var a=NY(i).createDir(e,t);r[e]=a,t.insDirOf(e,a)}else{var o=this[-e];if(o)o.insTextAtDirEnd(i,e);else{var a=NY(i).createDir(-e,t);a.jQ.insDirOf(-e,t.selection.jQ)}this.text.length===1&&r[-e]===this&&(r[-e]=this[-e])}return this.deleteTowards(e,t)}});Z.text=Z.textnormal=Z.textrm=Z.textup=Z.textmd=MY;function PY(e,t,n){return J(MY,{ctrlSeq:e,htmlTemplate:`<`+t+` `+n+`>&0</`+t+`>`})}Z.em=Z.italic=Z.italics=Z.emph=Z.textit=Z.textsl=PY(`\\textit`,`i`,`class="mq-text-mode"`),Z.strong=Z.bold=Z.textbf=PY(`\\textbf`,`b`,`class="mq-text-mode"`),Z.sf=Z.textsf=PY(`\\textsf`,`span`,`class="mq-sans-serif mq-text-mode"`),Z.tt=Z.texttt=PY(`\\texttt`,`span`,`class="mq-monospace mq-text-mode"`),Z.textsc=PY(`\\textsc`,`span`,`style="font-variant:small-caps" class="mq-text-mode"`),Z.uppercase=PY(`\\uppercase`,`span`,`style="text-transform:uppercase" class="mq-text-mode"`),Z.lowercase=PY(`\\lowercase`,`span`,`style="text-transform:lowercase" class="mq-text-mode"`);var FY=J(OY,function(e,t){e.init=function(e){t.init.call(this,`$`),this.cursor=e},e.htmlTemplate=`<span class="mq-math-mode">&0</span>`,e.createBlocks=function(){t.createBlocks.call(this),this.ends[Y].cursor=this.cursor,this.ends[Y].write=function(e,t){t===`$`?this.isEmpty()?(e.insRightOf(this.parent),this.parent.deleteTowards(dir,e),Q(`\\$`,`$`).createLeftOf(e.show())):e[X]?e[Y]?AY.prototype.write.call(this,e,t):e.insLeftOf(this.parent):e.insRightOf(this.parent):AY.prototype.write.call(this,e,t)}},e.latex=function(){return`$`+this.ends[Y].latex()+`$`}}),IY=J(jY,function(e,t){e.keystroke=function(e){if(!(e===`Spacebar`||e===`Shift-Spacebar`))return t.keystroke.apply(this,arguments)},e.write=function(e,t){if(e.show().deleteSelection(),t===`$`)FY(e).createLeftOf(e);else{var n;t===`<`?n=`&lt;`:t===`>`&&(n=`&gt;`),Q(t,n).createLeftOf(e)}}});dY.TextField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=IY,e.__mathquillify=function(){return t.__mathquillify.call(this,`mq-editable-field mq-text-mode`)},e.latex=function(e){return arguments.length>0?(this.__controller.renderLatexText(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()}})},oY[`\\`]=J(OY,function(e,t){e.ctrlSeq=`\\`,e.replaces=function(e){this._replacedFragment=e.disown(),this.isEmpty=function(){return!1}},e.htmlTemplate=`<span class="mq-latex-command-input mq-non-leaf">\\<span>&0</span></span>`,e.textTemplate=[`\\`],e.createBlocks=function(){t.createBlocks.call(this),this.ends[Y].focus=function(){return this.parent.jQ.addClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.removeClass(`mq-empty`),this},this.ends[Y].blur=function(){return this.parent.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.addClass(`mq-empty`),this},this.ends[Y].write=function(e,t){e.show().deleteSelection(),t.match(/[a-z]/i)?Q(t).createLeftOf(e):(this.parent.renderCommand(e),(t!==`\\`||!this.isEmpty())&&e.parent.write(e,t))},this.ends[Y].keystroke=function(e,n,r){if(e===`Tab`||e===`Enter`||e===`Spacebar`){this.parent.renderCommand(r.cursor),n.preventDefault();return}return t.keystroke.apply(this,arguments)}},e.createLeftOf=function(e){if(t.createLeftOf.call(this,e),this._replacedFragment){var n=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass(`mq-blur`).bind(`mousedown mousemove`,function(e){return HJ(e.target=n).trigger(e),!1}).insertBefore(this.jQ).add(this.jQ)}},e.latex=function(){return`\\`+this.ends[Y].latex()+` `},e.renderCommand=function(e){this.jQ=this.jQ.last(),this.remove(),this[X]?e.insLeftOf(this[X]):e.insAtRightEnd(this.parent);var t=this.ends[Y].latex();t||=` `;var n=Z[t];n?(n=n(t),this._replacedFragment&&n.replaces(this._replacedFragment),n.createLeftOf(e)):(n=MY(),n.replaces(t),n.createLeftOf(e),e.insRightOf(n),this._replacedFragment&&this._replacedFragment.remove())}}),Z[`∉`]=Z.notin=q($,`\\notin `,`&#8713;`),Z[`≅`]=Z.cong=q($,`\\cong `,`&#8773;`),Z[`≡`]=Z.equiv=q($,`\\equiv `,`&#8801;`),Z[`⊕`]=Z.oplus=q($,`\\oplus `,`&#8853;`),Z[`⊗`]=Z.otimes=q($,`\\otimes `,`&#8855;`),Z[`≠`]=Z.ne=Z.neq=q($,`\\ne `,`&ne;`),Z[`≇`]=Z.ncong=q($,`\\ncong `,`&ncong;`),Z[`∗`]=Z.ast=Z.star=Z.loast=Z.lowast=q($,`\\ast `,`&lowast;`),Z.therefor=Z.therefore=q($,`\\therefore `,`&there4;`),Z.cuz=Z.because=q($,`\\because `,`&#8757;`),Z.prop=Z.propto=q($,`\\propto `,`&prop;`),Z[`≈`]=Z.asymp=Z.approx=q($,`\\approx `,`&asymp;`),Z[`≉`]=Z.nasymp=Z.napprox=q($,`\\napprox `,`&nap;`),Z.isin=Z.in=q($,`\\in `,`&isin;`),Z.ni=Z.contains=q($,`\\ni `,`&ni;`),Z.notni=Z.niton=Z.notcontains=Z.doesnotcontain=sY[`\\not\\ni`]=q($,`\\not\\ni `,`&#8716;`),Z.sub=Z.subset=q($,`\\subset `,`&sub;`),Z.sup=Z.supset=Z.superset=q($,`\\supset `,`&sup;`),Z.nsub=Z.notsub=Z.nsubset=Z.notsubset=sY[`\\not\\subset`]=q($,`\\not\\subset `,`&#8836;`),Z.nsup=Z.notsup=Z.nsupset=Z.notsupset=Z.nsuperset=Z.notsuperset=sY[`\\not\\supset`]=q($,`\\not\\supset `,`&#8837;`),Z.sube=Z.subeq=Z.subsete=Z.subseteq=q($,`\\subseteq `,`&sube;`),Z.supe=Z.supeq=Z.supsete=Z.supseteq=Z.supersete=Z.superseteq=q($,`\\supseteq `,`&supe;`),Z.nsube=Z.nsubeq=Z.notsube=Z.notsubeq=Z.nsubsete=Z.nsubseteq=Z.notsubsete=Z.notsubseteq=sY[`\\not\\subseteq`]=q($,`\\not\\subseteq `,`&#8840;`),Z.nsupe=Z.nsupeq=Z.notsupe=Z.notsupeq=Z.nsupsete=Z.nsupseteq=Z.notsupsete=Z.notsupseteq=Z.nsupersete=Z.nsuperseteq=Z.notsupersete=Z.notsuperseteq=sY[`\\not\\supseteq`]=q($,`\\not\\supseteq `,`&#8841;`),Z.N=Z.naturals=Z.Naturals=q(Q,`\\mathbb{N}`,`&#8469;`),Z.P=Z.primes=Z.Primes=Z.projective=Z.Projective=Z.probability=Z.Probability=q(Q,`\\mathbb{P}`,`&#8473;`),Z.Z=Z.integers=Z.Integers=q(Q,`\\mathbb{Z}`,`&#8484;`),Z.Q=Z.rationals=Z.Rationals=q(Q,`\\mathbb{Q}`,`&#8474;`),Z.R=Z.reals=Z.Reals=q(Q,`\\mathbb{R}`,`&#8477;`),Z.C=Z.complex=Z.Complex=Z.complexes=Z.Complexes=Z.complexplane=Z.Complexplane=Z.ComplexPlane=q(Q,`\\mathbb{C}`,`&#8450;`),Z.H=Z.Hamiltonian=Z.quaternions=Z.Quaternions=q(Q,`\\mathbb{H}`,`&#8461;`),Z.quad=Z.emsp=q(Q,`\\quad `,` `),Z.qquad=q(Q,`\\qquad `,` `),Z.diamond=q(Q,`\\diamond `,`&#9671;`),Z.bigtriangleup=q(Q,`\\bigtriangleup `,`&#9651;`),Z.ominus=q(Q,`\\ominus `,`&#8854;`),Z.uplus=q(Q,`\\uplus `,`&#8846;`),Z.bigtriangledown=q(Q,`\\bigtriangledown `,`&#9661;`),Z.sqcap=q(Q,`\\sqcap `,`&#8851;`),Z.triangleleft=q(Q,`\\triangleleft `,`&#8882;`),Z.sqcup=q(Q,`\\sqcup `,`&#8852;`),Z.triangleright=q(Q,`\\triangleright `,`&#8883;`),Z.odot=Z.circledot=q(Q,`\\odot `,`&#8857;`),Z.bigcirc=q(Q,`\\bigcirc `,`&#9711;`),Z.dagger=q(Q,`\\dagger `,`&#0134;`),Z.ddagger=q(Q,`\\ddagger `,`&#135;`),Z.wr=q(Q,`\\wr `,`&#8768;`),Z.amalg=q(Q,`\\amalg `,`&#8720;`),Z.models=q(Q,`\\models `,`&#8872;`),Z.prec=q(Q,`\\prec `,`&#8826;`),Z.succ=q(Q,`\\succ `,`&#8827;`),Z.preceq=q(Q,`\\preceq `,`&#8828;`),Z.succeq=q(Q,`\\succeq `,`&#8829;`),Z.simeq=q(Q,`\\simeq `,`&#8771;`),Z.mid=q(Q,`\\mid `,`&#8739;`),Z.ll=q(Q,`\\ll `,`&#8810;`),Z.gg=q(Q,`\\gg `,`&#8811;`),Z.parallel=q(Q,`\\parallel `,`&#8741;`),Z.nparallel=q(Q,`\\nparallel `,`&#8742;`),Z.bowtie=q(Q,`\\bowtie `,`&#8904;`),Z.sqsubset=q(Q,`\\sqsubset `,`&#8847;`),Z.sqsupset=q(Q,`\\sqsupset `,`&#8848;`),Z.smile=q(Q,`\\smile `,`&#8995;`),Z.sqsubseteq=q(Q,`\\sqsubseteq `,`&#8849;`),Z.sqsupseteq=q(Q,`\\sqsupseteq `,`&#8850;`),Z.doteq=q(Q,`\\doteq `,`&#8784;`),Z.frown=q(Q,`\\frown `,`&#8994;`),Z.vdash=q(Q,`\\vdash `,`&#8870;`),Z.dashv=q(Q,`\\dashv `,`&#8867;`),Z.nless=q(Q,`\\nless `,`&#8814;`),Z.ngtr=q(Q,`\\ngtr `,`&#8815;`),Z.longleftarrow=q(Q,`\\longleftarrow `,`&#8592;`),Z.longrightarrow=q(Q,`\\longrightarrow `,`&#8594;`),Z.Longleftarrow=q(Q,`\\Longleftarrow `,`&#8656;`),Z.Longrightarrow=q(Q,`\\Longrightarrow `,`&#8658;`),Z.longleftrightarrow=q(Q,`\\longleftrightarrow `,`&#8596;`),Z.updownarrow=q(Q,`\\updownarrow `,`&#8597;`),Z.Longleftrightarrow=q(Q,`\\Longleftrightarrow `,`&#8660;`),Z.Updownarrow=q(Q,`\\Updownarrow `,`&#8661;`),Z.mapsto=q(Q,`\\mapsto `,`&#8614;`),Z.nearrow=q(Q,`\\nearrow `,`&#8599;`),Z.hookleftarrow=q(Q,`\\hookleftarrow `,`&#8617;`),Z.hookrightarrow=q(Q,`\\hookrightarrow `,`&#8618;`),Z.searrow=q(Q,`\\searrow `,`&#8600;`),Z.leftharpoonup=q(Q,`\\leftharpoonup `,`&#8636;`),Z.rightharpoonup=q(Q,`\\rightharpoonup `,`&#8640;`),Z.swarrow=q(Q,`\\swarrow `,`&#8601;`),Z.leftharpoondown=q(Q,`\\leftharpoondown `,`&#8637;`),Z.rightharpoondown=q(Q,`\\rightharpoondown `,`&#8641;`),Z.nwarrow=q(Q,`\\nwarrow `,`&#8598;`),Z.ldots=q(Q,`\\ldots `,`&#8230;`),Z.cdots=q(Q,`\\cdots `,`&#8943;`),Z.vdots=q(Q,`\\vdots `,`&#8942;`),Z.ddots=q(Q,`\\ddots `,`&#8945;`),Z.surd=q(Q,`\\surd `,`&#8730;`),Z.triangle=q(Q,`\\triangle `,`&#9651;`),Z.ell=q(Q,`\\ell `,`&#8467;`),Z.top=q(Q,`\\top `,`&#8868;`),Z.flat=q(Q,`\\flat `,`&#9837;`),Z.natural=q(Q,`\\natural `,`&#9838;`),Z.sharp=q(Q,`\\sharp `,`&#9839;`),Z.wp=q(Q,`\\wp `,`&#8472;`),Z.bot=q(Q,`\\bot `,`&#8869;`),Z.clubsuit=q(Q,`\\clubsuit `,`&#9827;`),Z.diamondsuit=q(Q,`\\diamondsuit `,`&#9826;`),Z.heartsuit=q(Q,`\\heartsuit `,`&#9825;`),Z.spadesuit=q(Q,`\\spadesuit `,`&#9824;`),Z.circledot=q(Q,`\\circledot `,`&#8857;`),Z.middot=q(Q,`\\middot `,`&middot;`),Z.dottedsquare=q(Q,`\\dottedsquare `,`&#11034;`),Z.square=q(Q,`\\square `,`&#11036;`),Z.rectangle=q(Q,`\\rectangle `,`&#9647;`),Z.oint=q(Q,`\\oint `,`&#8750;`),Z.bigcap=q(Q,`\\bigcap `,`&#8745;`),Z.bigcup=q(Q,`\\bigcup `,`&#8746;`),Z.bigsqcup=q(Q,`\\bigsqcup `,`&#8852;`),Z.bigvee=q(Q,`\\bigvee `,`&#8744;`),Z.bigwedge=q(Q,`\\bigwedge `,`&#8743;`),Z.bigodot=q(Q,`\\bigodot `,`&#8857;`),Z.bigotimes=q(Q,`\\bigotimes `,`&#8855;`),Z.bigoplus=q(Q,`\\bigoplus `,`&#8853;`),Z.biguplus=q(Q,`\\biguplus `,`&#8846;`),Z.lfloor=q(Q,`\\lfloor `,`&#8970;`),Z.rfloor=q(Q,`\\rfloor `,`&#8971;`),Z.lceil=q(Q,`\\lceil `,`&#8968;`),Z.rceil=q(Q,`\\rceil `,`&#8969;`),Z.opencurlybrace=Z.lbrace=q(Q,`\\lbrace `,`{`),Z.closecurlybrace=Z.rbrace=q(Q,`\\rbrace `,`}`),Z.lbrack=q(Q,`[`),Z.rbrack=q(Q,`]`),Z.mug=q(Q,`\\mug `,`µg`),Z.mus=q(Q,`\\mus `,`µs`),Z.mum=q(Q,`\\mum `,`µm`),Z.muL=q(Q,`\\muL `,`µL`),Z.slash=q(Q,`/`),Z.vert=q(Q,`|`),Z.perp=Z.perpendicular=q(Q,`\\perp `,`&perp;`),Z.nabla=Z.del=q(Q,`\\nabla `,`&nabla;`),Z.hbar=q(Q,`\\hbar `,`&#8463;`),Z.AA=Z.Angstrom=Z.angstrom=q(Q,`\\text\\AA `,`&#8491;`),Z.ring=Z.circ=Z.circle=q(Q,`\\circ `,`&#8728;`),Z.bull=Z.bullet=q(Q,`\\bullet `,`&bull;`),Z.setminus=Z.smallsetminus=q(Q,`\\setminus `,`&#8726;`),Z.not=Z[`¬`]=Z.neg=q(Q,`\\neg `,`&not;`),Z[`…`]=Z.dots=Z.ellip=Z.hellip=Z.ellipsis=Z.hellipsis=q(Q,`\\dots `,`&hellip;`),Z.converges=Z.darr=Z.dnarr=Z.dnarrow=Z.downarrow=q(Q,`\\downarrow `,`&darr;`),Z.dArr=Z.dnArr=Z.dnArrow=Z.Downarrow=q(Q,`\\Downarrow `,`&dArr;`),Z.diverges=Z.uarr=Z.uparrow=q(Q,`\\uparrow `,`&uarr;`),Z.uArr=Z.Uparrow=q(Q,`\\Uparrow `,`&uArr;`),Z.to=q($,`\\to `,`&rarr;`),Z.rarr=Z.rightarrow=q(Q,`\\rightarrow `,`&rarr;`),Z.implies=q($,`\\Rightarrow `,`&rArr;`),Z.rArr=Z.Rightarrow=q(Q,`\\Rightarrow `,`&rArr;`),Z.gets=q($,`\\gets `,`&larr;`),Z.larr=Z.leftarrow=q(Q,`\\leftarrow `,`&larr;`),Z.impliedby=q($,`\\Leftarrow `,`&lArr;`),Z.lArr=Z.Leftarrow=q(Q,`\\Leftarrow `,`&lArr;`),Z.harr=Z.lrarr=Z.leftrightarrow=q(Q,`\\leftrightarrow `,`&harr;`),Z.iff=q($,`\\Leftrightarrow `,`&hArr;`),Z.hArr=Z.lrArr=Z.Leftrightarrow=q(Q,`\\Leftrightarrow `,`&hArr;`),Z.Re=Z.Real=Z.real=q(Q,`\\Re `,`&real;`),Z.Im=Z.imag=Z.image=Z.imagin=Z.imaginary=Z.Imaginary=q(Q,`\\Im `,`&image;`),Z.part=Z.partial=q(Q,`\\partial `,`&part;`),Z.infty=Z.infin=Z.infinity=q(Q,`\\infty `,`&infin;`),Z.pounds=q(Q,`\\pounds `,`&pound;`),Z.alef=Z.alefsym=Z.aleph=Z.alephsym=q(Q,`\\aleph `,`&alefsym;`),Z.xist=Z.xists=Z.exist=Z.exists=q(Q,`\\exists `,`&exist;`),Z.nexists=Z.nexist=q(Q,`\\nexists `,`&#8708;`),Z.and=Z.land=Z.wedge=q($,`\\wedge `,`&and;`),Z.or=Z.lor=Z.vee=q($,`\\vee `,`&or;`),Z.o=Z.O=Z.empty=Z.emptyset=Z.oslash=Z.Oslash=Z.nothing=Z.varnothing=q($,`\\varnothing `,`&empty;`),Z.cup=Z.union=q($,`\\cup `,`&cup;`),Z.cap=Z.intersect=Z.intersection=q($,`\\cap `,`&cap;`),Z.deg=Z.degree=q(Q,`\\degree `,`&deg;`),Z.ang=Z.angle=q(Q,`\\angle `,`&ang;`),Z.measuredangle=q(Q,`\\measuredangle `,`m&ang;`);var LY=J(Q,function(e,t){e.createLeftOf=function(e){e.options.autoSubscriptNumerals&&e.parent!==e.parent.parent.sub&&(e[Y]instanceof RY&&e[Y].isItalic!==!1||e[Y]instanceof pX&&e[Y][Y]instanceof RY&&e[Y][Y].isItalic!==!1)?(Z._().createLeftOf(e),t.createLeftOf.call(this,e),e.insRightOf(e.parent.parent)):t.createLeftOf.call(this,e)}}),RY=J(kY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<var>`+(n||e)+`</var>`)},e.text=function(){var e=this.ctrlSeq;return this.isPartOfOperator?e[0]==`\\`?e=e.slice(1,e.length):e[e.length-1]==` `&&(e=e.slice(0,-1)):(this[Y]&&!(this[Y]instanceof RY)&&!(this[Y]instanceof $)&&this[Y].ctrlSeq!==`\\ `&&(e=`*`+e),this[X]&&!(this[X]instanceof $)&&!(this[X]instanceof pX)&&(e+=`*`)),e}});fY.p.autoCommands={_maxLength:0},pY.autoCommands=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`autocommand "`+a+`" not minimum length of 2`;if(Z[a]===UY)throw`"`+a+`" is a built-in operator name`;n[a]=1,r=JJ(r,a.length)}return n._maxLength=r,n};var zY=J(RY,function(e,t){e.init=function(e){return t.init.call(this,this.letter=e)},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments);var n=e.options.autoCommands,r=n._maxLength;if(r>0){for(var i=``,a=this,o=0;a instanceof zY&&a.ctrlSeq===a.letter&&o<r;)i=a.letter+i,a=a[Y],o+=1;for(;i.length;){if(n.hasOwnProperty(i)){for(var o=1,a=this;o<i.length;o+=1,a=a[Y]);return aY(a,this).remove(),e[Y]=a[Y],Z[i](i).createLeftOf(e)}i=i.slice(1)}}},e.italicize=function(e){return this.isItalic=e,this.isPartOfOperator=!e,this.jQ.toggleClass(`mq-operator-name`,!e),this},e.finalizeTree=e.siblingDeleted=e.siblingCreated=function(e,t){t!==Y&&this[X]instanceof zY||this.autoUnItalicize(e)},e.autoUnItalicize=function(e){var t=e.autoOperatorNames;if(t._maxLength!==0){for(var r=this.letter,i=this[Y];i instanceof zY;i=i[Y])r=i.letter+r;for(var a=this[X];a instanceof zY;a=a[X])r+=a.letter;aY(i[X]||this.parent.ends[Y],a[Y]||this.parent.ends[X]).each(function(e){e.italicize(!0).jQ.removeClass(`mq-first mq-last mq-followed-by-supsub`),e.ctrlSeq=e.letter});outer:for(var o=0,s=i[X]||this.parent.ends[Y];o<r.length;o+=1,s=s[X])for(var c=qJ(t._maxLength,r.length-o);c>0;--c){var l=r.slice(o,o+c);if(t.hasOwnProperty(l)){for(var u=0,d=s;u<c;u+=1,d=d[X]){d.italicize(!1);var f=d}var p=BY.hasOwnProperty(l);if(s.ctrlSeq=(p?`\\`:`\\operatorname{`)+s.ctrlSeq,f.ctrlSeq+=p?` `:`}`,HY.hasOwnProperty(l)&&f[Y][Y][Y].jQ.addClass(`mq-last`),n(s[Y])||s.jQ.addClass(`mq-first`),!n(f[X]))if(f[X]instanceof pX){var m=f[X];(m.siblingCreated=m.siblingDeleted=function(){m.jQ.toggleClass(`mq-after-operator-name`,!(m[X]instanceof SX))})()}else f.jQ.toggleClass(`mq-last`,!(f[X]instanceof SX));o+=c-1,s=f;continue outer}}}};function n(e){return!e||e instanceof $||e instanceof gX}}),BY={},VY=fY.p.autoOperatorNames={_maxLength:9},HY={limsup:1,liminf:1,projlim:1,injlim:1};(function(){for(var e=`arg deg det dim exp gcd hom inf ker lg ln log max min sup limsup liminf injlim projlim Pr`.split(` `),t=0;t<e.length;t+=1)BY[e[t]]=VY[e[t]]=1;for(var n=`sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth`.split(` `),t=0;t<n.length;t+=1)BY[n[t]]=1;for(var r=`sin cos tan sec cosec csc cotan cot ctg`.split(` `),t=0;t<r.length;t+=1)VY[r[t]]=VY[`arc`+r[t]]=VY[r[t]+`h`]=VY[`ar`+r[t]+`h`]=VY[`arc`+r[t]+`h`]=1;for(var i=`gcf hcf lcm proj span`.split(` `),t=0;t<i.length;t+=1)VY[i[t]]=1})(),pY.autoOperatorNames=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`"`+a+`" not minimum length of 2`;n[a]=1,r=JJ(r,a.length)}return n._maxLength=r,n};var UY=J(kY,function(e,t){e.init=function(e){this.ctrlSeq=e},e.createLeftOf=function(e){for(var t=this.ctrlSeq,n=0;n<t.length;n+=1)zY(t.charAt(n)).createLeftOf(e)},e.parser=function(){for(var e=this.ctrlSeq,t=AY(),n=0;n<e.length;n+=1)zY(e.charAt(n)).adopt(t,t.ends[X],0);return CY.succeed(t.children())}});for(var WY in VY)VY.hasOwnProperty(WY)&&(Z[WY]=UY);Z.operatorname=J(OY,function(e){e.createLeftOf=YJ,e.numBlocks=function(){return 1},e.parser=function(){return EY.block.map(function(e){return e.children()})}}),Z.f=J(zY,function(e,t){e.init=function(){kY.p.init.call(this,this.letter=`f`,`<var class="mq-f">f</var>`)},e.italicize=function(e){return this.jQ.html(`f`).toggleClass(`mq-f`,e),t.italicize.apply(this,arguments)}}),Z[` `]=Z.space=q(Q,`\\ `,`&nbsp;`),Z[`'`]=Z.prime=q(Q,`'`,`&prime;`),Z[`″`]=Z.dprime=q(Q,`″`,`&Prime;`),Z[`"`]=Z.doublePrime=q(Q,`"`,`&Prime;`),Z.backslash=q(Q,`\\backslash `,`\\`),oY[`\\`]||=Z.backslash,Z.$=q(Q,`\\$`,`$`);var GY=J(kY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span class="mq-nonSymbola">`+(n||e)+`</span>`)}});Z[`@`]=GY,Z[`&`]=q(GY,`\\&`,`&amp;`),Z[`%`]=q(GY,`\\%`,`%`),Z.alpha=Z.beta=Z.gamma=Z.delta=Z.zeta=Z.eta=Z.theta=Z.iota=Z.kappa=Z.mu=Z.nu=Z.xi=Z.rho=Z.sigma=Z.tau=Z.chi=Z.psi=Z.omega=J(RY,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.phi=q(RY,`\\phi `,`&#981;`),Z.phiv=Z.varphi=q(RY,`\\varphi `,`&phi;`),Z.epsilon=q(RY,`\\epsilon `,`&#1013;`),Z.epsiv=Z.varepsilon=q(RY,`\\varepsilon `,`&epsilon;`),Z.piv=Z.varpi=q(RY,`\\varpi `,`&piv;`),Z.sigmaf=Z.sigmav=Z.varsigma=q(RY,`\\varsigma `,`&sigmaf;`),Z.thetav=Z.vartheta=Z.thetasym=q(RY,`\\vartheta `,`&thetasym;`),Z.upsilon=Z.upsi=q(RY,`\\upsilon `,`&upsilon;`),Z.gammad=Z.Gammad=Z.digamma=q(RY,`\\digamma `,`&#989;`),Z.kappav=Z.varkappa=q(RY,`\\varkappa `,`&#1008;`),Z.rhov=Z.varrho=q(RY,`\\varrho `,`&#1009;`),Z.pi=Z.π=q(GY,`\\pi `,`&pi;`),Z.lambda=q(GY,`\\lambda `,`&lambda;`),Z.Upsilon=Z.Upsi=Z.upsih=Z.Upsih=q(kY,`\\Upsilon `,`<var style="font-family: serif">&upsih;</var>`),Z.Gamma=Z.Delta=Z.Theta=Z.Lambda=Z.Xi=Z.Pi=Z.Sigma=Z.Phi=Z.Psi=Z.Omega=J(Q,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.forall=Z[`∀`]=q(Q,`\\forall `,`&#8704;`);var KY=J(OY,function(e){e.init=function(e){this.latex=e},e.createLeftOf=function(e){var t=EY.parse(this.latex);t.children().adopt(e.parent,e[Y],e[X]),e[Y]=t.ends[X],t.jQize().insertBefore(e.jQ),t.finalizeInsert(e.options,e),t.ends[X][X].siblingCreated&&t.ends[X][X].siblingCreated(e.options,Y),t.ends[Y][Y].siblingCreated&&t.ends[Y][Y].siblingCreated(e.options,X),e.parent.bubble(`reflow`)},e.parser=function(){var e=EY.parse(this.latex).children();return CY.succeed(e)}});Z[`¹`]=q(KY,`^1`),Z[`²`]=q(KY,`^2`),Z[`³`]=q(KY,`^3`),Z[`¼`]=q(KY,`\\frac14`),Z[`½`]=q(KY,`\\frac12`),Z[`¾`]=q(KY,`\\frac34`);var qY=J($,function(e){e.init=Q.prototype.init,e.contactWeld=e.siblingCreated=e.siblingDeleted=function(e,t){function n(e){if(e[Y]){if(e[Y]instanceof $||/^[,;:\(\[]$/.test(e[Y].ctrlSeq))return``}else if(e.parent&&e.parent.parent&&e.parent.parent.isStyleBlock())return n(e.parent.parent);else return``;return`mq-binary-operator`}if(t!==X)return this.jQ[0].className=n(this),this}});Z[`+`]=q(qY,`+`,`+`),Z[`–`]=Z[`-`]=q(qY,`-`,`&minus;`),Z[`±`]=Z.pm=Z.plusmn=Z.plusminus=q(qY,`\\pm `,`&plusmn;`),Z.mp=Z.mnplus=Z.minusplus=q(qY,`\\mp `,`&#8723;`),oY[`*`]=Z.sdot=Z.cdot=q($,`\\cdot `,`&middot;`,`*`);var JY=J($,function(e,t){e.init=function(e,n){this.data=e,this.strict=n;var r=n?`Strict`:``;t.init.call(this,e[`ctrlSeq`+r],e[`html`+r],e[`text`+r])},e.swap=function(e){this.strict=e;var t=e?`Strict`:``;this.ctrlSeq=this.data[`ctrlSeq`+t],this.jQ.html(this.data[`html`+t]),this.textTemplate=[this.data[`text`+t]]},e.deleteTowards=function(e,n){if(e===Y&&!this.strict){this.swap(!0),this.bubble(`reflow`);return}t.deleteTowards.apply(this,arguments)}}),YY={ctrlSeq:`\\le `,html:`&le;`,text:`≤`,ctrlSeqStrict:`<`,htmlStrict:`&lt;`,textStrict:`<`},XY={ctrlSeq:`\\ge `,html:`&ge;`,text:`≥`,ctrlSeqStrict:`>`,htmlStrict:`&gt;`,textStrict:`>`};Z[`<`]=Z.lt=q(JY,YY,!0),Z[`>`]=Z.gt=q(JY,XY,!0),Z[`≤`]=Z.le=Z.leq=q(JY,YY,!1),Z[`≥`]=Z.ge=Z.geq=q(JY,XY,!1);var ZY=J($,function(e,t){e.init=function(){t.init.call(this,`=`,`=`)},e.createLeftOf=function(e){if(e[Y]instanceof JY&&e[Y].strict){e[Y].swap(!1),e[Y].bubble(`reflow`);return}t.createLeftOf.apply(this,arguments)}});Z[`=`]=ZY,Z[`×`]=Z.times=q($,`\\times `,`&times;`,`[x]`),Z[`÷`]=Z.div=Z.divide=Z.divides=q($,`\\div `,`&divide;`,`[/]`),oY[`~`]=Z.sim=q($,`\\sim `,`~`,`~`),oY[`≁`]=Z.nsim=q($,`\\nsim `,`≁`,`≁`),Z.complement=Z[`∁`]=q(Q,`\\complement `,`&#8705;`),Z.nexists=Z[`∄`]=q(Q,`\\nexists `,`&#8708;`),Z.sphericalangle=Z[`∢`]=q(Q,`\\sphericalangle `,`&#8738;`),Z.iint=Z[`∬`]=q(Q,`\\iint `,`&#8748;`),Z.iiint=Z[`∭`]=q(Q,`\\iiint `,`&#8749;`),Z.oiint=Z[`∯`]=q(Q,`\\oiint `,`&#8751;`),Z.oiiint=Z[`∰`]=q(Q,`\\oiiint `,`&#8752;`),Z.backsim=Z[`∽`]=q(Q,`\\backsim `,`&#8765;`),Z.backsimeq=Z[`⋍`]=q(Q,`\\backsimeq `,`&#8909;`),Z.eqsim=Z[`≂`]=q(Q,`\\eqsim `,`&#8770;`),Z.ncong=Z[`≇`]=q(Q,`\\ncong `,`&#8775;`),Z.approxeq=Z[`≊`]=q(Q,`\\approxeq `,`&#8778;`),Z.bumpeq=Z[`≏`]=q(Q,`\\bumpeq `,`&#8783;`),Z.Bumpeq=Z[`≎`]=q(Q,`\\Bumpeq `,`&#8782;`),Z.doteqdot=Z[`≑`]=q(Q,`\\doteqdot `,`&#8785;`),Z.fallingdotseq=Z[`≒`]=q(Q,`\\fallingdotseq `,`&#8786;`),Z.risingdotseq=Z[`≓`]=q(Q,`\\risingdotseq `,`&#8787;`),Z.eqcirc=Z[`≖`]=q(Q,`\\eqcirc `,`&#8790;`),Z.circeq=Z[`≗`]=q(Q,`\\circeq `,`&#8791;`),Z.triangleq=Z[`≜`]=q(Q,`\\triangleq `,`&#8796;`),Z.leqq=Z[`≦`]=q(Q,`\\leqq `,`&#8806;`),Z.geqq=Z[`≧`]=q(Q,`\\geqq `,`&#8807;`),Z.lneqq=Z[`≨`]=q(Q,`\\lneqq `,`&#8808;`),Z.gneqq=Z[`≩`]=q(Q,`\\gneqq `,`&#8809;`),Z.between=Z[`≬`]=q(Q,`\\between `,`&#8812;`),Z.nleq=Z[`≰`]=q(Q,`\\nleq `,`&#8816;`),Z.ngeq=Z[`≱`]=q(Q,`\\ngeq `,`&#8817;`),Z.lesssim=Z[`≲`]=q(Q,`\\lesssim `,`&#8818;`),Z.gtrsim=Z[`≳`]=q(Q,`\\gtrsim `,`&#8819;`),Z.lessgtr=Z[`≶`]=q(Q,`\\lessgtr `,`&#8822;`),Z.gtrless=Z[`≷`]=q(Q,`\\gtrless `,`&#8823;`),Z.preccurlyeq=Z[`≼`]=q(Q,`\\preccurlyeq `,`&#8828;`),Z.succcurlyeq=Z[`≽`]=q(Q,`\\succcurlyeq `,`&#8829;`),Z.precsim=Z[`≾`]=q(Q,`\\precsim `,`&#8830;`),Z.succsim=Z[`≿`]=q(Q,`\\succsim `,`&#8831;`),Z.nprec=Z[`⊀`]=q(Q,`\\nprec `,`&#8832;`),Z.nsucc=Z[`⊁`]=q(Q,`\\nsucc `,`&#8833;`),Z.subsetneq=Z[`⊊`]=q(Q,`\\subsetneq `,`&#8842;`),Z.supsetneq=Z[`⊋`]=q(Q,`\\supsetneq `,`&#8843;`),Z.vDash=Z[`⊨`]=q(Q,`\\vDash `,`&#8872;`),Z.Vdash=Z[`⊩`]=q(Q,`\\Vdash `,`&#8873;`),Z.Vvdash=Z[`⊪`]=q(Q,`\\Vvdash `,`&#8874;`),Z.VDash=Z[`⊫`]=q(Q,`\\VDash `,`&#8875;`),Z.nvdash=Z[`⊬`]=q(Q,`\\nvdash `,`&#8876;`),Z.nvDash=Z[`⊭`]=q(Q,`\\nvDash `,`&#8877;`),Z.nVdash=Z[`⊮`]=q(Q,`\\nVdash `,`&#8878;`),Z.nVDash=Z[`⊯`]=q(Q,`\\nVDash `,`&#8879;`),Z.vartriangleleft=Z[`⊲`]=q(Q,`\\vartriangleleft `,`&#8882;`),Z.vartriangleright=Z[`⊳`]=q(Q,`\\vartriangleright `,`&#8883;`),Z.trianglelefteq=Z[`⊴`]=q(Q,`\\trianglelefteq `,`&#8884;`),Z.trianglerighteq=Z[`⊵`]=q(Q,`\\trianglerighteq `,`&#8885;`),Z.multimap=Z[`⊸`]=q(Q,`\\multimap `,`&#8888;`),Z.Subset=Z[`⋐`]=q(Q,`\\Subset `,`&#8912;`),Z.Supset=Z[`⋑`]=q(Q,`\\Supset `,`&#8913;`),Z.Cap=Z[`⋒`]=q(Q,`\\Cap `,`&#8914;`),Z.Cup=Z[`⋓`]=q(Q,`\\Cup `,`&#8915;`),Z.pitchfork=Z[`⋔`]=q(Q,`\\pitchfork `,`&#8916;`),Z.lessdot=Z[`⋖`]=q(Q,`\\lessdot `,`&#8918;`),Z.gtrdot=Z[`⋗`]=q(Q,`\\gtrdot `,`&#8919;`),Z.lll=Z[`⋘`]=q(Q,`\\lll `,`&#8920;`),Z.ggg=Z[`⋙`]=q(Q,`\\ggg `,`&#8921;`),Z.lesseqgtr=Z[`⋚`]=q(Q,`\\lesseqgtr `,`&#8922;`),Z.gtreqless=Z[`⋛`]=q(Q,`\\gtreqless `,`&#8923;`),Z.curlyeqprec=Z[`⋞`]=q(Q,`\\curlyeqprec `,`&#8926;`),Z.curlyeqsucc=Z[`⋟`]=q(Q,`\\curlyeqsucc `,`&#8927;`),Z.nsim=Z[`≁`]=q(Q,`\\nsim `,`&#8769;`),Z.lnsim=Z[`⋦`]=q(Q,`\\lnsim `,`&#8934;`),Z.gnsim=Z[`⋧`]=q(Q,`\\gnsim `,`&#8935;`),Z.precnsim=Z[`⋨`]=q(Q,`\\precnsim `,`&#8936;`),Z.succnsim=Z[`⋩`]=q(Q,`\\succnsim `,`&#8937;`),Z.ntriangleleft=Z[`⋪`]=q(Q,`\\ntriangleleft `,`&#8938;`),Z.ntriangleright=Z[`⋫`]=q(Q,`\\ntriangleright `,`&#8939;`),Z.ntrianglelefteq=Z[`⋬`]=q(Q,`\\ntrianglelefteq `,`&#8940;`),Z.ntrianglerighteq=Z[`⋭`]=q(Q,`\\ntrianglerighteq `,`&#8941;`),Z.blacksquare=Z[`∎`]=q(Q,`\\blacksquare `,`&#8718;`),Z.colon=Z[`∶`]=q(Q,`\\colon `,`&#8758;`),Z.llcorner=Z[`∟`]=q(Q,`\\llcorner `,`&#8735;`),Z.dotplus=Z[`∔`]=q($,`\\dotplus `,`&#8724;`),Z.nmid=Z[`∤`]=q($,`
330
- mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`⊻`]=q($,`\\veebar `,`&#8891;`),Z.barwedge=Z[`⊼`]=q($,`\\barwedge `,`&#8892;`),Z.ltimes=Z[`⋉`]=q($,`\\ltimes `,`&#8905;`),Z.rtimes=Z[`⋊`]=q($,`\\rtimes `,`&#8906;`),Z.leftthreetimes=Z[`⋋`]=q($,`\\leftthreetimes `,`&#8907;`),Z.rightthreetimes=Z[`⋌`]=q($,`\\rightthreetimes `,`&#8908;`),Z.curlyvee=Z[`⋎`]=q($,`\\curlyvee `,`&#8910;`),Z.curlywedge=Z[`⋏`]=q($,`\\curlywedge `,`&#8911;`),Z.circledcirc=Z[`⊚`]=q($,`\\circledcirc `,`&#8858;`),Z.circledast=Z[`⊛`]=q($,`\\circledast `,`&#8859;`),Z.circleddash=Z[`⊝`]=q($,`\\circleddash `,`&#8861;`),Z.boxplus=Z[`⊞`]=q($,`\\boxplus `,`&#8862;`),Z.boxminus=Z[`⊟`]=q($,`\\boxminus `,`&#8863;`),Z.boxtimes=Z[`⊠`]=q($,`\\boxtimes `,`&#8864;`),Z.boxdot=Z[`⊡`]=q($,`\\boxdot `,`&#8865;`),Z[`∂`]=Z.partial,Z[`∃`]=Z.exists,Z[`∅`]=Z.varnothing,Z[`∆`]=Z.triangle,Z[`∇`]=Z.nabla,Z[`∈`]=Z.in,Z[`∊`]=Z.in,Z[`∋`]=Z.ni,Z[`∌`]=Z.notni,Z[`∍`]=Z.ni,Z[`∐`]=Z.amalg,Z[`−`]=Z[`-`],Z[`∓`]=Z.mp,Z[`∖`]=Z.setminus,Z[`∘`]=Z.circ,Z[`∙`]=Z.bullet,Z[`∝`]=Z.propto,Z[`∞`]=Z.infty,Z[`∠`]=Z.angle,Z[`∡`]=Z.measuredangle,Z[`∣`]=Z.divides,Z[`∥`]=Z.parallel,Z[`∦`]=Z.nparallel,Z[`∧`]=Z.wedge,Z[`∨`]=Z.vee,Z[`∩`]=Z.cap,Z[`∪`]=Z.cup,Z[`∮`]=Z.oint,Z[`∴`]=Z.therefore,Z[`∵`]=Z.because,Z[`∼`]=Z.sim,Z[`≀`]=Z.wr,Z[`≃`]=Z.simeq,Z[`≍`]=Z.asymp,Z[`≐`]=Z.doteq,Z[`≪`]=Z.ll,Z[`≫`]=Z.gg,Z[`≺`]=Z.prec,Z[`≻`]=Z.succ,Z[`⊂`]=Z.subset,Z[`⊃`]=Z.supset,Z[`⊆`]=Z.subseteq,Z[`⊇`]=Z.supseteq,Z[`⊈`]=Z.nsubseteq,Z[`⊉`]=Z.nsupseteq,Z[`⊏`]=Z.sqsubset,Z[`⊐`]=Z.sqsupset,Z[`⊓`]=Z.sqcap,Z[`⊔`]=Z.sqcup,Z[`⊖`]=Z.ominus,Z[`⊘`]=Z.oslash,Z[`⊙`]=Z.odot,Z[`⊢`]=Z.vdash,Z[`⊣`]=Z.dashv,Z[`⊤`]=Z.top,Z[`⊥`]=Z.bot,Z[`⊧`]=Z.models,Z[`⋀`]=Z.wedge,Z[`⋁`]=Z.vee,Z[`⋂`]=Z.cap,Z[`⋃`]=Z.cup,Z[`⋄`]=Z.diamond,Z[`⋅`]=Z.cdot,Z[`⋆`]=Z.star,Z[`⋈`]=Z.bowtie,Z[`⋮`]=Z.vdots,Z[`⋯`]=Z.cdots,Z[`⋱`]=Z.ddots;var QY,$Y=YJ,eX=document.createElement(`div`).style,tX={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1},nX;for(var rX in tX)if(rX in eX){nX=rX;break}nX?QY=function(e,t,n){e.css(nX,`scale(`+t+`,`+n+`)`)}:`filter`in eX?($Y=function(e){e.className=e.className},QY=function(e,t,n){t/=1+(n-1)/2,e.css(`fontSize`,n+`em`),e.hasClass(`mq-matrixed-container`)||e.addClass(`mq-matrixed-container`).wrapInner(`<span class="mq-matrixed"></span>`);var r=e.children().css(`filter`,`progid:DXImageTransform.Microsoft.Matrix(M11=`+t+`,SizingMethod='auto expand')`);function i(){e.css(`marginRight`,(r.width()-1)*(t-1)/t+`px`)}i();var a=setInterval(i);HJ(window).load(function(){clearTimeout(a),i()})}):QY=function(e,t,n){e.css(`fontSize`,n+`em`)};var iX=J(OY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`>&0</`+n+`>`)}}),aX=J(OY,function(e,t){e.init=function(e,n,r){this.args=arguments,this.htmlTemplate=`<`+n+` `+r+`><`+n+` class="mq-xarrow-over">&0</`+n+`><`+n+` class="mq-xarrow-under"></`+n+`></`+n+`>`,t.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`(`,`)`]},e.parser=function(){var e=this;return EY.optBlock.then(function(t){return EY.block.map(function(n){var r=oX.apply(null,e.args);return r.blocks=[t,n],t.adopt(r,0,0),n.adopt(r,t,0),r})}).or(t.parser.call(this))}}),oX=J(aX,function(e,t){e.init=function(e,t,n){this.htmlTemplate=`<`+t+` `+n+`><`+t+` class="mq-xarrow-over">&1</`+t+`><`+t+` class="mq-xarrow-under">&0</`+t+`></`+t+`>`,OY.prototype.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`[`,`](`,`)`]},e.latex=function(){return this.ctrlSeq+`[`+this.ends[Y].latex()+`]{`+this.ends[X].latex()+`}`},e.finalizeTree=function(){this.downInto=this.ends[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),sX=function(e){var t=`<span class="`+e+`-inner-right">g</span><span class="`+e+`-inner-left">h</span>`;return J(OY,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`<span class="mq-empty-box">&0</span></`+i+`></`+i+`>`)}})},cX=J(OY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`><span class="mq-longdiv-curve-border">)</span><span class="mq-longdiv-inner"><span class="mq-empty">&0</span></`+n+`></span>`)}}),lX=J(OY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-row"><p>`+r+`</p><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td><td class="mq-empty"></td><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),uX=J(OY,function(e,t){e.init=function(e){t.init.call(this,e,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),dX=J(OY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-col"><p>`+r+`</p></span><span class="matrix-edit-content-col"><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),fX=function(e,t){return J(kY,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`</`+i+`></`+i+`>`)}})};Z.mathrm=q(iX,`\\mathrm`,`span`,`class="mq-roman mq-font"`),Z.mathit=q(iX,`\\mathit`,`i`,`class="mq-font"`),Z.mathbf=q(iX,`\\mathbf`,`b`,`class="mq-font"`),Z.mathsf=q(iX,`\\mathsf`,`span`,`class="mq-sans-serif mq-font"`),Z.mathtt=q(iX,`\\mathtt`,`span`,`class="mq-monospace mq-font"`),Z.underline=q(iX,`\\underline`,`span`,`class="mq-non-leaf mq-underline"`),Z.overline=Z.bar=q(sX(`mq-overline`),`\\overline`,`span`,`class="mq-non-leaf mq-overline"`),Z.longdiv=q(cX,`\\longdiv`,`span`,`class="mq-non-leaf mq-longdiv"`),Z.overrightarrow=q(sX(`mq-overarrow`),`\\overrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-right"`),Z.overleftarrow=q(sX(`mq-overarrow`),`\\overleftarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-left"`),Z.xleftarrow=q(aX,`\\xleftarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-left"`),Z.xrightarrow=q(aX,`\\xrightarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-right"`),Z.overleftrightarrow=q(iX,`\\overleftrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-both"`),Z.overarc=q(iX,`\\overarc`,`span`,`class="mq-non-leaf mq-overarc"`),Z.dot=J(OY,function(e,t){e.init=function(){t.init.call(this,`\\dot`,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),Z.addmatrixrow=q(lX,`\\addmatrixrow`,`span`,`+`),Z.addmatrixcol=q(dX,`\\addmatrixcol`,`span`,`+`),Z.ngtr=Z[`≯`]=q(fX(`mq-ngtr`,`&#8815;`),`\\ngtr `,`span`,`class="mq-non-leaf mq-ngtr"`),Z.nless=Z[`≮`]=q(fX(`mq-nless`,`&#8814;`),`\\nless `,`span`,`class="mq-non-leaf mq-nless"`),Z.dot=q(uX,`\\dot`),Z.parallelogram=q(fX(`mq-parallelogram`,`&#9649;`),`\\parallelogram `,`span`,`class="mq-non-leaf mq-parallelogram"`),Z.textcolor=J(OY,function(e,t){e.setColor=function(e){this.color=e,this.htmlTemplate=`<span class="mq-textcolor" style="color:`+e+`">&0</span>`},e.latex=function(){return`\\textcolor{`+this.color+`}{`+this.blocks[0].latex()+`}`},e.parser=function(){var e=this,n=CY.optWhitespace,r=CY.string,i=CY.regex;return n.then(r(`{`)).then(i(/^[#\w\s.,()%-]*/)).skip(r(`}`)).then(function(n){return e.setColor(n),t.parser.call(e)})},e.isStyleBlock=function(){return!0}}),Z.class=J(OY,function(e,t){e.parser=function(){var e=this,n=CY.string,r=CY.regex;return CY.optWhitespace.then(n(`{`)).then(r(/^[-\w\s\\\xA0-\xFF]*/)).skip(n(`}`)).then(function(n){return e.cls=n||``,e.htmlTemplate=`<span class="mq-class `+n+`">&0</span>`,t.parser.call(e)})},e.latex=function(){return`\\class{`+this.cls+`}{`+this.blocks[0].latex()+`}`},e.isStyleBlock=function(){return!0}});var pX=J(OY,function(e,t){e.ctrlSeq=`_{...}^{...}`,e.createLeftOf=function(e){if(!(!this.replacedFragment&&!e[Y]&&e.options.supSubsRequireOperand))return t.createLeftOf.apply(this,arguments)},e.contactWeld=function(e){for(var t=Y;t;t=t===Y&&X)if(this[t]instanceof pX){for(var n=`sub`;n;n=n===`sub`&&`sup`){var r=this[n],i=this[t][n];if(r){if(!i)this[t].addBlock(r.disown());else if(r.isEmpty())var a=nY(i,0,i.ends[Y]);else{r.jQ.children().insAtDirEnd(-t,i.jQ);var o=r.children().disown(),a=nY(i,o.ends[X],i.ends[Y]);t===Y?o.adopt(i,i.ends[X],0):o.adopt(i,0,i.ends[Y])}this.placeCursor=function(e,n){return function(r){r.insAtDirEnd(-t,e||n)}}(i,r)}}this.remove(),e&&e[Y]===this&&(t===X&&a?a[Y]?e.insRightOf(a[Y]):e.insAtLeftEnd(a.parent):e.insRightOf(this[t]));break}},fY.p.charsThatBreakOutOfSupSub=``,e.finalizeTree=function(){this.ends[Y].write=function(e,t){if(e.options.autoSubscriptNumerals&&this===this.parent.sub){if(t===`_`)return;var n=this.chToCmd(t,e.options);return n instanceof kY?e.deleteSelection():e.clearSelection().insRightOf(this.parent),n.createLeftOf(e.show())}e[Y]&&!e[X]&&!e.selection&&e.options.charsThatBreakOutOfSupSub.indexOf(t)>-1&&e.insRightOf(this.parent),AY.p.write.apply(this,arguments)}},e.moveTowards=function(e,n,r){n.options.autoSubscriptNumerals&&!this.sup?n.insDirOf(e,this):t.moveTowards.apply(this,arguments)},e.deleteTowards=function(e,n){if(n.options.autoSubscriptNumerals&&this.sub){var r=this.sub.ends[-e];r instanceof kY?r.remove():r&&r.deleteTowards(e,n.insAtDirEnd(-e,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(Y,n.insAtLeftEnd(this.sub)),this.sup&&n.insDirOf(-e,this))}else t.deleteTowards.apply(this,arguments)},e.latex=function(){function e(e,t){var n=t&&t.latex();return t?e+(n.length===1?n:`{`+(n||` `)+`}`):``}return e(`_`,this.sub)+e(`^`,this.sup)},e.addBlock=function(e){this.supsub===`sub`?(this.sup=this.upInto=this.sub.upOutOf=e,e.adopt(this,this.sub,0).downOutOf=this.sub,e.jQ=HJ(`<span class="mq-sup"/>`).append(e.jQ.children()).attr(KJ,e.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=e,e.adopt(this,0,this.sup).upOutOf=this.sup,e.jQ=HJ(`<span class="mq-sub"></span>`).append(e.jQ.children()).attr(KJ,e.id).appendTo(this.jQ.removeClass(`mq-sup-only`)),this.jQ.append(`<span style="display:inline-block;width:0">&#8203;</span>`));for(var t=0;t<2;t+=1)(function(e,t,n,r){e[t].deleteOutOf=function(i,a){if(a.insDirOf(this[i]?-i:i,this.parent),!this.isEmpty()){var o=this.ends[i];this.children().disown().withDirAdopt(i,a.parent,a[i],a[-i]).jQ.insDirOf(-i,a.jQ),a[-i]=o}e.supsub=n,delete e[t],delete e[r+`Into`],e[n][r+`OutOf`]=mX,delete e[n].deleteOutOf,t===`sub`&&HJ(e.jQ.addClass(`mq-sup-only`)[0].lastChild).remove(),this.remove()}})(this,`sub sup`.split(` `)[t],`sup sub`.split(` `)[t],`down up`.split(` `)[t])},e.reflow=function(){var e=this.jQ,t=e.prev();if(t.length){var n=e.children(`.mq-sup`);if(n.length){var r=parseInt(n.css(`font-size`)),i=n.offset().top+n.height()-t.offset().top-.7*r,a=parseInt(n.css(`margin-bottom`));n.css(`margin-bottom`,a+i)}}}});function mX(e){var t=this.parent,n=e;do{if(n[X])return e.insLeftOf(t);n=n.parent.parent}while(n!==t);e.insRightOf(t)}Z.subscript=Z._=J(pX,function(e,t){e.supsub=`sub`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&0</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`_`],e.finalizeTree=function(){this.downInto=this.sub=this.ends[Y],this.sub.upOutOf=mX,t.finalizeTree.call(this)}}),Z.superscript=Z.supscript=Z[`^`]=J(pX,function(e,t){e.supsub=`sup`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`^`],e.finalizeTree=function(){this.upInto=this.sup=this.ends[X],this.sup.downOutOf=mX,t.finalizeTree.call(this)}});var hX=J(OY,function(e,t){e.parser=function(){for(var e=CY.string,t=CY.optWhitespace,n=CY.succeed,r=EY.block,i=this,a=i.blocks=[AY(),AY()],o=0;o<a.length;o+=1)a[o].adopt(i,i.ends[X],0);return t.then(e(`_`).or(e(`^`))).then(function(e){var t=a[e===`_`?0:1];return r.then(function(e){return e.children().adopt(t,t.ends[X],0),n(i)})}).many().result(i)},e.finalizeTree=function(){this.downInto=this.ends[Y],this.upInto=this.ends[X],this.ends[Y].upOutOf=this.ends[X],this.ends[X].downOutOf=this.ends[Y]}}),gX=J(hX,function(e,t){e.init=function(e,t){var n=`<span class="mq-large-operator mq-non-leaf"><span class="mq-to"><span>&1</span></span><big>`+t+`</big><span class="mq-from"><span>&0</span></span></span>`;kY.prototype.init.call(this,e,n)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())+`^`+e(this.ends[X].latex())},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments),e.options.sumStartsWithNEquals&&(zY(`n`).createLeftOf(e),ZY().createLeftOf(e))}});Z[`∑`]=Z.sum=Z.summation=q(gX,`\\sum `,`&sum;`),Z[`∏`]=Z.prod=Z.product=q(gX,`\\prod `,`&prod;`),Z.coprod=Z.coproduct=q(gX,`\\coprod `,`&#8720;`),Z[`∫`]=Z.int=Z.integral=J(gX,function(e,t){e.init=function(){kY.prototype.init.call(this,`\\int `,`<span class="mq-int mq-non-leaf"><big>&int;</big><span class="mq-supsub mq-non-leaf"><span class="mq-sup"><span class="mq-sup-inner">&1</span></span><span class="mq-sub">&0</span><span style="display:inline-block;width:0">&#8203</span></span></span>`)},e.createLeftOf=OY.p.createLeftOf}),Z.lim=Z.limit=J(hX,function(e,t){e.init=function(){kY.prototype.init.call(this,`\\lim `,`<span class="mq-lim mq-non-leaf"><span class="mq-un-italicized">lim</span><span class="mq-approaches"><span>&0</span></span></span>`)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())}});var _X=Z.over=oY[`/`]=J(Z.frac=Z.dfrac=Z.cfrac=Z.fraction=J(OY,function(e,t){e.ctrlSeq=`\\frac`,e.htmlTemplate=`<span class="mq-fraction mq-non-leaf"><span class="mq-numerator"><span class="mq-empty-box">&0</span></span><span class="mq-denominator"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`(`,`)/(`,`)`],e.finalizeTree=function(){this.upInto=this.ends[X].upOutOf=this.ends[Y],this.downInto=this.ends[Y].downOutOf=this.ends[X]}}),function(e,t){e.createLeftOf=function(e){if(!this.replacedFragment){for(var n=e[Y];n&&!(n instanceof $||n instanceof(Z.text||YJ)||n instanceof gX||n.ctrlSeq===`\\ `||/^[,;:]$/.test(n.ctrlSeq));)n=n[Y];n instanceof gX&&n[X]instanceof pX&&(n=n[X],n[X]instanceof pX&&n[X].ctrlSeq!=n.ctrlSeq&&(n=n[X])),n!==e[Y]&&!e.isTooDeep(1)&&(this.replaces(aY(n[X]||e.parent.ends[Y],e[Y])),e[Y]=n)}t.createLeftOf.call(this,e)}});Z.underset=J(OY,function(e,t){e.ctrlSeq=`\\underset`,e.htmlTemplate=`<span class="mq-underset mq-overunder mq-non-leaf"><span class="mq-over">&1</span><span class="mq-under">&0</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),Z.overset=J(OY,function(e,t){e.ctrlSeq=`\\overset`,e.htmlTemplate=`<span class="mq-overset mq-overunder mq-non-leaf"><span class="mq-over">&0</span><span class="mq-under">&1</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[X].upOutOf=this.ends[Y],this.upInto=this.ends[Y].downOutOf=this.ends[X]}});var vX=Z.sqrt=Z[`√`]=J(OY,function(e,t){e.ctrlSeq=`\\sqrt`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-sqrt-prefix">&radic;</span><span class="mq-non-leaf mq-sqrt-stem"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt(`,`)`],e.parser=function(){return EY.optBlock.then(function(e){return EY.block.map(function(t){var n=yX();return n.blocks=[e,t],e.adopt(n,0,0),t.adopt(n,e,0),n})}).or(t.parser.call(this))},e.reflow=function(){var e=this.ends[X].jQ.parent();QY(e.prev(),1,e.innerHeight()/+e.css(`fontSize`).slice(0,-2)-.1)}});Z.hat=J(OY,function(e,t){e.ctrlSeq=`\\hat`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-hat-prefix">^</span><span class="mq-hat-stem">&0</span></span>`,e.textTemplate=[`hat(`,`)`]});var yX=Z.nthroot=J(vX,function(e,t){e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">&0</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&1</span></span></span>`,e.textTemplate=[`sqrt[`,`](`,`)`],e.latex=function(){return`\\sqrt[`+this.ends[Y].latex()+`]{`+this.ends[X].latex()+`}`}}),bX=J(OY,function(e,t){e.init=function(e,n,r){var i=`<span class="mq-non-leaf"><span class="mq-diacritic-above">`+n+`</span><span class="mq-diacritic-stem">&0</span></span>`;t.init.call(this,e,i,r)}});Z.vec=q(bX,`\\vec`,`&rarr;`,[`vec(`,`)`]),Z.tilde=q(bX,`\\tilde`,`~`,[`tilde(`,`)`]),Z.lrncuberoot=J(vX,function(e,t){e.ctrlSeq=`\\lrncuberoot`,e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">3</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt[3](`,`)`],e.latex=function(){return`\\sqrt[3]{`+this.ends[Y].latex()+`}`}}),Z.abs=J(OY,function(e){e.ctrlSeq=`\\abs`,e.htmlTemplate=`<span class="mq-abs mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[`|`,`|`]}),Z.lrnplaceholder=J(OY,function(e,t){e.ctrlSeq=`\\lrnplaceholder`,e.htmlTemplate=`<span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[``],e.latex=function(){return this.ends[Y].latex()}}),Z.lrnexponent=J(OY,function(e,t){e.ctrSeq=`\\lrnexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&1</span></span></span></span>`,e.textTemplate=[``,`**`],e.latex=function(){var e=this.ends[X].latex();return e.length>1?e=`{`+e+`}`:e.length===0&&(e=`{ }`),this.ends[Y].latex()+`^`+e}}),Z.lrnsquaredexponent=J(OY,function(e,t){e.ctrSeq=`\\lrnsquaredexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">2</span></span></span></span>`,e.textTemplate=[``,`**2`],e.latex=function(){return this.ends[Y].latex()+`^2`}}),Z.lrnsubscript=J(OY,function(e,t){e.ctrSeq=`\\lrnsubscript`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&nbsp;</span></span></span>`,e.textTemplate=[``,`_`],e.latex=function(){return this.ends[Y].latex()+`_`+this.ends[X].latex()}});function xX(e,t){e.jQadd=function(){t.jQadd.apply(this,arguments),this.delimjQs=this.jQ.children(`:first`).add(this.jQ.children(`:last`)),this.contentjQ=this.jQ.children(`:eq(1)`)},e.reflow=function(){var e=this.contentjQ.outerHeight()/parseFloat(this.contentjQ.css(`fontSize`));QY(this.delimjQs,qJ(1+.2*(e-1),1.2),1.2*e)}}var SX=J(J(OY,xX),function(e,t){e.init=function(e,n,r,i,a){t.init.call(this,`\\left`+i,WJ,[n,r]),this.side=e,this.sides={},this.sides[Y]={ch:n,ctrlSeq:i},this.sides[X]={ch:r,ctrlSeq:a}},e.numBlocks=function(){return 1},e.html=function(){return this.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-paren`+(this.side===X?` mq-ghost`:``)+`">`+this.sides[Y].ch+`</span><span class="mq-non-leaf">&0</span><span class="mq-scaled mq-paren`+(this.side===Y?` mq-ghost`:``)+`">`+this.sides[X].ch+`</span></span>`,t.html.call(this)},e.latex=function(){return`\\left`+this.sides[Y].ctrlSeq+this.ends[Y].latex()+`\\right`+this.sides[X].ctrlSeq},e.matchBrack=function(e,t,n){return n instanceof SX&&n.side&&n.side!==-t&&(!e.restrictMismatchedBrackets||CX[this.sides[this.side].ch]===n.sides[n.side].ch||{"(":`]`,"[":`)`}[this.sides[Y].ch]===n.sides[X].ch)&&n},e.closeOpposing=function(e){e.side=0,e.sides[this.side]=this.sides[this.side],e.delimjQs.eq(this.side===Y?0:1).removeClass(`mq-ghost`).html(this.sides[this.side].ch)},e.createLeftOf=function(e){if(!this.replacedFragment){var n=e.options;if(this.sides[Y].ch===`|`)var r=this.matchBrack(n,X,e[X])||this.matchBrack(n,Y,e[Y])||this.matchBrack(n,0,e.parent.parent);else var r=this.matchBrack(n,-this.side,e[-this.side])||this.matchBrack(n,-this.side,e.parent.parent)}if(r){var i=this.side=-r.side;this.closeOpposing(r),r===e.parent.parent&&e[i]&&aY(e[i],e.parent.ends[i],-i).disown().withDirAdopt(-i,r.parent,r,r[i]).jQ.insDirOf(i,r.jQ),r.bubble(`reflow`)}else r=this,i=r.side,r.replacedFragment?r.side=0:e[-i]&&(r.replaces(aY(e[-i],e.parent.ends[-i],i)),e[-i]=0),t.createLeftOf.call(r,e);i===Y?e.insAtLeftEnd(r.ends[Y]):e.insRightOf(r)},e.placeCursor=YJ,e.unwrap=function(){this.ends[Y].children().disown().adopt(this.parent,this,this[X]).jQ.insertAfter(this.jQ),this.remove()},e.deleteSide=function(e,t,n){var r=this.parent,i=this[e],a=r.ends[e];if(e===this.side){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}var o=n.options,s=!this.side;if(this.side=-e,this.matchBrack(o,e,this.ends[Y].ends[this.side])){this.closeOpposing(this.ends[Y].ends[this.side]);var c=this.ends[Y].ends[e];this.unwrap(),c.siblingCreated&&c.siblingCreated(n.options,e),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r)}else{if(this.matchBrack(o,e,this.parent.parent))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else if(t&&s){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}else this.sides[e]={ch:CX[this.sides[this.side].ch],ctrlSeq:CX[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass(`mq-ghost`).eq(e===Y?0:1).addClass(`mq-ghost`).html(this.sides[e].ch);if(i){var c=this.ends[Y].ends[e];aY(i,a,-e).disown().withDirAdopt(-e,this.ends[Y],c,0).jQ.insAtDirEnd(e,this.ends[Y].jQ.removeClass(`mq-empty`)),c.siblingCreated&&c.siblingCreated(n.options,e),n.insDirOf(-e,i)}else t?n.insDirOf(e,this):n.insAtDirEnd(e,this.ends[Y])}},e.deleteTowards=function(e,t){this.deleteSide(-e,!1,t)},e.finalizeTree=function(){this.ends[Y].deleteOutOf=function(e,t){this.parent.deleteSide(e,!0,t)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(+(this.side===Y)).removeClass(`mq-ghost`),this.side=0}},e.siblingCreated=function(e,t){t===-this.side&&this.finalizeTree()}}),CX={"(":`)`,")":`(`,"[":`]`,"]":`[`,"{":`}`,"}":`{`,"\\{":`\\}`,"\\}":`\\{`,"&lang;":`&rang;`,"&rang;":`&lang;`,"\\langle ":`\\rangle `,"\\rangle ":`\\langle `,"|":`|`,"\\lVert ":`\\rVert `,"\\rVert ":`\\lVert `};function wX(e,t){var t=t||e,n=CX[e],r=CX[t];oY[e]=q(SX,Y,e,n,t,r),oY[n]=q(SX,X,e,n,t,r)}wX(`(`),wX(`[`),wX(`{`,`\\{`),Z.langle=q(SX,Y,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),Z.rangle=q(SX,X,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),oY[`|`]=q(SX,Y,`|`,`|`,`|`,`|`),Z.lVert=q(SX,Y,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.rVert=q(SX,X,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.left=J(OY,function(e){e.parser=function(){var e=CY.regex,t=CY.string;CY.succeed;var n=CY.optWhitespace;return n.then(e(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)).then(function(r){var i=r.charAt(0)===`\\`?r.slice(1):r;return r==`\\langle`&&(i=`&lang;`,r+=` `),r==`\\lVert`&&(i=`&#8741;`,r+=` `),EY.then(function(a){return t(`\\right`).skip(n).then(e(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)).map(function(e){var t=e.charAt(0)===`\\`?e.slice(1):e;e==`\\rangle`&&(t=`&rang;`,e+=` `),e==`\\rVert`&&(t=`&#8741;`,e+=` `);var n=SX(0,i,t,r,e);return n.blocks=[a],a.adopt(n,0,0),n})})})}}),Z.right=J(OY,function(e){e.parser=function(){return CY.fail(`unmatched \\right`)}}),Z.choose=J(Z.binom=Z.binomial=J(J(OY,xX),function(e,t){e.ctrlSeq=`\\binom`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-paren mq-scaled">(</span><span class="mq-non-leaf"><span class="mq-array mq-non-leaf"><span>&0</span><span>&1</span></span></span><span class="mq-paren mq-scaled">)</span></span>`,e.textTemplate=[`choose(`,`,`,`)`]}),function(e){e.createLeftOf=_X.prototype.createLeftOf}),Z.editable=Z.MathQuillMathField=J(OY,function(e,t){e.ctrlSeq=`\\MathQuillMathField`,e.htmlTemplate=`<span class="mq-editable-field"><span class="mq-root-block">&0</span></span>`,e.parser=function(){var e=this,n=CY.string,r=CY.regex,i=CY.succeed;return n(`[`).then(r(/^[a-z][a-z0-9]*/i)).skip(n(`]`)).map(function(t){e.name=t}).or(i()).then(t.parser.call(e))},e.finalizeTree=function(e){var t=uY(this.ends[Y],this.jQ,e);t.KIND_OF_MQ=`MathField`,t.editable=!0,t.createTextarea(),t.editablesTextareaEvents(),t.cursor.insAtRightEnd(t.root),SY(t.root)},e.registerInnerField=function(e,t){e.push(e[this.name]=t(this.ends[Y].controller))},e.latex=function(){return this.ends[Y].latex()},e.text=function(){return this.ends[Y].text()}});var TX=Z.embed=J(kY,function(e,t){e.setOptions=function(e){function t(){return``}return this.text=e.text||t,this.htmlTemplate=e.htmlString||``,this.latex=e.latex||t,this},e.parser=function(){var e=this,t=CY.string,n=CY.regex,r=CY.succeed;return t(`{`).then(n(/^[a-z][a-z0-9]*/i)).skip(t(`}`)).then(function(i){return t(`[`).then(n(/^[-\w\s]*/)).skip(t(`]`)).or(r()).map(function(t){return e.setOptions(hY[i](t))})})}});Z.MathQuillResponseContainer=J(OY,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainer`,e.htmlTemplate=`<span class="lrn-mq-response-container"><marker class="lrn-qe-keyboard-i-response"></marker><content>Response</content></span>`,e.latex=function(){return`\\MathQuillResponseContainer`},e.text=function(){return this.ends[Y].text()}}),Z.MathQuillResponseContainerIcon=J(OY,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainerIcon`,e.htmlTemplate=`<span class="lrn-mq-response-container-icon"><span class="lrn-qe-keyboard-i-response"></span></span>`,e.latex=function(){return`\\MathQuillResponseContainerIcon`},e.text=function(){return this.ends[Y].text()}});var EX=Z.matrix=J(OY,function(e,t){var n=J(AY,function(e,t){e.init=function(e,n){return this.column=e,this.row=n,t.init.call(this)},e.keystroke=function(e,n,r){switch(e){case`Shift-Spacebar`:return n.preventDefault(),this.parent.insertColumn(this);case`Shift-Enter`:return this.parent.insertRow(this)}return t.keystroke.apply(this,arguments)},e.deleteOutOf=function(e,n){var r=this,i=arguments;this.parent.backspace(this,e,n,function(){return t.deleteOutOf.apply(r,i)})}}),r={column:`&`,row:`\\\\`};e.parentheses={left:null,right:null},e.maximum={rows:5,columns:5},e.defaults={rows:2,columns:2},e.ctrlSeq=`\\matrix`,e.createBlocks=function(){var e=this,t=e.blocks=[],r,i,a=0;this.htmlTemplate.replace(/&\d+/g,function(o,s){var c=e.htmlTemplate.substring(0,s).match(/<tr[^>]*>/gi).length-1;i=r===c?i+1:0,t[a]=n(i,c),t[a].adopt(e,e.ends[X],0),r=c,a++})},e.reflow=function(){var e=this.jQ.children(`table`),t=e.outerHeight()/+e.css(`fontSize`).slice(0,-2),n=this.jQ.children(`.mq-paren`);n.length&&QY(n,qJ(1+.2*(t-1),1.2),1.05*t)},e.latex=function(){var e=this.getMatrixName(),t=`\\begin{`+e+`}`,n,i,a;for(a=0;a<this.blocks.length;a++)n=this.blocks[a].row,i!==void 0&&(i===n?t+=r.column:t+=r.row),i=n,t+=this.blocks[a].latex();return t+=`\\end{`+e+`}`,t},e.createLeftOf=function(n){this.cursor=n;var r=Math.min(this.defaults.rows,this.maximum.rows),i=Math.min(this.defaults.columns,this.maximum.columns);this.defaultHtmlTemplate=this.defaultHtmlTemplate||this.generateHtmlTemplate(r,i),e.htmlTemplate=this.defaultHtmlTemplate,t.createLeftOf.call(this,n)},e.getMatrixName=function(){return this.ctrlSeq.replace(`\\`,``)},e.generateHtmlTemplate=function(e,t){var n=`<span class="mq-matrix mq-non-leaf">`+o(this.parentheses.left);n+=`<table class="mq-non-leaf">`,e=Math.min(e,this.maximum.rows),t=Math.min(t,this.maximum.columns);for(var r=0,i=0;i<e;i++){n+=`<tr>`;for(var a=0;a<t;a++)n+=`<td>&`+r+`</td>`,r++;n+=`</tr>`}return n+=`</table>`,n+=o(this.parentheses.right)+`</span>`,n;function o(e){return e?`<span class="mq-paren mq-scaled">`+e+`</span>`:``}},e.htmlTemplate=e.generateHtmlTemplate(1,1),e.parser=function(){var e=CY.regex,t=this,i=this.getMatrixName(),a=RegExp(`^(.*?)\\\\end{`+i+`}`),o=RegExp(`\\\\end{`+i+`}`);return e(a).then(function(e){var i=e.replace(o,``),a=[],s=i.split(r.row),c=Math.min(s.length,t.maximum.rows),l=0,u,d;for(d=0;d<c;d++)u=s[d].split(r.column),l=Math.max(l,u.length);for(l=Math.min(l,t.maximum.columns),d=0;d<c;d++){u=s[d].split(r.column);for(var e=0;e<l;e++){var f=n(e,d);EY.parse(u[e]||` `).children().adopt(f,f.ends[X],0),a.push(f)}}t.htmlTemplate=t.generateHtmlTemplate(c,l),t.blocks=a;for(var d=0;d<a.length;d+=1)a[d].adopt(t,t.ends[X],0);return CY.succeed(t)})},e.finalizeTree=function(){var e=this.jQ.find(`table`);e.length&&(this.relink(),e.removeClass(function(e,t){var n=t.match(/mq-rows-\d+/g);return n&&n.join(` `)||``}),e.addClass(`mq-rows-`+e.find(`tr`).length))},e.relink=function(){var e=this.jQ.find(`td`),t=rY.byId[e.first().attr(KJ)],n=rY.byId[e.last().attr(KJ)],r=e.eq(0).closest(`tr`),i=[];e.each(function(t){var n=rY.byId[HJ(this).attr(KJ)],a=e.eq(t+1),o=HJ(this).closest(`tr`).next(`tr`),s=HJ(this).closest(`tr`).index(),c=HJ(this).index(),l;if(a.length){var u=rY.byId[a.attr(KJ)];n[X]=u,u[Y]=n}if(l=o.length?o.find(`td`).eq(c):r.find(`td`).eq(c+1),l.length){var d=rY.byId[l.attr(KJ)];n.downOutOf=d,d.upOutOf=n}n.column=c,n.row=s,i.push(n)}),this.ends[Y]=t,this.ends[X]=n,t&&t[Y]&&delete t[Y],n&&n[X]&&delete n[X],this.blocks=i},e.deleteCell=function(e){var t=e.jQ.closest(`tr`),n=e.jQ.index(),r=t.index(),i=t.find(`td`).not(e.jQ),a=this.jQ.find(`tr`).not(t).map(function(){return HJ(this).find(`td`)[n]}),o=this.jQ.find(`td`).length===1,s;function c(){return rY.byId[HJ(this).attr(KJ)].isEmpty()}return i.filter(c).length===i.length&&a.length&&(i.remove(),e.jQ.remove(),t.remove(),this.finalizeTree()),a.filter(c).length===a.length&&i.length&&(a.remove(),e.jQ.remove(),this.finalizeTree()),o||(r=Math.min(r,this.jQ.find(`tr`).length-1),n=Math.min(n,this.jQ.find(`tr`).eq(r).find(`td`).length-1),s=rY.byId[this.jQ.find(`tr`).eq(r).find(`td`).eq(n).attr(KJ)]),s},e.addRow=function(e){if(!(this.jQ.find(`tr`).length>=this.maximum.rows)){for(var t=e.find(`td`).length,r=HJ(`<tr></tr>`),i,a,o=0;o<t;o++)i=n(),i.parent=this,i.jQ=HJ(`<td class="mq-empty">`).attr(KJ,i.id),r.append(i.jQ),a||=i;return r.insertAfter(e),a}},e.addColumn=function(e){if(!(e.closest(`tr`).find(`td`).length>=this.maximum.columns)){var t=e.index(),r=e.closest(`tr`).index(),i=this,a,o=[];return this.jQ.find(`tr`).each(function(){a=n(),a.parent=i,a.jQ=HJ(`<td class="mq-empty">`).attr(KJ,a.id),a.jQ.insertAfter(HJ(this).find(`td`).eq(t)),o.push(a)}),o[r]}},e.insertColumn=function(e){newBlock=this.addColumn(e.jQ),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.insertRow=function(e){newBlock=this.addRow(e.jQ.closest(`tr`)),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.backspace=function(e,t,n,r){if(e.isEmpty()){var i=this.deleteCell(e);i?n.insAtRightEnd(i):(r(),this.finalizeTree()),this.bubble(`edited`)}}});Z.pmatrix=J(EX,function(e,t){e.ctrlSeq=`\\pmatrix`,e.parentheses={left:`(`,right:`)`}}),Z.bmatrix=J(EX,function(e,t){e.ctrlSeq=`\\bmatrix`,e.parentheses={left:`[`,right:`]`}}),Z.Bmatrix=J(EX,function(e,t){e.ctrlSeq=`\\Bmatrix`,e.parentheses={left:`{`,right:`}`}}),Z.vmatrix=J(EX,function(e,t){e.ctrlSeq=`\\vmatrix`,e.parentheses={left:`|`,right:`|`}}),Z.Vmatrix=J(EX,function(e,t){e.ctrlSeq=`\\Vmatrix`,e.parentheses={left:`‖`,right:`‖`}});var DX=bY(3);for(var OX in DX)(function(e,t){typeof t==`function`?(_Y[e]=function(){return gY(),t.apply(this,arguments)},_Y[e].prototype=t.prototype):_Y[e]=t})(OX,DX[OX]);var kX=function(e){e.registerEmbed(`newLine`,()=>({htmlString:`<div class="newLine"></div>`,text:()=>`testText`,latex:()=>`\\embed{newLine}[]`}))},AX;typeof window<`u`&&(AX=_Y.getInterface(3),AX&&AX.registerEmbed&&kX(AX));var jX=D(`math-input:mq:input`),MX=L(`span`)({}),NX=class extends N.Component{static propTypes={className:p.string,onClick:p.func,onChange:p.func,latex:p.string,onFocus:p.func,onBlur:p.func};componentDidMount(){if(!AX)throw Error(`MQ is not defined - but component has mounted?`);this.mathField=AX.MathField(this.input,{handlers:{edit:this.onInputEdit.bind(this)}}),this.updateLatex()}componentDidUpdate(){this.updateLatex()}updateLatex(){if(!this.mathField)return;let{latex:e}=this.props;e!=null&&this.mathField.latex(e)}clear(){return this.mathField.latex(``),``}blur(){jX(`blur mathfield`),this.mathField.blur()}focus(){jX(`focus mathfield...`),this.mathField.focus()}command(e){return jX(`command: `,e),Array.isArray(e)?e.forEach(e=>{this.mathField.cmd(e)}):this.mathField.cmd(e),this.mathField.focus(),this.mathField.latex()}keystroke(e){return this.mathField.keystroke(e),this.mathField.focus(),this.mathField.latex()}write(e){return jX(`write: `,e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}onInputEdit=()=>{jX(`[onInputEdit] ...`);let{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())};refresh=()=>{this.blur(),this.focus()};onKeyPress=e=>{if(Object.keys(this.mathField.__controller.options).indexOf(`ignoreNextMousedown`)<0&&this.refresh(),e.charCode===13){e.preventDefault();return}};onClick=e=>{let{onClick:t}=this.props;this.refresh(),t&&t(e)};shouldComponentUpdate(e){return jX(`next: `,e.latex),jX(`current: `,this.mathField.latex()),e.latex!==this.mathField.latex()}render(){let{onFocus:e,onBlur:t,className:n}=this.props;return(0,F.jsx)(MX,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}},PX=D(`pie-lib:math-input:mq:static`),FX=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,IX=/ /g;function LX(e=``){return e.replace(IX,``)}function RX(e){let t=0;for(let n=0;n<(e||``).length;n++)e[n]===`{`&&t++;return t}var zX=class extends N.Component{static propTypes={latex:p.string.isRequired,onFocus:p.func,onBlur:p.func,className:p.string,getFieldName:p.func,onSubFieldChange:p.func,onSubFieldFocus:p.func,setInput:p.func};static defaultProps={getFieldName:()=>{}};constructor(e){super(e),this.state={announcement:``,previousLatex:``,inputSource:null,isDeleteKeyPressed:!1},this.inputRef=N.createRef()}componentDidMount(){this.update(),EJ(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),EJ()}componentWillUnmount(){this.removeLiveRegion(),this.removeEventListeners()}createLiveRegion=()=>{this.liveRegion=document.createElement(`div`),this.liveRegion.style.position=`absolute`,this.liveRegion.style.width=`1px`,this.liveRegion.style.height=`1px`,this.liveRegion.style.marginTop=`-1px`,this.liveRegion.style.clip=`rect(1px, 1px, 1px, 1px)`,this.liveRegion.style.overflow=`hidden`,this.liveRegion.setAttribute(`aria-live`,`polite`),this.liveRegion.setAttribute(`aria-atomic`,`true`),document.body.appendChild(this.liveRegion)};addEventListeners=()=>{let e=this.inputRef.current;e&&(e.addEventListener(`keydown`,this.handleKeyDown),e.addEventListener(`click`,this.handleMathKeyboardClick))};removeEventListeners=()=>{let e=this.inputRef.current;e&&(e.removeEventListener(`keydown`,this.handleKeyDown),e.removeEventListener(`click`,this.handleMathKeyboardClick))};removeLiveRegion=()=>{this.liveRegion&&=(document.body.removeChild(this.liveRegion),null)};handleKeyDown=e=>{(e?.key===`Backspace`||e?.key===`Delete`)&&this.setState({isDeleteKeyPressed:!0}),this.setState({inputSource:`keyboard`})};handleMathKeyboardClick=()=>{this.setState({inputSource:`mathKeyboard`})};onInputEdit=e=>{if(!this.mathField||this._isProgrammaticUpdate)return;let t=this.props.getFieldName(e,this.mathField.innerFields);if(this.props.onSubFieldChange){let n=e.latex().match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.inputRef?.current&&n&&n?.length)try{e.__controller.cursor.insLeftOf(e.__controller.cursor.parent[-1].parent),e.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}else this.props.onSubFieldChange(t,e.latex())}this.announceLatexConversion(e.latex())};announceLatexConversion=e=>{if(!this.state){console.error(`State is not initialized`);return}let{previousLatex:t,inputSource:n,isDeleteKeyPressed:r}=this.state,i=`Converted to math symbol`;if(n===`keyboard`&&!r)if(RX(e)>RX(t))this.announceMessage(i);else try{this.mathField.parseLatex(t),this.mathField.parseLatex(e),e==t&&this.announceMessage(i)}catch(e){console.warn(`Error parsing latex:`,e.message),console.warn(e)}(this.state.previousLatex!==e||this.state.isDeleteKeyPressed)&&this.setState({previousLatex:e,isDeleteKeyPressed:!1})};announceMessage=e=>{this.setState({previousLatex:``}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=``},500))};update=()=>{if(!AX)throw Error(`MQ is not defined - but component has mounted?`);this.mathField||=AX.StaticMath(this.inputRef?.current,{handlers:{edit:this.onInputEdit.bind(this)}});try{this._isProgrammaticUpdate=!0,this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch{this.mathField.latex(`\\MathQuillMathField[r1]{}`)}finally{this._isProgrammaticUpdate=!1}};blur=()=>{PX(`blur mathfield`),this.mathField.blur()};focus=()=>{PX(`focus mathfield...`),this.mathField.focus()};shouldComponentUpdate(e){try{let t=LX(this.mathField.parseLatex(e.latex)),n=(e.latex.match(FX)||[]).length,r=t!==LX(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return PX(`[shouldComponentUpdate] `,r),r}catch(e){return console.warn(`Error parsing latex:`,e.message,`skip update`),console.warn(e),!1}}onFocus=e=>{try{let t=e.target.parentElement.nextSibling,n=parseInt(t.getAttribute(`mathquill-block-id`),10);n||=(t=t.parentElement,parseInt(t.getAttribute(`mathquill-block-id`),10));let r=this.mathField.innerFields.find(e=>e.id===n);if(r){let e=this.props.getFieldName(r,this.mathField.innerFields);this.props.setInput&&this.props.setInput(r),this.props.onSubFieldFocus(e,r)}}catch(e){console.error(`error finding root block`,e.message)}};render(){let{onBlur:e,className:t}=this.props;return(0,F.jsx)(`span`,{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}},BX={fontFamily:`MJXZERO, MJXTEX !important`,"-webkit-font-smoothing":`antialiased !important`,"& .mq-math-mode > span > var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode span var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode .mq-nonSymbola":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode > span > var.mq-operator-name":{fontFamily:`MJXZERO, MJXTEX !important`}},VX={"& .mq-longdiv-inner":{marginTop:`-1px`,marginLeft:`5px !important;`,"& > .mq-empty":{padding:`0 !important`,marginLeft:`0px !important`,marginTop:`2px`}},"& .mq-math-mode .mq-longdiv":{display:`inline-flex !important`}},HX={"& .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`0.5em !important`,paddingRight:`0.15em`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-supsub ":{fontSize:`70.7%`},"& .mq-math-mode .mq-supsub.mq-sup-only":{verticalAlign:`-0.1em !important`,"& .mq-sup":{marginBottom:`0px !important`}},"& .mq-math-mode .mq-fraction + .mq-supsub.mq-sup-only":{verticalAlign:`0.4em !important`},"& .mq-math-mode .mq-supsub.mq-sup-only.mq-after-fraction-group":{verticalAlign:`0.4em !important`}},UX={"& *":{...BX,...VX,"& .mq-math-mode .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-longdiv-inner .mq-empty":{padding:`0 !important`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-math-mode .mq-sqrt-stem":{marginTop:`-5px`,paddingTop:`4px`},"& .mq-math-mode .mq-paren":{verticalAlign:`middle !important`},"& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty":{padding:`0 !important`},"& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ":{padding:`0 !important`}}},WX={commonMqFontStyles:BX,longdivStyles:VX,supsubStyles:HX,commonMqKeyboardStyles:UX},GX=e=>(T(5-e.length,()=>e.push([])),E.apply(null,e)),KX=D(`pie-lib:math-inline:keypad`),qX=L(zX)(({latex:e})=>{let t={pointerEvents:`none`,textTransform:`none !important`,color:UH(),"& .mq-scaled.mq-sqrt-prefix":{transform:`scale(1, 0.9) !important`},"& .mq-sup-only .mq-sup":{marginBottom:`0.9px !important`},"& .mq-empty":{backgroundColor:`${LU()} !important`},"& .mq-overline .mq-overline-inner":{borderTop:`2px solid black`},"& .mq-non-leaf.mq-overline":{borderTop:`none !important`},"& .mq-overarrow":{width:`30px`,marginTop:`0 !important`,borderTop:`2px solid black`,fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`,"&.mq-arrow-both":{top:`0px !important`,"& *":{lineHeight:`1 !important`,borderTop:`none !important`},"&:before":{fontSize:`80%`,left:`calc(-13%) !important`,top:`-0.31em !important`},"&:after":{fontSize:`80% !important`,right:`calc(-13%) !important`,top:`-1.5em`},"&.mq-empty:before":{fontSize:`80%`,left:`calc(-13%)`,top:`-0.26em`},"&.mq-empty:after":{fontSize:`80%`,right:`calc(-13%)`,top:`-0.26em`},"&.mq-empty":{minHeight:`1.4em`}},"&.mq-arrow-right:before":{fontSize:`80%`,right:`calc(-13%) !important`,top:`-0.26em !important`},"& .mq-overarrow-inner":{border:`none !important`},"& .mq-overarrow-inner .mq-overarrow-inner-right":{display:`none !important`}},"& .mq-root-block":{padding:`5px !important`},"& .mq-overarrow.mq-arrow-both.mq-empty:after":{right:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-right.mq-empty:before":{right:`-5px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-both.mq-empty:before":{left:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},"& .mq-overarc":{borderTop:`2px solid black !important`,"& .mq-overline":{borderTop:`none !important`},"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`}}};return e===`\\parallel`?{...t,fontStyle:`italic !important`}:e===`\\overleftrightarrow{\\overline{}}`?{...t,"& .mq-overarrow.mq-arrow-both":{"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`},"&:after":{position:`absolute !important`,top:`0px !important`}}}:t});qX.propTypes={latex:p.string.isRequired};var JX=e=>e?{gridTemplateColumns:`repeat(${e.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${e.rows}, minmax(40px, 60px))`,gridAutoFlow:`initial`}:{},YX=L(`div`)(()=>({...UX,width:`100%`,display:`grid`,gridTemplateRows:`repeat(5, minmax(40px, 60px))`,gridRowGap:`0px`,gridColumnGap:`0px`,gridAutoFlow:`column`,"&.character":{textTransform:`initial !important`,gridTemplateRows:`repeat(5, minmax(40px, 50px)) !important`},"&.language":{gridTemplateRows:`repeat(4, minmax(40px, 50px)) !important`,"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),XX=L(FW)(({category:e,isDelete:t,isComma:n,isDot:r})=>({minWidth:`auto`,textTransform:`none`,fontSize:n||r?`200% !important`:`140% !important`,lineHeight:n||r?`100%`:`normal`,color:UH(),backgroundColor:e===`operators`?IU():FU(),"&:hover":{backgroundColor:e===`operators`?zU():RU()},borderRadius:0,...t&&{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),ZX=L(FW)(({category:e})=>({textTransform:`none`,padding:0,margin:0,fontSize:`110% !important`,minWidth:`auto`,borderRadius:0,backgroundColor:e===`operators`?IU():FU(),"&:hover":{backgroundColor:e===`operators`?zU():RU()}})),QX=L(vz)(({category:e})=>({minWidth:`auto`,backgroundColor:e===`operators`?IU():FU(),"&:hover":{backgroundColor:e===`operators`?zU():RU()},borderRadius:0,"& .icon":{height:`30px`}})),$X=class extends N.Component{static propTypes={className:p.string,controlledKeypadMode:p.bool,baseSet:p.array,additionalKeys:p.array,layoutForKeyPad:p.object,onPress:p.func.isRequired,onFocus:p.func,noDecimal:p.bool,setKeypadInteraction:p.func,mode:p.oneOfType([p.string,p.number])};static defaultProps={baseSet:zJ,noDecimal:!1};constructor(e){super(e),this.keypadRef=N.createRef()}componentDidMount(){let e=this.keypadRef?.current,t=e?.closest(`.main-container`),n=e?.closest(`.pie-toolbar`);if(this.props.controlledKeypadMode&&t&&n){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),i=e.top+e.height-(r.top+r.height);if(i<0){let n=e.height+e.top-i;t&&(t.style.height=`${n}px`)}}e&&(e.addEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.addEventListener(`mousedown`,this.handleKeypadInteraction,!0))}componentWillUnmount(){let e=this.keypadRef?.current;if(this.props.controlledKeypadMode&&e){let t=e.closest(`.main-container`);t&&(t.style.height=`unset`)}e&&(e.removeEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.removeEventListener(`mousedown`,this.handleKeypadInteraction,!0))}handleKeypadInteraction=()=>{this.props.setKeypadInteraction&&this.props.setKeypadInteraction(!0)};buttonClick=e=>{KX(`[buttonClick]`,e);let{onPress:t}=this.props;t(e)};flowKeys=(e,t)=>y([...GX(e),...GX(t)]);keyIsNotAllowed=e=>{let{noDecimal:t}=this.props;return!!((e.write===`.`&&e.label===`.`||e.write===`,`&&e.label===`,`)&&t)};render(){let{className:e,baseSet:t,additionalKeys:n,layoutForKeyPad:r,onFocus:i,mode:a}=this.props,o=[`non-negative-integers`,`integers`,`decimals`,`fractions`,`item-authoring`,`language`].includes(a),s=o?this.flowKeys([],n||[]):this.flowKeys(t,n||[]),c=s.length%5?1:0,l={gridTemplateColumns:`repeat(${Math.floor(s.length/5)+c}, minmax(min-content, 150px))`,...JX(r)};return(0,F.jsx)(YX,{ref:this.keypadRef,className:[e,a].filter(Boolean).join(` `),style:l,onFocus:i,children:s.map((e,t)=>{let n=this.buttonClick.bind(this,e);if(!e)return(0,F.jsx)(`span`,{},`empty-${t}`);let r={onClick:n,disabled:this.keyIsNotAllowed(e),key:`${e.label||e.latex||e.command}-${t}`,...e.actions||{},...e.extraProps||{}};if(e.latex)return(0,F.jsx)(ZX,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:(0,F.jsx)(qX,{latex:e.latex})},r.key);if(e.label)return(0,F.jsx)(XX,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,isDelete:e.label===`⌫`,isComma:e.label===`,`,isDot:e.label===`.`,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:e.label},r.key);{let t=e.icon?e.icon:`div`;return(0,F.jsx)(QX,{tabIndex:`-1`,onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,size:`large`,...e.actions||{},...e.extraProps||{},children:(0,F.jsx)(t,{className:`icon`})},r.key)}})})}},eZ=e=>{if(e.command)return{value:e.command,type:`command`};if(e.write)return{value:e.write};if(e.keystroke)return{type:`cursor`,value:e.keystroke}},tZ=class extends N.Component{static propTypes={className:p.string,controlledKeypadMode:p.bool,mode:p.oneOfType([p.string,p.number]),layoutForKeyPad:p.object,onClick:p.func.isRequired,onFocus:p.func,noDecimal:p.bool,additionalKeys:p.array,setKeypadInteraction:p.func};static defaultProps={mode:`scientific`,noDecimal:!1,additionalKeys:[]};keypadPress=e=>{let{onClick:t}=this.props;t(eZ(e))};render(){let{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:i,additionalKeys:a,layoutForKeyPad:o,setKeypadInteraction:s}=this.props,c=TJ(a);return(0,F.jsx)($X,{className:i,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:o,additionalKeys:xK(CJ(e),c),onPress:this.keypadPress,mode:e,setKeypadInteraction:s})}},nZ=L(`span`)(()=>({display:`inline-flex`,border:`1px solid ${gU()}`,margin:`1px 5px`,cursor:`pointer`,alignItems:`center`,justifyContent:`center`,minWidth:`50px`,minHeight:`36px`,height:`fit-content`})),rZ=L(`div`)(()=>({background:dU(),color:UH(),display:`inline-flex`,borderRight:`2px solid ${gU()}`,boxSizing:`border-box`,overflow:`hidden`,fontSize:`12px`,minHeight:`36px`,height:`100%`,alignItems:`center`,fontFamily:`Symbola, Times New Roman, serif`,padding:`0 2px`})),iZ=L(`div`)(()=>({flex:8,color:`var(--pie-text, black)`,padding:`4px !important`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`var(--pie-background, rgba(255, 255, 255, 0))`,"& > .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-overarrow.mq-arrow-both":{marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`}})),aZ=e=>{let{node:t,options:n,selected:r}=e,{attrs:i}=t,{value:a,index:o}=i,s=`R ${parseInt(o)+1}`;return(0,F.jsx)(rS,{className:`math-templated`,"data-selected":r,style:{display:`inline-flex`,minHeight:`36px`,minWidth:`50px`,cursor:`pointer`},children:(0,F.jsxs)(nZ,{...i,children:[(0,F.jsx)(rZ,{children:s}),(0,F.jsx)(iZ,{children:(0,F.jsx)(zX,{latex:a})})]})})};aZ.propTypes={attributes:p.object,value:p.string,keyToDisplay:p.string};var oZ={},sZ=e=>String(e||``).replace(/-/g,`_`),cZ=e=>e&&e.attrs&&e.attrs.index!=null?String(e.attrs.index):null,lZ=(e,t)=>{let n=[];return e.descendants((e,r)=>{if(e.type&&e.type.name===t){let t=cZ(e);t!=null&&n.push({index:t,pos:r,node:e})}return!0}),n},uZ=(e,t)=>{let n=0;return e.descendants(e=>(e.type&&e.type.name===t&&(n+=1),!0)),n},dZ=({schema:e,typeName:t,index:n})=>{let r=e.nodes[t];return r?r.create({index:String(n),id:String(n),value:``}):null},fZ=(e,t)=>{let n=e.resolve(Math.min(t,e.content.size));return U.near(n,1)},pZ=sb.create({name:`responseArea`,addOptions(){return{maxResponseAreas:null,error:null,options:null,respAreaToolbar:null,onHandleAreaChange:null}},addProseMirrorPlugins(){if(!this.options.type)return[];let e=sZ(this.options.type);return[new uu({key:new pu(`response-area-watcher:${e}`),view:t=>(oZ[e]===void 0&&(oZ[e]=0,t.state.doc.descendants(t=>{if(t.type&&t.type.name===e){let n=cZ(t);if(n!=null){let t=parseInt(n,10);!Number.isNaN(t)&&t>oZ[e]&&(oZ[e]=t)}}return!0})),{update:(t,n)=>{let r=t.state;if(n.doc.eq(r.doc))return;let i=lZ(r.doc,e),a=lZ(n.doc,e);if(this.options.toolbar&&(this.options.toolbar.disabled=i.length>=this.options.maxResponseAreas),a.length>i.length){let e=new Set(i.map(e=>e.index)),t=a.filter(t=>!e.has(t.index));t.length&&typeof this.options.onHandleAreaChange==`function`&&this.options.onHandleAreaChange(t)}}})})]},addCommands(){return{insertResponseArea:e=>({tr:t,state:n,dispatch:r,commands:i})=>{let a=sZ(e);if(uZ(n.doc,a)>=this.options.maxResponseAreas)return!1;oZ[a]===void 0&&(oZ[a]=0);let o=oZ[a]+1;oZ[a]+=1;let s=dZ({schema:n.schema,typeName:a,index:o});if(!s)return!1;let{selection:c}=n,l=c.from,u=e=>{try{return t.insert(e,s),e}catch{return null}},d=u(l);if(d??=u(t.doc.content.size),d==null)return!1;if([`inline_dropdown`,`explicit_constructed_response`].includes(a))t.setSelection(W.create(t.doc,d));else{let e=d+s.nodeSize;t.setSelection(fZ(t.doc,e))}return r&&(i.focus(),r(t)),!0},refreshResponseArea:()=>({tr:e,state:t,commands:n,dispatch:r})=>{let{selection:i}=t,a=i.$from.nodeAfter,o=i.from;return e.setNodeMarkup(o,void 0,{...a?.attrs,updated:`${Date.now()}`}),e.setSelection(W.create(e.doc,o)),r&&(n.focus(),r(e)),!0}}}}),mZ=Lb.create({name:`explicit_constructed_response`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="explicit_constructed_response"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`explicit_constructed_response`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(jz,{...e,options:this.options}))}}),hZ=Lb.create({name:`math_templated`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="math_templated"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`math_templated`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(aZ,{...e,options:this.options}))}}),gZ=Lb.create({name:`drag_in_the_blank`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},id:{default:null},value:{default:``},inTable:{default:null},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="drag_in_the_blank"]`,getAttrs:e=>({index:e.dataset.index,id:e.dataset.id,value:e.dataset.value,inTable:e.dataset.inTable})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`drag_in_the_blank`,"data-index":e.index,"data-id":e.id,"data-value":e.value,"data-in-table":e.inTable}]},addNodeView(){return dS(e=>(0,F.jsx)(uK,{...e,options:this.options}))}}),_Z=Lb.create({name:`inline_dropdown`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="inline_dropdown"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`inline_dropdown`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(dK,{...e,options:this.options}))}}),vZ=Qr(`MuiDivider`,[`root`,`absolute`,`fullWidth`,`inset`,`middle`,`flexItem`,`light`,`vertical`,`withChildren`,`withChildrenVertical`,`textAlignRight`,`textAlignLeft`,`wrapper`,`wrapperVertical`]),yZ=Qr(`MuiListItemIcon`,[`root`,`alignItemsFlexStart`]),bZ=Qr(`MuiListItemText`,[`root`,`multiline`,`dense`,`inset`,`primary`,`secondary`]);function xZ(e){return Zr(`MuiMenuItem`,e)}var SZ=Qr(`MuiMenuItem`,[`root`,`focusVisible`,`dense`,`disabled`,`divider`,`gutters`,`selected`]);function CZ(e){return Zr(`MuiNativeSelect`,e)}var wZ=Qr(`MuiNativeSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]),TZ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return A({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${R(n)}`,a&&`iconOpen`,r&&`disabled`]},CZ,t)},EZ=L(`select`,{name:`MuiNativeSelect`})(({theme:e})=>({MozAppearance:`none`,WebkitAppearance:`none`,userSelect:`none`,borderRadius:0,cursor:`pointer`,"&:focus":{borderRadius:0},[`&.${wZ.disabled}`]:{cursor:`default`},"&[multiple]":{height:`auto`},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!==`filled`&&e.variant!==`outlined`,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:`filled`},style:{"&&&":{paddingRight:32}}},{props:{variant:`outlined`},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),DZ=L(EZ,{name:`MuiNativeSelect`,slot:`Select`,shouldForwardProp:Fo,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${wZ.multiple}`]:t.multiple}]}})({}),OZ=L(`svg`,{name:`MuiNativeSelect`})(({theme:e})=>({position:`absolute`,right:0,top:`calc(50% - .5em)`,pointerEvents:`none`,color:(e.vars||e).palette.action.active,[`&.${wZ.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:`rotate(180deg)`}},{props:{variant:`filled`},style:{right:7}},{props:{variant:`outlined`},style:{right:7}}]})),kZ=L(OZ,{name:`MuiNativeSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${R(n.variant)}`],n.open&&t.iconOpen]}})({}),AZ=N.forwardRef(function(e,t){let{className:n,disabled:r,error:i,IconComponent:a,inputRef:o,variant:s=`standard`,...c}=e,l={...e,disabled:r,variant:s,error:i},u=TZ(l);return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(DZ,{ownerState:l,className:k(u.select,n),disabled:r,ref:o||t,...c}),e.multiple?null:(0,F.jsx)(kZ,{as:a,ownerState:l,className:u.icon})]})});function jZ(e){return Zr(`MuiSelect`,e)}var MZ=Qr(`MuiSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`focused`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]);function NZ(e){return e?e.type===`mousedown`||e.type===`pointerdown`||e.type===`touchstart`?`pointer`:e.type===`keydown`||e.type===`click`&&e.detail===0?`keyboard`:null:null}function PZ(e){return e==null||typeof e==`string`&&!e.trim()}function FZ(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var IZ=N.createContext(null);function LZ(){return N.useContext(IZ)}var RZ=IZ.Provider,zZ,BZ=L(EZ,{name:`MuiSelect`,slot:`Select`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${MZ.select}`]:t.select},{[`&.${MZ.select}`]:t[n.variant]},{[`&.${MZ.error}`]:t.error},{[`&.${MZ.multiple}`]:t.multiple}]}})({[`&.${MZ.select}`]:{height:`auto`,minHeight:`1.4375em`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`}}),VZ=L(OZ,{name:`MuiSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${R(n.variant)}`],n.open&&t.iconOpen]}})({}),HZ=L(`input`,{shouldForwardProp:e=>Po(e)&&e!==`classes`,name:`MuiSelect`,slot:`NativeInput`})({bottom:0,left:0,position:`absolute`,opacity:0,pointerEvents:`none`,width:`100%`,boxSizing:`border-box`}),UZ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return A({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${R(n)}`,a&&`iconOpen`,r&&`disabled`],nativeInput:[`nativeInput`]},jZ,t)},WZ=N.forwardRef(function(e,t){let{"aria-describedby":n,"aria-label":r,autoFocus:i,autoWidth:a,children:o,className:s,defaultOpen:c,defaultValue:l,disabled:u,displayEmpty:d,error:f=!1,IconComponent:p,inputRef:m,labelId:h,MenuProps:g={},multiple:_,name:v,onBlur:y,onChange:b,onClose:x,onFocus:S,onKeyDown:C,onMouseDown:w,onOpen:T,open:E,readOnly:D,renderValue:O,required:A,SelectDisplayProps:M={},tabIndex:ee,type:te,value:ne,variant:re=`standard`,...ie}=e,[P,ae]=JL({controlled:ne,default:l,name:`Select`}),[oe,se]=JL({controlled:E,default:c,name:`Select`}),ce=N.useRef(null),le=N.useRef(null),[ue,de]=N.useState(null),{current:fe}=N.useRef(E!=null),[pe,me]=N.useState(),[he,ge]=N.useState(null),_e=QL(t,m),ve=N.useCallback(e=>{le.current=e,e&&de(e)},[]),ye=ue?.parentNode;N.useImperativeHandle(_e,()=>({focus:()=>{le.current.focus()},node:ce.current,value:P}),[P]);let be=ue!==null&&oe;N.useEffect(()=>{if(!be||!ye||a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{me(ye.clientWidth)});return e.observe(ye),()=>{e.disconnect()}},[be,ye,a]),N.useEffect(()=>{c&&oe&&ue&&!fe&&(me(a?null:ye.clientWidth),le.current.focus())},[ue,a]),N.useEffect(()=>{i&&le.current.focus()},[i]),N.useEffect(()=>{if(!h)return;let e=VL(le.current).getElementById(h);if(e){let t=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}},[h]);let xe=(e,t)=>{e?(ge(NZ(t)),T&&T(t)):(ge(null),x&&x(t)),fe||(me(a?null:ye.clientWidth),se(e))},Se=e=>{w?.(e),e.button===0&&(e.preventDefault(),le.current.focus(),xe(!0,e))},Ce=e=>{xe(!1,e)},we=N.Children.toArray(o),Te=e=>{let t=we.find(t=>t.props.value===e.target.value);t!==void 0&&(ae(t.props.value),b&&b(e,t))},Ee=e=>t=>{let n;if(t.currentTarget.hasAttribute(`tabindex`)){if(_){n=Array.isArray(P)?P.slice():[];let t=P.indexOf(e.props.value);t===-1?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),P!==n&&(ae(n),b)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:n,name:v}}),b(i,e)}_||xe(!1,t)}},De=e=>{D||([` `,`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),xe(!0,e)),C?.(e))},Oe=e=>{!be&&y&&(Object.defineProperty(e,"target",{writable:!0,value:{value:P,name:v}}),y(e))};delete ie[`aria-invalid`];let ke,Ae,je=[],Me=!1;(lG({value:P})||d)&&(O?ke=O(P):Me=!0);let Ne=we.map(e=>{if(!N.isValidElement(e))return null;let t;if(_){if(!Array.isArray(P))throw Error(j(2));t=P.some(t=>FZ(t,e.props.value)),t&&Me&&je.push(e.props.children)}else t=FZ(P,e.props.value),t&&Me&&(Ae=e.props.children);return N.cloneElement(e,{"aria-selected":t?`true`:`false`,onClick:Ee(e),onKeyUp:t=>{t.key===` `&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:`option`,selected:t,value:void 0,"data-value":e.props.value})});Me&&(ke=_?je.length===0?null:je.reduce((e,t,n)=>(e.push(t),n<je.length-1&&e.push(`, `),e),[]):Ae);let Pe=pe;!a&&fe&&ue&&(Pe=ye.clientWidth);let Fe;Fe=ee===void 0?u?null:0:ee;let Ie=M.id||(v?`mui-component-select-${v}`:void 0),Le={...e,variant:re,value:P,open:be,error:f},Re=UZ(Le),ze={...g.PaperProps,...typeof g.slotProps?.paper==`function`?g.slotProps.paper(Le):g.slotProps?.paper},Be={...g.MenuListProps,...typeof g.slotProps?.list==`function`?g.slotProps.list(Le):g.slotProps?.list},Ve=Ki();return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(BZ,{as:`div`,ref:ve,tabIndex:Fe,role:`combobox`,"aria-controls":be?Ve:void 0,"aria-disabled":u?`true`:void 0,"aria-expanded":be?`true`:`false`,"aria-haspopup":`listbox`,"aria-label":r,"aria-labelledby":[h,Ie].filter(Boolean).join(` `)||void 0,"aria-describedby":n,"aria-required":A?`true`:void 0,"aria-invalid":f?`true`:void 0,onKeyDown:De,onMouseDown:u||D?null:Se,onBlur:Oe,onFocus:S,...M,ownerState:Le,className:k(M.className,Re.select,s),id:Ie,children:PZ(ke)?zZ||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):ke}),(0,F.jsx)(HZ,{"aria-invalid":f,value:Array.isArray(P)?P.join(`,`):P,name:v,ref:ce,"aria-hidden":!0,onChange:Te,tabIndex:-1,disabled:u,className:Re.nativeInput,autoFocus:i,required:A,...ie,ownerState:Le}),(0,F.jsx)(VZ,{as:p,className:Re.icon,ownerState:Le}),(0,F.jsx)(RZ,{value:he,children:(0,F.jsx)(ZG,{id:`menu-${v||``}`,anchorEl:ye,open:be,onClose:Ce,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},...g,slotProps:{...g.slotProps,list:{"aria-labelledby":h,role:`listbox`,"aria-multiselectable":_?`true`:void 0,disableListWrap:!0,id:Ve,...Be},paper:{...ze,style:{minWidth:Pe,...ze==null?null:ze.style}}},children:Ne})})]})}),GZ=IL((0,F.jsx)(`path`,{d:`M7 10l5 5 5-5z`}),`ArrowDropDown`);function KZ(e){return parseInt(e,10)||0}var qZ={shadow:{visibility:`hidden`,position:`absolute`,overflow:`hidden`,height:0,top:0,left:0,transform:`translateZ(0)`}};function JZ(e){for(let t in e)return!1;return!0}function YZ(e){return JZ(e)||e.outerHeightStyle===0&&!e.overflowing}var XZ=N.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:a,value:o,...s}=e,{current:c}=N.useRef(o!=null),l=N.useRef(null),u=ZL(t,l),d=N.useRef(null),f=N.useRef(null),p=N.useCallback(()=>{let t=l.current,n=f.current;if(!t||!n)return;let a=HL(t).getComputedStyle(t);if(a.width===`0px`)return{outerHeightStyle:0,overflowing:!1};n.style.width=a.width,n.value=t.value||e.placeholder||`x`,n.value.slice(-1)===`
331
- `&&(n.value+=` `);let o=a.boxSizing,s=KZ(a.paddingBottom)+KZ(a.paddingTop),c=KZ(a.borderBottomWidth)+KZ(a.borderTopWidth),u=n.scrollHeight;n.value=`x`;let d=n.scrollHeight,p=u;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),p=Math.max(p,d),{outerHeightStyle:p+(o===`border-box`?s+c:0),overflowing:Math.abs(p-u)<=1}},[r,i,e.placeholder]),m=YL(()=>{let e=l.current,t=p();if(!e||!t||YZ(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=N.useCallback(()=>{let e=l.current,t=p();if(!e||!t||YZ(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?`hidden`:``},[p]),g=N.useRef(-1);return fi(()=>{let e=LL(h),t=l?.current;if(!t)return;let n=HL(t);n.addEventListener(`resize`,e);let r;return typeof ResizeObserver<`u`&&(r=new ResizeObserver(()=>{m()&&(r.unobserve(t),cancelAnimationFrame(g.current),h(),g.current=requestAnimationFrame(()=>{r.observe(t)}))}),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),n.removeEventListener(`resize`,e),r&&r.disconnect()}},[p,h,m]),fi(()=>{h()}),(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(`
332
- `),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,F.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...qZ.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function ZZ(e){return Zr(`MuiInputBase`,e)}var QZ=Qr(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputSizeSmall`,`inputMultiline`,`inputTypeSearch`,`inputAdornedStart`,`inputAdornedEnd`,`inputHiddenLabel`]),$Z,eQ=`mui-auto-fill`,tQ=`mui-auto-fill-cancel`,nQ=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size===`small`&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${R(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},rQ=(e,t)=>{let{ownerState:n}=e;return[t.input,n.size===`small`&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type===`search`&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},iQ=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:c,hiddenLabel:l,multiline:u,readOnly:d,size:f,startAdornment:p,type:m}=e;return A({root:[`root`,`color${R(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${R(f)}`,u&&`multiline`,p&&`adornedStart`,a&&`adornedEnd`,l&&`hiddenLabel`,d&&`readOnly`],input:[`input`,r&&`disabled`,m===`search`&&`inputTypeSearch`,u&&`inputMultiline`,f===`small`&&`inputSizeSmall`,l&&`inputHiddenLabel`,p&&`inputAdornedStart`,a&&`inputAdornedEnd`,d&&`readOnly`]},ZZ,t)},aQ=L(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:nQ})(Ro(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:`1.4375em`,boxSizing:`border-box`,position:`relative`,cursor:`text`,display:`inline-flex`,alignItems:`center`,[`&.${QZ.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:`default`},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:`4px 0 5px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:`100%`}}]}))),oQ=L(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:rQ})(Ro(({theme:e})=>{let t=e.palette.mode===`light`,n={color:`currentColor`,...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create(`opacity`,{duration:e.transitions.duration.shorter})},r={opacity:`0 !important`},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:`inherit`,letterSpacing:`inherit`,color:`currentColor`,padding:`4px 0 5px`,border:0,boxSizing:`content-box`,background:`none`,height:`1.4375em`,margin:0,WebkitTapHighlightColor:`transparent`,display:`block`,minWidth:0,width:`100%`,"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:`none`},"&::-webkit-search-decoration":{WebkitAppearance:`none`},[`label[data-shrink=false] + .${QZ.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${QZ.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:tQ,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:eQ}}},{props:{size:`small`},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:`auto`,resize:`none`,padding:0,paddingTop:0}},{props:{type:`search`},style:{MozAppearance:`textfield`}}]}})),sQ=Io({[`@keyframes ${eQ}`]:{from:{animationName:eQ}},[`@keyframes ${tQ}`]:{from:{animationName:tQ}}}),cQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiInputBase`}),{"aria-describedby":r,autoComplete:i,autoFocus:a,className:o,color:s,components:c={},componentsProps:l={},defaultValue:u,disabled:d,disableInjectingGlobalStyles:f,endAdornment:p,error:m,fullWidth:h=!1,id:g,inputComponent:_=`input`,inputProps:v={},inputRef:y,margin:b,maxRows:x,minRows:S,multiline:C=!1,name:w,onBlur:T,onChange:E,onClick:D,onFocus:O,onKeyDown:A,onKeyUp:M,placeholder:ee,readOnly:te,renderSuffix:ne,rows:re,size:ie,slotProps:P={},slots:ae={},startAdornment:oe,type:se=`text`,value:ce,...le}=n,ue=v.value==null?ce:v.value,{current:de}=N.useRef(ue!=null),fe=N.useRef(),pe=N.useCallback(e=>{},[]),me=QL(fe,y,v.ref,pe),[he,ge]=N.useState(!1),_e=ZW(),ve=YW({props:n,muiFormControl:_e,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});ve.focused=_e?_e.focused:he,N.useEffect(()=>{!_e&&d&&he&&(ge(!1),T&&T())},[_e,d,he,T]);let ye=_e&&_e.onFilled,be=_e&&_e.onEmpty,xe=N.useCallback(e=>{lG(e)?ye&&ye():be&&be()},[ye,be]);GL(()=>{de&&xe({value:ue})},[ue,xe,de]),GL(()=>{if(!a)return;let e=fe.current;if(!e)return;let t=VL(e),n=UV(t),r=n==null||n===t.body||n===t.documentElement;e===n?_e&&_e.onFocus?_e.onFocus():ge(!0):r&&e.focus()},[a]);let Se=e=>{O&&O(e),v.onFocus&&v.onFocus(e),_e&&_e.onFocus?_e.onFocus(e):ge(!0)},Ce=e=>{T&&T(e),v.onBlur&&v.onBlur(e),_e&&_e.onBlur?_e.onBlur(e):ge(!1)},we=(e,...t)=>{if(!de){let t=e.target||fe.current;if(t==null)throw Error(j(1));xe({value:t.value})}v.onChange&&v.onChange(e,...t),E&&E(e,...t)};N.useEffect(()=>{xe(fe.current)},[]);let Te=e=>{fe.current&&e.currentTarget===e.target&&fe.current.focus(),D&&D(e)},Ee=_,De=v;C&&Ee===`input`&&(De=re?{type:void 0,minRows:re,maxRows:re,...De}:{type:void 0,maxRows:x,minRows:S,...De},Ee=XZ);let Oe=e=>{xe(e.animationName===tQ?fe.current:{value:`x`})};N.useEffect(()=>{_e&&_e.setAdornedStart(!!oe)},[_e,oe]);let ke={...n,color:ve.color||`primary`,disabled:ve.disabled,endAdornment:p,error:ve.error,focused:ve.focused,formControl:_e,fullWidth:h,hiddenLabel:ve.hiddenLabel,multiline:C,size:ve.size,startAdornment:oe,type:se},Ae=iQ(ke),je=ae.root||c.Root||aQ,Me=P.root||l.root||{},Ne=ae.input||c.Input||oQ;return De={...De,...P.input??l.input},(0,F.jsxs)(N.Fragment,{children:[!f&&typeof sQ==`function`&&($Z||=(0,F.jsx)(sQ,{})),(0,F.jsxs)(je,{...Me,ref:t,onClick:Te,...le,...!bV(je)&&{ownerState:{...ke,...Me.ownerState}},className:k(Ae.root,Me.className,o,te&&`MuiInputBase-readOnly`),children:[oe,(0,F.jsx)(XW.Provider,{value:null,children:(0,F.jsx)(Ne,{"aria-invalid":ve.error,"aria-describedby":r,autoComplete:i,autoFocus:a,defaultValue:u,disabled:ve.disabled,id:g,onAnimationStart:Oe,name:w,placeholder:ee,readOnly:te,required:ve.required,rows:re,value:ue,onKeyDown:A,onKeyUp:M,type:se,...De,...!bV(Ne)&&{as:Ee,ownerState:{...ke,...De.ownerState}},ref:me,className:k(Ae.input,De.className,te&&`MuiInputBase-readOnly`),onBlur:Ce,onChange:we,onFocus:Se})}),p,ne?ne({...ve,startAdornment:oe}):null]})]})});function lQ(e){return Zr(`MuiInput`,e)}var uQ={...QZ,...Qr(`MuiInput`,[`root`,`underline`,`input`])},dQ=e=>{let{classes:t,disableUnderline:n}=e,r=A({root:[`root`,!n&&`underline`],input:[`input`]},lQ,t);return{...t,...r}},fQ=L(aQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...nQ(e,t),!n.disableUnderline&&t.underline]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`;return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:`relative`,variants:[{props:({ownerState:e})=>e.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${uQ.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${uQ.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${uQ.disabled}, .${uQ.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${uQ.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),pQ=L(oQ,{name:`MuiInput`,slot:`Input`,overridesResolver:rQ})({}),mQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:s=`input`,multiline:c=!1,slotProps:l,slots:u={},type:d=`text`,...f}=n,p=dQ(n),m={root:{ownerState:{disableUnderline:r}}},h=l??a?P(l??a,m):m;return(0,F.jsx)(cQ,{slots:{root:u.root??i.Root??fQ,input:u.input??i.Input??pQ},slotProps:h,fullWidth:o,inputComponent:s,multiline:c,ref:t,type:d,...f,classes:p})});mQ.muiName=`Input`;function hQ(e){return Zr(`MuiFilledInput`,e)}var gQ={...QZ,...Qr(`MuiFilledInput`,[`root`,`underline`,`input`,`adornedStart`,`adornedEnd`,`sizeSmall`,`multiline`,`hiddenLabel`])},_Q=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,c=A({root:[`root`,!n&&`underline`,r&&`adornedStart`,i&&`adornedEnd`,a===`small`&&`size${R(a)}`,o&&`hiddenLabel`,s&&`multiline`],input:[`input`]},hQ,t);return{...t,...c}},vQ=L(aQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiFilledInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...nQ(e,t),!n.disableUnderline&&t.underline]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`,n=t?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`,r=t?`rgba(0, 0, 0, 0.06)`:`rgba(255, 255, 255, 0.09)`,i=t?`rgba(0, 0, 0, 0.09)`:`rgba(255, 255, 255, 0.13)`,a=t?`rgba(0, 0, 0, 0.12)`:`rgba(255, 255, 255, 0.12)`;return{position:`relative`,backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${gQ.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${gQ.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${gQ.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${gQ.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${gQ.disabled}, .${gQ.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${gQ.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:`25px 12px 8px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}}]}})),yQ=L(oQ,{name:`MuiFilledInput`,slot:`Input`,overridesResolver:rQ})(Ro(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),bQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFilledInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:s,inputComponent:c=`input`,multiline:l=!1,slotProps:u,slots:d={},type:f=`text`,...p}=n,m={...n,disableUnderline:r,fullWidth:o,inputComponent:c,multiline:l,type:f},h=_Q(n),g={root:{ownerState:m},input:{ownerState:m}},_=u??a?P(g,u??a):g;return(0,F.jsx)(cQ,{slots:{root:d.root??i.Root??vQ,input:d.input??i.Input??yQ},slotProps:_,fullWidth:o,inputComponent:c,multiline:l,ref:t,type:f,...p,classes:h})});bQ.muiName=`Input`;var xQ,SQ=L(`fieldset`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})({textAlign:`left`,position:`absolute`,bottom:0,right:0,top:-5,left:0,margin:0,padding:`0 8px`,pointerEvents:`none`,borderRadius:`inherit`,borderStyle:`solid`,borderWidth:1,overflow:`hidden`,minWidth:`0%`}),CQ=L(`legend`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})(Ro(({theme:e})=>({float:`unset`,width:`auto`,overflow:`hidden`,variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:`11px`,transition:e.transitions.create(`width`,{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:`block`,padding:0,height:11,fontSize:`0.75em`,visibility:`hidden`,maxWidth:.01,transition:e.transitions.create(`max-width`,{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:`nowrap`,"& > span":{paddingLeft:5,paddingRight:5,display:`inline-block`,opacity:0,visibility:`visible`}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:`100%`,transition:e.transitions.create(`max-width`,{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function wQ(e){let{children:t,classes:n,className:r,label:i,notched:a,...o}=e,s=i!=null&&i!==``,c={...e,notched:a,withLabel:s};return(0,F.jsx)(SQ,{"aria-hidden":!0,className:r,ownerState:c,...o,children:(0,F.jsx)(CQ,{ownerState:c,children:s?(0,F.jsx)(`span`,{children:i}):xQ||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`})})})}function TQ(e){return Zr(`MuiOutlinedInput`,e)}var EQ={...QZ,...Qr(`MuiOutlinedInput`,[`root`,`notchedOutline`,`input`])},DQ=e=>{let{classes:t}=e,n=A({root:[`root`],notchedOutline:[`notchedOutline`],input:[`input`]},TQ,t);return{...t,...n}},OQ=L(aQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiOutlinedInput`,slot:`Root`,overridesResolver:nQ})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{position:`relative`,borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${EQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${EQ.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${EQ.focused} .${EQ.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{[`&.${EQ.focused} .${EQ.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${EQ.error} .${EQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${EQ.disabled} .${EQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:`16.5px 14px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{padding:`8.5px 14px`}}]}})),kQ=L(wQ,{name:`MuiOutlinedInput`,slot:`NotchedOutline`})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),AQ=L(oQ,{name:`MuiOutlinedInput`,slot:`Input`,overridesResolver:rQ})(Ro(({theme:e})=>({padding:`16.5px 14px`,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{padding:`8.5px 14px`}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),jQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiOutlinedInput`}),{components:r={},fullWidth:i=!1,inputComponent:a=`input`,label:o,multiline:s=!1,notched:c,slots:l={},slotProps:u={},type:d=`text`,...f}=n,p=DQ(n),m=ZW(),h=YW({props:n,muiFormControl:m,states:[`color`,`disabled`,`error`,`focused`,`hiddenLabel`,`size`,`required`]}),g={...n,color:h.color||`primary`,disabled:h.disabled,error:h.error,focused:h.focused,formControl:m,fullWidth:i,hiddenLabel:h.hiddenLabel,multiline:s,size:h.size,type:d},_=l.root??r.Root??OQ,v=l.input??r.Input??AQ,[y,b]=oH(`notchedOutline`,{elementType:kQ,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:g,externalForwardedProps:{slots:l,slotProps:u},additionalProps:{label:o!=null&&o!==``&&h.required?(0,F.jsxs)(N.Fragment,{children:[o,` `,`*`]}):o}});return(0,F.jsx)(cQ,{slots:{root:_,input:v},slotProps:u,renderSuffix:e=>(0,F.jsx)(y,{...b,notched:c===void 0?!!(e.startAdornment||e.filled||e.focused):c}),fullWidth:i,inputComponent:a,multiline:s,ref:t,type:d,...f,classes:{...p,notchedOutline:null}})});jQ.muiName=`Input`;var MQ=e=>{let{classes:t}=e,n=A({root:[`root`]},jZ,t);return{...t,...n}},NQ={name:`MuiSelect`,slot:`Root`,shouldForwardProp:e=>Fo(e)&&e!==`variant`},PQ=L(mQ,NQ)(``),FQ=L(jQ,NQ)(``),IQ=L(bQ,NQ)(``),LQ=N.forwardRef(function(e,t){let n=zo({name:`MuiSelect`,props:e}),{autoWidth:r=!1,children:i,classes:a={},className:o,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:l=GZ,id:u,input:d,inputProps:f,label:p,labelId:m,MenuProps:h,multiple:g=!1,native:_=!1,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:S,variant:C=`outlined`,...w}=n,T=_?AZ:WZ,E=YW({props:n,muiFormControl:ZW(),states:[`variant`,`error`]}),D=E.variant||C,O={...n,variant:D,classes:a},A=MQ(O),{root:j,...M}=A,ee=d||{standard:(0,F.jsx)(PQ,{ownerState:O}),outlined:(0,F.jsx)(FQ,{label:p,ownerState:O}),filled:(0,F.jsx)(IQ,{ownerState:O})}[D],te=QL(t,xV(ee));return(0,F.jsx)(N.Fragment,{children:N.cloneElement(ee,{inputComponent:T,inputProps:{children:i,error:E.error,IconComponent:l,variant:D,type:void 0,multiple:g,..._?{id:u}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:m,MenuProps:h,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:{id:u,...S}},...f,classes:f?P(M,f.classes):M,...d?d.props.inputProps:{}},...(g&&_||c)&&D===`outlined`?{notched:!0}:{},ref:te,className:k(ee.props.className,o,A.root),...!d&&{variant:D},...w})})});LQ.muiName=`Select`;function RQ(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t===`keyboard`})}catch{e.focus()}}var zQ=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},BQ=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:a,classes:o}=e,s=A({root:[`root`,n&&`dense`,t&&`disabled`,!i&&`gutters`,r&&`divider`,a&&`selected`]},xZ,o);return{...o,...s}},VQ=L($R,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenuItem`,slot:`Root`,overridesResolver:zQ})(Ro(({theme:e})=>({...e.typography.body1,display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:`border-box`,whiteSpace:`nowrap`,"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${SZ.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${SZ.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${SZ.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${SZ.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${SZ.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${vZ.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${vZ.inset}`]:{marginLeft:52},[`& .${bZ.root}`]:{marginTop:0,marginBottom:0},[`& .${bZ.inset}`]:{paddingLeft:36},[`& .${yZ.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up(`sm`)]:{minHeight:`auto`}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${yZ.root} svg`]:{fontSize:`1.25rem`}}}]}))),HQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiMenuItem`}),{autoFocus:r=!1,component:i=`li`,dense:a=!1,divider:o=!1,disableGutters:s=!1,focusVisibleClassName:c,role:l=`menuitem`,tabIndex:u,className:d,...f}=n,p=LZ(),m=N.useContext(NG),h=N.useMemo(()=>({dense:a||m.dense||!1,disableGutters:s}),[m.dense,a,s]),g=N.useRef(null);GL(()=>{r&&g.current&&RQ(g.current,p)},[r]);let _={...n,dense:h.dense,divider:o,disableGutters:s},v=BQ(n),y=QL(g,t),{root:b,...x}=v,S;return n.disabled||(S=u===void 0?-1:u),(0,F.jsx)(NG.Provider,{value:h,children:(0,F.jsx)(VQ,{ref:y,role:l,tabIndex:S,component:i,focusVisibleClassName:k(v.focusVisible,c),className:k(v.root,d),...f,ownerState:_,classes:x})})}),UQ=()=>{document.querySelectorAll(`.mq-supsub.mq-sup-only`).forEach(e=>{let t=e.previousElementSibling;t&&t.classList.contains(`mq-non-leaf`)&&t.querySelector(`.mq-fraction`)?e.classList.add(`mq-after-fraction-group`):e.classList.remove(`mq-after-fraction-group`)})},{commonMqFontStyles:WQ,commonMqKeyboardStyles:GQ,longdivStyles:KQ,supsubStyles:qQ}=WX,JQ=D(`@pie-lib:math-toolbar:editor-and-pad`),YQ=/\.|,/g,XQ=L(`div`)(({theme:e})=>({zIndex:9,position:`relative`,textAlign:`center`,width:`auto`,"& > .mq-math-mode":{border:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`dotted 1px ${e.palette.primary.main}`,borderRadius:`0px`},"& .mq-overarrow-inner":{border:`none !important`,paddingTop:`0 !important`},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.8px`,marginTop:`0px`,minWidth:`1.23em`},"& .mq-parallelogram":{lineHeight:.85}})),ZQ=L(`div`)(({theme:e,hide:t})=>({display:t?`none`:`flex`,alignItems:`center`,"& .mq-editable-field .mq-cursor":{top:`-4px`},"& .mq-math-mode .mq-selection, .mq-editable-field .mq-selection":{paddingTop:`18px`},"& .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& .mq-math-mode .mq-overline .mq-overline-inner":{paddingTop:`0.4em !important`},"& .mq-overarrow.mq-arrow-both":{minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.45em`,left:`-1px`},"&:after":{position:`absolute !important`,top:`0px !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& *":{...WQ,...qQ,...KQ,"& .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-root-block":{paddingTop:`10px`},"& .mq-scaled .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`4px !important`,paddingTop:`6px !important`,paddingLeft:`6px !important`},"& .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`}},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),QQ=L(mG)({flex:`initial`,width:`25%`,minWidth:`100px`,marginLeft:`15px`,marginTop:`5px`,marginBottom:`5px`,marginRight:`5px`,"& label":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& div":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}),$Q=L(sG)(()=>({backgroundColor:`transparent`})),e$=L(`div`)(({theme:e,error:t})=>({minWidth:`500px`,maxWidth:`900px`,minHeight:`30px`,width:`100%`,display:`flex`,marginTop:e.spacing(1),marginBottom:e.spacing(1),...t&&{border:`2px solid red`},"& .mq-sqrt-prefix .mq-scaled":{verticalAlign:`middle !important`}})),t$=L(NX)(({controlledKeypadMode:e})=>({maxWidth:e?`400px`:`500px`,color:UH(),backgroundColor:uU(),padding:`2px`})),n$=L(FW)({position:`absolute`,right:`12px`,border:`1px solid lightgrey`,color:UH()}),r$=L(`hr`)(({theme:e})=>({padding:0,margin:0,height:`1px`,border:`none`,borderBottom:`solid 1px ${e.palette.primary.main}`})),i$=L(tZ)(({mode:e})=>({...GQ,...e===`language`&&{"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),a$=e=>{if(!e)return;let{type:t,value:n}=e;return t===`command`||t===`cursor`?e:t===`answer`?{type:`answer`,...e}:n===`clear`?{type:`clear`}:{type:`write`,value:n}},o$=class extends N.Component{static propTypes={classNames:p.object,keypadMode:p.oneOfType([p.string,p.number]),autoFocus:p.bool,allowAnswerBlock:p.bool,showKeypad:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,error:p.string,noDecimal:p.bool,hideInput:p.bool,noLatexHandling:p.bool,layoutForKeyPad:p.object,maxResponseAreas:p.number,additionalKeys:p.array,latex:p.string.isRequired,onAnswerBlockAdd:p.func,onFocus:p.func,onBlur:p.func,onChange:p.func.isRequired,setKeypadInteraction:p.func};constructor(e){super(e),this.state={equationEditor:`item-authoring`,addDisabled:!1}}componentDidMount(){this.input&&this.props.autoFocus&&setTimeout(()=>this.input.focus(),0)}onClick=e=>{let{noDecimal:t,noLatexHandling:n,onChange:r}=this.props,i=a$(e);if(JQ(`mathChange: `,i),n){r(i.value);return}t&&(i.value===`.`||i.value===`,`)||i&&(i.type===`clear`?(JQ(`call clear...`),this.input.clear()):i.type===`command`?this.input.command(i.value):i.type===`cursor`?this.input.keystroke(i.value):i.type===`answer`?this.input.write(`%response%`):this.input.write(i.value))};updateDisable=e=>{let{maxResponseAreas:t}=this.props;if(t){let n=this.checkResponseAreasNumber(t,e);this.setState({addDisabled:n})}};onAnswerBlockClick=()=>{this.props.onAnswerBlockAdd(),this.onClick({type:`answer`}),this.updateDisable(!0)};onEditorChange=e=>{let{onChange:t,noDecimal:n}=this.props;if(EJ(),UQ(),this.updateDisable(!0),n&&(e.indexOf(`.`)!==-1||e.indexOf(`,`)!==-1)&&this.input){this.input.clear(),this.input.write(e.replace(YQ,``));return}let r=e.match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.input&&r&&r?.length){try{this.input.mathField.__controller.cursor.insLeftOf(this.input.mathField.__controller.cursor.parent[-1].parent),this.input.mathField.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}return}t(e)};shouldComponentUpdate(e,t){let n=this.input.mathField.latex()!==e.latex;return JQ(`[shouldComponentUpdate] `,`inputIsDifferent: `,n),!C(this.props.error,e.error)||!n&&this.props.keypadMode!==e.keypadMode||!n&&this.props.noDecimal!==e.noDecimal||!n&&this.state.equationEditor!==t.equationEditor?!0:!n&&this.props.controlledKeypad?this.props.showKeypad!==e.showKeypad:n}onEditorTypeChange=e=>{this.setState({equationEditor:e.target.value})};checkResponseAreasNumber=(e,t)=>{let{latex:n}=this.input&&this.input.props||{};if(n){let r=(n.match(/answerBlock/g)||[]).length;return t?r===e-1:r===e}return!1};render(){let{classNames:e,keypadMode:t,allowAnswerBlock:n,additionalKeys:r,controlledKeypad:i,controlledKeypadMode:a,showKeypad:o,setKeypadInteraction:s,noDecimal:c,hideInput:l,layoutForKeyPad:u,latex:d,onFocus:f,onBlur:p,error:m}=this.props,h=!i||i&&o,{addDisabled:g}=this.state;return JQ(`[render]`,d),(0,F.jsxs)(XQ,{className:e.mathToolbar,children:[(0,F.jsxs)(ZQ,{hide:l,children:[a&&(0,F.jsxs)(QQ,{variant:`standard`,children:[(0,F.jsx)($Q,{id:`equation-editor-label`,children:`Equation Editor`}),(0,F.jsxs)(LQ,{labelId:`equation-editor-label`,id:`equation-editor-select`,name:`equationEditor`,label:`Equation Editor`,onChange:this.onEditorTypeChange,value:this.state.equationEditor,MenuProps:{transitionDuration:{enter:225,exit:195}},children:[(0,F.jsx)(HQ,{value:`non-negative-integers`,children:`Numeric - Non-Negative Integers`}),(0,F.jsx)(HQ,{value:`integers`,children:`Numeric - Integers`}),(0,F.jsx)(HQ,{value:`decimals`,children:`Numeric - Decimals`}),(0,F.jsx)(HQ,{value:`fractions`,children:`Numeric - Fractions`}),(0,F.jsx)(HQ,{value:1,children:`Grade 1 - 2`}),(0,F.jsx)(HQ,{value:3,children:`Grade 3 - 5`}),(0,F.jsx)(HQ,{value:6,children:`Grade 6 - 7`}),(0,F.jsx)(HQ,{value:8,children:`Grade 8 - HS`}),(0,F.jsx)(HQ,{value:`geometry`,children:`Geometry`}),(0,F.jsx)(HQ,{value:`advanced-algebra`,children:`Advanced Algebra`}),(0,F.jsx)(HQ,{value:`statistics`,children:`Statistics`}),(0,F.jsx)(HQ,{value:`item-authoring`,children:`Item Authoring`})]})]}),(0,F.jsx)(e$,{error:m,children:(0,F.jsx)(t$,{onFocus:()=>{f&&f(),this.updateDisable(!1)},onBlur:e=>{this.updateDisable(!1),p&&p(e)},className:e&&e.editor||``,controlledKeypadMode:a,ref:e=>this.input=e,latex:d,onChange:this.onEditorChange})})]}),n&&(0,F.jsx)(n$,{type:`primary`,style:{bottom:h?`320px`:`20px`},onClick:this.onAnswerBlockClick,disabled:g,children:`+ Response Area`}),(0,F.jsx)(r$,{}),h&&(0,F.jsx)(i$,{mode:a?this.state.equationEditor:t,controlledKeypadMode:a,layoutForKeyPad:u,additionalKeys:r,onClick:this.onClick,noDecimal:c,setKeypadInteraction:s})]})}},s$=L(vz)(({hideBackground:e})=>({verticalAlign:`top`,width:`28px`,height:`28px`,color:`#00bb00`,...e&&{backgroundColor:wU(),"&:hover":{backgroundColor:dU()}},"& .MuiIconButton-label":{position:`absolute`,top:`2px`}})),c$=({onClick:e,hideBackground:t})=>(0,F.jsx)(s$,{"aria-label":`Done`,onClick:e,hideBackground:t,size:`large`,children:(0,F.jsx)(xz,{})});c$.propTypes={onClick:p.func,hideBackground:p.bool};var l$=c$,{commonMqFontStyles:u$,longdivStyles:d$,supsubStyles:f$}=WX,p$=D(`@pie-lib:math-toolbar:math-preview`),m$=L(`div`)(({theme:e,isSelected:t})=>({display:`inline-flex`,alignItems:`center`,position:`relative`,"& *":u$,...f$,...d$,"& > .mq-math-mode":{border:t?`solid 0px lightgrey`:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`solid 1px black`,borderRadius:`0px`},"& > .mq-math-mode .mq-root-block":{paddingTop:`7px !important`},"& > .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& > .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& > .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty":{paddingTop:`6px !important`,paddingLeft:`4px !important`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`0 !important`},"& > .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& > .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-editable-field .mq-cursor":{marginTop:`-15px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.5px`,marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},...t&&{border:`solid 1px ${e.palette.primary.main}`}})),h$=L(`span`)({position:`absolute`,bottom:0,left:0,right:0,top:0}),g$=class extends N.Component{static propTypes={latex:p.string,isSelected:p.bool,onFocus:p.func,onBlur:p.func};componentDidMount(){UQ()}componentDidUpdate(e){this.props.latex!==e.latex&&UQ()}render(){let{isSelected:e,onFocus:t,onBlur:n,latex:r}=this.props;return p$(`[render] latex: `,r),(0,F.jsxs)(m$,{isSelected:e,children:[` `,(0,F.jsx)(h$,{}),(0,F.jsx)(zX,{latex:r,onFocus:t,onBlur:n})]})}},_$=L(`div`)({display:`flex`,width:`100%`,zIndex:8,alignItems:`center`}),v$=class extends N.Component{static propTypes={autoFocus:p.bool,allowAnswerBlock:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,keypadMode:p.oneOfType([p.string,p.number]),classNames:p.object,error:p.string,maxResponseAreas:p.number,showKeypad:p.bool,noDecimal:p.bool,additionalKeys:p.array,latex:p.string.isRequired,onAnswerBlockAdd:p.func,onChange:p.func,onDone:p.func.isRequired,onFocus:p.func,onBlur:p.func,hideDoneButton:p.bool,keyPadCharacterRef:p.func,setKeypadInteraction:p.func};static defaultProps={classNames:{},keypadMode:`item-authoring`,autoFocus:!1,allowAnswerBlock:!1,controlledKeypad:!1,controlledKeypadMode:!1,noDecimal:!1,showKeypad:!0,additionalKeys:[],onChange:()=>{},onAnswerBlockAdd:()=>{},onFocus:()=>{},hideDoneButton:!1};constructor(e){super(e),this.state={latex:e.latex}}done=()=>{this.props.onDone(this.state.latex)};UNSAFE_componentWillReceiveProps(e){this.setState({latex:e.latex})}onChange=e=>{this.setState({latex:e}),this.props.onChange(e)};render(){let{latex:e}=this.state,{classNames:t,autoFocus:n,allowAnswerBlock:r,onAnswerBlockAdd:i,controlledKeypad:a,controlledKeypadMode:o,keypadMode:s,noDecimal:c,additionalKeys:l,showKeypad:u,onFocus:d,onBlur:f,hideDoneButton:p,error:m,keyPadCharacterRef:h,setKeypadInteraction:g,maxResponseAreas:_}=this.props;return(0,F.jsx)(y$,{autoFocus:n,classNames:t,onAnswerBlockAdd:i,allowAnswerBlock:r,latex:e,additionalKeys:l,noDecimal:c,keypadMode:s,keyPadCharacterRef:h,setKeypadInteraction:g,onChange:this.onChange,onDone:this.done,onFocus:d,onBlur:f,showKeypad:u,controlledKeypad:a,controlledKeypadMode:o,hideDoneButton:p,error:m,maxResponseAreas:_})}},y$=class extends N.Component{static propTypes={classNames:p.object,latex:p.string.isRequired,keypadMode:p.oneOfType([p.string,p.number]),hideInput:p.bool,noLatexHandling:p.bool,layoutForKeyPad:p.object,onChange:p.func.isRequired,onDone:p.func.isRequired,onBlur:p.func,onAnswerBlockAdd:p.func,additionalKeys:p.array,onFocus:p.func,autoFocus:p.bool,noDecimal:p.bool,allowAnswerBlock:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,showKeypad:p.bool,hideDoneButton:p.bool,hideDoneButtonBackground:p.bool,error:p.any,maxResponseAreas:p.number,keyPadCharacterRef:p.object,setKeypadInteraction:p.func};static defaultProps={classNames:{},hideDoneButtonBackground:!1};render(){let{classNames:e,autoFocus:t,allowAnswerBlock:n,onAnswerBlockAdd:r,controlledKeypad:i,controlledKeypadMode:a,additionalKeys:o,showKeypad:s,keypadMode:c,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,keyPadCharacterRef:p,setKeypadInteraction:m,latex:h,onChange:g,onDone:_,onFocus:v,onBlur:y,hideDoneButton:b,hideDoneButtonBackground:x,error:S,maxResponseAreas:C}=this.props;return(0,F.jsxs)(_$,{className:e&&e.toolbar||``,ref:p,children:[(0,F.jsx)(`div`,{}),(0,F.jsx)(o$,{autoFocus:t,keypadMode:c,classNames:e||{},controlledKeypad:i,controlledKeypadMode:a,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,showKeypad:s,additionalKeys:o,allowAnswerBlock:n,onAnswerBlockAdd:r,latex:h,onChange:g,onFocus:v,onBlur:y,error:S,maxResponseAreas:C,setKeypadInteraction:m}),(!i||i&&s)&&!b&&(0,F.jsx)(l$,{hideBackground:x,onClick:_})]})}},b$=new pu(`ensureTextAfterMath`),x$=(e=[])=>e.map(e=>({name:e,latex:e,write:e,label:e})),S$=e=>new uu({key:b$,appendTransaction:(t,n,r)=>{if(!t.some(e=>e.docChanged))return null;let i=r.tr,a=!1;return r.doc.descendants((t,n)=>{if(t.type.name===e){let e=n+t.nodeSize,o=r.doc.nodeAt(e);(!o||o.type.name!==`text`)&&(i.insert(e,r.schema.text(`​`)),a=!0)}}),a?i:null}}),C$=(e,t)=>{let n;for(n=t;n>0;n--){let t=e.nodeAt(n);if(t?.type?.name===`text`&&t.textContent!==`​`)return-1;if(t&&t?.type?.name!==`text`)break}return n},w$=new uu({key:new pu(`zeroWidthSpaceHandling`),props:{handleKeyDown(e,t){let{state:n,dispatch:r}=e,{selection:i,doc:a}=n,{from:o,empty:s}=i;if(s&&t.key===`Backspace`&&o>0){let e=C$(a,o);return e===-1?!1:(r(n.tr.delete(e,o)),!0)}if(s&&t.key===`ArrowLeft`&&o>0){let e=C$(a,o);if(e===-1)return!1;let t=n.doc.resolve(e);if(t.nodeAfter||t.nodeBefore){let t=n.doc.resolve(e);return r(n.tr.setSelection(W.create(n.doc,t.pos))),!0}else return r(n.tr.setSelection(U.create(n.doc,o-2))),!0}return!1}}}),T$=Lb.create({name:`math`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``},wrapper:{default:null},html:{default:null}}},addProseMirrorPlugins(){return[S$(this.name),w$]},parseHTML(){return[{tag:`span[data-latex]`,getAttrs:e=>({latex:e.getAttribute(`data-raw`)||e.textContent})},{tag:`span[data-type="mathml"]`,getAttrs:e=>({html:e.innerHTML})}]},addCommands(){return{insertMath:(e=``)=>({tr:t,editor:n,dispatch:r})=>{let{state:i}=n.view,a=i.schema.nodes.math.create({latex:e}),{selection:o}=i,s=o.$from.pos;if(t.insert(s,a),a?.type?.name===this.name){let e=W.create(t.doc,o.$from.pos);t.setSelection(e)}return r(t),Az(n,!0),!0}}},renderHTML({HTMLAttributes:e}){return e.html?[`span`,{"data-type":`mathml`,dangerouslySetInnerHTML:{__html:e.html}}]:[`span`,{"data-latex":``,"data-raw":e.latex},bW(e.latex,e.wrapper)]},addNodeView(){return dS(e=>(0,F.jsx)(E$,{...e,options:this.options}))}}),E$=e=>{let{node:t,updateAttributes:n,editor:r,selected:i,options:a,getPos:o}=e,[s,c]=(0,N.useState)(i),l=(0,N.useRef)(null),u=(0,N.useRef)(null),d=(0,N.useRef)(Date.now()),[f,p]=(0,N.useState)({top:0,left:0}),{math:m={}}=a||{},{keypadMode:h,controlledKeypadMode:g=!0,customKeys:_=[],keyPadCharacterRef:v,setKeypadInteraction:y}=m,b=t.attrs.latex||``,x=e=>{n({latex:e})},S=(e,{moveCursorAfterNode:i=!0}={})=>{if(n({latex:e}),c(!1),i&&typeof o==`function`){let e=o(),{doc:n}=r.state,i=U.create(n,e+t.nodeSize),a=r.state.tr.setSelection(i);r.view.dispatch(a)}r.commands.focus()};return(0,N.useEffect)(()=>{if(!i)return;let{selection:e}=r.state;e.node?.type?.name===`math`&&c(!0)},[i,r]),(0,N.useEffect)(()=>{Az(r,i||s)},[r,s,i]),(0,N.useEffect)(()=>{if(!r||!s){p({top:0,left:0});return}let e=()=>{if(!l.current)return;let{from:e}=r.state.selection,t=r.view.coordsAtPos(e),n=u.current?.getBoundingClientRect?.(),i=n?.height?n.top:t.top,a=n?.width?n.left:t.left,o=n?.height?n.bottom:t.bottom??t.top,s=l.current.offsetHeight,c=l.current.offsetWidth,d=window.innerHeight-(o+0)>=s?o+0:i-s-0,f=a;d=Math.max(8,Math.min(d,window.innerHeight-s-8)),f=Math.max(8,Math.min(f,window.innerWidth-c-8));let m=(r._tiptapContainerEl||document.body).getBoundingClientRect();p({top:d-m.top,left:f-m.left})};e();let t=null,n=()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))};return t=requestAnimationFrame(()=>{t=null,e()}),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{t!==null&&cancelAnimationFrame(t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[r,s]),(0,N.useEffect)(()=>{let e=e=>{let n=e?.target,i=(document.querySelectorAll?.(`[id^="equation-editor-select"][id*="listbox"], [aria-labelledby="equation-editor-label"][role="listbox"]`)||[]).length>0,a=!!(n?.id&&n.id.includes(`equation-editor-select`))||!!n?.closest?.(`[id*="equation-editor-select"]`),o=!!n?.closest?.(`.math-node-${d.current}`);if(l.current&&!l.current.contains(n)&&!n?.closest?.(`[data-inline-node]`)&&!i&&!a&&!o){c(!1);let e=!!r?.view?.dom?.contains(n);S(t.attrs.latex,{moveCursorAfterNode:!e})}};return s?document.addEventListener(`click`,e):document.removeEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,s,t]),(0,F.jsxs)(rS,{className:`math-node-${d.current}`,style:{display:`inline-flex`,cursor:`pointer`,margin:`0 4px`},"data-selected":i,children:[(0,F.jsx)(`div`,{ref:u,onClick:()=>c(!0),contentEditable:!1,children:(0,F.jsx)(g$,{latex:b})}),s&&Rx.createPortal((0,F.jsx)(`div`,{ref:l,"data-toolbar-for":r.instanceId,style:{position:`absolute`,top:`${f.top}px`,left:`${f.left}px`,zIndex:1e3,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`},children:(0,F.jsx)(v$,{latex:b,autoFocus:!0,onChange:x,onDone:S,keypadMode:h,controlledKeypadMode:g,additionalKeys:x$(_),keyPadCharacterRef:v,setKeypadInteraction:y})}),r?._tiptapContainerEl||document.body)]})};function D$(e){return Zr(`MuiLinearProgress`,e)}Qr(`MuiLinearProgress`,[`root`,`colorPrimary`,`colorSecondary`,`determinate`,`indeterminate`,`buffer`,`query`,`dashed`,`dashedColorPrimary`,`dashedColorSecondary`,`bar`,`bar1`,`bar2`,`barColorPrimary`,`barColorSecondary`,`bar1Indeterminate`,`bar1Determinate`,`bar1Buffer`,`bar2Indeterminate`,`bar2Buffer`]);var O$=4,k$=pr`
328
+ https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)},wY(),TY},TY.getInterface=OY;var EY=OY.MIN=1,DY=OY.MAX=3;function OY(e){if(!(EY<=e&&e<=DY))throw`Only interface versions between `+EY+` and `+DY+` supported. You specified: `+e;if(e<3&&typeof window<`u`&&!window.jQuery)throw`MathQuill interface version `+e+` requires jQuery 1.5.2+ to be loaded first`;function t(e){if(!e||!e.nodeType)return null;var t=XJ(e).children(`.mq-root-block`).attr(eY),r=t&&dY.byId[t].controller;return r?n[r.KIND_OF_MQ](r):null}var n={};t.L=Y,t.R=X,t.saneKeyboardEvents=MY;function r(e,t){for(var r in t&&t.handlers&&(t.handlers={fns:t.handlers,APIClasses:n}),t)if(t.hasOwnProperty(r)){var i=t[r],a=xY[r];e[r]=a?a(i):i}}t.config=function(e){return r(bY.p,e),this},t.registerEmbed=function(e,t){if(!/^[a-z][a-z0-9]*$/i.test(e))throw`Embed name must start with letter and be only letters and digits`;CY[e]=t};var i=n.AbstractMathQuill=J(SY,function(t){t.init=function(e){this.__controller=e,this.__options=e.options,this.id=e.id,this.data=e.data},t.parseLatex=function(e){return this.__controller.parseLatex(e)},t.__mathquillify=function(t){var n=this.__controller,r=n.root,i=n.container;n.createTextarea();var a=i.addClass(t).contents().detach();r.jQ=XJ(`<span class="mq-root-block"/>`).attr(eY,r.id).appendTo(i),this.latex(a.text()),this.revert=function(){var t=i.empty().unbind(`.mathquill`).removeClass(`mq-editable-field mq-math-mode mq-text-mode`).append(a);return e>=3?t[0]:t}},t.config=function(e){return r(this.__options,e),this},t.el=function(){return this.__controller.container[0]},t.text=function(){return this.__controller.exportText()},t.latex=function(e){return arguments.length>0?(this.__controller.renderLatexMath(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},t.html=function(){return this.__controller.root.jQ.html().replace(/ mathquill-(?:command|block)-id="?\d+"?/g,``).replace(/<span class="?mq-cursor( mq-blink)?"?>.?<\/span>/i,``).replace(/ mq-hasCursor|mq-hasCursor ?/,``).replace(/ class=(""|(?= |>))/g,``)},t.reflow=function(){return this.__controller.root.postOrder(`reflow`),this}});for(var a in t.prototype=i.prototype,n.EditableField=J(i,function(e,t){e.__mathquillify=function(){return t.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},e.focus=function(){return this.__controller.textarea.focus(),this},e.blur=function(){return this.__controller.textarea.blur(),this},e.write=function(e){return this.__controller.writeLatex(e),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},e.empty=function(){var e=this.__controller.root,t=this.__controller.cursor;return e.eachChild(`postOrder`,`dispose`),e.ends[Y]=e.ends[X]=0,e.jQ.empty(),delete t.selection,t.insAtRightEnd(e),this},e.cmd=function(e){var t=this.__controller.notify(),n=t.cursor;if(/^\\[a-z]+$/i.test(e)&&!n.isTooDeep()){e=e.slice(1);var r=Z[e];r&&(e=r(e),n.selection&&e.replaces(n.replaceSelection()),e.createLeftOf(n.show()),this.__controller.scrollHoriz())}else n.parent.write(n,e);return t.blurred&&n.hide().parent.blur(),this},e.select=function(){var e=this.__controller;for(e.notify(`move`).cursor.insAtRightEnd(e.root);e.cursor[Y];)e.selectLeft();return this},e.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},e.moveToDirEnd=function(e){return this.__controller.notify(`move`).cursor.insAtDirEnd(e,this.__controller.root),this},e.moveToLeftEnd=function(){return this.moveToDirEnd(Y)},e.moveToRightEnd=function(){return this.moveToDirEnd(X)},e.keystroke=function(e){for(var e=e.replace(/^\s+|\s+$/g,``).split(/\s+/),t=0;t<e.length;t+=1)this.__controller.keystroke(e[t],{preventDefault:rY});return this},e.typedText=function(e){for(var t=0;t<e.length;t+=1)this.__controller.typedText(e.charAt(t));return this},e.dropEmbedded=function(e,t,n){var r=e-XJ(window).scrollLeft(),i=t-XJ(window).scrollTop(),a=document.elementFromPoint(r,i);this.__controller.seek(XJ(a),e,t),NX().setOptions(n).createLeftOf(this.__controller.cursor)},e.clickAt=function(e,t,n){n||=document.elementFromPoint(e,t);var r=this.__controller,i=r.root;return ZJ.contains(i.jQ[0],n)||(n=i.jQ[0]),r.seek(XJ(n),e+pageXOffset,t+pageYOffset),r.blurred&&this.focus(),this},e.ignoreNextMousedown=function(e){return this.__controller.cursor.options.ignoreNextMousedown=e,this}}),t.EditableField=function(){throw`wtf don't call me, I'm 'abstract'`},t.EditableField.prototype=n.EditableField.prototype,yY)(function(r,i){var a=n[r]=i(n);t[r]=function(n,i){var o=t(n);if(o instanceof a||!n||!n.nodeType)return o;var s=vY(a.RootBlock(),XJ(n),bY());return s.KIND_OF_MQ=r,a(s).__mathquillify(i,e)},t[r].prototype=a.prototype})(a,yY[a]);return t}TY.noConflict=function(){return window.MathQuill=kY,TY};var kY=window.MathQuill;window.MathQuill=TY;function AY(e){for(var t=`moveOutOf deleteOutOf selectOutOf upOutOf downOutOf`.split(` `),n=0;n<t.length;n+=1)(function(t){e[t]=function(e){this.controller.handle(t,e)}})(t[n]);e.reflow=function(){this.controller.handle(`reflow`),this.controller.handle(`edited`),this.controller.handle(`edit`)}}var jY=J(function(e,t,n){function r(e,t){throw e=e?`'`+e+`'`:`EOF`,`Parse Error: `+t+` at `+e}e.init=function(e){this._=e},e.parse=function(e){return this.skip(o)._(``+e,t,r);function t(e,t){return t}},e.or=function(e){cY(`or is passed a parser`,e instanceof n);var t=this;return n(function(n,r,i){return t._(n,r,a);function a(t){return e._(n,r,i)}})},e.then=function(e){var t=this;return n(function(r,i,a){return t._(r,o,a);function o(t,r){var o=e instanceof n?e:e(r);return cY(`a parser is returned`,o instanceof n),o._(t,i,a)}})},e.many=function(){var e=this;return n(function(t,n,r){for(var i=[];e._(t,a,o););return n(t,i);function a(e,n){return t=e,i.push(n),!0}function o(){return!1}})},e.times=function(e,t){arguments.length<2&&(t=e);var r=this;return n(function(n,i,a){for(var o=[],s=!0,c,l=0;l<e;l+=1)if(s=r._(n,u,d),!s)return a(n,c);for(;l<t&&s;l+=1)s=r._(n,u,f);return i(n,o);function u(e,t){return o.push(t),n=e,!0}function d(e,t){return c=t,n=e,!1}function f(e,t){return!1}})},e.result=function(e){return this.then(a(e))},e.atMost=function(e){return this.times(0,e)},e.atLeast=function(e){var t=this;return t.times(e).then(function(e){return t.many().map(function(t){return e.concat(t)})})},e.map=function(e){return this.then(function(t){return a(e(t))})},e.skip=function(e){return this.then(function(t){return e.result(t)})},this.string=function(e){var t=e.length,r=`expected '`+e+`'`;return n(function(n,i,a){var o=n.slice(0,t);return o===e?i(n.slice(t),o):a(n,r)})};var i=this.regex=function(e){cY(`regexp parser is anchored`,e.toString().charAt(1)===`^`);var t=`expected `+e;return n(function(n,r,i){var a=e.exec(n);if(a){var o=a[0];return r(n.slice(o.length),o)}else return i(n,t)})},a=n.succeed=function(e){return n(function(t,n){return n(t,e)})};n.fail=function(e){return n(function(t,n,r){return r(t,e)})},n.letter=i(/^[a-z]/i),n.letters=i(/^[a-z]*/i),n.digit=i(/^[0-9]/),n.digits=i(/^[0-9]*/),n.whitespace=i(/^\s+/),n.optWhitespace=i(/^\s*/),n.any=n(function(e,t,n){return e?t(e.slice(1),e.charAt(0)):n(e,`expected any character`)}),n.all=n(function(e,t,n){return t(``,e)});var o=n.eof=n(function(e,t,n){return e?n(e,`expected EOF`):t(e,e)})}),MY=function(){var e={8:`Backspace`,9:`Tab`,10:`Enter`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Esc`,32:`Spacebar`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,45:`Insert`,46:`Del`,144:`NumLock`};function t(t){var n=t.which||t.keyCode,r=e[n],i,a=[];return t.ctrlKey&&a.push(`Ctrl`),t.originalEvent&&t.originalEvent.metaKey&&a.push(`Meta`),t.altKey&&a.push(`Alt`),t.shiftKey&&a.push(`Shift`),i=r||String.fromCharCode(n),!a.length&&!r?i:(a.push(i),a.join(`-`))}return function(e,n){var r=null,i=null,a=ZJ(e),o=ZJ(n.container||a),s=rY,c;function l(e){s=e,clearTimeout(c),c=setTimeout(e)}function u(e){l(function(t){s=rY,clearTimeout(c),e(t)})}o.bind(`keydown keypress input keyup focusout paste`,function(e){s(e)});function d(e){s(),s=rY,clearTimeout(c),a.val(e),e&&a[0]&&a[0].select&&a[0].select(),f=!!e}var f=!1;function p(){var e=a[0];return`selectionStart`in e&&e.selectionStart!==e.selectionEnd}function m(){n.keystroke(t(r),r)}function h(e){r=e,i=null,f&&u(function(e){!(e&&e.type===`focusout`)&&a[0]&&a[0].select&&a[0].select()}),m()}function g(e){r&&i&&m(),i=e,l(v)}function _(e){r&&!i&&l(v)}function v(){if(!p()){var e=a.val();e.length===1?(a.val(``),n.typedText(e)):e&&a[0]&&a[0].select&&a[0].select()}}function y(){r=i=null}function b(e){a.focus(),l(x)}function x(){var e=a.val();a.val(``),e&&n.paste(e)}return o.bind({keydown:h,keypress:g,keyup:_,focusout:y,cut:function(){u(function(){n.cut()})},copy:function(){u(function(){n.copy()})},paste:b}),{select:d}}}();vY.open(function(e,t){e.exportText=function(){return this.root.foldChildren(``,function(e,t){return e+t.text()})}}),vY.open(function(e){e.focusBlurEvents=function(){var e=this,t=e.root,n=e.cursor,r;e.textarea.focus(function(){e.blurred=!1,clearTimeout(r),e.container.addClass(`mq-focused`),n.parent||n.insAtRightEnd(t),n.selection?(n.selection.jQ.removeClass(`mq-blur`),e.selectionChanged()):n.show()}).blur(function(){e.blurred=!0,r=setTimeout(function(){t.postOrder(`intentionalBlur`),n.clearSelection().endSelection(),a()}),XJ(window).bind(`blur`,i)});function i(){clearTimeout(r),n.selection&&n.selection.jQ.addClass(`mq-blur`),a()}function a(){n.hide().parent.blur(),e.container.removeClass(`mq-focused`),XJ(window).unbind(`blur`,i)}e.blurred=!0,n.hide().parent.blur()}}),vY.open(function(e){e.keystroke=function(e,t){this.cursor.parent.keystroke(e,t,this)}}),dY.open(function(e){e.keystroke=function(e,t,n){var r=n.cursor;switch(e){case`Ctrl-Shift-Backspace`:case`Ctrl-Backspace`:n.ctrlDeleteDir(Y);break;case`Shift-Backspace`:case`Backspace`:n.backspace();break;case`Esc`:case`Tab`:n.escapeDir(X,e,t);return;case`Shift-Tab`:case`Shift-Esc`:n.escapeDir(Y,e,t);return;case`End`:n.notify(`move`).cursor.insAtRightEnd(r.parent);break;case`Ctrl-End`:n.notify(`move`).cursor.insAtRightEnd(n.root);break;case`Shift-End`:for(;r[X];)n.selectRight();break;case`Ctrl-Shift-End`:for(;r[X]||r.parent!==n.root;)n.selectRight();break;case`Home`:n.notify(`move`).cursor.insAtLeftEnd(r.parent);break;case`Ctrl-Home`:n.notify(`move`).cursor.insAtLeftEnd(n.root);break;case`Shift-Home`:for(;r[Y];)n.selectLeft();break;case`Ctrl-Shift-Home`:for(;r[Y]||r.parent!==n.root;)n.selectLeft();break;case`Left`:n.moveLeft();break;case`Shift-Left`:n.selectLeft();break;case`Ctrl-Left`:break;case`Right`:n.moveRight();break;case`Shift-Right`:n.selectRight();break;case`Ctrl-Right`:break;case`Up`:n.moveUp();break;case`Down`:n.moveDown();break;case`Shift-Up`:if(r[Y])for(;r[Y];)n.selectLeft();else n.selectLeft();case`Shift-Down`:if(r[X])for(;r[X];)n.selectRight();else n.selectRight();case`Ctrl-Up`:break;case`Ctrl-Down`:break;case`Ctrl-Shift-Del`:case`Ctrl-Del`:n.ctrlDeleteDir(X);break;case`Shift-Del`:case`Del`:n.deleteForward();break;case`Meta-A`:case`Ctrl-A`:for(n.notify(`move`).cursor.insAtRightEnd(n.root);r[Y];)n.selectLeft();break;default:return}t.preventDefault(),n.scrollHoriz()},e.moveOutOf=e.moveTowards=e.deleteOutOf=e.deleteTowards=e.unselectInto=e.selectOutOf=e.selectTowards=function(){cY(`overridden or never called on this node`)}}),vY.open(function(e){this.onNotify(function(e){(e===`move`||e===`upDown`)&&this.show().clearSelection()}),e.escapeDir=function(e,t,n){lY(e);var r=this.cursor;if(r.parent!==this.root&&n.preventDefault(),r.parent!==this.root)return r.parent.moveOutOf(e,r),this.notify(`move`)},xY.leftRightIntoCmdGoes=function(e){if(e&&e!==`up`&&e!==`down`)throw`"up" or "down" required for leftRightIntoCmdGoes option, got "`+e+`"`;return e},e.moveDir=function(e){lY(e);var t=this.cursor,n=t.options.leftRightIntoCmdGoes;return t.selection?t.insDirOf(e,t.selection.ends[e]):t[e]?t[e].moveTowards(e,t,n):t.parent.moveOutOf(e,t,n),this.notify(`move`)},e.moveLeft=function(){return this.moveDir(Y)},e.moveRight=function(){return this.moveDir(X)},e.moveUp=function(){return t(this,`up`)},e.moveDown=function(){return t(this,`down`)};function t(e,t){var n=e.notify(`upDown`).cursor,r=t+`Into`,i=t+`OutOf`;return n[X][r]?n.insAtLeftEnd(n[X][r]):n[Y][r]?n.insAtRightEnd(n[Y][r]):n.parent.bubble(function(e){var t=e[i];if(t&&(typeof t==`function`&&(t=e[i](n)),t instanceof dY&&n.jumpUpDown(e,t),t!==!0))return!1}),e}this.onNotify(function(e){e!==`upDown`&&(this.upDownCache={})}),this.onNotify(function(e){e===`edit`&&this.show().deleteSelection()}),e.deleteDir=function(e){lY(e);var t=this.cursor,n=t.selection;return this.notify(`edit`),n||(t[e]?t[e].deleteTowards(e,t):t.parent.deleteOutOf(e,t)),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this},e.ctrlDeleteDir=function(e){lY(e);var t=this.cursor;return!t[e]||t.selection?this.deleteDir(e):(this.notify(`edit`),e===Y?pY(t.parent.ends[Y],t[Y]).remove():pY(t[X],t.parent.ends[X]).remove(),t.insAtDirEnd(e,t.parent),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this)},e.backspace=function(){return this.deleteDir(Y)},e.deleteForward=function(){return this.deleteDir(X)},this.onNotify(function(e){e!==`select`&&this.endSelection()}),e.selectDir=function(e){var t=this.notify(`select`).cursor,n=t.selection;lY(e),t.anticursor||t.startSelection();var r=t[e];r?n&&n.ends[e]===r&&t.anticursor[-e]!==r?r.unselectInto(e,t):r.selectTowards(e,t):t.parent.selectOutOf(e,t),t.clearSelection(),t.select()||t.show()},e.selectLeft=function(){return this.selectDir(Y)},e.selectRight=function(){return this.selectDir(X)}});var NY=/[\\]{2,}/gm,PY=(function(){function e(e){var t=RY();return e.adopt(t,0,0),t}function t(e){for(var t=e[0]||RY(),n=1;n<e.length;n+=1)e[n].children().adopt(t,t.ends[X],0);return t}var n=jY.string,r=jY.regex,i=jY.letter,a=jY.any,o=jY.optWhitespace,s=jY.succeed,c=jY.fail,l=i.map(function(e){return qY(e)}),u=r(/^[^${}\\_^]/).map(function(e){return Q(e)}),d=r(/^\\not\\[a-z]+/).then(function(e){return hY[e]&&hY[e]().parser()||c(`unknown compound command: `+e)}),f=r(/^[^\\a-eg-zA-Z]/).or(n(`\\`).then(r(/^begin\{.?matrix\}/).or(r(/^[a-z]+/i)).or(r(/^\s+/).result(` `)).or(a))).then(function(e){e=e.replace(/^begin\{(.?matrix)\}$/,`$1`);var t=Z[e];return t?t(e).parser():c(`unknown command: \\`+e)}),p=d.or(f).or(l).or(u),m=n(`{`).then(function(){return g}).skip(n(`}`)),h=o.then(m.or(p.map(e))),g=h.many().map(t).skip(o),_=n(`[`).then(h.then(function(e){return e.join(`latex`)===`]`?c():s(e)}).many().map(t).skip(o)).skip(n(`]`)),v=g;return v.block=h,v.optBlock=_,v})();vY.open(function(e,t){e.exportLatex=function(){return this.root.latex().replace(/(\\[a-z]+) (?![a-z])/gi,`$1`)},e.parseLatex=function(e){return PY.parse(e).postOrder(`finalizeTree`,bY.p).join(`latex`).trim()},xY.maxDepth=function(e){return typeof e==`number`?e:QJ},e.writeLatex=function(e){var t=this.notify(`edit`).cursor,n=jY.all,r=jY.eof,i=PY.skip(r).or(n.result(!1)).parse(e);return i&&!i.isEmpty()&&i.prepareInsertionAt(t)&&(i.children().adopt(t.parent,t[Y],t[X]),i.jQize().insertBefore(t.jQ),t[Y]=i.ends[X],i.finalizeInsert(t.options,t),i.ends[X][X].siblingCreated&&i.ends[X][X].siblingCreated(t.options,Y),i.ends[Y][Y].siblingCreated&&i.ends[Y][Y].siblingCreated(t.options,X),t.parent.bubble(`reflow`)),this},e.renderLatexMath=function(e){e&&e.replace&&(e=e.replace(NY,`\\`));var t=this.root,n=this.cursor;n.options;var r=t.jQ,i=jY.all,a=jY.eof,o=PY.skip(a).or(i.result(!1)).parse(e);if(t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,o&&o.prepareInsertionAt(n)){o.children().adopt(t,0,0);var s=o.join(`html`);r.html(s),t.jQize(r.children()),t.finalizeInsert(n.options)}else r.empty();delete n.selection,n.insAtRightEnd(t)},e.renderLatexText=function(e){var t=this.root,n=this.cursor;t.jQ.children().slice(1).remove(),t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,delete n.selection,n.show().insAtRightEnd(t);var r=jY.regex,i=jY.string,a=jY.eof,o=jY.all,s=i(`$`).then(PY).skip(i(`$`).or(a)).map(function(e){var t=UY(n);t.createBlocks();var r=t.ends[Y];return e.children().adopt(r,0,0),t}),c=i(`\\$`).result(`$`).or(r(/^[^$]/)).map(Q),l=s.or(c).many().skip(a).or(o.result(!1)).parse(e);if(l){for(var u=0;u<l.length;u+=1)l[u].adopt(t,t.ends[X],0);t.jQize().appendTo(t.jQ),t.finalizeInsert(n.options)}}}),vY.open(function(e){bY.p.ignoreNextMousedown=rY,e.delegateMouseEvents=function(){var e=this.root.jQ;this.container.bind(`mousedown.mathquill`,function(t){var n=XJ(t.target).closest(`.mq-root-block`),r=dY.byId[n.attr(eY)||e.attr(eY)].controller,i=r.cursor;i.blink;var a=r.textareaSpan,o=r.textarea;if(t.preventDefault(),t.target.unselectable=!0,i.options.ignoreNextMousedown(t))return;i.options.ignoreNextMousedown=rY;function s(e){i.anticursor||i.startSelection(),r.seek(XJ(e.target),e.pageX,e.pageY).cursor.select(),e.target&&XJ(e.target.ownerDocument).unbind(`mousemove`,c)}function c(e){return delete e.target,s(e)}function l(e){!i.selection&&!r.editable&&a.detach(),n.unbind(`mousemove`,s),XJ(e.target.ownerDocument).unbind(`mousemove`,c).unbind(`mouseup`,l)}if(a.parent().length===0)return!1;r.blurred&&(r.editable||n.prepend(a),document.body.focus(),o.focus()),t.preventDefault(),t.target.unselectable=!0,i.show(),r.seek(XJ(t.target),t.pageX,t.pageY).cursor.startSelection(),n.mousemove(s),XJ(t.target.ownerDocument).mousemove(c).mouseup(l)})}}),vY.open(function(e){e.seek=function(e,t,n){var r=this.notify(`select`).cursor;if(e){var i=e.attr(eY)||e.attr($J);if(!i){var a=e.parent();i=a.attr(eY)||a.attr($J)}}var o=i&&dY.byId[i]?dY.byId[i]:this.root;return r.clearSelection().show(),o.seek(t,r),this.scrollHoriz(),this}}),vY.open(function(e){e.scrollHoriz=function(){var e=this.cursor,t=e.selection,n=this.root.jQ[0].getBoundingClientRect();if(t){var r=t.jQ[0].getBoundingClientRect(),i=r.left-(n.left+20),a=r.right-(n.right-20);if(t.ends[Y]===e[X])if(i<0)var o=i;else if(a>0)if(r.left-a<n.left+20)var o=i;else var o=a;else return;else if(a>0)var o=a;else if(i<0)if(r.right-i>n.right-20)var o=a;else var o=i;else return}else{var s=e.jQ[0].getBoundingClientRect().left;if(s>n.right-20)var o=s-(n.right-20);else if(s<n.left+20)var o=s-(n.left+20);else return}this.root.jQ.stop&&typeof this.root.jQ.stop==`function`&&this.root.jQ.stop().animate({scrollLeft:`+=`+o},100)}}),vY.open(function(e){bY.p.substituteTextarea=function(){return XJ(`<textarea autocapitalize=off autocomplete=off autocorrect=off spellcheck=false x-palm-disable-ste-all=true />`)[0]},e.createTextarea=function(){var e=this.textareaSpan=XJ(`<span class="mq-textarea"></span>`),t=this.options.substituteTextarea();if(!t.nodeType)throw`substituteTextarea() must return a DOM element, got `+t;t=this.textarea=XJ(t).appendTo(e);var n=this;n.cursor.selectionChanged=function(){n.selectionChanged()}},e.selectionChanged=function(){var e=this;sX(e.container[0]),e.textareaSelectionTimeout===QJ&&(e.textareaSelectionTimeout=setTimeout(function(){e.setTextareaSelection()}))},e.setTextareaSelection=function(){this.textareaSelectionTimeout=QJ;var e=``;this.cursor.selection&&(e=this.cursor.selection.join(`latex`),this.options.statelessClipboard&&(e=`$`+e+`$`)),this.selectFn(e)},e.staticMathTextareaEvents=function(){var e=this;e.root;var t=e.cursor,n=e.textarea,r=e.textareaSpan;this.container.prepend(ZJ(`<span class="mq-selectable">`).text(`$`+e.exportLatex()+`$`)),e.blurred=!0,n.bind(`cut paste`,!1).bind(`copy`,function(){e.setTextareaSelection()}).focus(function(){e.blurred=!1}).blur(function(){t.selection&&t.selection.clear(),setTimeout(i)});function i(){r.detach(),e.blurred=!0}e.selectFn=function(e){n.val(e),e&&n.select()}},bY.p.substituteKeyboardEvents=MY,e.editablesTextareaEvents=function(){var e=this,t=e.textarea,n=e.textareaSpan,r=this.options.substituteKeyboardEvents(t,this);this.selectFn=function(e){r.select(e)},this.container.prepend(n),this.focusBlurEvents()},e.typedText=function(e){if(e===`
329
+ `)return this.handle(`enter`);var t=this.notify().cursor;t.parent.write(t,e),this.scrollHoriz()},e.cut=function(){var e=this,t=e.cursor;t.selection&&setTimeout(function(){e.notify(`edit`),t.parent.bubble(`reflow`)})},e.copy=function(){this.setTextareaSelection()},e.paste=function(e){this.options.statelessClipboard&&(e=e.slice(0,1)===`$`&&e.slice(-1)===`$`?e.slice(1,-1):`\\text{`+e+`}`),this.writeLatex(e).cursor.show()}});var FY=J(dY,function(e,t){e.finalizeInsert=function(e,t){var n=this;n.postOrder(`finalizeTree`,e),n.postOrder(`contactWeld`,t),n.postOrder(`blur`),n.postOrder(`reflow`),n[X].siblingCreated&&n[X].siblingCreated(e,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e,X),n.bubble(`reflow`)},e.prepareInsertionAt=function(e){var t=e.options.maxDepth;if(t!==QJ){var n=e.depth();if(n>t)return!1;this.removeNodesDeeperThan(t-n)}return!0},e.removeNodesDeeperThan=function(e){for(var t=0,n=[[this,t]],r;n.length;)r=n.shift(),r[0].children().each(function(i){var a=+(i instanceof RY);t=r[1]+a,t<=e?n.push([i,t]):(a?i.children():i).remove()})}}),IY=J(FY,function(e,t){e.init=function(e,n,r){var i=this;t.init.call(i),i.ctrlSeq||=e,n&&(i.htmlTemplate=n),r&&(i.textTemplate=r)},e.replaces=function(e){e.disown(),this.replacedFragment=e},e.isEmpty=function(){return this.foldChildren(!0,function(e,t){return e&&t.isEmpty()})},e.parser=function(){var e=PY.block,t=this;return e.times(t.numBlocks()).map(function(e){t.blocks=e;for(var n=0;n<e.length;n+=1)e[n].adopt(t,t.ends[X],0);return t})},e.createLeftOf=function(e){var n=this,r=n.replacedFragment;n.createBlocks(),t.createLeftOf.call(n,e),r&&(r.adopt(n.ends[Y],0,0),r.jQ.appendTo(n.ends[Y].jQ),n.placeCursor(e),n.prepareInsertionAt(e)),n.finalizeInsert(e.options),n.placeCursor(e)},e.createBlocks=function(){for(var e=this,t=e.numBlocks(),n=e.blocks=Array(t),r=0;r<t;r+=1)(n[r]=RY()).adopt(e,e.ends[X],0)},e.placeCursor=function(e){e.insAtRightEnd(this.foldChildren(this.ends[Y],function(e,t){return e.isEmpty()?e:t}))},e.moveTowards=function(e,t,n){var r=n&&this[n+`Into`];t.insAtDirEnd(-e,r||this.ends[-e])},e.deleteTowards=function(e,t){this.isEmpty()?t[e]=this.remove()[e]:this.moveTowards(e,t,null)},e.selectTowards=function(e,t){t[-e]=this,t[e]=this[e]},e.selectChildren=function(){return _Y(this,this)},e.unselectInto=function(e,t){t.insAtDirEnd(-e,t.anticursor.ancestors[this.id])},e.seek=function(e,t){function n(e){var t={};return t[Y]=e.jQ.offset().left,t[X]=t[Y]+e.jQ.outerWidth(),t}var r=this,i=n(r);if(e<i[Y])return t.insLeftOf(r);if(e>i[X])return t.insRightOf(r);var a=i[Y];r.eachChild(function(o){var s=n(o);if(e<s[Y])return e-a<s[Y]-e?o[Y]?t.insAtRightEnd(o[Y]):t.insLeftOf(r):t.insAtLeftEnd(o),!1;if(e>s[X])o[X]?a=s[X]:i[X]-e<e-s[X]?t.insRightOf(r):t.insAtRightEnd(o);else return o.seek(e,t),!1})},e.numBlocks=function(){var e=this.htmlTemplate.match(/&\d+/g);return e?e.length:0},e.html=function(){var e=this,t=e.blocks,n=` mathquill-command-id=`+e.id,r=e.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);cY(`no unmatched angle brackets`,r.join(``)===this.htmlTemplate);for(var i=0,a=r[0];a;i+=1,a=r[i])if(a.slice(-2)===`/>`)r[i]=a.slice(0,-2)+n+`/>`;else if(a.charAt(0)===`<`){cY(`not an unmatched top-level close tag`,a.charAt(1)!==`/`),r[i]=a.slice(0,-1)+n+`>`;var o=1;do i+=1,a=r[i],cY(`no missing close tags`,a),a.slice(0,2)===`</`?--o:a.charAt(0)===`<`&&a.slice(-2)!==`/>`&&(o+=1);while(o>0)}return r.join(``).replace(/>&(\d+)/g,function(e,n){return` mathquill-block-id=`+t[n].id+`>`+t[n].join(`html`)})},e.latex=function(){return this.foldChildren(this.ctrlSeq,function(e,t){return e+`{`+(t.latex()||` `)+`}`})},e.textTemplate=[``],e.text=function(){var e=this,t=0;return e.foldChildren(e.textTemplate[t],function(n,r){t+=1;var i=r.text();return n&&e.textTemplate[t]===`(`&&i[0]===`(`&&i.slice(-1)===`)`?n+i.slice(1,-1)+e.textTemplate[t]:n+i+(e.textTemplate[t]||``)})}}),LY=J(IY,function(e,t){e.init=function(e,n,r){r||=e&&e.length>1?e.slice(1):e,t.init.call(this,e,n,[r])},e.parser=function(){return jY.succeed(this)},e.numBlocks=function(){return 0},e.replaces=function(e){e.remove()},e.createBlocks=rY,e.moveTowards=function(e,t){t.jQ.insDirOf(e,this.jQ),t[-e]=this,t[e]=this[e]},e.deleteTowards=function(e,t){t[e]=this.remove()[e]},e.seek=function(e,t){e-this.jQ.offset().left<this.jQ.outerWidth()/2?t.insLeftOf(this):t.insRightOf(this)},e.latex=function(){return this.ctrlSeq},e.text=function(){return this.textTemplate},e.placeCursor=rY,e.isEmpty=function(){return!0}}),Q=J(LY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span>`+(n||e)+`</span>`)}}),$=J(LY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-binary-operator">`+n+`</span>`,r)}}),RY=J(FY,function(e,t){e.join=function(e){return this.foldChildren(``,function(t,n){return t+n[e]()})},e.html=function(){return this.join(`html`)},e.latex=function(){return this.join(`latex`)},e.text=function(){return this.ends[Y]===this.ends[X]&&this.ends[Y]!==0?this.ends[Y].text():this.join(`text`)},e.keystroke=function(e,n,r){if(r.options.spaceBehavesLikeTab&&(e===`Spacebar`||e===`Shift-Spacebar`)){n.preventDefault(),r.escapeDir(e===`Shift-Spacebar`?Y:X,e,n);return}return t.keystroke.apply(this,arguments)},e.moveOutOf=function(e,t,n){!(n&&this.parent[n+`Into`])&&this[e]?t.insAtDirEnd(-e,this[e]):t.insDirOf(e,this.parent)},e.selectOutOf=function(e,t){t.insDirOf(e,this.parent)},e.deleteOutOf=function(e,t){t.unwrapGramp()},e.seek=function(e,t){var n=this.ends[X];if(!n||n.jQ.offset().left+n.jQ.outerWidth()<e)return t.insAtRightEnd(this);if(e<this.ends[Y].jQ.offset().left)return t.insAtLeftEnd(this);for(;e<n.jQ.offset().left;)n=n[Y];return n.seek(e,t)},e.chToCmd=function(e,t){var n;return e.match(/^[a-eg-zA-Z]$/)?qY(e):/^\d$/.test(e)?GY(e):t&&t.typingSlashWritesDivisionSymbol&&e===`/`?Z[`÷`](e):t&&t.typingAsteriskWritesTimesSymbol&&e===`*`?Z[`×`](e):(n=mY[e]||Z[e])?n(e):Q(e)},e.write=function(e,t){var n;if(e.tooDeep())return!1;n=this.chToCmd(t,e.options),e.selection&&n.replaces(e.replaceSelection()),e.isTooDeep()||n.createLeftOf(e.show())},e.focus=function(){return this.jQ.addClass(`mq-hasCursor`),this.jQ.removeClass(`mq-empty`),this},e.blur=function(){return this.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.jQ.addClass(`mq-empty`),this}});bY.p.mouseEvents=!0,yY.StaticMath=function(e){return J(e.AbstractMathQuill,function(t,n){this.RootBlock=RY,t.__mathquillify=function(e,t){return this.config(e),n.__mathquillify.call(this,`mq-math-mode`),this.__options.mouseEvents&&(this.__controller.delegateMouseEvents(),this.__controller.staticMathTextareaEvents()),this},t.init=function(){n.init.apply(this,arguments),this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField)},t.latex=function(){var t=n.latex.apply(this,arguments);return arguments.length>0&&this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField),t}})};var zY=J(RY,AY);yY.MathField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=zY,e.__mathquillify=function(e,n){return this.config(e),n>1&&(this.__controller.root.reflow=rY),t.__mathquillify.call(this,`mq-editable-field mq-math-mode`),delete this.__controller.root.reflow,this}})};var BY=J(dY,function(e,t){e.ctrlSeq=`\\text`,e.replaces=function(e){e instanceof pY?this.replacedText=e.remove().jQ.text():typeof e==`string`&&(this.replacedText=e)},e.jQadd=function(e){t.jQadd.call(this,e),this.ends[Y]&&this.ends[Y].jQadd(this.jQ[0].firstChild)},e.createLeftOf=function(e){var n=this;if(t.createLeftOf.call(this,e),n[X].siblingCreated&&n[X].siblingCreated(e.options,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e.options,X),n.bubble(`reflow`),e.insAtRightEnd(n),n.replacedText)for(var r=0;r<n.replacedText.length;r+=1)n.write(e,n.replacedText.charAt(r))},e.parser=function(){var e=this,t=jY.string,n=jY.regex;return jY.optWhitespace.then(t(`{`)).then(n(/^[^}]*/)).skip(t(`}`)).map(function(t){return t.length===0?pY():(VY(t).adopt(e,0,0),e)})},e.textContents=function(){return this.foldChildren(``,function(e,t){return e+t.text})},e.text=function(){return`"`+this.textContents()+`"`},e.latex=function(){var e=this.textContents();return e.length===0?``:`\\text{`+e.replace(/\\/g,`\\backslash `).replace(/[{}]/g,`\\$&`)+`}`},e.html=function(){return`<span class="mq-text-mode" mathquill-command-id=`+this.id+`>`+this.textContents()+`</span>`},e.moveTowards=function(e,t){t.insAtDirEnd(-e,this)},e.moveOutOf=function(e,t){t.insDirOf(e,this)},e.unselectInto=e.moveTowards,e.selectTowards=IY.prototype.selectTowards,e.deleteTowards=IY.prototype.deleteTowards,e.selectOutOf=function(e,t){t.insDirOf(e,this)},e.deleteOutOf=function(e,t){this.isEmpty()&&t.insRightOf(this)},e.write=function(e,n){if(e.show().deleteSelection(),n!==`$`)e[Y]?(e[Y].appendText(n),this.bubble(`reflow`)):VY(n).createLeftOf(e);else if(this.isEmpty())e.insRightOf(this),Q(`\\$`,`$`).createLeftOf(e);else if(!e[X])e.insRightOf(this);else if(!e[Y])e.insLeftOf(this);else{var r=BY(),i=this.ends[Y];i.disown().jQ.detach(),i.adopt(r,0,0),e.insLeftOf(this),t.createLeftOf.call(r,e)}},e.seek=function(e,t){t.hide();var r=n(this),i=this.jQ.width()/this.text.length,a=Math.round((e-this.jQ.offset().left)/i);a<=0?t.insAtLeftEnd(this):a>=r.text.length?t.insAtRightEnd(this):t.insLeftOf(r.splitRight(a));for(var o=e-t.show().offset().left,s=o&&o<0?Y:X,c=s;t[s]&&o*c>0;)t[s].moveTowards(s,t),c=o,o=e-t.offset().left;if(s*o<-s*c&&t[-s].moveTowards(-s,t),!t.anticursor)this.anticursorPosition=t[Y]&&t[Y].text.length;else if(t.anticursor.parent===this){var l=t[Y]&&t[Y].text.length;if(this.anticursorPosition===l)t.anticursor=uY.copy(t);else{if(this.anticursorPosition<l){var u=t[Y].splitRight(this.anticursorPosition);t[Y]=u}else var u=t[X].splitRight(this.anticursorPosition-l);t.anticursor=uY(this,u[Y],u)}}},e.blur=function(e){RY.prototype.blur.call(this),e&&(this.textContents()===``?(this.remove(),e[Y]===this?e[Y]=this[Y]:e[X]===this&&(e[X]=this[X])):n(this))};function n(e){e.jQ[0].normalize();var t=e.jQ.contents().filter(function(e,t){return t.nodeType===3})[0];t||={data:``},cY(`only node in TextBlock span is Text node`,t.nodeType===3);var n=VY(t.data);return n.jQadd(t),e.children().disown(),n.adopt(e,0,0)}e.focus=RY.prototype.focus}),VY=J(dY,function(e,t){e.init=function(e){t.init.call(this),this.text=e},e.jQadd=function(e){this.dom=e,this.jQ=XJ(e)},e.jQize=function(){return this.jQadd(document.createTextNode(this.text))},e.appendText=function(e){this.text+=e,this.dom.appendData(e)},e.prependText=function(e){this.text=e+this.text,this.dom.insertData(0,e)},e.insTextAtDirEnd=function(e,t){lY(t),t===X?this.appendText(e):this.prependText(e)},e.splitRight=function(e){var t=VY(this.text.slice(e)).adopt(this.parent,this,this[X]);return t.jQadd(this.dom.splitText(e)),this.text=this.text.slice(0,e),t};function n(e,t){return t.charAt(e===Y?0:-1+t.length)}e.moveTowards=function(e,t){lY(e);var r=n(-e,this.text),i=this[-e];return i?i.insTextAtDirEnd(r,e):VY(r).createDir(-e,t),this.deleteTowards(e,t)},e.latex=function(){return this.text},e.deleteTowards=function(e,t){this.text.length>1?e===X?(this.dom.deleteData(0,1),this.text=this.text.slice(1)):(this.dom.deleteData(-1+this.text.length,1),this.text=this.text.slice(0,-1)):(this.remove(),this.jQ.remove(),t[e]=this[e])},e.selectTowards=function(e,t){lY(e);var r=t.anticursor,i=n(-e,this.text);if(r[e]===this){var a=VY(i).createDir(e,t);r[e]=a,t.insDirOf(e,a)}else{var o=this[-e];if(o)o.insTextAtDirEnd(i,e);else{var a=VY(i).createDir(-e,t);a.jQ.insDirOf(-e,t.selection.jQ)}this.text.length===1&&r[-e]===this&&(r[-e]=this[-e])}return this.deleteTowards(e,t)}});Z.text=Z.textnormal=Z.textrm=Z.textup=Z.textmd=BY;function HY(e,t,n){return J(BY,{ctrlSeq:e,htmlTemplate:`<`+t+` `+n+`>&0</`+t+`>`})}Z.em=Z.italic=Z.italics=Z.emph=Z.textit=Z.textsl=HY(`\\textit`,`i`,`class="mq-text-mode"`),Z.strong=Z.bold=Z.textbf=HY(`\\textbf`,`b`,`class="mq-text-mode"`),Z.sf=Z.textsf=HY(`\\textsf`,`span`,`class="mq-sans-serif mq-text-mode"`),Z.tt=Z.texttt=HY(`\\texttt`,`span`,`class="mq-monospace mq-text-mode"`),Z.textsc=HY(`\\textsc`,`span`,`style="font-variant:small-caps" class="mq-text-mode"`),Z.uppercase=HY(`\\uppercase`,`span`,`style="text-transform:uppercase" class="mq-text-mode"`),Z.lowercase=HY(`\\lowercase`,`span`,`style="text-transform:lowercase" class="mq-text-mode"`);var UY=J(IY,function(e,t){e.init=function(e){t.init.call(this,`$`),this.cursor=e},e.htmlTemplate=`<span class="mq-math-mode">&0</span>`,e.createBlocks=function(){t.createBlocks.call(this),this.ends[Y].cursor=this.cursor,this.ends[Y].write=function(e,t){t===`$`?this.isEmpty()?(e.insRightOf(this.parent),this.parent.deleteTowards(dir,e),Q(`\\$`,`$`).createLeftOf(e.show())):e[X]?e[Y]?RY.prototype.write.call(this,e,t):e.insLeftOf(this.parent):e.insRightOf(this.parent):RY.prototype.write.call(this,e,t)}},e.latex=function(){return`$`+this.ends[Y].latex()+`$`}}),WY=J(zY,function(e,t){e.keystroke=function(e){if(!(e===`Spacebar`||e===`Shift-Spacebar`))return t.keystroke.apply(this,arguments)},e.write=function(e,t){if(e.show().deleteSelection(),t===`$`)UY(e).createLeftOf(e);else{var n;t===`<`?n=`&lt;`:t===`>`&&(n=`&gt;`),Q(t,n).createLeftOf(e)}}});yY.TextField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=WY,e.__mathquillify=function(){return t.__mathquillify.call(this,`mq-editable-field mq-text-mode`)},e.latex=function(e){return arguments.length>0?(this.__controller.renderLatexText(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()}})},mY[`\\`]=J(IY,function(e,t){e.ctrlSeq=`\\`,e.replaces=function(e){this._replacedFragment=e.disown(),this.isEmpty=function(){return!1}},e.htmlTemplate=`<span class="mq-latex-command-input mq-non-leaf">\\<span>&0</span></span>`,e.textTemplate=[`\\`],e.createBlocks=function(){t.createBlocks.call(this),this.ends[Y].focus=function(){return this.parent.jQ.addClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.removeClass(`mq-empty`),this},this.ends[Y].blur=function(){return this.parent.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.addClass(`mq-empty`),this},this.ends[Y].write=function(e,t){e.show().deleteSelection(),t.match(/[a-z]/i)?Q(t).createLeftOf(e):(this.parent.renderCommand(e),(t!==`\\`||!this.isEmpty())&&e.parent.write(e,t))},this.ends[Y].keystroke=function(e,n,r){if(e===`Tab`||e===`Enter`||e===`Spacebar`){this.parent.renderCommand(r.cursor),n.preventDefault();return}return t.keystroke.apply(this,arguments)}},e.createLeftOf=function(e){if(t.createLeftOf.call(this,e),this._replacedFragment){var n=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass(`mq-blur`).bind(`mousedown mousemove`,function(e){return XJ(e.target=n).trigger(e),!1}).insertBefore(this.jQ).add(this.jQ)}},e.latex=function(){return`\\`+this.ends[Y].latex()+` `},e.renderCommand=function(e){this.jQ=this.jQ.last(),this.remove(),this[X]?e.insLeftOf(this[X]):e.insAtRightEnd(this.parent);var t=this.ends[Y].latex();t||=` `;var n=Z[t];n?(n=n(t),this._replacedFragment&&n.replaces(this._replacedFragment),n.createLeftOf(e)):(n=BY(),n.replaces(t),n.createLeftOf(e),e.insRightOf(n),this._replacedFragment&&this._replacedFragment.remove())}}),Z[`∉`]=Z.notin=q($,`\\notin `,`&#8713;`),Z[`≅`]=Z.cong=q($,`\\cong `,`&#8773;`),Z[`≡`]=Z.equiv=q($,`\\equiv `,`&#8801;`),Z[`⊕`]=Z.oplus=q($,`\\oplus `,`&#8853;`),Z[`⊗`]=Z.otimes=q($,`\\otimes `,`&#8855;`),Z[`≠`]=Z.ne=Z.neq=q($,`\\ne `,`&ne;`),Z[`≇`]=Z.ncong=q($,`\\ncong `,`&ncong;`),Z[`∗`]=Z.ast=Z.star=Z.loast=Z.lowast=q($,`\\ast `,`&lowast;`),Z.therefor=Z.therefore=q($,`\\therefore `,`&there4;`),Z.cuz=Z.because=q($,`\\because `,`&#8757;`),Z.prop=Z.propto=q($,`\\propto `,`&prop;`),Z[`≈`]=Z.asymp=Z.approx=q($,`\\approx `,`&asymp;`),Z[`≉`]=Z.nasymp=Z.napprox=q($,`\\napprox `,`&nap;`),Z.isin=Z.in=q($,`\\in `,`&isin;`),Z.ni=Z.contains=q($,`\\ni `,`&ni;`),Z.notni=Z.niton=Z.notcontains=Z.doesnotcontain=hY[`\\not\\ni`]=q($,`\\not\\ni `,`&#8716;`),Z.sub=Z.subset=q($,`\\subset `,`&sub;`),Z.sup=Z.supset=Z.superset=q($,`\\supset `,`&sup;`),Z.nsub=Z.notsub=Z.nsubset=Z.notsubset=hY[`\\not\\subset`]=q($,`\\not\\subset `,`&#8836;`),Z.nsup=Z.notsup=Z.nsupset=Z.notsupset=Z.nsuperset=Z.notsuperset=hY[`\\not\\supset`]=q($,`\\not\\supset `,`&#8837;`),Z.sube=Z.subeq=Z.subsete=Z.subseteq=q($,`\\subseteq `,`&sube;`),Z.supe=Z.supeq=Z.supsete=Z.supseteq=Z.supersete=Z.superseteq=q($,`\\supseteq `,`&supe;`),Z.nsube=Z.nsubeq=Z.notsube=Z.notsubeq=Z.nsubsete=Z.nsubseteq=Z.notsubsete=Z.notsubseteq=hY[`\\not\\subseteq`]=q($,`\\not\\subseteq `,`&#8840;`),Z.nsupe=Z.nsupeq=Z.notsupe=Z.notsupeq=Z.nsupsete=Z.nsupseteq=Z.notsupsete=Z.notsupseteq=Z.nsupersete=Z.nsuperseteq=Z.notsupersete=Z.notsuperseteq=hY[`\\not\\supseteq`]=q($,`\\not\\supseteq `,`&#8841;`),Z.N=Z.naturals=Z.Naturals=q(Q,`\\mathbb{N}`,`&#8469;`),Z.P=Z.primes=Z.Primes=Z.projective=Z.Projective=Z.probability=Z.Probability=q(Q,`\\mathbb{P}`,`&#8473;`),Z.Z=Z.integers=Z.Integers=q(Q,`\\mathbb{Z}`,`&#8484;`),Z.Q=Z.rationals=Z.Rationals=q(Q,`\\mathbb{Q}`,`&#8474;`),Z.R=Z.reals=Z.Reals=q(Q,`\\mathbb{R}`,`&#8477;`),Z.C=Z.complex=Z.Complex=Z.complexes=Z.Complexes=Z.complexplane=Z.Complexplane=Z.ComplexPlane=q(Q,`\\mathbb{C}`,`&#8450;`),Z.H=Z.Hamiltonian=Z.quaternions=Z.Quaternions=q(Q,`\\mathbb{H}`,`&#8461;`),Z.quad=Z.emsp=q(Q,`\\quad `,` `),Z.qquad=q(Q,`\\qquad `,` `),Z.diamond=q(Q,`\\diamond `,`&#9671;`),Z.bigtriangleup=q(Q,`\\bigtriangleup `,`&#9651;`),Z.ominus=q(Q,`\\ominus `,`&#8854;`),Z.uplus=q(Q,`\\uplus `,`&#8846;`),Z.bigtriangledown=q(Q,`\\bigtriangledown `,`&#9661;`),Z.sqcap=q(Q,`\\sqcap `,`&#8851;`),Z.triangleleft=q(Q,`\\triangleleft `,`&#8882;`),Z.sqcup=q(Q,`\\sqcup `,`&#8852;`),Z.triangleright=q(Q,`\\triangleright `,`&#8883;`),Z.odot=Z.circledot=q(Q,`\\odot `,`&#8857;`),Z.bigcirc=q(Q,`\\bigcirc `,`&#9711;`),Z.dagger=q(Q,`\\dagger `,`&#0134;`),Z.ddagger=q(Q,`\\ddagger `,`&#135;`),Z.wr=q(Q,`\\wr `,`&#8768;`),Z.amalg=q(Q,`\\amalg `,`&#8720;`),Z.models=q(Q,`\\models `,`&#8872;`),Z.prec=q(Q,`\\prec `,`&#8826;`),Z.succ=q(Q,`\\succ `,`&#8827;`),Z.preceq=q(Q,`\\preceq `,`&#8828;`),Z.succeq=q(Q,`\\succeq `,`&#8829;`),Z.simeq=q(Q,`\\simeq `,`&#8771;`),Z.mid=q(Q,`\\mid `,`&#8739;`),Z.ll=q(Q,`\\ll `,`&#8810;`),Z.gg=q(Q,`\\gg `,`&#8811;`),Z.parallel=q(Q,`\\parallel `,`&#8741;`),Z.nparallel=q(Q,`\\nparallel `,`&#8742;`),Z.bowtie=q(Q,`\\bowtie `,`&#8904;`),Z.sqsubset=q(Q,`\\sqsubset `,`&#8847;`),Z.sqsupset=q(Q,`\\sqsupset `,`&#8848;`),Z.smile=q(Q,`\\smile `,`&#8995;`),Z.sqsubseteq=q(Q,`\\sqsubseteq `,`&#8849;`),Z.sqsupseteq=q(Q,`\\sqsupseteq `,`&#8850;`),Z.doteq=q(Q,`\\doteq `,`&#8784;`),Z.frown=q(Q,`\\frown `,`&#8994;`),Z.vdash=q(Q,`\\vdash `,`&#8870;`),Z.dashv=q(Q,`\\dashv `,`&#8867;`),Z.nless=q(Q,`\\nless `,`&#8814;`),Z.ngtr=q(Q,`\\ngtr `,`&#8815;`),Z.longleftarrow=q(Q,`\\longleftarrow `,`&#8592;`),Z.longrightarrow=q(Q,`\\longrightarrow `,`&#8594;`),Z.Longleftarrow=q(Q,`\\Longleftarrow `,`&#8656;`),Z.Longrightarrow=q(Q,`\\Longrightarrow `,`&#8658;`),Z.longleftrightarrow=q(Q,`\\longleftrightarrow `,`&#8596;`),Z.updownarrow=q(Q,`\\updownarrow `,`&#8597;`),Z.Longleftrightarrow=q(Q,`\\Longleftrightarrow `,`&#8660;`),Z.Updownarrow=q(Q,`\\Updownarrow `,`&#8661;`),Z.mapsto=q(Q,`\\mapsto `,`&#8614;`),Z.nearrow=q(Q,`\\nearrow `,`&#8599;`),Z.hookleftarrow=q(Q,`\\hookleftarrow `,`&#8617;`),Z.hookrightarrow=q(Q,`\\hookrightarrow `,`&#8618;`),Z.searrow=q(Q,`\\searrow `,`&#8600;`),Z.leftharpoonup=q(Q,`\\leftharpoonup `,`&#8636;`),Z.rightharpoonup=q(Q,`\\rightharpoonup `,`&#8640;`),Z.swarrow=q(Q,`\\swarrow `,`&#8601;`),Z.leftharpoondown=q(Q,`\\leftharpoondown `,`&#8637;`),Z.rightharpoondown=q(Q,`\\rightharpoondown `,`&#8641;`),Z.nwarrow=q(Q,`\\nwarrow `,`&#8598;`),Z.ldots=q(Q,`\\ldots `,`&#8230;`),Z.cdots=q(Q,`\\cdots `,`&#8943;`),Z.vdots=q(Q,`\\vdots `,`&#8942;`),Z.ddots=q(Q,`\\ddots `,`&#8945;`),Z.surd=q(Q,`\\surd `,`&#8730;`),Z.triangle=q(Q,`\\triangle `,`&#9651;`),Z.ell=q(Q,`\\ell `,`&#8467;`),Z.top=q(Q,`\\top `,`&#8868;`),Z.flat=q(Q,`\\flat `,`&#9837;`),Z.natural=q(Q,`\\natural `,`&#9838;`),Z.sharp=q(Q,`\\sharp `,`&#9839;`),Z.wp=q(Q,`\\wp `,`&#8472;`),Z.bot=q(Q,`\\bot `,`&#8869;`),Z.clubsuit=q(Q,`\\clubsuit `,`&#9827;`),Z.diamondsuit=q(Q,`\\diamondsuit `,`&#9826;`),Z.heartsuit=q(Q,`\\heartsuit `,`&#9825;`),Z.spadesuit=q(Q,`\\spadesuit `,`&#9824;`),Z.circledot=q(Q,`\\circledot `,`&#8857;`),Z.middot=q(Q,`\\middot `,`&middot;`),Z.dottedsquare=q(Q,`\\dottedsquare `,`&#11034;`),Z.square=q(Q,`\\square `,`&#11036;`),Z.rectangle=q(Q,`\\rectangle `,`&#9647;`),Z.oint=q(Q,`\\oint `,`&#8750;`),Z.bigcap=q(Q,`\\bigcap `,`&#8745;`),Z.bigcup=q(Q,`\\bigcup `,`&#8746;`),Z.bigsqcup=q(Q,`\\bigsqcup `,`&#8852;`),Z.bigvee=q(Q,`\\bigvee `,`&#8744;`),Z.bigwedge=q(Q,`\\bigwedge `,`&#8743;`),Z.bigodot=q(Q,`\\bigodot `,`&#8857;`),Z.bigotimes=q(Q,`\\bigotimes `,`&#8855;`),Z.bigoplus=q(Q,`\\bigoplus `,`&#8853;`),Z.biguplus=q(Q,`\\biguplus `,`&#8846;`),Z.lfloor=q(Q,`\\lfloor `,`&#8970;`),Z.rfloor=q(Q,`\\rfloor `,`&#8971;`),Z.lceil=q(Q,`\\lceil `,`&#8968;`),Z.rceil=q(Q,`\\rceil `,`&#8969;`),Z.opencurlybrace=Z.lbrace=q(Q,`\\lbrace `,`{`),Z.closecurlybrace=Z.rbrace=q(Q,`\\rbrace `,`}`),Z.lbrack=q(Q,`[`),Z.rbrack=q(Q,`]`),Z.mug=q(Q,`\\mug `,`µg`),Z.mus=q(Q,`\\mus `,`µs`),Z.mum=q(Q,`\\mum `,`µm`),Z.muL=q(Q,`\\muL `,`µL`),Z.slash=q(Q,`/`),Z.vert=q(Q,`|`),Z.perp=Z.perpendicular=q(Q,`\\perp `,`&perp;`),Z.nabla=Z.del=q(Q,`\\nabla `,`&nabla;`),Z.hbar=q(Q,`\\hbar `,`&#8463;`),Z.AA=Z.Angstrom=Z.angstrom=q(Q,`\\text\\AA `,`&#8491;`),Z.ring=Z.circ=Z.circle=q(Q,`\\circ `,`&#8728;`),Z.bull=Z.bullet=q(Q,`\\bullet `,`&bull;`),Z.setminus=Z.smallsetminus=q(Q,`\\setminus `,`&#8726;`),Z.not=Z[`¬`]=Z.neg=q(Q,`\\neg `,`&not;`),Z[`…`]=Z.dots=Z.ellip=Z.hellip=Z.ellipsis=Z.hellipsis=q(Q,`\\dots `,`&hellip;`),Z.converges=Z.darr=Z.dnarr=Z.dnarrow=Z.downarrow=q(Q,`\\downarrow `,`&darr;`),Z.dArr=Z.dnArr=Z.dnArrow=Z.Downarrow=q(Q,`\\Downarrow `,`&dArr;`),Z.diverges=Z.uarr=Z.uparrow=q(Q,`\\uparrow `,`&uarr;`),Z.uArr=Z.Uparrow=q(Q,`\\Uparrow `,`&uArr;`),Z.to=q($,`\\to `,`&rarr;`),Z.rarr=Z.rightarrow=q(Q,`\\rightarrow `,`&rarr;`),Z.implies=q($,`\\Rightarrow `,`&rArr;`),Z.rArr=Z.Rightarrow=q(Q,`\\Rightarrow `,`&rArr;`),Z.gets=q($,`\\gets `,`&larr;`),Z.larr=Z.leftarrow=q(Q,`\\leftarrow `,`&larr;`),Z.impliedby=q($,`\\Leftarrow `,`&lArr;`),Z.lArr=Z.Leftarrow=q(Q,`\\Leftarrow `,`&lArr;`),Z.harr=Z.lrarr=Z.leftrightarrow=q(Q,`\\leftrightarrow `,`&harr;`),Z.iff=q($,`\\Leftrightarrow `,`&hArr;`),Z.hArr=Z.lrArr=Z.Leftrightarrow=q(Q,`\\Leftrightarrow `,`&hArr;`),Z.Re=Z.Real=Z.real=q(Q,`\\Re `,`&real;`),Z.Im=Z.imag=Z.image=Z.imagin=Z.imaginary=Z.Imaginary=q(Q,`\\Im `,`&image;`),Z.part=Z.partial=q(Q,`\\partial `,`&part;`),Z.infty=Z.infin=Z.infinity=q(Q,`\\infty `,`&infin;`),Z.pounds=q(Q,`\\pounds `,`&pound;`),Z.alef=Z.alefsym=Z.aleph=Z.alephsym=q(Q,`\\aleph `,`&alefsym;`),Z.xist=Z.xists=Z.exist=Z.exists=q(Q,`\\exists `,`&exist;`),Z.nexists=Z.nexist=q(Q,`\\nexists `,`&#8708;`),Z.and=Z.land=Z.wedge=q($,`\\wedge `,`&and;`),Z.or=Z.lor=Z.vee=q($,`\\vee `,`&or;`),Z.o=Z.O=Z.empty=Z.emptyset=Z.oslash=Z.Oslash=Z.nothing=Z.varnothing=q($,`\\varnothing `,`&empty;`),Z.cup=Z.union=q($,`\\cup `,`&cup;`),Z.cap=Z.intersect=Z.intersection=q($,`\\cap `,`&cap;`),Z.deg=Z.degree=q(Q,`\\degree `,`&deg;`),Z.ang=Z.angle=q(Q,`\\angle `,`&ang;`),Z.measuredangle=q(Q,`\\measuredangle `,`m&ang;`);var GY=J(Q,function(e,t){e.createLeftOf=function(e){e.options.autoSubscriptNumerals&&e.parent!==e.parent.parent.sub&&(e[Y]instanceof KY&&e[Y].isItalic!==!1||e[Y]instanceof xX&&e[Y][Y]instanceof KY&&e[Y][Y].isItalic!==!1)?(Z._().createLeftOf(e),t.createLeftOf.call(this,e),e.insRightOf(e.parent.parent)):t.createLeftOf.call(this,e)}}),KY=J(LY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<var>`+(n||e)+`</var>`)},e.text=function(){var e=this.ctrlSeq;return this.isPartOfOperator?e[0]==`\\`?e=e.slice(1,e.length):e[e.length-1]==` `&&(e=e.slice(0,-1)):(this[Y]&&!(this[Y]instanceof KY)&&!(this[Y]instanceof $)&&this[Y].ctrlSeq!==`\\ `&&(e=`*`+e),this[X]&&!(this[X]instanceof $)&&!(this[X]instanceof xX)&&(e+=`*`)),e}});bY.p.autoCommands={_maxLength:0},xY.autoCommands=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`autocommand "`+a+`" not minimum length of 2`;if(Z[a]===ZY)throw`"`+a+`" is a built-in operator name`;n[a]=1,r=nY(r,a.length)}return n._maxLength=r,n};var qY=J(KY,function(e,t){e.init=function(e){return t.init.call(this,this.letter=e)},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments);var n=e.options.autoCommands,r=n._maxLength;if(r>0){for(var i=``,a=this,o=0;a instanceof qY&&a.ctrlSeq===a.letter&&o<r;)i=a.letter+i,a=a[Y],o+=1;for(;i.length;){if(n.hasOwnProperty(i)){for(var o=1,a=this;o<i.length;o+=1,a=a[Y]);return pY(a,this).remove(),e[Y]=a[Y],Z[i](i).createLeftOf(e)}i=i.slice(1)}}},e.italicize=function(e){return this.isItalic=e,this.isPartOfOperator=!e,this.jQ.toggleClass(`mq-operator-name`,!e),this},e.finalizeTree=e.siblingDeleted=e.siblingCreated=function(e,t){t!==Y&&this[X]instanceof qY||this.autoUnItalicize(e)},e.autoUnItalicize=function(e){var t=e.autoOperatorNames;if(t._maxLength!==0){for(var r=this.letter,i=this[Y];i instanceof qY;i=i[Y])r=i.letter+r;for(var a=this[X];a instanceof qY;a=a[X])r+=a.letter;pY(i[X]||this.parent.ends[Y],a[Y]||this.parent.ends[X]).each(function(e){e.italicize(!0).jQ.removeClass(`mq-first mq-last mq-followed-by-supsub`),e.ctrlSeq=e.letter});outer:for(var o=0,s=i[X]||this.parent.ends[Y];o<r.length;o+=1,s=s[X])for(var c=tY(t._maxLength,r.length-o);c>0;--c){var l=r.slice(o,o+c);if(t.hasOwnProperty(l)){for(var u=0,d=s;u<c;u+=1,d=d[X]){d.italicize(!1);var f=d}var p=JY.hasOwnProperty(l);if(s.ctrlSeq=(p?`\\`:`\\operatorname{`)+s.ctrlSeq,f.ctrlSeq+=p?` `:`}`,XY.hasOwnProperty(l)&&f[Y][Y][Y].jQ.addClass(`mq-last`),n(s[Y])||s.jQ.addClass(`mq-first`),!n(f[X]))if(f[X]instanceof xX){var m=f[X];(m.siblingCreated=m.siblingDeleted=function(){m.jQ.toggleClass(`mq-after-operator-name`,!(m[X]instanceof AX))})()}else f.jQ.toggleClass(`mq-last`,!(f[X]instanceof AX));o+=c-1,s=f;continue outer}}}};function n(e){return!e||e instanceof $||e instanceof wX}}),JY={},YY=bY.p.autoOperatorNames={_maxLength:9},XY={limsup:1,liminf:1,projlim:1,injlim:1};(function(){for(var e=`arg deg det dim exp gcd hom inf ker lg ln log max min sup limsup liminf injlim projlim Pr`.split(` `),t=0;t<e.length;t+=1)JY[e[t]]=YY[e[t]]=1;for(var n=`sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth`.split(` `),t=0;t<n.length;t+=1)JY[n[t]]=1;for(var r=`sin cos tan sec cosec csc cotan cot ctg`.split(` `),t=0;t<r.length;t+=1)YY[r[t]]=YY[`arc`+r[t]]=YY[r[t]+`h`]=YY[`ar`+r[t]+`h`]=YY[`arc`+r[t]+`h`]=1;for(var i=`gcf hcf lcm proj span`.split(` `),t=0;t<i.length;t+=1)YY[i[t]]=1})(),xY.autoOperatorNames=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`"`+a+`" not minimum length of 2`;n[a]=1,r=nY(r,a.length)}return n._maxLength=r,n};var ZY=J(LY,function(e,t){e.init=function(e){this.ctrlSeq=e},e.createLeftOf=function(e){for(var t=this.ctrlSeq,n=0;n<t.length;n+=1)qY(t.charAt(n)).createLeftOf(e)},e.parser=function(){for(var e=this.ctrlSeq,t=RY(),n=0;n<e.length;n+=1)qY(e.charAt(n)).adopt(t,t.ends[X],0);return jY.succeed(t.children())}});for(var QY in YY)YY.hasOwnProperty(QY)&&(Z[QY]=ZY);Z.operatorname=J(IY,function(e){e.createLeftOf=rY,e.numBlocks=function(){return 1},e.parser=function(){return PY.block.map(function(e){return e.children()})}}),Z.f=J(qY,function(e,t){e.init=function(){LY.p.init.call(this,this.letter=`f`,`<var class="mq-f">f</var>`)},e.italicize=function(e){return this.jQ.html(`f`).toggleClass(`mq-f`,e),t.italicize.apply(this,arguments)}}),Z[` `]=Z.space=q(Q,`\\ `,`&nbsp;`),Z[`'`]=Z.prime=q(Q,`'`,`&prime;`),Z[`″`]=Z.dprime=q(Q,`″`,`&Prime;`),Z[`"`]=Z.doublePrime=q(Q,`"`,`&Prime;`),Z.backslash=q(Q,`\\backslash `,`\\`),mY[`\\`]||=Z.backslash,Z.$=q(Q,`\\$`,`$`);var $Y=J(LY,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span class="mq-nonSymbola">`+(n||e)+`</span>`)}});Z[`@`]=$Y,Z[`&`]=q($Y,`\\&`,`&amp;`),Z[`%`]=q($Y,`\\%`,`%`),Z.alpha=Z.beta=Z.gamma=Z.delta=Z.zeta=Z.eta=Z.theta=Z.iota=Z.kappa=Z.mu=Z.nu=Z.xi=Z.rho=Z.sigma=Z.tau=Z.chi=Z.psi=Z.omega=J(KY,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.phi=q(KY,`\\phi `,`&#981;`),Z.phiv=Z.varphi=q(KY,`\\varphi `,`&phi;`),Z.epsilon=q(KY,`\\epsilon `,`&#1013;`),Z.epsiv=Z.varepsilon=q(KY,`\\varepsilon `,`&epsilon;`),Z.piv=Z.varpi=q(KY,`\\varpi `,`&piv;`),Z.sigmaf=Z.sigmav=Z.varsigma=q(KY,`\\varsigma `,`&sigmaf;`),Z.thetav=Z.vartheta=Z.thetasym=q(KY,`\\vartheta `,`&thetasym;`),Z.upsilon=Z.upsi=q(KY,`\\upsilon `,`&upsilon;`),Z.gammad=Z.Gammad=Z.digamma=q(KY,`\\digamma `,`&#989;`),Z.kappav=Z.varkappa=q(KY,`\\varkappa `,`&#1008;`),Z.rhov=Z.varrho=q(KY,`\\varrho `,`&#1009;`),Z.pi=Z.π=q($Y,`\\pi `,`&pi;`),Z.lambda=q($Y,`\\lambda `,`&lambda;`),Z.Upsilon=Z.Upsi=Z.upsih=Z.Upsih=q(LY,`\\Upsilon `,`<var style="font-family: serif">&upsih;</var>`),Z.Gamma=Z.Delta=Z.Theta=Z.Lambda=Z.Xi=Z.Pi=Z.Sigma=Z.Phi=Z.Psi=Z.Omega=J(Q,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.forall=Z[`∀`]=q(Q,`\\forall `,`&#8704;`);var eX=J(IY,function(e){e.init=function(e){this.latex=e},e.createLeftOf=function(e){var t=PY.parse(this.latex);t.children().adopt(e.parent,e[Y],e[X]),e[Y]=t.ends[X],t.jQize().insertBefore(e.jQ),t.finalizeInsert(e.options,e),t.ends[X][X].siblingCreated&&t.ends[X][X].siblingCreated(e.options,Y),t.ends[Y][Y].siblingCreated&&t.ends[Y][Y].siblingCreated(e.options,X),e.parent.bubble(`reflow`)},e.parser=function(){var e=PY.parse(this.latex).children();return jY.succeed(e)}});Z[`¹`]=q(eX,`^1`),Z[`²`]=q(eX,`^2`),Z[`³`]=q(eX,`^3`),Z[`¼`]=q(eX,`\\frac14`),Z[`½`]=q(eX,`\\frac12`),Z[`¾`]=q(eX,`\\frac34`);var tX=J($,function(e){e.init=Q.prototype.init,e.contactWeld=e.siblingCreated=e.siblingDeleted=function(e,t){function n(e){if(e[Y]){if(e[Y]instanceof $||/^[,;:\(\[]$/.test(e[Y].ctrlSeq))return``}else if(e.parent&&e.parent.parent&&e.parent.parent.isStyleBlock())return n(e.parent.parent);else return``;return`mq-binary-operator`}if(t!==X)return this.jQ[0].className=n(this),this}});Z[`+`]=q(tX,`+`,`+`),Z[`–`]=Z[`-`]=q(tX,`-`,`&minus;`),Z[`±`]=Z.pm=Z.plusmn=Z.plusminus=q(tX,`\\pm `,`&plusmn;`),Z.mp=Z.mnplus=Z.minusplus=q(tX,`\\mp `,`&#8723;`),mY[`*`]=Z.sdot=Z.cdot=q($,`\\cdot `,`&middot;`,`*`);var nX=J($,function(e,t){e.init=function(e,n){this.data=e,this.strict=n;var r=n?`Strict`:``;t.init.call(this,e[`ctrlSeq`+r],e[`html`+r],e[`text`+r])},e.swap=function(e){this.strict=e;var t=e?`Strict`:``;this.ctrlSeq=this.data[`ctrlSeq`+t],this.jQ.html(this.data[`html`+t]),this.textTemplate=[this.data[`text`+t]]},e.deleteTowards=function(e,n){if(e===Y&&!this.strict){this.swap(!0),this.bubble(`reflow`);return}t.deleteTowards.apply(this,arguments)}}),rX={ctrlSeq:`\\le `,html:`&le;`,text:`≤`,ctrlSeqStrict:`<`,htmlStrict:`&lt;`,textStrict:`<`},iX={ctrlSeq:`\\ge `,html:`&ge;`,text:`≥`,ctrlSeqStrict:`>`,htmlStrict:`&gt;`,textStrict:`>`};Z[`<`]=Z.lt=q(nX,rX,!0),Z[`>`]=Z.gt=q(nX,iX,!0),Z[`≤`]=Z.le=Z.leq=q(nX,rX,!1),Z[`≥`]=Z.ge=Z.geq=q(nX,iX,!1);var aX=J($,function(e,t){e.init=function(){t.init.call(this,`=`,`=`)},e.createLeftOf=function(e){if(e[Y]instanceof nX&&e[Y].strict){e[Y].swap(!1),e[Y].bubble(`reflow`);return}t.createLeftOf.apply(this,arguments)}});Z[`=`]=aX,Z[`×`]=Z.times=q($,`\\times `,`&times;`,`[x]`),Z[`÷`]=Z.div=Z.divide=Z.divides=q($,`\\div `,`&divide;`,`[/]`),mY[`~`]=Z.sim=q($,`\\sim `,`~`,`~`),mY[`≁`]=Z.nsim=q($,`\\nsim `,`≁`,`≁`),Z.complement=Z[`∁`]=q(Q,`\\complement `,`&#8705;`),Z.nexists=Z[`∄`]=q(Q,`\\nexists `,`&#8708;`),Z.sphericalangle=Z[`∢`]=q(Q,`\\sphericalangle `,`&#8738;`),Z.iint=Z[`∬`]=q(Q,`\\iint `,`&#8748;`),Z.iiint=Z[`∭`]=q(Q,`\\iiint `,`&#8749;`),Z.oiint=Z[`∯`]=q(Q,`\\oiint `,`&#8751;`),Z.oiiint=Z[`∰`]=q(Q,`\\oiiint `,`&#8752;`),Z.backsim=Z[`∽`]=q(Q,`\\backsim `,`&#8765;`),Z.backsimeq=Z[`⋍`]=q(Q,`\\backsimeq `,`&#8909;`),Z.eqsim=Z[`≂`]=q(Q,`\\eqsim `,`&#8770;`),Z.ncong=Z[`≇`]=q(Q,`\\ncong `,`&#8775;`),Z.approxeq=Z[`≊`]=q(Q,`\\approxeq `,`&#8778;`),Z.bumpeq=Z[`≏`]=q(Q,`\\bumpeq `,`&#8783;`),Z.Bumpeq=Z[`≎`]=q(Q,`\\Bumpeq `,`&#8782;`),Z.doteqdot=Z[`≑`]=q(Q,`\\doteqdot `,`&#8785;`),Z.fallingdotseq=Z[`≒`]=q(Q,`\\fallingdotseq `,`&#8786;`),Z.risingdotseq=Z[`≓`]=q(Q,`\\risingdotseq `,`&#8787;`),Z.eqcirc=Z[`≖`]=q(Q,`\\eqcirc `,`&#8790;`),Z.circeq=Z[`≗`]=q(Q,`\\circeq `,`&#8791;`),Z.triangleq=Z[`≜`]=q(Q,`\\triangleq `,`&#8796;`),Z.leqq=Z[`≦`]=q(Q,`\\leqq `,`&#8806;`),Z.geqq=Z[`≧`]=q(Q,`\\geqq `,`&#8807;`),Z.lneqq=Z[`≨`]=q(Q,`\\lneqq `,`&#8808;`),Z.gneqq=Z[`≩`]=q(Q,`\\gneqq `,`&#8809;`),Z.between=Z[`≬`]=q(Q,`\\between `,`&#8812;`),Z.nleq=Z[`≰`]=q(Q,`\\nleq `,`&#8816;`),Z.ngeq=Z[`≱`]=q(Q,`\\ngeq `,`&#8817;`),Z.lesssim=Z[`≲`]=q(Q,`\\lesssim `,`&#8818;`),Z.gtrsim=Z[`≳`]=q(Q,`\\gtrsim `,`&#8819;`),Z.lessgtr=Z[`≶`]=q(Q,`\\lessgtr `,`&#8822;`),Z.gtrless=Z[`≷`]=q(Q,`\\gtrless `,`&#8823;`),Z.preccurlyeq=Z[`≼`]=q(Q,`\\preccurlyeq `,`&#8828;`),Z.succcurlyeq=Z[`≽`]=q(Q,`\\succcurlyeq `,`&#8829;`),Z.precsim=Z[`≾`]=q(Q,`\\precsim `,`&#8830;`),Z.succsim=Z[`≿`]=q(Q,`\\succsim `,`&#8831;`),Z.nprec=Z[`⊀`]=q(Q,`\\nprec `,`&#8832;`),Z.nsucc=Z[`⊁`]=q(Q,`\\nsucc `,`&#8833;`),Z.subsetneq=Z[`⊊`]=q(Q,`\\subsetneq `,`&#8842;`),Z.supsetneq=Z[`⊋`]=q(Q,`\\supsetneq `,`&#8843;`),Z.vDash=Z[`⊨`]=q(Q,`\\vDash `,`&#8872;`),Z.Vdash=Z[`⊩`]=q(Q,`\\Vdash `,`&#8873;`),Z.Vvdash=Z[`⊪`]=q(Q,`\\Vvdash `,`&#8874;`),Z.VDash=Z[`⊫`]=q(Q,`\\VDash `,`&#8875;`),Z.nvdash=Z[`⊬`]=q(Q,`\\nvdash `,`&#8876;`),Z.nvDash=Z[`⊭`]=q(Q,`\\nvDash `,`&#8877;`),Z.nVdash=Z[`⊮`]=q(Q,`\\nVdash `,`&#8878;`),Z.nVDash=Z[`⊯`]=q(Q,`\\nVDash `,`&#8879;`),Z.vartriangleleft=Z[`⊲`]=q(Q,`\\vartriangleleft `,`&#8882;`),Z.vartriangleright=Z[`⊳`]=q(Q,`\\vartriangleright `,`&#8883;`),Z.trianglelefteq=Z[`⊴`]=q(Q,`\\trianglelefteq `,`&#8884;`),Z.trianglerighteq=Z[`⊵`]=q(Q,`\\trianglerighteq `,`&#8885;`),Z.multimap=Z[`⊸`]=q(Q,`\\multimap `,`&#8888;`),Z.Subset=Z[`⋐`]=q(Q,`\\Subset `,`&#8912;`),Z.Supset=Z[`⋑`]=q(Q,`\\Supset `,`&#8913;`),Z.Cap=Z[`⋒`]=q(Q,`\\Cap `,`&#8914;`),Z.Cup=Z[`⋓`]=q(Q,`\\Cup `,`&#8915;`),Z.pitchfork=Z[`⋔`]=q(Q,`\\pitchfork `,`&#8916;`),Z.lessdot=Z[`⋖`]=q(Q,`\\lessdot `,`&#8918;`),Z.gtrdot=Z[`⋗`]=q(Q,`\\gtrdot `,`&#8919;`),Z.lll=Z[`⋘`]=q(Q,`\\lll `,`&#8920;`),Z.ggg=Z[`⋙`]=q(Q,`\\ggg `,`&#8921;`),Z.lesseqgtr=Z[`⋚`]=q(Q,`\\lesseqgtr `,`&#8922;`),Z.gtreqless=Z[`⋛`]=q(Q,`\\gtreqless `,`&#8923;`),Z.curlyeqprec=Z[`⋞`]=q(Q,`\\curlyeqprec `,`&#8926;`),Z.curlyeqsucc=Z[`⋟`]=q(Q,`\\curlyeqsucc `,`&#8927;`),Z.nsim=Z[`≁`]=q(Q,`\\nsim `,`&#8769;`),Z.lnsim=Z[`⋦`]=q(Q,`\\lnsim `,`&#8934;`),Z.gnsim=Z[`⋧`]=q(Q,`\\gnsim `,`&#8935;`),Z.precnsim=Z[`⋨`]=q(Q,`\\precnsim `,`&#8936;`),Z.succnsim=Z[`⋩`]=q(Q,`\\succnsim `,`&#8937;`),Z.ntriangleleft=Z[`⋪`]=q(Q,`\\ntriangleleft `,`&#8938;`),Z.ntriangleright=Z[`⋫`]=q(Q,`\\ntriangleright `,`&#8939;`),Z.ntrianglelefteq=Z[`⋬`]=q(Q,`\\ntrianglelefteq `,`&#8940;`),Z.ntrianglerighteq=Z[`⋭`]=q(Q,`\\ntrianglerighteq `,`&#8941;`),Z.blacksquare=Z[`∎`]=q(Q,`\\blacksquare `,`&#8718;`),Z.colon=Z[`∶`]=q(Q,`\\colon `,`&#8758;`),Z.llcorner=Z[`∟`]=q(Q,`\\llcorner `,`&#8735;`),Z.dotplus=Z[`∔`]=q($,`\\dotplus `,`&#8724;`),Z.nmid=Z[`∤`]=q($,`
330
+ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`⊻`]=q($,`\\veebar `,`&#8891;`),Z.barwedge=Z[`⊼`]=q($,`\\barwedge `,`&#8892;`),Z.ltimes=Z[`⋉`]=q($,`\\ltimes `,`&#8905;`),Z.rtimes=Z[`⋊`]=q($,`\\rtimes `,`&#8906;`),Z.leftthreetimes=Z[`⋋`]=q($,`\\leftthreetimes `,`&#8907;`),Z.rightthreetimes=Z[`⋌`]=q($,`\\rightthreetimes `,`&#8908;`),Z.curlyvee=Z[`⋎`]=q($,`\\curlyvee `,`&#8910;`),Z.curlywedge=Z[`⋏`]=q($,`\\curlywedge `,`&#8911;`),Z.circledcirc=Z[`⊚`]=q($,`\\circledcirc `,`&#8858;`),Z.circledast=Z[`⊛`]=q($,`\\circledast `,`&#8859;`),Z.circleddash=Z[`⊝`]=q($,`\\circleddash `,`&#8861;`),Z.boxplus=Z[`⊞`]=q($,`\\boxplus `,`&#8862;`),Z.boxminus=Z[`⊟`]=q($,`\\boxminus `,`&#8863;`),Z.boxtimes=Z[`⊠`]=q($,`\\boxtimes `,`&#8864;`),Z.boxdot=Z[`⊡`]=q($,`\\boxdot `,`&#8865;`),Z[`∂`]=Z.partial,Z[`∃`]=Z.exists,Z[`∅`]=Z.varnothing,Z[`∆`]=Z.triangle,Z[`∇`]=Z.nabla,Z[`∈`]=Z.in,Z[`∊`]=Z.in,Z[`∋`]=Z.ni,Z[`∌`]=Z.notni,Z[`∍`]=Z.ni,Z[`∐`]=Z.amalg,Z[`−`]=Z[`-`],Z[`∓`]=Z.mp,Z[`∖`]=Z.setminus,Z[`∘`]=Z.circ,Z[`∙`]=Z.bullet,Z[`∝`]=Z.propto,Z[`∞`]=Z.infty,Z[`∠`]=Z.angle,Z[`∡`]=Z.measuredangle,Z[`∣`]=Z.divides,Z[`∥`]=Z.parallel,Z[`∦`]=Z.nparallel,Z[`∧`]=Z.wedge,Z[`∨`]=Z.vee,Z[`∩`]=Z.cap,Z[`∪`]=Z.cup,Z[`∮`]=Z.oint,Z[`∴`]=Z.therefore,Z[`∵`]=Z.because,Z[`∼`]=Z.sim,Z[`≀`]=Z.wr,Z[`≃`]=Z.simeq,Z[`≍`]=Z.asymp,Z[`≐`]=Z.doteq,Z[`≪`]=Z.ll,Z[`≫`]=Z.gg,Z[`≺`]=Z.prec,Z[`≻`]=Z.succ,Z[`⊂`]=Z.subset,Z[`⊃`]=Z.supset,Z[`⊆`]=Z.subseteq,Z[`⊇`]=Z.supseteq,Z[`⊈`]=Z.nsubseteq,Z[`⊉`]=Z.nsupseteq,Z[`⊏`]=Z.sqsubset,Z[`⊐`]=Z.sqsupset,Z[`⊓`]=Z.sqcap,Z[`⊔`]=Z.sqcup,Z[`⊖`]=Z.ominus,Z[`⊘`]=Z.oslash,Z[`⊙`]=Z.odot,Z[`⊢`]=Z.vdash,Z[`⊣`]=Z.dashv,Z[`⊤`]=Z.top,Z[`⊥`]=Z.bot,Z[`⊧`]=Z.models,Z[`⋀`]=Z.wedge,Z[`⋁`]=Z.vee,Z[`⋂`]=Z.cap,Z[`⋃`]=Z.cup,Z[`⋄`]=Z.diamond,Z[`⋅`]=Z.cdot,Z[`⋆`]=Z.star,Z[`⋈`]=Z.bowtie,Z[`⋮`]=Z.vdots,Z[`⋯`]=Z.cdots,Z[`⋱`]=Z.ddots;var oX,sX=rY,cX=document.createElement(`div`).style,lX={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1},uX;for(var dX in lX)if(dX in cX){uX=dX;break}uX?oX=function(e,t,n){e.css(uX,`scale(`+t+`,`+n+`)`)}:`filter`in cX?(sX=function(e){e.className=e.className},oX=function(e,t,n){t/=1+(n-1)/2,e.css(`fontSize`,n+`em`),e.hasClass(`mq-matrixed-container`)||e.addClass(`mq-matrixed-container`).wrapInner(`<span class="mq-matrixed"></span>`);var r=e.children().css(`filter`,`progid:DXImageTransform.Microsoft.Matrix(M11=`+t+`,SizingMethod='auto expand')`);function i(){e.css(`marginRight`,(r.width()-1)*(t-1)/t+`px`)}i();var a=setInterval(i);XJ(window).load(function(){clearTimeout(a),i()})}):oX=function(e,t,n){e.css(`fontSize`,n+`em`)};var fX=J(IY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`>&0</`+n+`>`)}}),pX=J(IY,function(e,t){e.init=function(e,n,r){this.args=arguments,this.htmlTemplate=`<`+n+` `+r+`><`+n+` class="mq-xarrow-over">&0</`+n+`><`+n+` class="mq-xarrow-under"></`+n+`></`+n+`>`,t.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`(`,`)`]},e.parser=function(){var e=this;return PY.optBlock.then(function(t){return PY.block.map(function(n){var r=mX.apply(null,e.args);return r.blocks=[t,n],t.adopt(r,0,0),n.adopt(r,t,0),r})}).or(t.parser.call(this))}}),mX=J(pX,function(e,t){e.init=function(e,t,n){this.htmlTemplate=`<`+t+` `+n+`><`+t+` class="mq-xarrow-over">&1</`+t+`><`+t+` class="mq-xarrow-under">&0</`+t+`></`+t+`>`,IY.prototype.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`[`,`](`,`)`]},e.latex=function(){return this.ctrlSeq+`[`+this.ends[Y].latex()+`]{`+this.ends[X].latex()+`}`},e.finalizeTree=function(){this.downInto=this.ends[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),hX=function(e){var t=`<span class="`+e+`-inner-right">g</span><span class="`+e+`-inner-left">h</span>`;return J(IY,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`<span class="mq-empty-box">&0</span></`+i+`></`+i+`>`)}})},gX=J(IY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`><span class="mq-longdiv-curve-border">)</span><span class="mq-longdiv-inner"><span class="mq-empty">&0</span></`+n+`></span>`)}}),_X=J(IY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-row"><p>`+r+`</p><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td><td class="mq-empty"></td><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),vX=J(IY,function(e,t){e.init=function(e){t.init.call(this,e,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),yX=J(IY,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-col"><p>`+r+`</p></span><span class="matrix-edit-content-col"><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),bX=function(e,t){return J(LY,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`</`+i+`></`+i+`>`)}})};Z.mathrm=q(fX,`\\mathrm`,`span`,`class="mq-roman mq-font"`),Z.mathit=q(fX,`\\mathit`,`i`,`class="mq-font"`),Z.mathbf=q(fX,`\\mathbf`,`b`,`class="mq-font"`),Z.mathsf=q(fX,`\\mathsf`,`span`,`class="mq-sans-serif mq-font"`),Z.mathtt=q(fX,`\\mathtt`,`span`,`class="mq-monospace mq-font"`),Z.underline=q(fX,`\\underline`,`span`,`class="mq-non-leaf mq-underline"`),Z.overline=Z.bar=q(hX(`mq-overline`),`\\overline`,`span`,`class="mq-non-leaf mq-overline"`),Z.longdiv=q(gX,`\\longdiv`,`span`,`class="mq-non-leaf mq-longdiv"`),Z.overrightarrow=q(hX(`mq-overarrow`),`\\overrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-right"`),Z.overleftarrow=q(hX(`mq-overarrow`),`\\overleftarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-left"`),Z.xleftarrow=q(pX,`\\xleftarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-left"`),Z.xrightarrow=q(pX,`\\xrightarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-right"`),Z.overleftrightarrow=q(fX,`\\overleftrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-both"`),Z.overarc=q(fX,`\\overarc`,`span`,`class="mq-non-leaf mq-overarc"`),Z.dot=J(IY,function(e,t){e.init=function(){t.init.call(this,`\\dot`,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),Z.addmatrixrow=q(_X,`\\addmatrixrow`,`span`,`+`),Z.addmatrixcol=q(yX,`\\addmatrixcol`,`span`,`+`),Z.ngtr=Z[`≯`]=q(bX(`mq-ngtr`,`&#8815;`),`\\ngtr `,`span`,`class="mq-non-leaf mq-ngtr"`),Z.nless=Z[`≮`]=q(bX(`mq-nless`,`&#8814;`),`\\nless `,`span`,`class="mq-non-leaf mq-nless"`),Z.dot=q(vX,`\\dot`),Z.parallelogram=q(bX(`mq-parallelogram`,`&#9649;`),`\\parallelogram `,`span`,`class="mq-non-leaf mq-parallelogram"`),Z.textcolor=J(IY,function(e,t){e.setColor=function(e){this.color=e,this.htmlTemplate=`<span class="mq-textcolor" style="color:`+e+`">&0</span>`},e.latex=function(){return`\\textcolor{`+this.color+`}{`+this.blocks[0].latex()+`}`},e.parser=function(){var e=this,n=jY.optWhitespace,r=jY.string,i=jY.regex;return n.then(r(`{`)).then(i(/^[#\w\s.,()%-]*/)).skip(r(`}`)).then(function(n){return e.setColor(n),t.parser.call(e)})},e.isStyleBlock=function(){return!0}}),Z.class=J(IY,function(e,t){e.parser=function(){var e=this,n=jY.string,r=jY.regex;return jY.optWhitespace.then(n(`{`)).then(r(/^[-\w\s\\\xA0-\xFF]*/)).skip(n(`}`)).then(function(n){return e.cls=n||``,e.htmlTemplate=`<span class="mq-class `+n+`">&0</span>`,t.parser.call(e)})},e.latex=function(){return`\\class{`+this.cls+`}{`+this.blocks[0].latex()+`}`},e.isStyleBlock=function(){return!0}});var xX=J(IY,function(e,t){e.ctrlSeq=`_{...}^{...}`,e.createLeftOf=function(e){if(!(!this.replacedFragment&&!e[Y]&&e.options.supSubsRequireOperand))return t.createLeftOf.apply(this,arguments)},e.contactWeld=function(e){for(var t=Y;t;t=t===Y&&X)if(this[t]instanceof xX){for(var n=`sub`;n;n=n===`sub`&&`sup`){var r=this[n],i=this[t][n];if(r){if(!i)this[t].addBlock(r.disown());else if(r.isEmpty())var a=uY(i,0,i.ends[Y]);else{r.jQ.children().insAtDirEnd(-t,i.jQ);var o=r.children().disown(),a=uY(i,o.ends[X],i.ends[Y]);t===Y?o.adopt(i,i.ends[X],0):o.adopt(i,0,i.ends[Y])}this.placeCursor=function(e,n){return function(r){r.insAtDirEnd(-t,e||n)}}(i,r)}}this.remove(),e&&e[Y]===this&&(t===X&&a?a[Y]?e.insRightOf(a[Y]):e.insAtLeftEnd(a.parent):e.insRightOf(this[t]));break}},bY.p.charsThatBreakOutOfSupSub=``,e.finalizeTree=function(){this.ends[Y].write=function(e,t){if(e.options.autoSubscriptNumerals&&this===this.parent.sub){if(t===`_`)return;var n=this.chToCmd(t,e.options);return n instanceof LY?e.deleteSelection():e.clearSelection().insRightOf(this.parent),n.createLeftOf(e.show())}e[Y]&&!e[X]&&!e.selection&&e.options.charsThatBreakOutOfSupSub.indexOf(t)>-1&&e.insRightOf(this.parent),RY.p.write.apply(this,arguments)}},e.moveTowards=function(e,n,r){n.options.autoSubscriptNumerals&&!this.sup?n.insDirOf(e,this):t.moveTowards.apply(this,arguments)},e.deleteTowards=function(e,n){if(n.options.autoSubscriptNumerals&&this.sub){var r=this.sub.ends[-e];r instanceof LY?r.remove():r&&r.deleteTowards(e,n.insAtDirEnd(-e,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(Y,n.insAtLeftEnd(this.sub)),this.sup&&n.insDirOf(-e,this))}else t.deleteTowards.apply(this,arguments)},e.latex=function(){function e(e,t){var n=t&&t.latex();return t?e+(n.length===1?n:`{`+(n||` `)+`}`):``}return e(`_`,this.sub)+e(`^`,this.sup)},e.addBlock=function(e){this.supsub===`sub`?(this.sup=this.upInto=this.sub.upOutOf=e,e.adopt(this,this.sub,0).downOutOf=this.sub,e.jQ=XJ(`<span class="mq-sup"/>`).append(e.jQ.children()).attr(eY,e.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=e,e.adopt(this,0,this.sup).upOutOf=this.sup,e.jQ=XJ(`<span class="mq-sub"></span>`).append(e.jQ.children()).attr(eY,e.id).appendTo(this.jQ.removeClass(`mq-sup-only`)),this.jQ.append(`<span style="display:inline-block;width:0">&#8203;</span>`));for(var t=0;t<2;t+=1)(function(e,t,n,r){e[t].deleteOutOf=function(i,a){if(a.insDirOf(this[i]?-i:i,this.parent),!this.isEmpty()){var o=this.ends[i];this.children().disown().withDirAdopt(i,a.parent,a[i],a[-i]).jQ.insDirOf(-i,a.jQ),a[-i]=o}e.supsub=n,delete e[t],delete e[r+`Into`],e[n][r+`OutOf`]=SX,delete e[n].deleteOutOf,t===`sub`&&XJ(e.jQ.addClass(`mq-sup-only`)[0].lastChild).remove(),this.remove()}})(this,`sub sup`.split(` `)[t],`sup sub`.split(` `)[t],`down up`.split(` `)[t])},e.reflow=function(){var e=this.jQ,t=e.prev();if(t.length){var n=e.children(`.mq-sup`);if(n.length){var r=parseInt(n.css(`font-size`)),i=n.offset().top+n.height()-t.offset().top-.7*r,a=parseInt(n.css(`margin-bottom`));n.css(`margin-bottom`,a+i)}}}});function SX(e){var t=this.parent,n=e;do{if(n[X])return e.insLeftOf(t);n=n.parent.parent}while(n!==t);e.insRightOf(t)}Z.subscript=Z._=J(xX,function(e,t){e.supsub=`sub`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&0</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`_`],e.finalizeTree=function(){this.downInto=this.sub=this.ends[Y],this.sub.upOutOf=SX,t.finalizeTree.call(this)}}),Z.superscript=Z.supscript=Z[`^`]=J(xX,function(e,t){e.supsub=`sup`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`^`],e.finalizeTree=function(){this.upInto=this.sup=this.ends[X],this.sup.downOutOf=SX,t.finalizeTree.call(this)}});var CX=J(IY,function(e,t){e.parser=function(){for(var e=jY.string,t=jY.optWhitespace,n=jY.succeed,r=PY.block,i=this,a=i.blocks=[RY(),RY()],o=0;o<a.length;o+=1)a[o].adopt(i,i.ends[X],0);return t.then(e(`_`).or(e(`^`))).then(function(e){var t=a[e===`_`?0:1];return r.then(function(e){return e.children().adopt(t,t.ends[X],0),n(i)})}).many().result(i)},e.finalizeTree=function(){this.downInto=this.ends[Y],this.upInto=this.ends[X],this.ends[Y].upOutOf=this.ends[X],this.ends[X].downOutOf=this.ends[Y]}}),wX=J(CX,function(e,t){e.init=function(e,t){var n=`<span class="mq-large-operator mq-non-leaf"><span class="mq-to"><span>&1</span></span><big>`+t+`</big><span class="mq-from"><span>&0</span></span></span>`;LY.prototype.init.call(this,e,n)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())+`^`+e(this.ends[X].latex())},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments),e.options.sumStartsWithNEquals&&(qY(`n`).createLeftOf(e),aX().createLeftOf(e))}});Z[`∑`]=Z.sum=Z.summation=q(wX,`\\sum `,`&sum;`),Z[`∏`]=Z.prod=Z.product=q(wX,`\\prod `,`&prod;`),Z.coprod=Z.coproduct=q(wX,`\\coprod `,`&#8720;`),Z[`∫`]=Z.int=Z.integral=J(wX,function(e,t){e.init=function(){LY.prototype.init.call(this,`\\int `,`<span class="mq-int mq-non-leaf"><big>&int;</big><span class="mq-supsub mq-non-leaf"><span class="mq-sup"><span class="mq-sup-inner">&1</span></span><span class="mq-sub">&0</span><span style="display:inline-block;width:0">&#8203</span></span></span>`)},e.createLeftOf=IY.p.createLeftOf}),Z.lim=Z.limit=J(CX,function(e,t){e.init=function(){LY.prototype.init.call(this,`\\lim `,`<span class="mq-lim mq-non-leaf"><span class="mq-un-italicized">lim</span><span class="mq-approaches"><span>&0</span></span></span>`)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())}});var TX=Z.over=mY[`/`]=J(Z.frac=Z.dfrac=Z.cfrac=Z.fraction=J(IY,function(e,t){e.ctrlSeq=`\\frac`,e.htmlTemplate=`<span class="mq-fraction mq-non-leaf"><span class="mq-numerator"><span class="mq-empty-box">&0</span></span><span class="mq-denominator"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`(`,`)/(`,`)`],e.finalizeTree=function(){this.upInto=this.ends[X].upOutOf=this.ends[Y],this.downInto=this.ends[Y].downOutOf=this.ends[X]}}),function(e,t){e.createLeftOf=function(e){if(!this.replacedFragment){for(var n=e[Y];n&&!(n instanceof $||n instanceof(Z.text||rY)||n instanceof wX||n.ctrlSeq===`\\ `||/^[,;:]$/.test(n.ctrlSeq));)n=n[Y];n instanceof wX&&n[X]instanceof xX&&(n=n[X],n[X]instanceof xX&&n[X].ctrlSeq!=n.ctrlSeq&&(n=n[X])),n!==e[Y]&&!e.isTooDeep(1)&&(this.replaces(pY(n[X]||e.parent.ends[Y],e[Y])),e[Y]=n)}t.createLeftOf.call(this,e)}});Z.underset=J(IY,function(e,t){e.ctrlSeq=`\\underset`,e.htmlTemplate=`<span class="mq-underset mq-overunder mq-non-leaf"><span class="mq-over">&1</span><span class="mq-under">&0</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),Z.overset=J(IY,function(e,t){e.ctrlSeq=`\\overset`,e.htmlTemplate=`<span class="mq-overset mq-overunder mq-non-leaf"><span class="mq-over">&0</span><span class="mq-under">&1</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[X].upOutOf=this.ends[Y],this.upInto=this.ends[Y].downOutOf=this.ends[X]}});var EX=Z.sqrt=Z[`√`]=J(IY,function(e,t){e.ctrlSeq=`\\sqrt`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-sqrt-prefix">&radic;</span><span class="mq-non-leaf mq-sqrt-stem"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt(`,`)`],e.parser=function(){return PY.optBlock.then(function(e){return PY.block.map(function(t){var n=DX();return n.blocks=[e,t],e.adopt(n,0,0),t.adopt(n,e,0),n})}).or(t.parser.call(this))},e.reflow=function(){var e=this.ends[X].jQ.parent();oX(e.prev(),1,e.innerHeight()/+e.css(`fontSize`).slice(0,-2)-.1)}});Z.hat=J(IY,function(e,t){e.ctrlSeq=`\\hat`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-hat-prefix">^</span><span class="mq-hat-stem">&0</span></span>`,e.textTemplate=[`hat(`,`)`]});var DX=Z.nthroot=J(EX,function(e,t){e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">&0</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&1</span></span></span>`,e.textTemplate=[`sqrt[`,`](`,`)`],e.latex=function(){return`\\sqrt[`+this.ends[Y].latex()+`]{`+this.ends[X].latex()+`}`}}),OX=J(IY,function(e,t){e.init=function(e,n,r){var i=`<span class="mq-non-leaf"><span class="mq-diacritic-above">`+n+`</span><span class="mq-diacritic-stem">&0</span></span>`;t.init.call(this,e,i,r)}});Z.vec=q(OX,`\\vec`,`&rarr;`,[`vec(`,`)`]),Z.tilde=q(OX,`\\tilde`,`~`,[`tilde(`,`)`]),Z.lrncuberoot=J(EX,function(e,t){e.ctrlSeq=`\\lrncuberoot`,e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">3</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt[3](`,`)`],e.latex=function(){return`\\sqrt[3]{`+this.ends[Y].latex()+`}`}}),Z.abs=J(IY,function(e){e.ctrlSeq=`\\abs`,e.htmlTemplate=`<span class="mq-abs mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[`|`,`|`]}),Z.lrnplaceholder=J(IY,function(e,t){e.ctrlSeq=`\\lrnplaceholder`,e.htmlTemplate=`<span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[``],e.latex=function(){return this.ends[Y].latex()}}),Z.lrnexponent=J(IY,function(e,t){e.ctrSeq=`\\lrnexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&1</span></span></span></span>`,e.textTemplate=[``,`**`],e.latex=function(){var e=this.ends[X].latex();return e.length>1?e=`{`+e+`}`:e.length===0&&(e=`{ }`),this.ends[Y].latex()+`^`+e}}),Z.lrnsquaredexponent=J(IY,function(e,t){e.ctrSeq=`\\lrnsquaredexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">2</span></span></span></span>`,e.textTemplate=[``,`**2`],e.latex=function(){return this.ends[Y].latex()+`^2`}}),Z.lrnsubscript=J(IY,function(e,t){e.ctrSeq=`\\lrnsubscript`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&nbsp;</span></span></span>`,e.textTemplate=[``,`_`],e.latex=function(){return this.ends[Y].latex()+`_`+this.ends[X].latex()}});function kX(e,t){e.jQadd=function(){t.jQadd.apply(this,arguments),this.delimjQs=this.jQ.children(`:first`).add(this.jQ.children(`:last`)),this.contentjQ=this.jQ.children(`:eq(1)`)},e.reflow=function(){var e=this.contentjQ.outerHeight()/parseFloat(this.contentjQ.css(`fontSize`));oX(this.delimjQs,tY(1+.2*(e-1),1.2),1.2*e)}}var AX=J(J(IY,kX),function(e,t){e.init=function(e,n,r,i,a){t.init.call(this,`\\left`+i,QJ,[n,r]),this.side=e,this.sides={},this.sides[Y]={ch:n,ctrlSeq:i},this.sides[X]={ch:r,ctrlSeq:a}},e.numBlocks=function(){return 1},e.html=function(){return this.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-paren`+(this.side===X?` mq-ghost`:``)+`">`+this.sides[Y].ch+`</span><span class="mq-non-leaf">&0</span><span class="mq-scaled mq-paren`+(this.side===Y?` mq-ghost`:``)+`">`+this.sides[X].ch+`</span></span>`,t.html.call(this)},e.latex=function(){return`\\left`+this.sides[Y].ctrlSeq+this.ends[Y].latex()+`\\right`+this.sides[X].ctrlSeq},e.matchBrack=function(e,t,n){return n instanceof AX&&n.side&&n.side!==-t&&(!e.restrictMismatchedBrackets||jX[this.sides[this.side].ch]===n.sides[n.side].ch||{"(":`]`,"[":`)`}[this.sides[Y].ch]===n.sides[X].ch)&&n},e.closeOpposing=function(e){e.side=0,e.sides[this.side]=this.sides[this.side],e.delimjQs.eq(this.side===Y?0:1).removeClass(`mq-ghost`).html(this.sides[this.side].ch)},e.createLeftOf=function(e){if(!this.replacedFragment){var n=e.options;if(this.sides[Y].ch===`|`)var r=this.matchBrack(n,X,e[X])||this.matchBrack(n,Y,e[Y])||this.matchBrack(n,0,e.parent.parent);else var r=this.matchBrack(n,-this.side,e[-this.side])||this.matchBrack(n,-this.side,e.parent.parent)}if(r){var i=this.side=-r.side;this.closeOpposing(r),r===e.parent.parent&&e[i]&&pY(e[i],e.parent.ends[i],-i).disown().withDirAdopt(-i,r.parent,r,r[i]).jQ.insDirOf(i,r.jQ),r.bubble(`reflow`)}else r=this,i=r.side,r.replacedFragment?r.side=0:e[-i]&&(r.replaces(pY(e[-i],e.parent.ends[-i],i)),e[-i]=0),t.createLeftOf.call(r,e);i===Y?e.insAtLeftEnd(r.ends[Y]):e.insRightOf(r)},e.placeCursor=rY,e.unwrap=function(){this.ends[Y].children().disown().adopt(this.parent,this,this[X]).jQ.insertAfter(this.jQ),this.remove()},e.deleteSide=function(e,t,n){var r=this.parent,i=this[e],a=r.ends[e];if(e===this.side){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}var o=n.options,s=!this.side;if(this.side=-e,this.matchBrack(o,e,this.ends[Y].ends[this.side])){this.closeOpposing(this.ends[Y].ends[this.side]);var c=this.ends[Y].ends[e];this.unwrap(),c.siblingCreated&&c.siblingCreated(n.options,e),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r)}else{if(this.matchBrack(o,e,this.parent.parent))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else if(t&&s){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}else this.sides[e]={ch:jX[this.sides[this.side].ch],ctrlSeq:jX[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass(`mq-ghost`).eq(e===Y?0:1).addClass(`mq-ghost`).html(this.sides[e].ch);if(i){var c=this.ends[Y].ends[e];pY(i,a,-e).disown().withDirAdopt(-e,this.ends[Y],c,0).jQ.insAtDirEnd(e,this.ends[Y].jQ.removeClass(`mq-empty`)),c.siblingCreated&&c.siblingCreated(n.options,e),n.insDirOf(-e,i)}else t?n.insDirOf(e,this):n.insAtDirEnd(e,this.ends[Y])}},e.deleteTowards=function(e,t){this.deleteSide(-e,!1,t)},e.finalizeTree=function(){this.ends[Y].deleteOutOf=function(e,t){this.parent.deleteSide(e,!0,t)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(+(this.side===Y)).removeClass(`mq-ghost`),this.side=0}},e.siblingCreated=function(e,t){t===-this.side&&this.finalizeTree()}}),jX={"(":`)`,")":`(`,"[":`]`,"]":`[`,"{":`}`,"}":`{`,"\\{":`\\}`,"\\}":`\\{`,"&lang;":`&rang;`,"&rang;":`&lang;`,"\\langle ":`\\rangle `,"\\rangle ":`\\langle `,"|":`|`,"\\lVert ":`\\rVert `,"\\rVert ":`\\lVert `};function MX(e,t){var t=t||e,n=jX[e],r=jX[t];mY[e]=q(AX,Y,e,n,t,r),mY[n]=q(AX,X,e,n,t,r)}MX(`(`),MX(`[`),MX(`{`,`\\{`),Z.langle=q(AX,Y,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),Z.rangle=q(AX,X,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),mY[`|`]=q(AX,Y,`|`,`|`,`|`,`|`),Z.lVert=q(AX,Y,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.rVert=q(AX,X,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.left=J(IY,function(e){e.parser=function(){var e=jY.regex,t=jY.string;jY.succeed;var n=jY.optWhitespace;return n.then(e(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)).then(function(r){var i=r.charAt(0)===`\\`?r.slice(1):r;return r==`\\langle`&&(i=`&lang;`,r+=` `),r==`\\lVert`&&(i=`&#8741;`,r+=` `),PY.then(function(a){return t(`\\right`).skip(n).then(e(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)).map(function(e){var t=e.charAt(0)===`\\`?e.slice(1):e;e==`\\rangle`&&(t=`&rang;`,e+=` `),e==`\\rVert`&&(t=`&#8741;`,e+=` `);var n=AX(0,i,t,r,e);return n.blocks=[a],a.adopt(n,0,0),n})})})}}),Z.right=J(IY,function(e){e.parser=function(){return jY.fail(`unmatched \\right`)}}),Z.choose=J(Z.binom=Z.binomial=J(J(IY,kX),function(e,t){e.ctrlSeq=`\\binom`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-paren mq-scaled">(</span><span class="mq-non-leaf"><span class="mq-array mq-non-leaf"><span>&0</span><span>&1</span></span></span><span class="mq-paren mq-scaled">)</span></span>`,e.textTemplate=[`choose(`,`,`,`)`]}),function(e){e.createLeftOf=TX.prototype.createLeftOf}),Z.editable=Z.MathQuillMathField=J(IY,function(e,t){e.ctrlSeq=`\\MathQuillMathField`,e.htmlTemplate=`<span class="mq-editable-field"><span class="mq-root-block">&0</span></span>`,e.parser=function(){var e=this,n=jY.string,r=jY.regex,i=jY.succeed;return n(`[`).then(r(/^[a-z][a-z0-9]*/i)).skip(n(`]`)).map(function(t){e.name=t}).or(i()).then(t.parser.call(e))},e.finalizeTree=function(e){var t=vY(this.ends[Y],this.jQ,e);t.KIND_OF_MQ=`MathField`,t.editable=!0,t.createTextarea(),t.editablesTextareaEvents(),t.cursor.insAtRightEnd(t.root),AY(t.root)},e.registerInnerField=function(e,t){e.push(e[this.name]=t(this.ends[Y].controller))},e.latex=function(){return this.ends[Y].latex()},e.text=function(){return this.ends[Y].text()}});var NX=Z.embed=J(LY,function(e,t){e.setOptions=function(e){function t(){return``}return this.text=e.text||t,this.htmlTemplate=e.htmlString||``,this.latex=e.latex||t,this},e.parser=function(){var e=this,t=jY.string,n=jY.regex,r=jY.succeed;return t(`{`).then(n(/^[a-z][a-z0-9]*/i)).skip(t(`}`)).then(function(i){return t(`[`).then(n(/^[-\w\s]*/)).skip(t(`]`)).or(r()).map(function(t){return e.setOptions(CY[i](t))})})}});Z.MathQuillResponseContainer=J(IY,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainer`,e.htmlTemplate=`<span class="lrn-mq-response-container"><marker class="lrn-qe-keyboard-i-response"></marker><content>Response</content></span>`,e.latex=function(){return`\\MathQuillResponseContainer`},e.text=function(){return this.ends[Y].text()}}),Z.MathQuillResponseContainerIcon=J(IY,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainerIcon`,e.htmlTemplate=`<span class="lrn-mq-response-container-icon"><span class="lrn-qe-keyboard-i-response"></span></span>`,e.latex=function(){return`\\MathQuillResponseContainerIcon`},e.text=function(){return this.ends[Y].text()}});var PX=Z.matrix=J(IY,function(e,t){var n=J(RY,function(e,t){e.init=function(e,n){return this.column=e,this.row=n,t.init.call(this)},e.keystroke=function(e,n,r){switch(e){case`Shift-Spacebar`:return n.preventDefault(),this.parent.insertColumn(this);case`Shift-Enter`:return this.parent.insertRow(this)}return t.keystroke.apply(this,arguments)},e.deleteOutOf=function(e,n){var r=this,i=arguments;this.parent.backspace(this,e,n,function(){return t.deleteOutOf.apply(r,i)})}}),r={column:`&`,row:`\\\\`};e.parentheses={left:null,right:null},e.maximum={rows:5,columns:5},e.defaults={rows:2,columns:2},e.ctrlSeq=`\\matrix`,e.createBlocks=function(){var e=this,t=e.blocks=[],r,i,a=0;this.htmlTemplate.replace(/&\d+/g,function(o,s){var c=e.htmlTemplate.substring(0,s).match(/<tr[^>]*>/gi).length-1;i=r===c?i+1:0,t[a]=n(i,c),t[a].adopt(e,e.ends[X],0),r=c,a++})},e.reflow=function(){var e=this.jQ.children(`table`),t=e.outerHeight()/+e.css(`fontSize`).slice(0,-2),n=this.jQ.children(`.mq-paren`);n.length&&oX(n,tY(1+.2*(t-1),1.2),1.05*t)},e.latex=function(){var e=this.getMatrixName(),t=`\\begin{`+e+`}`,n,i,a;for(a=0;a<this.blocks.length;a++)n=this.blocks[a].row,i!==void 0&&(i===n?t+=r.column:t+=r.row),i=n,t+=this.blocks[a].latex();return t+=`\\end{`+e+`}`,t},e.createLeftOf=function(n){this.cursor=n;var r=Math.min(this.defaults.rows,this.maximum.rows),i=Math.min(this.defaults.columns,this.maximum.columns);this.defaultHtmlTemplate=this.defaultHtmlTemplate||this.generateHtmlTemplate(r,i),e.htmlTemplate=this.defaultHtmlTemplate,t.createLeftOf.call(this,n)},e.getMatrixName=function(){return this.ctrlSeq.replace(`\\`,``)},e.generateHtmlTemplate=function(e,t){var n=`<span class="mq-matrix mq-non-leaf">`+o(this.parentheses.left);n+=`<table class="mq-non-leaf">`,e=Math.min(e,this.maximum.rows),t=Math.min(t,this.maximum.columns);for(var r=0,i=0;i<e;i++){n+=`<tr>`;for(var a=0;a<t;a++)n+=`<td>&`+r+`</td>`,r++;n+=`</tr>`}return n+=`</table>`,n+=o(this.parentheses.right)+`</span>`,n;function o(e){return e?`<span class="mq-paren mq-scaled">`+e+`</span>`:``}},e.htmlTemplate=e.generateHtmlTemplate(1,1),e.parser=function(){var e=jY.regex,t=this,i=this.getMatrixName(),a=RegExp(`^(.*?)\\\\end{`+i+`}`),o=RegExp(`\\\\end{`+i+`}`);return e(a).then(function(e){var i=e.replace(o,``),a=[],s=i.split(r.row),c=Math.min(s.length,t.maximum.rows),l=0,u,d;for(d=0;d<c;d++)u=s[d].split(r.column),l=Math.max(l,u.length);for(l=Math.min(l,t.maximum.columns),d=0;d<c;d++){u=s[d].split(r.column);for(var e=0;e<l;e++){var f=n(e,d);PY.parse(u[e]||` `).children().adopt(f,f.ends[X],0),a.push(f)}}t.htmlTemplate=t.generateHtmlTemplate(c,l),t.blocks=a;for(var d=0;d<a.length;d+=1)a[d].adopt(t,t.ends[X],0);return jY.succeed(t)})},e.finalizeTree=function(){var e=this.jQ.find(`table`);e.length&&(this.relink(),e.removeClass(function(e,t){var n=t.match(/mq-rows-\d+/g);return n&&n.join(` `)||``}),e.addClass(`mq-rows-`+e.find(`tr`).length))},e.relink=function(){var e=this.jQ.find(`td`),t=dY.byId[e.first().attr(eY)],n=dY.byId[e.last().attr(eY)],r=e.eq(0).closest(`tr`),i=[];e.each(function(t){var n=dY.byId[XJ(this).attr(eY)],a=e.eq(t+1),o=XJ(this).closest(`tr`).next(`tr`),s=XJ(this).closest(`tr`).index(),c=XJ(this).index(),l;if(a.length){var u=dY.byId[a.attr(eY)];n[X]=u,u[Y]=n}if(l=o.length?o.find(`td`).eq(c):r.find(`td`).eq(c+1),l.length){var d=dY.byId[l.attr(eY)];n.downOutOf=d,d.upOutOf=n}n.column=c,n.row=s,i.push(n)}),this.ends[Y]=t,this.ends[X]=n,t&&t[Y]&&delete t[Y],n&&n[X]&&delete n[X],this.blocks=i},e.deleteCell=function(e){var t=e.jQ.closest(`tr`),n=e.jQ.index(),r=t.index(),i=t.find(`td`).not(e.jQ),a=this.jQ.find(`tr`).not(t).map(function(){return XJ(this).find(`td`)[n]}),o=this.jQ.find(`td`).length===1,s;function c(){return dY.byId[XJ(this).attr(eY)].isEmpty()}return i.filter(c).length===i.length&&a.length&&(i.remove(),e.jQ.remove(),t.remove(),this.finalizeTree()),a.filter(c).length===a.length&&i.length&&(a.remove(),e.jQ.remove(),this.finalizeTree()),o||(r=Math.min(r,this.jQ.find(`tr`).length-1),n=Math.min(n,this.jQ.find(`tr`).eq(r).find(`td`).length-1),s=dY.byId[this.jQ.find(`tr`).eq(r).find(`td`).eq(n).attr(eY)]),s},e.addRow=function(e){if(!(this.jQ.find(`tr`).length>=this.maximum.rows)){for(var t=e.find(`td`).length,r=XJ(`<tr></tr>`),i,a,o=0;o<t;o++)i=n(),i.parent=this,i.jQ=XJ(`<td class="mq-empty">`).attr(eY,i.id),r.append(i.jQ),a||=i;return r.insertAfter(e),a}},e.addColumn=function(e){if(!(e.closest(`tr`).find(`td`).length>=this.maximum.columns)){var t=e.index(),r=e.closest(`tr`).index(),i=this,a,o=[];return this.jQ.find(`tr`).each(function(){a=n(),a.parent=i,a.jQ=XJ(`<td class="mq-empty">`).attr(eY,a.id),a.jQ.insertAfter(XJ(this).find(`td`).eq(t)),o.push(a)}),o[r]}},e.insertColumn=function(e){newBlock=this.addColumn(e.jQ),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.insertRow=function(e){newBlock=this.addRow(e.jQ.closest(`tr`)),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.backspace=function(e,t,n,r){if(e.isEmpty()){var i=this.deleteCell(e);i?n.insAtRightEnd(i):(r(),this.finalizeTree()),this.bubble(`edited`)}}});Z.pmatrix=J(PX,function(e,t){e.ctrlSeq=`\\pmatrix`,e.parentheses={left:`(`,right:`)`}}),Z.bmatrix=J(PX,function(e,t){e.ctrlSeq=`\\bmatrix`,e.parentheses={left:`[`,right:`]`}}),Z.Bmatrix=J(PX,function(e,t){e.ctrlSeq=`\\Bmatrix`,e.parentheses={left:`{`,right:`}`}}),Z.vmatrix=J(PX,function(e,t){e.ctrlSeq=`\\vmatrix`,e.parentheses={left:`|`,right:`|`}}),Z.Vmatrix=J(PX,function(e,t){e.ctrlSeq=`\\Vmatrix`,e.parentheses={left:`‖`,right:`‖`}});var FX=OY(3);for(var IX in FX)(function(e,t){typeof t==`function`?(TY[e]=function(){return wY(),t.apply(this,arguments)},TY[e].prototype=t.prototype):TY[e]=t})(IX,FX[IX]);var LX=function(e){e.registerEmbed(`newLine`,()=>({htmlString:`<div class="newLine"></div>`,text:()=>`testText`,latex:()=>`\\embed{newLine}[]`}))},RX;typeof window<`u`&&(RX=TY.getInterface(3),RX&&RX.registerEmbed&&LX(RX));var zX=D(`math-input:mq:input`),BX=L(`span`)({}),VX=class extends N.Component{static propTypes={className:p.string,onClick:p.func,onChange:p.func,latex:p.string,onFocus:p.func,onBlur:p.func};componentDidMount(){if(!RX)throw Error(`MQ is not defined - but component has mounted?`);this.mathField=RX.MathField(this.input,{handlers:{edit:this.onInputEdit.bind(this)}}),this.updateLatex()}componentDidUpdate(){this.updateLatex()}updateLatex(){if(!this.mathField)return;let{latex:e}=this.props;e!=null&&this.mathField.latex(e)}clear(){return this.mathField.latex(``),``}blur(){zX(`blur mathfield`),this.mathField.blur()}focus(){zX(`focus mathfield...`),this.mathField.focus()}command(e){return zX(`command: `,e),Array.isArray(e)?e.forEach(e=>{this.mathField.cmd(e)}):this.mathField.cmd(e),this.mathField.focus(),this.mathField.latex()}keystroke(e){return this.mathField.keystroke(e),this.mathField.focus(),this.mathField.latex()}write(e){return zX(`write: `,e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}onInputEdit=()=>{zX(`[onInputEdit] ...`);let{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())};refresh=()=>{this.blur(),this.focus()};onKeyPress=e=>{if(Object.keys(this.mathField.__controller.options).indexOf(`ignoreNextMousedown`)<0&&this.refresh(),e.charCode===13){e.preventDefault();return}};onClick=e=>{let{onClick:t}=this.props;this.refresh(),t&&t(e)};shouldComponentUpdate(e){return zX(`next: `,e.latex),zX(`current: `,this.mathField.latex()),e.latex!==this.mathField.latex()}render(){let{onFocus:e,onBlur:t,className:n}=this.props;return(0,F.jsx)(BX,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}},HX=D(`pie-lib:math-input:mq:static`),UX=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,WX=/ /g;function GX(e=``){return e.replace(WX,``)}function KX(e){let t=0;for(let n=0;n<(e||``).length;n++)e[n]===`{`&&t++;return t}var qX=class extends N.Component{static propTypes={latex:p.string.isRequired,onFocus:p.func,onBlur:p.func,className:p.string,getFieldName:p.func,onSubFieldChange:p.func,onSubFieldFocus:p.func,setInput:p.func};static defaultProps={getFieldName:()=>{}};constructor(e){super(e),this.state={announcement:``,previousLatex:``,inputSource:null,isDeleteKeyPressed:!1},this.inputRef=N.createRef()}componentDidMount(){this.update(),PJ(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),PJ()}componentWillUnmount(){this.removeLiveRegion(),this.removeEventListeners()}createLiveRegion=()=>{this.liveRegion=document.createElement(`div`),this.liveRegion.style.position=`absolute`,this.liveRegion.style.width=`1px`,this.liveRegion.style.height=`1px`,this.liveRegion.style.marginTop=`-1px`,this.liveRegion.style.clip=`rect(1px, 1px, 1px, 1px)`,this.liveRegion.style.overflow=`hidden`,this.liveRegion.setAttribute(`aria-live`,`polite`),this.liveRegion.setAttribute(`aria-atomic`,`true`),document.body.appendChild(this.liveRegion)};addEventListeners=()=>{let e=this.inputRef.current;e&&(e.addEventListener(`keydown`,this.handleKeyDown),e.addEventListener(`click`,this.handleMathKeyboardClick))};removeEventListeners=()=>{let e=this.inputRef.current;e&&(e.removeEventListener(`keydown`,this.handleKeyDown),e.removeEventListener(`click`,this.handleMathKeyboardClick))};removeLiveRegion=()=>{this.liveRegion&&=(document.body.removeChild(this.liveRegion),null)};handleKeyDown=e=>{(e?.key===`Backspace`||e?.key===`Delete`)&&this.setState({isDeleteKeyPressed:!0}),this.setState({inputSource:`keyboard`})};handleMathKeyboardClick=()=>{this.setState({inputSource:`mathKeyboard`})};onInputEdit=e=>{if(!this.mathField||this._isProgrammaticUpdate)return;let t=this.props.getFieldName(e,this.mathField.innerFields);if(this.props.onSubFieldChange){let n=e.latex().match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.inputRef?.current&&n&&n?.length)try{e.__controller.cursor.insLeftOf(e.__controller.cursor.parent[-1].parent),e.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}else this.props.onSubFieldChange(t,e.latex())}this.announceLatexConversion(e.latex())};announceLatexConversion=e=>{if(!this.state){console.error(`State is not initialized`);return}let{previousLatex:t,inputSource:n,isDeleteKeyPressed:r}=this.state,i=`Converted to math symbol`;if(n===`keyboard`&&!r)if(KX(e)>KX(t))this.announceMessage(i);else try{this.mathField.parseLatex(t),this.mathField.parseLatex(e),e==t&&this.announceMessage(i)}catch(e){console.warn(`Error parsing latex:`,e.message),console.warn(e)}(this.state.previousLatex!==e||this.state.isDeleteKeyPressed)&&this.setState({previousLatex:e,isDeleteKeyPressed:!1})};announceMessage=e=>{this.setState({previousLatex:``}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=``},500))};update=()=>{if(!RX)throw Error(`MQ is not defined - but component has mounted?`);this.mathField||=RX.StaticMath(this.inputRef?.current,{handlers:{edit:this.onInputEdit.bind(this)}});try{this._isProgrammaticUpdate=!0,this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch{this.mathField.latex(`\\MathQuillMathField[r1]{}`)}finally{this._isProgrammaticUpdate=!1}};blur=()=>{HX(`blur mathfield`),this.mathField.blur()};focus=()=>{HX(`focus mathfield...`),this.mathField.focus()};shouldComponentUpdate(e){try{let t=GX(this.mathField.parseLatex(e.latex)),n=(e.latex.match(UX)||[]).length,r=t!==GX(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return HX(`[shouldComponentUpdate] `,r),r}catch(e){return console.warn(`Error parsing latex:`,e.message,`skip update`),console.warn(e),!1}}onFocus=e=>{try{let t=e.target.parentElement.nextSibling,n=parseInt(t.getAttribute(`mathquill-block-id`),10);n||=(t=t.parentElement,parseInt(t.getAttribute(`mathquill-block-id`),10));let r=this.mathField.innerFields.find(e=>e.id===n);if(r){let e=this.props.getFieldName(r,this.mathField.innerFields);this.props.setInput&&this.props.setInput(r),this.props.onSubFieldFocus(e,r)}}catch(e){console.error(`error finding root block`,e.message)}};render(){let{onBlur:e,className:t}=this.props;return(0,F.jsx)(`span`,{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}},JX={fontFamily:`MJXZERO, MJXTEX !important`,"-webkit-font-smoothing":`antialiased !important`,"& .mq-math-mode > span > var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode span var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode .mq-nonSymbola":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode > span > var.mq-operator-name":{fontFamily:`MJXZERO, MJXTEX !important`}},YX={"& .mq-longdiv-inner":{marginTop:`-1px`,marginLeft:`5px !important;`,"& > .mq-empty":{padding:`0 !important`,marginLeft:`0px !important`,marginTop:`2px`}},"& .mq-math-mode .mq-longdiv":{display:`inline-flex !important`}},XX={"& .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`0.5em !important`,paddingRight:`0.15em`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-supsub ":{fontSize:`70.7%`},"& .mq-math-mode .mq-supsub.mq-sup-only":{verticalAlign:`-0.1em !important`,"& .mq-sup":{marginBottom:`0px !important`}},"& .mq-math-mode .mq-fraction + .mq-supsub.mq-sup-only":{verticalAlign:`0.4em !important`},"& .mq-math-mode .mq-supsub.mq-sup-only.mq-after-fraction-group":{verticalAlign:`0.4em !important`}},ZX={"& *":{...JX,...YX,"& .mq-math-mode .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-longdiv-inner .mq-empty":{padding:`0 !important`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-math-mode .mq-sqrt-stem":{marginTop:`-5px`,paddingTop:`4px`},"& .mq-math-mode .mq-paren":{verticalAlign:`middle !important`},"& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty":{padding:`0 !important`},"& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ":{padding:`0 !important`}}},QX={commonMqFontStyles:JX,longdivStyles:YX,supsubStyles:XX,commonMqKeyboardStyles:ZX},$X=e=>(T(5-e.length,()=>e.push([])),E.apply(null,e)),eZ=D(`pie-lib:math-inline:keypad`),tZ=L(qX)(({latex:e})=>{let t={pointerEvents:`none`,textTransform:`none !important`,color:ZH(),"& .mq-scaled.mq-sqrt-prefix":{transform:`scale(1, 0.9) !important`},"& .mq-sup-only .mq-sup":{marginBottom:`0.9px !important`},"& .mq-empty":{backgroundColor:`${GU()} !important`},"& .mq-overline .mq-overline-inner":{borderTop:`2px solid black`},"& .mq-non-leaf.mq-overline":{borderTop:`none !important`},"& .mq-overarrow":{width:`30px`,marginTop:`0 !important`,borderTop:`2px solid black`,fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`,"&.mq-arrow-both":{top:`0px !important`,"& *":{lineHeight:`1 !important`,borderTop:`none !important`},"&:before":{fontSize:`80%`,left:`calc(-13%) !important`,top:`-0.31em !important`},"&:after":{fontSize:`80% !important`,right:`calc(-13%) !important`,top:`-1.5em`},"&.mq-empty:before":{fontSize:`80%`,left:`calc(-13%)`,top:`-0.26em`},"&.mq-empty:after":{fontSize:`80%`,right:`calc(-13%)`,top:`-0.26em`},"&.mq-empty":{minHeight:`1.4em`}},"&.mq-arrow-right:before":{fontSize:`80%`,right:`calc(-13%) !important`,top:`-0.26em !important`},"& .mq-overarrow-inner":{border:`none !important`},"& .mq-overarrow-inner .mq-overarrow-inner-right":{display:`none !important`}},"& .mq-root-block":{padding:`5px !important`},"& .mq-overarrow.mq-arrow-both.mq-empty:after":{right:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-right.mq-empty:before":{right:`-5px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-both.mq-empty:before":{left:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},"& .mq-overarc":{borderTop:`2px solid black !important`,"& .mq-overline":{borderTop:`none !important`},"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`}}};return e===`\\parallel`?{...t,fontStyle:`italic !important`}:e===`\\overleftrightarrow{\\overline{}}`?{...t,"& .mq-overarrow.mq-arrow-both":{"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`},"&:after":{position:`absolute !important`,top:`0px !important`}}}:t});tZ.propTypes={latex:p.string.isRequired};var nZ=e=>e?{gridTemplateColumns:`repeat(${e.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${e.rows}, minmax(40px, 60px))`,gridAutoFlow:`initial`}:{},rZ=L(`div`)(()=>({...ZX,width:`100%`,display:`grid`,gridTemplateRows:`repeat(5, minmax(40px, 60px))`,gridRowGap:`0px`,gridColumnGap:`0px`,gridAutoFlow:`column`,"&.character":{textTransform:`initial !important`,gridTemplateRows:`repeat(5, minmax(40px, 50px)) !important`},"&.language":{gridTemplateRows:`repeat(4, minmax(40px, 50px)) !important`,"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),iZ=L(UW)(({category:e,isDelete:t,isComma:n,isDot:r})=>({minWidth:`auto`,textTransform:`none`,fontSize:n||r?`200% !important`:`140% !important`,lineHeight:n||r?`100%`:`normal`,color:ZH(),backgroundColor:e===`operators`?WU():UU(),"&:hover":{backgroundColor:e===`operators`?qU():KU()},borderRadius:0,...t&&{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),aZ=L(UW)(({category:e})=>({textTransform:`none`,padding:0,margin:0,fontSize:`110% !important`,minWidth:`auto`,borderRadius:0,backgroundColor:e===`operators`?WU():UU(),"&:hover":{backgroundColor:e===`operators`?qU():KU()}})),oZ=L(Ez)(({category:e})=>({minWidth:`auto`,backgroundColor:e===`operators`?WU():UU(),"&:hover":{backgroundColor:e===`operators`?qU():KU()},borderRadius:0,"& .icon":{height:`30px`}})),sZ=class extends N.Component{static propTypes={className:p.string,controlledKeypadMode:p.bool,baseSet:p.array,additionalKeys:p.array,layoutForKeyPad:p.object,onPress:p.func.isRequired,onFocus:p.func,noDecimal:p.bool,setKeypadInteraction:p.func,mode:p.oneOfType([p.string,p.number])};static defaultProps={baseSet:qJ,noDecimal:!1};constructor(e){super(e),this.keypadRef=N.createRef()}componentDidMount(){let e=this.keypadRef?.current,t=e?.closest(`.main-container`),n=e?.closest(`.pie-toolbar`);if(this.props.controlledKeypadMode&&t&&n){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),i=e.top+e.height-(r.top+r.height);if(i<0){let n=e.height+e.top-i;t&&(t.style.height=`${n}px`)}}e&&(e.addEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.addEventListener(`mousedown`,this.handleKeypadInteraction,!0))}componentWillUnmount(){let e=this.keypadRef?.current;if(this.props.controlledKeypadMode&&e){let t=e.closest(`.main-container`);t&&(t.style.height=`unset`)}e&&(e.removeEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.removeEventListener(`mousedown`,this.handleKeypadInteraction,!0))}handleKeypadInteraction=()=>{this.props.setKeypadInteraction&&this.props.setKeypadInteraction(!0)};buttonClick=e=>{eZ(`[buttonClick]`,e);let{onPress:t}=this.props;t(e)};flowKeys=(e,t)=>y([...$X(e),...$X(t)]);keyIsNotAllowed=e=>{let{noDecimal:t}=this.props;return!!((e.write===`.`&&e.label===`.`||e.write===`,`&&e.label===`,`)&&t)};render(){let{className:e,baseSet:t,additionalKeys:n,layoutForKeyPad:r,onFocus:i,mode:a}=this.props,o=[`non-negative-integers`,`integers`,`decimals`,`fractions`,`item-authoring`,`language`].includes(a),s=o?this.flowKeys([],n||[]):this.flowKeys(t,n||[]),c=s.length%5?1:0,l={gridTemplateColumns:`repeat(${Math.floor(s.length/5)+c}, minmax(min-content, 150px))`,...nZ(r)};return(0,F.jsx)(rZ,{ref:this.keypadRef,className:[e,a].filter(Boolean).join(` `),style:l,onFocus:i,children:s.map((e,t)=>{let n=this.buttonClick.bind(this,e);if(!e)return(0,F.jsx)(`span`,{},`empty-${t}`);let r={onClick:n,disabled:this.keyIsNotAllowed(e),key:`${e.label||e.latex||e.command}-${t}`,...e.actions||{},...e.extraProps||{}};if(e.latex)return(0,F.jsx)(aZ,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:(0,F.jsx)(tZ,{latex:e.latex})},r.key);if(e.label)return(0,F.jsx)(iZ,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,isDelete:e.label===`⌫`,isComma:e.label===`,`,isDot:e.label===`.`,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:e.label},r.key);{let t=e.icon?e.icon:`div`;return(0,F.jsx)(oZ,{tabIndex:`-1`,onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,size:`large`,...e.actions||{},...e.extraProps||{},children:(0,F.jsx)(t,{className:`icon`})},r.key)}})})}},cZ=e=>{if(e.command)return{value:e.command,type:`command`};if(e.write)return{value:e.write};if(e.keystroke)return{type:`cursor`,value:e.keystroke}},lZ=class extends N.Component{static propTypes={className:p.string,controlledKeypadMode:p.bool,mode:p.oneOfType([p.string,p.number]),layoutForKeyPad:p.object,onClick:p.func.isRequired,onFocus:p.func,noDecimal:p.bool,additionalKeys:p.array,setKeypadInteraction:p.func};static defaultProps={mode:`scientific`,noDecimal:!1,additionalKeys:[]};keypadPress=e=>{let{onClick:t}=this.props;t(cZ(e))};render(){let{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:i,additionalKeys:a,layoutForKeyPad:o,setKeypadInteraction:s}=this.props,c=NJ(a);return(0,F.jsx)(sZ,{className:i,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:o,additionalKeys:kK(jJ(e),c),onPress:this.keypadPress,mode:e,setKeypadInteraction:s})}},uZ=L(`span`)(()=>({display:`inline-flex`,border:`1px solid ${wU()}`,margin:`1px 5px`,cursor:`pointer`,alignItems:`center`,justifyContent:`center`,minWidth:`50px`,minHeight:`36px`,height:`fit-content`})),dZ=L(`div`)(()=>({background:yU(),color:ZH(),display:`inline-flex`,borderRight:`2px solid ${wU()}`,boxSizing:`border-box`,overflow:`hidden`,fontSize:`12px`,minHeight:`36px`,height:`100%`,alignItems:`center`,fontFamily:`Symbola, Times New Roman, serif`,padding:`0 2px`})),fZ=L(`div`)(()=>({flex:8,color:`var(--pie-text, black)`,padding:`4px !important`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`var(--pie-background, rgba(255, 255, 255, 0))`,"& > .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-overarrow.mq-arrow-both":{marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`}})),pZ=e=>{let{node:t,options:n,selected:r}=e,{attrs:i}=t,{value:a,index:o}=i,s=`R ${parseInt(o)+1}`;return(0,F.jsx)(rS,{className:`math-templated`,"data-selected":r,style:{display:`inline-flex`,minHeight:`36px`,minWidth:`50px`,cursor:`pointer`},children:(0,F.jsxs)(uZ,{...i,children:[(0,F.jsx)(dZ,{children:s}),(0,F.jsx)(fZ,{children:(0,F.jsx)(qX,{latex:a})})]})})};pZ.propTypes={attributes:p.object,value:p.string,keyToDisplay:p.string};var mZ={},hZ=e=>String(e||``).replace(/-/g,`_`),gZ=e=>e&&e.attrs&&e.attrs.index!=null?String(e.attrs.index):null,_Z=(e,t)=>{let n=[];return e.descendants((e,r)=>{if(e.type&&e.type.name===t){let t=gZ(e);t!=null&&n.push({index:t,pos:r,node:e})}return!0}),n},vZ=(e,t)=>{let n=0;return e.descendants(e=>(e.type&&e.type.name===t&&(n+=1),!0)),n},yZ=({schema:e,typeName:t,index:n})=>{let r=e.nodes[t];return r?r.create({index:String(n),id:String(n),value:``}):null},bZ=(e,t)=>{let n=e.resolve(Math.min(t,e.content.size));return U.near(n,1)},xZ=sb.create({name:`responseArea`,addOptions(){return{maxResponseAreas:null,error:null,options:null,respAreaToolbar:null,onHandleAreaChange:null}},addProseMirrorPlugins(){if(!this.options.type)return[];let e=hZ(this.options.type);return[new uu({key:new pu(`response-area-watcher:${e}`),view:t=>(mZ[e]===void 0&&(mZ[e]=0,t.state.doc.descendants(t=>{if(t.type&&t.type.name===e){let n=gZ(t);if(n!=null){let t=parseInt(n,10);!Number.isNaN(t)&&t>mZ[e]&&(mZ[e]=t)}}return!0})),{update:(t,n)=>{let r=t.state;if(n.doc.eq(r.doc))return;let i=_Z(r.doc,e),a=_Z(n.doc,e);if(this.options.toolbar&&(this.options.toolbar.disabled=i.length>=this.options.maxResponseAreas),a.length>i.length){let e=new Set(i.map(e=>e.index)),t=a.filter(t=>!e.has(t.index));t.length&&typeof this.options.onHandleAreaChange==`function`&&this.options.onHandleAreaChange(t)}}})})]},addCommands(){return{insertResponseArea:e=>({tr:t,state:n,dispatch:r,commands:i})=>{let a=hZ(e);if(vZ(n.doc,a)>=this.options.maxResponseAreas)return!1;mZ[a]===void 0&&(mZ[a]=0);let o=mZ[a]+1;mZ[a]+=1;let s=yZ({schema:n.schema,typeName:a,index:o});if(!s)return!1;let{selection:c}=n,l=c.from,u=e=>{try{return t.insert(e,s),e}catch{return null}},d=u(l);if(d??=u(t.doc.content.size),d==null)return!1;if([`inline_dropdown`,`explicit_constructed_response`].includes(a))t.setSelection(W.create(t.doc,d));else{let e=d+s.nodeSize;t.setSelection(bZ(t.doc,e))}return r&&(i.focus(),r(t)),!0},refreshResponseArea:()=>({tr:e,state:t,commands:n,dispatch:r})=>{let{selection:i}=t,a=i.$from.nodeAfter,o=i.from;return e.setNodeMarkup(o,void 0,{...a?.attrs,updated:`${Date.now()}`}),e.setSelection(W.create(e.doc,o)),r&&(n.focus(),r(e)),!0}}}}),SZ=Lb.create({name:`explicit_constructed_response`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="explicit_constructed_response"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`explicit_constructed_response`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(zz,{...e,options:this.options}))}}),CZ=Lb.create({name:`math_templated`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="math_templated"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`math_templated`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(pZ,{...e,options:this.options}))}}),wZ=Lb.create({name:`drag_in_the_blank`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},id:{default:null},value:{default:``},inTable:{default:null},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="drag_in_the_blank"]`,getAttrs:e=>({index:e.dataset.index,id:e.dataset.id,value:e.dataset.value,inTable:e.dataset.inTable})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`drag_in_the_blank`,"data-index":e.index,"data-id":e.id,"data-value":e.value,"data-in-table":e.inTable}]},addNodeView(){return dS(e=>(0,F.jsx)(vK,{...e,options:this.options}))}}),TZ=Lb.create({name:`inline_dropdown`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="inline_dropdown"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`inline_dropdown`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return dS(e=>(0,F.jsx)(yK,{...e,options:this.options}))}}),EZ=Qr(`MuiDivider`,[`root`,`absolute`,`fullWidth`,`inset`,`middle`,`flexItem`,`light`,`vertical`,`withChildren`,`withChildrenVertical`,`textAlignRight`,`textAlignLeft`,`wrapper`,`wrapperVertical`]),DZ=Qr(`MuiListItemIcon`,[`root`,`alignItemsFlexStart`]),OZ=Qr(`MuiListItemText`,[`root`,`multiline`,`dense`,`inset`,`primary`,`secondary`]);function kZ(e){return Zr(`MuiMenuItem`,e)}var AZ=Qr(`MuiMenuItem`,[`root`,`focusVisible`,`dense`,`disabled`,`divider`,`gutters`,`selected`]);function jZ(e){return Zr(`MuiNativeSelect`,e)}var MZ=Qr(`MuiNativeSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]),NZ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return A({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${R(n)}`,a&&`iconOpen`,r&&`disabled`]},jZ,t)},PZ=L(`select`,{name:`MuiNativeSelect`})(({theme:e})=>({MozAppearance:`none`,WebkitAppearance:`none`,userSelect:`none`,borderRadius:0,cursor:`pointer`,"&:focus":{borderRadius:0},[`&.${MZ.disabled}`]:{cursor:`default`},"&[multiple]":{height:`auto`},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!==`filled`&&e.variant!==`outlined`,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:`filled`},style:{"&&&":{paddingRight:32}}},{props:{variant:`outlined`},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),FZ=L(PZ,{name:`MuiNativeSelect`,slot:`Select`,shouldForwardProp:Fo,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${MZ.multiple}`]:t.multiple}]}})({}),IZ=L(`svg`,{name:`MuiNativeSelect`})(({theme:e})=>({position:`absolute`,right:0,top:`calc(50% - .5em)`,pointerEvents:`none`,color:(e.vars||e).palette.action.active,[`&.${MZ.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:`rotate(180deg)`}},{props:{variant:`filled`},style:{right:7}},{props:{variant:`outlined`},style:{right:7}}]})),LZ=L(IZ,{name:`MuiNativeSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${R(n.variant)}`],n.open&&t.iconOpen]}})({}),RZ=N.forwardRef(function(e,t){let{className:n,disabled:r,error:i,IconComponent:a,inputRef:o,variant:s=`standard`,...c}=e,l={...e,disabled:r,variant:s,error:i},u=NZ(l);return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(FZ,{ownerState:l,className:k(u.select,n),disabled:r,ref:o||t,...c}),e.multiple?null:(0,F.jsx)(LZ,{as:a,ownerState:l,className:u.icon})]})});function zZ(e){return Zr(`MuiSelect`,e)}var BZ=Qr(`MuiSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`focused`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]);function VZ(e){return e?e.type===`mousedown`||e.type===`pointerdown`||e.type===`touchstart`?`pointer`:e.type===`keydown`||e.type===`click`&&e.detail===0?`keyboard`:null:null}function HZ(e){return e==null||typeof e==`string`&&!e.trim()}function UZ(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var WZ=N.createContext(null);function GZ(){return N.useContext(WZ)}var KZ=WZ.Provider,qZ,JZ=L(PZ,{name:`MuiSelect`,slot:`Select`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${BZ.select}`]:t.select},{[`&.${BZ.select}`]:t[n.variant]},{[`&.${BZ.error}`]:t.error},{[`&.${BZ.multiple}`]:t.multiple}]}})({[`&.${BZ.select}`]:{height:`auto`,minHeight:`1.4375em`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`}}),YZ=L(IZ,{name:`MuiSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${R(n.variant)}`],n.open&&t.iconOpen]}})({}),XZ=L(`input`,{shouldForwardProp:e=>Po(e)&&e!==`classes`,name:`MuiSelect`,slot:`NativeInput`})({bottom:0,left:0,position:`absolute`,opacity:0,pointerEvents:`none`,width:`100%`,boxSizing:`border-box`}),ZZ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return A({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${R(n)}`,a&&`iconOpen`,r&&`disabled`],nativeInput:[`nativeInput`]},zZ,t)},QZ=N.forwardRef(function(e,t){let{"aria-describedby":n,"aria-label":r,autoFocus:i,autoWidth:a,children:o,className:s,defaultOpen:c,defaultValue:l,disabled:u,displayEmpty:d,error:f=!1,IconComponent:p,inputRef:m,labelId:h,MenuProps:g={},multiple:_,name:v,onBlur:y,onChange:b,onClose:x,onFocus:S,onKeyDown:C,onMouseDown:w,onOpen:T,open:E,readOnly:D,renderValue:O,required:A,SelectDisplayProps:M={},tabIndex:ee,type:te,value:ne,variant:re=`standard`,...ie}=e,[P,ae]=nR({controlled:ne,default:l,name:`Select`}),[oe,se]=nR({controlled:E,default:c,name:`Select`}),ce=N.useRef(null),le=N.useRef(null),[ue,de]=N.useState(null),{current:fe}=N.useRef(E!=null),[pe,me]=N.useState(),[he,ge]=N.useState(null),_e=oR(t,m),ve=N.useCallback(e=>{le.current=e,e&&de(e)},[]),ye=ue?.parentNode;N.useImperativeHandle(_e,()=>({focus:()=>{le.current.focus()},node:ce.current,value:P}),[P]);let be=ue!==null&&oe;N.useEffect(()=>{if(!be||!ye||a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{me(ye.clientWidth)});return e.observe(ye),()=>{e.disconnect()}},[be,ye,a]),N.useEffect(()=>{c&&oe&&ue&&!fe&&(me(a?null:ye.clientWidth),le.current.focus())},[ue,a]),N.useEffect(()=>{i&&le.current.focus()},[i]),N.useEffect(()=>{if(!h)return;let e=YL(le.current).getElementById(h);if(e){let t=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}},[h]);let xe=(e,t)=>{e?(ge(VZ(t)),T&&T(t)):(ge(null),x&&x(t)),fe||(me(a?null:ye.clientWidth),se(e))},Se=e=>{w?.(e),e.button===0&&(e.preventDefault(),le.current.focus(),xe(!0,e))},Ce=e=>{xe(!1,e)},we=N.Children.toArray(o),Te=e=>{let t=we.find(t=>t.props.value===e.target.value);t!==void 0&&(ae(t.props.value),b&&b(e,t))},Ee=e=>t=>{let n;if(t.currentTarget.hasAttribute(`tabindex`)){if(_){n=Array.isArray(P)?P.slice():[];let t=P.indexOf(e.props.value);t===-1?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),P!==n&&(ae(n),b)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:n,name:v}}),b(i,e)}_||xe(!1,t)}},De=e=>{D||([` `,`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),xe(!0,e)),C?.(e))},Oe=e=>{!be&&y&&(Object.defineProperty(e,"target",{writable:!0,value:{value:P,name:v}}),y(e))};delete ie[`aria-invalid`];let ke,Ae,je=[],Me=!1;(_G({value:P})||d)&&(O?ke=O(P):Me=!0);let Ne=we.map(e=>{if(!N.isValidElement(e))return null;let t;if(_){if(!Array.isArray(P))throw Error(j(2));t=P.some(t=>UZ(t,e.props.value)),t&&Me&&je.push(e.props.children)}else t=UZ(P,e.props.value),t&&Me&&(Ae=e.props.children);return N.cloneElement(e,{"aria-selected":t?`true`:`false`,onClick:Ee(e),onKeyUp:t=>{t.key===` `&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:`option`,selected:t,value:void 0,"data-value":e.props.value})});Me&&(ke=_?je.length===0?null:je.reduce((e,t,n)=>(e.push(t),n<je.length-1&&e.push(`, `),e),[]):Ae);let Pe=pe;!a&&fe&&ue&&(Pe=ye.clientWidth);let Fe;Fe=ee===void 0?u?null:0:ee;let Ie=M.id||(v?`mui-component-select-${v}`:void 0),Le={...e,variant:re,value:P,open:be,error:f},Re=ZZ(Le),ze={...g.PaperProps,...typeof g.slotProps?.paper==`function`?g.slotProps.paper(Le):g.slotProps?.paper},Be={...g.MenuListProps,...typeof g.slotProps?.list==`function`?g.slotProps.list(Le):g.slotProps?.list},Ve=Ki();return(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(JZ,{as:`div`,ref:ve,tabIndex:Fe,role:`combobox`,"aria-controls":be?Ve:void 0,"aria-disabled":u?`true`:void 0,"aria-expanded":be?`true`:`false`,"aria-haspopup":`listbox`,"aria-label":r,"aria-labelledby":[h,Ie].filter(Boolean).join(` `)||void 0,"aria-describedby":n,"aria-required":A?`true`:void 0,"aria-invalid":f?`true`:void 0,onKeyDown:De,onMouseDown:u||D?null:Se,onBlur:Oe,onFocus:S,...M,ownerState:Le,className:k(M.className,Re.select,s),id:Ie,children:HZ(ke)?qZ||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):ke}),(0,F.jsx)(XZ,{"aria-invalid":f,value:Array.isArray(P)?P.join(`,`):P,name:v,ref:ce,"aria-hidden":!0,onChange:Te,tabIndex:-1,disabled:u,className:Re.nativeInput,autoFocus:i,required:A,...ie,ownerState:Le}),(0,F.jsx)(YZ,{as:p,className:Re.icon,ownerState:Le}),(0,F.jsx)(KZ,{value:he,children:(0,F.jsx)(aK,{id:`menu-${v||``}`,anchorEl:ye,open:be,onClose:Ce,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},...g,slotProps:{...g.slotProps,list:{"aria-labelledby":h,role:`listbox`,"aria-multiselectable":_?`true`:void 0,disableListWrap:!0,id:Ve,...Be},paper:{...ze,style:{minWidth:Pe,...ze==null?null:ze.style}}},children:Ne})})]})}),$Z=WL((0,F.jsx)(`path`,{d:`M7 10l5 5 5-5z`}),`ArrowDropDown`);function eQ(e){return parseInt(e,10)||0}var tQ={shadow:{visibility:`hidden`,position:`absolute`,overflow:`hidden`,height:0,top:0,left:0,transform:`translateZ(0)`}};function nQ(e){for(let t in e)return!1;return!0}function rQ(e){return nQ(e)||e.outerHeightStyle===0&&!e.overflowing}var iQ=N.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:a,value:o,...s}=e,{current:c}=N.useRef(o!=null),l=N.useRef(null),u=aR(t,l),d=N.useRef(null),f=N.useRef(null),p=N.useCallback(()=>{let t=l.current,n=f.current;if(!t||!n)return;let a=XL(t).getComputedStyle(t);if(a.width===`0px`)return{outerHeightStyle:0,overflowing:!1};n.style.width=a.width,n.value=t.value||e.placeholder||`x`,n.value.slice(-1)===`
331
+ `&&(n.value+=` `);let o=a.boxSizing,s=eQ(a.paddingBottom)+eQ(a.paddingTop),c=eQ(a.borderBottomWidth)+eQ(a.borderTopWidth),u=n.scrollHeight;n.value=`x`;let d=n.scrollHeight,p=u;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),p=Math.max(p,d),{outerHeightStyle:p+(o===`border-box`?s+c:0),overflowing:Math.abs(p-u)<=1}},[r,i,e.placeholder]),m=rR(()=>{let e=l.current,t=p();if(!e||!t||rQ(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=N.useCallback(()=>{let e=l.current,t=p();if(!e||!t||rQ(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?`hidden`:``},[p]),g=N.useRef(-1);return fi(()=>{let e=GL(h),t=l?.current;if(!t)return;let n=XL(t);n.addEventListener(`resize`,e);let r;return typeof ResizeObserver<`u`&&(r=new ResizeObserver(()=>{m()&&(r.unobserve(t),cancelAnimationFrame(g.current),h(),g.current=requestAnimationFrame(()=>{r.observe(t)}))}),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),n.removeEventListener(`resize`,e),r&&r.disconnect()}},[p,h,m]),fi(()=>{h()}),(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(`
332
+ `),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,F.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...tQ.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function aQ(e){return Zr(`MuiInputBase`,e)}var oQ=Qr(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputSizeSmall`,`inputMultiline`,`inputTypeSearch`,`inputAdornedStart`,`inputAdornedEnd`,`inputHiddenLabel`]),sQ,cQ=`mui-auto-fill`,lQ=`mui-auto-fill-cancel`,uQ=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size===`small`&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${R(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},dQ=(e,t)=>{let{ownerState:n}=e;return[t.input,n.size===`small`&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type===`search`&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},fQ=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:c,hiddenLabel:l,multiline:u,readOnly:d,size:f,startAdornment:p,type:m}=e;return A({root:[`root`,`color${R(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${R(f)}`,u&&`multiline`,p&&`adornedStart`,a&&`adornedEnd`,l&&`hiddenLabel`,d&&`readOnly`],input:[`input`,r&&`disabled`,m===`search`&&`inputTypeSearch`,u&&`inputMultiline`,f===`small`&&`inputSizeSmall`,l&&`inputHiddenLabel`,p&&`inputAdornedStart`,a&&`inputAdornedEnd`,d&&`readOnly`]},aQ,t)},pQ=L(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:uQ})(Ro(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:`1.4375em`,boxSizing:`border-box`,position:`relative`,cursor:`text`,display:`inline-flex`,alignItems:`center`,[`&.${oQ.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:`default`},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:`4px 0 5px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:`100%`}}]}))),mQ=L(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:dQ})(Ro(({theme:e})=>{let t=e.palette.mode===`light`,n={color:`currentColor`,...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create(`opacity`,{duration:e.transitions.duration.shorter})},r={opacity:`0 !important`},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:`inherit`,letterSpacing:`inherit`,color:`currentColor`,padding:`4px 0 5px`,border:0,boxSizing:`content-box`,background:`none`,height:`1.4375em`,margin:0,WebkitTapHighlightColor:`transparent`,display:`block`,minWidth:0,width:`100%`,"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:`none`},"&::-webkit-search-decoration":{WebkitAppearance:`none`},[`label[data-shrink=false] + .${oQ.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${oQ.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:lQ,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:cQ}}},{props:{size:`small`},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:`auto`,resize:`none`,padding:0,paddingTop:0}},{props:{type:`search`},style:{MozAppearance:`textfield`}}]}})),hQ=Io({[`@keyframes ${cQ}`]:{from:{animationName:cQ}},[`@keyframes ${lQ}`]:{from:{animationName:lQ}}}),gQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiInputBase`}),{"aria-describedby":r,autoComplete:i,autoFocus:a,className:o,color:s,components:c={},componentsProps:l={},defaultValue:u,disabled:d,disableInjectingGlobalStyles:f,endAdornment:p,error:m,fullWidth:h=!1,id:g,inputComponent:_=`input`,inputProps:v={},inputRef:y,margin:b,maxRows:x,minRows:S,multiline:C=!1,name:w,onBlur:T,onChange:E,onClick:D,onFocus:O,onKeyDown:A,onKeyUp:M,placeholder:ee,readOnly:te,renderSuffix:ne,rows:re,size:ie,slotProps:P={},slots:ae={},startAdornment:oe,type:se=`text`,value:ce,...le}=n,ue=v.value==null?ce:v.value,{current:de}=N.useRef(ue!=null),fe=N.useRef(),pe=N.useCallback(e=>{},[]),me=oR(fe,y,v.ref,pe),[he,ge]=N.useState(!1),_e=aG(),ve=rG({props:n,muiFormControl:_e,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});ve.focused=_e?_e.focused:he,N.useEffect(()=>{!_e&&d&&he&&(ge(!1),T&&T())},[_e,d,he,T]);let ye=_e&&_e.onFilled,be=_e&&_e.onEmpty,xe=N.useCallback(e=>{_G(e)?ye&&ye():be&&be()},[ye,be]);$L(()=>{de&&xe({value:ue})},[ue,xe,de]),$L(()=>{if(!a)return;let e=fe.current;if(!e)return;let t=YL(e),n=ZV(t),r=n==null||n===t.body||n===t.documentElement;e===n?_e&&_e.onFocus?_e.onFocus():ge(!0):r&&e.focus()},[a]);let Se=e=>{O&&O(e),v.onFocus&&v.onFocus(e),_e&&_e.onFocus?_e.onFocus(e):ge(!0)},Ce=e=>{T&&T(e),v.onBlur&&v.onBlur(e),_e&&_e.onBlur?_e.onBlur(e):ge(!1)},we=(e,...t)=>{if(!de){let t=e.target||fe.current;if(t==null)throw Error(j(1));xe({value:t.value})}v.onChange&&v.onChange(e,...t),E&&E(e,...t)};N.useEffect(()=>{xe(fe.current)},[]);let Te=e=>{fe.current&&e.currentTarget===e.target&&fe.current.focus(),D&&D(e)},Ee=_,De=v;C&&Ee===`input`&&(De=re?{type:void 0,minRows:re,maxRows:re,...De}:{type:void 0,maxRows:x,minRows:S,...De},Ee=iQ);let Oe=e=>{xe(e.animationName===lQ?fe.current:{value:`x`})};N.useEffect(()=>{_e&&_e.setAdornedStart(!!oe)},[_e,oe]);let ke={...n,color:ve.color||`primary`,disabled:ve.disabled,endAdornment:p,error:ve.error,focused:ve.focused,formControl:_e,fullWidth:h,hiddenLabel:ve.hiddenLabel,multiline:C,size:ve.size,startAdornment:oe,type:se},Ae=fQ(ke),je=ae.root||c.Root||pQ,Me=P.root||l.root||{},Ne=ae.input||c.Input||mQ;return De={...De,...P.input??l.input},(0,F.jsxs)(N.Fragment,{children:[!f&&typeof hQ==`function`&&(sQ||=(0,F.jsx)(hQ,{})),(0,F.jsxs)(je,{...Me,ref:t,onClick:Te,...le,...!OV(je)&&{ownerState:{...ke,...Me.ownerState}},className:k(Ae.root,Me.className,o,te&&`MuiInputBase-readOnly`),children:[oe,(0,F.jsx)(iG.Provider,{value:null,children:(0,F.jsx)(Ne,{"aria-invalid":ve.error,"aria-describedby":r,autoComplete:i,autoFocus:a,defaultValue:u,disabled:ve.disabled,id:g,onAnimationStart:Oe,name:w,placeholder:ee,readOnly:te,required:ve.required,rows:re,value:ue,onKeyDown:A,onKeyUp:M,type:se,...De,...!OV(Ne)&&{as:Ee,ownerState:{...ke,...De.ownerState}},ref:me,className:k(Ae.input,De.className,te&&`MuiInputBase-readOnly`),onBlur:Ce,onChange:we,onFocus:Se})}),p,ne?ne({...ve,startAdornment:oe}):null]})]})});function _Q(e){return Zr(`MuiInput`,e)}var vQ={...oQ,...Qr(`MuiInput`,[`root`,`underline`,`input`])},yQ=e=>{let{classes:t,disableUnderline:n}=e,r=A({root:[`root`,!n&&`underline`],input:[`input`]},_Q,t);return{...t,...r}},bQ=L(pQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...uQ(e,t),!n.disableUnderline&&t.underline]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`;return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:`relative`,variants:[{props:({ownerState:e})=>e.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${vQ.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${vQ.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${vQ.disabled}, .${vQ.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${vQ.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),xQ=L(mQ,{name:`MuiInput`,slot:`Input`,overridesResolver:dQ})({}),SQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:s=`input`,multiline:c=!1,slotProps:l,slots:u={},type:d=`text`,...f}=n,p=yQ(n),m={root:{ownerState:{disableUnderline:r}}},h=l??a?P(l??a,m):m;return(0,F.jsx)(gQ,{slots:{root:u.root??i.Root??bQ,input:u.input??i.Input??xQ},slotProps:h,fullWidth:o,inputComponent:s,multiline:c,ref:t,type:d,...f,classes:p})});SQ.muiName=`Input`;function CQ(e){return Zr(`MuiFilledInput`,e)}var wQ={...oQ,...Qr(`MuiFilledInput`,[`root`,`underline`,`input`,`adornedStart`,`adornedEnd`,`sizeSmall`,`multiline`,`hiddenLabel`])},TQ=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,c=A({root:[`root`,!n&&`underline`,r&&`adornedStart`,i&&`adornedEnd`,a===`small`&&`size${R(a)}`,o&&`hiddenLabel`,s&&`multiline`],input:[`input`]},CQ,t);return{...t,...c}},EQ=L(pQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiFilledInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...uQ(e,t),!n.disableUnderline&&t.underline]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`,n=t?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`,r=t?`rgba(0, 0, 0, 0.06)`:`rgba(255, 255, 255, 0.09)`,i=t?`rgba(0, 0, 0, 0.09)`:`rgba(255, 255, 255, 0.13)`,a=t?`rgba(0, 0, 0, 0.12)`:`rgba(255, 255, 255, 0.12)`;return{position:`relative`,backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${wQ.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${wQ.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${wQ.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${wQ.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${wQ.disabled}, .${wQ.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${wQ.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:`25px 12px 8px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}}]}})),DQ=L(mQ,{name:`MuiFilledInput`,slot:`Input`,overridesResolver:dQ})(Ro(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),OQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFilledInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:s,inputComponent:c=`input`,multiline:l=!1,slotProps:u,slots:d={},type:f=`text`,...p}=n,m={...n,disableUnderline:r,fullWidth:o,inputComponent:c,multiline:l,type:f},h=TQ(n),g={root:{ownerState:m},input:{ownerState:m}},_=u??a?P(g,u??a):g;return(0,F.jsx)(gQ,{slots:{root:d.root??i.Root??EQ,input:d.input??i.Input??DQ},slotProps:_,fullWidth:o,inputComponent:c,multiline:l,ref:t,type:f,...p,classes:h})});OQ.muiName=`Input`;var kQ,AQ=L(`fieldset`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})({textAlign:`left`,position:`absolute`,bottom:0,right:0,top:-5,left:0,margin:0,padding:`0 8px`,pointerEvents:`none`,borderRadius:`inherit`,borderStyle:`solid`,borderWidth:1,overflow:`hidden`,minWidth:`0%`}),jQ=L(`legend`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})(Ro(({theme:e})=>({float:`unset`,width:`auto`,overflow:`hidden`,variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:`11px`,transition:e.transitions.create(`width`,{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:`block`,padding:0,height:11,fontSize:`0.75em`,visibility:`hidden`,maxWidth:.01,transition:e.transitions.create(`max-width`,{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:`nowrap`,"& > span":{paddingLeft:5,paddingRight:5,display:`inline-block`,opacity:0,visibility:`visible`}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:`100%`,transition:e.transitions.create(`max-width`,{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function MQ(e){let{children:t,classes:n,className:r,label:i,notched:a,...o}=e,s=i!=null&&i!==``,c={...e,notched:a,withLabel:s};return(0,F.jsx)(AQ,{"aria-hidden":!0,className:r,ownerState:c,...o,children:(0,F.jsx)(jQ,{ownerState:c,children:s?(0,F.jsx)(`span`,{children:i}):kQ||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`})})})}function NQ(e){return Zr(`MuiOutlinedInput`,e)}var PQ={...oQ,...Qr(`MuiOutlinedInput`,[`root`,`notchedOutline`,`input`])},FQ=e=>{let{classes:t}=e,n=A({root:[`root`],notchedOutline:[`notchedOutline`],input:[`input`]},NQ,t);return{...t,...n}},IQ=L(pQ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiOutlinedInput`,slot:`Root`,overridesResolver:uQ})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{position:`relative`,borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${PQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${PQ.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${PQ.focused} .${PQ.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{[`&.${PQ.focused} .${PQ.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${PQ.error} .${PQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${PQ.disabled} .${PQ.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:`16.5px 14px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{padding:`8.5px 14px`}}]}})),LQ=L(MQ,{name:`MuiOutlinedInput`,slot:`NotchedOutline`})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),RQ=L(mQ,{name:`MuiOutlinedInput`,slot:`Input`,overridesResolver:dQ})(Ro(({theme:e})=>({padding:`16.5px 14px`,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{padding:`8.5px 14px`}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),zQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiOutlinedInput`}),{components:r={},fullWidth:i=!1,inputComponent:a=`input`,label:o,multiline:s=!1,notched:c,slots:l={},slotProps:u={},type:d=`text`,...f}=n,p=FQ(n),m=aG(),h=rG({props:n,muiFormControl:m,states:[`color`,`disabled`,`error`,`focused`,`hiddenLabel`,`size`,`required`]}),g={...n,color:h.color||`primary`,disabled:h.disabled,error:h.error,focused:h.focused,formControl:m,fullWidth:i,hiddenLabel:h.hiddenLabel,multiline:s,size:h.size,type:d},_=l.root??r.Root??IQ,v=l.input??r.Input??RQ,[y,b]=mH(`notchedOutline`,{elementType:LQ,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:g,externalForwardedProps:{slots:l,slotProps:u},additionalProps:{label:o!=null&&o!==``&&h.required?(0,F.jsxs)(N.Fragment,{children:[o,` `,`*`]}):o}});return(0,F.jsx)(gQ,{slots:{root:_,input:v},slotProps:u,renderSuffix:e=>(0,F.jsx)(y,{...b,notched:c===void 0?!!(e.startAdornment||e.filled||e.focused):c}),fullWidth:i,inputComponent:a,multiline:s,ref:t,type:d,...f,classes:{...p,notchedOutline:null}})});zQ.muiName=`Input`;var BQ=e=>{let{classes:t}=e,n=A({root:[`root`]},zZ,t);return{...t,...n}},VQ={name:`MuiSelect`,slot:`Root`,shouldForwardProp:e=>Fo(e)&&e!==`variant`},HQ=L(SQ,VQ)(``),UQ=L(zQ,VQ)(``),WQ=L(OQ,VQ)(``),GQ=N.forwardRef(function(e,t){let n=zo({name:`MuiSelect`,props:e}),{autoWidth:r=!1,children:i,classes:a={},className:o,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:l=$Z,id:u,input:d,inputProps:f,label:p,labelId:m,MenuProps:h,multiple:g=!1,native:_=!1,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:S,variant:C=`outlined`,...w}=n,T=_?RZ:QZ,E=rG({props:n,muiFormControl:aG(),states:[`variant`,`error`]}),D=E.variant||C,O={...n,variant:D,classes:a},A=BQ(O),{root:j,...M}=A,ee=d||{standard:(0,F.jsx)(HQ,{ownerState:O}),outlined:(0,F.jsx)(UQ,{label:p,ownerState:O}),filled:(0,F.jsx)(WQ,{ownerState:O})}[D],te=oR(t,kV(ee));return(0,F.jsx)(N.Fragment,{children:N.cloneElement(ee,{inputComponent:T,inputProps:{children:i,error:E.error,IconComponent:l,variant:D,type:void 0,multiple:g,..._?{id:u}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:m,MenuProps:h,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:{id:u,...S}},...f,classes:f?P(M,f.classes):M,...d?d.props.inputProps:{}},...(g&&_||c)&&D===`outlined`?{notched:!0}:{},ref:te,className:k(ee.props.className,o,A.root),...!d&&{variant:D},...w})})});GQ.muiName=`Select`;function KQ(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t===`keyboard`})}catch{e.focus()}}var qQ=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},JQ=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:a,classes:o}=e,s=A({root:[`root`,n&&`dense`,t&&`disabled`,!i&&`gutters`,r&&`divider`,a&&`selected`]},kZ,o);return{...o,...s}},YQ=L(sz,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenuItem`,slot:`Root`,overridesResolver:qQ})(Ro(({theme:e})=>({...e.typography.body1,display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:`border-box`,whiteSpace:`nowrap`,"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${AZ.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${AZ.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${AZ.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${AZ.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${AZ.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${EZ.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${EZ.inset}`]:{marginLeft:52},[`& .${OZ.root}`]:{marginTop:0,marginBottom:0},[`& .${OZ.inset}`]:{paddingLeft:36},[`& .${DZ.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up(`sm`)]:{minHeight:`auto`}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${DZ.root} svg`]:{fontSize:`1.25rem`}}}]}))),XQ=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiMenuItem`}),{autoFocus:r=!1,component:i=`li`,dense:a=!1,divider:o=!1,disableGutters:s=!1,focusVisibleClassName:c,role:l=`menuitem`,tabIndex:u,className:d,...f}=n,p=GZ(),m=N.useContext(VG),h=N.useMemo(()=>({dense:a||m.dense||!1,disableGutters:s}),[m.dense,a,s]),g=N.useRef(null);$L(()=>{r&&g.current&&KQ(g.current,p)},[r]);let _={...n,dense:h.dense,divider:o,disableGutters:s},v=JQ(n),y=oR(g,t),{root:b,...x}=v,S;return n.disabled||(S=u===void 0?-1:u),(0,F.jsx)(VG.Provider,{value:h,children:(0,F.jsx)(YQ,{ref:y,role:l,tabIndex:S,component:i,focusVisibleClassName:k(v.focusVisible,c),className:k(v.root,d),...f,ownerState:_,classes:x})})}),ZQ=()=>{document.querySelectorAll(`.mq-supsub.mq-sup-only`).forEach(e=>{let t=e.previousElementSibling;t&&t.classList.contains(`mq-non-leaf`)&&t.querySelector(`.mq-fraction`)?e.classList.add(`mq-after-fraction-group`):e.classList.remove(`mq-after-fraction-group`)})},{commonMqFontStyles:QQ,commonMqKeyboardStyles:$Q,longdivStyles:e$,supsubStyles:t$}=QX,n$=D(`@pie-lib:math-toolbar:editor-and-pad`),r$=/\.|,/g,i$=L(`div`)(({theme:e})=>({zIndex:9,position:`relative`,textAlign:`center`,width:`auto`,"& > .mq-math-mode":{border:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`dotted 1px ${e.palette.primary.main}`,borderRadius:`0px`},"& .mq-overarrow-inner":{border:`none !important`,paddingTop:`0 !important`},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.8px`,marginTop:`0px`,minWidth:`1.23em`},"& .mq-parallelogram":{lineHeight:.85}})),a$=L(`div`)(({theme:e,hide:t})=>({display:t?`none`:`flex`,alignItems:`center`,"& .mq-editable-field .mq-cursor":{top:`-4px`},"& .mq-math-mode .mq-selection, .mq-editable-field .mq-selection":{paddingTop:`18px`},"& .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& .mq-math-mode .mq-overline .mq-overline-inner":{paddingTop:`0.4em !important`},"& .mq-overarrow.mq-arrow-both":{minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.45em`,left:`-1px`},"&:after":{position:`absolute !important`,top:`0px !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& *":{...QQ,...t$,...e$,"& .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-root-block":{paddingTop:`10px`},"& .mq-scaled .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`4px !important`,paddingTop:`6px !important`,paddingLeft:`6px !important`},"& .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`}},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),o$=L(SG)({flex:`initial`,width:`25%`,minWidth:`100px`,marginLeft:`15px`,marginTop:`5px`,marginBottom:`5px`,marginRight:`5px`,"& label":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& div":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}),s$=L(hG)(()=>({backgroundColor:`transparent`})),c$=L(`div`)(({theme:e,error:t})=>({minWidth:`500px`,maxWidth:`900px`,minHeight:`30px`,width:`100%`,display:`flex`,marginTop:e.spacing(1),marginBottom:e.spacing(1),...t&&{border:`2px solid red`},"& .mq-sqrt-prefix .mq-scaled":{verticalAlign:`middle !important`}})),l$=L(VX)(({controlledKeypadMode:e})=>({maxWidth:e?`400px`:`500px`,color:ZH(),backgroundColor:vU(),padding:`2px`})),u$=L(UW)({position:`absolute`,right:`12px`,border:`1px solid lightgrey`,color:ZH()}),d$=L(`hr`)(({theme:e})=>({padding:0,margin:0,height:`1px`,border:`none`,borderBottom:`solid 1px ${e.palette.primary.main}`})),f$=L(lZ)(({mode:e})=>({...$Q,...e===`language`&&{"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),p$=e=>{if(!e)return;let{type:t,value:n}=e;return t===`command`||t===`cursor`?e:t===`answer`?{type:`answer`,...e}:n===`clear`?{type:`clear`}:{type:`write`,value:n}},m$=class extends N.Component{static propTypes={classNames:p.object,keypadMode:p.oneOfType([p.string,p.number]),autoFocus:p.bool,allowAnswerBlock:p.bool,showKeypad:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,error:p.string,noDecimal:p.bool,hideInput:p.bool,noLatexHandling:p.bool,layoutForKeyPad:p.object,maxResponseAreas:p.number,additionalKeys:p.array,latex:p.string.isRequired,onAnswerBlockAdd:p.func,onFocus:p.func,onBlur:p.func,onChange:p.func.isRequired,setKeypadInteraction:p.func};constructor(e){super(e),this.state={equationEditor:`item-authoring`,addDisabled:!1}}componentDidMount(){this.input&&this.props.autoFocus&&setTimeout(()=>this.input.focus(),0)}onClick=e=>{let{noDecimal:t,noLatexHandling:n,onChange:r}=this.props,i=p$(e);if(n$(`mathChange: `,i),n){r(i.value);return}t&&(i.value===`.`||i.value===`,`)||i&&(i.type===`clear`?(n$(`call clear...`),this.input.clear()):i.type===`command`?this.input.command(i.value):i.type===`cursor`?this.input.keystroke(i.value):i.type===`answer`?this.input.write(`%response%`):this.input.write(i.value))};updateDisable=e=>{let{maxResponseAreas:t}=this.props;if(t){let n=this.checkResponseAreasNumber(t,e);this.setState({addDisabled:n})}};onAnswerBlockClick=()=>{this.props.onAnswerBlockAdd(),this.onClick({type:`answer`}),this.updateDisable(!0)};onEditorChange=e=>{let{onChange:t,noDecimal:n}=this.props;if(PJ(),ZQ(),this.updateDisable(!0),n&&(e.indexOf(`.`)!==-1||e.indexOf(`,`)!==-1)&&this.input){this.input.clear(),this.input.write(e.replace(r$,``));return}let r=e.match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.input&&r&&r?.length){try{this.input.mathField.__controller.cursor.insLeftOf(this.input.mathField.__controller.cursor.parent[-1].parent),this.input.mathField.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}return}t(e)};shouldComponentUpdate(e,t){let n=this.input.mathField.latex()!==e.latex;return n$(`[shouldComponentUpdate] `,`inputIsDifferent: `,n),!C(this.props.error,e.error)||!n&&this.props.keypadMode!==e.keypadMode||!n&&this.props.noDecimal!==e.noDecimal||!n&&this.state.equationEditor!==t.equationEditor?!0:!n&&this.props.controlledKeypad?this.props.showKeypad!==e.showKeypad:n}onEditorTypeChange=e=>{this.setState({equationEditor:e.target.value})};checkResponseAreasNumber=(e,t)=>{let{latex:n}=this.input&&this.input.props||{};if(n){let r=(n.match(/answerBlock/g)||[]).length;return t?r===e-1:r===e}return!1};render(){let{classNames:e,keypadMode:t,allowAnswerBlock:n,additionalKeys:r,controlledKeypad:i,controlledKeypadMode:a,showKeypad:o,setKeypadInteraction:s,noDecimal:c,hideInput:l,layoutForKeyPad:u,latex:d,onFocus:f,onBlur:p,error:m}=this.props,h=!i||i&&o,{addDisabled:g}=this.state;return n$(`[render]`,d),(0,F.jsxs)(i$,{className:e.mathToolbar,children:[(0,F.jsxs)(a$,{hide:l,children:[a&&(0,F.jsxs)(o$,{variant:`standard`,children:[(0,F.jsx)(s$,{id:`equation-editor-label`,children:`Equation Editor`}),(0,F.jsxs)(GQ,{labelId:`equation-editor-label`,id:`equation-editor-select`,name:`equationEditor`,label:`Equation Editor`,onChange:this.onEditorTypeChange,value:this.state.equationEditor,MenuProps:{transitionDuration:{enter:225,exit:195}},children:[(0,F.jsx)(XQ,{value:`non-negative-integers`,children:`Numeric - Non-Negative Integers`}),(0,F.jsx)(XQ,{value:`integers`,children:`Numeric - Integers`}),(0,F.jsx)(XQ,{value:`decimals`,children:`Numeric - Decimals`}),(0,F.jsx)(XQ,{value:`fractions`,children:`Numeric - Fractions`}),(0,F.jsx)(XQ,{value:1,children:`Grade 1 - 2`}),(0,F.jsx)(XQ,{value:3,children:`Grade 3 - 5`}),(0,F.jsx)(XQ,{value:6,children:`Grade 6 - 7`}),(0,F.jsx)(XQ,{value:8,children:`Grade 8 - HS`}),(0,F.jsx)(XQ,{value:`geometry`,children:`Geometry`}),(0,F.jsx)(XQ,{value:`advanced-algebra`,children:`Advanced Algebra`}),(0,F.jsx)(XQ,{value:`statistics`,children:`Statistics`}),(0,F.jsx)(XQ,{value:`item-authoring`,children:`Item Authoring`})]})]}),(0,F.jsx)(c$,{error:m,children:(0,F.jsx)(l$,{onFocus:()=>{f&&f(),this.updateDisable(!1)},onBlur:e=>{this.updateDisable(!1),p&&p(e)},className:e&&e.editor||``,controlledKeypadMode:a,ref:e=>this.input=e,latex:d,onChange:this.onEditorChange})})]}),n&&(0,F.jsx)(u$,{type:`primary`,style:{bottom:h?`320px`:`20px`},onClick:this.onAnswerBlockClick,disabled:g,children:`+ Response Area`}),(0,F.jsx)(d$,{}),h&&(0,F.jsx)(f$,{mode:a?this.state.equationEditor:t,controlledKeypadMode:a,layoutForKeyPad:u,additionalKeys:r,onClick:this.onClick,noDecimal:c,setKeypadInteraction:s})]})}},h$=L(Ez)(({hideBackground:e})=>({verticalAlign:`top`,width:`28px`,height:`28px`,color:`#00bb00`,...e&&{backgroundColor:MU(),"&:hover":{backgroundColor:yU()}},"& .MuiIconButton-label":{position:`absolute`,top:`2px`}})),g$=({onClick:e,hideBackground:t})=>(0,F.jsx)(h$,{"aria-label":`Done`,onClick:e,hideBackground:t,size:`large`,children:(0,F.jsx)(kz,{})});g$.propTypes={onClick:p.func,hideBackground:p.bool};var _$=g$,{commonMqFontStyles:v$,longdivStyles:y$,supsubStyles:b$}=QX,x$=D(`@pie-lib:math-toolbar:math-preview`),S$=L(`div`)(({theme:e,isSelected:t})=>({display:`inline-flex`,alignItems:`center`,position:`relative`,"& *":v$,...b$,...y$,"& > .mq-math-mode":{border:t?`solid 0px lightgrey`:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`solid 1px black`,borderRadius:`0px`},"& > .mq-math-mode .mq-root-block":{paddingTop:`7px !important`},"& > .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& > .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& > .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty":{paddingTop:`6px !important`,paddingLeft:`4px !important`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`0 !important`},"& > .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& > .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-editable-field .mq-cursor":{marginTop:`-15px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.5px`,marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},...t&&{border:`solid 1px ${e.palette.primary.main}`}})),C$=L(`span`)({position:`absolute`,bottom:0,left:0,right:0,top:0}),w$=class extends N.Component{static propTypes={latex:p.string,isSelected:p.bool,onFocus:p.func,onBlur:p.func};componentDidMount(){ZQ()}componentDidUpdate(e){this.props.latex!==e.latex&&ZQ()}render(){let{isSelected:e,onFocus:t,onBlur:n,latex:r}=this.props;return x$(`[render] latex: `,r),(0,F.jsxs)(S$,{isSelected:e,children:[` `,(0,F.jsx)(C$,{}),(0,F.jsx)(qX,{latex:r,onFocus:t,onBlur:n})]})}},T$=L(`div`)({display:`flex`,width:`100%`,zIndex:8,alignItems:`center`}),E$=class extends N.Component{static propTypes={autoFocus:p.bool,allowAnswerBlock:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,keypadMode:p.oneOfType([p.string,p.number]),classNames:p.object,error:p.string,maxResponseAreas:p.number,showKeypad:p.bool,noDecimal:p.bool,additionalKeys:p.array,latex:p.string.isRequired,onAnswerBlockAdd:p.func,onChange:p.func,onDone:p.func.isRequired,onFocus:p.func,onBlur:p.func,hideDoneButton:p.bool,keyPadCharacterRef:p.func,setKeypadInteraction:p.func};static defaultProps={classNames:{},keypadMode:`item-authoring`,autoFocus:!1,allowAnswerBlock:!1,controlledKeypad:!1,controlledKeypadMode:!1,noDecimal:!1,showKeypad:!0,additionalKeys:[],onChange:()=>{},onAnswerBlockAdd:()=>{},onFocus:()=>{},hideDoneButton:!1};constructor(e){super(e),this.state={latex:e.latex}}done=()=>{this.props.onDone(this.state.latex)};UNSAFE_componentWillReceiveProps(e){this.setState({latex:e.latex})}onChange=e=>{this.setState({latex:e}),this.props.onChange(e)};render(){let{latex:e}=this.state,{classNames:t,autoFocus:n,allowAnswerBlock:r,onAnswerBlockAdd:i,controlledKeypad:a,controlledKeypadMode:o,keypadMode:s,noDecimal:c,additionalKeys:l,showKeypad:u,onFocus:d,onBlur:f,hideDoneButton:p,error:m,keyPadCharacterRef:h,setKeypadInteraction:g,maxResponseAreas:_}=this.props;return(0,F.jsx)(D$,{autoFocus:n,classNames:t,onAnswerBlockAdd:i,allowAnswerBlock:r,latex:e,additionalKeys:l,noDecimal:c,keypadMode:s,keyPadCharacterRef:h,setKeypadInteraction:g,onChange:this.onChange,onDone:this.done,onFocus:d,onBlur:f,showKeypad:u,controlledKeypad:a,controlledKeypadMode:o,hideDoneButton:p,error:m,maxResponseAreas:_})}},D$=class extends N.Component{static propTypes={classNames:p.object,latex:p.string.isRequired,keypadMode:p.oneOfType([p.string,p.number]),hideInput:p.bool,noLatexHandling:p.bool,layoutForKeyPad:p.object,onChange:p.func.isRequired,onDone:p.func.isRequired,onBlur:p.func,onAnswerBlockAdd:p.func,additionalKeys:p.array,onFocus:p.func,autoFocus:p.bool,noDecimal:p.bool,allowAnswerBlock:p.bool,controlledKeypad:p.bool,controlledKeypadMode:p.bool,showKeypad:p.bool,hideDoneButton:p.bool,hideDoneButtonBackground:p.bool,error:p.any,maxResponseAreas:p.number,keyPadCharacterRef:p.object,setKeypadInteraction:p.func};static defaultProps={classNames:{},hideDoneButtonBackground:!1};render(){let{classNames:e,autoFocus:t,allowAnswerBlock:n,onAnswerBlockAdd:r,controlledKeypad:i,controlledKeypadMode:a,additionalKeys:o,showKeypad:s,keypadMode:c,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,keyPadCharacterRef:p,setKeypadInteraction:m,latex:h,onChange:g,onDone:_,onFocus:v,onBlur:y,hideDoneButton:b,hideDoneButtonBackground:x,error:S,maxResponseAreas:C}=this.props;return(0,F.jsxs)(T$,{className:e&&e.toolbar||``,ref:p,children:[(0,F.jsx)(`div`,{}),(0,F.jsx)(m$,{autoFocus:t,keypadMode:c,classNames:e||{},controlledKeypad:i,controlledKeypadMode:a,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,showKeypad:s,additionalKeys:o,allowAnswerBlock:n,onAnswerBlockAdd:r,latex:h,onChange:g,onFocus:v,onBlur:y,error:S,maxResponseAreas:C,setKeypadInteraction:m}),(!i||i&&s)&&!b&&(0,F.jsx)(_$,{hideBackground:x,onClick:_})]})}},O$=new pu(`ensureTextAfterMath`),k$=(e=[])=>e.map(e=>({name:e,latex:e,write:e,label:e})),A$=e=>new uu({key:O$,appendTransaction:(t,n,r)=>{if(!t.some(e=>e.docChanged))return null;let i=r.tr,a=!1;return r.doc.descendants((t,n)=>{if(t.type.name===e){let e=n+t.nodeSize,o=r.doc.nodeAt(e);(!o||o.type.name!==`text`)&&(i.insert(e,r.schema.text(`​`)),a=!0)}}),a?i:null}}),j$=(e,t)=>{let n;for(n=t;n>0;n--){let t=e.nodeAt(n);if(t?.type?.name===`text`&&t.textContent!==`​`)return-1;if(t&&t?.type?.name!==`text`)break}return n},M$=new uu({key:new pu(`zeroWidthSpaceHandling`),props:{handleKeyDown(e,t){let{state:n,dispatch:r}=e,{selection:i,doc:a}=n,{from:o,empty:s}=i;if(s&&t.key===`Backspace`&&o>0){let e=j$(a,o);return e===-1?!1:(r(n.tr.delete(e,o)),!0)}if(s&&t.key===`ArrowLeft`&&o>0){let e=j$(a,o);if(e===-1)return!1;let t=n.doc.resolve(e);if(t.nodeAfter||t.nodeBefore){let t=n.doc.resolve(e);return r(n.tr.setSelection(W.create(n.doc,t.pos))),!0}else return r(n.tr.setSelection(U.create(n.doc,o-2))),!0}return!1}}}),N$=Lb.create({name:`math`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``},wrapper:{default:null},html:{default:null}}},addProseMirrorPlugins(){return[A$(this.name),M$]},parseHTML(){return[{tag:`span[data-latex]`,getAttrs:e=>({latex:e.getAttribute(`data-raw`)||e.textContent})},{tag:`span[data-type="mathml"]`,getAttrs:e=>({html:e.innerHTML})}]},addCommands(){return{insertMath:(e=``)=>({tr:t,editor:n,dispatch:r})=>{let{state:i}=n.view,a=i.schema.nodes.math.create({latex:e}),{selection:o}=i,s=o.$from.pos;if(t.insert(s,a),a?.type?.name===this.name){let e=W.create(t.doc,o.$from.pos);t.setSelection(e)}return r(t),Rz(n,!0),!0}}},renderHTML({HTMLAttributes:e}){return e.html?[`span`,{"data-type":`mathml`,dangerouslySetInnerHTML:{__html:e.html}}]:[`span`,{"data-latex":``,"data-raw":e.latex},OW(e.latex,e.wrapper)]},addNodeView(){return dS(e=>(0,F.jsx)(P$,{...e,options:this.options}))}}),P$=e=>{let{node:t,updateAttributes:n,editor:r,selected:i,options:a,getPos:o}=e,[s,c]=(0,N.useState)(i),l=(0,N.useRef)(null),u=(0,N.useRef)(null),d=(0,N.useRef)(Date.now()),[f,p]=(0,N.useState)({top:0,left:0}),{math:m={}}=a||{},{keypadMode:h,controlledKeypadMode:g=!0,customKeys:_=[],keyPadCharacterRef:v,setKeypadInteraction:y}=m,b=t.attrs.latex||``,x=e=>{n({latex:e})},S=(e,{moveCursorAfterNode:i=!0}={})=>{if(n({latex:e}),c(!1),i&&typeof o==`function`){let e=o(),{doc:n}=r.state,i=U.create(n,e+t.nodeSize),a=r.state.tr.setSelection(i);r.view.dispatch(a)}r.commands.focus()};return(0,N.useEffect)(()=>{if(!i)return;let{selection:e}=r.state;e.node?.type?.name===`math`&&c(!0)},[i,r]),(0,N.useEffect)(()=>{Rz(r,i||s)},[r,s,i]),(0,N.useEffect)(()=>{if(!r||!s){p({top:0,left:0});return}let e=()=>{if(!l.current)return;let{from:e}=r.state.selection,t=r.view.coordsAtPos(e),n=u.current?.getBoundingClientRect?.(),i=n?.height?n.top:t.top,a=n?.width?n.left:t.left,o=n?.height?n.bottom:t.bottom??t.top,s=l.current.offsetHeight,c=l.current.offsetWidth,d=window.innerHeight-(o+0)>=s?o+0:i-s-0,f=a;d=Math.max(8,Math.min(d,window.innerHeight-s-8)),f=Math.max(8,Math.min(f,window.innerWidth-c-8));let m=(r._tiptapContainerEl||document.body).getBoundingClientRect();p({top:d-m.top,left:f-m.left})};e();let t=null,n=()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))};return t=requestAnimationFrame(()=>{t=null,e()}),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{t!==null&&cancelAnimationFrame(t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[r,s]),(0,N.useEffect)(()=>{let e=e=>{let n=e?.target,i=(document.querySelectorAll?.(`[id^="equation-editor-select"][id*="listbox"], [aria-labelledby="equation-editor-label"][role="listbox"]`)||[]).length>0,a=!!(n?.id&&n.id.includes(`equation-editor-select`))||!!n?.closest?.(`[id*="equation-editor-select"]`),o=!!n?.closest?.(`.math-node-${d.current}`);if(l.current&&!l.current.contains(n)&&!n?.closest?.(`[data-inline-node]`)&&!i&&!a&&!o){c(!1);let e=!!r?.view?.dom?.contains(n);S(t.attrs.latex,{moveCursorAfterNode:!e})}};return s?document.addEventListener(`click`,e):document.removeEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,s,t]),(0,F.jsxs)(rS,{className:`math-node-${d.current}`,style:{display:`inline-flex`,cursor:`pointer`,margin:`0 4px`},"data-selected":i,children:[(0,F.jsx)(`div`,{ref:u,onClick:()=>c(!0),contentEditable:!1,children:(0,F.jsx)(w$,{latex:b})}),s&&Rx.createPortal((0,F.jsx)(`div`,{ref:l,"data-toolbar-for":r.instanceId,style:{position:`absolute`,top:`${f.top}px`,left:`${f.left}px`,zIndex:1e3,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`},children:(0,F.jsx)(E$,{latex:b,autoFocus:!0,onChange:x,onDone:S,keypadMode:h,controlledKeypadMode:g,additionalKeys:k$(_),keyPadCharacterRef:v,setKeypadInteraction:y})}),r?._tiptapContainerEl||document.body)]})};function F$(e){return Zr(`MuiLinearProgress`,e)}Qr(`MuiLinearProgress`,[`root`,`colorPrimary`,`colorSecondary`,`determinate`,`indeterminate`,`buffer`,`query`,`dashed`,`dashedColorPrimary`,`dashedColorSecondary`,`bar`,`bar1`,`bar2`,`barColorPrimary`,`barColorSecondary`,`bar1Indeterminate`,`bar1Determinate`,`bar1Buffer`,`bar2Indeterminate`,`bar2Buffer`]);var I$=4,L$=pr`
333
333
  0% {
334
334
  left: -35%;
335
335
  right: 100%;
@@ -344,9 +344,9 @@ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`
344
344
  left: 100%;
345
345
  right: -90%;
346
346
  }
347
- `,A$=typeof k$==`string`?null:fr`
348
- animation: ${k$} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
349
- `,j$=pr`
347
+ `,R$=typeof L$==`string`?null:fr`
348
+ animation: ${L$} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
349
+ `,z$=pr`
350
350
  0% {
351
351
  left: -200%;
352
352
  right: 100%;
@@ -361,9 +361,9 @@ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`
361
361
  left: 107%;
362
362
  right: -8%;
363
363
  }
364
- `,M$=typeof j$==`string`?null:fr`
365
- animation: ${j$} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
366
- `,N$=pr`
364
+ `,B$=typeof z$==`string`?null:fr`
365
+ animation: ${z$} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
366
+ `,V$=pr`
367
367
  0% {
368
368
  opacity: 1;
369
369
  background-position: 0 -23px;
@@ -378,20 +378,20 @@ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`
378
378
  opacity: 1;
379
379
  background-position: -200px -23px;
380
380
  }
381
- `,P$=typeof N$==`string`?null:fr`
382
- animation: ${N$} 3s infinite linear;
383
- `,F$=e=>{let{classes:t,variant:n,color:r}=e;return A({root:[`root`,`color${R(r)}`,n],dashed:[`dashed`,`dashedColor${R(r)}`],bar1:[`bar`,`bar1`,`barColor${R(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${R(r)}`,n===`buffer`&&`color${R(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},D$,t)},I$=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),L$=L(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${R(n.color)}`],t[n.variant]]}})(Ro(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{backgroundColor:I$(e,t)}})),{props:({ownerState:e})=>e.color===`inherit`&&e.variant!==`buffer`,style:{"&::before":{content:`""`,position:`absolute`,left:0,top:0,right:0,bottom:0,backgroundColor:`currentColor`,opacity:.3}}},{props:{variant:`buffer`},style:{backgroundColor:`transparent`}},{props:{variant:`query`},style:{transform:`rotate(180deg)`}}]}))),R$=L(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${R(n.color)}`]]}})(Ro(({theme:e})=>({position:`absolute`,marginTop:0,height:`100%`,width:`100%`,backgroundSize:`10px 10px`,backgroundPosition:`0 -23px`,variants:[{props:{color:`inherit`},style:{opacity:.3,backgroundImage:`radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>{let n=I$(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),P$||{animation:`${N$} 3s infinite linear`}),z$=L(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${R(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(Ro(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[{props:{color:`inherit`},style:{backgroundColor:`currentColor`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${O$}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${O$}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:A$||{animation:`${k$} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),B$=L(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${R(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(Ro(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:e})=>e.variant!==`buffer`&&e.color!==`inherit`,style:{backgroundColor:`var(--LinearProgressBar2-barColor, currentColor)`}},{props:({ownerState:e})=>e.variant!==`buffer`&&e.color===`inherit`,style:{backgroundColor:`currentColor`}},{props:{color:`inherit`},style:{opacity:.3}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:I$(e,t),transition:`transform .${O$}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:M$||{animation:`${j$} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),V$=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiLinearProgress`}),{className:r,color:i=`primary`,value:a,valueBuffer:o,variant:s=`indeterminate`,...c}=n,l={...n,color:i,variant:s},u=F$(l),d=Ri(),f={},p={bar1:{},bar2:{}};if((s===`determinate`||s===`buffer`)&&a!==void 0){f[`aria-valuenow`]=Math.round(a),f[`aria-valuemin`]=0,f[`aria-valuemax`]=100;let e=a-100;d&&(e=-e),p.bar1.transform=`translateX(${e}%)`}if(s===`buffer`&&o!==void 0){let e=(o||0)-100;d&&(e=-e),p.bar2.transform=`translateX(${e}%)`}return(0,F.jsxs)(L$,{className:k(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,F.jsx)(R$,{className:u.dashed,ownerState:l}):null,(0,F.jsx)(z$,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,F.jsx)(B$,{className:u.bar2,ownerState:l,style:p.bar2})]})}),H$=D(`@pie-lib:editable-html:image:insert-image-handler`),U$=class{constructor(e,t,n,r=!1){this.editor=e,this.nodeInfo=t,this.node=t[0],this.nodePos=t[1],this.onFinish=n,this.isPasted=r,this.chosenFile=null}cancel(){H$(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(this.nodePos);if(i){let t=r.setNodeMarkup(this.nodePos,void 0,{...i.attrs,...e});n.dispatch(t)}}deleteNode(){let{state:e,view:t}=this.editor,{tr:n}=e,r=n.delete(this.nodePos,this.nodePos+this.node.nodeSize);t.dispatch(r)}done(e,t){H$(`done: err:`,e),e?(console.log(e),this.onFinish(!1)):(this.updateNode({loaded:!0,src:t,percent:100}),this.onFinish(!0)),this.editor._insertingImage=!1}fileChosen(e){if(!e)return;this.chosenFile=e,this.editor._insertingImage=!1,H$(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){H$(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function W$(e){return Zr(`MuiDialogContent`,e)}Qr(`MuiDialogContent`,[`root`,`dividers`]);function G$(e){return Zr(`MuiDialogTitle`,e)}var K$=Qr(`MuiDialogTitle`,[`root`]),q$=e=>{let{classes:t,dividers:n}=e;return A({root:[`root`,n&&`dividers`]},W$,t)},J$=L(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Ro(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${K$.root} + &`]:{paddingTop:0}}}]}))),Y$=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=q$(o);return(0,F.jsx)(J$,{className:k(s.root,r),ownerState:o,ref:t,...a})}),X$=IL((0,F.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function Z$(e){return Zr(`MuiFormHelperText`,e)}var Q$=Qr(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),$$,e1=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return A({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${R(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},Z$,t)},t1=L(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${R(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Ro(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Q$.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Q$.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),n1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,m=YW({props:n,muiFormControl:ZW(),states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete h.ownerState;let g=e1(h);return(0,F.jsx)(t1,{as:a,className:k(g.root,i),ref:t,...p,ownerState:h,children:r===` `?$$||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):r})});function r1(e){return Zr(`MuiTextField`,e)}Qr(`MuiTextField`,[`root`]);var i1={standard:mQ,filled:bQ,outlined:jQ},a1=e=>{let{classes:t}=e;return A({root:[`root`]},r1,t)},o1=L(mG,{name:`MuiTextField`,slot:`Root`})({}),s1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,FormHelperTextProps:d,fullWidth:f=!1,helperText:p,id:m,InputLabelProps:h,inputProps:g,InputProps:_,inputRef:v,label:y,maxRows:b,minRows:x,multiline:S=!1,name:C,onBlur:w,onChange:T,onFocus:E,placeholder:D,required:O=!1,rows:A,select:j=!1,SelectProps:M,slots:ee={},slotProps:te={},type:N,value:ne,variant:re=`outlined`,...ie}=n,P={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:j,variant:re},ae=a1(P),oe=Ki(m),se=p&&oe?`${oe}-helper-text`:void 0,ce=y&&oe?`${oe}-label`:void 0,le=i1[re],ue={slots:ee,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:M,...te}},de={},fe=ue.slotProps.inputLabel;re===`outlined`&&(fe&&fe.shrink!==void 0&&(de.notched=fe.shrink),de.label=y),j&&((!M||!M.native)&&(de.id=void 0),de[`aria-describedby`]=void 0);let[pe,me]=oH(`root`,{elementType:o1,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...ie},ownerState:P,className:k(ae.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:re}}),[he,ge]=oH(`input`,{elementType:le,externalForwardedProps:ue,additionalProps:de,ownerState:P}),[_e,ve]=oH(`inputLabel`,{elementType:sG,externalForwardedProps:ue,ownerState:P}),[ye,be]=oH(`htmlInput`,{elementType:`input`,externalForwardedProps:ue,ownerState:P}),[xe,Se]=oH(`formHelperText`,{elementType:n1,externalForwardedProps:ue,ownerState:P}),[Ce,we]=oH(`select`,{elementType:LQ,externalForwardedProps:ue,ownerState:P}),Te=(0,F.jsx)(he,{"aria-describedby":se,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:A,maxRows:b,minRows:x,type:N,value:ne,id:oe,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:be,slots:{input:ee.htmlInput?ye:void 0},...ge});return(0,F.jsxs)(pe,{...me,children:[y!=null&&y!==``&&(0,F.jsx)(_e,{htmlFor:oe,id:ce,...ve,children:y}),j?(0,F.jsx)(Ce,{"aria-describedby":se,id:oe,labelId:ce,value:ne,input:Te,...we,children:a}):Te,p&&(0,F.jsx)(xe,{id:se,...Se,children:p})]})});function c1(e){return Zr(`MuiDialogActions`,e)}Qr(`MuiDialogActions`,[`root`,`spacing`]);var l1=e=>{let{classes:t,disableSpacing:n}=e;return A({root:[`root`,!n&&`spacing`]},c1,t)},u1=L(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),d1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=l1(o);return(0,F.jsx)(u1,{className:k(s.root,r),ownerState:o,ref:t,...a})});function f1(e){return Zr(`MuiDialog`,e)}var p1=Qr(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),m1=N.createContext({}),h1=L(pH,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),g1=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return A({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${R(n)}`],paper:[`paper`,`paperScroll${R(n)}`,`paperWidth${R(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},f1,t)},_1=L(CH,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),v1=L(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${R(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),y1=L(DH,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${R(n.scroll)}`],t[`paperWidth${R(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Ro(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${p1.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${p1.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0,[`&.${p1.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),b1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialog`}),r=Mo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:l,children:u,className:d,disableEscapeKeyDown:f=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:h=`sm`,onClick:g,onClose:_,open:v,PaperComponent:y=DH,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=lH,transitionDuration:E=i,TransitionProps:D,...O}=n,A={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},j=g1(A),M=N.useRef(),ee=e=>{M.current=e.target===e.currentTarget},te=e=>{g&&g(e),M.current&&(M.current=null,_&&_(e,`backdropClick`))},ne=Ki(o),re=N.useMemo(()=>({titleId:ne}),[ne]),ie={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[P,ae]=oH(`root`,{elementType:_1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:k(j.root,d),ref:t}),[oe,se]=oH(`backdrop`,{elementType:h1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:j.backdrop}),[ce,le]=oH(`paper`,{elementType:y1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:j.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":ne,"aria-modal":s,tabIndex:-1,[WV]:``}}),[ue,de]=oH(`container`,{elementType:v1,externalForwardedProps:ie,ownerState:A,className:j.container}),[fe,pe]=oH(`transition`,{elementType:lH,externalForwardedProps:ie,ownerState:A,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,F.jsx)(P,{closeAfterTransition:!0,slots:{backdrop:oe},slotProps:{backdrop:{transitionDuration:E,as:c,...se}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:te,...ae,...O,children:(0,F.jsx)(fe,{...pe,children:(0,F.jsx)(ue,{onMouseDown:ee,...de,children:(0,F.jsx)(ce,{as:y,...le,children:(0,F.jsx)(m1.Provider,{value:re,children:u})})})})})}),x1=class extends N.Component{static propTypes={onDone:p.func.isRequired,alt:p.string};constructor(e){super(e);let{alt:t}=e;this.state={value:t}}closeDialog=()=>{document.querySelectorAll(`#text-dialog`).forEach(function(e){return e.remove()})};onDone=()=>{let{onDone:e}=this.props,{value:t}=this.state;e(t),this.closeDialog()};handleOverflow=()=>{document.body.style.removeProperty(`overflow`)};render(){let{value:e}=this.state;return(0,F.jsxs)(b1,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,F.jsx)(Y$,{children:(0,F.jsxs)(`div`,{style:{display:`flex`},children:[(0,F.jsx)(X$,{style:{paddingTop:`6px`}}),(0,F.jsx)(s1,{multiline:!0,placeholder:`Enter an Alt Text description of this image`,helperText:`Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.`,value:e,onChange:e=>this.setState({value:e.target.value}),FormHelperTextProps:{style:{fontSize:14}}})]})}),(0,F.jsx)(d1,{children:(0,F.jsx)(FW,{onClick:this.onDone,children:`Done`})})]})}},S1=L(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?UH():WH(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?WH():UH()},"&:focus":{outline:`2px solid ${AU()}`},...t&&{opacity:.7}})),C1=D(`pie-elements:editable-html:raw-button`);(class extends N.Component{static propTypes={onClick:p.func.isRequired,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,active:p.bool,disabled:p.bool,extraStyles:p.object};constructor(e){super(e)}onClick=e=>{C1(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){C1(`[onKeyDown]`),e.preventDefault();let{onClick:t}=this.props;t(e)}};render(){let{active:e,children:t,disabled:n,extraStyles:r,ariaLabel:i}=this.props;return(0,F.jsx)(S1,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var w1=class extends N.Component{static propTypes={onToggle:p.func.isRequired,mark:p.string,label:p.string.isRequired,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,active:p.bool};constructor(e){super(e)}onToggle=e=>{e.preventDefault(),this.props.onToggle(this.props.mark)};onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.props.onToggle(this.props.mark))};render(){let{children:e,active:t,label:n}=this.props;return(0,F.jsx)(S1,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},T1=D(`@pie-lib:editable-html:plugins:image:image-toolbar`),E1=L(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),D1=L(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),O1=({alignment:e,active:t,onClick:n})=>(0,F.jsx)(w1,{active:t,onToggle:()=>n(e),label:e,children:e});O1.propTypes={alignment:p.string.isRequired,active:p.bool.isRequired,onClick:p.func.isRequired};var k1=class extends N.Component{static propTypes={onChange:p.func.isRequired,alignment:p.string,alt:p.string,imageLoaded:p.bool,disableImageAlignmentButtons:p.bool};onAltTextDone=e=>{T1(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{T1(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,F.jsx)(x1,{alt:e,onDone:this.onAltTextDone});Rx.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,F.jsxs)(E1,{children:[!n&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(O1,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,F.jsx)(O1,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,F.jsx)(O1,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,F.jsx)(D1,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}},A1=L(V$,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),j1=L(`div`,{shouldForwardProp:e=>![`active`,`loading`,`pendingDelete`].includes(e)})(({loading:e,pendingDelete:t})=>({position:`relative`,display:`flex`,transition:`opacity 200ms linear`,...e&&{opacity:.3},...t&&{opacity:.3}})),M1=L(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),N1=L(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),P1=L(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),F1=e=>e?`${e}px`:`calc(20px)`;function I1(e){let{node:t,editor:n,attributes:r,onFocus:i,getPos:a,selected:o,options:s,maxImageWidth:c=700,maxImageHeight:l=900}=e,{alt:u}=t.attrs,d=a(),f=n.state.selection.from,p=n.state.selection.to,m=(0,N.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(t),v=(0,N.useRef)(null),y=(0,N.useRef)(null),b=(0,N.useRef)(null),x=(0,N.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,N.useCallback)(()=>{let e=_.current.attrs.nodeKey,t=null;return n.state.doc.descendants((n,r)=>{if(t!==null)return!1;if(n.type.name===`imageUploadNode`&&n.attrs.nodeKey===e)return t=r,!1}),t},[n]),w=(0,N.useCallback)(e=>{let t=S();if(t===null)return;let r=n.state.doc.nodeAt(t);r&&n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...r.attrs,...e}))},[n,S]),T=(0,N.useCallback)(()=>{if(!t.attrs.width||!v.current||!v.current.naturalWidth)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&w({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,w]);(0,N.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,N.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new U$(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,N.useEffect)(()=>{T();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,j,!1),()=>{e&&e.removeEventListener(`mousedown`,j,!1)}},[]),(0,N.useEffect)(()=>{T()});let E=(0,N.useCallback)(()=>{let e=v.current;if(e&&(!e.style.width||e.style.width===`calc(20px)`)){let n=Math.min(e.naturalWidth,c),r=Math.min(e.naturalHeight,l);e.style.width=`${n}px`,e.style.height=`${r}px`;let i={width:n,height:r};C(i,{width:t.attrs.width,height:t.attrs.height})||w(i)}},[t.attrs.width,t.attrs.height,c,l,w]),D=(e,t,n=!0,r)=>{if(n){let n=e.width/e.height;return r===`height`?{width:t.height*n,height:t.height}:{width:t.width,height:t.width/n}}return t},O=(0,N.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r={width:t.naturalWidth,height:t.naturalHeight},i=D(r,{width:e.clientX-n.left,height:e.clientY-n.top});i.width>50&&i.height>50&&i.width<=700&&i.height<=900&&(t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,w({width:i.width,height:i.height}))},[n,w]),k=(0,N.useCallback)(e=>{w(e)},[n,w]),A=(0,N.useCallback)(()=>{window.removeEventListener(`mousemove`,O),window.removeEventListener(`mouseup`,A)},[O]),j=(0,N.useCallback)(()=>{window.addEventListener(`mousemove`,O),window.addEventListener(`mouseup`,A)},[O,A]),M={width:F1(t.attrs.width),height:F1(t.attrs.height),objectFit:`contain`},ee={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,F.jsxs)(rS,{children:[(0,F.jsxs)(j1,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:ee},children:[(0,F.jsx)(A1,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,F.jsxs)(M1,{onDragStart:e=>e.preventDefault(),children:[(0,F.jsx)(N1,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:M,onLoad:E,alt:t.attrs.alt}),(0,F.jsx)(P1,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(`div`,{ref:b,style:{zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,width:`100%`},children:(0,F.jsx)(Oz,{showDone:!0,deletable:!0,toolbarOpts:s.toolbarOpts||{},onDelete:()=>{let e=S();e!==null&&(s.imageHandling?.onDelete?.(_.current),n.view.dispatch(n.state.tr.delete(e,e+n.state.doc.nodeAt(e).nodeSize)),g(!1),n.commands.focus())},onDone:()=>{g(!1),s.imageHandling?.onDone?.(n),n.commands.focus(`end`)},children:(0,F.jsx)(k1,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:k})})}),n._tiptapContainerEl)]})}I1.propTypes={node:p.object.isRequired,editor:p.object.isRequired,attributes:p.object,onFocus:p.func,maxImageWidth:p.number,maxImageHeight:p.number};var L1=Lb.create({name:`imageUploadNode`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{nodeKey:{default:null},loaded:{default:!1},deleteStatus:{default:null},alignment:{default:null},percent:{default:null},width:{default:null},height:{default:null},src:{default:null},alt:{default:null}}},parseHTML(){return[{tag:`img[data-type="image-upload-node"]`}]},renderHTML({HTMLAttributes:e}){return[`img`,Vv(e,{"data-type":`image-upload-node`})]},addNodeView(){return dS(e=>(0,F.jsx)(I1,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})}},addProseMirrorPlugins(){let e=this.editor;return[new uu({props:{handlePaste(t,n){let r=Array.from(n.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!r)return!1;let i=r.getAsFile();if(!i)return!1;let a=new FileReader;return a.onload=()=>{let t=a.result;typeof t==`string`&&e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!0,nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})},a.readAsDataURL(i),!0}}})]}});function R1(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function z1(e,t,n,r={},i=()=>{}){let{ease:a=R1,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var B1={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function V1(e){let{onChange:t,...n}=e,r=N.useRef(),i=N.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return GL(()=>{let e=RL(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=UL(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),N.useEffect(()=>{a(),t(r.current)},[t]),(0,F.jsx)(`div`,{style:B1,...n,ref:i})}var H1=IL((0,F.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),U1=IL((0,F.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function W1(e){return Zr(`MuiTabScrollButton`,e)}var G1=Qr(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),K1=e=>{let{classes:t,orientation:n,disabled:r}=e;return A({root:[`root`,n,r&&`disabled`]},W1,t)},q1=L($R,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${G1.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),J1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=Ri(),d={isRtl:u,...n},f=K1(d),p=i.StartScrollButtonIcon??H1,m=i.EndScrollButtonIcon??U1,h=MG({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=MG({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,F.jsx)(q1,{component:`div`,className:k(f.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...l,style:{...l.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:o===`left`?(0,F.jsx)(p,{...h}):(0,F.jsx)(m,{...g})})});function Y1(e){return Zr(`MuiTabs`,e)}var X1=Qr(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),Z1=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Q1=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,$1=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||i.getAttribute(`aria-disabled`)===`true`;if(!i.hasAttribute(`tabindex`)||t)i=n(e,i);else{i.focus();return}}},e0=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return A({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,`flexContainer`,t&&`flexContainerVertical`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},Y1,c)},t0=L(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${X1.scrollButtons}`]:t.scrollButtons},{[`& .${X1.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Ro(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${X1.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),n0=L(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),r0=L(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),i0=L(`span`,{name:`MuiTabs`,slot:`Indicator`})(Ro(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),a0=L(V1)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),o0={},s0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTabs`}),r=Mo(),i=Ri(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,ScrollButtonComponent:g,scrollButtons:_=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},TabIndicatorProps:x={},TabScrollButtonProps:S={},textColor:C=`primary`,value:w,variant:T=`standard`,visibleScrollbar:E=!1,...D}=n,O=T===`scrollable`,A=h===`vertical`,j=A?`scrollTop`:`scrollLeft`,M=A?`top`:`left`,ee=A?`bottom`:`right`,te=A?`clientHeight`:`clientWidth`,ne=A?`height`:`width`,re={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:A,scrollButtons:_,textColor:C,variant:T,visibleScrollbar:E,fixed:!O,hideScrollbar:O&&!E,scrollableX:O&&!A,scrollableY:O&&A,centered:c&&!O,scrollButtonsHideMobile:!f},ie=e0(re),P=MG({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:re}),ae=MG({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:re}),[oe,se]=N.useState(!1),[ce,le]=N.useState(o0),[ue,de]=N.useState(!1),[fe,pe]=N.useState(!1),[me,he]=N.useState(!1),[ge,_e]=N.useState({overflow:`hidden`,scrollbarWidth:0}),ve=new Map,ye=N.useRef(null),be=N.useRef(null),xe={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},Se=()=>{let e=ye.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&w!==!1){let e=be.current.children;if(e.length>0){let t=e[ve.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},Ce=XL(()=>{let{tabsMeta:e,tabMeta:t}=Se(),n=0,r;A?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[ne]:t?t[ne]:0};if(typeof ce[r]!=`number`||typeof ce[ne]!=`number`)le(a);else{let e=Math.abs(ce[r]-a[r]),t=Math.abs(ce[ne]-a[ne]);(e>=1||t>=1)&&le(a)}}),we=(e,{animation:t=!0}={})=>{t?z1(j,ye.current,e,{duration:r.transitions.duration.standard}):ye.current[j]=e},Te=e=>{let t=ye.current[j];A?t+=e:t+=e*(i?-1:1),we(t)},Ee=()=>{let e=ye.current[te],t=0,n=Array.from(be.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[te]>e){r===0&&(t=e);break}t+=i[te]}return t},De=()=>{Te(-1*Ee())},Oe=()=>{Te(Ee())},[ke,{onChange:Ae,...je}]=oH(`scrollbar`,{className:k(ie.scrollableX,ie.hideScrollbar),elementType:a0,shouldForwardComponentProp:!0,externalForwardedProps:xe,ownerState:re}),Me=N.useCallback(e=>{Ae?.(e),_e({overflow:null,scrollbarWidth:e})},[Ae]),[Ne,Pe]=oH(`scrollButtons`,{className:k(ie.scrollButtons,S.className),elementType:J1,externalForwardedProps:xe,ownerState:re,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:P,endScrollButtonIcon:ae}}}),Fe=()=>{let e={};e.scrollbarSizeListener=O?(0,F.jsx)(ke,{...je,onChange:Me}):null;let t=O&&(_===`auto`&&(ue||fe)||_===!0);return e.scrollButtonStart=t?(0,F.jsx)(Ne,{direction:i?`right`:`left`,onClick:De,disabled:!ue,...Pe}):null,e.scrollButtonEnd=t?(0,F.jsx)(Ne,{direction:i?`left`:`right`,onClick:Oe,disabled:!fe,...Pe}):null,e},Ie=XL(e=>{let{tabsMeta:t,tabMeta:n}=Se();if(!(!n||!t)){if(n[M]<t[M]){let r=t[j]+(n[M]-t[M]);we(r,{animation:e})}else if(n[ee]>t[ee]){let r=t[j]+(n[ee]-t[ee]);we(r,{animation:e})}}}),Le=XL(()=>{O&&_!==!1&&he(!me)});N.useEffect(()=>{let e=RL(()=>{ye.current&&Ce()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Le()},r=UL(ye.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(be.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(be.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[Ce,Le]),N.useEffect(()=>{let e=Array.from(be.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:ye.current,threshold:.99},a=new IntersectionObserver(e=>{de(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{pe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,me,l?.length]),N.useEffect(()=>{se(!0)},[]),N.useEffect(()=>{Ce()}),N.useEffect(()=>{Ie(o0!==ce)},[Ie,ce]),N.useImperativeHandle(s,()=>({updateIndicator:Ce,updateScrollButtons:Le}),[Ce,Le]);let[Re,ze]=oH(`indicator`,{className:k(ie.indicator,x.className),elementType:i0,externalForwardedProps:xe,ownerState:re,additionalProps:{style:ce}}),Be=(0,F.jsx)(Re,{...ze}),Ve=0,He=N.Children.map(l,e=>{if(!N.isValidElement(e))return null;let t=e.props.value===void 0?Ve:e.props.value;ve.set(t,Ve);let n=t===w;return Ve+=1,N.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!oe&&Be,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Ve===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),Ue=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=be.current,n=UV(VL(t));if(n?.getAttribute(`role`)!==`tab`)return;let r=h===`horizontal`?`ArrowLeft`:`ArrowUp`,a=h===`horizontal`?`ArrowRight`:`ArrowDown`;switch(h===`horizontal`&&i&&(r=`ArrowRight`,a=`ArrowLeft`),e.key){case r:e.preventDefault(),$1(t,n,Q1);break;case a:e.preventDefault(),$1(t,n,Z1);break;case`Home`:e.preventDefault(),$1(t,null,Z1);break;case`End`:e.preventDefault(),$1(t,null,Q1);break;default:break}},We=Fe(),[Ge,Ke]=oH(`root`,{ref:t,className:k(ie.root,u),elementType:t0,externalForwardedProps:{...xe,...D,component:d},ownerState:re}),[qe,Je]=oH(`scroller`,{ref:ye,className:ie.scroller,elementType:n0,externalForwardedProps:xe,ownerState:re,additionalProps:{style:{overflow:ge.overflow,[A?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-ge.scrollbarWidth}}}),[Ye,Xe]=oH(`list`,{ref:be,className:k(ie.list,ie.flexContainer),elementType:r0,externalForwardedProps:xe,ownerState:re,getSlotProps:e=>({...e,onKeyDown:t=>{Ue(t),e.onKeyDown?.(t)}})});return(0,F.jsxs)(Ge,{...Ke,children:[We.scrollButtonStart,We.scrollbarSizeListener,(0,F.jsxs)(qe,{...Je,children:[(0,F.jsx)(Ye,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...Xe,children:He}),oe&&Be]}),We.scrollButtonEnd]})});function c0(e){return Zr(`MuiTab`,e)}var l0=Qr(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),u0=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return A({root:[`root`,a&&o&&`labelIcon`,`textColor${R(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},c0,t)},d0=L($R,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${R(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${l0.iconWrapper}`]:t.iconWrapper},{[`& .${l0.icon}`]:t.icon}]}})(Ro(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${l0.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${l0.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${l0.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${l0.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${l0.selected}`]:{opacity:1},[`&.${l0.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${l0.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${l0.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${l0.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${l0.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),f0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:_,wrapped:v=!1,...y}=n,b={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:v},x=u0(b),S=s&&u&&N.isValidElement(s)?N.cloneElement(s,{className:k(x.icon,s.props.className)}):s;return(0,F.jsxs)(d0,{focusRipple:!a,className:k(x.root,r),ref:t,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,_),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,_),p&&p(e)},ownerState:b,tabIndex:m?0:-1,...y,children:[c===`top`||c===`start`?(0,F.jsxs)(N.Fragment,{children:[S,u]}):(0,F.jsxs)(N.Fragment,{children:[u,S]}),l]})}),p0=e=>{let{classes:t}=e;return A({root:[`root`]},G$,t)},m0=L(Yo,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),h0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=p0(o),{titleId:c=i}=N.useContext(m1);return(0,F.jsx)(m0,{component:`h2`,className:k(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function g0(e){return Zr(`MuiDialogContentText`,e)}Qr(`MuiDialogContentText`,[`root`]);var _0=e=>{let{classes:t}=e,n=A({root:[`root`]},g0,t);return{...t,...n}},v0=L(Yo,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),y0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=_0(a);return(0,F.jsx)(v0,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:k(o.root,i),...n,classes:o})}),b0=D(`@pie-lib:editable-html:plugins:media:dialog`),x0=e=>{if(!e)return!1;let t=/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;return e.match(t)?e.match(t)[1]:!1},S0=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),C0=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),w0=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},T0=e=>new Promise(t=>{try{fetch(`https://soundcloud.com/oembed?format=json&url=${e}`).then(e=>e.json()).then(e=>{let n=document.createElement(`div`);n.innerHTML=e.html,t(n.querySelector(`iframe`).src)}).catch(e=>{t(``),b0(e)})}catch{t(``)}}),E0={video:`Video`,audio:`Audio`},D0={uploadFile:`upload-file`,insertUrl:`insert-url`},O0=L(b1)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),k0=L(Y$)(({theme:e})=>({padding:0})),A0=L(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),j0=L(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),M0=L(`input`)(({theme:e})=>({})),N0=L(Yo)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),P0=L(vz)(({theme:e})=>({marginLeft:e.spacing(1.5)})),F0=class extends N.Component{static propTypes={open:p.bool,edit:p.bool,disablePortal:p.bool,handleClose:p.func,uploadSoundSupport:p.shape({add:p.func,delete:p.func}),type:p.string,src:p.string,url:p.string,urlToUse:p.string,starts:p.number,ends:p.number,height:p.number,width:p.number};constructor(e){super(e);let{ends:t,height:n,src:r,starts:i,type:a,uploadSoundSupport:o,url:s,urlToUse:c,width:l}=e,u=o?.add&&o?.delete&&a!==`video`&&!r;this.state={ends:t||0,url:s,urlToUse:c,formattedUrl:r,height:n||315,invalid:!1,starts:i||0,width:l||560,tabValue:u?D0.uploadFile:D0.insertUrl,fileUpload:{error:null,loading:!1,scheduled:!1,url:``,mimeType:``}}}componentDidMount(){this.props.url&&this.urlChange({target:{value:this.props.url}})}formatUrl=()=>{let{url:e,urlToUse:t,starts:n,ends:r}=this.state,i=x0(e),a=S0(e),o=t;if((i||a)&&t){let e=[],s,c;switch(!0){case a:s=`t`,c=`#`;break;case i:s=`start`,c=`?`;break;default:s=`start`,c=`?`}n&&e.push(`${s}=${n}`),r&&e.push(`end=${r}`),o=`${t}${e.length?c:``}${e.join(`&`)}`}this.setState({formattedUrl:null,updating:!0},()=>this.setState({formattedUrl:o,updating:!1}))};handleStateChange=e=>this.setState(e,this.formatUrl);checkAudio=e=>{w0(e)&&T0(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(b0)};checkVideo=e=>{if(x0(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;b0(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(S0(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;b0(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(C0(e)){let t=`https://drive.google.com/file/d/${e.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,`$1`)}/preview`;b0(`is google drive`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}};urlChange=e=>{let{value:t}=e.target||{},{type:n}=this.props;if(n&&n===`audio`){this.checkAudio(t);return}else if(n&&n===`video`){this.checkVideo(t);return}this.handleStateChange({urlToUse:null,url:null,invalid:!0})};changeHandler=e=>t=>this.handleStateChange({[e]:t.target.value});handleDone=e=>{let{handleClose:t}=this.props,{tabValue:n,fileUpload:r}=this.state,i=n===D0.insertUrl;if(!e){r.url&&this.handleRemoveFile(),t(e);return}if(i){let{ends:n,height:r,url:i,urlToUse:a,formattedUrl:o,starts:s,width:c}=this.state;t(e,{tag:`iframe`,ends:n,height:r,starts:s,width:c,url:i,urlToUse:a,src:o});return}if(!r.loading){t(e,{tag:`audio`,src:r.url});return}this.setState({fileUpload:{...r,scheduled:!0}})};handleUploadFile=async e=>{e.preventDefault(),this.setState({fileUpload:{...this.state.fileUpload,error:null,loading:!0}});let t=e.target.files[0],n=new FileReader;n.onload=()=>{let e=n.result;this.setState({fileUpload:{...this.state.fileUpload,url:e,mimeType:t.type}})},n.readAsDataURL(t),this.props.uploadSoundSupport.add({fileChosen:t,done:(e,t)=>{if(b0(`done: err:`,e),e){console.log(e),this.setState({fileUpload:{...this.state.fileUpload,scheduled:!1,loading:!1,error:e}});return}let{fileUpload:n}=this.state,r=n&&n.scheduled?this.handleDone.bind(this,!0):void 0;this.setState({fileUpload:{...n,scheduled:!1,loading:!1,url:t}},r)}})};handleRemoveFile=async()=>{this.props.uploadSoundSupport.delete(this.state.fileUpload.url,e=>{e&&(console.log(e),this.setState({fileUpload:{...this.state.fileUpload,error:e}}))}),this.setState({fileUpload:{...this.state.fileUpload,loading:!1,url:``,mimeType:``}})};render(){let{open:e,disablePortal:t,type:n,edit:r,uploadSoundSupport:i}=this.props,{ends:a,height:o,invalid:s,starts:c,width:l,url:u,mimeType:d,formattedUrl:f,updating:p,tabValue:m,fileUpload:h}=this.state,g=x0(u),_=m===D0.insertUrl,v=m===D0.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,F.jsxs)(O0,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,F.jsxs)(h0,{id:`form-dialog-title`,children:[`Insert `,E0[n]]}),(0,F.jsx)(Y$,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(A0,{children:(0,F.jsxs)(s0,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,F.jsx)(f0,{value:D0.uploadFile,label:`Upload file`}):null,(0,F.jsx)(f0,{value:D0.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(s1,{autoFocus:!0,error:s,helperText:s?`Invalid URL`:``,margin:`dense`,id:`name`,label:`URL`,placeholder:`Paste URL of ${n}...`,type:`text`,onChange:this.urlChange,value:u,fullWidth:!0}),n===`video`&&(0,F.jsxs)(k0,{children:[(0,F.jsx)(y0,{children:`Video Properties`}),(0,F.jsx)(s1,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,F.jsx)(s1,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,F.jsx)(`iframe`,{width:l,height:o,src:f,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0}),n===`video`&&(f||p)&&!s&&(0,F.jsx)(N.Fragment,{children:(0,F.jsxs)(k0,{children:[(0,F.jsx)(s1,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,F.jsx)(s1,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,F.jsx)(j0,{children:(0,F.jsxs)(`div`,{children:[h.url?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(A0,{children:[(0,F.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:d,src:h.url})}),(0,F.jsx)(P0,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,F.jsx)(yz,{})})]}),!h.scheduled&&h.loading?(0,F.jsx)(Yo,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,F.jsx)(Yo,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,F.jsx)(M0,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,F.jsx)(N0,{variant:`caption`,children:h.error})]})})]})}),(0,F.jsxs)(d1,{children:[(0,F.jsx)(FW,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,F.jsx)(FW,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},I0=L(`span`)(({theme:e})=>({position:`relative`,bottom:`5px`,left:0,width:`100%`,background:e.palette.common.white,display:`inline-flex`,padding:`5px`,boxShadow:`0px 4px 4px rgba(0, 0, 0, 0.25)`})),L0=L(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),R0=L(`span`)({cursor:`pointer`}),z0=class extends N.Component{static propTypes={onEdit:p.func,hideEdit:p.bool,onRemove:p.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,F.jsxs)(I0,{children:[e?null:(0,F.jsx)(L0,{onClick:t,children:`Edit Settings`}),(0,F.jsx)(R0,{onClick:n,children:`Remove`})]})}},B0=Lb.create({name:`media`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{type:{default:`video`},src:{default:null},width:{default:null},height:{default:null},title:{default:null},starts:{default:null},ends:{default:null},editing:{default:!1},tag:{default:`iframe`},url:{default:null}}},parseHTML(){return[{tag:`iframe[data-type="video"]`,getAttrs:e=>({type:`video`,tag:`iframe`,src:e.getAttribute(`src`),width:e.getAttribute(`width`),height:e.getAttribute(`height`),title:e.dataset.title,starts:e.dataset.starts,ends:e.dataset.ends,url:e.dataset.url})},{tag:`audio`,getAttrs:e=>({type:`audio`,tag:`audio`,src:e.querySelector(`source`)?.getAttribute(`src`)})}]},renderHTML({HTMLAttributes:e}){let{tag:t,src:n,width:r,height:i}=e;return t===`audio`?[`audio`,{controls:`controls`,controlsList:`nodownload`},[`source`,{src:n,type:`audio/mp3`}]]:[`iframe`,Vv({"data-type":`video`,frameborder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:``,src:n},r?{width:r}:{},i?{height:i}:{})]},addCommands(){return{insertMedia:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateMedia:e=>({commands:t})=>t.updateAttributes(this.name,e)}},addNodeView(){return dS(e=>(0,F.jsx)(U0,{...e,options:this.options}))}}),V0=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},H0=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;V0(),t.className=`insert-media-dialog`,document.body.style.overflow=`hidden`;let s=(e,n)=>{r(e,n),t.remove(),document.body.style.overflow=o},c=(0,F.jsx)(F0,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});Rx.render(c,t),document.body.appendChild(t)};function U0({editor:e,node:t,updateAttributes:n,deleteNode:r,options:i}){let{type:a,src:o,width:s,height:c,tag:l}=t.attrs;return(0,N.useEffect)(()=>{o||H0({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,F.jsxs)(rS,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,F.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,F.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,F.jsx)(z0,{onEdit:()=>{H0({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function W0(e){return Zr(`MuiListItem`,e)}Qr(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var G0=Qr(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function K0(e){return Zr(`MuiListItemSecondaryAction`,e)}Qr(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var q0=e=>{let{disableGutters:t,classes:n}=e;return A({root:[`root`,t&&`disableGutters`]},K0,n)},J0=L(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),Y0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=N.useContext(NG),o={...n,disableGutters:a.disableGutters},s=q0(o);return(0,F.jsx)(J0,{className:k(s.root,r),ownerState:o,ref:t,...i})});Y0.muiName=`ListItemSecondaryAction`;var X0=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},Z0=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return A({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},W0,n)},Q0=L(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:X0})(Ro(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${G0.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),$0=L(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),e2=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o,components:s={},componentsProps:c={},ContainerComponent:l=`li`,ContainerProps:{className:u,...d}={},dense:f=!1,disableGutters:p=!1,disablePadding:m=!1,divider:h=!1,secondaryAction:g,slotProps:_={},slots:v={},...y}=n,b=N.useContext(NG),x=N.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=N.useRef(null),C=N.Children.toArray(i),w=C.length&&zL(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=Z0(T),D=QL(S,t),[O,A]=oH(`secondaryAction`,{elementType:Y0,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),j=v.root||s.Root||Q0,M=_.root||c.root||{},ee={className:k(E.root,M.className,a),...y},te=o||`li`;return w?(te=!ee.component&&!o?`div`:te,l===`li`&&(te===`li`?te=`div`:ee.component===`li`&&(ee.component=`div`)),(0,F.jsx)(NG.Provider,{value:x,children:(0,F.jsxs)($0,{as:l,className:k(E.container,u),ref:D,ownerState:T,...d,children:[(0,F.jsx)(j,{...M,...!bV(j)&&{as:te,ownerState:{...T,...M.ownerState}},...ee,children:C}),C.pop()]})})):(0,F.jsx)(NG.Provider,{value:x,children:(0,F.jsxs)(j,{...M,as:te,ref:D,...!bV(j)&&{ownerState:{...T,...M.ownerState}},...ee,children:[C,g&&(0,F.jsx)(O,{...A,children:g})]})})}),t2=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},n2=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;t2(),o.className=`insert-css-dialog`;let c=!1,l=e=>{if(c){let t=o.contains(e.target)||void 0,n=a.contains(e.target);t||n||u()}else c=!0},u=()=>{t(void 0,!0),o.remove(),document.body.removeEventListener(`click`,l)},d=e=>{t(e,!0),o.remove(),document.body.removeEventListener(`click`,l)},f=i?.attrs.class,p=e=>{let t=`<span class="${e}">${r}</span>`;if(i){let e=`span`;i?.object===`inline`&&(e=`span`),i?.object===`block`&&(e=`div`),t=`<${e} class="${f}">${i.text.slice(0,s.$anchor.textOffset)}${t}${i.text.slice(s.$head.textOffset)}</${e}>`}return t},m=(0,F.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,F.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,F.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,F.jsx)(LG,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,F.jsxs)(e2,{button:!0,onClick:()=>d(e),children:[(0,F.jsx)(`div`,{style:{marginRight:20},children:e}),(0,F.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});Rx.render(m,o,()=>{let t=e.view.nodeDOM(e.state.selection.from)?.parentNode;if(t){let e=a.parentElement.parentElement.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect();a.parentElement.parentElement.parentElement.appendChild(o),o.style.maxWidth=`500px`,o.style.position=`absolute`,o.style.top=0,o.style.zIndex=99999;let r=`${n.left+Math.abs(e.left)+t.offsetWidth+10}px`,i=`${n.x}px`;o.style.left=r;let s=o.offsetWidth;o.style.left=`unset`,o.style.right=i;let c=o.offsetWidth;o.style.left=`unset`,o.style.right=`unset`,s>=c?o.style.left=r:o.style.right=i,document.body.addEventListener(`click`,l)}})},r2=$y.create({name:`cssmark`,addOptions(){return{classes:[]}},addAttributes(){return{class:{default:null,parseHTML:e=>e.getAttribute(`class`),renderHTML:e=>e.class?{class:e.class}:{}}}},parseHTML(){return[{tag:`span[class]`,getAttrs:e=>{let t=e.getAttribute(`class`)||``;if(!t)return!1;if((this.options&&this.options.classes||[]).length>0){let e=this.options.classes.find(e=>t.includes(e));return e?{class:e}:!1}return{class:t}}}]},renderHTML({HTMLAttributes:e}){return[`span`,Vv(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{n2({editor:e,selectedText:e.state.doc.textBetween(e.state.selection.from,e.state.selection.to),parentNode:e.state.selection.$from.nodeAfter,opts:this.options.extraCSSRules,callback:t=>{t&&e.chain().focus().setCSSClass(t).run()}})}}}}),i2=Object.defineProperty,a2=(e,t)=>{for(var n in t)i2(e,n,{get:t[n],enumerable:!0})},o2=`listItem`,s2=`textStyle`,c2=/^\s*([-+*])\s$/,l2=Lb.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
384
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(o2,this.editor.getAttributes(s2)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=wb({find:c2,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=wb({find:c2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(s2),editor:this.editor})),[e]}});function u2(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function d2(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var f2=Lb.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(u2(e))return{type:`listItem`,content:[{type:`paragraph`,content:d2(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Fb(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});a2({},{findListItemPos:()=>p2,getNextListDepth:()=>m2,handleBackspace:()=>v2,handleDelete:()=>x2,hasListBefore:()=>h2,hasListItemAfter:()=>S2,hasListItemBefore:()=>g2,listItemHasSubList:()=>_2,nextListIsDeeper:()=>y2,nextListIsHigher:()=>b2});var p2=(e,t)=>{let{$from:n}=t.selection,r=T_(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},m2=(e,t)=>{let n=p2(e,t);if(!n)return!1;let[,r]=ay(t,e,n.$pos.pos+4);return r},h2=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},g2=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},_2=(e,t,n)=>{if(!n)return!1;let r=T_(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},v2=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dv(e.state,t)&&h2(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!dv(e.state,t)||!fy(e.state))return!1;let r=p2(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=_2(t,e.state,i);return g2(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},y2=(e,t)=>{let n=m2(e,t),r=p2(e,t);return!r||!n?!1:n>r.depth},b2=(e,t)=>{let n=m2(e,t),r=p2(e,t);return!r||!n?!1:n<r.depth},x2=(e,t)=>{if(!dv(e.state,t)||!dy(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:y2(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():b2(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},S2=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},C2=sb.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&x2(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&x2(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&v2(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&v2(e,n,r)&&(t=!0)}),t}}}}),w2=/^(\s*)(\d+)\.\s+(.*)$/,T2=/^\s/;function E2(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function D2(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&E2(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function O2(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(w2);if(!a)break;let[,o,s,c]=a,l=o.length,u=[c],d=n+1,f=[i],p=!1;for(;d<e.length;){let t=e[d];if(t.match(w2))break;if(t.trim()===``)f.push(t),u.push(``),p=!0,d+=1;else if(t.match(T2))f.push(t),u.push(t.slice(l+2)),d+=1;else{if(p)break;f.push(t),u.push(t),d+=1}}t.push({indent:l,number:parseInt(s,10),content:u.join(`
381
+ `,H$=typeof V$==`string`?null:fr`
382
+ animation: ${V$} 3s infinite linear;
383
+ `,U$=e=>{let{classes:t,variant:n,color:r}=e;return A({root:[`root`,`color${R(r)}`,n],dashed:[`dashed`,`dashedColor${R(r)}`],bar1:[`bar`,`bar1`,`barColor${R(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${R(r)}`,n===`buffer`&&`color${R(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},F$,t)},W$=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),G$=L(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${R(n.color)}`],t[n.variant]]}})(Ro(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{backgroundColor:W$(e,t)}})),{props:({ownerState:e})=>e.color===`inherit`&&e.variant!==`buffer`,style:{"&::before":{content:`""`,position:`absolute`,left:0,top:0,right:0,bottom:0,backgroundColor:`currentColor`,opacity:.3}}},{props:{variant:`buffer`},style:{backgroundColor:`transparent`}},{props:{variant:`query`},style:{transform:`rotate(180deg)`}}]}))),K$=L(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${R(n.color)}`]]}})(Ro(({theme:e})=>({position:`absolute`,marginTop:0,height:`100%`,width:`100%`,backgroundSize:`10px 10px`,backgroundPosition:`0 -23px`,variants:[{props:{color:`inherit`},style:{opacity:.3,backgroundImage:`radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>{let n=W$(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),H$||{animation:`${V$} 3s infinite linear`}),q$=L(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${R(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(Ro(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[{props:{color:`inherit`},style:{backgroundColor:`currentColor`}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${I$}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${I$}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:R$||{animation:`${L$} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),J$=L(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${R(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(Ro(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:e})=>e.variant!==`buffer`&&e.color!==`inherit`,style:{backgroundColor:`var(--LinearProgressBar2-barColor, currentColor)`}},{props:({ownerState:e})=>e.variant!==`buffer`&&e.color===`inherit`,style:{backgroundColor:`currentColor`}},{props:{color:`inherit`},style:{opacity:.3}},...Object.entries(e.palette).filter(Ho()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:W$(e,t),transition:`transform .${I$}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:B$||{animation:`${z$} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Y$=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiLinearProgress`}),{className:r,color:i=`primary`,value:a,valueBuffer:o,variant:s=`indeterminate`,...c}=n,l={...n,color:i,variant:s},u=U$(l),d=Ri(),f={},p={bar1:{},bar2:{}};if((s===`determinate`||s===`buffer`)&&a!==void 0){f[`aria-valuenow`]=Math.round(a),f[`aria-valuemin`]=0,f[`aria-valuemax`]=100;let e=a-100;d&&(e=-e),p.bar1.transform=`translateX(${e}%)`}if(s===`buffer`&&o!==void 0){let e=(o||0)-100;d&&(e=-e),p.bar2.transform=`translateX(${e}%)`}return(0,F.jsxs)(G$,{className:k(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,F.jsx)(K$,{className:u.dashed,ownerState:l}):null,(0,F.jsx)(q$,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,F.jsx)(J$,{className:u.bar2,ownerState:l,style:p.bar2})]})}),X$=D(`@pie-lib:editable-html:image:insert-image-handler`),Z$=class{constructor(e,t,n,r=!1){this.editor=e,this.nodeInfo=t,this.node=t[0],this.nodePos=t[1],this.onFinish=n,this.isPasted=r,this.chosenFile=null}cancel(){X$(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(this.nodePos);if(i){let t=r.setNodeMarkup(this.nodePos,void 0,{...i.attrs,...e});n.dispatch(t)}}deleteNode(){let{state:e,view:t}=this.editor,{tr:n}=e,r=n.delete(this.nodePos,this.nodePos+this.node.nodeSize);t.dispatch(r)}done(e,t){X$(`done: err:`,e),e?(console.log(e),this.onFinish(!1)):(this.updateNode({loaded:!0,src:t,percent:100}),this.onFinish(!0)),this.editor._insertingImage=!1}fileChosen(e){if(!e)return;this.chosenFile=e,this.editor._insertingImage=!1,X$(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){X$(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function Q$(e){return Zr(`MuiDialogContent`,e)}Qr(`MuiDialogContent`,[`root`,`dividers`]);function $$(e){return Zr(`MuiDialogTitle`,e)}var e1=Qr(`MuiDialogTitle`,[`root`]),t1=e=>{let{classes:t,dividers:n}=e;return A({root:[`root`,n&&`dividers`]},Q$,t)},n1=L(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Ro(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${e1.root} + &`]:{paddingTop:0}}}]}))),r1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=t1(o);return(0,F.jsx)(n1,{className:k(s.root,r),ownerState:o,ref:t,...a})}),i1=WL((0,F.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function a1(e){return Zr(`MuiFormHelperText`,e)}var o1=Qr(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),s1,c1=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return A({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${R(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},a1,t)},l1=L(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${R(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Ro(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${o1.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${o1.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),u1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,m=rG({props:n,muiFormControl:aG(),states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete h.ownerState;let g=c1(h);return(0,F.jsx)(l1,{as:a,className:k(g.root,i),ref:t,...p,ownerState:h,children:r===` `?s1||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):r})});function d1(e){return Zr(`MuiTextField`,e)}Qr(`MuiTextField`,[`root`]);var f1={standard:SQ,filled:OQ,outlined:zQ},p1=e=>{let{classes:t}=e;return A({root:[`root`]},d1,t)},m1=L(SG,{name:`MuiTextField`,slot:`Root`})({}),h1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,FormHelperTextProps:d,fullWidth:f=!1,helperText:p,id:m,InputLabelProps:h,inputProps:g,InputProps:_,inputRef:v,label:y,maxRows:b,minRows:x,multiline:S=!1,name:C,onBlur:w,onChange:T,onFocus:E,placeholder:D,required:O=!1,rows:A,select:j=!1,SelectProps:M,slots:ee={},slotProps:te={},type:N,value:ne,variant:re=`outlined`,...ie}=n,P={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:j,variant:re},ae=p1(P),oe=Ki(m),se=p&&oe?`${oe}-helper-text`:void 0,ce=y&&oe?`${oe}-label`:void 0,le=f1[re],ue={slots:ee,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:M,...te}},de={},fe=ue.slotProps.inputLabel;re===`outlined`&&(fe&&fe.shrink!==void 0&&(de.notched=fe.shrink),de.label=y),j&&((!M||!M.native)&&(de.id=void 0),de[`aria-describedby`]=void 0);let[pe,me]=mH(`root`,{elementType:m1,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...ie},ownerState:P,className:k(ae.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:re}}),[he,ge]=mH(`input`,{elementType:le,externalForwardedProps:ue,additionalProps:de,ownerState:P}),[_e,ve]=mH(`inputLabel`,{elementType:hG,externalForwardedProps:ue,ownerState:P}),[ye,be]=mH(`htmlInput`,{elementType:`input`,externalForwardedProps:ue,ownerState:P}),[xe,Se]=mH(`formHelperText`,{elementType:u1,externalForwardedProps:ue,ownerState:P}),[Ce,we]=mH(`select`,{elementType:GQ,externalForwardedProps:ue,ownerState:P}),Te=(0,F.jsx)(he,{"aria-describedby":se,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:A,maxRows:b,minRows:x,type:N,value:ne,id:oe,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:be,slots:{input:ee.htmlInput?ye:void 0},...ge});return(0,F.jsxs)(pe,{...me,children:[y!=null&&y!==``&&(0,F.jsx)(_e,{htmlFor:oe,id:ce,...ve,children:y}),j?(0,F.jsx)(Ce,{"aria-describedby":se,id:oe,labelId:ce,value:ne,input:Te,...we,children:a}):Te,p&&(0,F.jsx)(xe,{id:se,...Se,children:p})]})});function g1(e){return Zr(`MuiDialogActions`,e)}Qr(`MuiDialogActions`,[`root`,`spacing`]);var _1=e=>{let{classes:t,disableSpacing:n}=e;return A({root:[`root`,!n&&`spacing`]},g1,t)},v1=L(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),y1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=_1(o);return(0,F.jsx)(v1,{className:k(s.root,r),ownerState:o,ref:t,...a})});function b1(e){return Zr(`MuiDialog`,e)}var x1=Qr(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),S1=N.createContext({}),C1=L(xH,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),w1=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return A({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${R(n)}`],paper:[`paper`,`paperScroll${R(n)}`,`paperWidth${R(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},b1,t)},T1=L(jH,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),E1=L(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${R(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),D1=L(FH,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${R(n.scroll)}`],t[`paperWidth${R(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Ro(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${x1.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${x1.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0,[`&.${x1.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),O1=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialog`}),r=Mo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:l,children:u,className:d,disableEscapeKeyDown:f=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:h=`sm`,onClick:g,onClose:_,open:v,PaperComponent:y=FH,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=_H,transitionDuration:E=i,TransitionProps:D,...O}=n,A={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},j=w1(A),M=N.useRef(),ee=e=>{M.current=e.target===e.currentTarget},te=e=>{g&&g(e),M.current&&(M.current=null,_&&_(e,`backdropClick`))},ne=Ki(o),re=N.useMemo(()=>({titleId:ne}),[ne]),ie={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[P,ae]=mH(`root`,{elementType:T1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:k(j.root,d),ref:t}),[oe,se]=mH(`backdrop`,{elementType:C1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:j.backdrop}),[ce,le]=mH(`paper`,{elementType:D1,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:A,className:j.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":ne,"aria-modal":s,tabIndex:-1,[QV]:``}}),[ue,de]=mH(`container`,{elementType:E1,externalForwardedProps:ie,ownerState:A,className:j.container}),[fe,pe]=mH(`transition`,{elementType:_H,externalForwardedProps:ie,ownerState:A,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,F.jsx)(P,{closeAfterTransition:!0,slots:{backdrop:oe},slotProps:{backdrop:{transitionDuration:E,as:c,...se}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:te,...ae,...O,children:(0,F.jsx)(fe,{...pe,children:(0,F.jsx)(ue,{onMouseDown:ee,...de,children:(0,F.jsx)(ce,{as:y,...le,children:(0,F.jsx)(S1.Provider,{value:re,children:u})})})})})}),k1=class extends N.Component{static propTypes={onDone:p.func.isRequired,alt:p.string};constructor(e){super(e);let{alt:t}=e;this.state={value:t}}closeDialog=()=>{document.querySelectorAll(`#text-dialog`).forEach(function(e){return e.remove()})};onDone=()=>{let{onDone:e}=this.props,{value:t}=this.state;e(t),this.closeDialog()};handleOverflow=()=>{document.body.style.removeProperty(`overflow`)};render(){let{value:e}=this.state;return(0,F.jsxs)(O1,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,F.jsx)(r1,{children:(0,F.jsxs)(`div`,{style:{display:`flex`},children:[(0,F.jsx)(i1,{style:{paddingTop:`6px`}}),(0,F.jsx)(h1,{multiline:!0,placeholder:`Enter an Alt Text description of this image`,helperText:`Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.`,value:e,onChange:e=>this.setState({value:e.target.value}),FormHelperTextProps:{style:{fontSize:14}}})]})}),(0,F.jsx)(y1,{children:(0,F.jsx)(UW,{onClick:this.onDone,children:`Done`})})]})}},A1=L(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?ZH():QH(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?QH():ZH()},"&:focus":{outline:`2px solid ${RU()}`},...t&&{opacity:.7}})),j1=D(`pie-elements:editable-html:raw-button`);(class extends N.Component{static propTypes={onClick:p.func.isRequired,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,active:p.bool,disabled:p.bool,extraStyles:p.object};constructor(e){super(e)}onClick=e=>{j1(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){j1(`[onKeyDown]`),e.preventDefault();let{onClick:t}=this.props;t(e)}};render(){let{active:e,children:t,disabled:n,extraStyles:r,ariaLabel:i}=this.props;return(0,F.jsx)(A1,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var M1=class extends N.Component{static propTypes={onToggle:p.func.isRequired,mark:p.string,label:p.string.isRequired,children:p.oneOfType([p.arrayOf(p.node),p.node]).isRequired,active:p.bool};constructor(e){super(e)}onToggle=e=>{e.preventDefault(),this.props.onToggle(this.props.mark)};onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.props.onToggle(this.props.mark))};render(){let{children:e,active:t,label:n}=this.props;return(0,F.jsx)(A1,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},N1=D(`@pie-lib:editable-html:plugins:image:image-toolbar`),P1=L(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),F1=L(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),I1=({alignment:e,active:t,onClick:n})=>(0,F.jsx)(M1,{active:t,onToggle:()=>n(e),label:e,children:e});I1.propTypes={alignment:p.string.isRequired,active:p.bool.isRequired,onClick:p.func.isRequired};var L1=class extends N.Component{static propTypes={onChange:p.func.isRequired,alignment:p.string,alt:p.string,imageLoaded:p.bool,disableImageAlignmentButtons:p.bool};onAltTextDone=e=>{N1(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{N1(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,F.jsx)(k1,{alt:e,onDone:this.onAltTextDone});Rx.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,F.jsxs)(P1,{children:[!n&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(I1,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,F.jsx)(I1,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,F.jsx)(I1,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,F.jsx)(F1,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}},R1=L(Y$,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),z1=L(`div`,{shouldForwardProp:e=>![`active`,`loading`,`pendingDelete`].includes(e)})(({loading:e,pendingDelete:t})=>({position:`relative`,display:`flex`,transition:`opacity 200ms linear`,...e&&{opacity:.3},...t&&{opacity:.3}})),B1=L(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),V1=L(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),H1=L(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),U1=e=>e?`${e}px`:`calc(20px)`;function W1(e){let{node:t,editor:n,attributes:r,onFocus:i,getPos:a,selected:o,options:s,maxImageWidth:c=700,maxImageHeight:l=900}=e,{alt:u}=t.attrs,d=a(),f=n.state.selection.from,p=n.state.selection.to,m=(0,N.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(t),v=(0,N.useRef)(null),y=(0,N.useRef)(null),b=(0,N.useRef)(null),x=(0,N.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,N.useCallback)(()=>{let e=_.current.attrs.nodeKey,t=null;return n.state.doc.descendants((n,r)=>{if(t!==null)return!1;if(n.type.name===`imageUploadNode`&&n.attrs.nodeKey===e)return t=r,!1}),t},[n]),w=(0,N.useCallback)(e=>{let t=S();if(t===null)return;let r=n.state.doc.nodeAt(t);r&&n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...r.attrs,...e}))},[n,S]),T=(0,N.useCallback)(()=>{if(!t.attrs.width||!v.current||!v.current.naturalWidth)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&w({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,w]);(0,N.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,N.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new Z$(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,N.useEffect)(()=>{T();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,j,!1),()=>{e&&e.removeEventListener(`mousedown`,j,!1)}},[]),(0,N.useEffect)(()=>{T()});let E=(0,N.useCallback)(()=>{let e=v.current;if(e&&(!e.style.width||e.style.width===`calc(20px)`)){let n=Math.min(e.naturalWidth,c),r=Math.min(e.naturalHeight,l);e.style.width=`${n}px`,e.style.height=`${r}px`;let i={width:n,height:r};C(i,{width:t.attrs.width,height:t.attrs.height})||w(i)}},[t.attrs.width,t.attrs.height,c,l,w]),D=(e,t,n=!0,r)=>{if(n){let n=e.width/e.height;return r===`height`?{width:t.height*n,height:t.height}:{width:t.width,height:t.width/n}}return t},O=(0,N.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r={width:t.naturalWidth,height:t.naturalHeight},i=D(r,{width:e.clientX-n.left,height:e.clientY-n.top});i.width>50&&i.height>50&&i.width<=700&&i.height<=900&&(t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,w({width:i.width,height:i.height}))},[n,w]),k=(0,N.useCallback)(e=>{w(e)},[n,w]),A=(0,N.useCallback)(()=>{window.removeEventListener(`mousemove`,O),window.removeEventListener(`mouseup`,A)},[O]),j=(0,N.useCallback)(()=>{window.addEventListener(`mousemove`,O),window.addEventListener(`mouseup`,A)},[O,A]),M={width:U1(t.attrs.width),height:U1(t.attrs.height),objectFit:`contain`},ee={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,F.jsxs)(rS,{children:[(0,F.jsxs)(z1,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:ee},children:[(0,F.jsx)(R1,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,F.jsxs)(B1,{onDragStart:e=>e.preventDefault(),children:[(0,F.jsx)(V1,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:M,onLoad:E,alt:t.attrs.alt}),(0,F.jsx)(H1,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&Rx.createPortal((0,F.jsx)(`div`,{ref:b,style:{zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,width:`100%`},children:(0,F.jsx)(Iz,{showDone:!0,deletable:!0,toolbarOpts:s.toolbarOpts||{},onDelete:()=>{let e=S();e!==null&&(s.imageHandling?.onDelete?.(_.current),n.view.dispatch(n.state.tr.delete(e,e+n.state.doc.nodeAt(e).nodeSize)),g(!1),n.commands.focus())},onDone:()=>{g(!1),s.imageHandling?.onDone?.(n),n.commands.focus(`end`)},children:(0,F.jsx)(L1,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:k})})}),n._tiptapContainerEl)]})}W1.propTypes={node:p.object.isRequired,editor:p.object.isRequired,attributes:p.object,onFocus:p.func,maxImageWidth:p.number,maxImageHeight:p.number};var G1=Lb.create({name:`imageUploadNode`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{nodeKey:{default:null},loaded:{default:!1},deleteStatus:{default:null},alignment:{default:null},percent:{default:null},width:{default:null},height:{default:null},src:{default:null},alt:{default:null}}},parseHTML(){return[{tag:`img[data-type="image-upload-node"]`}]},renderHTML({HTMLAttributes:e}){return[`img`,Vv(e,{"data-type":`image-upload-node`})]},addNodeView(){return dS(e=>(0,F.jsx)(W1,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})}},addProseMirrorPlugins(){let e=this.editor;return[new uu({props:{handlePaste(t,n){let r=Array.from(n.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!r)return!1;let i=r.getAsFile();if(!i)return!1;let a=new FileReader;return a.onload=()=>{let t=a.result;typeof t==`string`&&e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!0,nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})},a.readAsDataURL(i),!0}}})]}});function K1(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function q1(e,t,n,r={},i=()=>{}){let{ease:a=K1,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var J1={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function Y1(e){let{onChange:t,...n}=e,r=N.useRef(),i=N.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return $L(()=>{let e=KL(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=ZL(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),N.useEffect(()=>{a(),t(r.current)},[t]),(0,F.jsx)(`div`,{style:J1,...n,ref:i})}var X1=WL((0,F.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),Z1=WL((0,F.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function Q1(e){return Zr(`MuiTabScrollButton`,e)}var $1=Qr(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),e0=e=>{let{classes:t,orientation:n,disabled:r}=e;return A({root:[`root`,n,r&&`disabled`]},Q1,t)},t0=L(sz,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${$1.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),n0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=Ri(),d={isRtl:u,...n},f=e0(d),p=i.StartScrollButtonIcon??X1,m=i.EndScrollButtonIcon??Z1,h=BG({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=BG({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,F.jsx)(t0,{component:`div`,className:k(f.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...l,style:{...l.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:o===`left`?(0,F.jsx)(p,{...h}):(0,F.jsx)(m,{...g})})});function r0(e){return Zr(`MuiTabs`,e)}var i0=Qr(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),a0=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,o0=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,s0=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||i.getAttribute(`aria-disabled`)===`true`;if(!i.hasAttribute(`tabindex`)||t)i=n(e,i);else{i.focus();return}}},c0=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return A({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,`flexContainer`,t&&`flexContainerVertical`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},r0,c)},l0=L(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${i0.scrollButtons}`]:t.scrollButtons},{[`& .${i0.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Ro(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${i0.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),u0=L(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),d0=L(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),f0=L(`span`,{name:`MuiTabs`,slot:`Indicator`})(Ro(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),p0=L(Y1)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),m0={},h0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTabs`}),r=Mo(),i=Ri(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,ScrollButtonComponent:g,scrollButtons:_=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},TabIndicatorProps:x={},TabScrollButtonProps:S={},textColor:C=`primary`,value:w,variant:T=`standard`,visibleScrollbar:E=!1,...D}=n,O=T===`scrollable`,A=h===`vertical`,j=A?`scrollTop`:`scrollLeft`,M=A?`top`:`left`,ee=A?`bottom`:`right`,te=A?`clientHeight`:`clientWidth`,ne=A?`height`:`width`,re={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:A,scrollButtons:_,textColor:C,variant:T,visibleScrollbar:E,fixed:!O,hideScrollbar:O&&!E,scrollableX:O&&!A,scrollableY:O&&A,centered:c&&!O,scrollButtonsHideMobile:!f},ie=c0(re),P=BG({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:re}),ae=BG({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:re}),[oe,se]=N.useState(!1),[ce,le]=N.useState(m0),[ue,de]=N.useState(!1),[fe,pe]=N.useState(!1),[me,he]=N.useState(!1),[ge,_e]=N.useState({overflow:`hidden`,scrollbarWidth:0}),ve=new Map,ye=N.useRef(null),be=N.useRef(null),xe={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},Se=()=>{let e=ye.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&w!==!1){let e=be.current.children;if(e.length>0){let t=e[ve.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},Ce=iR(()=>{let{tabsMeta:e,tabMeta:t}=Se(),n=0,r;A?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[ne]:t?t[ne]:0};if(typeof ce[r]!=`number`||typeof ce[ne]!=`number`)le(a);else{let e=Math.abs(ce[r]-a[r]),t=Math.abs(ce[ne]-a[ne]);(e>=1||t>=1)&&le(a)}}),we=(e,{animation:t=!0}={})=>{t?q1(j,ye.current,e,{duration:r.transitions.duration.standard}):ye.current[j]=e},Te=e=>{let t=ye.current[j];A?t+=e:t+=e*(i?-1:1),we(t)},Ee=()=>{let e=ye.current[te],t=0,n=Array.from(be.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[te]>e){r===0&&(t=e);break}t+=i[te]}return t},De=()=>{Te(-1*Ee())},Oe=()=>{Te(Ee())},[ke,{onChange:Ae,...je}]=mH(`scrollbar`,{className:k(ie.scrollableX,ie.hideScrollbar),elementType:p0,shouldForwardComponentProp:!0,externalForwardedProps:xe,ownerState:re}),Me=N.useCallback(e=>{Ae?.(e),_e({overflow:null,scrollbarWidth:e})},[Ae]),[Ne,Pe]=mH(`scrollButtons`,{className:k(ie.scrollButtons,S.className),elementType:n0,externalForwardedProps:xe,ownerState:re,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:P,endScrollButtonIcon:ae}}}),Fe=()=>{let e={};e.scrollbarSizeListener=O?(0,F.jsx)(ke,{...je,onChange:Me}):null;let t=O&&(_===`auto`&&(ue||fe)||_===!0);return e.scrollButtonStart=t?(0,F.jsx)(Ne,{direction:i?`right`:`left`,onClick:De,disabled:!ue,...Pe}):null,e.scrollButtonEnd=t?(0,F.jsx)(Ne,{direction:i?`left`:`right`,onClick:Oe,disabled:!fe,...Pe}):null,e},Ie=iR(e=>{let{tabsMeta:t,tabMeta:n}=Se();if(!(!n||!t)){if(n[M]<t[M]){let r=t[j]+(n[M]-t[M]);we(r,{animation:e})}else if(n[ee]>t[ee]){let r=t[j]+(n[ee]-t[ee]);we(r,{animation:e})}}}),Le=iR(()=>{O&&_!==!1&&he(!me)});N.useEffect(()=>{let e=KL(()=>{ye.current&&Ce()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Le()},r=ZL(ye.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(be.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(be.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[Ce,Le]),N.useEffect(()=>{let e=Array.from(be.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:ye.current,threshold:.99},a=new IntersectionObserver(e=>{de(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{pe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,me,l?.length]),N.useEffect(()=>{se(!0)},[]),N.useEffect(()=>{Ce()}),N.useEffect(()=>{Ie(m0!==ce)},[Ie,ce]),N.useImperativeHandle(s,()=>({updateIndicator:Ce,updateScrollButtons:Le}),[Ce,Le]);let[Re,ze]=mH(`indicator`,{className:k(ie.indicator,x.className),elementType:f0,externalForwardedProps:xe,ownerState:re,additionalProps:{style:ce}}),Be=(0,F.jsx)(Re,{...ze}),Ve=0,He=N.Children.map(l,e=>{if(!N.isValidElement(e))return null;let t=e.props.value===void 0?Ve:e.props.value;ve.set(t,Ve);let n=t===w;return Ve+=1,N.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!oe&&Be,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Ve===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),Ue=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=be.current,n=ZV(YL(t));if(n?.getAttribute(`role`)!==`tab`)return;let r=h===`horizontal`?`ArrowLeft`:`ArrowUp`,a=h===`horizontal`?`ArrowRight`:`ArrowDown`;switch(h===`horizontal`&&i&&(r=`ArrowRight`,a=`ArrowLeft`),e.key){case r:e.preventDefault(),s0(t,n,o0);break;case a:e.preventDefault(),s0(t,n,a0);break;case`Home`:e.preventDefault(),s0(t,null,a0);break;case`End`:e.preventDefault(),s0(t,null,o0);break;default:break}},We=Fe(),[Ge,Ke]=mH(`root`,{ref:t,className:k(ie.root,u),elementType:l0,externalForwardedProps:{...xe,...D,component:d},ownerState:re}),[qe,Je]=mH(`scroller`,{ref:ye,className:ie.scroller,elementType:u0,externalForwardedProps:xe,ownerState:re,additionalProps:{style:{overflow:ge.overflow,[A?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-ge.scrollbarWidth}}}),[Ye,Xe]=mH(`list`,{ref:be,className:k(ie.list,ie.flexContainer),elementType:d0,externalForwardedProps:xe,ownerState:re,getSlotProps:e=>({...e,onKeyDown:t=>{Ue(t),e.onKeyDown?.(t)}})});return(0,F.jsxs)(Ge,{...Ke,children:[We.scrollButtonStart,We.scrollbarSizeListener,(0,F.jsxs)(qe,{...Je,children:[(0,F.jsx)(Ye,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...Xe,children:He}),oe&&Be]}),We.scrollButtonEnd]})});function g0(e){return Zr(`MuiTab`,e)}var _0=Qr(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),v0=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return A({root:[`root`,a&&o&&`labelIcon`,`textColor${R(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},g0,t)},y0=L(sz,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${R(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${_0.iconWrapper}`]:t.iconWrapper},{[`& .${_0.icon}`]:t.icon}]}})(Ro(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${_0.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${_0.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${_0.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${_0.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${_0.selected}`]:{opacity:1},[`&.${_0.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${_0.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${_0.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${_0.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${_0.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),b0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:_,wrapped:v=!1,...y}=n,b={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:v},x=v0(b),S=s&&u&&N.isValidElement(s)?N.cloneElement(s,{className:k(x.icon,s.props.className)}):s;return(0,F.jsxs)(y0,{focusRipple:!a,className:k(x.root,r),ref:t,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,_),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,_),p&&p(e)},ownerState:b,tabIndex:m?0:-1,...y,children:[c===`top`||c===`start`?(0,F.jsxs)(N.Fragment,{children:[S,u]}):(0,F.jsxs)(N.Fragment,{children:[u,S]}),l]})}),x0=e=>{let{classes:t}=e;return A({root:[`root`]},$$,t)},S0=L(Yo,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),C0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=x0(o),{titleId:c=i}=N.useContext(S1);return(0,F.jsx)(S0,{component:`h2`,className:k(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function w0(e){return Zr(`MuiDialogContentText`,e)}Qr(`MuiDialogContentText`,[`root`]);var T0=e=>{let{classes:t}=e,n=A({root:[`root`]},w0,t);return{...t,...n}},E0=L(Yo,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),D0=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=T0(a);return(0,F.jsx)(E0,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:k(o.root,i),...n,classes:o})}),O0=D(`@pie-lib:editable-html:plugins:media:dialog`),k0=e=>{if(!e)return!1;let t=/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;return e.match(t)?e.match(t)[1]:!1},A0=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),j0=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),M0=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},N0=e=>new Promise(t=>{try{fetch(`https://soundcloud.com/oembed?format=json&url=${e}`).then(e=>e.json()).then(e=>{let n=document.createElement(`div`);n.innerHTML=e.html,t(n.querySelector(`iframe`).src)}).catch(e=>{t(``),O0(e)})}catch{t(``)}}),P0={video:`Video`,audio:`Audio`},F0={uploadFile:`upload-file`,insertUrl:`insert-url`},I0=L(O1)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),L0=L(r1)(({theme:e})=>({padding:0})),R0=L(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),z0=L(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),B0=L(`input`)(({theme:e})=>({})),V0=L(Yo)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),H0=L(Ez)(({theme:e})=>({marginLeft:e.spacing(1.5)})),U0=class extends N.Component{static propTypes={open:p.bool,edit:p.bool,disablePortal:p.bool,handleClose:p.func,uploadSoundSupport:p.shape({add:p.func,delete:p.func}),type:p.string,src:p.string,url:p.string,urlToUse:p.string,starts:p.number,ends:p.number,height:p.number,width:p.number};constructor(e){super(e);let{ends:t,height:n,src:r,starts:i,type:a,uploadSoundSupport:o,url:s,urlToUse:c,width:l}=e,u=o?.add&&o?.delete&&a!==`video`&&!r;this.state={ends:t||0,url:s,urlToUse:c,formattedUrl:r,height:n||315,invalid:!1,starts:i||0,width:l||560,tabValue:u?F0.uploadFile:F0.insertUrl,fileUpload:{error:null,loading:!1,scheduled:!1,url:``,mimeType:``}}}componentDidMount(){this.props.url&&this.urlChange({target:{value:this.props.url}})}formatUrl=()=>{let{url:e,urlToUse:t,starts:n,ends:r}=this.state,i=k0(e),a=A0(e),o=t;if((i||a)&&t){let e=[],s,c;switch(!0){case a:s=`t`,c=`#`;break;case i:s=`start`,c=`?`;break;default:s=`start`,c=`?`}n&&e.push(`${s}=${n}`),r&&e.push(`end=${r}`),o=`${t}${e.length?c:``}${e.join(`&`)}`}this.setState({formattedUrl:null,updating:!0},()=>this.setState({formattedUrl:o,updating:!1}))};handleStateChange=e=>this.setState(e,this.formatUrl);checkAudio=e=>{M0(e)&&N0(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(O0)};checkVideo=e=>{if(k0(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;O0(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(A0(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;O0(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(j0(e)){let t=`https://drive.google.com/file/d/${e.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,`$1`)}/preview`;O0(`is google drive`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}};urlChange=e=>{let{value:t}=e.target||{},{type:n}=this.props;if(n&&n===`audio`){this.checkAudio(t);return}else if(n&&n===`video`){this.checkVideo(t);return}this.handleStateChange({urlToUse:null,url:null,invalid:!0})};changeHandler=e=>t=>this.handleStateChange({[e]:t.target.value});handleDone=e=>{let{handleClose:t}=this.props,{tabValue:n,fileUpload:r}=this.state,i=n===F0.insertUrl;if(!e){r.url&&this.handleRemoveFile(),t(e);return}if(i){let{ends:n,height:r,url:i,urlToUse:a,formattedUrl:o,starts:s,width:c}=this.state;t(e,{tag:`iframe`,ends:n,height:r,starts:s,width:c,url:i,urlToUse:a,src:o});return}if(!r.loading){t(e,{tag:`audio`,src:r.url});return}this.setState({fileUpload:{...r,scheduled:!0}})};handleUploadFile=async e=>{e.preventDefault(),this.setState({fileUpload:{...this.state.fileUpload,error:null,loading:!0}});let t=e.target.files[0],n=new FileReader;n.onload=()=>{let e=n.result;this.setState({fileUpload:{...this.state.fileUpload,url:e,mimeType:t.type}})},n.readAsDataURL(t),this.props.uploadSoundSupport.add({fileChosen:t,done:(e,t)=>{if(O0(`done: err:`,e),e){console.log(e),this.setState({fileUpload:{...this.state.fileUpload,scheduled:!1,loading:!1,error:e}});return}let{fileUpload:n}=this.state,r=n&&n.scheduled?this.handleDone.bind(this,!0):void 0;this.setState({fileUpload:{...n,scheduled:!1,loading:!1,url:t}},r)}})};handleRemoveFile=async()=>{this.props.uploadSoundSupport.delete(this.state.fileUpload.url,e=>{e&&(console.log(e),this.setState({fileUpload:{...this.state.fileUpload,error:e}}))}),this.setState({fileUpload:{...this.state.fileUpload,loading:!1,url:``,mimeType:``}})};render(){let{open:e,disablePortal:t,type:n,edit:r,uploadSoundSupport:i}=this.props,{ends:a,height:o,invalid:s,starts:c,width:l,url:u,mimeType:d,formattedUrl:f,updating:p,tabValue:m,fileUpload:h}=this.state,g=k0(u),_=m===F0.insertUrl,v=m===F0.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,F.jsxs)(I0,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,F.jsxs)(C0,{id:`form-dialog-title`,children:[`Insert `,P0[n]]}),(0,F.jsx)(r1,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(R0,{children:(0,F.jsxs)(h0,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,F.jsx)(b0,{value:F0.uploadFile,label:`Upload file`}):null,(0,F.jsx)(b0,{value:F0.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(h1,{autoFocus:!0,error:s,helperText:s?`Invalid URL`:``,margin:`dense`,id:`name`,label:`URL`,placeholder:`Paste URL of ${n}...`,type:`text`,onChange:this.urlChange,value:u,fullWidth:!0}),n===`video`&&(0,F.jsxs)(L0,{children:[(0,F.jsx)(D0,{children:`Video Properties`}),(0,F.jsx)(h1,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,F.jsx)(h1,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,F.jsx)(`iframe`,{width:l,height:o,src:f,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0}),n===`video`&&(f||p)&&!s&&(0,F.jsx)(N.Fragment,{children:(0,F.jsxs)(L0,{children:[(0,F.jsx)(h1,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,F.jsx)(h1,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,F.jsx)(z0,{children:(0,F.jsxs)(`div`,{children:[h.url?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R0,{children:[(0,F.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:d,src:h.url})}),(0,F.jsx)(H0,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,F.jsx)(Dz,{})})]}),!h.scheduled&&h.loading?(0,F.jsx)(Yo,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,F.jsx)(Yo,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,F.jsx)(B0,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,F.jsx)(V0,{variant:`caption`,children:h.error})]})})]})}),(0,F.jsxs)(y1,{children:[(0,F.jsx)(UW,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,F.jsx)(UW,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},W0=L(`span`)(({theme:e})=>({position:`relative`,bottom:`5px`,left:0,width:`100%`,background:e.palette.common.white,display:`inline-flex`,padding:`5px`,boxShadow:`0px 4px 4px rgba(0, 0, 0, 0.25)`})),G0=L(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),K0=L(`span`)({cursor:`pointer`}),q0=class extends N.Component{static propTypes={onEdit:p.func,hideEdit:p.bool,onRemove:p.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,F.jsxs)(W0,{children:[e?null:(0,F.jsx)(G0,{onClick:t,children:`Edit Settings`}),(0,F.jsx)(K0,{onClick:n,children:`Remove`})]})}},J0=Lb.create({name:`media`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{type:{default:`video`},src:{default:null},width:{default:null},height:{default:null},title:{default:null},starts:{default:null},ends:{default:null},editing:{default:!1},tag:{default:`iframe`},url:{default:null}}},parseHTML(){return[{tag:`iframe[data-type="video"]`,getAttrs:e=>({type:`video`,tag:`iframe`,src:e.getAttribute(`src`),width:e.getAttribute(`width`),height:e.getAttribute(`height`),title:e.dataset.title,starts:e.dataset.starts,ends:e.dataset.ends,url:e.dataset.url})},{tag:`audio`,getAttrs:e=>({type:`audio`,tag:`audio`,src:e.querySelector(`source`)?.getAttribute(`src`)})}]},renderHTML({HTMLAttributes:e}){let{tag:t,src:n,width:r,height:i}=e;return t===`audio`?[`audio`,{controls:`controls`,controlsList:`nodownload`},[`source`,{src:n,type:`audio/mp3`}]]:[`iframe`,Vv({"data-type":`video`,frameborder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:``,src:n},r?{width:r}:{},i?{height:i}:{})]},addCommands(){return{insertMedia:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateMedia:e=>({commands:t})=>t.updateAttributes(this.name,e)}},addNodeView(){return dS(e=>(0,F.jsx)(Z0,{...e,options:this.options}))}}),Y0=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},X0=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;Y0(),t.className=`insert-media-dialog`,document.body.style.overflow=`hidden`;let s=(e,n)=>{r(e,n),t.remove(),document.body.style.overflow=o},c=(0,F.jsx)(U0,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});Rx.render(c,t),document.body.appendChild(t)};function Z0({editor:e,node:t,updateAttributes:n,deleteNode:r,options:i}){let{type:a,src:o,width:s,height:c,tag:l}=t.attrs;return(0,N.useEffect)(()=>{o||X0({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,F.jsxs)(rS,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,F.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,F.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,F.jsx)(q0,{onEdit:()=>{X0({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function Q0(e){return Zr(`MuiListItem`,e)}Qr(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var $0=Qr(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function e2(e){return Zr(`MuiListItemSecondaryAction`,e)}Qr(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var t2=e=>{let{disableGutters:t,classes:n}=e;return A({root:[`root`,t&&`disableGutters`]},e2,n)},n2=L(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),r2=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=N.useContext(VG),o={...n,disableGutters:a.disableGutters},s=t2(o);return(0,F.jsx)(n2,{className:k(s.root,r),ownerState:o,ref:t,...i})});r2.muiName=`ListItemSecondaryAction`;var i2=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},a2=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return A({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},Q0,n)},o2=L(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:i2})(Ro(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${$0.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),s2=L(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),c2=N.forwardRef(function(e,t){let n=zo({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o,components:s={},componentsProps:c={},ContainerComponent:l=`li`,ContainerProps:{className:u,...d}={},dense:f=!1,disableGutters:p=!1,disablePadding:m=!1,divider:h=!1,secondaryAction:g,slotProps:_={},slots:v={},...y}=n,b=N.useContext(VG),x=N.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=N.useRef(null),C=N.Children.toArray(i),w=C.length&&qL(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=a2(T),D=oR(S,t),[O,A]=mH(`secondaryAction`,{elementType:r2,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),j=v.root||s.Root||o2,M=_.root||c.root||{},ee={className:k(E.root,M.className,a),...y},te=o||`li`;return w?(te=!ee.component&&!o?`div`:te,l===`li`&&(te===`li`?te=`div`:ee.component===`li`&&(ee.component=`div`)),(0,F.jsx)(VG.Provider,{value:x,children:(0,F.jsxs)(s2,{as:l,className:k(E.container,u),ref:D,ownerState:T,...d,children:[(0,F.jsx)(j,{...M,...!OV(j)&&{as:te,ownerState:{...T,...M.ownerState}},...ee,children:C}),C.pop()]})})):(0,F.jsx)(VG.Provider,{value:x,children:(0,F.jsxs)(j,{...M,as:te,ref:D,...!OV(j)&&{ownerState:{...T,...M.ownerState}},...ee,children:[C,g&&(0,F.jsx)(O,{...A,children:g})]})})}),l2=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},u2=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;l2(),o.className=`insert-css-dialog`;let c=!1,l=e=>{if(c){let t=o.contains(e.target)||void 0,n=a.contains(e.target);t||n||u()}else c=!0},u=()=>{t(void 0,!0),o.remove(),document.body.removeEventListener(`click`,l)},d=e=>{t(e,!0),o.remove(),document.body.removeEventListener(`click`,l)},f=i?.attrs.class,p=e=>{let t=`<span class="${e}">${r}</span>`;if(i){let e=`span`;i?.object===`inline`&&(e=`span`),i?.object===`block`&&(e=`div`),t=`<${e} class="${f}">${i.text.slice(0,s.$anchor.textOffset)}${t}${i.text.slice(s.$head.textOffset)}</${e}>`}return t},m=(0,F.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,F.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,F.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,F.jsx)(GG,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,F.jsxs)(c2,{button:!0,onClick:()=>d(e),children:[(0,F.jsx)(`div`,{style:{marginRight:20},children:e}),(0,F.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});Rx.render(m,o,()=>{let t=e.view.nodeDOM(e.state.selection.from)?.parentNode;if(t){let e=a.parentElement.parentElement.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect();a.parentElement.parentElement.parentElement.appendChild(o),o.style.maxWidth=`500px`,o.style.position=`absolute`,o.style.top=0,o.style.zIndex=99999;let r=`${n.left+Math.abs(e.left)+t.offsetWidth+10}px`,i=`${n.x}px`;o.style.left=r;let s=o.offsetWidth;o.style.left=`unset`,o.style.right=i;let c=o.offsetWidth;o.style.left=`unset`,o.style.right=`unset`,s>=c?o.style.left=r:o.style.right=i,document.body.addEventListener(`click`,l)}})},d2=$y.create({name:`cssmark`,addOptions(){return{classes:[]}},addAttributes(){return{class:{default:null,parseHTML:e=>e.getAttribute(`class`),renderHTML:e=>e.class?{class:e.class}:{}}}},parseHTML(){return[{tag:`span[class]`,getAttrs:e=>{let t=e.getAttribute(`class`)||``;if(!t)return!1;if((this.options&&this.options.classes||[]).length>0){let e=this.options.classes.find(e=>t.includes(e));return e?{class:e}:!1}return{class:t}}}]},renderHTML({HTMLAttributes:e}){return[`span`,Vv(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{u2({editor:e,selectedText:e.state.doc.textBetween(e.state.selection.from,e.state.selection.to),parentNode:e.state.selection.$from.nodeAfter,opts:this.options.extraCSSRules,callback:t=>{t&&e.chain().focus().setCSSClass(t).run()}})}}}}),f2=Object.defineProperty,p2=(e,t)=>{for(var n in t)f2(e,n,{get:t[n],enumerable:!0})},m2=`listItem`,h2=`textStyle`,g2=/^\s*([-+*])\s$/,_2=Lb.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
384
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(m2,this.editor.getAttributes(h2)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=wb({find:g2,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=wb({find:g2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h2),editor:this.editor})),[e]}});function v2(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function y2(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var b2=Lb.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(v2(e))return{type:`listItem`,content:[{type:`paragraph`,content:y2(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Fb(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});p2({},{findListItemPos:()=>x2,getNextListDepth:()=>S2,handleBackspace:()=>E2,handleDelete:()=>k2,hasListBefore:()=>C2,hasListItemAfter:()=>A2,hasListItemBefore:()=>w2,listItemHasSubList:()=>T2,nextListIsDeeper:()=>D2,nextListIsHigher:()=>O2});var x2=(e,t)=>{let{$from:n}=t.selection,r=T_(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},S2=(e,t)=>{let n=x2(e,t);if(!n)return!1;let[,r]=ay(t,e,n.$pos.pos+4);return r},C2=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},w2=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},T2=(e,t,n)=>{if(!n)return!1;let r=T_(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},E2=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dv(e.state,t)&&C2(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!dv(e.state,t)||!fy(e.state))return!1;let r=x2(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=T2(t,e.state,i);return w2(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},D2=(e,t)=>{let n=S2(e,t),r=x2(e,t);return!r||!n?!1:n>r.depth},O2=(e,t)=>{let n=S2(e,t),r=x2(e,t);return!r||!n?!1:n<r.depth},k2=(e,t)=>{if(!dv(e.state,t)||!dy(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:D2(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():O2(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},A2=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},j2=sb.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&k2(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&k2(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&E2(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&E2(e,n,r)&&(t=!0)}),t}}}}),M2=/^(\s*)(\d+)\.\s+(.*)$/,N2=/^\s/;function P2(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function F2(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&P2(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function I2(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(M2);if(!a)break;let[,o,s,c]=a,l=o.length,u=[c],d=n+1,f=[i],p=!1;for(;d<e.length;){let t=e[d];if(t.match(M2))break;if(t.trim()===``)f.push(t),u.push(``),p=!0,d+=1;else if(t.match(N2))f.push(t),u.push(t.slice(l+2)),d+=1;else{if(p)break;f.push(t),u.push(t),d+=1}}t.push({indent:l,number:parseInt(s,10),content:u.join(`
385
385
  `).trim(),contentLines:u,raw:f.join(`
386
- `)}),r=d,n=d}return[t,r]}function k2(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=D2(a.contentLines),c=o.join(`
386
+ `)}),r=d,n=d}return[t,r]}function L2(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=F2(a.contentLines),c=o.join(`
387
387
  `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
388
- `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=k2(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,items:e,raw:f.map(e=>e.raw).join(`
389
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function A2(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var j2=`listItem`,M2=`textStyle`,N2=/^(\d+)\.\s$/,P2=Lb.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,Vv(this.options.HTMLAttributes,n),0]:[`ol`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?A2(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
388
+ `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=L2(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,items:e,raw:f.map(e=>e.raw).join(`
389
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function R2(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var z2=`listItem`,B2=`textStyle`,V2=/^(\d+)\.\s$/,H2=Lb.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,Vv(this.options.HTMLAttributes,n),0]:[`ol`,Vv(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?R2(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
390
390
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
391
- `),[i,a]=O2(r);if(i.length===0)return;let o=k2(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
392
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(j2,this.editor.getAttributes(M2)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=wb({find:N2,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=wb({find:N2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(M2)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),F2=/^\s*(\[([( |x])?\])\s$/,I2=Lb.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}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Vv(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)=>Fb(e,t,`- [${e.attrs?.checked?`x`:` `}] `),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`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};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=Hv(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[wb({find:F2,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),L2=Lb.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`,Vv(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,`
393
- `):``,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=Pb(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);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Pb(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()}}});sb.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(l2.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(f2.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(C2.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(P2.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(I2.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(L2.configure(this.options.taskList)),e}});var R2=f2.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),z2=Lb.create({name:`headingParagraph`,group:`block`,content:`inline*`,defining:!0,addAttributes(){return{"data-heading":{default:`heading1`,parseHTML:e=>e.getAttribute(`data-heading`),renderHTML:e=>({"data-heading":e[`data-heading`]})}}},parseHTML(){return[{tag:`p[data-heading]`}]},renderHTML({HTMLAttributes:e}){return[`p`,Vv(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),B2=e=>{if(!e)return;let t=/^calc\((.*)\)$/;if(typeof e==`string`){if(e.endsWith(`%`))return;if(e.endsWith(`px`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`ch`)||e.endsWith(`em`)||e.match(t))return e;let n=parseInt(e,10);return Number.isNaN(n)?n:`${n}px`}if(typeof e==`number`)return`${e}px`},V2=IL((0,F.jsx)(`path`,{d:`M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5`}),`FormatBold`),H2=IL((0,F.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),U2=IL((0,F.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),W2=IL((0,F.jsx)(`path`,{d:`M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z`}),`Code`),G2=IL((0,F.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z`}),`GridOn`),K2=IL((0,F.jsx)(`path`,{d:`M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z`}),`FormatListBulleted`),q2=IL((0,F.jsx)(`path`,{d:`M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z`}),`FormatListNumbered`),J2=IL((0,F.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z`}),`FormatUnderlined`),Y2=IL((0,F.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),X2=IL((0,F.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),Z2=IL((0,F.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z`}),`Redo`),Q2=IL((0,F.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),$2=IL((0,F.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),e4=IL((0,F.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`}),`VolumeUp`),t4=IL((0,F.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),n4=L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),r4=()=>(0,F.jsx)(n4,{children:`+ Response Area`}),i4={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},a4={hasPreview:!0,characters:[[{unicode:`U+00A2`,description:`CENT SIGN`,write:`¢`,label:`¢`},{unicode:`U+00BF`,description:`INVERTED QUESTION MARK`,write:`¿`,label:`¿`},{unicode:`U+00B4`,description:`ACUTE ACCENT`,write:`´`,label:`´`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E1`,description:`LATIN SMALL LETTER A WITH ACUTE`,write:`á`,label:`á`},{unicode:`U+00E9`,description:`LATIN SMALL LETTER E WITH ACUTE`,write:`é`,label:`é`},{unicode:`U+00ED`,description:`LATIN SMALL LETTER I WITH ACUTE`,write:`í`,label:`í`},{unicode:`U+00F3`,description:`LATIN SMALL LETTER O WITH ACUTE`,write:`ó`,label:`ó`},{unicode:`U+00FA`,description:`LATIN SMALL LETTER U WITH ACUTE`,write:`ú`,label:`ú`},{unicode:`U+00F1`,description:`LATIN SMALL LETTER N WITH TILDE`,write:`ñ`,label:`ñ`}],[{unicode:`U+20AC`,description:`EURO SIGN`,write:`€`,label:`€`},{unicode:`U+00A1`,description:`INVERTED EXCLAMATION MARK`,write:`¡`,label:`¡`},{unicode:`U+00C1`,description:`LATIN CAPITAL LETTER A WITH ACUTE`,write:`Á`,label:`Á`},{unicode:`U+00C9`,description:`LATIN CAPITAL LETTER E WITH ACUTE`,write:`É`,label:`É`},{unicode:`U+00CD`,description:`LATIN CAPITAL LETTER I WITH ACUTE`,write:`Í`,label:`Í`},{unicode:`U+00D3`,description:`LATIN CAPITAL LETTER O WITH ACUTE`,write:`Ó`,label:`Ó`},{unicode:`U+00DA`,description:`LATIN CAPITAL LETTER U WITH ACUTE`,write:`Ú`,label:`Ú`},{unicode:`U+00D1`,description:`LATIN CAPITAL LETTER N WITH TILDE`,write:`Ñ`,label:`Ñ`}],[{unicode:`U+00A3`,description:`POUND SIGN`,write:`£`,label:`£`},{unicode:`U+00AB`,description:`LEFT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`«`,label:`«`},{unicode:`U+005E`,description:`CIRCUMFLEX ACCENT`,write:`^`,label:`^`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E2`,description:`LATIN SMALL LETTER A WITH CIRCUMFLEX`,write:`â`,label:`â`},{unicode:`U+00EA`,description:`LATIN SMALL LETTER E WITH CIRCUMFLEX`,write:`ê`,label:`ê`},{unicode:`U+00EE`,description:`LATIN SMALL LETTER I WITH CIRCUMFLEX`,write:`î`,label:`î`},{unicode:`U+00F4`,description:`LATIN SMALL LETTER O WITH CIRCUMFLEX`,write:`ô`,label:`ô`},{unicode:`U+00FB`,description:`LATIN SMALL LETTER U WITH CIRCUMFLEX`,write:`û`,label:`û`},{unicode:`U+00E7`,description:`LATIN SMALL LETTER C WITH CEDILLA`,write:`ç`,label:`ç`}],[{unicode:`U+00A5`,description:`YEN SIGN`,write:`¥`,label:`¥`},{unicode:`U+00BB`,description:`RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`»`,label:`»`},{unicode:`U+00C2`,description:`LATIN CAPITAL LETTER A WITH CIRCUMFLEX`,write:`Â`,label:`Â`},{unicode:`U+00CA`,description:`LATIN CAPITAL LETTER E WITH CIRCUMFLEX`,write:`Ê`,label:`Ê`},{unicode:`U+00CE`,description:`LATIN CAPITAL LETTER I WITH CIRCUMFLEX`,write:`Î`,label:`Î`},{unicode:`U+00D4`,description:`LATIN CAPITAL LETTER O WITH CIRCUMFLEX`,write:`Ô`,label:`Ô`},{unicode:`U+00DB`,description:`LATIN CAPITAL LETTER U WITH CIRCUMFLEX`,write:`Û`,label:`Û`},{unicode:`U+00C7`,description:`LATIN CAPITAL LETTER C WITH CEDILLA`,write:`Ç`,label:`Ç`}],[{unicode:`U+200A`,description:`HAIR SPACE`,write:String.fromCodePoint(`0x200A`),label:`&hairsp;`},{unicode:`U+00A7`,description:`SECTION SIGN`,write:`§`,label:`§`},{unicode:`U+00A8`,description:`DIAERESIS`,write:`¨`,label:`¨`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E4`,description:`LATIN SMALL LETTER A WITH DIAERESIS`,write:`ä`,label:`ä`},{unicode:`U+00EB`,description:`LATIN SMALL LETTER E WITH DIAERESIS`,write:`ë`,label:`ë`},{unicode:`U+00EF`,description:`LATIN SMALL LETTER I WITH DIAERESIS`,write:`ï`,label:`ï`},{unicode:`U+00F6`,description:`LATIN SMALL LETTER O WITH DIAERESIS`,write:`ö`,label:`ö`},{unicode:`U+00FC`,description:`LATIN SMALL LETTER U WITH DIAERESIS`,write:`ü`,label:`ü`},{unicode:`U+00DF`,description:`LATIN SMALL LETTER SHARP S`,write:`ß`,label:`ß`}],[{unicode:`U+2009`,description:`THIN SPACE`,write:String.fromCodePoint(`0x2009`),label:`&thinsp;`},{unicode:`U+2026`,description:`HORIZONTAL ELLIPSIS`,write:`…`,label:`…`},{unicode:`U+00C4`,description:`LATIN CAPITAL LETTER A WITH DIAERESIS`,write:`Ä`,label:`Ä`},{unicode:`U+00CB`,description:`LATIN CAPITAL LETTER E WITH DIAERESIS`,write:`Ë`,label:`Ë`},{unicode:`U+00CF`,description:`LATIN CAPITAL LETTER I WITH DIAERESIS`,write:`Ï`,label:`Ï`},{unicode:`U+00D6`,description:`LATIN CAPITAL LETTER O WITH DIAERESIS`,write:`Ö`,label:`Ö`},{unicode:`U+00DC`,description:`LATIN CAPITAL LETTER U WITH DIAERESIS`,write:`Ü`,label:`Ü`},{unicode:`U+2212`,description:`MINUS SIGN`,write:`−`,label:`−`}],[{unicode:`U+00A0`,description:`NO-BREAK SPACE`,write:String.fromCodePoint(`0x00A0`),label:`&nbsp;`},{unicode:`U+2022`,description:`BULLET`,write:`•`,label:`•`},{unicode:`U+0060`,description:`GRAVE ACCENT`,write:"`",label:"`",extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E0`,description:`LATIN SMALL LETTER A WITH GRAVE`,write:`à`,label:`à`},{unicode:`U+00E8`,description:`LATIN SMALL LETTER E WITH GRAVE`,write:`è`,label:`è`},{unicode:`U+00EC`,description:`LATIN SMALL LETTER I WITH GRAVE`,write:`ì`,label:`ì`},{unicode:`U+00F2`,description:`LATIN SMALL LETTER O WITH GRAVE`,write:`ò`,label:`ò`},{unicode:`U+00F9`,description:`LATIN SMALL LETTER U WITH GRAVE`,write:`ù`,label:`ù`},{unicode:`U+2013`,description:`EN DASH`,write:`–`,label:`–`}],[{unicode:`U+2003`,description:`EM SPACE`,write:String.fromCodePoint(`0x2003`),label:`&emsp;`},{unicode:`U+25E6`,description:`WHITE BULLET`,write:`◦`,label:`◦`},{unicode:`U+00C0`,description:`LATIN CAPITAL LETTER A WITH GRAVE`,write:`À`,label:`À`},{unicode:`U+00C8`,description:`LATIN CAPITAL LETTER E WITH GRAVE`,write:`È`,label:`È`},{unicode:`U+00CC`,description:`LATIN CAPITAL LETTER I WITH GRAVE`,write:`Ì`,label:`Ì`},{unicode:`U+00D2`,description:`LATIN CAPITAL LETTER O WITH GRAVE`,write:`Ò`,label:`Ò`},{unicode:`U+00D9`,description:`LATIN CAPITAL LETTER U WITH GRAVE`,write:`Ù`,label:`Ù`},{unicode:`U+2014`,description:`EM DASH`,write:`—`,label:`—`}]]},o4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),s4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),c4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z`,fill:`currentColor`})}),l4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),u4=({editor:e,onChange:t})=>{let[n,r]=(0,N.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,F.jsx)(s4,{});break;case e.isActive({textAlign:`center`}):i=(0,F.jsx)(c4,{});break;case e.isActive({textAlign:`justify`}):i=(0,F.jsx)(l4,{});break;default:i=(0,F.jsx)(o4,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,F.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,F.jsx)(lW,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,F.jsxs)(LG,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,F.jsx)(e2,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,F.jsx)(o4,{})}),(0,F.jsx)(e2,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,F.jsx)(c4,{})}),(0,F.jsx)(e2,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,F.jsx)(s4,{})}),(0,F.jsx)(e2,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,F.jsx)(l4,{})})]})})]})},d4=L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),f4=()=>(0,F.jsx)(d4,{children:`CSS`}),p4=L(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),m4=e=>t=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(e,{...t})}),h4=m4(e=>(0,F.jsx)(p4,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),g4=m4(e=>(0,F.jsx)(p4,{...e,d:`M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z`})),_4=m4(e=>(0,F.jsx)(p4,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),v4=m4(e=>(0,F.jsx)(p4,{...e,d:`M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z`})),y4=m4(e=>(0,F.jsx)(p4,{...e,d:`M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z`})),b4=`bottom`,x4=`right`,S4=`left`,C4=`auto`,w4=[`top`,b4,x4,S4],T4=`start`,E4=`clippingParents`,D4=`viewport`,O4=`popper`,k4=`reference`,A4=w4.reduce(function(e,t){return e.concat([t+`-`+T4,t+`-end`])},[]),j4=[].concat(w4,[C4]).reduce(function(e,t){return e.concat([t,t+`-`+T4,t+`-end`])},[]),M4=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function N4(e){return e?(e.nodeName||``).toLowerCase():null}function P4(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function F4(e){return e instanceof P4(e).Element||e instanceof Element}function I4(e){return e instanceof P4(e).HTMLElement||e instanceof HTMLElement}function L4(e){return typeof ShadowRoot>`u`?!1:e instanceof P4(e).ShadowRoot||e instanceof ShadowRoot}function R4(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!I4(i)||!N4(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function z4(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!I4(r)||!N4(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var B4={name:`applyStyles`,enabled:!0,phase:`write`,fn:R4,effect:z4,requires:[`computeStyles`]};function V4(e){return e.split(`-`)[0]}var H4=Math.max,U4=Math.min,W4=Math.round;function G4(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function K4(){return!/^((?!chrome|android).)*safari/i.test(G4())}function q4(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&I4(e)&&(i=e.offsetWidth>0&&W4(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&W4(r.height)/e.offsetHeight||1);var o=(F4(e)?P4(e):window).visualViewport,s=!K4()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function J4(e){var t=q4(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Y4(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&L4(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function X4(e){return P4(e).getComputedStyle(e)}function Z4(e){return[`table`,`td`,`th`].indexOf(N4(e))>=0}function Q4(e){return((F4(e)?e.ownerDocument:e.document)||window.document).documentElement}function $4(e){return N4(e)===`html`?e:e.assignedSlot||e.parentNode||(L4(e)?e.host:null)||Q4(e)}function e3(e){return!I4(e)||X4(e).position===`fixed`?null:e.offsetParent}function t3(e){var t=/firefox/i.test(G4());if(/Trident/i.test(G4())&&I4(e)&&X4(e).position===`fixed`)return null;var n=$4(e);for(L4(n)&&(n=n.host);I4(n)&&[`html`,`body`].indexOf(N4(n))<0;){var r=X4(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function n3(e){for(var t=P4(e),n=e3(e);n&&Z4(n)&&X4(n).position===`static`;)n=e3(n);return n&&(N4(n)===`html`||N4(n)===`body`&&X4(n).position===`static`)?t:n||t3(e)||t}function r3(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function i3(e,t,n){return H4(e,U4(t,n))}function a3(e,t,n){var r=i3(e,t,n);return r>n?n:r}function o3(){return{top:0,right:0,bottom:0,left:0}}function s3(e){return Object.assign({},o3(),e)}function c3(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var l3=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,s3(typeof e==`number`?c3(e,w4):e)};function u3(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=V4(n.placement),c=r3(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=l3(i.padding,n),d=J4(a),f=c===`y`?`top`:S4,p=c===`y`?b4:x4,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=n3(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=i3(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function d3(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||Y4(t.elements.popper,r)&&(t.elements.arrow=r))}var f3={name:`arrow`,enabled:!0,phase:`main`,fn:u3,effect:d3,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function p3(e){return e.split(`-`)[1]}var m3={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function h3(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:W4(n*i)/i||0,y:W4(r*i)/i||0}}function g3(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=S4,b=`top`,x=window;if(l){var S=n3(n),C=`clientHeight`,w=`clientWidth`;if(S===P4(n)&&(S=Q4(n),X4(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=b4;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=x4;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&m3),O=u===!0?h3({x:p,y:h},P4(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function _3(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:V4(t.placement),variation:p3(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,g3(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,g3(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var v3={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:_3,data:{}},y3={passive:!0};function b3(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=P4(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,y3)}),s&&c.addEventListener(`resize`,n.update,y3),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,y3)}),s&&c.removeEventListener(`resize`,n.update,y3)}}var x3={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:b3,data:{}},S3={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function C3(e){return e.replace(/left|right|bottom|top/g,function(e){return S3[e]})}var w3={start:`end`,end:`start`};function T3(e){return e.replace(/start|end/g,function(e){return w3[e]})}function E3(e){var t=P4(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function D3(e){return q4(Q4(e)).left+E3(e).scrollLeft}function O3(e,t){var n=P4(e),r=Q4(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=K4();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+D3(e),y:c}}function k3(e){var t=Q4(e),n=E3(e),r=e.ownerDocument?.body,i=H4(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=H4(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+D3(e),s=-n.scrollTop;return X4(r||t).direction===`rtl`&&(o+=H4(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function A3(e){var t=X4(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function j3(e){return[`html`,`body`,`#document`].indexOf(N4(e))>=0?e.ownerDocument.body:I4(e)&&A3(e)?e:j3($4(e))}function M3(e,t){t===void 0&&(t=[]);var n=j3(e),r=n===e.ownerDocument?.body,i=P4(n),a=r?[i].concat(i.visualViewport||[],A3(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(M3($4(a)))}function N3(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function P3(e,t){var n=q4(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function F3(e,t,n){return t===`viewport`?N3(O3(e,n)):F4(t)?P3(t,n):N3(k3(Q4(e)))}function I3(e){var t=M3($4(e)),n=[`absolute`,`fixed`].indexOf(X4(e).position)>=0&&I4(e)?n3(e):e;return F4(n)?t.filter(function(e){return F4(e)&&Y4(e,n)&&N4(e)!==`body`}):[]}function L3(e,t,n,r){var i=t===`clippingParents`?I3(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=F3(e,n,r);return t.top=H4(i.top,t.top),t.right=U4(i.right,t.right),t.bottom=U4(i.bottom,t.bottom),t.left=H4(i.left,t.left),t},F3(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function R3(e){var t=e.reference,n=e.element,r=e.placement,i=r?V4(r):null,a=r?p3(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case b4:c={x:o,y:t.y+t.height};break;case x4:c={x:t.x+t.width,y:s};break;case S4:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?r3(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case T4:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function z3(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?E4:s,l=n.rootBoundary,u=l===void 0?D4:l,d=n.elementContext,f=d===void 0?O4:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=s3(typeof g==`number`?c3(g,w4):g),v=f===`popper`?k4:O4,y=e.rects.popper,b=e.elements[m?v:f],x=L3(F4(b)?b:b.contextElement||Q4(e.elements.popper),c,u,o),S=q4(e.elements.reference),C=R3({reference:S,element:y,strategy:`absolute`,placement:i}),w=N3(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function B3(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?j4:c,u=p3(r),d=u?s?A4:A4.filter(function(e){return p3(e)===u}):w4,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=z3(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[V4(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function V3(e){if(V4(e)===`auto`)return[];var t=C3(e);return[T3(e),t,T3(t)]}function H3(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=V4(g)===g,v=c||(_||!m?[C3(g)]:V3(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(V4(n)===`auto`?B3(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=V4(E),O=p3(E)===T4,k=[`top`,b4].indexOf(D)>=0,A=k?`width`:`height`,j=z3(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?x4:S4:O?b4:`top`;b[A]>x[A]&&(M=C3(M));var ee=C3(M),te=[];if(a&&te.push(j[D]<=0),s&&te.push(j[M]<=0,j[ee]<=0),te.every(function(e){return e})){w=E,C=!1;break}S.set(E,te)}if(C)for(var N=m?3:1,ne=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},re=N;re>0&&ne(re)!==`break`;re--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var U3={name:`flip`,enabled:!0,phase:`main`,fn:H3,requiresIfExists:[`offset`],data:{_skip:!1}};function W3(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function G3(e){return[`top`,x4,b4,S4].some(function(t){return e[t]>=0})}function K3(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=z3(t,{elementContext:`reference`}),s=z3(t,{altBoundary:!0}),c=W3(o,r),l=W3(s,i,a),u=G3(c),d=G3(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var q3={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:K3};function J3(e,t,n){var r=V4(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function Y3(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=j4.reduce(function(e,n){return e[n]=J3(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var X3={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:Y3};function Z3(e){var t=e.state,n=e.name;t.modifiersData[n]=R3({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var Q3={name:`popperOffsets`,enabled:!0,phase:`read`,fn:Z3,data:{}};function $3(e){return e===`x`?`y`:`x`}function e6(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=z3(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=V4(t.placement),v=p3(t.placement),y=!v,b=r3(_),x=$3(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:S4,A=b===`y`?b4:x4,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],te=M-g[A],N=p?-w[j]/2:0,ne=v===`start`?C[j]:w[j],re=v===`start`?-w[j]:-C[j],ie=t.elements.arrow,P=p&&ie?J4(ie):{width:0,height:0},ae=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:o3(),oe=ae[k],se=ae[A],ce=i3(0,C[j],P[j]),le=y?C[j]/2-N-ce-oe-E.mainAxis:ne-ce-oe-E.mainAxis,ue=y?-C[j]/2+N+ce+se+E.mainAxis:re+ce+se+E.mainAxis,de=t.elements.arrow&&n3(t.elements.arrow),fe=de?b===`y`?de.clientTop||0:de.clientLeft||0:0,pe=D?.[b]??0,me=M+le-pe-fe,he=M+ue-pe,ge=i3(p?U4(ee,me):ee,M,p?H4(te,he):te);S[b]=ge,O[b]=ge-M}if(s){var _e=b===`x`?`top`:S4,ve=b===`x`?b4:x4,ye=S[x],be=x===`y`?`height`:`width`,xe=ye+g[_e],Se=ye-g[ve],Ce=[`top`,S4].indexOf(_)!==-1,we=D?.[x]??0,Te=Ce?xe:ye-C[be]-w[be]-we+E.altAxis,Ee=Ce?ye+C[be]+w[be]-we-E.altAxis:Se,De=p&&Ce?a3(Te,ye,Ee):i3(p?Te:xe,ye,p?Ee:Se);S[x]=De,O[x]=De-ye}t.modifiersData[r]=O}}var t6={name:`preventOverflow`,enabled:!0,phase:`main`,fn:e6,requiresIfExists:[`offset`]};function n6(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function r6(e){return e===P4(e)||!I4(e)?E3(e):n6(e)}function i6(e){var t=e.getBoundingClientRect(),n=W4(t.width)/e.offsetWidth||1,r=W4(t.height)/e.offsetHeight||1;return n!==1||r!==1}function a6(e,t,n){n===void 0&&(n=!1);var r=I4(t),i=I4(t)&&i6(t),a=Q4(t),o=q4(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((N4(t)!==`body`||A3(a))&&(s=r6(t)),I4(t)?(c=q4(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=D3(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function o6(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function s6(e){var t=o6(e);return M4.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function c6(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function l6(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var u6={placement:`bottom`,modifiers:[],strategy:`absolute`};function d6(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function f6(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?u6:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},u6,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:F4(e)?M3(e):e.contextElement?M3(e.contextElement):[],popper:M3(t)};var s=s6(l6([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(d6(t,n)){i.rects={reference:a6(t,n3(n),i.options.strategy===`fixed`),popper:J4(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:c6(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!d6(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var p6=f6({defaultModifiers:[x3,Q3,v3,B4,X3,U3,t6,f3,q3]});function m6(e){return Zr(`MuiPopper`,e)}Qr(`MuiPopper`,[`root`]);function h6(e,t){if(t===`ltr`)return e;switch(e){case`bottom-end`:return`bottom-start`;case`bottom-start`:return`bottom-end`;case`top-end`:return`top-start`;case`top-start`:return`top-end`;default:return e}}function g6(e){return typeof e==`function`?e():e}function _6(e){return e.nodeType!==void 0}var v6=e=>{let{classes:t}=e;return A({root:[`root`]},m6,t)},y6={},b6=N.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:a,modifiers:o,open:s,placement:c,popperOptions:l,popperRef:u,slotProps:d={},slots:f={},TransitionProps:p,ownerState:m,...h}=e,g=N.useRef(null),_=ZL(g,t),v=N.useRef(null),y=ZL(v,u),b=N.useRef(y);fi(()=>{b.current=y},[y]),N.useImperativeHandle(u,()=>v.current,[]);let x=h6(c,i),[S,C]=N.useState(x),[w,T]=N.useState(g6(n));N.useEffect(()=>{v.current&&v.current.forceUpdate()}),N.useEffect(()=>{n&&T(g6(n))},[n]),fi(()=>{if(!w||!s)return;let e=e=>{C(e.placement)},t=[{name:`preventOverflow`,options:{altBoundary:a}},{name:`flip`,options:{altBoundary:a}},{name:`onUpdate`,enabled:!0,phase:`afterWrite`,fn:({state:t})=>{e(t)}}];o!=null&&(t=t.concat(o)),l&&l.modifiers!=null&&(t=t.concat(l.modifiers));let n=p6(w,g.current,{placement:x,...l,modifiers:t});b.current(n);let r=g.current;return()=>{if(r){let{style:e}=r,t=e.position,i=e.top,a=e.left,o=e.transform;n.destroy(),e.position=t,e.top=i,e.left=a,e.transform=o}else n.destroy();b.current(null)}},[w,a,o,s,l,x]);let E={placement:S};p!==null&&(E.TransitionProps=p);let D=v6(e),O=f.root??`div`;return(0,F.jsx)(O,{...MG({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),x6=L(N.forwardRef(function(e,t){let{anchorEl:n,children:r,container:i,direction:a=`ltr`,disablePortal:o=!1,keepMounted:s=!1,modifiers:c,open:l,placement:u=`bottom`,popperOptions:d=y6,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=N.useState(!0),b=()=>{y(!1)},x=()=>{y(!0)};if(!s&&!l&&(!m||v))return null;let S;if(i)S=i;else if(n){let e=g6(n);S=e&&_6(e)?BL(e).body:BL(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,F.jsx)(eH,{disablePortal:o,container:S,children:(0,F.jsx)(b6,{anchorEl:n,direction:a,disablePortal:o,modifiers:c,ref:t,open:m?!v:l,placement:u,popperOptions:d,popperRef:f,slotProps:h,slots:g,..._,style:{position:`fixed`,top:0,left:0,display:C,...p},TransitionProps:w,children:r})})}),{name:`MuiPopper`,slot:`Root`})({}),S6=L(N.forwardRef(function(e,t){let n=Ri(),{anchorEl:r,component:i,components:a,componentsProps:o,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,slots:g,slotProps:_,...v}=zo({props:e,name:`MuiPopper`}),y=g?.root??a?.Root,b={anchorEl:r,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,...v};return(0,F.jsx)(x6,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),C6=L(Yo)({fontSize:50,textAlign:`center`}),w6=({children:e,...t})=>(0,F.jsx)(S6,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,F.jsx)(C6,{children:e})}),T6=({letter:e})=>(0,F.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});T6.propTypes={letter:p.string};function E6({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,N.useRef)(null),i=(0,N.useRef)(n),[a,o]=(0,N.useState)({top:0,left:0}),[s,c]=(0,N.useState)(null);i.current=n;let l=(0,N.useMemo)(()=>{if(!t)return i4;switch(!0){case t.language===`spanish`:return i4;case t.language===`special`:return a4;default:return t}},[t]),u=(0,N.useMemo)(()=>l.characters.reduce((e,t)=>(t.length>=e.columns&&(e.columns=t.length),e),{rows:l.characters.length,columns:0}),[l]),d=()=>c(null);(0,N.useEffect)(()=>()=>{d()},[]),(0,N.useEffect)(()=>{if(!e)return;let t=e.options.element,n=e.view.dom,a=()=>{if(!r.current)return;let n=t.getBoundingClientRect(),{from:i}=e.state.selection,a=e.view.coordsAtPos(i),s=r.current.offsetHeight,c=r.current.offsetWidth,l=window.innerHeight-(n.bottom+60)>=s||n.top<s+80?n.bottom+60:n.top-s-20,u=a.left;l=Math.max(8,Math.min(l,window.innerHeight-s-8)),u=Math.max(8,Math.min(u,window.innerWidth-c-8)),o({top:l,left:u})};a();let s=null,c=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,a()}))};window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c);let l=e=>{r.current&&!r.current.contains(e.target)&&!n.contains(e.target)&&i.current()},u=setTimeout(()=>{document.addEventListener(`click`,l)});return()=>{clearTimeout(u),s!==null&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),document.removeEventListener(`click`,l)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,F.jsxs)(F.Fragment,{children:[Rx.createPortal((0,F.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`fixed`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:1e3},children:(0,F.jsx)(`div`,{children:(0,F.jsx)(y$,{keyPadCharacterRef:t.keyPadCharacterRef,setKeypadInteraction:t.setKeypadInteraction,autoFocus:!0,noDecimal:!0,hideInput:!0,noLatexHandling:!0,hideDoneButtonBackground:!0,layoutForKeyPad:u,additionalKeys:l.characters.reduce((e,t)=>(e=[...e,...t.map(e=>({name:b(e,`name`)||e,write:b(e,`write`)||e,label:b(e,`label`)||e,category:`character`,extraClass:`character`,extraProps:{...e.extraProps||{},style:{...(e.extraProps||{}).style,border:`1px solid #000`}},...l.hasPreview?{actions:{onMouseEnter:t=>f(t,e),onMouseLeave:d}}:{}}))],e),[]),keypadMode:`language`,onChange:t=>{typeof t==`string`&&e.chain().focus().insertContent(t).run()},onDone:n})})}),document.body),s&&Rx.createPortal((0,F.jsxs)(w6,{onClose:d,anchorEl:s.anchorEl,children:[(0,F.jsx)(`div`,{children:s.el.label}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}E6.propTypes={editor:p.object,opts:p.object,onClose:p.func.isRequired};var D6=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z`,fill:`currentColor`})}),O6=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z`,fill:`currentColor`})}),k6=()=>(0,F.jsx)(`svg`,{width:`30`,height:`28`,viewBox:`0 0 30 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`20px`,height:`18px`},"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z`,fill:`currentColor`})});function A6({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,N.useState)(!1),l=r??{},u=Yx({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof W&&(n=t.node);let r=e.editor?.isActive(`math`)||e.editor?.isActive(`explicit_constructed_response`)||e.editor?.isActive(`imageUploadNode`)||e.editor?.isActive(`drag_in_the_blank`),i=t&&t.empty===!1&&e.editor.isActive(`table`);return{currentNode:n,hideDefaultToolbar:r,hasTextSelectionInTable:i,isFocused:e.editor?.isFocused,toolbarOpened:e.editor?._toolbarOpened??!1,isBold:e.editor.isActive(`bold`)??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isTable:e.editor.isActive(`table`)??!1,tableHasBorder:e.editor.getAttributes(`table`)?.border===`1`,canTable:e.editor.can().chain().insertTable().run()??!1,isItalic:e.editor.isActive(`italic`)??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isStrike:e.editor.isActive(`strike`)??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive(`code`)??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isUnderline:e.editor.isActive(`underline`)??!1,isSubScript:e.editor.isActive(`subscript`)??!1,isSuperScript:e.editor.isActive(`superscript`)??!1,isParagraph:e.editor.isActive(`paragraph`)??!1,isHeading1:e.editor.isActive(`heading`,{level:1})??!1,isHeading2:e.editor.isActive(`heading`,{level:2})??!1,isHeading3:e.editor.isActive(`heading`,{level:3})??!1,isHeadingParagraph:e.editor.isActive(`headingParagraph`)??!1,isHeading4:e.editor.isActive(`heading`,{level:4})??!1,isHeading5:e.editor.isActive(`heading`,{level:5})??!1,isHeading6:e.editor.isActive(`heading`,{level:6})??!1,isBulletList:e.editor.isActive(`bulletList`)??!1,isOrderedList:e.editor.isActive(`orderedList`)??!1,isCodeBlock:e.editor.isActive(`codeBlock`)??!1,isBlockquote:e.editor.isActive(`blockquote`)??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}}),d=!!o,f=k(t.toolbar,bz,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!u.toolbarOpened&&!u.hideDefaultToolbar,[t.autoWidth]:d,[t.fullWidth]:!d,[t.hidden]:l.isHidden===!0}),p=l.minWidth===void 0?{}:{minWidth:l.minWidth},m=e=>{e.preventDefault()},h=(0,N.useMemo)(()=>[{icon:(0,F.jsx)(G2,{}),label:`Insert table`,onClick:e=>e.chain().focus().insertTable({rows:2,cols:2,withHeaderRow:!1}).run(),hidden:e=>!n?.includes(`table`)||e.isTable,isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(h4,{}),label:`Add table row`,onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(g4,{}),label:`Remove table row`,onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(_4,{}),label:`Add table column`,onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(v4,{}),label:`Remove table column`,onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(y4,{}),label:`Remove table`,onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(t4,{}),label:`Table borders`,toggle:!0,onClick:e=>{let t=e.getAttributes(`table`),n={...t,border:t.border===`0`?`1`:`0`};e.commands.updateAttributes(`table`,n)},hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.tableHasBorder,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(V2,{}),label:`Bold`,toggle:!0,onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,F.jsx)(H2,{}),label:`Italic`,toggle:!0,onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,F.jsx)(U2,{}),label:`Strikethrough`,toggle:!0,onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,F.jsx)(W2,{}),label:`Code`,toggle:!0,onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,F.jsx)(J2,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,F.jsx)(O6,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,F.jsx)(D6,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,F.jsx)(X2,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,F.jsx)($2,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,F.jsx)(e4,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,F.jsx)(f4,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,F.jsx)(Q2,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,F.jsx)(k6,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,F.jsx)(Y2,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,F.jsx)(T6,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(i4)},{icon:(0,F.jsx)(T6,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(a4)},{icon:(0,F.jsx)(u4,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,F.jsx)(K2,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,F.jsx)(q2,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,F.jsx)(LW,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,F.jsx)(Z2,{}),label:`Redo`,hidden:()=>!n?.includes(`redo`),onClick:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.canRedo}],[n,e]),g=u.hideDefaultToolbar&&u.currentNode?.type?.name===`drag_in_the_blank`;return(0,F.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,F.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,F.jsx)(`div`,{className:t.buttonsContainer,children:(0,F.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,title:`Delete response area`,children:(0,F.jsx)(yz,{})})})}),!u.hideDefaultToolbar&&(0,F.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,F.jsx)(`div`,{className:t.buttonsContainer,children:h.filter(e=>!e.hidden?.(u)).map((n,r)=>{let i=n.isDisabled?.(u),a=n.isActive?.(u);return(0,F.jsx)(`button`,{type:`button`,disabled:i,"aria-label":n.label,title:n.label,"aria-pressed":n.toggle?!!a:void 0,onClick:t=>{t.preventDefault(),n.onClick(e)},className:k(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Insert response area`,title:`Insert response area`,onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,F.jsx)(r4,{})}),l.showDone&&(0,F.jsx)(wz,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,F.jsx)(E6,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var j6=e=>{Mo();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`toolbarButton`,active:`active`,disabled:`disabled`,isActive:`isActive`,toolbar:`toolbar`,toolbarWithNoDone:`toolbarWithNoDone`,toolbarTop:`toolbarTop`,toolbarRight:`toolbarRight`,fullWidth:`fullWidth`,hidden:`hidden`,autoWidth:`autoWidth`,focused:`focused`,iconRoot:`iconRoot`,label:`label`,shared:`shared`};return(0,F.jsx)(M6,{children:(0,F.jsx)(A6,{...e,classes:t})})},M6=L(`div`)(()=>({"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .toolbarButton":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:UH()},"&:focus":{outline:`2px solid ${AU()}`}},"& .active":{color:UH()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:WH()}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`absolute`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:0,pointerEvents:`none`},"& .toolbarWithNoDone":{minWidth:`265px`},"& .toolbarTop":{top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`auto`},"& .focused":{opacity:1,pointerEvents:`auto`},"& .iconRoot":{width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`},"& .label":{color:`var(--editable-html-toolbar-check, #00bb00)`},"& .shared":{display:`flex`}})),N6=L(`div`,{shouldForwardProp:e=>![`noBorder`,`error`].includes(e)})(({theme:e,noBorder:t,error:n})=>({position:`relative`,padding:`0px`,border:t?`none`:`1px solid #ccc`,borderRadius:`4px`,cursor:`text`,'& [data-slate-editor="true"]':{wordBreak:`break-word`,overflow:`visible`,maxHeight:`500px`,padding:`5px`},"&:first-child":{marginTop:0},"& ul, & ol":{padding:`0 1rem`,margin:`1.25rem 1rem 1.25rem 0.4rem`},"& ul li p, & ol li p":{marginTop:`0.25em`,marginBottom:`0.25em`},"& h1, & h2, & h3, & h4, & h5, & h6":{lineHeight:1.1,marginTop:`2.5rem`,textWrap:`pretty`},"& h1, & h2":{marginTop:`3.5rem`,marginBottom:`1.5rem`},"& h1":{fontSize:`1.4rem`},"& h2":{fontSize:`1.2rem`},"& h3":{fontSize:`1.1rem`},"& h4, & h5, & h6":{fontSize:`1rem`},"& code":{backgroundColor:`var(--purple-light)`,borderRadius:`0.4rem`,color:`var(--black)`,fontSize:`0.85rem`,padding:`0.25em 0.3em`},"& pre":{background:`var(--black)`,borderRadius:`0.5rem`,color:`var(--white)`,fontFamily:`'JetBrainsMono', monospace`,margin:`1.5rem 0`,padding:`0.75rem 1rem`,"& code":{background:`none`,color:`inherit`,fontSize:`0.8rem`,padding:0}},"& blockquote":{background:`#f9f9f9`,borderLeft:`5px solid #ccc`,margin:`1.5em 10px`,padding:`.5em 10px`},"& p":{margin:`0`},"& table":{tableLayout:`fixed`,width:`100%`,borderCollapse:`collapse`,color:UH(),backgroundColor:uU()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${xU()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${xU()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),P6=L(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:UH(),backgroundColor:n?e.palette.action.selected:uU(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),F6=L(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function I6(e){let[t,n]=(0,N.useState)(null),r=(0,N.useRef)(null),{editor:i,disabled:a,children:o,disableScrollbar:s,activePlugins:c,toolbarOpts:l,responseAreaProps:u,autoFocus:d,minWidth:f,width:p,maxWidth:m,minHeight:h,height:g,maxHeight:_,highlightShape:v,ref:y}=e;(0,N.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,N.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,N.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.style.whiteSpace=`nowrap`,t.textContent=`W`.repeat(e.charactersLimit);let i=window.getComputedStyle(r.current);[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`wordSpacing`,`textTransform`,`lineHeight`].forEach(e=>{t.style[e]=i[e]}),document.body.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,N.useMemo)(()=>({width:B2(t||p),minWidth:B2(f),maxWidth:B2(m),height:B2(g),minHeight:B2(h),maxHeight:B2(_)}),[t,f,p,m,h,g,_]);return(0,F.jsxs)(N6,{noBorder:l&&l.noBorder,error:l&&l.error,className:e.className,style:{width:b.width,minWidth:b.minWidth,maxWidth:b.maxWidth},ref:r,children:[(0,F.jsx)(P6,{disableScrollbar:s,highlightShape:v,children:(0,F.jsx)(F6,{noPadding:l&&l.noPadding,children:o})}),i&&(0,F.jsx)(j6,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var L6=D(`@pie-lib:editable-html:plugins`),R6=[`bold`,`html`,`extraCSSRules`,`italic`,`underline`,`strikethrough`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`blockquote`,`h3`,`table`,`video`,`audio`,`responseArea`,`redo`,`undo`,`superscript`,`subscript`],z6={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},B6=R6.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),V6=(e,t,n)=>{L6(`[buildPlugins] opts: `,n),e||=B6;let r=(t,n=!0)=>e.includes(t)&&n&&t,i=n.image&&n.image.delete,a=n.math,o=n.responseArea&&n.responseArea.type,s=!x(n.extraCSSRules),c=n?.languageCharacters||[];return _([r(`table`),r(`bold`),r(`italic`),r(`strikethrough`),r(`underline`),r(`superscript`),r(`subscript`),r(`image`,!!i),r(`video`),r(`audio`),r(`math`,!!a),...c.map(e=>r(`languageCharacters`,e)),r(`text-align`),r(`blockquote`),r(`h3`),r(`bulleted-list`),r(`numbered-list`),r(`undo`),r(`redo`),r(`responseArea`,!!o),r(`css`,!!s),r(`html`,!!n.html)])},H6={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},U6={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},W6=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],G6={"--white":`#fff`,"--black":`#2e2b29`,"--black-contrast":`#110f0e`,"--gray-1":`rgba(61, 37, 20, .05)`,"--gray-2":`rgba(61, 37, 20, .08)`,"--gray-3":`rgba(61, 37, 20, .12)`,"--gray-4":`rgba(53, 38, 28, .3)`,"--gray-5":`rgba(28, 25, 23, .6)`,"--green":`#22c55e`,"--purple":`#6a00f5`,"--purple-contrast":`#5800cc`,"--purple-light":`rgba(88, 5, 255, .05)`,"--yellow-contrast":`#facc15`,"--yellow":`rgba(250, 204, 21, .4)`,"--yellow-light":`#fffae5`,"--red":`#ff5c33`,"--red-light":`#ffebe5`,"--shadow":`0px 12px 33px 0px rgba(0, 0, 0, .06),
394
- 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},K6=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,N.useState)([]),[a,o]=(0,N.useState)(!1),{toolbarOpts:s}=e,c=(0,N.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...H6,...s},u=(0,N.useCallback)(t=>{let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},[e.markup,e.onChange,e.onDone,l.doneOn]),d=(0,N.useMemo)(()=>({...U6,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,N.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||W6)?.filter(e=>{let t=z6[e]||e,r=n[t]||{};return!r||!r.disabled});return V6(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:d.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e,d.type]),p=$x({extensions:[mF.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),YP,XP.configure({limit:e.charactersLimit||1e6}),zP.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]}}),R2,OL,z2,kL,AL,_F.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),wL,cL,DL,EL,pZ.configure(d),mZ.configure(d),gZ.configure(d),_Z.configure(d),hZ.configure(d),T$.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),pF,fF,gF,L1.configure({toolbarOpts:l,imageHandling:{disableImageAlignmentButtons:e.disableImageAlignmentButtons,onDone:t=>e.onDone?.(t.getHTML()),onDelete:e.imageSupport&&e.imageSupport.delete&&(t=>{let{src:n}=t.attrs;e.imageSupport.delete(n,e=>{c(t.pos)})}),insertImageRequested:e.imageSupport&&((t,n,r)=>{let[o,s]=n,l=n=>{let r;a&&n&&(r=e.onChange),c(s),r?.(t.getHTML())};t._insertingImage=!0,i(e=>[...e,o]),(()=>{let n=r(l),i=v(()=>{let e=()=>window.removeEventListener(`focus`,i);if(!t._insertingImage){e();return}c(s),t._insertingImage=!1,e()},500);window.addEventListener(`focus`,i),e.imageSupport.add(n)})()}),maxImageWidth:e.maxImageWidth,maxImageHeight:e.maxImageHeight},limit:3}),B0.configure({uploadSoundSupport:e.uploadSoundSupport}),r2.configure({extraCSSRules:e.extraCSSRules})],immediatelyRender:!1,editorProps:{handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:bF(e.markup),onUpdate:({editor:t,transaction:n})=>{n.isDone&&e.onChange?.(t.getHTML())},onBlur:({editor:e})=>{e._insertingImage||e._toolbarOpened||e.isActive(`inline_dropdown`)||e.isActive(`explicit_constructed_response`)||!e.schema||u(e)}},[e.charactersLimit]);(0,N.useEffect)(()=>{e.editorRef&&e.editorRef(p)},[e.editorRef,p]),(0,N.useEffect)(()=>{p?.setEditable(!e.disabled)},[e.disabled,p]),(0,N.useEffect)(()=>{if(!p)return;let t=bF(e.markup);t!==p.getHTML()&&p.commands.setContent(t,{emitUpdate:!1})},[e.markup,p]),(0,N.useEffect)(()=>{Object.entries(G6).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let m=Yx({editor:p,selector:e=>({isFocused:e.editor?.isFocused})}),h=(0,N.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:B2(n),minWidth:B2(t),maxWidth:B2(r),height:B2(a),minHeight:B2(i),maxHeight:B2(o)}},[e]);return(0,F.jsx)(I6,{...e,activePlugins:f,toolbarOpts:l,editorState:m,editor:p,children:p&&(0,F.jsx)(q6,{style:{minHeight:h.minHeight,height:h.height,maxHeight:h.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:p})})},q6=L(Kx,{shouldForwardProp:e=>![`showParagraph`,`separateParagraph`].includes(e)})(({showParagraph:e,separateParagraph:t})=>({display:`flex`,outline:`none !important`,"& .ProseMirror":{flex:1,padding:`5px`,maxHeight:`500px`,outline:`none !important`,position:`initial`,"& > p, & > div":{margin:`0`},"& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child":{position:`relative`},"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before":{content:`attr(data-placeholder)`,position:`absolute`,left:0,top:0,color:`#9CA3AF`,pointerEvents:`none`,whiteSpace:`pre-wrap`},...e&&{"& > p:has(+ p)::after, & > div:has(+ div)::after":{display:`block`,content:`"¶"`,fontSize:`1em`,color:`#146EB3`}},...t&&{"& > p:has(+ p)":{marginBottom:`1em`}}}})),J6=K6,Y6=(e,t,n)=>{let r=n||[],i=r.reduce((e,t)=>e+t.textContent.length,0),a=!0;if(i>t)return!1;for(e&&=(e.nodeType===3&&e.parentNode&&!e.parentNode.hasAttribute(`data-ann-id`)&&r.push(e),e.firstChild);e&&a;)a=Y6(e,t,r),e=e.nextSibling;return r},X6=(e,t,n)=>{let r=Y6(n,t),i=[],a=0;return r.forEach(n=>{let r=a+n.textContent.length;[e,t].forEach(e=>{a<=e&&e<r&&i.push({node:n,offset:e-a})}),a=r}),i},Z6=e=>{let{commonAncestorContainer:t,startContainer:n,endContainer:r,startOffset:i,endOffset:a}=e,o=[],s=!1,c=!1,l=``,u=e=>{let{nodeValue:t,childNodes:d}=e;e===n&&e===r?(t&&(l+=t.substring(i,a)),s=c=!0):e===n?(t&&(l+=t.substring(i)),s=!0):e===r?(t&&(l+=t.substring(0,a)),c=!0):e&&e.nodeType===3&&e.parentNode&&!e.parentNode.hasAttribute(`data-ann-id`)&&t&&s&&!c&&(l+=t,o.push(e)),d.forEach(e=>{if(!c)u(e);else return})};return u(t),[o,l]},Q6=e=>{let t=document.createElement(`SPAN`);return e.surroundContents(t),t},$6=e=>{if(e.startContainer===e.endContainer)return[Q6(e)];let[t]=Z6(e),n=document.createRange();n.selectNodeContents(e.startContainer),n.setStart(e.startContainer,e.startOffset);let r=Q6(n),i=document.createRange();i.selectNode(e.endContainer),i.setEnd(e.endContainer,e.endOffset);let a=Q6(i);return[r,...t.map(e=>{let t=document.createElement(`SPAN`);return e.parentNode.insertBefore(t,e),t.appendChild(e),t}),a]},e8=(e,t)=>{let n=document.createRange();n.setStart(t,0),n.setEnd(e.startContainer,e.startOffset);let[,r]=Z6(n),[,i]=Z6(e),a=r.length;return{quote:i,start:a,end:a+i.length}},t8=(e,t)=>{(e||[]).forEach(e=>{let t=e.parentNode,n=e.childNodes,r=n.length;if(r>0)for(let i=0;i<r;i++)t.insertBefore(n[0],e);else t.insertBefore(document.createTextNode(e.textContent),e);t.removeChild(e)}),t.normalize()},n8=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()},r8=e=>e.length>=20||e.search(/\n|\r|\r\n/)!==-1,i8=e=>Array.from(document.querySelectorAll(`[data-id='${e}']`)),a8=e=>document.querySelector(`[data-ann-id='${e}']`),o8=L(IH)(({annotationType:e})=>({"& .MuiPaper-root":{overflowX:`unset`,overflowY:`unset`,marginLeft:`16px`,"&::before":{position:`absolute`,right:`100%`,top:`13px`,border:`solid transparent`,content:`""`,height:0,width:0,pointerEvents:`none`,borderWidth:`7px`,borderRightColor:gU()},...e===`negative`&&{"&::before":{borderRightColor:`rgb(255, 204, 238) !important`}},...e===`positive`&&{"&::before":{borderRightColor:`rgb(153, 255, 153) !important`}}}})),s8=L(`div`)(({annotationType:e})=>({width:`200px`,overflow:`hidden`,borderRadius:`4px`,backgroundColor:wU(),border:`4px solid ${gU()}`,...e===`negative`&&{borderColor:`rgb(255, 204, 238) !important`},...e===`positive`&&{borderColor:`rgb(153, 255, 153) !important`}})),c8=L(`div`)(()=>({display:`flex`,flexWrap:`wrap`,borderTop:`2px solid ${gU()}`})),l8=L(`div`)(({variant:e,annotationType:t})=>({flexGrow:1,width:`28%`,textAlign:`center`,padding:`4px`,cursor:`pointer`,"&:not(:nth-child(3n))":{borderRight:`1px solid ${gU()}`},"&:hover":{backgroundColor:dU()},...e===`positive`&&{backgroundColor:`rgb(153, 255, 153) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`negative`&&{backgroundColor:`rgb(255, 204, 238) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`typeChange`&&t===`negative`&&{"&:hover":{backgroundColor:`rgb(153, 255, 153) !important`}},...e===`typeChange`&&t===`positive`&&{"&:hover":{backgroundColor:`rgb(255, 204, 238) !important`}}})),u8=class extends N.Component{static propTypes={anchorEl:p.object,open:p.bool,offset:p.number,value:p.string,type:p.string,onClose:p.func,onDelete:p.func,onSave:p.func,onTypeChange:p.func};constructor(e){super(e),this.state={value:e.value}}UNSAFE_componentWillReceiveProps(e){let{value:t}=e,{value:n}=this.props;t!==n&&this.setState({value:t})}onValueChange=e=>this.setState({value:e.target.value});handleSave=()=>{let{value:e,onSave:t,onClose:n,onDelete:r}=this.props,{value:i}=this.state;i===``&&r(),e!==i&&t(e,i),this.setState({value:``}),n()};handleTypeChange=()=>{let{onTypeChange:e,onDelete:t}=this.props,{value:n}=this.state;n===``?t():e(n),this.setState({value:``})};render(){let{anchorEl:e,offset:t,onDelete:n,open:r,type:i}=this.props,{value:a}=this.state;return(0,F.jsx)(o8,{anchorEl:e,elevation:2,open:r,onClose:this.handleSave,annotationType:i,style:{marginTop:`${t}px`,transition:`margin-top 2s ease-out`},transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:`top`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`left`},children:(0,F.jsxs)(s8,{annotationType:i,children:[(0,F.jsx)(s1,{id:`annotation-editor`,style:{padding:`2px 5px`,width:`95%`},autoFocus:!0,multiline:!0,rows:1,maxRows:4,value:a,onChange:this.onValueChange,InputProps:{disableUnderline:!0}}),(0,F.jsxs)(c8,{children:[(0,F.jsx)(l8,{onClick:n,children:`Delete`}),(0,F.jsx)(l8,{variant:`typeChange`,annotationType:i,onClick:this.handleTypeChange,children:i===`negative`?`Green`:`Pink`}),(0,F.jsx)(l8,{onClick:this.handleSave,children:`Save`})]})]})})}},d8=L(IH)({"& .MuiPaper-root":{overflowX:`unset`,overflowY:`unset`,marginTop:`-16px`,"&::after":{position:`absolute`,left:`calc(50% - 7px)`,border:`solid transparent`,content:`""`,height:0,width:0,pointerEvents:`none`,borderWidth:`7px`,borderTopColor:gU()}}}),f8=L(`div`)(()=>({width:`300px`,overflow:`hidden`,borderRadius:`4px`,backgroundColor:wU(),border:`2px solid ${gU()}`})),p8=L(`div`)({display:`flex`,flexWrap:`wrap`}),m8=L(`div`)(()=>({display:`flex`,flexWrap:`wrap`,borderTop:`2px solid ${gU()}`})),h8=L(`div`)(({variant:e})=>({width:`22%`,textAlign:`center`,padding:`4px`,cursor:`pointer`,borderBottom:`1px solid ${gU()}`,"&:not(:nth-child(4n))":{borderRight:`1px solid ${gU()}`},"&:nth-child(4n)":{flexGrow:1},"&:hover":{backgroundColor:dU()},...e===`positive`&&{backgroundColor:`rgb(153, 255, 153) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`negative`&&{backgroundColor:`rgb(255, 204, 238) !important`,"&:hover":{filter:`brightness(85%)`}}})),g8=class extends N.Component{static propTypes={anchorEl:p.object,open:p.bool,annotations:p.array,isNewAnnotation:p.bool,onClose:p.func,onDelete:p.func,onEdit:p.func,onWrite:p.func,onAnnotate:p.func};render(){let{anchorEl:e,annotations:t,isNewAnnotation:n,onAnnotate:r,onClose:i,onEdit:a,onDelete:o,onWrite:s,open:c}=this.props;return(0,F.jsx)(d8,{anchorEl:e,open:c,onClose:i,elevation:5,transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:`top`,horizontal:`center`},transformOrigin:{vertical:`bottom`,horizontal:`center`},children:(0,F.jsxs)(f8,{children:[(0,F.jsx)(p8,{children:t.map((e,t)=>(0,F.jsx)(h8,{variant:e.type,onClick:()=>r(e),children:e.label},`annotation-${t}`))}),(0,F.jsxs)(m8,{children:[(0,F.jsx)(h8,{onClick:i,children:`Cancel`}),(0,F.jsx)(h8,{style:{pointerEvents:`none`}}),n?(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(h8,{variant:`positive`,onClick:()=>s(`positive`),children:`Write`}),(0,F.jsx)(h8,{variant:`negative`,onClick:()=>s(`negative`),children:`Write`})]}):(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(h8,{onClick:o,children:`Delete`}),(0,F.jsx)(h8,{onClick:a,children:`Edit`})]})]})]})})}};function _8(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function v8(e,t){return!e||_8(e)?e:_8(e.default)?e.default:t&&_8(e[t])?e[t]:t&&_8(e[t]?.default)?e[t].default:e}var y8=v8(_G,`InputContainer`)||v8(S8.InputContainer,`InputContainer`),b8=$G,x8=b8.default,S8=x8&&typeof x8==`object`?x8:b8,C8=L(`div`)({padding:`10px 120px 10px 16px`,backgroundColor:`rgba(0, 0, 0, 0.06)`,border:`1px solid #ccc`,borderRadius:`4px`,overflowY:`scroll`,lineHeight:`36px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`,"& p":{margin:0},"& span[data-latex]":{userSelect:`none`,"-webkit-user-select":`none`,"-moz-user-select":`none`,"-ms-user-select":`none`}}),w8=L(`div`)({width:`230px`}),T8=L(`div`)({position:`relative`,overflowX:`hidden`,display:`flex`}),E8=L(y8)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),marginTop:e.spacing(2),width:`100%`})),D8=`
391
+ `),[i,a]=I2(r);if(i.length===0)return;let o=L2(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
392
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(z2,this.editor.getAttributes(B2)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=wb({find:V2,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=wb({find:V2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(B2)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),U2=/^\s*(\[([( |x])?\])\s$/,W2=Lb.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}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Vv(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)=>Fb(e,t,`- [${e.attrs?.checked?`x`:` `}] `),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`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};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=Hv(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[wb({find:U2,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),G2=Lb.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`,Vv(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,`
393
+ `):``,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=Pb(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);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Pb(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()}}});sb.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(_2.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(b2.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(j2.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(H2.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(W2.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(G2.configure(this.options.taskList)),e}});var K2=b2.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),q2=Lb.create({name:`headingParagraph`,group:`block`,content:`inline*`,defining:!0,addAttributes(){return{"data-heading":{default:`heading1`,parseHTML:e=>e.getAttribute(`data-heading`),renderHTML:e=>({"data-heading":e[`data-heading`]})}}},parseHTML(){return[{tag:`p[data-heading]`}]},renderHTML({HTMLAttributes:e}){return[`p`,Vv(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),J2=e=>{if(!e)return;let t=/^calc\((.*)\)$/;if(typeof e==`string`){if(e.endsWith(`%`))return;if(e.endsWith(`px`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`ch`)||e.endsWith(`em`)||e.match(t))return e;let n=parseInt(e,10);return Number.isNaN(n)?n:`${n}px`}if(typeof e==`number`)return`${e}px`},Y2=WL((0,F.jsx)(`path`,{d:`M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5`}),`FormatBold`),X2=WL((0,F.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),Z2=WL((0,F.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),Q2=WL((0,F.jsx)(`path`,{d:`M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z`}),`Code`),$2=WL((0,F.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z`}),`GridOn`),e4=WL((0,F.jsx)(`path`,{d:`M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z`}),`FormatListBulleted`),t4=WL((0,F.jsx)(`path`,{d:`M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z`}),`FormatListNumbered`),n4=WL((0,F.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z`}),`FormatUnderlined`),r4=WL((0,F.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),i4=WL((0,F.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),a4=WL((0,F.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z`}),`Redo`),o4=WL((0,F.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),s4=WL((0,F.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),c4=WL((0,F.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`}),`VolumeUp`),l4=WL((0,F.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),u4=L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),d4=()=>(0,F.jsx)(u4,{children:`+ Response Area`}),f4={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},p4={hasPreview:!0,characters:[[{unicode:`U+00A2`,description:`CENT SIGN`,write:`¢`,label:`¢`},{unicode:`U+00BF`,description:`INVERTED QUESTION MARK`,write:`¿`,label:`¿`},{unicode:`U+00B4`,description:`ACUTE ACCENT`,write:`´`,label:`´`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E1`,description:`LATIN SMALL LETTER A WITH ACUTE`,write:`á`,label:`á`},{unicode:`U+00E9`,description:`LATIN SMALL LETTER E WITH ACUTE`,write:`é`,label:`é`},{unicode:`U+00ED`,description:`LATIN SMALL LETTER I WITH ACUTE`,write:`í`,label:`í`},{unicode:`U+00F3`,description:`LATIN SMALL LETTER O WITH ACUTE`,write:`ó`,label:`ó`},{unicode:`U+00FA`,description:`LATIN SMALL LETTER U WITH ACUTE`,write:`ú`,label:`ú`},{unicode:`U+00F1`,description:`LATIN SMALL LETTER N WITH TILDE`,write:`ñ`,label:`ñ`}],[{unicode:`U+20AC`,description:`EURO SIGN`,write:`€`,label:`€`},{unicode:`U+00A1`,description:`INVERTED EXCLAMATION MARK`,write:`¡`,label:`¡`},{unicode:`U+00C1`,description:`LATIN CAPITAL LETTER A WITH ACUTE`,write:`Á`,label:`Á`},{unicode:`U+00C9`,description:`LATIN CAPITAL LETTER E WITH ACUTE`,write:`É`,label:`É`},{unicode:`U+00CD`,description:`LATIN CAPITAL LETTER I WITH ACUTE`,write:`Í`,label:`Í`},{unicode:`U+00D3`,description:`LATIN CAPITAL LETTER O WITH ACUTE`,write:`Ó`,label:`Ó`},{unicode:`U+00DA`,description:`LATIN CAPITAL LETTER U WITH ACUTE`,write:`Ú`,label:`Ú`},{unicode:`U+00D1`,description:`LATIN CAPITAL LETTER N WITH TILDE`,write:`Ñ`,label:`Ñ`}],[{unicode:`U+00A3`,description:`POUND SIGN`,write:`£`,label:`£`},{unicode:`U+00AB`,description:`LEFT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`«`,label:`«`},{unicode:`U+005E`,description:`CIRCUMFLEX ACCENT`,write:`^`,label:`^`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E2`,description:`LATIN SMALL LETTER A WITH CIRCUMFLEX`,write:`â`,label:`â`},{unicode:`U+00EA`,description:`LATIN SMALL LETTER E WITH CIRCUMFLEX`,write:`ê`,label:`ê`},{unicode:`U+00EE`,description:`LATIN SMALL LETTER I WITH CIRCUMFLEX`,write:`î`,label:`î`},{unicode:`U+00F4`,description:`LATIN SMALL LETTER O WITH CIRCUMFLEX`,write:`ô`,label:`ô`},{unicode:`U+00FB`,description:`LATIN SMALL LETTER U WITH CIRCUMFLEX`,write:`û`,label:`û`},{unicode:`U+00E7`,description:`LATIN SMALL LETTER C WITH CEDILLA`,write:`ç`,label:`ç`}],[{unicode:`U+00A5`,description:`YEN SIGN`,write:`¥`,label:`¥`},{unicode:`U+00BB`,description:`RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`»`,label:`»`},{unicode:`U+00C2`,description:`LATIN CAPITAL LETTER A WITH CIRCUMFLEX`,write:`Â`,label:`Â`},{unicode:`U+00CA`,description:`LATIN CAPITAL LETTER E WITH CIRCUMFLEX`,write:`Ê`,label:`Ê`},{unicode:`U+00CE`,description:`LATIN CAPITAL LETTER I WITH CIRCUMFLEX`,write:`Î`,label:`Î`},{unicode:`U+00D4`,description:`LATIN CAPITAL LETTER O WITH CIRCUMFLEX`,write:`Ô`,label:`Ô`},{unicode:`U+00DB`,description:`LATIN CAPITAL LETTER U WITH CIRCUMFLEX`,write:`Û`,label:`Û`},{unicode:`U+00C7`,description:`LATIN CAPITAL LETTER C WITH CEDILLA`,write:`Ç`,label:`Ç`}],[{unicode:`U+200A`,description:`HAIR SPACE`,write:String.fromCodePoint(`0x200A`),label:`&hairsp;`},{unicode:`U+00A7`,description:`SECTION SIGN`,write:`§`,label:`§`},{unicode:`U+00A8`,description:`DIAERESIS`,write:`¨`,label:`¨`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E4`,description:`LATIN SMALL LETTER A WITH DIAERESIS`,write:`ä`,label:`ä`},{unicode:`U+00EB`,description:`LATIN SMALL LETTER E WITH DIAERESIS`,write:`ë`,label:`ë`},{unicode:`U+00EF`,description:`LATIN SMALL LETTER I WITH DIAERESIS`,write:`ï`,label:`ï`},{unicode:`U+00F6`,description:`LATIN SMALL LETTER O WITH DIAERESIS`,write:`ö`,label:`ö`},{unicode:`U+00FC`,description:`LATIN SMALL LETTER U WITH DIAERESIS`,write:`ü`,label:`ü`},{unicode:`U+00DF`,description:`LATIN SMALL LETTER SHARP S`,write:`ß`,label:`ß`}],[{unicode:`U+2009`,description:`THIN SPACE`,write:String.fromCodePoint(`0x2009`),label:`&thinsp;`},{unicode:`U+2026`,description:`HORIZONTAL ELLIPSIS`,write:`…`,label:`…`},{unicode:`U+00C4`,description:`LATIN CAPITAL LETTER A WITH DIAERESIS`,write:`Ä`,label:`Ä`},{unicode:`U+00CB`,description:`LATIN CAPITAL LETTER E WITH DIAERESIS`,write:`Ë`,label:`Ë`},{unicode:`U+00CF`,description:`LATIN CAPITAL LETTER I WITH DIAERESIS`,write:`Ï`,label:`Ï`},{unicode:`U+00D6`,description:`LATIN CAPITAL LETTER O WITH DIAERESIS`,write:`Ö`,label:`Ö`},{unicode:`U+00DC`,description:`LATIN CAPITAL LETTER U WITH DIAERESIS`,write:`Ü`,label:`Ü`},{unicode:`U+2212`,description:`MINUS SIGN`,write:`−`,label:`−`}],[{unicode:`U+00A0`,description:`NO-BREAK SPACE`,write:String.fromCodePoint(`0x00A0`),label:`&nbsp;`},{unicode:`U+2022`,description:`BULLET`,write:`•`,label:`•`},{unicode:`U+0060`,description:`GRAVE ACCENT`,write:"`",label:"`",extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E0`,description:`LATIN SMALL LETTER A WITH GRAVE`,write:`à`,label:`à`},{unicode:`U+00E8`,description:`LATIN SMALL LETTER E WITH GRAVE`,write:`è`,label:`è`},{unicode:`U+00EC`,description:`LATIN SMALL LETTER I WITH GRAVE`,write:`ì`,label:`ì`},{unicode:`U+00F2`,description:`LATIN SMALL LETTER O WITH GRAVE`,write:`ò`,label:`ò`},{unicode:`U+00F9`,description:`LATIN SMALL LETTER U WITH GRAVE`,write:`ù`,label:`ù`},{unicode:`U+2013`,description:`EN DASH`,write:`–`,label:`–`}],[{unicode:`U+2003`,description:`EM SPACE`,write:String.fromCodePoint(`0x2003`),label:`&emsp;`},{unicode:`U+25E6`,description:`WHITE BULLET`,write:`◦`,label:`◦`},{unicode:`U+00C0`,description:`LATIN CAPITAL LETTER A WITH GRAVE`,write:`À`,label:`À`},{unicode:`U+00C8`,description:`LATIN CAPITAL LETTER E WITH GRAVE`,write:`È`,label:`È`},{unicode:`U+00CC`,description:`LATIN CAPITAL LETTER I WITH GRAVE`,write:`Ì`,label:`Ì`},{unicode:`U+00D2`,description:`LATIN CAPITAL LETTER O WITH GRAVE`,write:`Ò`,label:`Ò`},{unicode:`U+00D9`,description:`LATIN CAPITAL LETTER U WITH GRAVE`,write:`Ù`,label:`Ù`},{unicode:`U+2014`,description:`EM DASH`,write:`—`,label:`—`}]]},m4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),h4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),g4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z`,fill:`currentColor`})}),_4=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),v4=({editor:e,onChange:t})=>{let[n,r]=(0,N.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,F.jsx)(h4,{});break;case e.isActive({textAlign:`center`}):i=(0,F.jsx)(g4,{});break;case e.isActive({textAlign:`justify`}):i=(0,F.jsx)(_4,{});break;default:i=(0,F.jsx)(m4,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,F.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,F.jsx)(_W,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,F.jsxs)(GG,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,F.jsx)(c2,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,F.jsx)(m4,{})}),(0,F.jsx)(c2,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,F.jsx)(g4,{})}),(0,F.jsx)(c2,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,F.jsx)(h4,{})}),(0,F.jsx)(c2,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,F.jsx)(_4,{})})]})})]})},y4=L(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),b4=()=>(0,F.jsx)(y4,{children:`CSS`}),x4=L(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),S4=e=>t=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(e,{...t})}),C4=S4(e=>(0,F.jsx)(x4,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),w4=S4(e=>(0,F.jsx)(x4,{...e,d:`M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z`})),T4=S4(e=>(0,F.jsx)(x4,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),E4=S4(e=>(0,F.jsx)(x4,{...e,d:`M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z`})),D4=S4(e=>(0,F.jsx)(x4,{...e,d:`M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z`})),O4=`bottom`,k4=`right`,A4=`left`,j4=`auto`,M4=[`top`,O4,k4,A4],N4=`start`,P4=`clippingParents`,F4=`viewport`,I4=`popper`,L4=`reference`,R4=M4.reduce(function(e,t){return e.concat([t+`-`+N4,t+`-end`])},[]),z4=[].concat(M4,[j4]).reduce(function(e,t){return e.concat([t,t+`-`+N4,t+`-end`])},[]),B4=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function V4(e){return e?(e.nodeName||``).toLowerCase():null}function H4(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function U4(e){return e instanceof H4(e).Element||e instanceof Element}function W4(e){return e instanceof H4(e).HTMLElement||e instanceof HTMLElement}function G4(e){return typeof ShadowRoot>`u`?!1:e instanceof H4(e).ShadowRoot||e instanceof ShadowRoot}function K4(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!W4(i)||!V4(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function q4(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!W4(r)||!V4(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var J4={name:`applyStyles`,enabled:!0,phase:`write`,fn:K4,effect:q4,requires:[`computeStyles`]};function Y4(e){return e.split(`-`)[0]}var X4=Math.max,Z4=Math.min,Q4=Math.round;function $4(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function e3(){return!/^((?!chrome|android).)*safari/i.test($4())}function t3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&W4(e)&&(i=e.offsetWidth>0&&Q4(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Q4(r.height)/e.offsetHeight||1);var o=(U4(e)?H4(e):window).visualViewport,s=!e3()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function n3(e){var t=t3(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function r3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&G4(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function i3(e){return H4(e).getComputedStyle(e)}function a3(e){return[`table`,`td`,`th`].indexOf(V4(e))>=0}function o3(e){return((U4(e)?e.ownerDocument:e.document)||window.document).documentElement}function s3(e){return V4(e)===`html`?e:e.assignedSlot||e.parentNode||(G4(e)?e.host:null)||o3(e)}function c3(e){return!W4(e)||i3(e).position===`fixed`?null:e.offsetParent}function l3(e){var t=/firefox/i.test($4());if(/Trident/i.test($4())&&W4(e)&&i3(e).position===`fixed`)return null;var n=s3(e);for(G4(n)&&(n=n.host);W4(n)&&[`html`,`body`].indexOf(V4(n))<0;){var r=i3(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function u3(e){for(var t=H4(e),n=c3(e);n&&a3(n)&&i3(n).position===`static`;)n=c3(n);return n&&(V4(n)===`html`||V4(n)===`body`&&i3(n).position===`static`)?t:n||l3(e)||t}function d3(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function f3(e,t,n){return X4(e,Z4(t,n))}function p3(e,t,n){var r=f3(e,t,n);return r>n?n:r}function m3(){return{top:0,right:0,bottom:0,left:0}}function h3(e){return Object.assign({},m3(),e)}function g3(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var _3=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,h3(typeof e==`number`?g3(e,M4):e)};function v3(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Y4(n.placement),c=d3(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=_3(i.padding,n),d=n3(a),f=c===`y`?`top`:A4,p=c===`y`?O4:k4,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=u3(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=f3(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function y3(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||r3(t.elements.popper,r)&&(t.elements.arrow=r))}var b3={name:`arrow`,enabled:!0,phase:`main`,fn:v3,effect:y3,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function x3(e){return e.split(`-`)[1]}var S3={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function C3(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Q4(n*i)/i||0,y:Q4(r*i)/i||0}}function w3(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=A4,b=`top`,x=window;if(l){var S=u3(n),C=`clientHeight`,w=`clientWidth`;if(S===H4(n)&&(S=o3(n),i3(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=O4;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=k4;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&S3),O=u===!0?C3({x:p,y:h},H4(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function T3(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:Y4(t.placement),variation:x3(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,w3(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,w3(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var E3={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:T3,data:{}},D3={passive:!0};function O3(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=H4(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,D3)}),s&&c.addEventListener(`resize`,n.update,D3),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,D3)}),s&&c.removeEventListener(`resize`,n.update,D3)}}var k3={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:O3,data:{}},A3={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function j3(e){return e.replace(/left|right|bottom|top/g,function(e){return A3[e]})}var M3={start:`end`,end:`start`};function N3(e){return e.replace(/start|end/g,function(e){return M3[e]})}function P3(e){var t=H4(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function F3(e){return t3(o3(e)).left+P3(e).scrollLeft}function I3(e,t){var n=H4(e),r=o3(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=e3();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+F3(e),y:c}}function L3(e){var t=o3(e),n=P3(e),r=e.ownerDocument?.body,i=X4(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=X4(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+F3(e),s=-n.scrollTop;return i3(r||t).direction===`rtl`&&(o+=X4(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function R3(e){var t=i3(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function z3(e){return[`html`,`body`,`#document`].indexOf(V4(e))>=0?e.ownerDocument.body:W4(e)&&R3(e)?e:z3(s3(e))}function B3(e,t){t===void 0&&(t=[]);var n=z3(e),r=n===e.ownerDocument?.body,i=H4(n),a=r?[i].concat(i.visualViewport||[],R3(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(B3(s3(a)))}function V3(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function H3(e,t){var n=t3(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function U3(e,t,n){return t===`viewport`?V3(I3(e,n)):U4(t)?H3(t,n):V3(L3(o3(e)))}function W3(e){var t=B3(s3(e)),n=[`absolute`,`fixed`].indexOf(i3(e).position)>=0&&W4(e)?u3(e):e;return U4(n)?t.filter(function(e){return U4(e)&&r3(e,n)&&V4(e)!==`body`}):[]}function G3(e,t,n,r){var i=t===`clippingParents`?W3(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=U3(e,n,r);return t.top=X4(i.top,t.top),t.right=Z4(i.right,t.right),t.bottom=Z4(i.bottom,t.bottom),t.left=X4(i.left,t.left),t},U3(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function K3(e){var t=e.reference,n=e.element,r=e.placement,i=r?Y4(r):null,a=r?x3(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case O4:c={x:o,y:t.y+t.height};break;case k4:c={x:t.x+t.width,y:s};break;case A4:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?d3(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case N4:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function q3(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?P4:s,l=n.rootBoundary,u=l===void 0?F4:l,d=n.elementContext,f=d===void 0?I4:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=h3(typeof g==`number`?g3(g,M4):g),v=f===`popper`?L4:I4,y=e.rects.popper,b=e.elements[m?v:f],x=G3(U4(b)?b:b.contextElement||o3(e.elements.popper),c,u,o),S=t3(e.elements.reference),C=K3({reference:S,element:y,strategy:`absolute`,placement:i}),w=V3(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function J3(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?z4:c,u=x3(r),d=u?s?R4:R4.filter(function(e){return x3(e)===u}):M4,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=q3(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[Y4(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function Y3(e){if(Y4(e)===`auto`)return[];var t=j3(e);return[N3(e),t,N3(t)]}function X3(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=Y4(g)===g,v=c||(_||!m?[j3(g)]:Y3(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(Y4(n)===`auto`?J3(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=Y4(E),O=x3(E)===N4,k=[`top`,O4].indexOf(D)>=0,A=k?`width`:`height`,j=q3(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?k4:A4:O?O4:`top`;b[A]>x[A]&&(M=j3(M));var ee=j3(M),te=[];if(a&&te.push(j[D]<=0),s&&te.push(j[M]<=0,j[ee]<=0),te.every(function(e){return e})){w=E,C=!1;break}S.set(E,te)}if(C)for(var N=m?3:1,ne=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},re=N;re>0&&ne(re)!==`break`;re--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var Z3={name:`flip`,enabled:!0,phase:`main`,fn:X3,requiresIfExists:[`offset`],data:{_skip:!1}};function Q3(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function $3(e){return[`top`,k4,O4,A4].some(function(t){return e[t]>=0})}function e6(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=q3(t,{elementContext:`reference`}),s=q3(t,{altBoundary:!0}),c=Q3(o,r),l=Q3(s,i,a),u=$3(c),d=$3(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var t6={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:e6};function n6(e,t,n){var r=Y4(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function r6(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=z4.reduce(function(e,n){return e[n]=n6(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var i6={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:r6};function a6(e){var t=e.state,n=e.name;t.modifiersData[n]=K3({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var o6={name:`popperOffsets`,enabled:!0,phase:`read`,fn:a6,data:{}};function s6(e){return e===`x`?`y`:`x`}function c6(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=q3(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=Y4(t.placement),v=x3(t.placement),y=!v,b=d3(_),x=s6(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:A4,A=b===`y`?O4:k4,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],te=M-g[A],N=p?-w[j]/2:0,ne=v===`start`?C[j]:w[j],re=v===`start`?-w[j]:-C[j],ie=t.elements.arrow,P=p&&ie?n3(ie):{width:0,height:0},ae=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:m3(),oe=ae[k],se=ae[A],ce=f3(0,C[j],P[j]),le=y?C[j]/2-N-ce-oe-E.mainAxis:ne-ce-oe-E.mainAxis,ue=y?-C[j]/2+N+ce+se+E.mainAxis:re+ce+se+E.mainAxis,de=t.elements.arrow&&u3(t.elements.arrow),fe=de?b===`y`?de.clientTop||0:de.clientLeft||0:0,pe=D?.[b]??0,me=M+le-pe-fe,he=M+ue-pe,ge=f3(p?Z4(ee,me):ee,M,p?X4(te,he):te);S[b]=ge,O[b]=ge-M}if(s){var _e=b===`x`?`top`:A4,ve=b===`x`?O4:k4,ye=S[x],be=x===`y`?`height`:`width`,xe=ye+g[_e],Se=ye-g[ve],Ce=[`top`,A4].indexOf(_)!==-1,we=D?.[x]??0,Te=Ce?xe:ye-C[be]-w[be]-we+E.altAxis,Ee=Ce?ye+C[be]+w[be]-we-E.altAxis:Se,De=p&&Ce?p3(Te,ye,Ee):f3(p?Te:xe,ye,p?Ee:Se);S[x]=De,O[x]=De-ye}t.modifiersData[r]=O}}var l6={name:`preventOverflow`,enabled:!0,phase:`main`,fn:c6,requiresIfExists:[`offset`]};function u6(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function d6(e){return e===H4(e)||!W4(e)?P3(e):u6(e)}function f6(e){var t=e.getBoundingClientRect(),n=Q4(t.width)/e.offsetWidth||1,r=Q4(t.height)/e.offsetHeight||1;return n!==1||r!==1}function p6(e,t,n){n===void 0&&(n=!1);var r=W4(t),i=W4(t)&&f6(t),a=o3(t),o=t3(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((V4(t)!==`body`||R3(a))&&(s=d6(t)),W4(t)?(c=t3(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=F3(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function m6(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function h6(e){var t=m6(e);return B4.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function g6(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function _6(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var v6={placement:`bottom`,modifiers:[],strategy:`absolute`};function y6(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function b6(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?v6:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},v6,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:U4(e)?B3(e):e.contextElement?B3(e.contextElement):[],popper:B3(t)};var s=h6(_6([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(y6(t,n)){i.rects={reference:p6(t,u3(n),i.options.strategy===`fixed`),popper:n3(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:g6(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!y6(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var x6=b6({defaultModifiers:[k3,o6,E3,J4,i6,Z3,l6,b3,t6]});function S6(e){return Zr(`MuiPopper`,e)}Qr(`MuiPopper`,[`root`]);function C6(e,t){if(t===`ltr`)return e;switch(e){case`bottom-end`:return`bottom-start`;case`bottom-start`:return`bottom-end`;case`top-end`:return`top-start`;case`top-start`:return`top-end`;default:return e}}function w6(e){return typeof e==`function`?e():e}function T6(e){return e.nodeType!==void 0}var E6=e=>{let{classes:t}=e;return A({root:[`root`]},S6,t)},D6={},O6=N.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:a,modifiers:o,open:s,placement:c,popperOptions:l,popperRef:u,slotProps:d={},slots:f={},TransitionProps:p,ownerState:m,...h}=e,g=N.useRef(null),_=aR(g,t),v=N.useRef(null),y=aR(v,u),b=N.useRef(y);fi(()=>{b.current=y},[y]),N.useImperativeHandle(u,()=>v.current,[]);let x=C6(c,i),[S,C]=N.useState(x),[w,T]=N.useState(w6(n));N.useEffect(()=>{v.current&&v.current.forceUpdate()}),N.useEffect(()=>{n&&T(w6(n))},[n]),fi(()=>{if(!w||!s)return;let e=e=>{C(e.placement)},t=[{name:`preventOverflow`,options:{altBoundary:a}},{name:`flip`,options:{altBoundary:a}},{name:`onUpdate`,enabled:!0,phase:`afterWrite`,fn:({state:t})=>{e(t)}}];o!=null&&(t=t.concat(o)),l&&l.modifiers!=null&&(t=t.concat(l.modifiers));let n=x6(w,g.current,{placement:x,...l,modifiers:t});b.current(n);let r=g.current;return()=>{if(r){let{style:e}=r,t=e.position,i=e.top,a=e.left,o=e.transform;n.destroy(),e.position=t,e.top=i,e.left=a,e.transform=o}else n.destroy();b.current(null)}},[w,a,o,s,l,x]);let E={placement:S};p!==null&&(E.TransitionProps=p);let D=E6(e),O=f.root??`div`;return(0,F.jsx)(O,{...BG({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),k6=L(N.forwardRef(function(e,t){let{anchorEl:n,children:r,container:i,direction:a=`ltr`,disablePortal:o=!1,keepMounted:s=!1,modifiers:c,open:l,placement:u=`bottom`,popperOptions:d=D6,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=N.useState(!0),b=()=>{y(!1)},x=()=>{y(!0)};if(!s&&!l&&(!m||v))return null;let S;if(i)S=i;else if(n){let e=w6(n);S=e&&T6(e)?JL(e).body:JL(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,F.jsx)(cH,{disablePortal:o,container:S,children:(0,F.jsx)(O6,{anchorEl:n,direction:a,disablePortal:o,modifiers:c,ref:t,open:m?!v:l,placement:u,popperOptions:d,popperRef:f,slotProps:h,slots:g,..._,style:{position:`fixed`,top:0,left:0,display:C,...p},TransitionProps:w,children:r})})}),{name:`MuiPopper`,slot:`Root`})({}),A6=L(N.forwardRef(function(e,t){let n=Ri(),{anchorEl:r,component:i,components:a,componentsProps:o,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,slots:g,slotProps:_,...v}=zo({props:e,name:`MuiPopper`}),y=g?.root??a?.Root,b={anchorEl:r,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,...v};return(0,F.jsx)(k6,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),j6=L(Yo)({fontSize:50,textAlign:`center`}),M6=({children:e,...t})=>(0,F.jsx)(A6,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,F.jsx)(j6,{children:e})}),N6=({letter:e})=>(0,F.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});N6.propTypes={letter:p.string};function P6({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,N.useRef)(null),i=(0,N.useRef)(n),[a,o]=(0,N.useState)({top:0,left:0}),[s,c]=(0,N.useState)(null);i.current=n;let l=(0,N.useMemo)(()=>{if(!t)return f4;switch(!0){case t.language===`spanish`:return f4;case t.language===`special`:return p4;default:return t}},[t]),u=(0,N.useMemo)(()=>l.characters.reduce((e,t)=>(t.length>=e.columns&&(e.columns=t.length),e),{rows:l.characters.length,columns:0}),[l]),d=()=>c(null);(0,N.useEffect)(()=>()=>{d()},[]),(0,N.useEffect)(()=>{if(!e)return;let t=e.options.element,n=e.view.dom,a=()=>{if(!r.current)return;let n=t.getBoundingClientRect(),{from:i}=e.state.selection,a=e.view.coordsAtPos(i),s=r.current.offsetHeight,c=r.current.offsetWidth,l=window.innerHeight-(n.bottom+60)>=s||n.top<s+80?n.bottom+60:n.top-s-20,u=a.left;l=Math.max(8,Math.min(l,window.innerHeight-s-8)),u=Math.max(8,Math.min(u,window.innerWidth-c-8)),o({top:l,left:u})};a();let s=null,c=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,a()}))};window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c);let l=e=>{r.current&&!r.current.contains(e.target)&&!n.contains(e.target)&&i.current()},u=setTimeout(()=>{document.addEventListener(`click`,l)});return()=>{clearTimeout(u),s!==null&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),document.removeEventListener(`click`,l)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,F.jsxs)(F.Fragment,{children:[Rx.createPortal((0,F.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`fixed`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:1e3},children:(0,F.jsx)(`div`,{children:(0,F.jsx)(D$,{keyPadCharacterRef:t.keyPadCharacterRef,setKeypadInteraction:t.setKeypadInteraction,autoFocus:!0,noDecimal:!0,hideInput:!0,noLatexHandling:!0,hideDoneButtonBackground:!0,layoutForKeyPad:u,additionalKeys:l.characters.reduce((e,t)=>(e=[...e,...t.map(e=>({name:b(e,`name`)||e,write:b(e,`write`)||e,label:b(e,`label`)||e,category:`character`,extraClass:`character`,extraProps:{...e.extraProps||{},style:{...(e.extraProps||{}).style,border:`1px solid #000`}},...l.hasPreview?{actions:{onMouseEnter:t=>f(t,e),onMouseLeave:d}}:{}}))],e),[]),keypadMode:`language`,onChange:t=>{typeof t==`string`&&e.chain().focus().insertContent(t).run()},onDone:n})})}),document.body),s&&Rx.createPortal((0,F.jsxs)(M6,{onClose:d,anchorEl:s.anchorEl,children:[(0,F.jsx)(`div`,{children:s.el.label}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}P6.propTypes={editor:p.object,opts:p.object,onClose:p.func.isRequired};var F6=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z`,fill:`currentColor`})}),I6=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z`,fill:`currentColor`})}),L6=()=>(0,F.jsx)(`svg`,{width:`30`,height:`28`,viewBox:`0 0 30 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`20px`,height:`18px`},"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z`,fill:`currentColor`})});function R6({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,N.useState)(!1),l=r??{},u=Yx({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof W&&(n=t.node);let r=e.editor?.isActive(`math`)||e.editor?.isActive(`explicit_constructed_response`)||e.editor?.isActive(`imageUploadNode`)||e.editor?.isActive(`drag_in_the_blank`),i=t&&t.empty===!1&&e.editor.isActive(`table`);return{currentNode:n,hideDefaultToolbar:r,hasTextSelectionInTable:i,isFocused:e.editor?.isFocused,toolbarOpened:e.editor?._toolbarOpened??!1,isBold:e.editor.isActive(`bold`)??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isTable:e.editor.isActive(`table`)??!1,tableHasBorder:e.editor.getAttributes(`table`)?.border===`1`,canTable:e.editor.can().chain().insertTable().run()??!1,isItalic:e.editor.isActive(`italic`)??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isStrike:e.editor.isActive(`strike`)??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive(`code`)??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isUnderline:e.editor.isActive(`underline`)??!1,isSubScript:e.editor.isActive(`subscript`)??!1,isSuperScript:e.editor.isActive(`superscript`)??!1,isParagraph:e.editor.isActive(`paragraph`)??!1,isHeading1:e.editor.isActive(`heading`,{level:1})??!1,isHeading2:e.editor.isActive(`heading`,{level:2})??!1,isHeading3:e.editor.isActive(`heading`,{level:3})??!1,isHeadingParagraph:e.editor.isActive(`headingParagraph`)??!1,isHeading4:e.editor.isActive(`heading`,{level:4})??!1,isHeading5:e.editor.isActive(`heading`,{level:5})??!1,isHeading6:e.editor.isActive(`heading`,{level:6})??!1,isBulletList:e.editor.isActive(`bulletList`)??!1,isOrderedList:e.editor.isActive(`orderedList`)??!1,isCodeBlock:e.editor.isActive(`codeBlock`)??!1,isBlockquote:e.editor.isActive(`blockquote`)??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}}),d=!!o,f=k(t.toolbar,Oz,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!u.toolbarOpened&&!u.hideDefaultToolbar,[t.autoWidth]:d,[t.fullWidth]:!d,[t.hidden]:l.isHidden===!0}),p=l.minWidth===void 0?{}:{minWidth:l.minWidth},m=e=>{e.preventDefault()},h=(0,N.useMemo)(()=>[{icon:(0,F.jsx)($2,{}),label:`Insert table`,onClick:e=>e.chain().focus().insertTable({rows:2,cols:2,withHeaderRow:!1}).run(),hidden:e=>!n?.includes(`table`)||e.isTable,isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(C4,{}),label:`Add table row`,onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(w4,{}),label:`Remove table row`,onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(T4,{}),label:`Add table column`,onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(E4,{}),label:`Remove table column`,onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(D4,{}),label:`Remove table`,onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(l4,{}),label:`Table borders`,toggle:!0,onClick:e=>{let t=e.getAttributes(`table`),n={...t,border:t.border===`0`?`1`:`0`};e.commands.updateAttributes(`table`,n)},hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.tableHasBorder,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(Y2,{}),label:`Bold`,toggle:!0,onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,F.jsx)(X2,{}),label:`Italic`,toggle:!0,onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,F.jsx)(Z2,{}),label:`Strikethrough`,toggle:!0,onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,F.jsx)(Q2,{}),label:`Code`,toggle:!0,onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,F.jsx)(n4,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,F.jsx)(I6,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,F.jsx)(F6,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,F.jsx)(i4,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,F.jsx)(s4,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,F.jsx)(c4,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,F.jsx)(b4,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,F.jsx)(o4,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,F.jsx)(L6,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,F.jsx)(r4,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,F.jsx)(N6,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(f4)},{icon:(0,F.jsx)(N6,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(p4)},{icon:(0,F.jsx)(v4,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,F.jsx)(e4,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,F.jsx)(t4,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,F.jsx)(GW,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,F.jsx)(a4,{}),label:`Redo`,hidden:()=>!n?.includes(`redo`),onClick:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.canRedo}],[n,e]),g=u.hideDefaultToolbar&&u.currentNode?.type?.name===`drag_in_the_blank`;return(0,F.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,F.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,F.jsx)(`div`,{className:t.buttonsContainer,children:(0,F.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,title:`Delete response area`,children:(0,F.jsx)(Dz,{})})})}),!u.hideDefaultToolbar&&(0,F.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,F.jsx)(`div`,{className:t.buttonsContainer,children:h.filter(e=>!e.hidden?.(u)).map((n,r)=>{let i=n.isDisabled?.(u),a=n.isActive?.(u);return(0,F.jsx)(`button`,{type:`button`,disabled:i,"aria-label":n.label,title:n.label,"aria-pressed":n.toggle?!!a:void 0,onClick:t=>{t.preventDefault(),n.onClick(e)},className:k(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Insert response area`,title:`Insert response area`,onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,F.jsx)(d4,{})}),l.showDone&&(0,F.jsx)(Mz,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,F.jsx)(P6,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var z6=e=>{Mo();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`toolbarButton`,active:`active`,disabled:`disabled`,isActive:`isActive`,toolbar:`toolbar`,toolbarWithNoDone:`toolbarWithNoDone`,toolbarTop:`toolbarTop`,toolbarRight:`toolbarRight`,fullWidth:`fullWidth`,hidden:`hidden`,autoWidth:`autoWidth`,focused:`focused`,iconRoot:`iconRoot`,label:`label`,shared:`shared`};return(0,F.jsx)(B6,{children:(0,F.jsx)(R6,{...e,classes:t})})},B6=L(`div`)(()=>({"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .toolbarButton":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:ZH()},"&:focus":{outline:`2px solid ${RU()}`}},"& .active":{color:ZH()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:QH()}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`absolute`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:0,pointerEvents:`none`},"& .toolbarWithNoDone":{minWidth:`265px`},"& .toolbarTop":{top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`auto`},"& .focused":{opacity:1,pointerEvents:`auto`},"& .iconRoot":{width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`},"& .label":{color:`var(--editable-html-toolbar-check, #00bb00)`},"& .shared":{display:`flex`}})),V6=L(`div`,{shouldForwardProp:e=>![`noBorder`,`error`].includes(e)})(({theme:e,noBorder:t,error:n})=>({position:`relative`,padding:`0px`,border:t?`none`:`1px solid #ccc`,borderRadius:`4px`,cursor:`text`,'& [data-slate-editor="true"]':{wordBreak:`break-word`,overflow:`visible`,maxHeight:`500px`,padding:`5px`},"&:first-child":{marginTop:0},"& ul, & ol":{padding:`0 1rem`,margin:`1.25rem 1rem 1.25rem 0.4rem`},"& ul li p, & ol li p":{marginTop:`0.25em`,marginBottom:`0.25em`},"& h1, & h2, & h3, & h4, & h5, & h6":{lineHeight:1.1,marginTop:`2.5rem`,textWrap:`pretty`},"& h1, & h2":{marginTop:`3.5rem`,marginBottom:`1.5rem`},"& h1":{fontSize:`1.4rem`},"& h2":{fontSize:`1.2rem`},"& h3":{fontSize:`1.1rem`},"& h4, & h5, & h6":{fontSize:`1rem`},"& code":{backgroundColor:`var(--purple-light)`,borderRadius:`0.4rem`,color:`var(--black)`,fontSize:`0.85rem`,padding:`0.25em 0.3em`},"& pre":{background:`var(--black)`,borderRadius:`0.5rem`,color:`var(--white)`,fontFamily:`'JetBrainsMono', monospace`,margin:`1.5rem 0`,padding:`0.75rem 1rem`,"& code":{background:`none`,color:`inherit`,fontSize:`0.8rem`,padding:0}},"& blockquote":{background:`#f9f9f9`,borderLeft:`5px solid #ccc`,margin:`1.5em 10px`,padding:`.5em 10px`},"& p":{margin:`0`},"& table":{tableLayout:`fixed`,width:`100%`,borderCollapse:`collapse`,color:ZH(),backgroundColor:vU()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${kU()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${kU()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),H6=L(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:ZH(),backgroundColor:n?e.palette.action.selected:vU(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),U6=L(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function W6(e){let[t,n]=(0,N.useState)(null),r=(0,N.useRef)(null),{editor:i,disabled:a,children:o,disableScrollbar:s,activePlugins:c,toolbarOpts:l,responseAreaProps:u,autoFocus:d,minWidth:f,width:p,maxWidth:m,minHeight:h,height:g,maxHeight:_,highlightShape:v,ref:y}=e;(0,N.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,N.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,N.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.style.whiteSpace=`nowrap`,t.textContent=`W`.repeat(e.charactersLimit);let i=window.getComputedStyle(r.current);[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`wordSpacing`,`textTransform`,`lineHeight`].forEach(e=>{t.style[e]=i[e]}),document.body.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,N.useMemo)(()=>({width:J2(t||p),minWidth:J2(f),maxWidth:J2(m),height:J2(g),minHeight:J2(h),maxHeight:J2(_)}),[t,f,p,m,h,g,_]);return(0,F.jsxs)(V6,{noBorder:l&&l.noBorder,error:l&&l.error,className:e.className,style:{width:b.width,minWidth:b.minWidth,maxWidth:b.maxWidth},ref:r,children:[(0,F.jsx)(H6,{disableScrollbar:s,highlightShape:v,children:(0,F.jsx)(U6,{noPadding:l&&l.noPadding,children:o})}),i&&(0,F.jsx)(z6,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var G6=D(`@pie-lib:editable-html:plugins`),K6=[`bold`,`html`,`extraCSSRules`,`italic`,`underline`,`strikethrough`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`blockquote`,`h3`,`table`,`video`,`audio`,`responseArea`,`redo`,`undo`,`superscript`,`subscript`],q6={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},J6=K6.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),Y6=(e,t,n)=>{G6(`[buildPlugins] opts: `,n),e||=J6;let r=(t,n=!0)=>e.includes(t)&&n&&t,i=n.image&&n.image.delete,a=n.math,o=n.responseArea&&n.responseArea.type,s=!x(n.extraCSSRules),c=n?.languageCharacters||[];return _([r(`table`),r(`bold`),r(`italic`),r(`strikethrough`),r(`underline`),r(`superscript`),r(`subscript`),r(`image`,!!i),r(`video`),r(`audio`),r(`math`,!!a),...c.map(e=>r(`languageCharacters`,e)),r(`text-align`),r(`blockquote`),r(`h3`),r(`bulleted-list`),r(`numbered-list`),r(`undo`),r(`redo`),r(`responseArea`,!!o),r(`css`,!!s),r(`html`,!!n.html)])},X6={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},Z6={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},Q6=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],$6={"--white":`#fff`,"--black":`#2e2b29`,"--black-contrast":`#110f0e`,"--gray-1":`rgba(61, 37, 20, .05)`,"--gray-2":`rgba(61, 37, 20, .08)`,"--gray-3":`rgba(61, 37, 20, .12)`,"--gray-4":`rgba(53, 38, 28, .3)`,"--gray-5":`rgba(28, 25, 23, .6)`,"--green":`#22c55e`,"--purple":`#6a00f5`,"--purple-contrast":`#5800cc`,"--purple-light":`rgba(88, 5, 255, .05)`,"--yellow-contrast":`#facc15`,"--yellow":`rgba(250, 204, 21, .4)`,"--yellow-light":`#fffae5`,"--red":`#ff5c33`,"--red-light":`#ffebe5`,"--shadow":`0px 12px 33px 0px rgba(0, 0, 0, .06),
394
+ 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},e8=e=>({spellcheck:e?`true`:`false`,autocorrect:e?`on`:`off`,autocapitalize:e?`on`:`off`}),t8=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,N.useState)([]),[a,o]=(0,N.useState)(!1),{toolbarOpts:s}=e,c=(0,N.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...X6,...s},u=(0,N.useCallback)(t=>{let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},[e.markup,e.onChange,e.onDone,l.doneOn]),d=(0,N.useMemo)(()=>({...Z6,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,N.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||Q6)?.filter(e=>{let t=q6[e]||e,r=n[t]||{};return!r||!r.disabled});return Y6(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:d.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e,d.type]),p=[SF.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),YP,XP.configure({limit:e.charactersLimit||1e6}),zP.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]},link:{autolink:!1,linkOnPaste:!1}}),K2,IL,q2,LL,RL,TF.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),ML,gL,FL,PL,xZ.configure(d),SZ.configure(d),wZ.configure(d),TZ.configure(d),CZ.configure(d),N$.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),xF,bF,wF,G1.configure({toolbarOpts:l,imageHandling:{disableImageAlignmentButtons:e.disableImageAlignmentButtons,onDone:t=>e.onDone?.(t.getHTML()),onDelete:e.imageSupport&&e.imageSupport.delete&&(t=>{let{src:n}=t.attrs;e.imageSupport.delete(n,e=>{c(t.pos)})}),insertImageRequested:e.imageSupport&&((t,n,r)=>{let[o,s]=n,l=n=>{let r;a&&n&&(r=e.onChange),c(s),r?.(t.getHTML())};t._insertingImage=!0,i(e=>[...e,o]),(()=>{let n=r(l),i=v(()=>{let e=()=>window.removeEventListener(`focus`,i);if(!t._insertingImage){e();return}c(s),t._insertingImage=!1,e()},500);window.addEventListener(`focus`,i),e.imageSupport.add(n)})()}),maxImageWidth:e.maxImageWidth,maxImageHeight:e.maxImageHeight},limit:3}),J0.configure({uploadSoundSupport:e.uploadSoundSupport}),d2.configure({extraCSSRules:e.extraCSSRules})],m=e.spellCheck!==!1,h=$x({extensions:p,immediatelyRender:!1,editorProps:{attributes:e8(m),handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:OF(e.markup),onUpdate:({editor:t,transaction:n})=>{n.isDone&&e.onChange?.(t.getHTML())},onBlur:({editor:e})=>{e._insertingImage||e._toolbarOpened||e.isActive(`inline_dropdown`)||e.isActive(`explicit_constructed_response`)||!e.schema||u(e)}},[e.charactersLimit]);(0,N.useEffect)(()=>{e.editorRef&&e.editorRef(h)},[e.editorRef,h]),(0,N.useEffect)(()=>{h?.setEditable(!e.disabled)},[e.disabled,h]),(0,N.useEffect)(()=>{if(!h)return;let e=h.options?.editorProps,t=e8(m);e?.attributes?.spellcheck!==t.spellcheck&&h.setOptions({editorProps:{...e,attributes:t}})},[m,h]),(0,N.useEffect)(()=>{if(!h)return;let t=OF(e.markup);t!==h.getHTML()&&h.commands.setContent(t,{emitUpdate:!1})},[e.markup,h]),(0,N.useEffect)(()=>{Object.entries($6).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let g=Yx({editor:h,selector:e=>({isFocused:e.editor?.isFocused})}),_=(0,N.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:J2(n),minWidth:J2(t),maxWidth:J2(r),height:J2(a),minHeight:J2(i),maxHeight:J2(o)}},[e]);return(0,F.jsx)(W6,{...e,activePlugins:f,toolbarOpts:l,editorState:g,editor:h,children:h&&(0,F.jsx)(n8,{style:{minHeight:_.minHeight,height:_.height,maxHeight:_.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:h})})},n8=L(Kx,{shouldForwardProp:e=>![`showParagraph`,`separateParagraph`].includes(e)})(({showParagraph:e,separateParagraph:t})=>({display:`flex`,outline:`none !important`,"& .ProseMirror":{flex:1,padding:`5px`,maxHeight:`500px`,outline:`none !important`,position:`initial`,"& > p, & > div":{margin:`0`},"& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child":{position:`relative`},"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before":{content:`attr(data-placeholder)`,position:`absolute`,left:0,top:0,color:`#9CA3AF`,pointerEvents:`none`,whiteSpace:`pre-wrap`},...e&&{"& > p:has(+ p)::after, & > div:has(+ div)::after":{display:`block`,content:`"¶"`,fontSize:`1em`,color:`#146EB3`}},...t&&{"& > p:has(+ p)":{marginBottom:`1em`}}}})),r8=t8,i8=(e,t,n)=>{let r=n||[],i=r.reduce((e,t)=>e+t.textContent.length,0),a=!0;if(i>t)return!1;for(e&&=(e.nodeType===3&&e.parentNode&&!e.parentNode.hasAttribute(`data-ann-id`)&&r.push(e),e.firstChild);e&&a;)a=i8(e,t,r),e=e.nextSibling;return r},a8=(e,t,n)=>{let r=i8(n,t),i=[],a=0;return r.forEach(n=>{let r=a+n.textContent.length;[e,t].forEach(e=>{a<=e&&e<r&&i.push({node:n,offset:e-a})}),a=r}),i},o8=e=>{let{commonAncestorContainer:t,startContainer:n,endContainer:r,startOffset:i,endOffset:a}=e,o=[],s=!1,c=!1,l=``,u=e=>{let{nodeValue:t,childNodes:d}=e;e===n&&e===r?(t&&(l+=t.substring(i,a)),s=c=!0):e===n?(t&&(l+=t.substring(i)),s=!0):e===r?(t&&(l+=t.substring(0,a)),c=!0):e&&e.nodeType===3&&e.parentNode&&!e.parentNode.hasAttribute(`data-ann-id`)&&t&&s&&!c&&(l+=t,o.push(e)),d.forEach(e=>{if(!c)u(e);else return})};return u(t),[o,l]},s8=e=>{let t=document.createElement(`SPAN`);return e.surroundContents(t),t},c8=e=>{if(e.startContainer===e.endContainer)return[s8(e)];let[t]=o8(e),n=document.createRange();n.selectNodeContents(e.startContainer),n.setStart(e.startContainer,e.startOffset);let r=s8(n),i=document.createRange();i.selectNode(e.endContainer),i.setEnd(e.endContainer,e.endOffset);let a=s8(i);return[r,...t.map(e=>{let t=document.createElement(`SPAN`);return e.parentNode.insertBefore(t,e),t.appendChild(e),t}),a]},l8=(e,t)=>{let n=document.createRange();n.setStart(t,0),n.setEnd(e.startContainer,e.startOffset);let[,r]=o8(n),[,i]=o8(e),a=r.length;return{quote:i,start:a,end:a+i.length}},u8=(e,t)=>{(e||[]).forEach(e=>{let t=e.parentNode,n=e.childNodes,r=n.length;if(r>0)for(let i=0;i<r;i++)t.insertBefore(n[0],e);else t.insertBefore(document.createTextNode(e.textContent),e);t.removeChild(e)}),t.normalize()},d8=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()},f8=e=>e.length>=20||e.search(/\n|\r|\r\n/)!==-1,p8=e=>Array.from(document.querySelectorAll(`[data-id='${e}']`)),m8=e=>document.querySelector(`[data-ann-id='${e}']`),h8=L(WH)(({annotationType:e})=>({"& .MuiPaper-root":{overflowX:`unset`,overflowY:`unset`,marginLeft:`16px`,"&::before":{position:`absolute`,right:`100%`,top:`13px`,border:`solid transparent`,content:`""`,height:0,width:0,pointerEvents:`none`,borderWidth:`7px`,borderRightColor:wU()},...e===`negative`&&{"&::before":{borderRightColor:`rgb(255, 204, 238) !important`}},...e===`positive`&&{"&::before":{borderRightColor:`rgb(153, 255, 153) !important`}}}})),g8=L(`div`)(({annotationType:e})=>({width:`200px`,overflow:`hidden`,borderRadius:`4px`,backgroundColor:MU(),border:`4px solid ${wU()}`,...e===`negative`&&{borderColor:`rgb(255, 204, 238) !important`},...e===`positive`&&{borderColor:`rgb(153, 255, 153) !important`}})),_8=L(`div`)(()=>({display:`flex`,flexWrap:`wrap`,borderTop:`2px solid ${wU()}`})),v8=L(`div`)(({variant:e,annotationType:t})=>({flexGrow:1,width:`28%`,textAlign:`center`,padding:`4px`,cursor:`pointer`,"&:not(:nth-child(3n))":{borderRight:`1px solid ${wU()}`},"&:hover":{backgroundColor:yU()},...e===`positive`&&{backgroundColor:`rgb(153, 255, 153) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`negative`&&{backgroundColor:`rgb(255, 204, 238) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`typeChange`&&t===`negative`&&{"&:hover":{backgroundColor:`rgb(153, 255, 153) !important`}},...e===`typeChange`&&t===`positive`&&{"&:hover":{backgroundColor:`rgb(255, 204, 238) !important`}}})),y8=class extends N.Component{static propTypes={anchorEl:p.object,open:p.bool,offset:p.number,value:p.string,type:p.string,onClose:p.func,onDelete:p.func,onSave:p.func,onTypeChange:p.func};constructor(e){super(e),this.state={value:e.value}}UNSAFE_componentWillReceiveProps(e){let{value:t}=e,{value:n}=this.props;t!==n&&this.setState({value:t})}onValueChange=e=>this.setState({value:e.target.value});handleSave=()=>{let{value:e,onSave:t,onClose:n,onDelete:r}=this.props,{value:i}=this.state;i===``&&r(),e!==i&&t(e,i),this.setState({value:``}),n()};handleTypeChange=()=>{let{onTypeChange:e,onDelete:t}=this.props,{value:n}=this.state;n===``?t():e(n),this.setState({value:``})};render(){let{anchorEl:e,offset:t,onDelete:n,open:r,type:i}=this.props,{value:a}=this.state;return(0,F.jsx)(h8,{anchorEl:e,elevation:2,open:r,onClose:this.handleSave,annotationType:i,style:{marginTop:`${t}px`,transition:`margin-top 2s ease-out`},transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:`top`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`left`},children:(0,F.jsxs)(g8,{annotationType:i,children:[(0,F.jsx)(h1,{id:`annotation-editor`,style:{padding:`2px 5px`,width:`95%`},autoFocus:!0,multiline:!0,rows:1,maxRows:4,value:a,onChange:this.onValueChange,InputProps:{disableUnderline:!0}}),(0,F.jsxs)(_8,{children:[(0,F.jsx)(v8,{onClick:n,children:`Delete`}),(0,F.jsx)(v8,{variant:`typeChange`,annotationType:i,onClick:this.handleTypeChange,children:i===`negative`?`Green`:`Pink`}),(0,F.jsx)(v8,{onClick:this.handleSave,children:`Save`})]})]})})}},b8=L(WH)({"& .MuiPaper-root":{overflowX:`unset`,overflowY:`unset`,marginTop:`-16px`,"&::after":{position:`absolute`,left:`calc(50% - 7px)`,border:`solid transparent`,content:`""`,height:0,width:0,pointerEvents:`none`,borderWidth:`7px`,borderTopColor:wU()}}}),x8=L(`div`)(()=>({width:`300px`,overflow:`hidden`,borderRadius:`4px`,backgroundColor:MU(),border:`2px solid ${wU()}`})),S8=L(`div`)({display:`flex`,flexWrap:`wrap`}),C8=L(`div`)(()=>({display:`flex`,flexWrap:`wrap`,borderTop:`2px solid ${wU()}`})),w8=L(`div`)(({variant:e})=>({width:`22%`,textAlign:`center`,padding:`4px`,cursor:`pointer`,borderBottom:`1px solid ${wU()}`,"&:not(:nth-child(4n))":{borderRight:`1px solid ${wU()}`},"&:nth-child(4n)":{flexGrow:1},"&:hover":{backgroundColor:yU()},...e===`positive`&&{backgroundColor:`rgb(153, 255, 153) !important`,"&:hover":{filter:`brightness(85%)`}},...e===`negative`&&{backgroundColor:`rgb(255, 204, 238) !important`,"&:hover":{filter:`brightness(85%)`}}})),T8=class extends N.Component{static propTypes={anchorEl:p.object,open:p.bool,annotations:p.array,isNewAnnotation:p.bool,onClose:p.func,onDelete:p.func,onEdit:p.func,onWrite:p.func,onAnnotate:p.func};render(){let{anchorEl:e,annotations:t,isNewAnnotation:n,onAnnotate:r,onClose:i,onEdit:a,onDelete:o,onWrite:s,open:c}=this.props;return(0,F.jsx)(b8,{anchorEl:e,open:c,onClose:i,elevation:5,transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:`top`,horizontal:`center`},transformOrigin:{vertical:`bottom`,horizontal:`center`},children:(0,F.jsxs)(x8,{children:[(0,F.jsx)(S8,{children:t.map((e,t)=>(0,F.jsx)(w8,{variant:e.type,onClick:()=>r(e),children:e.label},`annotation-${t}`))}),(0,F.jsxs)(C8,{children:[(0,F.jsx)(w8,{onClick:i,children:`Cancel`}),(0,F.jsx)(w8,{style:{pointerEvents:`none`}}),n?(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(w8,{variant:`positive`,onClick:()=>s(`positive`),children:`Write`}),(0,F.jsx)(w8,{variant:`negative`,onClick:()=>s(`negative`),children:`Write`})]}):(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(w8,{onClick:o,children:`Delete`}),(0,F.jsx)(w8,{onClick:a,children:`Edit`})]})]})]})})}};function E8(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function D8(e,t){return!e||E8(e)?e:E8(e.default)?e.default:t&&E8(e[t])?e[t]:t&&E8(e[t]?.default)?e[t].default:e}var O8=D8(TG,`InputContainer`)||D8(j8.InputContainer,`InputContainer`),k8=sK,A8=k8.default,j8=A8&&typeof A8==`object`?A8:k8,M8=L(`div`)({padding:`10px 120px 10px 16px`,backgroundColor:`rgba(0, 0, 0, 0.06)`,border:`1px solid #ccc`,borderRadius:`4px`,overflowY:`scroll`,lineHeight:`36px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`,"& p":{margin:0},"& span[data-latex]":{userSelect:`none`,"-webkit-user-select":`none`,"-moz-user-select":`none`,"-ms-user-select":`none`}}),N8=L(`div`)({width:`230px`}),P8=L(`div`)({position:`relative`,overflowX:`hidden`,display:`flex`}),F8=L(O8)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),marginTop:e.spacing(2),width:`100%`})),I8=`
395
395
  .sideAnnotation:before {
396
396
  position: absolute;
397
397
  right: var(--before-right, 100%);
@@ -404,4 +404,4 @@ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`
404
404
  border-width: var(--before-border-width, 7px);
405
405
  border-right-color: var(--before-border-color, rgb(153, 255, 153));
406
406
  }
407
- `;if(!document.getElementById(`annotation-editor-styles`)){let e=document.createElement(`style`);e.id=`annotation-editor-styles`,e.textContent=D8,document.head.appendChild(e)}var O8=class extends N.Component{static propTypes={text:p.string,comment:p.string,annotations:p.array,predefinedAnnotations:p.array,onChange:p.func.isRequired,onCommentChange:p.func.isRequired,width:p.number,height:p.number,maxHeight:p.string,disabled:p.bool,disabledMath:p.bool,customKeys:p.array,keypadMode:p.string};constructor(e){super(e),this.state={anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotation:null,annotationIndex:null}}componentDidMount(){let{annotations:e,text:t}=this.props;t&&e.forEach(e=>{let[t,n]=X6(e.start,e.end,this.textRef);if(t&&n){let r=document.createRange();r.setStart(t.node,t.offset),r.setEnd(n.node,n.offset);let i=$6(r);this.createDOMAnnotation(i,e)}}),this.textRef&&(this.adjustAnnotationsPosition(),this.textRef.addEventListener(`scroll`,this.adjustAnnotationsPosition))}adjustAnnotationsPosition=()=>{if(this.textRef&&this.labelsRef){let e=this.textRef.offsetLeft+this.textRef.offsetWidth+8;Array.from(this.labelsRef.children).forEach(t=>{let n=i8(t.dataset.annId),r=(n[0].offsetTop?n[0].offsetTop:n[0].offsetParent.offsetTop)-this.textRef.scrollTop-6;t.style.top=`${r}px`,t.style.left=`${e}px`})}};handleClick=e=>{let{annotations:t}=this.props,{selectionDetails:n}=this.state;if(n)return;let{id:r,annId:i}=e.target.dataset,a=r||i,o=i8(a),s=a8(a),c=t.findIndex(e=>e.id===a),l=s.hasAttribute(`data-freeform`);l&&(s.style.zIndex=`10`),this.setState({anchorEl:o[0],openedMenu:!!r||!!i&&!l,openedEditor:!!i&&l,selectedElems:o,labelElem:s,annotationIndex:c,annotation:t[c],selectionDetails:null})};handleHover=e=>{let{id:t,annId:n}=e.target.dataset,r=t||n,i=i8(r),a=a8(r),o=a.hasAttribute(`data-freeform`);i.forEach(e=>{e.style.zIndex=`20`,e.classList.contains(`positive`)?e.style.backgroundColor=`rgb(51, 255, 51, 0.7)`:e.classList.contains(`negative`)&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.55)`)}),o?(a.style.zIndex=`20`,a.classList.contains(`positive`)?(a.style.backgroundColor=`rgb(128, 255, 128)`,a.style.setProperty(`--before-border-color`,`rgb(153, 255, 153)`)):a.classList.contains(`negative`)&&(a.style.backgroundColor=`rgb(255, 179, 230)`,a.style.setProperty(`--before-border-color`,`rgb(255, 179, 230)`))):(a.style.zIndex=`20`,a.classList.contains(`positive`)?a.style.color=`rgb(0, 77, 0)`:a.classList.contains(`negative`)&&(a.style.color=`rgb(153, 0, 102)`))};handleCancelHover=e=>{let{id:t,annId:n}=e.target.dataset,r=t||n,i=i8(r),a=a8(r),o=a.hasAttribute(`data-freeform`);i.forEach(e=>{e.style.zIndex=``,e.classList.contains(`positive`)?e.style.backgroundColor=`rgb(51, 255, 51, 0.5)`:e.classList.contains(`negative`)&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.4)`)}),o?(a.style.zIndex=``,a.classList.contains(`positive`)?(a.style.backgroundColor=`rgb(153, 255, 153)`,a.style.removeProperty(`--before-border-color`)):a.classList.contains(`negative`)&&(a.style.backgroundColor=`rgb(255, 204, 238)`,a.style.removeProperty(`--before-border-color`))):(a.style.zIndex=``,a.classList.contains(`positive`)?a.style.color=`rgb(0, 128, 0)`:a.classList.contains(`negative`)&&(a.style.color=`rgb(204, 0, 136)`))};handleClose=e=>{let{selectedElems:t,labelElem:n}=this.state;t.length&&!t[0].hasAttribute(`data-id`)&&t8(t,this.textRef),n&&(n.style.zIndex=``),this.setState({anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotationIndex:null,annotation:null}),n8()};handleSelection=e=>{let t=window.getSelection();if(e.detail>2){n8();return}if(t&&t.rangeCount>0){let e=t.getRangeAt(0),n=e.toString(),r=this.textRef.contains(e.commonAncestorContainer);if(!t.isCollapsed&&n!==``&&r){let t=e8(e,this.textRef),n=$6(e);this.setState({anchorEl:n[0],openedMenu:!0,selectedElems:n,selectionDetails:t})}}};deleteAnnotation=()=>{let{annotations:e,onChange:t}=this.props,{selectedElems:n,labelElem:r,annotationIndex:i,annotation:a}=this.state;(r8(a.label)?this.labelsRef:n[0]).removeChild(r),t8(n,this.textRef),e.splice(i,1),t(e),this.handleClose()};createDOMAnnotation=(e,t)=>{let{disabled:n}=this.props,{id:r,label:i,type:a}=t;(e||[]).forEach(e=>{e.dataset.id=r,e.className=`annotation ${a}`,e.style.position=`relative`,e.style.cursor=`pointer`,a===`positive`?e.style.backgroundColor=`rgb(51, 255, 51, 0.5)`:a===`negative`&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.4)`),e.onclick=!n&&this.handleClick,e.onmouseover=this.handleHover,e.onmouseout=this.handleCancelHover});let o=e&&e[0]||{},s=document.createElement(`SPAN`);if(s.dataset.annId=r,s.innerHTML=i,s.onclick=!n&&this.handleClick,s.onmouseover=this.handleHover,s.onmouseout=this.handleCancelHover,r8(i)){let e=(o.offsetTop?o.offsetTop:o.offsetParent.offsetTop)-this.textRef.scrollTop,t=this.textRef.offsetLeft+this.textRef.offsetWidth+8;s.dataset.freeform=!0,s.className=`sideAnnotation ${a}`,s.style.position=`absolute`,s.style.padding=`4px`,s.style.borderRadius=`4px`,s.style.marginLeft=`8px`,s.style.width=`180px`,s.style.whiteSpace=`pre-wrap`,s.style.wordBreak=`break-word`,s.style.border=`2px solid #ffffff`,s.style.fontSize=`14px`,s.style.fontStyle=`normal`,s.style.fontWeight=`normal`,s.style.top=`${e}px`,s.style.left=`${t}px`,a===`negative`?s.style.backgroundColor=`rgb(255, 204, 238)`:a===`positive`&&(s.style.backgroundColor=`rgb(153, 255, 153)`),s.style.setProperty(`--before-border-width`,`7px`),s.style.setProperty(`--before-top`,`5px`),s.style.setProperty(`--before-right`,`100%`),a===`negative`?s.style.setProperty(`--before-border-color`,`rgb(255, 204, 238)`):a===`positive`&&s.style.setProperty(`--before-border-color`,`rgb(153, 255, 153)`),this.labelsRef.appendChild(s)}else s.className=`annotationLabel ${a}`,s.style.backgroundColor=`rgb(242, 242, 242)`,s.style.padding=`2px`,s.style.position=`absolute`,s.style.userSelect=`none`,s.style.whiteSpace=`nowrap`,s.style.top=`-10px`,s.style.left=`-2px`,s.style.fontSize=`12px`,s.style.fontStyle=`normal`,s.style.fontWeight=`normal`,s.style.lineHeight=`6px`,s.style.webkitUserSelect=`none`,s.style.mozUserSelect=`none`,s.style.msUserSelect=`none`,a===`positive`?s.style.color=`rgb(0, 128, 0)`:a===`negative`&&(s.style.color=`rgb(204, 0, 136)`),o.appendChild(s)};createNewAnnotation=(e,t)=>{let{selectedElems:n,selectionDetails:r}=this.state,i={id:[r.start,r.end,new Date().getTime()].join(`-`),label:e,type:t,...r};return this.createDOMAnnotation(n,i),i};handleMenuClick=e=>{let{annotations:t,onChange:n}=this.props,{annotation:r,annotationIndex:i}=this.state,{type:a,text:o}=e;if(r){let e={...r,label:o,type:a},{type:n,label:s}=r;this.updateLabel(s,e,a!==n&&n),t.splice(i,1,e)}else{let e=this.createNewAnnotation(o,a);t.push(e)}n(t),this.handleClose()};editAnnotation=()=>{this.setState({openedMenu:!1,openedEditor:!0})};addAnnotation=e=>{let{annotations:t,onChange:n}=this.props,r=this.createNewAnnotation(``,e),i=a8(r.id);t.push(r),this.setState({openedMenu:!1,openedEditor:!0,annotationIndex:t.length-1,annotation:r,labelElem:i}),n(t)};updateLabel=(e,t,n)=>{let{selectedElems:r,labelElem:i}=this.state,{label:a,type:o}=t;r8(a)&&r8(e)||!r8(a)&&!r8(e)?(i.innerHTML=a,n&&(i.classList.remove(n),i.classList.add(o),r.forEach(e=>{e.classList.remove(n),e.classList.add(o)}))):r8(a)&&!r8(e)?(r[0].removeChild(i),this.createDOMAnnotation(r,t)):!r8(a)&&r8(e)&&(this.labelsRef.removeChild(i),this.createDOMAnnotation(r,t))};changeAnnotationType=e=>{let{annotations:t,onChange:n}=this.props,{annotationIndex:r,selectedElems:i}=this.state,{type:a,label:o}=t[r],s=a===`positive`?`negative`:`positive`,c={...t[r],type:s,label:e};i.forEach(e=>{e.classList.remove(a),e.classList.add(s)}),this.updateLabel(o,c,a),t.splice(r,1,c),n(t),this.handleClose()};updateAnnotation=(e,t)=>{let{annotations:n,onChange:r}=this.props,{annotationIndex:i}=this.state,a={...n[i],label:t};this.updateLabel(e,a),n.splice(i,1,a),r(n)};componentWillUnmount(){this.textRef.removeEventListener(`scroll`,this.adjustAnnotationsPosition)}render(){let{comment:e,customKeys:t,disabled:n,disabledMath:r,keypadMode:i,height:a,width:o,maxHeight:s,onCommentChange:c,predefinedAnnotations:l,text:u}=this.props,{anchorEl:d,annotation:f,openedMenu:p,openedEditor:m,selectionDetails:h}=this.state,g=d&&(d.offsetTop?d.offsetTop:d.offsetParent.offsetTop),_=this.textRef&&g?g-this.textRef.scrollTop-8:0;return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(T8,{children:[(0,F.jsx)(C8,{style:{width:o-34,minHeight:a,maxHeight:s},ref:e=>this.textRef=e,onMouseDown:n?()=>{}:n8,onMouseUp:n?()=>{}:this.handleSelection,dangerouslySetInnerHTML:{__html:u}}),(0,F.jsx)(w8,{ref:e=>this.labelsRef=e})]}),(0,F.jsx)(E8,{label:`Comment`,children:(0,F.jsx)(J6,{className:`prompt`,markup:e||``,onChange:c,width:o&&(o+104).toString(),disabled:n,pluginProps:{math:{disabled:r,customKeys:t,keypadMode:i,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0}}})}),(0,F.jsx)(g8,{anchorEl:d,open:p&&!n,annotations:l,isNewAnnotation:!!h,onClose:this.handleClose,onDelete:this.deleteAnnotation,onEdit:this.editAnnotation,onWrite:this.addAnnotation,onAnnotate:this.handleMenuClick}),(0,F.jsx)(u8,{anchorEl:this.textRef,open:m&&!n,offset:_,value:f&&f.label||``,type:f&&f.type,onClose:this.handleClose,onDelete:this.deleteAnnotation,onSave:this.updateAnnotation,onTypeChange:this.changeAnnotationType})]})}};function k8(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function A8(e,t){return!e||k8(e)?e:k8(e.default)?e.default:t&&k8(e[t])?e[t]:t&&k8(e[t]?.default)?e[t].default:e}var j8=A8(GW,`UiLayout`)||A8(L8.UiLayout,`UiLayout`),M8=A8(SG,`PreviewPrompt`)||A8(L8.PreviewPrompt,`PreviewPrompt`),N8=A8(CW,`Collapsible`)||A8(L8.Collapsible,`Collapsible`),P8=A8(qU,`Feedback`)||A8(L8.Feedback,`Feedback`),F8=$G,I8=F8.default,L8=I8&&typeof I8==`object`?I8:F8,R8=D(`@pie-ui:extended-text-entry`),z8=L(j8)({backgroundColor:uU(),color:UH()}),B8=L(Yo)(({theme:e})=>({width:`100%`,color:UH(),marginBottom:e.spacing(2),fontSize:`inherit`,display:`block`})),V8=L(`div`)(({theme:e})=>({marginBottom:e.spacing(2)})),H8=L(J6)(({theme:e})=>({marginBottom:e.spacing(2),borderRadius:`4px`})),U8=L(`h2`)({position:`absolute`,left:`-10000px`,top:`auto`,width:`1px`,height:`1px`,overflow:`hidden`}),W8=class extends N.Component{static propTypes={onValueChange:p.func.isRequired,onAnnotationsChange:p.func.isRequired,onCommentChange:p.func.isRequired,model:p.object,session:p.shape({value:p.string,annotations:p.array,comment:p.string}).isRequired};changeSessionValue=v(this.props.onValueChange,1500);changeSessionComment=v(this.props.onCommentChange,1500);render(){let{model:e,session:t,onAnnotationsChange:n}=this.props,{animationsDisabled:r,annotatorMode:i,customKeys:a,dimensions:o,disabled:s,disabledAnnotator:c,equationEditor:l,extraCSSRules:u,feedback:d,mathInput:f,playersToolbarPosition:p,predefinedAnnotations:m,prompt:h,spanishInput:g,specialInput:_,spellCheckEnabled:v,teacherInstructions:y}=e,{annotations:b,comment:x,value:S}=t,{width:C,height:w}=o||{},T=`40vh`,E={position:p===`top`?`top`:`bottom`};R8(`[render] disabled? `,s);let D=(0,F.jsx)(M8,{defaultClassName:`teacher-instructions`,prompt:y}),O=[];return g&&O.push({language:`spanish`}),_&&O.push({language:`special`}),(0,F.jsxs)(z8,{extraCSSRules:u,ref:e=>{this.containerRef=e},children:[(0,F.jsx)(U8,{children:`Constructed Response Question`}),y&&(0,F.jsx)(V8,{children:r?D:(0,F.jsx)(N8,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:D})}),h&&(0,F.jsx)(B8,{component:`span`,children:(0,F.jsx)(M8,{defaultClassName:`prompt`,prompt:e.prompt})}),i?(0,F.jsx)(O8,{text:S||``,annotations:b||[],comment:x||``,predefinedAnnotations:m||[],onChange:n,onCommentChange:this.changeSessionComment,width:C,height:w,maxHeight:T,disabled:c,disabledMath:!f,customKeys:a,keypadMode:l}):(0,F.jsx)(H8,{className:`response-area-editor`,onChange:this.changeSessionValue,markup:S||``,maxWidth:C&&C.toString(),minWidth:`100px`,minHeight:w&&w.toString(),maxHeight:T,disabled:s,highlightShape:!0,toolbarOpts:E,spellCheck:v,charactersLimit:5e4,autoWidthToolbar:!0,pluginProps:{math:{disabled:!f,customKeys:this.props.model.customKeys,keypadMode:this.props.model.equationEditor,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},table:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0},separateParagraphs:{disabled:!1},ul_list:{disabled:!0},ol_list:{disabled:!0}},languageCharactersProps:O}),d&&(0,F.jsx)(P8,{correctness:`correct`,feedback:d})]})}},G8=o((e=>{var t=ss();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),K8=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},q8=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},J8=G8(),Y8=D(`@pie-elements:extended-text-entry`),X8=new DOMParser;function Z8(e){if(typeof e==`string`)try{return X8.parseFromString(e,`text/html`).body.textContent}catch{return Y8(`tried to parse as dom and failed`,e),e}}function Q8(e){let t=Z8(e);return t!==void 0&&t.length>0}var $8=class extends HTMLElement{constructor(){super(),this._model=null,this._session=null,this._root=null}setLangAttribute(){let e=this._model&&typeof this._model.language?this._model.language:``,t=e?e.slice(0,2):`en`;this.setAttribute(`lang`,t)}set model(e){this._model=e,this.dispatchEvent(new K8(this.tagName.toLowerCase(),!1,!!this._model)),this.render()}set session(e){this._session=e,this.render()}get session(){return this._session}valueChange(e){this._session.value=e,this.dispatchEvent(new q8(this.tagName.toLowerCase(),Q8(e))),this.render()}annotationsChange(e){this._session.annotations=e,this.dispatchEvent(new q8(this.tagName.toLowerCase(),!0)),this.render()}commentChange(e){this._session.comment=e,this.dispatchEvent(new q8(this.tagName.toLowerCase(),Q8(e))),this.render()}connectedCallback(){this.setAttribute(`aria-label`,`Written Response Question`),this.setAttribute(`role`,`region`),this.render()}render(){if(this._model&&this._session){let e=N.createElement(W8,{model:this._model,session:this._session,onValueChange:this.valueChange.bind(this),onAnnotationsChange:this.annotationsChange.bind(this),onCommentChange:this.commentChange.bind(this)});this.setLangAttribute(),this._root||=(0,J8.createRoot)(this),this._root.render(e),queueMicrotask(()=>{yW(this)})}}disconnectedCallback(){this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`extended-text-entry-element`)&&customElements.define(`extended-text-entry-element`,$8),$8})();
407
+ `;if(!document.getElementById(`annotation-editor-styles`)){let e=document.createElement(`style`);e.id=`annotation-editor-styles`,e.textContent=I8,document.head.appendChild(e)}var L8=class extends N.Component{static propTypes={text:p.string,comment:p.string,annotations:p.array,predefinedAnnotations:p.array,onChange:p.func.isRequired,onCommentChange:p.func.isRequired,width:p.number,height:p.number,maxHeight:p.string,disabled:p.bool,disabledMath:p.bool,customKeys:p.array,keypadMode:p.string};constructor(e){super(e),this.state={anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotation:null,annotationIndex:null}}componentDidMount(){let{annotations:e,text:t}=this.props;t&&e.forEach(e=>{let[t,n]=a8(e.start,e.end,this.textRef);if(t&&n){let r=document.createRange();r.setStart(t.node,t.offset),r.setEnd(n.node,n.offset);let i=c8(r);this.createDOMAnnotation(i,e)}}),this.textRef&&(this.adjustAnnotationsPosition(),this.textRef.addEventListener(`scroll`,this.adjustAnnotationsPosition))}adjustAnnotationsPosition=()=>{if(this.textRef&&this.labelsRef){let e=this.textRef.offsetLeft+this.textRef.offsetWidth+8;Array.from(this.labelsRef.children).forEach(t=>{let n=p8(t.dataset.annId),r=(n[0].offsetTop?n[0].offsetTop:n[0].offsetParent.offsetTop)-this.textRef.scrollTop-6;t.style.top=`${r}px`,t.style.left=`${e}px`})}};handleClick=e=>{let{annotations:t}=this.props,{selectionDetails:n}=this.state;if(n)return;let{id:r,annId:i}=e.target.dataset,a=r||i,o=p8(a),s=m8(a),c=t.findIndex(e=>e.id===a),l=s.hasAttribute(`data-freeform`);l&&(s.style.zIndex=`10`),this.setState({anchorEl:o[0],openedMenu:!!r||!!i&&!l,openedEditor:!!i&&l,selectedElems:o,labelElem:s,annotationIndex:c,annotation:t[c],selectionDetails:null})};handleHover=e=>{let{id:t,annId:n}=e.target.dataset,r=t||n,i=p8(r),a=m8(r),o=a.hasAttribute(`data-freeform`);i.forEach(e=>{e.style.zIndex=`20`,e.classList.contains(`positive`)?e.style.backgroundColor=`rgb(51, 255, 51, 0.7)`:e.classList.contains(`negative`)&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.55)`)}),o?(a.style.zIndex=`20`,a.classList.contains(`positive`)?(a.style.backgroundColor=`rgb(128, 255, 128)`,a.style.setProperty(`--before-border-color`,`rgb(153, 255, 153)`)):a.classList.contains(`negative`)&&(a.style.backgroundColor=`rgb(255, 179, 230)`,a.style.setProperty(`--before-border-color`,`rgb(255, 179, 230)`))):(a.style.zIndex=`20`,a.classList.contains(`positive`)?a.style.color=`rgb(0, 77, 0)`:a.classList.contains(`negative`)&&(a.style.color=`rgb(153, 0, 102)`))};handleCancelHover=e=>{let{id:t,annId:n}=e.target.dataset,r=t||n,i=p8(r),a=m8(r),o=a.hasAttribute(`data-freeform`);i.forEach(e=>{e.style.zIndex=``,e.classList.contains(`positive`)?e.style.backgroundColor=`rgb(51, 255, 51, 0.5)`:e.classList.contains(`negative`)&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.4)`)}),o?(a.style.zIndex=``,a.classList.contains(`positive`)?(a.style.backgroundColor=`rgb(153, 255, 153)`,a.style.removeProperty(`--before-border-color`)):a.classList.contains(`negative`)&&(a.style.backgroundColor=`rgb(255, 204, 238)`,a.style.removeProperty(`--before-border-color`))):(a.style.zIndex=``,a.classList.contains(`positive`)?a.style.color=`rgb(0, 128, 0)`:a.classList.contains(`negative`)&&(a.style.color=`rgb(204, 0, 136)`))};handleClose=e=>{let{selectedElems:t,labelElem:n}=this.state;t.length&&!t[0].hasAttribute(`data-id`)&&u8(t,this.textRef),n&&(n.style.zIndex=``),this.setState({anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotationIndex:null,annotation:null}),d8()};handleSelection=e=>{let t=window.getSelection();if(e.detail>2){d8();return}if(t&&t.rangeCount>0){let e=t.getRangeAt(0),n=e.toString(),r=this.textRef.contains(e.commonAncestorContainer);if(!t.isCollapsed&&n!==``&&r){let t=l8(e,this.textRef),n=c8(e);this.setState({anchorEl:n[0],openedMenu:!0,selectedElems:n,selectionDetails:t})}}};deleteAnnotation=()=>{let{annotations:e,onChange:t}=this.props,{selectedElems:n,labelElem:r,annotationIndex:i,annotation:a}=this.state;(f8(a.label)?this.labelsRef:n[0]).removeChild(r),u8(n,this.textRef),e.splice(i,1),t(e),this.handleClose()};createDOMAnnotation=(e,t)=>{let{disabled:n}=this.props,{id:r,label:i,type:a}=t;(e||[]).forEach(e=>{e.dataset.id=r,e.className=`annotation ${a}`,e.style.position=`relative`,e.style.cursor=`pointer`,a===`positive`?e.style.backgroundColor=`rgb(51, 255, 51, 0.5)`:a===`negative`&&(e.style.backgroundColor=`rgba(255, 102, 204, 0.4)`),e.onclick=!n&&this.handleClick,e.onmouseover=this.handleHover,e.onmouseout=this.handleCancelHover});let o=e&&e[0]||{},s=document.createElement(`SPAN`);if(s.dataset.annId=r,s.innerHTML=i,s.onclick=!n&&this.handleClick,s.onmouseover=this.handleHover,s.onmouseout=this.handleCancelHover,f8(i)){let e=(o.offsetTop?o.offsetTop:o.offsetParent.offsetTop)-this.textRef.scrollTop,t=this.textRef.offsetLeft+this.textRef.offsetWidth+8;s.dataset.freeform=!0,s.className=`sideAnnotation ${a}`,s.style.position=`absolute`,s.style.padding=`4px`,s.style.borderRadius=`4px`,s.style.marginLeft=`8px`,s.style.width=`180px`,s.style.whiteSpace=`pre-wrap`,s.style.wordBreak=`break-word`,s.style.border=`2px solid #ffffff`,s.style.fontSize=`14px`,s.style.fontStyle=`normal`,s.style.fontWeight=`normal`,s.style.top=`${e}px`,s.style.left=`${t}px`,a===`negative`?s.style.backgroundColor=`rgb(255, 204, 238)`:a===`positive`&&(s.style.backgroundColor=`rgb(153, 255, 153)`),s.style.setProperty(`--before-border-width`,`7px`),s.style.setProperty(`--before-top`,`5px`),s.style.setProperty(`--before-right`,`100%`),a===`negative`?s.style.setProperty(`--before-border-color`,`rgb(255, 204, 238)`):a===`positive`&&s.style.setProperty(`--before-border-color`,`rgb(153, 255, 153)`),this.labelsRef.appendChild(s)}else s.className=`annotationLabel ${a}`,s.style.backgroundColor=`rgb(242, 242, 242)`,s.style.padding=`2px`,s.style.position=`absolute`,s.style.userSelect=`none`,s.style.whiteSpace=`nowrap`,s.style.top=`-10px`,s.style.left=`-2px`,s.style.fontSize=`12px`,s.style.fontStyle=`normal`,s.style.fontWeight=`normal`,s.style.lineHeight=`6px`,s.style.webkitUserSelect=`none`,s.style.mozUserSelect=`none`,s.style.msUserSelect=`none`,a===`positive`?s.style.color=`rgb(0, 128, 0)`:a===`negative`&&(s.style.color=`rgb(204, 0, 136)`),o.appendChild(s)};createNewAnnotation=(e,t)=>{let{selectedElems:n,selectionDetails:r}=this.state,i={id:[r.start,r.end,new Date().getTime()].join(`-`),label:e,type:t,...r};return this.createDOMAnnotation(n,i),i};handleMenuClick=e=>{let{annotations:t,onChange:n}=this.props,{annotation:r,annotationIndex:i}=this.state,{type:a,text:o}=e;if(r){let e={...r,label:o,type:a},{type:n,label:s}=r;this.updateLabel(s,e,a!==n&&n),t.splice(i,1,e)}else{let e=this.createNewAnnotation(o,a);t.push(e)}n(t),this.handleClose()};editAnnotation=()=>{this.setState({openedMenu:!1,openedEditor:!0})};addAnnotation=e=>{let{annotations:t,onChange:n}=this.props,r=this.createNewAnnotation(``,e),i=m8(r.id);t.push(r),this.setState({openedMenu:!1,openedEditor:!0,annotationIndex:t.length-1,annotation:r,labelElem:i}),n(t)};updateLabel=(e,t,n)=>{let{selectedElems:r,labelElem:i}=this.state,{label:a,type:o}=t;f8(a)&&f8(e)||!f8(a)&&!f8(e)?(i.innerHTML=a,n&&(i.classList.remove(n),i.classList.add(o),r.forEach(e=>{e.classList.remove(n),e.classList.add(o)}))):f8(a)&&!f8(e)?(r[0].removeChild(i),this.createDOMAnnotation(r,t)):!f8(a)&&f8(e)&&(this.labelsRef.removeChild(i),this.createDOMAnnotation(r,t))};changeAnnotationType=e=>{let{annotations:t,onChange:n}=this.props,{annotationIndex:r,selectedElems:i}=this.state,{type:a,label:o}=t[r],s=a===`positive`?`negative`:`positive`,c={...t[r],type:s,label:e};i.forEach(e=>{e.classList.remove(a),e.classList.add(s)}),this.updateLabel(o,c,a),t.splice(r,1,c),n(t),this.handleClose()};updateAnnotation=(e,t)=>{let{annotations:n,onChange:r}=this.props,{annotationIndex:i}=this.state,a={...n[i],label:t};this.updateLabel(e,a),n.splice(i,1,a),r(n)};componentWillUnmount(){this.textRef.removeEventListener(`scroll`,this.adjustAnnotationsPosition)}render(){let{comment:e,customKeys:t,disabled:n,disabledMath:r,keypadMode:i,height:a,width:o,maxHeight:s,onCommentChange:c,predefinedAnnotations:l,text:u}=this.props,{anchorEl:d,annotation:f,openedMenu:p,openedEditor:m,selectionDetails:h}=this.state,g=d&&(d.offsetTop?d.offsetTop:d.offsetParent.offsetTop),_=this.textRef&&g?g-this.textRef.scrollTop-8:0;return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(P8,{children:[(0,F.jsx)(M8,{style:{width:o-34,minHeight:a,maxHeight:s},ref:e=>this.textRef=e,onMouseDown:n?()=>{}:d8,onMouseUp:n?()=>{}:this.handleSelection,dangerouslySetInnerHTML:{__html:u}}),(0,F.jsx)(N8,{ref:e=>this.labelsRef=e})]}),(0,F.jsx)(F8,{label:`Comment`,children:(0,F.jsx)(r8,{className:`prompt`,markup:e||``,onChange:c,width:o&&(o+104).toString(),disabled:n,pluginProps:{math:{disabled:r,customKeys:t,keypadMode:i,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0}}})}),(0,F.jsx)(T8,{anchorEl:d,open:p&&!n,annotations:l,isNewAnnotation:!!h,onClose:this.handleClose,onDelete:this.deleteAnnotation,onEdit:this.editAnnotation,onWrite:this.addAnnotation,onAnnotate:this.handleMenuClick}),(0,F.jsx)(y8,{anchorEl:this.textRef,open:m&&!n,offset:_,value:f&&f.label||``,type:f&&f.type,onClose:this.handleClose,onDelete:this.deleteAnnotation,onSave:this.updateAnnotation,onTypeChange:this.changeAnnotationType})]})}};function R8(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function z8(e,t){return!e||R8(e)?e:R8(e.default)?e.default:t&&R8(e[t])?e[t]:t&&R8(e[t]?.default)?e[t].default:e}var B8=z8($W,`UiLayout`)||z8(K8.UiLayout,`UiLayout`),V8=z8(AG,`PreviewPrompt`)||z8(K8.PreviewPrompt,`PreviewPrompt`),H8=z8(jW,`Collapsible`)||z8(K8.Collapsible,`Collapsible`),U8=z8(tW,`Feedback`)||z8(K8.Feedback,`Feedback`),W8=sK,G8=W8.default,K8=G8&&typeof G8==`object`?G8:W8,q8=D(`@pie-ui:extended-text-entry`),J8=L(B8)({backgroundColor:vU(),color:ZH()}),Y8=L(Yo)(({theme:e})=>({width:`100%`,color:ZH(),marginBottom:e.spacing(2),fontSize:`inherit`,display:`block`})),X8=L(`div`)(({theme:e})=>({marginBottom:e.spacing(2)})),Z8=L(r8)(({theme:e})=>({marginBottom:e.spacing(2),borderRadius:`4px`})),Q8=L(`h2`)({position:`absolute`,left:`-10000px`,top:`auto`,width:`1px`,height:`1px`,overflow:`hidden`}),$8=class extends N.Component{static propTypes={onValueChange:p.func.isRequired,onAnnotationsChange:p.func.isRequired,onCommentChange:p.func.isRequired,model:p.object,session:p.shape({value:p.string,annotations:p.array,comment:p.string}).isRequired};changeSessionValue=v(this.props.onValueChange,1500);changeSessionComment=v(this.props.onCommentChange,1500);render(){let{model:e,session:t,onAnnotationsChange:n}=this.props,{animationsDisabled:r,annotatorMode:i,customKeys:a,dimensions:o,disabled:s,disabledAnnotator:c,equationEditor:l,extraCSSRules:u,feedback:d,mathInput:f,playersToolbarPosition:p,predefinedAnnotations:m,prompt:h,spanishInput:g,specialInput:_,spellCheckEnabled:v,teacherInstructions:y}=e,{annotations:b,comment:x,value:S}=t,{width:C,height:w}=o||{},T=`40vh`,E={position:p===`top`?`top`:`bottom`};q8(`[render] disabled? `,s);let D=(0,F.jsx)(V8,{defaultClassName:`teacher-instructions`,prompt:y}),O=[];return g&&O.push({language:`spanish`}),_&&O.push({language:`special`}),(0,F.jsxs)(J8,{extraCSSRules:u,ref:e=>{this.containerRef=e},children:[(0,F.jsx)(Q8,{children:`Constructed Response Question`}),y&&(0,F.jsx)(X8,{children:r?D:(0,F.jsx)(H8,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:D})}),h&&(0,F.jsx)(Y8,{component:`span`,children:(0,F.jsx)(V8,{defaultClassName:`prompt`,prompt:e.prompt})}),i?(0,F.jsx)(L8,{text:S||``,annotations:b||[],comment:x||``,predefinedAnnotations:m||[],onChange:n,onCommentChange:this.changeSessionComment,width:C,height:w,maxHeight:T,disabled:c,disabledMath:!f,customKeys:a,keypadMode:l}):(0,F.jsx)(Z8,{className:`response-area-editor`,onChange:this.changeSessionValue,markup:S||``,maxWidth:C&&C.toString(),minWidth:`100px`,minHeight:w&&w.toString(),maxHeight:T,disabled:s,highlightShape:!0,toolbarOpts:E,spellCheck:v,charactersLimit:5e4,autoWidthToolbar:!0,pluginProps:{math:{disabled:!f,customKeys:this.props.model.customKeys,keypadMode:this.props.model.equationEditor,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},table:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0},separateParagraphs:{disabled:!1},ul_list:{disabled:!0},ol_list:{disabled:!0}},languageCharactersProps:O}),d&&(0,F.jsx)(U8,{correctness:`correct`,feedback:d})]})}},e5=o((e=>{var t=ss();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),t5=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},n5=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},r5=e5(),i5=D(`@pie-elements:extended-text-entry`),a5=new DOMParser;function o5(e){if(typeof e==`string`)try{return a5.parseFromString(e,`text/html`).body.textContent}catch{return i5(`tried to parse as dom and failed`,e),e}}function s5(e){let t=o5(e);return t!==void 0&&t.length>0}var c5=class extends HTMLElement{constructor(){super(),this._model=null,this._session=null,this._root=null}setLangAttribute(){let e=this._model&&typeof this._model.language?this._model.language:``,t=e?e.slice(0,2):`en`;this.setAttribute(`lang`,t)}set model(e){this._model=e,this.dispatchEvent(new t5(this.tagName.toLowerCase(),!1,!!this._model)),this.render()}set session(e){this._session=e,this.render()}get session(){return this._session}valueChange(e){this._session.value=e,this.dispatchEvent(new n5(this.tagName.toLowerCase(),s5(e))),this.render()}annotationsChange(e){this._session.annotations=e,this.dispatchEvent(new n5(this.tagName.toLowerCase(),!0)),this.render()}commentChange(e){this._session.comment=e,this.dispatchEvent(new n5(this.tagName.toLowerCase(),s5(e))),this.render()}connectedCallback(){this.setAttribute(`aria-label`,`Written Response Question`),this.setAttribute(`role`,`region`),this.render()}render(){if(this._model&&this._session){let e=N.createElement($8,{model:this._model,session:this._session,onValueChange:this.valueChange.bind(this),onAnnotationsChange:this.annotationsChange.bind(this),onCommentChange:this.commentChange.bind(this)});this.setLangAttribute(),this._root||=(0,r5.createRoot)(this),this._root.render(e),queueMicrotask(()=>{DW(this)})}}disconnectedCallback(){this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`extended-text-entry-element`)&&customElements.define(`extended-text-entry-element`,c5),c5})();