// source --> https://www.leclubbbq.nl/wp-includes/js/dist/core-data.min.js?ver=15baadfe6e1374188072 
/*! This file is auto-generated */
(()=>{var e={287:(e,t,r)=>{"use strict";r.d(t,{fL:()=>o,l3:()=>i});var n=r(1635),s=r(2226);function i(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function o(e,t){return void 0===t&&(t={}),(0,s.W)(e,(0,n.Cl)({delimiter:"",transform:i},t))}},533:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null}},1455:e=>{"use strict";e.exports=window.wp.apiFetch},1635:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},n.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError},2226:(e,t,r)=>{"use strict";r.d(t,{W:()=>o});var n=r(7314),s=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function o(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,o=void 0===r?s:r,c=t.stripRegexp,l=void 0===c?i:c,u=t.transform,d=void 0===u?n.g:u,p=t.delimiter,f=void 0===p?" ":p,E=a(a(e,o,"$1\0$2"),l,"\0"),y=0,g=E.length;"\0"===E.charAt(y);)y++;for(;"\0"===E.charAt(g-1);)g--;return E.slice(y,g).split("\0").map(d).join(f)}function a(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}},2239:(e,t,r)=>{"use strict";function n(e,t){const r={...e};let n=r;for(const e of t)n.children={...n.children,[e]:{locks:[],children:{},...n.children[e]}},n=n.children[e];return r}function s(e,t){let r=e;for(const e of t){const t=r.children[e];if(!t)return null;r=t}return r}function i({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}r.d(t,{A:()=>u});const o={requests:[],tree:{locks:[],children:{}}};function a(e=o,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:r}=t;return{...e,requests:[r,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:r,request:i}=t,{store:o,path:a}=i,c=[o,...a],l=n(e.tree,c),u=s(l,c);return u.locks=[...u.locks,r],{...e,requests:e.requests.filter((e=>e!==i)),tree:l}}case"RELEASE_LOCK":{const{lock:r}=t,i=[r.store,...r.path],o=n(e.tree,i),a=s(o,i);return a.locks=a.locks.filter((e=>e!==r)),{...e,tree:o}}}return e}function c(e,t,r,{exclusive:n}){const o=[t,...r],a=e.tree;for(const e of function*(e,t){let r=e;yield r;for(const e of t){const t=r.children[e];if(!t)break;yield t,r=t}}(a,o))if(i({exclusive:n},e.locks))return!1;const c=s(a,o);if(!c)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(c))if(i({exclusive:n},e.locks))return!1;return!0}function l(){let e=a(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:r,path:n,exclusive:s,notifyAcquired:i}=t;if(c(e,r,n,{exclusive:s})){const o={store:r,path:n,exclusive:s};e=a(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(r,n,s){return new Promise((i=>{e=a(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:n,exclusive:s,notifyAcquired:i}}),t()}))},release:function(r){e=a(e,{type:"RELEASE_LOCK",lock:r}),t()}}}function u(){const e=l();return{__unstableAcquireStoreLock:function(t,r,{exclusive:n}){return()=>e.acquire(t,r,n)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}},2278:(e,t,r)=>{"use strict";r.d(t,{E:()=>n});const n="core"},2577:(e,t,r)=>{"use strict";r.d(t,{CO:()=>n,kC:()=>i,qY:()=>s});const n=["create","read","update","delete"];function s(e){const t={};if(!e)return t;const r={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[n,s]of Object.entries(r))t[n]=e.includes(s);return t}function i(e,t,r){return("object"==typeof t?[e,t.kind,t.name,t.id]:[e,t,r]).filter(Boolean).join("/")}},2859:(e,t,r)=>{"use strict";r.d(t,{n:()=>n});var n=(e=>(e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e))(n||{})},3249:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t){var r=e._map,n=e._arrayTreeMap,s=e._objectTreeMap;if(r.has(t))return r.get(t);for(var i=Object.keys(t).sort(),o=Array.isArray(t)?n:s,a=0;a<i.length;a++){var c=i[a];if(void 0===(o=o.get(c)))return;var l=t[c];if(void 0===(o=o.get(l)))return}var u=o.get("_ekm_value");return u?(r.delete(u[0]),u[0]=t,o.set("_ekm_value",u),r.set(t,u),u):void 0}var s=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var r=[];t.forEach((function(e,t){r.push([t,e])})),t=r}if(null!=t)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}var s,i,o;return s=e,i=[{key:"set",value:function(r,n){if(null===r||"object"!==t(r))return this._map.set(r,n),this;for(var s=Object.keys(r).sort(),i=[r,n],o=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,a=0;a<s.length;a++){var c=s[a];o.has(c)||o.set(c,new e),o=o.get(c);var l=r[c];o.has(l)||o.set(l,new e),o=o.get(l)}var u=o.get("_ekm_value");return u&&this._map.delete(u[0]),o.set("_ekm_value",i),this._map.set(r,i),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var r=n(this,e);return r?r[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==n(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===t(i)&&(s=s[1]),e.call(n,s,i,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],i&&r(s.prototype,i),o&&r(s,o),e}();e.exports=s},3377:()=>{},3440:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__experimentalBatch:()=>F,__experimentalReceiveCurrentGlobalStylesId:()=>U,__experimentalReceiveThemeBaseGlobalStyles:()=>x,__experimentalReceiveThemeGlobalStyleVariations:()=>L,__experimentalSaveSpecifiedEntityEdits:()=>K,__unstableCreateUndoLevel:()=>$,addEntities:()=>C,deleteEntityRecord:()=>N,editEntityRecord:()=>V,receiveAutosaves:()=>W,receiveCurrentTheme:()=>P,receiveCurrentUser:()=>k,receiveDefaultTemplateId:()=>J,receiveEmbedPreview:()=>M,receiveEntityRecords:()=>O,receiveNavigationFallbackId:()=>Z,receiveRevisions:()=>X,receiveThemeGlobalStyleRevisions:()=>D,receiveThemeSupports:()=>j,receiveUploadPermissions:()=>Q,receiveUserPermission:()=>H,receiveUserPermissions:()=>z,receiveUserQuery:()=>A,redo:()=>G,saveEditedEntityRecord:()=>Y,saveEntityRecord:()=>B,undo:()=>q});var n=r(7734),s=r.n(n);const i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const a=new Uint8Array(16);function c(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(a)}const l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));function u(e,t=0){return l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]}const d=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();const n=(e=e||{}).random||(e.rng||c)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return u(n)};var p=r(1455),f=r.n(p),E=r(3832),y=r(4040),g=r.n(y),m=r(5003);function h(e,t,r){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const n=Array.isArray(t)?t:t.split(".");let s=e;return n.forEach((e=>{s=s?.[e]})),void 0!==s?s:r}function v(e,t,r){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:r}}var _=r(5914);let R=null;async function b(e){if(null===R){const e=await f()({path:"/batch/v1",method:"OPTIONS"});R=e.endpoints[0].args.requests.maxItems}const t=[];for(const r of function(e,t){const r=[...e],n=[];for(;r.length;)n.push(r.splice(0,t));return n}(e,R)){const e=await f()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:r.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let n;n=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...n)}return t}function w(e=b){let t=0,r=[];const n=new S;return{add(e){const s=++t;n.add(s);const i=e=>new Promise(((t,i)=>{r.push({input:e,resolve:t,reject:i}),n.delete(s)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{n.delete(s)})):i(e)},async run(){let t;n.size&&await new Promise((e=>{const t=n.subscribe((()=>{n.size||(t(),e(void 0))}))}));try{if(t=await e(r.map((({input:e})=>e))),t.length!==r.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of r)t(e);throw e}let s=!0;return t.forEach(((e,t)=>{const n=r[t];e?.error?(n?.reject(e.error),s=!1):n?.resolve(e?.output??e)})),r=[],s}}}class S{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}var T=r(2278),I=r(9410);function A(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function k(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function C(e){return{type:"ADD_ENTITIES",entities:e}}function O(e,t,r,n,s=!1,i,o){let a;return"postType"===e&&(r=(Array.isArray(r)?r:[r]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=n?function(e,t={},r,n){return{...v(e,r,n),query:t}}(r,n,i,o):v(r,i,o),{...a,kind:e,name:t,invalidateCache:s}}function P(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function U(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function x(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function L(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function j(){return g()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function D(e,t){return g()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function M(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const N=(e,t,r,n,{__unstableFetch:s=f(),throwOnError:i=!1}={})=>async({dispatch:o,resolveSelect:a})=>{(0,I.A)(e,t,"deleteEntityRecord");const c=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));let l,u=!1;if(!c)return;const d=await o.__unstableAcquireStoreLock(T.E,["entities","records",e,t,r],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:r});let a=!1;try{let i=`${c.baseURL}/${r}`;n&&(i=(0,E.addQueryArgs)(i,n)),u=await s({path:i,method:"DELETE"}),await o(function(e,t,r,n=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(r)?r:[r],kind:e,name:t,invalidateCache:n}}(e,t,r,!0))}catch(e){a=!0,l=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:r,error:l}),a&&i)throw l;return u}finally{o.__unstableReleaseStoreLock(d)}},V=(e,t,r,n,i={})=>({select:o,dispatch:a})=>{(0,I.A)(e,t,"editEntityRecord");const c=o.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=c,u=o.getRawEntityRecord(e,t,r),d=o.getEditedEntityRecord(e,t,r),p={kind:e,name:t,recordId:r,edits:Object.keys(n).reduce(((e,t)=>{const r=u[t],i=d[t],o=l[t]?{...i,...n[t]}:n[t];return e[t]=s()(r,o)?void 0:o,e}),{})};window.__experimentalEnableSync&&c.syncConfig,i.undoIgnore||o.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:r},changes:Object.keys(n).reduce(((e,t)=>(e[t]={from:d[t],to:n[t]},e)),{})}],i.isCached),a({type:"EDIT_ENTITY_RECORD",...p})},q=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().undo();r&&t({type:"UNDO",record:r})},G=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().redo();r&&t({type:"REDO",record:r})},$=()=>({select:e})=>{e.getUndoManager().addRecord()},B=(e,t,r,{isAutosave:n=!1,__unstableFetch:s=f(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{(0,I.A)(e,t,"saveEntityRecord");const l=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));if(!l)return;const u=l.key??_.C_,p=r[u],f=!!u&&!p,E=await c.__unstableAcquireStoreLock(T.E,["entities","records",e,t,p||d()],{exclusive:!0});try{for(const[n,s]of Object.entries(r))if("function"==typeof s){const i=s(o.getEditedEntityRecord(e,t,p));c.editEntityRecord(e,t,p,{[n]:i},{undoIgnore:!0}),r[n]=i}let u,d;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:p,isAutosave:n});let E=!1;try{const i=`${l.baseURL}${p?"/"+p:""}`,d=f?{}:o.getRawEntityRecord(e,t,p);if(n){const n=o.getCurrentUser(),l=n?n.id:void 0,p=await a.getAutosave(d.type,d.id,l);let f={...d,...p,...r};if(f=Object.keys(f).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=f[t]),e)),{status:"auto-draft"===f.status?"draft":void 0}),u=await s({path:`${i}/autosaves`,method:"POST",data:f}),d.id===u.id){let r={...d,...f,...u};r=Object.keys(r).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=r[t]:e[t]="status"===t?"auto-draft"===d.status&&"draft"===r.status?r.status:d.status:d[t],e)),{}),c.receiveEntityRecords(e,t,r,void 0,!0)}else c.receiveAutosaves(d.id,u)}else{let n=r;l.__unstablePrePersist&&(n={...n,...l.__unstablePrePersist(d,n)}),u=await s({path:i,method:p?"PUT":"POST",data:n}),c.receiveEntityRecords(e,t,u,void 0,!0,n)}}catch(e){E=!0,d=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:p,error:d,isAutosave:n}),E&&i)throw d;return u}finally{c.__unstableReleaseStoreLock(E)}},F=e=>async({dispatch:t})=>{const r=w(),n={saveEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEntityRecord(e,n,s,{...i,__unstableFetch:r}))),saveEditedEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEditedEntityRecord(e,n,s,{...i,__unstableFetch:r}))),deleteEntityRecord:(e,n,s,i,o)=>r.add((r=>t.deleteEntityRecord(e,n,s,i,{...o,__unstableFetch:r})))},s=e.map((e=>e(n))),[,...i]=await Promise.all([r.run(),...s]);return i},Y=(e,t,r,n)=>async({select:s,dispatch:i,resolveSelect:o})=>{if((0,I.A)(e,t,"saveEditedEntityRecord"),!s.hasEditsForEntityRecord(e,t,r))return;const a=(await o.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));if(!a)return;const c=a.key||_.C_,l=s.getEntityRecordNonTransientEdits(e,t,r),u={[c]:r,...l};return await i.saveEntityRecord(e,t,u,n)},K=(e,t,r,n,s)=>async({select:i,dispatch:o,resolveSelect:a})=>{if((0,I.A)(e,t,"__experimentalSaveSpecifiedEntityEdits"),!i.hasEditsForEntityRecord(e,t,r))return;const c=i.getEntityRecordNonTransientEdits(e,t,r),l={};for(const e of n)(0,m.A)(l,e,h(c,e));const u=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t)),d=u?.key||_.C_;return r&&(l[d]=r),await o.saveEntityRecord(e,t,l,s)};function Q(e){return g()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),H("create/media",e)}function H(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function z(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function W(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function Z(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function J(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const X=(e,t,r,n,s,i=!1,o)=>async({dispatch:a,resolveSelect:c})=>{(0,I.A)(e,t,"receiveRevisions");const l=(await c.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:_.C_,items:Array.isArray(n)?n:[n],recordKey:r,meta:o,query:s,kind:e,name:t,invalidateCache:i})}},3832:e=>{"use strict";e.exports=window.wp.url},4027:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(3832),s=r(533);var i=function(e){const t=new WeakMap;return r=>{let n;return t.has(r)?n=t.get(r):(n=e(r),null!==r&&"object"==typeof r&&t.set(r,n)),n}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},r=Object.keys(e).sort();for(let i=0;i<r.length;i++){const o=r[i];let a=e[o];switch(o){case"page":t[o]=Number(a);break;case"per_page":t.perPage=Number(a);break;case"context":t.context=a;break;default:"_fields"===o&&(t.fields=(0,s.A)(a)??[],a=t.fields.join()),"include"===o&&("number"==typeof a&&(a=a.toString()),t.include=((0,s.A)(a)??[]).map(Number),a=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,n.addQueryArgs)("",{[o]:a}).slice(1)}}return t}))},4040:e=>{"use strict";e.exports=window.wp.deprecated},4460:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});const n=window.ReactJSXRuntime;var s=r(6087),i=r(8843);function o({kind:e,type:t,id:r,children:o}){const a=(0,s.useContext)(i.D),c=(0,s.useMemo)((()=>({...a,[e]:{...a?.[e],[t]:r}})),[a,e,t,r]);return(0,n.jsx)(i.D.Provider,{value:c,children:o})}},4565:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EntityProvider:()=>g.A,__experimentalFetchLinkSuggestions:()=>v.Y3,__experimentalFetchUrlData:()=>v.gr,__experimentalUseEntityRecord:()=>_.qh,__experimentalUseEntityRecords:()=>_.bM,__experimentalUseResourcePermissions:()=>_._,fetchBlockPatterns:()=>v.l$,privateApis:()=>R.j,store:()=>I,useEntityBlockEditor:()=>_.hg,useEntityId:()=>_.mV,useEntityProp:()=>_.S$,useEntityRecord:()=>_.MA,useEntityRecords:()=>_.$u,useResourcePermissions:()=>_.qs});var n=r(7143),s=r(5469),i=r(8368),o=r(8741),a=r(3440),c=r(9424),l=r(6384),u=r(2239),d=r(5914),p=r(2278),f=r(6378),E=r(8582),y=r(9410),g=r(4460),m=r(3377),h={};for(const e in m)["default","EntityProvider","store"].indexOf(e)<0&&(h[e]=()=>m[e]);r.d(t,h);var v=r(7006),_=r(5891),R=r(7826);const b=[...d.Mr,...d.L2.filter((e=>!!e.name))],w=b.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t,o=(0,d.zD)(r,n);if(e[o]=(e,t,s)=>((0,y.A)(r,n,o,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),i.getEntityRecord(e,r,n,t,s)),s){const t=(0,d.zD)(r,s,"get");e[t]=(e,s)=>((0,y.A)(r,n,t,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),i.getEntityRecords(e,r,n,s))}return e}),{}),S=b.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t,i=(0,d.zD)(r,n);if(e[i]=(e,t)=>((0,y.A)(r,n,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),l.getEntityRecord(r,n,e,t)),s){const t=(0,d.zD)(r,s,"get");e[t]=(...e)=>((0,y.A)(r,s,t,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),l.getEntityRecords(r,n,...e)),e[t].shouldInvalidate=e=>l.getEntityRecords.shouldInvalidate(e,r,n)}return e}),{}),T=b.reduce(((e,t)=>{const{kind:r,name:n}=t,s=(0,d.zD)(r,n,"save");e[s]=(e,t)=>((0,y.A)(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"saveEntityRecord"}),a.saveEntityRecord(r,n,e,t));const i=(0,d.zD)(r,n,"delete");return e[i]=(e,t,s)=>((0,y.A)(r,n,i,{isShorthandSelector:!0,alternativeFunctionName:"deleteEntityRecord"}),a.deleteEntityRecord(r,n,e,t,s)),e}),{}),I=(0,n.createReduxStore)(p.E,{reducer:s.Ay,actions:{...E.B,...a,...T,...(0,u.A)()},selectors:{...E.A,...i,...w},resolvers:{...l,...S}});(0,f.T)(I).registerPrivateSelectors(o),(0,f.T)(I).registerPrivateActions(c),(0,n.register)(I)},4997:e=>{"use strict";e.exports=window.wp.blocks},5003:(e,t,r)=>{"use strict";function n(e,t,r){if(!e||"object"!=typeof e)return e;const n=Array.isArray(t)?t:t.split(".");return n.reduce(((e,t,s)=>(void 0===e[t]&&(Number.isInteger(n[s+1])?e[t]=[]:e[t]={}),s===n.length-1&&(e[t]=r),e[t])),e),e}r.d(t,{A:()=>n})},5101:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=Symbol("RECEIVE_INTERMEDIATE_RESULTS")},5469:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>S});var n=r(7734),s=r.n(n);const i=window.wp.compose;var o=r(7143);const a=window.wp.isShallowEqual;var c=r.n(a);function l(e,t){const r={...e};return Object.entries(t).forEach((([e,t])=>{r[e]?r[e]={...r[e],to:t.to}:r[e]=t})),r}const u=(e,t)=>{const r=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:c()(e,t.id))),n=[...e];return-1!==r?n[r]={id:t.id,changes:l(n[r].changes,t.changes)}:n.push(t),n};function d(){let e=[],t=[],r=0;const n=()=>{e=e.slice(0,r||void 0),r=0},s=()=>{const r=0===e.length?0:e.length-1;let n=e[r]??[];t.forEach((e=>{n=u(n,e)})),t=[],e[r]=n};return{addRecord(r,i=!1){const o=!r||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!c()(e,t))))).length)(r);if(i){if(o)return;r.forEach((e=>{t=u(t,e)}))}else{if(n(),t.length&&s(),o)return;e.push(r)}},undo(){t.length&&(n(),s());const i=e[e.length-1+r];if(i)return r-=1,i},redo(){const t=e[e.length+r];if(t)return r+=1,t},hasUndo:()=>!!e[e.length-1+r],hasRedo:()=>!!e[e.length+r]}}var p=e=>t=>(r,n)=>void 0===r||e(n)?t(r,n):r;var f=e=>t=>(r,n)=>t(r,e(n));var E=e=>t=>(r={},n)=>{const s=n[e];if(void 0===s)return r;const i=t(r[s],n);return i===r[s]?r:{...r,[s]:i}},y=r(5914),g=r(4027);function m(e){const{query:t}=e;if(!t)return"default";return(0,g.A)(t).context}function h(e,t,r,n){if(1===r&&-1===n)return t;const s=(r-1)*n,i=Math.max(e?.length??0,s+t.length),o=new Array(i);for(let r=0;r<i;r++){const i=r>=s&&r<s+n;o[r]=i?t[r-s]:e?.[r]}return o}function v(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const _=(0,i.compose)([p((e=>"query"in e)),f((e=>e.query?{...e,...(0,g.A)(e.query)}:e)),E("context"),E("stableKey")])(((e={},t)=>{const{type:r,page:n,perPage:s,key:i=y.C_}=t;return"RECEIVE_ITEMS"!==r?e:{itemIds:h(e?.itemIds||[],t.items.map((e=>e?.[i])).filter(Boolean),n,s),meta:t.meta}}));var R=(0,o.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=m(t),n=t.key||y.C_;return{...e,[r]:{...e[r],...t.items.reduce(((t,i)=>{const o=i?.[n];return t[o]=function(e,t){if(!e)return t;let r=!1;const n={};for(const i in t)s()(e[i],t[i])?n[i]=e[i]:(r=!0,n[i]=t[i]);if(!r)return e;for(const t in e)n.hasOwnProperty(t)||(n[t]=e[t]);return n}(e?.[r]?.[o],i),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,v(r,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=m(t),{query:n,key:s=y.C_}=t,i=n?(0,g.A)(n):{},o=!n||!Array.isArray(i.fields);return{...e,[r]:{...e[r],...t.items.reduce(((t,n)=>{const i=n?.[s];return t[i]=e?.[r]?.[i]||o,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,v(r,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return _(e,t);case"REMOVE_ITEMS":const r=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!r[e]))}])))])));default:return e}}});const b=e=>(t,r)=>{if("UNDO"===r.type||"REDO"===r.type){const{record:n}=r;let s=t;return n.forEach((({id:{kind:t,name:n,recordId:i},changes:o})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:n,recordId:i,edits:Object.entries(o).reduce(((e,[t,n])=>(e[t]="UNDO"===r.type?n.from:n.to,e)),{})})})),s}return e(t,r)};function w(e){return(0,i.compose)([b,p((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),f((t=>({key:e.key||y.C_,...t})))])((0,o.combineReducers)({queriedData:R,edits:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":if("default"!==(t?.query?.context??"default"))return e;const r={...e};for(const e of t.items){const n=e?.[t.key],i=r[n];if(!i)continue;const o=Object.keys(i).reduce(((r,n)=>(s()(i[n],e[n]?.raw??e[n])||t.persistedEdits&&s()(i[n],t.persistedEdits[n])||(r[n]=i[n]),r)),{});Object.keys(o).length?r[n]=o:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const n={...e[t.recordId],...t.edits};return Object.keys(n).forEach((e=>{void 0===n[e]&&delete n[e]})),{...e,[t.recordId]:n}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const r=t.recordKey;delete t.recordKey;const n=R(e[r],{...t,type:"RECEIVE_ITEMS"});return{...e,[r]:n}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}var S=(0,o.combineReducers)({users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},entities:(e={},t)=>{const r=function(e=y.Mr,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let n=e.reducer;if(!n||r!==e.config){const e=r.reduce(((e,t)=>{const{kind:r}=t;return e[r]||(e[r]=[]),e[r].push(t),e}),{});n=(0,o.combineReducers)(Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,o.combineReducers)(Object.fromEntries(t.map((e=>[e.name,w(e)]))))]))))}const s=n(e.records,t);return s===e.records&&r===e.config&&n===e.reducer?e:{reducer:n,records:s,config:r}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=d()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:r,preview:n}=t;return{...e,[r]:n}}return e},userPermissions:function(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:r,autosaves:n}=t;return{...e,[r]:n}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e},registeredPostMeta:function(e={},t){return"RECEIVE_REGISTERED_POST_META"===t.type?{...e,[t.postType]:t.registeredPostMeta}:e}})},5663:(e,t,r)=>{"use strict";r.d(t,{xQ:()=>o});var n=r(1635),s=r(287);function i(e,t){return 0===t?e.toLowerCase():(0,s.l3)(e,t)}function o(e,t){return void 0===t&&(t={}),(0,s.fL)(e,(0,n.Cl)({transform:i},t))}},5891:(e,t,r)=>{"use strict";r.d(t,{qh:()=>d,bM:()=>p.bM,_:()=>h,hg:()=>L,mV:()=>b,S$:()=>j,MA:()=>u,$u:()=>p.Ay,qs:()=>m});var n=r(7143),s=r(4040),i=r.n(s),o=r(6087),a=r(7541),c=r(4565);const l={};function u(e,t,r,s={enabled:!0}){const{editEntityRecord:i,saveEditedEntityRecord:u}=(0,n.useDispatch)(c.store),d=(0,o.useMemo)((()=>({edit:(n,s={})=>i(e,t,r,n,s),save:(n={})=>u(e,t,r,{throwOnError:!0,...n})})),[i,e,t,r,u]),{editedRecord:p,hasEdits:f,edits:E}=(0,n.useSelect)((n=>s.enabled?{editedRecord:n(c.store).getEditedEntityRecord(e,t,r),hasEdits:n(c.store).hasEditsForEntityRecord(e,t,r),edits:n(c.store).getEntityRecordNonTransientEdits(e,t,r)}:{editedRecord:l,hasEdits:!1,edits:l}),[e,t,r,s.enabled]),{data:y,...g}=(0,a.A)((n=>s.enabled?n(c.store).getEntityRecord(e,t,r):{data:null}),[e,t,r,s.enabled]);return{record:y,editedRecord:p,hasEdits:f,edits:E,...g,...d}}function d(e,t,r,n){return i()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),u(e,t,r,n)}var p=r(7078);const f=window.wp.warning;var E=r.n(f),y=r(2859);function g(e,t){const r="object"==typeof e,n=r?JSON.stringify(e):e;return r&&void 0!==t&&E()("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),(0,a.A)((n=>{const s=r?!!e.id:!!t,{canUser:i}=n(c.store),o=i("create",r?{kind:e.kind,name:e.name}:e);if(!s){const t=i("read",e),r=o.isResolving||t.isResolving,n=o.hasResolved&&t.hasResolved;let s=y.n.Idle;return r?s=y.n.Resolving:n&&(s=y.n.Success),{status:s,isResolving:r,hasResolved:n,canCreate:o.hasResolved&&o.data,canRead:t.hasResolved&&t.data}}const a=i("read",e,t),l=i("update",e,t),u=i("delete",e,t),d=a.isResolving||o.isResolving||l.isResolving||u.isResolving,p=a.hasResolved&&o.hasResolved&&l.hasResolved&&u.hasResolved;let f=y.n.Idle;return d?f=y.n.Resolving:p&&(f=y.n.Success),{status:f,isResolving:d,hasResolved:p,canRead:p&&a.data,canCreate:p&&o.data,canUpdate:p&&l.data,canDelete:p&&u.data}}),[n,t])}var m=g;function h(e,t){return i()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),g(e,t)}var v=r(4997),_=r(2278),R=r(8843);function b(e,t){const r=(0,o.useContext)(R.D);return r?.[e]?.[t]}const w=window.wp.richText,S=window.wp.blockEditor;var T=r(6378);let I;const A=new WeakMap;const k=new WeakMap;function C(e){if(!k.has(e)){const t=[];for(const r of function(e){if(I||(I=(0,T.T)(S.privateApis)),!A.has(e)){const t=I.getRichTextValues([e]);A.set(e,t)}return A.get(e)}(e))r&&r.replacements.forEach((({type:e,attributes:r})=>{"core/footnote"===e&&t.push(r["data-fn"])}));k.set(e,t)}return k.get(e)}let O={};function P(e,t){const r={blocks:e};if(!t)return r;if(void 0===t.footnotes)return r;const n=function(e){return e.flatMap(C)}(e),s=t.footnotes?JSON.parse(t.footnotes):[];if(s.map((e=>e.id)).join("")===n.join(""))return r;const i=n.map((e=>s.find((t=>t.id===e))||O[e]||{id:e,content:""}));function o(e){if(!e||Array.isArray(e)||"object"!=typeof e)return e;e={...e};for(const t in e){const r=e[t];if(Array.isArray(r)){e[t]=r.map(o);continue}if("string"!=typeof r&&!(r instanceof w.RichTextData))continue;const s="string"==typeof r?w.RichTextData.fromHTMLString(r):new w.RichTextData(r);let i=!1;s.replacements.forEach((e=>{if("core/footnote"===e.type){const t=e.attributes["data-fn"],r=n.indexOf(t),s=(0,w.create)({html:e.innerHTML});s.text=String(r+1),s.formats=Array.from({length:s.text.length},(()=>s.formats[0])),s.replacements=Array.from({length:s.text.length},(()=>s.replacements[0])),e.innerHTML=(0,w.toHTMLString)({value:s}),i=!0}})),i&&(e[t]="string"==typeof r?s.toHTMLString():s)}return e}const a=function e(t){return t.map((t=>({...t,attributes:o(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return O={...O,...s.reduce(((e,t)=>(n.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:a}}const U=[],x=new WeakMap;function L(e,t,{id:r}={}){const s=b(e,t),i=r??s,{getEntityRecord:a,getEntityRecordEdits:c}=(0,n.useSelect)(_.E),{content:l,editedBlocks:u,meta:d}=(0,n.useSelect)((r=>{if(!i)return{};const{getEditedEntityRecord:n}=r(_.E),s=n(e,t,i);return{editedBlocks:s.blocks,content:s.content,meta:s.meta}}),[e,t,i]),{__unstableCreateUndoLevel:p,editEntityRecord:f}=(0,n.useDispatch)(_.E),E=(0,o.useMemo)((()=>{if(!i)return;if(u)return u;if(!l||"string"!=typeof l)return U;const r=c(e,t,i),n=!r||!Object.keys(r).length?a(e,t,i):r;let s=x.get(n);return s||(s=(0,v.parse)(l),x.set(n,s)),s}),[e,t,i,u,l,a,c]),y=(0,o.useCallback)(((r,n)=>{if(E===r)return p(e,t,i);const{selection:s,...o}=n,a={selection:s,content:({blocks:e=[]})=>(0,v.__unstableSerializeAndClean)(e),...P(r,d)};f(e,t,i,a,{isCached:!1,...o})}),[e,t,i,E,d,p,f]),g=(0,o.useCallback)(((r,n)=>{const{selection:s,...o}=n,a={selection:s,...P(r,d)};f(e,t,i,a,{isCached:!0,...o})}),[e,t,i,d,f]);return[E,g,y]}function j(e,t,r,s){const i=b(e,t),a=s??i,{value:c,fullValue:l}=(0,n.useSelect)((n=>{const{getEntityRecord:s,getEditedEntityRecord:i}=n(_.E),o=s(e,t,a),c=i(e,t,a);return o&&c?{value:c[r],fullValue:o[r]}:{}}),[e,t,a,r]),{editEntityRecord:u}=(0,n.useDispatch)(_.E);return[c,(0,o.useCallback)((n=>{u(e,t,a,{[r]:n})}),[u,e,t,a,r]),l]}},5914:(e,t,r)=>{"use strict";r.d(t,{C_:()=>d,L2:()=>g,TK:()=>y,zD:()=>h,Mr:()=>E});var n=r(1635),s=r(2226);function i(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}var o=r(287),a=r(1455),c=r.n(a),l=r(4997),u=r(7723);const d="id",p=["title","excerpt","content"],f={blocks:{read:e=>(0,l.parse)(e.content?.raw??""),write:e=>({content:(0,l.__unstableSerializeAndClean)(e.blocks)})}},E=[{label:(0,u.__)("Base"),kind:"root",key:!1,name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases"},{label:(0,u.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes"},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,u.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,u.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,u.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,u.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,u.__)("Widget types")},{label:(0,u.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",getTitle:e=>e?.name||e?.slug,baseURLParams:{context:"edit"},plural:"users",supportsPagination:!0},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,u.__)("Comment"),supportsPagination:!0},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,u.__)("Menu"),supportsPagination:!0},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,u.__)("Menu Item"),rawAttributes:["title"],supportsPagination:!0},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,u.__)("Menu Location"),key:"name"},{label:(0,u.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>(0,u.__)("Custom Styles"),getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,u.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,u.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,u.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],y={root:{media:{since:"6.9",alternative:{kind:"postType",name:"attachment"}}}},g=[{kind:"postType",loadEntities:async function(){const e=await c()({path:"/wp/v2/types?context=view"});return Object.entries(e??{}).map((([e,t])=>{const r=["wp_template","wp_template_part"].includes(e),o=t?.rest_namespace??"wp/v2",a={kind:"postType",baseURL:`/${o}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{...f,selection:!0},mergedEdits:{meta:!0},rawAttributes:p,getTitle:e=>{return e?.title?.rendered||e?.title||(r?(t=e.slug??"",void 0===o&&(o={}),(0,s.W)(t,(0,n.Cl)({delimiter:" ",transform:i},o))):String(e.id));var t,o},__unstablePrePersist:r?void 0:m,__unstable_rest_base:t.rest_base,supportsPagination:!0,getRevisionsUrl:(e,r)=>`/${o}/${t.rest_base}/${e}/revisions${r?"/"+r:""}`,revisionKey:r?"wp_id":d};return window.__experimentalEnableSync,a}))}},{kind:"taxonomy",loadEntities:async function(){const e=await c()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map((([e,t])=>({kind:"taxonomy",baseURL:`/${t?.rest_namespace??"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,getTitle:e=>e?.name,supportsPagination:!0})))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){const e={label:(0,u.__)("Site"),name:"site",kind:"root",key:!1,baseURL:"/wp/v2/settings",meta:{}};window.__experimentalEnableSync;const t=await c()({path:e.baseURL,method:"OPTIONS"}),r={};return Object.entries(t?.schema?.properties??{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...e,meta:{labels:r}}]}}],m=(e,t)=>{const r={};return"auto-draft"===e?.status&&(t.status||r.status||(r.status="draft"),t.title&&"Auto Draft"!==t.title||r.title||e?.title&&"Auto Draft"!==e?.title||(r.title="")),r};const h=(e,t,r="get")=>`${r}${"root"===e?"":(0,o.fL)(e)}${(0,o.fL)(t)}`},6087:e=>{"use strict";e.exports=window.wp.element},6378:(e,t,r)=>{"use strict";r.d(t,{s:()=>s,T:()=>i});const n=window.wp.privateApis,{lock:s,unlock:i}=(0,n.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data")},6384:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__experimentalGetCurrentGlobalStylesId:()=>O,__experimentalGetCurrentThemeBaseGlobalStyles:()=>P,__experimentalGetCurrentThemeGlobalStylesVariations:()=>U,canUser:()=>I,canUserEditEntityRecord:()=>A,getAuthors:()=>y,getAutosave:()=>C,getAutosaves:()=>k,getBlockPatternCategories:()=>j,getBlockPatterns:()=>L,getCurrentTheme:()=>w,getCurrentThemeGlobalStylesRevisions:()=>x,getCurrentUser:()=>g,getDefaultTemplateId:()=>N,getEditedEntityRecord:()=>v,getEmbedPreview:()=>T,getEntitiesConfig:()=>$,getEntityRecord:()=>m,getEntityRecords:()=>_,getEntityRecordsTotalItems:()=>R,getEntityRecordsTotalPages:()=>b,getNavigationFallbackId:()=>M,getRawEntityRecord:()=>h,getRegisteredPostMeta:()=>G,getRevision:()=>q,getRevisions:()=>V,getThemeSupports:()=>S,getUserPatternCategories:()=>D});var n=r(5663),s=r(3832),i=r(8537),o=r(1455),a=r.n(o),c=r(2278),l=r(5914),u=r(533),d=r(2577);var p=e=>(...t)=>async({resolveSelect:r})=>{await r[e](...t)},f=r(5101),E=r(7006);const y=e=>async({dispatch:t})=>{const r=(0,s.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),n=await a()({path:r});t.receiveUserQuery(r,n)},g=()=>async({dispatch:e})=>{const t=await a()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},m=(e,t,r="",n)=>async({select:i,dispatch:o,registry:p,resolveSelect:f})=>{const E=(await f.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!E)return;const y=await o.__unstableAcquireStoreLock(c.E,["entities","records",e,t,r],{exclusive:!1});try{if(void 0!==n&&n._fields&&(n={...n,_fields:[...new Set([...(0,u.A)(n._fields)||[],E.key||l.C_])].join()}),void 0!==n&&n._fields){if(i.hasEntityRecord(e,t,r,n))return}const c=(0,s.addQueryArgs)(E.baseURL+(r?"/"+r:""),{...E.baseURLParams,...n}),f=await a()({path:c,parse:!1}),y=await f.json(),g=(0,d.qY)(f.headers?.get("allow")),m=[],h={};for(const n of d.CO)h[(0,d.kC)(n,{kind:e,name:t,id:r})]=g[n],m.push([n,{kind:e,name:t,id:r}]);window.__experimentalEnableSync&&E.syncConfig,p.batch((()=>{o.receiveEntityRecords(e,t,y,n),o.receiveUserPermissions(h),o.finishResolutions("canUser",m)}))}finally{o.__unstableReleaseStoreLock(y)}},h=p("getEntityRecord"),v=p("getEntityRecord"),_=(e,t,r={})=>async({dispatch:n,registry:i,resolveSelect:o})=>{const p=(await o.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!p)return;const E=await n.__unstableAcquireStoreLock(c.E,["entities","records",e,t],{exclusive:!1}),y={...r},g=p.key||l.C_;function m(r,n){const s=Object.fromEntries(Object.entries(n).filter((([e,t])=>["context","_fields"].includes(e)&&!!t)));return r.filter((e=>e?.[g])).map((r=>[e,t,r[g],Object.keys(s).length>0?s:void 0]))}try{r._fields&&(r={...r,_fields:[...new Set([...(0,u.A)(r._fields)||[],g])].join()});const o=(0,s.addQueryArgs)(p.baseURL,{...p.baseURLParams,...r});let c,l=[];if(p.supportsPagination&&-1!==r.per_page){const e=await a()({path:o,parse:!1});l=Object.values(await e.json()),c={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else if(-1===r.per_page&&!0===r[f.Z]){let u,d=1;do{const p=await a()({path:(0,s.addQueryArgs)(o,{page:d,per_page:100}),parse:!1}),f=Object.values(await p.json());u=parseInt(p.headers.get("X-WP-TotalPages")),c||(c={totalItems:parseInt(p.headers.get("X-WP-Total")),totalPages:1}),l.push(...f),i.batch((()=>{n.receiveEntityRecords(e,t,l,r,!1,void 0,c),n.finishResolutions("getEntityRecord",m(f,y))})),d++}while(d<=u)}else l=Object.values(await a()({path:o})),c={totalItems:l.length,totalPages:1};r._fields&&(l=l.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.batch((()=>{n.receiveEntityRecords(e,t,l,r,!1,void 0,c);const s=l.filter((e=>!!e?.[g]&&!!e?._links?.self?.[0]?.targetHints?.allow)).map((e=>({id:e[g],permissions:(0,d.qY)(e._links.self[0].targetHints.allow)}))),i=[],o={};for(const r of s)for(const n of d.CO)i.push([n,{kind:e,name:t,id:r.id}]),o[(0,d.kC)(n,{kind:e,name:t,id:r.id})]=r.permissions[n];s.length>0&&(n.receiveUserPermissions(o),n.finishResolutions("canUser",i)),n.finishResolutions("getEntityRecord",m(l,y)),n.__unstableReleaseStoreLock(E)}))}catch(e){n.__unstableReleaseStoreLock(E)}};_.shouldInvalidate=(e,t,r)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&r===e.name;const R=p("getEntityRecords"),b=p("getEntityRecords"),w=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(r[0])},S=p("getCurrentTheme"),T=e=>async({dispatch:t})=>{try{const r=await a()({path:(0,s.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,r)}catch(r){t.receiveEmbedPreview(e,!1)}},I=(e,t,r)=>async({dispatch:n,registry:s,resolveSelect:i})=>{if(!d.CO.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:o}=s.select(c.E);for(const n of d.CO){if(n===e)continue;if(o("canUser",[n,t,r]))return}let l,u=null;if("object"==typeof t){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const e=(await i.getEntitiesConfig(t.kind)).find((e=>e.name===t.name&&e.kind===t.kind));if(!e)return;u=e.baseURL+(t.id?"/"+t.id:"")}else u=`/wp/v2/${t}`+(r?"/"+r:"");try{l=await a()({path:u,method:"OPTIONS",parse:!1})}catch(e){return}const p=(0,d.qY)(l.headers?.get("allow"));s.batch((()=>{for(const s of d.CO){const i=(0,d.kC)(s,t,r);n.receiveUserPermission(i,p[s]),s!==e&&n.finishResolution("canUser",[s,t,r])}}))},A=(e,t,r)=>async({dispatch:n})=>{await n(I("update",{kind:e,name:t,id:r}))},k=(e,t)=>async({dispatch:r,resolveSelect:n})=>{const{rest_base:s,rest_namespace:i="wp/v2",supports:o}=await n.getPostType(e);if(!o?.autosave)return;const c=await a()({path:`/${i}/${s}/${t}/autosaves?context=edit`});c&&c.length&&r.receiveAutosaves(t,c)},C=(e,t)=>async({resolveSelect:r})=>{await r.getAutosaves(e,t)},O=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"}),n=r?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!n)return;const s=n.match(/\/(\d+)(?:\?|$)/),i=s?Number(s[1]):null;i&&e.__experimentalReceiveCurrentGlobalStylesId(i)},P=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await a()({path:`/wp/v2/global-styles/themes/${r.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},U=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await a()({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},x=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.__experimentalGetCurrentGlobalStylesId(),s=r?await e.getEntityRecord("root","globalStyles",r):void 0,i=s?._links?.["version-history"]?.[0]?.href;if(i){const e=await a()({url:i}),s=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,n.xQ)(e),t])))));t.receiveThemeGlobalStyleRevisions(r,s)}};x.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const L=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await(0,E.l$)()})},j=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await a()({path:"/wp/v2/block-patterns/categories"})})},D=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:r?.map((e=>({...e,label:(0,i.decodeEntities)(e.name),name:e.slug})))||[]})},M=()=>async({dispatch:e,select:t,registry:r})=>{const n=await a()({path:(0,s.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),i=n?._embedded?.self;r.batch((()=>{if(e.receiveNavigationFallbackId(n?.id),!i)return;const r=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",i,void 0,r),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])}))},N=e=>async({dispatch:t,registry:r,resolveSelect:n})=>{const i=await a()({path:(0,s.addQueryArgs)("/wp/v2/templates/lookup",e)});await n.getEntitiesConfig("postType"),i?.id&&r.batch((()=>{t.receiveDefaultTemplateId(e,i.id),t.receiveEntityRecords("postType","wp_template",[i]),t.finishResolution("getEntityRecord",["postType","wp_template",i.id])}))},V=(e,t,r,n={})=>async({dispatch:i,registry:o,resolveSelect:c})=>{const d=(await c.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!d)return;n._fields&&(n={...n,_fields:[...new Set([...(0,u.A)(n._fields)||[],d.revisionKey||l.C_])].join()});const p=(0,s.addQueryArgs)(d.getRevisionsUrl(r),n);let f,E;const y={},g=d.supportsPagination&&-1!==n.per_page;try{E=await a()({path:p,parse:!g})}catch(e){return}E&&(g?(f=Object.values(await E.json()),y.totalItems=parseInt(E.headers.get("X-WP-Total"))):f=Object.values(E),n._fields&&(f=f.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.batch((()=>{if(i.receiveRevisions(e,t,r,f,n,!1,y),!n?._fields&&!n.context){const n=d.key||l.C_,s=f.filter((e=>e[n])).map((s=>[e,t,r,s[n]]));i.finishResolutions("getRevision",s)}})))};V.shouldInvalidate=(e,t,r,n)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&r===e.name&&t===e.kind&&!e.error&&n===e.recordId;const q=(e,t,r,n,i)=>async({dispatch:o,resolveSelect:c})=>{const d=(await c.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!d)return;void 0!==i&&i._fields&&(i={...i,_fields:[...new Set([...(0,u.A)(i._fields)||[],d.revisionKey||l.C_])].join()});const p=(0,s.addQueryArgs)(d.getRevisionsUrl(r,n),i);let f;try{f=await a()({path:p})}catch(e){return}f&&o.receiveRevisions(e,t,r,f,i)},G=e=>async({dispatch:t,resolveSelect:r})=>{let n;try{const{rest_namespace:t="wp/v2",rest_base:s}=await r.getPostType(e)||{};n=await a()({path:`${t}/${s}/?context=edit`,method:"OPTIONS"})}catch(e){return}n&&t.receiveRegisteredPostMeta(e,n?.schema?.properties?.meta?.properties)},$=e=>async({dispatch:t})=>{const r=l.L2.find((t=>t.kind===e));if(r)try{const e=await r.loadEntities();if(!e.length)return;t.addEntities(e)}catch{}}},7006:(e,t,r)=>{"use strict";r.d(t,{Y3:()=>l,gr:()=>p,l$:()=>f});var n=r(5663),s=r(1455),i=r.n(s),o=r(3832),a=r(8537),c=r(7723);async function l(e,t={},r={}){const n=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:s,subtype:l,page:d,perPage:p=(t.isInitialSuggestions?3:20)}=n,{disablePostFormats:f=!1}=r,E=[];s&&"post"!==s||E.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:e,page:d,per_page:p,type:"post",subtype:l})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,a.decodeEntities)(e.title||"")||(0,c.__)("(no title)"),type:e.subtype||e.type,kind:"post-type"}))))).catch((()=>[]))),s&&"term"!==s||E.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:e,page:d,per_page:p,type:"term",subtype:l})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,a.decodeEntities)(e.title||"")||(0,c.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),f||s&&"post-format"!==s||E.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:e,page:d,per_page:p,type:"post-format",subtype:l})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,a.decodeEntities)(e.title||"")||(0,c.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),s&&"attachment"!==s||E.push(i()({path:(0,o.addQueryArgs)("/wp/v2/media",{search:e,page:d,per_page:p})}).then((e=>e.map((e=>({id:e.id,url:e.source_url,title:(0,a.decodeEntities)(e.title.rendered||"")||(0,c.__)("(no title)"),type:e.type,kind:"media"}))))).catch((()=>[])));let y=(await Promise.all(E)).flat();return y=y.filter((e=>!!e.id)),y=function(e,t){const r=u(t),n={};for(const t of e)if(t.title){const e=u(t.title),s=e.filter((e=>r.some((t=>e===t)))),i=e.filter((e=>r.some((t=>e!==t&&e.includes(t))))),o=s.length/e.length*10,a=i.length/e.length;n[t.id]=o+a}else n[t.id]=0;return e.sort(((e,t)=>n[t.id]-n[e.id]))}(y,e),y=y.slice(0,p),y}function u(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const d=new Map;var p=async(e,t={})=>{const r={url:(0,o.prependHTTP)(e)};if(!(0,o.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const n=(0,o.getProtocol)(e);return n&&(0,o.isValidProtocol)(n)&&n.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?d.has(e)?d.get(e):i()({path:(0,o.addQueryArgs)("/wp-block-editor/v1/url-details",r),...t}).then((t=>(d.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};async function f(){const e=await i()({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,n.xQ)(e),t]))))):[]}},7078:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>f,bM:()=>E,pU:()=>y});var n=r(3832),s=r(4040),i=r.n(s),o=r(7143),a=r(6087),c=r(7541),l=r(4565),u=r(6378),d=r(533);const p=[];function f(e,t,r={},s={enabled:!0}){const i=(0,n.addQueryArgs)("",r),{data:a,...u}=(0,c.A)((n=>s.enabled?n(l.store).getEntityRecords(e,t,r):{data:p}),[e,t,i,s.enabled]),{totalItems:d,totalPages:f}=(0,o.useSelect)((n=>s.enabled?{totalItems:n(l.store).getEntityRecordsTotalItems(e,t,r),totalPages:n(l.store).getEntityRecordsTotalPages(e,t,r)}:{totalItems:null,totalPages:null}),[e,t,i,s.enabled]);return{records:a,totalItems:d,totalPages:f,...u}}function E(e,t,r,n){return i()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),f(e,t,r,n)}function y(e,t,r={},n={enabled:!0}){const s=(0,o.useSelect)((r=>r(l.store).getEntityConfig(e,t)),[e,t]),{records:i,...c}=f(e,t,{...r,...r._fields?{_fields:[...new Set([...(0,d.A)(r._fields)||[],"_links"])].join()}:{}},n),p=(0,a.useMemo)((()=>i?.map((e=>e[s?.key??"id"]))??[]),[i,s?.key]),E=(0,o.useSelect)((r=>{const{getEntityRecordsPermissions:n}=(0,u.T)(r(l.store));return n(e,t,p)}),[p,e,t]);return{records:(0,a.useMemo)((()=>i?.map(((e,t)=>({...e,permissions:E[t]})))??[]),[i,E]),...c}}},7143:e=>{"use strict";e.exports=window.wp.data},7314:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});function n(e){return e.toLowerCase()}},7541:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(7143);var s=function(e,t){var r,n,s=0;function i(){var i,o,a=r,c=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(o=0;o<c;o++)if(a.args[o]!==arguments[o]){a=a.next;continue e}return a!==r&&(a===n&&(n=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(i=new Array(c),o=0;o<c;o++)i[o]=arguments[o];return a={args:i,val:e.apply(null,i)},r?(r.prev=a,a.next=r):n=a,s===t.maxSize?(n=n.prev).next=null:s++,r=a,a.val}return t=t||{},i.clear=function(){r=null,n=null,s=0},i},i=r(2859);const o=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function a(e,t){return(0,n.useSelect)(((t,r)=>e((e=>c(t(e))),r)),t)}const c=s((e=>{const t={};for(const r in e)o.includes(r)||Object.defineProperty(t,r,{get:()=>(...t)=>{const n=e[r](...t),s=e.getResolutionState(r,t)?.status;let o;switch(s){case"resolving":o=i.n.Resolving;break;case"finished":o=i.n.Success;break;case"error":o=i.n.Error;break;case void 0:o=i.n.Idle}return{data:n,status:o,isResolving:o===i.n.Resolving,hasStarted:o!==i.n.Idle,hasResolved:o===i.n.Success||o===i.n.Error}}});return t}))},7723:e=>{"use strict";e.exports=window.wp.i18n},7734:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(!e(t[s],r[s]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],r.get(s[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(t[s]!==r[s])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;0!=s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},7826:(e,t,r)=>{"use strict";r.d(t,{j:()=>o});var n=r(7078),s=r(5101),i=r(6378);const o={};(0,i.s)(o,{useEntityRecordsWithPermissions:n.pU,RECEIVE_INTERMEDIATE_RESULTS:s.Z})},8368:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__experimentalGetCurrentGlobalStylesId:()=>J,__experimentalGetCurrentThemeBaseGlobalStyles:()=>ce,__experimentalGetCurrentThemeGlobalStylesVariations:()=>le,__experimentalGetDirtyEntityRecords:()=>D,__experimentalGetEntitiesBeingSaved:()=>M,__experimentalGetEntityRecordNoResolver:()=>O,canUser:()=>re,canUserEditEntityRecord:()=>ne,getAuthors:()=>R,getAutosave:()=>ie,getAutosaves:()=>se,getBlockPatternCategories:()=>de,getBlockPatterns:()=>ue,getCurrentTheme:()=>Z,getCurrentThemeGlobalStylesRevisions:()=>fe,getCurrentUser:()=>b,getDefaultTemplateId:()=>Ee,getEditedEntityRecord:()=>G,getEmbedPreview:()=>ee,getEntitiesByKind:()=>S,getEntitiesConfig:()=>T,getEntity:()=>I,getEntityConfig:()=>A,getEntityRecord:()=>k,getEntityRecordEdits:()=>N,getEntityRecordNonTransientEdits:()=>V,getEntityRecords:()=>x,getEntityRecordsTotalItems:()=>L,getEntityRecordsTotalPages:()=>j,getLastEntityDeleteError:()=>K,getLastEntitySaveError:()=>Y,getRawEntityRecord:()=>P,getRedoEdit:()=>H,getReferenceByDistinctEdits:()=>ae,getRevision:()=>ge,getRevisions:()=>ye,getThemeSupports:()=>X,getUndoEdit:()=>Q,getUserPatternCategories:()=>pe,getUserQueryResults:()=>w,hasEditsForEntityRecord:()=>q,hasEntityRecord:()=>C,hasEntityRecords:()=>U,hasFetchedAutosaves:()=>oe,hasRedo:()=>W,hasUndo:()=>z,isAutosavingEntityRecord:()=>$,isDeletingEntityRecord:()=>F,isPreviewEmbedFallback:()=>te,isRequestingEmbedPreview:()=>_,isSavingEntityRecord:()=>B});var n=r(7143),s=r(3832),i=r(4040),o=r.n(i),a=r(2278),c=r(3249),l=r.n(c),u=r(4027),d=r(5003);const p=new WeakMap;const f=(0,n.createSelector)(((e,t={})=>{let r=p.get(e);if(r){const e=r.get(t);if(void 0!==e)return e}else r=new(l()),p.set(e,r);const n=function(e,t){const{stableKey:r,page:n,perPage:s,include:i,fields:o,context:a}=(0,u.A)(t);let c;if(e.queries?.[a]?.[r]&&(c=e.queries[a][r].itemIds),!c)return null;const l=-1===s?0:(n-1)*s,p=-1===s?c.length:Math.min(l+s,c.length),f=[];for(let t=l;t<p;t++){const r=c[t];if(Array.isArray(i)&&!i.includes(r))continue;if(void 0===r)continue;if(!e.items[a]?.hasOwnProperty(r))return null;const n=e.items[a][r];let s;if(Array.isArray(o)){s={};for(let e=0;e<o.length;e++){const t=o[e].split(".");let r=n;t.forEach((e=>{r=r?.[e]})),(0,d.A)(s,t,r)}}else{if(!e.itemIsComplete[a]?.[r])return null;s=n}f.push(s)}return f}(e,t);return r.set(t,n),n}));function E(e,t={}){const{stableKey:r,context:n}=(0,u.A)(t);return e.queries?.[n]?.[r]?.meta?.totalItems??null}var y=r(5914),g=r(533);var m=r(2577),h=r(9410);const v={},_=(0,n.createRegistrySelector)((e=>(t,r)=>e(a.E).isResolving("getEmbedPreview",[r])));function R(e,t){o()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const r=(0,s.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return w(e,r)}function b(e){return e.currentUser}const w=(0,n.createSelector)(((e,t)=>(e.users.queries[t]??[]).map((t=>e.users.byId[t]))),((e,t)=>[e.users.queries[t],e.users.byId]));function S(e,t){return o()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),T(e,t)}const T=(0,n.createSelector)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function I(e,t,r){return o()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),A(e,t,r)}function A(e,t,r){return(0,h.A)(t,r,"getEntityConfig"),e.entities.config?.find((e=>e.kind===t&&e.name===r))}const k=(0,n.createSelector)(((e,t,r,n,s)=>{(0,h.A)(t,r,"getEntityRecord");const i=e.entities.records?.[t]?.[r]?.queriedData;if(!i)return;const o=s?.context??"default";if(!s||!s._fields){if(!i.itemIsComplete[o]?.[n])return;return i.items[o][n]}const a=i.items[o]?.[n];if(!a)return a;const c={},l=(0,g.A)(s._fields)??[];for(let e=0;e<l.length;e++){const t=l[e].split(".");let r=a;t.forEach((e=>{r=r?.[e]})),(0,d.A)(c,t,r)}return c}),((e,t,r,n,s)=>{const i=s?.context??"default",o=e.entities.records?.[t]?.[r]?.queriedData;return[o?.items[i]?.[n],o?.itemIsComplete[i]?.[n]]}));function C(e,t,r,n,s){const i=e.entities.records?.[t]?.[r]?.queriedData;if(!i)return!1;const o=s?.context??"default";if(!s||!s._fields)return!!i.itemIsComplete[o]?.[n];const a=i.items[o]?.[n];if(!a)return!1;const c=(0,g.A)(s._fields)??[];for(let e=0;e<c.length;e++){const t=c[e].split(".");let r=a;for(let e=0;e<t.length;e++){const n=t[e];if(!r||!Object.hasOwn(r,n))return!1;r=r[n]}}return!0}function O(e,t,r,n){return k(e,t,r,n)}k.__unstableNormalizeArgs=e=>{const t=[...e],r=t?.[2];return t[2]=/^\s*\d+\s*$/.test(r)?Number(r):r,t};const P=(0,n.createSelector)(((e,t,r,n)=>{(0,h.A)(t,r,"getRawEntityRecord");const s=k(e,t,r,n);return s&&Object.keys(s).reduce(((n,i)=>{var o,a;return o=A(e,t,r),a=i,(o.rawAttributes||[]).includes(a)?n[i]=void 0!==s[i]?.raw?s[i]?.raw:s[i]:n[i]=s[i],n}),{})}),((e,t,r,n,s)=>{const i=s?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData?.items[i]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[i]?.[n]]}));function U(e,t,r,n){return(0,h.A)(t,r,"hasEntityRecords"),Array.isArray(x(e,t,r,n))}const x=(e,t,r,n)=>{(0,h.A)(t,r,"getEntityRecords");const s=e.entities.records?.[t]?.[r]?.queriedData;return s?f(s,n):null},L=(e,t,r,n)=>{(0,h.A)(t,r,"getEntityRecordsTotalItems");const s=e.entities.records?.[t]?.[r]?.queriedData;return s?E(s,n):null},j=(e,t,r,n)=>{(0,h.A)(t,r,"getEntityRecordsTotalPages");const s=e.entities.records?.[t]?.[r]?.queriedData;if(!s)return null;if(-1===n?.per_page)return 1;const i=E(s,n);return i?n?.per_page?Math.ceil(i/n.per_page):function(e,t={}){const{stableKey:r,context:n}=(0,u.A)(t);return e.queries?.[n]?.[r]?.meta?.totalPages??null}(s,n):i},D=(0,n.createSelector)((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].edits).filter((t=>k(e,n,s,t)&&q(e,n,s,t)));if(i.length){const t=A(e,n,s);i.forEach((i=>{const o=G(e,n,s,i);r.push({key:o?o[t.key||y.C_]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records])),M=(0,n.createSelector)((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].saving).filter((t=>B(e,n,s,t)));if(i.length){const t=A(e,n,s);i.forEach((i=>{const o=G(e,n,s,i);r.push({key:o?o[t.key||y.C_]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records]));function N(e,t,r,n){return(0,h.A)(t,r,"getEntityRecordEdits"),e.entities.records?.[t]?.[r]?.edits?.[n]}const V=(0,n.createSelector)(((e,t,r,n)=>{(0,h.A)(t,r,"getEntityRecordNonTransientEdits");const{transientEdits:s}=A(e,t,r)||{},i=N(e,t,r,n)||{};return s?Object.keys(i).reduce(((e,t)=>(s[t]||(e[t]=i[t]),e)),{}):i}),((e,t,r,n)=>[e.entities.config,e.entities.records?.[t]?.[r]?.edits?.[n]]));function q(e,t,r,n){return(0,h.A)(t,r,"hasEditsForEntityRecord"),B(e,t,r,n)||Object.keys(V(e,t,r,n)).length>0}const G=(0,n.createSelector)(((e,t,r,n)=>{(0,h.A)(t,r,"getEditedEntityRecord");const s=P(e,t,r,n),i=N(e,t,r,n);return!(!s&&!i)&&{...s,...i}}),((e,t,r,n,s)=>{const i=s?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData.items[i]?.[n],e.entities.records?.[t]?.[r]?.queriedData.itemIsComplete[i]?.[n],e.entities.records?.[t]?.[r]?.edits?.[n]]}));function $(e,t,r,n){(0,h.A)(t,r,"isAutosavingEntityRecord");const{pending:s,isAutosave:i}=e.entities.records?.[t]?.[r]?.saving?.[n]??{};return Boolean(s&&i)}function B(e,t,r,n){return(0,h.A)(t,r,"isSavingEntityRecord"),e.entities.records?.[t]?.[r]?.saving?.[n]?.pending??!1}function F(e,t,r,n){return(0,h.A)(t,r,"isDeletingEntityRecord"),e.entities.records?.[t]?.[r]?.deleting?.[n]?.pending??!1}function Y(e,t,r,n){return(0,h.A)(t,r,"getLastEntitySaveError"),e.entities.records?.[t]?.[r]?.saving?.[n]?.error}function K(e,t,r,n){return(0,h.A)(t,r,"getLastEntityDeleteError"),e.entities.records?.[t]?.[r]?.deleting?.[n]?.error}function Q(e){o()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function H(e){o()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function z(e){return e.undoManager.hasUndo()}function W(e){return e.undoManager.hasRedo()}function Z(e){return e.currentTheme?k(e,"root","theme",e.currentTheme):null}function J(e){return e.currentGlobalStylesId}function X(e){return Z(e)?.theme_supports??v}function ee(e,t){return e.embedPreviews[t]}function te(e,t){const r=e.embedPreviews[t],n='<a href="'+t+'">'+t+"</a>";return!!r&&r.html===n}function re(e,t,r,n){const s="object"==typeof r;if(s&&(!r.kind||!r.name))return!1;s&&(0,h.A)(r.kind,r.name,"canUser");const i=(0,m.kC)(t,r,n);return e.userPermissions[i]}function ne(e,t,r,n){return o()("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),re(e,"update",{kind:t,name:r,id:n})}function se(e,t,r){return e.autosaves[r]}function ie(e,t,r,n){if(void 0===n)return;const s=e.autosaves[r];return s?.find((e=>e.author===n))}const oe=(0,n.createRegistrySelector)((e=>(t,r,n)=>e(a.E).hasFinishedResolution("getAutosaves",[r,n])));function ae(e){return e.editsReference}function ce(e){const t=Z(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function le(e){const t=Z(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function ue(e){return e.blockPatterns}function de(e){return e.blockPatternCategories}function pe(e){return e.userPatternCategories}function fe(e){o()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=J(e);return t?e.themeGlobalStyleRevisions[t]:null}function Ee(e,t){return e.defaultTemplates[JSON.stringify(t)]}const ye=(e,t,r,n,s)=>{(0,h.A)(t,r,"getRevisions");const i=e.entities.records?.[t]?.[r]?.revisions?.[n];return i?f(i,s):null},ge=(0,n.createSelector)(((e,t,r,n,s,i)=>{(0,h.A)(t,r,"getRevision");const o=e.entities.records?.[t]?.[r]?.revisions?.[n];if(!o)return;const a=i?.context??"default";if(!i||!i._fields){if(!o.itemIsComplete[a]?.[s])return;return o.items[a][s]}const c=o.items[a]?.[s];if(!c)return c;const l={},u=(0,g.A)(i._fields)??[];for(let e=0;e<u.length;e++){const t=u[e].split(".");let r=c;t.forEach((e=>{r=r?.[e]})),(0,d.A)(l,t,r)}return l}),((e,t,r,n,s,i)=>{const o=i?.context??"default",a=e.entities.records?.[t]?.[r]?.revisions?.[n];return[a?.items?.[o]?.[s],a?.itemIsComplete?.[o]?.[s]]}))},8537:e=>{"use strict";e.exports=window.wp.htmlEntities},8582:(e,t,r)=>{"use strict";r.d(t,{A:()=>{},B:()=>{}})},8741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getBlockPatternsForPostType:()=>u,getEntityRecordPermissions:()=>p,getEntityRecordsPermissions:()=>d,getHomePage:()=>y,getNavigationFallbackId:()=>l,getPostsPageId:()=>g,getRegisteredPostMeta:()=>f,getTemplateId:()=>m,getUndoManager:()=>c});var n=r(7143),s=r(8368),i=r(2278),o=r(6378),a=r(9410);function c(e){return e.undoManager}function l(e){return e.navigationFallbackId}const u=(0,n.createRegistrySelector)((e=>(0,n.createSelector)(((t,r)=>e(i.E).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(r)))),(()=>[e(i.E).getBlockPatterns()])))),d=(0,n.createRegistrySelector)((e=>(0,n.createSelector)(((t,r,n,s)=>(Array.isArray(s)?s:[s]).map((t=>({delete:e(i.E).canUser("delete",{kind:r,name:n,id:t}),update:e(i.E).canUser("update",{kind:r,name:n,id:t})})))),(e=>[e.userPermissions]))));function p(e,t,r,n){return(0,a.A)(t,r,"getEntityRecordPermissions"),d(e,t,r,n)[0]}function f(e,t){return e.registeredPostMeta?.[t]??{}}function E(e){return e&&["number","string"].includes(typeof e)?0===Number(e)?null:e.toString():null}const y=(0,n.createRegistrySelector)((e=>(0,n.createSelector)((()=>{const t=e(i.E).getEntityRecord("root","__unstableBase");if(!t)return null;const r="page"===t?.show_on_front?E(t.page_on_front):null;if(r)return{postType:"page",postId:r};const n=e(i.E).getDefaultTemplateId({slug:"front-page"});return n?{postType:"wp_template",postId:n}:null}),(e=>[(0,s.getEntityRecord)(e,"root","__unstableBase"),(0,s.getDefaultTemplateId)(e,{slug:"front-page"})])))),g=(0,n.createRegistrySelector)((e=>()=>{const t=e(i.E).getEntityRecord("root","__unstableBase");return"page"===t?.show_on_front?E(t.page_for_posts):null})),m=(0,n.createRegistrySelector)((e=>(t,r,n)=>{const s=(0,o.T)(e(i.E)).getHomePage();if(!s)return;if("page"===r&&r===s?.postType&&n.toString()===s?.postId){const t=e(i.E).getEntityRecords("postType","wp_template",{per_page:-1});if(!t)return;const r=t.find((({slug:e})=>"front-page"===e))?.id;if(r)return r}const a=e(i.E).getEditedEntityRecord("postType",r,n);if(!a)return;const c=(0,o.T)(e(i.E)).getPostsPageId();if("page"===r&&c===n.toString())return e(i.E).getDefaultTemplateId({slug:"home"});const l=a.template;if(l){const t=e(i.E).getEntityRecords("postType","wp_template",{per_page:-1})?.find((({slug:e})=>e===l));if(t)return t.id}let u;return u=a.slug?"page"===r?`${r}-${a.slug}`:`single-${r}-${a.slug}`:"page"===r?"page":`single-${r}`,e(i.E).getDefaultTemplateId({slug:u})}))},8843:(e,t,r)=>{"use strict";r.d(t,{D:()=>s});var n=r(6087);const s=(0,n.createContext)({});s.displayName="EntityContext"},9410:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(4040),s=r.n(n),i=r(5914);let o=!1;function a(e,t,r,{alternativeFunctionName:n,isShorthandSelector:a=!1}={}){const c=i.TK[e]?.[t];if(c){if(!o){const{alternative:i}=c,o=a?`'${r}'`:`The '${e}', '${t}' entity (used via '${r}')`;let l=`the '${i.kind}', '${i.name}' entity`;n&&(l+=` via the '${n}' function`),s()(o,{...c,alternative:l})}o=!0,setTimeout((()=>{o=!1}),0)}}},9424:(e,t,r)=>{"use strict";r.r(t),r.d(t,{editMediaEntity:()=>a,receiveRegisteredPostMeta:()=>o});var n=r(1455),s=r.n(n),i=r(2278);function o(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}const a=(e,t={},{__unstableFetch:r=s(),throwOnError:n=!1}={})=>async({dispatch:s,resolveSelect:o})=>{if(!e)return;const a="postType",c="attachment",l=(await o.getEntitiesConfig(a)).find((e=>e.kind===a&&e.name===c));if(!l)return;const u=await s.__unstableAcquireStoreLock(i.E,["entities","records",a,c,e],{exclusive:!0});let d,p,f=!1;try{s({type:"SAVE_ENTITY_RECORD_START",kind:a,name:c,recordId:e});try{const n=`${l.baseURL}/${e}/edit`,i=await r({path:n,method:"POST",data:{...t}});i&&(s.receiveEntityRecords(a,c,[i],void 0,!0,void 0,void 0),d=i)}catch(e){p=e,f=!0}if(s({type:"SAVE_ENTITY_RECORD_FINISH",kind:a,name:c,recordId:e,error:p}),f&&n)throw p;return d}finally{s.__unstableReleaseStoreLock(u)}}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(4565);(window.wp=window.wp||{}).coreData=n})();
// source --> https://www.leclubbbq.nl/wp-includes/js/dist/latex-to-mathml.min.js?ver=960cef31b586960935b4 
/*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>mn});class r{constructor(e,t){let n,o=" "+e;const a=t&&t.loc;if(a&&a.start<=a.end){const e=a.lexer.input;n=a.start;const t=a.end;n===e.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";const r=e.slice(n,t).replace(/[^]/g,"$&̲");let s,i;s=n>15?"…"+e.slice(n-15,n):e.slice(0,n),i=t+15<e.length?e.slice(t,t+15)+"…":e.slice(t),o+=s+r+i}const s=new Error(o);return s.name="ParseError",s.__proto__=r.prototype,s.position=n,s}}r.prototype.__proto__=Error.prototype;const n=/([A-Z])/g,o={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},a=/[&><"']/g;const s=function(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?s(e.body[0]):e:"font"===e.type?s(e.body):e};var i={deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(a,(e=>o[e]))},hyphenate:function(e){return e.replace(n,"-$1").toLowerCase()},getBaseElem:s,isCharacterBox:function(e){const t=s(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){const t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"},round:function(e){return+e.toFixed(4)}};class l{constructor(e){e=e||{},this.displayMode=i.deflt(e.displayMode,!1),this.annotate=i.deflt(e.annotate,!1),this.leqno=i.deflt(e.leqno,!1),this.throwOnError=i.deflt(e.throwOnError,!1),this.errorColor=i.deflt(e.errorColor,"#b22222"),this.macros=e.macros||{},this.wrap=i.deflt(e.wrap,"tex"),this.xml=i.deflt(e.xml,!1),this.colorIsTextColor=i.deflt(e.colorIsTextColor,!1),this.strict=i.deflt(e.strict,!1),this.trust=i.deflt(e.trust,!1),this.maxSize=void 0===e.maxSize?[1/0,1/0]:Array.isArray(e.maxSize)?e.maxSize:[1/0,1/0],this.maxExpand=Math.max(0,i.deflt(e.maxExpand,1e3))}isTrusted(e){if(e.url&&!e.protocol){const t=i.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}const t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}const c={},u={};function p({type:e,names:t,props:r,handler:n,mathmlBuilder:o}){const a={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:n};for(let e=0;e<t.length;++e)c[t[e]]=a;e&&o&&(u[e]=o)}function m({type:e,mathmlBuilder:t}){p({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},mathmlBuilder:t})}const d=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},h=function(e){return"ordgroup"===e.type?e.body:[e]};class g{constructor(e){this.children=e,this.classes=[],this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createDocumentFragment();for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e="";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}const f=function(e){return e.filter((e=>e)).join(" ")},b=function(e,t){this.classes=e||[],this.attributes={},this.style=t||{}},x=function(e){const t=document.createElement(e);t.className=f(this.classes);for(const e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t.style[e]=this.style[e]);for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t},y=function(e){let t=`<${e}`;this.classes.length&&(t+=` class="${i.escape(f(this.classes))}"`);let r="";for(const e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(r+=`${i.hyphenate(e)}:${this.style[e]};`);r&&(t+=` style="${r}"`);for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=` ${e}="${i.escape(this.attributes[e])}"`);t+=">";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+=`</${e}>`,t};class w{constructor(e,t,r){b.call(this,e,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}toNode(){return x.call(this,"span")}toMarkup(){return y.call(this,"span")}}let v=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return i.escape(this.text)}};class k{constructor(e,t,r){this.href=e,this.classes=t,this.children=r||[]}toNode(){const e=document.createElement("a");e.setAttribute("href",this.href),this.classes.length>0&&(e.className=f(this.classes));for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e=`<a href='${i.escape(this.href)}'`;this.classes.length>0&&(e+=` class="${i.escape(f(this.classes))}"`),e+=">";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+="</a>",e}}class A{constructor(e,t,r){this.alt=t,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(const t in this.style)Object.prototype.hasOwnProperty.call(this.style,t)&&(e.style[t]=this.style[t]);return e}toMarkup(){let e=`<img src='${this.src}' alt='${this.alt}'`,t="";for(const e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t+=`${i.hyphenate(e)}:${this.style[e]};`);return t&&(e+=` style="${i.escape(t)}"`),e+=">",e}}class q{constructor(e,t,r,n){this.type=e,this.attributes={},this.children=t||[],this.classes=r||[],this.style=n||{},this.label=""}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}setLabel(e){this.label=e}toNode(){const e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=f(this.classes));for(const t in this.style)Object.prototype.hasOwnProperty.call(this.style,t)&&(e.style[t]=this.style[t]);for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e="<"+this.type;for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=i.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=` class="${i.escape(f(this.classes))}"`);let t="";for(const e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t+=`${i.hyphenate(e)}:${this.style[e]};`);t&&(e+=` style="${t}"`),e+=">";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map((e=>e.toText())).join("")}}class _{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return i.escape(this.toText())}toText(){return this.text}}const S=e=>{let t;return 1===e.length&&"mrow"===e[0].type?(t=e.pop(),t.type="mstyle"):t=new q("mstyle",e),t};var T={MathNode:q,TextNode:_,newDocumentFragment:function(e){return new g(e)}};const N=e=>{let t=0;if(e.body)for(const r of e.body)t+=N(r);else if("supsub"===e.type)t+=N(e.base),e.sub&&(t+=.7*N(e.sub)),e.sup&&(t+=.7*N(e.sup));else if("mathord"===e.type||"textord"===e.type)for(const r of e.text.split("")){const e=r.codePointAt(0);t+=96<e&&e<123||944<e&&e<970?.56:47<e&&e<58?.5:.92}else t+=1;return t},O={widehat:"^",widecheck:"ˇ",widetilde:"~",wideparen:"⏜",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",overparen:"⏜",undergroup:"⏡",underparen:"⏝",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xrightleftarrows:"⇄",yields:"→",yieldsLeft:"←",mesomerism:"↔",longrightharpoonup:"⇀",longleftharpoondown:"↽",eqrightharpoonup:"⇀",eqleftharpoondown:"↽","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},$=function(e){const t=new T.TextNode(O[e.slice(1)]),r=new T.MathNode("mo",[t]);return r.setAttribute("stretchy","true"),r},M=["\\widetilde","\\widehat","\\widecheck","\\utilde"];var B=$,C=e=>{const t=$(e.label);if(M.includes(e.label)){const r=N(e.base);1<r&&r<1.6?t.classes.push("tml-crooked-2"):1.6<=r&&r<2.5?t.classes.push("tml-crooked-3"):2.5<=r&&t.classes.push("tml-crooked-4")}return t};const z={bin:1,close:1,inner:1,open:1,punct:1,rel:1},L={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},I={math:{},text:{}};function D(e,t,r,n,o){I[e][n]={group:t,replace:r},o&&r&&(I[e][r]=I[e][n])}const E="math",F="text",G="accent-token",P="bin",R="close",j="inner",U="mathord",V="op-token",Z="open",H="punct",W="rel",X="spacing",K="textord";D(E,W,"≡","\\equiv",!0),D(E,W,"≺","\\prec",!0),D(E,W,"≻","\\succ",!0),D(E,W,"∼","\\sim",!0),D(E,W,"⟂","\\perp",!0),D(E,W,"⪯","\\preceq",!0),D(E,W,"⪰","\\succeq",!0),D(E,W,"≃","\\simeq",!0),D(E,W,"≌","\\backcong",!0),D(E,W,"|","\\mid",!0),D(E,W,"≪","\\ll",!0),D(E,W,"≫","\\gg",!0),D(E,W,"≍","\\asymp",!0),D(E,W,"∥","\\parallel"),D(E,W,"⌣","\\smile",!0),D(E,W,"⊑","\\sqsubseteq",!0),D(E,W,"⊒","\\sqsupseteq",!0),D(E,W,"≐","\\doteq",!0),D(E,W,"⌢","\\frown",!0),D(E,W,"∋","\\ni",!0),D(E,W,"∌","\\notni",!0),D(E,W,"∝","\\propto",!0),D(E,W,"⊢","\\vdash",!0),D(E,W,"⊣","\\dashv",!0),D(E,W,"∋","\\owns"),D(E,W,"≘","\\arceq",!0),D(E,W,"≙","\\wedgeq",!0),D(E,W,"≚","\\veeeq",!0),D(E,W,"≛","\\stareq",!0),D(E,W,"≝","\\eqdef",!0),D(E,W,"≞","\\measeq",!0),D(E,W,"≟","\\questeq",!0),D(E,W,"≠","\\ne",!0),D(E,W,"≠","\\neq"),D(E,W,"⩵","\\eqeq",!0),D(E,W,"⩶","\\eqeqeq",!0),D(E,W,"∷","\\dblcolon",!0),D(E,W,"≔","\\coloneqq",!0),D(E,W,"≕","\\eqqcolon",!0),D(E,W,"∹","\\eqcolon",!0),D(E,W,"⩴","\\Coloneqq",!0),D(E,H,".","\\ldotp"),D(E,H,"·","\\cdotp"),D(E,K,"#","\\#"),D(F,K,"#","\\#"),D(E,K,"&","\\&"),D(F,K,"&","\\&"),D(E,K,"ℵ","\\aleph",!0),D(E,K,"∀","\\forall",!0),D(E,K,"ℏ","\\hbar",!0),D(E,K,"∃","\\exists",!0),D(E,P,"∇","\\nabla",!0),D(E,K,"♭","\\flat",!0),D(E,K,"ℓ","\\ell",!0),D(E,K,"♮","\\natural",!0),D(E,K,"Å","\\Angstrom",!0),D(F,K,"Å","\\Angstrom",!0),D(E,K,"♣","\\clubsuit",!0),D(E,K,"♧","\\varclubsuit",!0),D(E,K,"℘","\\wp",!0),D(E,K,"♯","\\sharp",!0),D(E,K,"♢","\\diamondsuit",!0),D(E,K,"♦","\\vardiamondsuit",!0),D(E,K,"ℜ","\\Re",!0),D(E,K,"♡","\\heartsuit",!0),D(E,K,"♥","\\varheartsuit",!0),D(E,K,"ℑ","\\Im",!0),D(E,K,"♠","\\spadesuit",!0),D(E,K,"♤","\\varspadesuit",!0),D(E,K,"♀","\\female",!0),D(E,K,"♂","\\male",!0),D(E,K,"§","\\S",!0),D(F,K,"§","\\S"),D(E,K,"¶","\\P",!0),D(F,K,"¶","\\P"),D(F,K,"☺","\\smiley",!0),D(E,K,"☺","\\smiley",!0),D(E,K,"†","\\dag"),D(F,K,"†","\\dag"),D(F,K,"†","\\textdagger"),D(E,K,"‡","\\ddag"),D(F,K,"‡","\\ddag"),D(F,K,"‡","\\textdaggerdbl"),D(E,R,"⎱","\\rmoustache",!0),D(E,Z,"⎰","\\lmoustache",!0),D(E,R,"⟯","\\rgroup",!0),D(E,Z,"⟮","\\lgroup",!0),D(E,P,"∓","\\mp",!0),D(E,P,"⊖","\\ominus",!0),D(E,P,"⊎","\\uplus",!0),D(E,P,"⊓","\\sqcap",!0),D(E,P,"∗","\\ast"),D(E,P,"⊔","\\sqcup",!0),D(E,P,"◯","\\bigcirc",!0),D(E,P,"∙","\\bullet",!0),D(E,P,"‡","\\ddagger"),D(E,P,"≀","\\wr",!0),D(E,P,"⨿","\\amalg"),D(E,P,"&","\\And"),D(E,P,"⫽","\\sslash",!0),D(E,W,"⟵","\\longleftarrow",!0),D(E,W,"⇐","\\Leftarrow",!0),D(E,W,"⟸","\\Longleftarrow",!0),D(E,W,"⟶","\\longrightarrow",!0),D(E,W,"⇒","\\Rightarrow",!0),D(E,W,"⟹","\\Longrightarrow",!0),D(E,W,"↔","\\leftrightarrow",!0),D(E,W,"⟷","\\longleftrightarrow",!0),D(E,W,"⇔","\\Leftrightarrow",!0),D(E,W,"⟺","\\Longleftrightarrow",!0),D(E,W,"↤","\\mapsfrom",!0),D(E,W,"↦","\\mapsto",!0),D(E,W,"⟼","\\longmapsto",!0),D(E,W,"↗","\\nearrow",!0),D(E,W,"↩","\\hookleftarrow",!0),D(E,W,"↪","\\hookrightarrow",!0),D(E,W,"↘","\\searrow",!0),D(E,W,"↼","\\leftharpoonup",!0),D(E,W,"⇀","\\rightharpoonup",!0),D(E,W,"↙","\\swarrow",!0),D(E,W,"↽","\\leftharpoondown",!0),D(E,W,"⇁","\\rightharpoondown",!0),D(E,W,"↖","\\nwarrow",!0),D(E,W,"⇌","\\rightleftharpoons",!0),D(E,U,"↯","\\lightning",!0),D(E,U,"∎","\\QED",!0),D(E,U,"‰","\\permil",!0),D(F,K,"‰","\\permil"),D(E,U,"☉","\\astrosun",!0),D(E,U,"☼","\\sun",!0),D(E,U,"☾","\\leftmoon",!0),D(E,U,"☽","\\rightmoon",!0),D(E,U,"⊕","\\Earth"),D(E,W,"≮","\\nless",!0),D(E,W,"⪇","\\lneq",!0),D(E,W,"≨","\\lneqq",!0),D(E,W,"≨︀","\\lvertneqq"),D(E,W,"⋦","\\lnsim",!0),D(E,W,"⪉","\\lnapprox",!0),D(E,W,"⊀","\\nprec",!0),D(E,W,"⋠","\\npreceq",!0),D(E,W,"⋨","\\precnsim",!0),D(E,W,"⪹","\\precnapprox",!0),D(E,W,"≁","\\nsim",!0),D(E,W,"∤","\\nmid",!0),D(E,W,"∤","\\nshortmid"),D(E,W,"⊬","\\nvdash",!0),D(E,W,"⊭","\\nvDash",!0),D(E,W,"⋪","\\ntriangleleft"),D(E,W,"⋬","\\ntrianglelefteq",!0),D(E,W,"⊄","\\nsubset",!0),D(E,W,"⊅","\\nsupset",!0),D(E,W,"⊊","\\subsetneq",!0),D(E,W,"⊊︀","\\varsubsetneq"),D(E,W,"⫋","\\subsetneqq",!0),D(E,W,"⫋︀","\\varsubsetneqq"),D(E,W,"≯","\\ngtr",!0),D(E,W,"⪈","\\gneq",!0),D(E,W,"≩","\\gneqq",!0),D(E,W,"≩︀","\\gvertneqq"),D(E,W,"⋧","\\gnsim",!0),D(E,W,"⪊","\\gnapprox",!0),D(E,W,"⊁","\\nsucc",!0),D(E,W,"⋡","\\nsucceq",!0),D(E,W,"⋩","\\succnsim",!0),D(E,W,"⪺","\\succnapprox",!0),D(E,W,"≆","\\ncong",!0),D(E,W,"∦","\\nparallel",!0),D(E,W,"∦","\\nshortparallel"),D(E,W,"⊯","\\nVDash",!0),D(E,W,"⋫","\\ntriangleright"),D(E,W,"⋭","\\ntrianglerighteq",!0),D(E,W,"⊋","\\supsetneq",!0),D(E,W,"⊋","\\varsupsetneq"),D(E,W,"⫌","\\supsetneqq",!0),D(E,W,"⫌︀","\\varsupsetneqq"),D(E,W,"⊮","\\nVdash",!0),D(E,W,"⪵","\\precneqq",!0),D(E,W,"⪶","\\succneqq",!0),D(E,P,"⊴","\\unlhd"),D(E,P,"⊵","\\unrhd"),D(E,W,"↚","\\nleftarrow",!0),D(E,W,"↛","\\nrightarrow",!0),D(E,W,"⇍","\\nLeftarrow",!0),D(E,W,"⇏","\\nRightarrow",!0),D(E,W,"↮","\\nleftrightarrow",!0),D(E,W,"⇎","\\nLeftrightarrow",!0),D(E,W,"△","\\vartriangle"),D(E,K,"ℏ","\\hslash"),D(E,K,"▽","\\triangledown"),D(E,K,"◊","\\lozenge"),D(E,K,"Ⓢ","\\circledS"),D(E,K,"®","\\circledR",!0),D(F,K,"®","\\circledR"),D(F,K,"®","\\textregistered"),D(E,K,"∡","\\measuredangle",!0),D(E,K,"∄","\\nexists"),D(E,K,"℧","\\mho"),D(E,K,"Ⅎ","\\Finv",!0),D(E,K,"⅁","\\Game",!0),D(E,K,"‵","\\backprime"),D(E,K,"‶","\\backdprime"),D(E,K,"‷","\\backtrprime"),D(E,K,"▲","\\blacktriangle"),D(E,K,"▼","\\blacktriangledown"),D(E,K,"■","\\blacksquare"),D(E,K,"⧫","\\blacklozenge"),D(E,K,"★","\\bigstar"),D(E,K,"∢","\\sphericalangle",!0),D(E,K,"∁","\\complement",!0),D(E,K,"ð","\\eth",!0),D(F,K,"ð","ð"),D(E,K,"╱","\\diagup"),D(E,K,"╲","\\diagdown"),D(E,K,"□","\\square"),D(E,K,"□","\\Box"),D(E,K,"◊","\\Diamond"),D(E,K,"¥","\\yen",!0),D(F,K,"¥","\\yen",!0),D(E,K,"✓","\\checkmark",!0),D(F,K,"✓","\\checkmark"),D(E,K,"✗","\\ballotx",!0),D(F,K,"✗","\\ballotx"),D(F,K,"•","\\textbullet"),D(E,K,"ℶ","\\beth",!0),D(E,K,"ℸ","\\daleth",!0),D(E,K,"ℷ","\\gimel",!0),D(E,K,"ϝ","\\digamma",!0),D(E,K,"ϰ","\\varkappa"),D(E,Z,"⌜","\\ulcorner",!0),D(E,R,"⌝","\\urcorner",!0),D(E,Z,"⌞","\\llcorner",!0),D(E,R,"⌟","\\lrcorner",!0),D(E,W,"≦","\\leqq",!0),D(E,W,"⩽","\\leqslant",!0),D(E,W,"⪕","\\eqslantless",!0),D(E,W,"≲","\\lesssim",!0),D(E,W,"⪅","\\lessapprox",!0),D(E,W,"≊","\\approxeq",!0),D(E,P,"⋖","\\lessdot"),D(E,W,"⋘","\\lll",!0),D(E,W,"≶","\\lessgtr",!0),D(E,W,"⋚","\\lesseqgtr",!0),D(E,W,"⪋","\\lesseqqgtr",!0),D(E,W,"≑","\\doteqdot"),D(E,W,"≓","\\risingdotseq",!0),D(E,W,"≒","\\fallingdotseq",!0),D(E,W,"∽","\\backsim",!0),D(E,W,"⋍","\\backsimeq",!0),D(E,W,"⫅","\\subseteqq",!0),D(E,W,"⋐","\\Subset",!0),D(E,W,"⊏","\\sqsubset",!0),D(E,W,"≼","\\preccurlyeq",!0),D(E,W,"⋞","\\curlyeqprec",!0),D(E,W,"≾","\\precsim",!0),D(E,W,"⪷","\\precapprox",!0),D(E,W,"⊲","\\vartriangleleft"),D(E,W,"⊴","\\trianglelefteq"),D(E,W,"⊨","\\vDash",!0),D(E,W,"⊫","\\VDash",!0),D(E,W,"⊪","\\Vvdash",!0),D(E,W,"⌣","\\smallsmile"),D(E,W,"⌢","\\smallfrown"),D(E,W,"≏","\\bumpeq",!0),D(E,W,"≎","\\Bumpeq",!0),D(E,W,"≧","\\geqq",!0),D(E,W,"⩾","\\geqslant",!0),D(E,W,"⪖","\\eqslantgtr",!0),D(E,W,"≳","\\gtrsim",!0),D(E,W,"⪆","\\gtrapprox",!0),D(E,P,"⋗","\\gtrdot"),D(E,W,"⋙","\\ggg",!0),D(E,W,"≷","\\gtrless",!0),D(E,W,"⋛","\\gtreqless",!0),D(E,W,"⪌","\\gtreqqless",!0),D(E,W,"≖","\\eqcirc",!0),D(E,W,"≗","\\circeq",!0),D(E,W,"≜","\\triangleq",!0),D(E,W,"∼","\\thicksim"),D(E,W,"≈","\\thickapprox"),D(E,W,"⫆","\\supseteqq",!0),D(E,W,"⋑","\\Supset",!0),D(E,W,"⊐","\\sqsupset",!0),D(E,W,"≽","\\succcurlyeq",!0),D(E,W,"⋟","\\curlyeqsucc",!0),D(E,W,"≿","\\succsim",!0),D(E,W,"⪸","\\succapprox",!0),D(E,W,"⊳","\\vartriangleright"),D(E,W,"⊵","\\trianglerighteq"),D(E,W,"⊩","\\Vdash",!0),D(E,W,"∣","\\shortmid"),D(E,W,"∥","\\shortparallel"),D(E,W,"≬","\\between",!0),D(E,W,"⋔","\\pitchfork",!0),D(E,W,"∝","\\varpropto"),D(E,W,"◀","\\blacktriangleleft"),D(E,W,"∴","\\therefore",!0),D(E,W,"∍","\\backepsilon"),D(E,W,"▶","\\blacktriangleright"),D(E,W,"∵","\\because",!0),D(E,W,"⋘","\\llless"),D(E,W,"⋙","\\gggtr"),D(E,P,"⊲","\\lhd"),D(E,P,"⊳","\\rhd"),D(E,W,"≂","\\eqsim",!0),D(E,W,"≑","\\Doteq",!0),D(E,W,"⥽","\\strictif",!0),D(E,W,"⥼","\\strictfi",!0),D(E,P,"∔","\\dotplus",!0),D(E,P,"∖","\\smallsetminus"),D(E,P,"⋒","\\Cap",!0),D(E,P,"⋓","\\Cup",!0),D(E,P,"⩞","\\doublebarwedge",!0),D(E,P,"⊟","\\boxminus",!0),D(E,P,"⊞","\\boxplus",!0),D(E,P,"⧄","\\boxslash",!0),D(E,P,"⋇","\\divideontimes",!0),D(E,P,"⋉","\\ltimes",!0),D(E,P,"⋊","\\rtimes",!0),D(E,P,"⋋","\\leftthreetimes",!0),D(E,P,"⋌","\\rightthreetimes",!0),D(E,P,"⋏","\\curlywedge",!0),D(E,P,"⋎","\\curlyvee",!0),D(E,P,"⊝","\\circleddash",!0),D(E,P,"⊛","\\circledast",!0),D(E,P,"⊺","\\intercal",!0),D(E,P,"⋒","\\doublecap"),D(E,P,"⋓","\\doublecup"),D(E,P,"⊠","\\boxtimes",!0),D(E,P,"⋈","\\bowtie",!0),D(E,P,"⋈","\\Join"),D(E,P,"⟕","\\leftouterjoin",!0),D(E,P,"⟖","\\rightouterjoin",!0),D(E,P,"⟗","\\fullouterjoin",!0),D(E,P,"∸","\\dotminus",!0),D(E,P,"⟑","\\wedgedot",!0),D(E,P,"⟇","\\veedot",!0),D(E,P,"⩢","\\doublebarvee",!0),D(E,P,"⩣","\\veedoublebar",!0),D(E,P,"⩟","\\wedgebar",!0),D(E,P,"⩠","\\wedgedoublebar",!0),D(E,P,"⩔","\\Vee",!0),D(E,P,"⩓","\\Wedge",!0),D(E,P,"⩃","\\barcap",!0),D(E,P,"⩂","\\barcup",!0),D(E,P,"⩈","\\capbarcup",!0),D(E,P,"⩀","\\capdot",!0),D(E,P,"⩇","\\capovercup",!0),D(E,P,"⩆","\\cupovercap",!0),D(E,P,"⩍","\\closedvarcap",!0),D(E,P,"⩌","\\closedvarcup",!0),D(E,P,"⨪","\\minusdot",!0),D(E,P,"⨫","\\minusfdots",!0),D(E,P,"⨬","\\minusrdots",!0),D(E,P,"⊻","\\Xor",!0),D(E,P,"⊼","\\Nand",!0),D(E,P,"⊽","\\Nor",!0),D(E,P,"⊽","\\barvee"),D(E,P,"⫴","\\interleave",!0),D(E,P,"⧢","\\shuffle",!0),D(E,P,"⫶","\\threedotcolon",!0),D(E,P,"⦂","\\typecolon",!0),D(E,P,"∾","\\invlazys",!0),D(E,P,"⩋","\\twocaps",!0),D(E,P,"⩊","\\twocups",!0),D(E,P,"⩎","\\Sqcap",!0),D(E,P,"⩏","\\Sqcup",!0),D(E,P,"⩖","\\veeonvee",!0),D(E,P,"⩕","\\wedgeonwedge",!0),D(E,P,"⧗","\\blackhourglass",!0),D(E,P,"⧆","\\boxast",!0),D(E,P,"⧈","\\boxbox",!0),D(E,P,"⧇","\\boxcircle",!0),D(E,P,"⊜","\\circledequal",!0),D(E,P,"⦷","\\circledparallel",!0),D(E,P,"⦶","\\circledvert",!0),D(E,P,"⦵","\\circlehbar",!0),D(E,P,"⟡","\\concavediamond",!0),D(E,P,"⟢","\\concavediamondtickleft",!0),D(E,P,"⟣","\\concavediamondtickright",!0),D(E,P,"⋄","\\diamond",!0),D(E,P,"⧖","\\hourglass",!0),D(E,P,"⟠","\\lozengeminus",!0),D(E,P,"⌽","\\obar",!0),D(E,P,"⦸","\\obslash",!0),D(E,P,"⨸","\\odiv",!0),D(E,P,"⧁","\\ogreaterthan",!0),D(E,P,"⧀","\\olessthan",!0),D(E,P,"⦹","\\operp",!0),D(E,P,"⨷","\\Otimes",!0),D(E,P,"⨶","\\otimeshat",!0),D(E,P,"⋆","\\star",!0),D(E,P,"△","\\triangle",!0),D(E,P,"⨺","\\triangleminus",!0),D(E,P,"⨹","\\triangleplus",!0),D(E,P,"⨻","\\triangletimes",!0),D(E,P,"⟤","\\whitesquaretickleft",!0),D(E,P,"⟥","\\whitesquaretickright",!0),D(E,P,"⨳","\\smashtimes",!0),D(E,W,"⇢","\\dashrightarrow",!0),D(E,W,"⇠","\\dashleftarrow",!0),D(E,W,"⇇","\\leftleftarrows",!0),D(E,W,"⇆","\\leftrightarrows",!0),D(E,W,"⇚","\\Lleftarrow",!0),D(E,W,"↞","\\twoheadleftarrow",!0),D(E,W,"↢","\\leftarrowtail",!0),D(E,W,"↫","\\looparrowleft",!0),D(E,W,"⇋","\\leftrightharpoons",!0),D(E,W,"↶","\\curvearrowleft",!0),D(E,W,"↺","\\circlearrowleft",!0),D(E,W,"↰","\\Lsh",!0),D(E,W,"⇈","\\upuparrows",!0),D(E,W,"↿","\\upharpoonleft",!0),D(E,W,"⇃","\\downharpoonleft",!0),D(E,W,"⊶","\\origof",!0),D(E,W,"⊷","\\imageof",!0),D(E,W,"⊸","\\multimap",!0),D(E,W,"↭","\\leftrightsquigarrow",!0),D(E,W,"⇉","\\rightrightarrows",!0),D(E,W,"⇄","\\rightleftarrows",!0),D(E,W,"↠","\\twoheadrightarrow",!0),D(E,W,"↣","\\rightarrowtail",!0),D(E,W,"↬","\\looparrowright",!0),D(E,W,"↷","\\curvearrowright",!0),D(E,W,"↻","\\circlearrowright",!0),D(E,W,"↱","\\Rsh",!0),D(E,W,"⇊","\\downdownarrows",!0),D(E,W,"↾","\\upharpoonright",!0),D(E,W,"⇂","\\downharpoonright",!0),D(E,W,"⇝","\\rightsquigarrow",!0),D(E,W,"⇝","\\leadsto"),D(E,W,"⇛","\\Rrightarrow",!0),D(E,W,"↾","\\restriction"),D(E,K,"‘","`"),D(E,K,"$","\\$"),D(F,K,"$","\\$"),D(F,K,"$","\\textdollar"),D(E,K,"¢","\\cent"),D(F,K,"¢","\\cent"),D(E,K,"%","\\%"),D(F,K,"%","\\%"),D(E,K,"_","\\_"),D(F,K,"_","\\_"),D(F,K,"_","\\textunderscore"),D(F,K,"␣","\\textvisiblespace",!0),D(E,K,"∠","\\angle",!0),D(E,K,"∞","\\infty",!0),D(E,K,"′","\\prime"),D(E,K,"″","\\dprime"),D(E,K,"‴","\\trprime"),D(E,K,"⁗","\\qprime"),D(E,K,"△","\\triangle"),D(F,K,"Α","\\Alpha",!0),D(F,K,"Β","\\Beta",!0),D(F,K,"Γ","\\Gamma",!0),D(F,K,"Δ","\\Delta",!0),D(F,K,"Ε","\\Epsilon",!0),D(F,K,"Ζ","\\Zeta",!0),D(F,K,"Η","\\Eta",!0),D(F,K,"Θ","\\Theta",!0),D(F,K,"Ι","\\Iota",!0),D(F,K,"Κ","\\Kappa",!0),D(F,K,"Λ","\\Lambda",!0),D(F,K,"Μ","\\Mu",!0),D(F,K,"Ν","\\Nu",!0),D(F,K,"Ξ","\\Xi",!0),D(F,K,"Ο","\\Omicron",!0),D(F,K,"Π","\\Pi",!0),D(F,K,"Ρ","\\Rho",!0),D(F,K,"Σ","\\Sigma",!0),D(F,K,"Τ","\\Tau",!0),D(F,K,"Υ","\\Upsilon",!0),D(F,K,"Φ","\\Phi",!0),D(F,K,"Χ","\\Chi",!0),D(F,K,"Ψ","\\Psi",!0),D(F,K,"Ω","\\Omega",!0),D(E,U,"Α","\\Alpha",!0),D(E,U,"Β","\\Beta",!0),D(E,U,"Γ","\\Gamma",!0),D(E,U,"Δ","\\Delta",!0),D(E,U,"Ε","\\Epsilon",!0),D(E,U,"Ζ","\\Zeta",!0),D(E,U,"Η","\\Eta",!0),D(E,U,"Θ","\\Theta",!0),D(E,U,"Ι","\\Iota",!0),D(E,U,"Κ","\\Kappa",!0),D(E,U,"Λ","\\Lambda",!0),D(E,U,"Μ","\\Mu",!0),D(E,U,"Ν","\\Nu",!0),D(E,U,"Ξ","\\Xi",!0),D(E,U,"Ο","\\Omicron",!0),D(E,U,"Π","\\Pi",!0),D(E,U,"Ρ","\\Rho",!0),D(E,U,"Σ","\\Sigma",!0),D(E,U,"Τ","\\Tau",!0),D(E,U,"Υ","\\Upsilon",!0),D(E,U,"Φ","\\Phi",!0),D(E,U,"Χ","\\Chi",!0),D(E,U,"Ψ","\\Psi",!0),D(E,U,"Ω","\\Omega",!0),D(E,Z,"¬","\\neg",!0),D(E,Z,"¬","\\lnot"),D(E,K,"⊤","\\top"),D(E,K,"⊥","\\bot"),D(E,K,"∅","\\emptyset"),D(E,K,"⌀","\\varnothing"),D(E,U,"α","\\alpha",!0),D(E,U,"β","\\beta",!0),D(E,U,"γ","\\gamma",!0),D(E,U,"δ","\\delta",!0),D(E,U,"ϵ","\\epsilon",!0),D(E,U,"ζ","\\zeta",!0),D(E,U,"η","\\eta",!0),D(E,U,"θ","\\theta",!0),D(E,U,"ι","\\iota",!0),D(E,U,"κ","\\kappa",!0),D(E,U,"λ","\\lambda",!0),D(E,U,"μ","\\mu",!0),D(E,U,"ν","\\nu",!0),D(E,U,"ξ","\\xi",!0),D(E,U,"ο","\\omicron",!0),D(E,U,"π","\\pi",!0),D(E,U,"ρ","\\rho",!0),D(E,U,"σ","\\sigma",!0),D(E,U,"τ","\\tau",!0),D(E,U,"υ","\\upsilon",!0),D(E,U,"ϕ","\\phi",!0),D(E,U,"χ","\\chi",!0),D(E,U,"ψ","\\psi",!0),D(E,U,"ω","\\omega",!0),D(E,U,"ε","\\varepsilon",!0),D(E,U,"ϑ","\\vartheta",!0),D(E,U,"ϖ","\\varpi",!0),D(E,U,"ϱ","\\varrho",!0),D(E,U,"ς","\\varsigma",!0),D(E,U,"φ","\\varphi",!0),D(E,U,"Ϙ","\\Coppa",!0),D(E,U,"ϙ","\\coppa",!0),D(E,U,"ϙ","\\varcoppa",!0),D(E,U,"Ϟ","\\Koppa",!0),D(E,U,"ϟ","\\koppa",!0),D(E,U,"Ϡ","\\Sampi",!0),D(E,U,"ϡ","\\sampi",!0),D(E,U,"Ϛ","\\Stigma",!0),D(E,U,"ϛ","\\stigma",!0),D(E,U,"⫫","\\Bot"),D(E,P,"∗","∗",!0),D(E,P,"+","+"),D(E,P,"∗","*"),D(E,P,"⁄","/",!0),D(E,P,"⁄","⁄"),D(E,P,"−","-",!0),D(E,P,"⋅","\\cdot",!0),D(E,P,"∘","\\circ",!0),D(E,P,"÷","\\div",!0),D(E,P,"±","\\pm",!0),D(E,P,"×","\\times",!0),D(E,P,"∩","\\cap",!0),D(E,P,"∪","\\cup",!0),D(E,P,"∖","\\setminus",!0),D(E,P,"∧","\\land"),D(E,P,"∨","\\lor"),D(E,P,"∧","\\wedge",!0),D(E,P,"∨","\\vee",!0),D(E,Z,"⟦","\\llbracket",!0),D(E,R,"⟧","\\rrbracket",!0),D(E,Z,"⟨","\\langle",!0),D(E,Z,"⟪","\\lAngle",!0),D(E,Z,"⦉","\\llangle",!0),D(E,Z,"|","\\lvert"),D(E,Z,"‖","\\lVert",!0),D(E,K,"!","\\oc"),D(E,K,"?","\\wn"),D(E,K,"↓","\\shpos"),D(E,K,"↕","\\shift"),D(E,K,"↑","\\shneg"),D(E,R,"?","?"),D(E,R,"!","!"),D(E,R,"‼","‼"),D(E,R,"⟩","\\rangle",!0),D(E,R,"⟫","\\rAngle",!0),D(E,R,"⦊","\\rrangle",!0),D(E,R,"|","\\rvert"),D(E,R,"‖","\\rVert"),D(E,Z,"⦃","\\lBrace",!0),D(E,R,"⦄","\\rBrace",!0),D(E,W,"=","\\equal",!0),D(E,W,":",":"),D(E,W,"≈","\\approx",!0),D(E,W,"≅","\\cong",!0),D(E,W,"≥","\\ge"),D(E,W,"≥","\\geq",!0),D(E,W,"←","\\gets"),D(E,W,">","\\gt",!0),D(E,W,"∈","\\in",!0),D(E,W,"∉","\\notin",!0),D(E,W,"","\\@not"),D(E,W,"⊂","\\subset",!0),D(E,W,"⊃","\\supset",!0),D(E,W,"⊆","\\subseteq",!0),D(E,W,"⊇","\\supseteq",!0),D(E,W,"⊈","\\nsubseteq",!0),D(E,W,"⊈","\\nsubseteqq"),D(E,W,"⊉","\\nsupseteq",!0),D(E,W,"⊉","\\nsupseteqq"),D(E,W,"⊨","\\models"),D(E,W,"←","\\leftarrow",!0),D(E,W,"≤","\\le"),D(E,W,"≤","\\leq",!0),D(E,W,"<","\\lt",!0),D(E,W,"→","\\rightarrow",!0),D(E,W,"→","\\to"),D(E,W,"≱","\\ngeq",!0),D(E,W,"≱","\\ngeqq"),D(E,W,"≱","\\ngeqslant"),D(E,W,"≰","\\nleq",!0),D(E,W,"≰","\\nleqq"),D(E,W,"≰","\\nleqslant"),D(E,W,"⫫","\\Perp",!0),D(E,X," ","\\ "),D(E,X," ","\\space"),D(E,X," ","\\nobreakspace"),D(F,X," ","\\ "),D(F,X," "," "),D(F,X," ","\\space"),D(F,X," ","\\nobreakspace"),D(E,X,null,"\\nobreak"),D(E,X,null,"\\allowbreak"),D(E,H,",",","),D(F,H,":",":"),D(E,H,";",";"),D(E,P,"⊼","\\barwedge"),D(E,P,"⊻","\\veebar"),D(E,P,"⊙","\\odot",!0),D(E,P,"⊕︎","\\oplus"),D(E,P,"⊗","\\otimes",!0),D(E,K,"∂","\\partial",!0),D(E,P,"⊘","\\oslash",!0),D(E,P,"⊚","\\circledcirc",!0),D(E,P,"⊡","\\boxdot",!0),D(E,P,"△","\\bigtriangleup"),D(E,P,"▽","\\bigtriangledown"),D(E,P,"†","\\dagger"),D(E,P,"⋄","\\diamond"),D(E,P,"◃","\\triangleleft"),D(E,P,"▹","\\triangleright"),D(E,Z,"{","\\{"),D(F,K,"{","\\{"),D(F,K,"{","\\textbraceleft"),D(E,R,"}","\\}"),D(F,K,"}","\\}"),D(F,K,"}","\\textbraceright"),D(E,Z,"{","\\lbrace"),D(E,R,"}","\\rbrace"),D(E,Z,"[","\\lbrack",!0),D(F,K,"[","\\lbrack",!0),D(E,R,"]","\\rbrack",!0),D(F,K,"]","\\rbrack",!0),D(E,Z,"(","\\lparen",!0),D(E,R,")","\\rparen",!0),D(E,Z,"⦇","\\llparenthesis",!0),D(E,R,"⦈","\\rrparenthesis",!0),D(F,K,"<","\\textless",!0),D(F,K,">","\\textgreater",!0),D(E,Z,"⌊","\\lfloor",!0),D(E,R,"⌋","\\rfloor",!0),D(E,Z,"⌈","\\lceil",!0),D(E,R,"⌉","\\rceil",!0),D(E,K,"\\","\\backslash"),D(E,K,"|","|"),D(E,K,"|","\\vert"),D(F,K,"|","\\textbar",!0),D(E,K,"‖","\\|"),D(E,K,"‖","\\Vert"),D(F,K,"‖","\\textbardbl"),D(F,K,"~","\\textasciitilde"),D(F,K,"\\","\\textbackslash"),D(F,K,"^","\\textasciicircum"),D(E,W,"↑","\\uparrow",!0),D(E,W,"⇑","\\Uparrow",!0),D(E,W,"↓","\\downarrow",!0),D(E,W,"⇓","\\Downarrow",!0),D(E,W,"↕","\\updownarrow",!0),D(E,W,"⇕","\\Updownarrow",!0),D(E,V,"∐","\\coprod"),D(E,V,"⋁","\\bigvee"),D(E,V,"⋀","\\bigwedge"),D(E,V,"⨄","\\biguplus"),D(E,V,"⨄","\\bigcupplus"),D(E,V,"⨃","\\bigcupdot"),D(E,V,"⨇","\\bigdoublevee"),D(E,V,"⨈","\\bigdoublewedge"),D(E,V,"⋂","\\bigcap"),D(E,V,"⋃","\\bigcup"),D(E,V,"∫","\\int"),D(E,V,"∫","\\intop"),D(E,V,"∬","\\iint"),D(E,V,"∭","\\iiint"),D(E,V,"∏","\\prod"),D(E,V,"∑","\\sum"),D(E,V,"⨂","\\bigotimes"),D(E,V,"⨁","\\bigoplus"),D(E,V,"⨀","\\bigodot"),D(E,V,"⨉","\\bigtimes"),D(E,V,"∮","\\oint"),D(E,V,"∯","\\oiint"),D(E,V,"∰","\\oiiint"),D(E,V,"∱","\\intclockwise"),D(E,V,"∲","\\varointclockwise"),D(E,V,"⨌","\\iiiint"),D(E,V,"⨍","\\intbar"),D(E,V,"⨎","\\intBar"),D(E,V,"⨏","\\fint"),D(E,V,"⨒","\\rppolint"),D(E,V,"⨓","\\scpolint"),D(E,V,"⨕","\\pointint"),D(E,V,"⨖","\\sqint"),D(E,V,"⨗","\\intlarhk"),D(E,V,"⨘","\\intx"),D(E,V,"⨙","\\intcap"),D(E,V,"⨚","\\intcup"),D(E,V,"⨅","\\bigsqcap"),D(E,V,"⨆","\\bigsqcup"),D(E,V,"∫","\\smallint"),D(F,j,"…","\\textellipsis"),D(E,j,"…","\\mathellipsis"),D(F,j,"…","\\ldots",!0),D(E,j,"…","\\ldots",!0),D(E,j,"⋰","\\iddots",!0),D(E,j,"⋯","\\@cdots",!0),D(E,j,"⋱","\\ddots",!0),D(E,K,"⋮","\\varvdots"),D(F,K,"⋮","\\varvdots"),D(E,G,"ˊ","\\acute"),D(E,G,"`","\\grave"),D(E,G,"¨","\\ddot"),D(E,G,"…","\\dddot"),D(E,G,"….","\\ddddot"),D(E,G,"~","\\tilde"),D(E,G,"‾","\\bar"),D(E,G,"˘","\\breve"),D(E,G,"ˇ","\\check"),D(E,G,"^","\\hat"),D(E,G,"→","\\vec"),D(E,G,"˙","\\dot"),D(E,G,"˚","\\mathring"),D(E,U,"ı","\\imath",!0),D(E,U,"ȷ","\\jmath",!0),D(E,K,"ı","ı"),D(E,K,"ȷ","ȷ"),D(F,K,"ı","\\i",!0),D(F,K,"ȷ","\\j",!0),D(F,K,"ß","\\ss",!0),D(F,K,"æ","\\ae",!0),D(F,K,"œ","\\oe",!0),D(F,K,"ø","\\o",!0),D(E,U,"ø","\\o",!0),D(F,K,"Æ","\\AE",!0),D(F,K,"Œ","\\OE",!0),D(F,K,"Ø","\\O",!0),D(E,U,"Ø","\\O",!0),D(F,G,"ˊ","\\'"),D(F,G,"ˋ","\\`"),D(F,G,"ˆ","\\^"),D(F,G,"˜","\\~"),D(F,G,"ˉ","\\="),D(F,G,"˘","\\u"),D(F,G,"˙","\\."),D(F,G,"¸","\\c"),D(F,G,"˚","\\r"),D(F,G,"ˇ","\\v"),D(F,G,"¨",'\\"'),D(F,G,"˝","\\H"),D(E,G,"ˊ","\\'"),D(E,G,"ˋ","\\`"),D(E,G,"ˆ","\\^"),D(E,G,"˜","\\~"),D(E,G,"ˉ","\\="),D(E,G,"˘","\\u"),D(E,G,"˙","\\."),D(E,G,"¸","\\c"),D(E,G,"˚","\\r"),D(E,G,"ˇ","\\v"),D(E,G,"¨",'\\"'),D(E,G,"˝","\\H");const Y={"--":!0,"---":!0,"``":!0,"''":!0};D(F,K,"–","--",!0),D(F,K,"–","\\textendash"),D(F,K,"—","---",!0),D(F,K,"—","\\textemdash"),D(F,K,"‘","`",!0),D(F,K,"‘","\\textquoteleft"),D(F,K,"’","'",!0),D(F,K,"’","\\textquoteright"),D(F,K,"“","``",!0),D(F,K,"“","\\textquotedblleft"),D(F,K,"”","''",!0),D(F,K,"”","\\textquotedblright"),D(E,K,"°","\\degree",!0),D(F,K,"°","\\degree"),D(F,K,"°","\\textdegree",!0),D(E,K,"£","\\pounds"),D(E,K,"£","\\mathsterling",!0),D(F,K,"£","\\pounds"),D(F,K,"£","\\textsterling",!0),D(E,K,"✠","\\maltese"),D(F,K,"✠","\\maltese"),D(E,K,"€","\\euro",!0),D(F,K,"€","\\euro",!0),D(F,K,"€","\\texteuro"),D(E,K,"©","\\copyright",!0),D(F,K,"©","\\textcopyright"),D(E,K,"⌀","\\diameter",!0),D(F,K,"⌀","\\diameter"),D(E,K,"𝛤","\\varGamma"),D(E,K,"𝛥","\\varDelta"),D(E,K,"𝛩","\\varTheta"),D(E,K,"𝛬","\\varLambda"),D(E,K,"𝛯","\\varXi"),D(E,K,"𝛱","\\varPi"),D(E,K,"𝛴","\\varSigma"),D(E,K,"𝛶","\\varUpsilon"),D(E,K,"𝛷","\\varPhi"),D(E,K,"𝛹","\\varPsi"),D(E,K,"𝛺","\\varOmega"),D(F,K,"𝛤","\\varGamma"),D(F,K,"𝛥","\\varDelta"),D(F,K,"𝛩","\\varTheta"),D(F,K,"𝛬","\\varLambda"),D(F,K,"𝛯","\\varXi"),D(F,K,"𝛱","\\varPi"),D(F,K,"𝛴","\\varSigma"),D(F,K,"𝛶","\\varUpsilon"),D(F,K,"𝛷","\\varPhi"),D(F,K,"𝛹","\\varPsi"),D(F,K,"𝛺","\\varOmega");const J='0123456789/@."';for(let e=0;e<14;e++){const t=J.charAt(e);D(E,K,t,t)}const Q='0123456789!@*()-=+";:?/.,';for(let e=0;e<25;e++){const t=Q.charAt(e);D(F,K,t,t)}const ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e<52;e++){const t=ee.charAt(e);D(E,U,t,t),D(F,K,t,t)}const te="ÇÐÞçþℂℍℕℙℚℝℤℎℏℊℋℌℐℑℒℓ℘ℛℜℬℰℱℳℭℨ";for(let e=0;e<30;e++){const t=te.charAt(e);D(E,U,t,t),D(F,K,t,t)}let re="";for(let e=0;e<52;e++){re=String.fromCharCode(55349,56320+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56372+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56424+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56580+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56736+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56788+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56840+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56944+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,56632+e),D(E,U,re,re),D(F,K,re,re);const t=ee.charAt(e);re=String.fromCharCode(55349,56476+e),D(E,U,t,re),D(F,K,t,re)}for(let e=0;e<10;e++)re=String.fromCharCode(55349,57294+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,57314+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,57324+e),D(E,U,re,re),D(F,K,re,re),re=String.fromCharCode(55349,57334+e),D(E,U,re,re),D(F,K,re,re);const ne=function(e,t,r){return!I[t][e]||!I[t][e].replace||55349===e.charCodeAt(0)||Object.prototype.hasOwnProperty.call(Y,e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=I[t][e].replace),new T.TextNode(e)},oe=(e,t)=>{if(0===e.children.length||"mtext"!==e.children[e.children.length-1].type){const r=new T.MathNode("mtext",[new T.TextNode(t.children[0].text)]);e.children.push(r)}else e.children[e.children.length-1].children[0].text+=t.children[0].text},ae=e=>{if("mrow"!==e.type&&"mstyle"!==e.type)return e;if(0===e.children.length)return e;const t=new T.MathNode("mrow");for(let r=0;r<e.children.length;r++){const n=e.children[r];if("mtext"===n.type&&0===Object.keys(n.attributes).length)oe(t,n);else if("mrow"===n.type){let e=!0;for(let t=0;t<n.children.length;t++){if("mtext"!==n.children[t].type||0!==Object.keys(n.attributes).length){e=!1;break}}if(e)for(let e=0;e<n.children.length;e++){const r=n.children[e];oe(t,r)}else t.children.push(n)}else t.children.push(n)}for(let r=0;r<t.children.length;r++)if("mtext"===t.children[r].type){const n=t.children[r];" "===n.children[0].text.charAt(0)&&(n.children[0].text=" "+n.children[0].text.slice(1));const o=n.children[0].text.length;o>0&&" "===n.children[0].text.charAt(o-1)&&(n.children[0].text=n.children[0].text.slice(0,-1)+" ");for(const[t,r]of Object.entries(e.attributes))n.attributes[t]=r}return 1===t.children.length&&"mtext"===t.children[0].type?t.children[0]:t},se=function(e,t=!1){if(!(1!==e.length||e[0]instanceof g))return e[0];if(!t){e[0]instanceof q&&"mo"===e[0].type&&!e[0].attributes.fence&&(e[0].attributes.lspace="0em",e[0].attributes.rspace="0em");const t=e.length-1;e[t]instanceof q&&"mo"===e[t].type&&!e[t].attributes.fence&&(e[t].attributes.lspace="0em",e[t].attributes.rspace="0em")}return new T.MathNode("mrow",e)};function ie(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){const t=e.children[0];return t instanceof _&&"."===t.text}if("mtext"===e.type&&1===e.children.length){const t=e.children[0];return t instanceof _&&" "===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){const t=e.children[0];return t instanceof _&&","===t.text}return!1}const le=(e,t)=>{const r=e[t],n=e[t+1];return"atom"===r.type&&","===r.text&&r.loc&&n.loc&&r.loc.end===n.loc.start},ce=e=>"atom"===e.type&&"rel"===e.family||"mclass"===e.type&&"mrel"===e.mclass,ue=function(e,t,r=!1){if(!r&&1===e.length){const r=me(e[0],t);return r instanceof q&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}const n=[],o=[];let a;for(let r=0;r<e.length;r++)o.push(me(e[r],t));for(let t=0;t<o.length;t++){const r=o[t];if(t<e.length-1&&ce(e[t])&&ce(e[t+1])&&r.setAttribute("rspace","0em"),t>0&&ce(e[t])&&ce(e[t-1])&&r.setAttribute("lspace","0em"),"mn"===r.type&&a&&"mn"===a.type)a.children.push(...r.children);else if(ie(r)&&a&&"mn"===a.type)a.children.push(...r.children);else if(a&&"mn"===a.type&&t<o.length-1&&"mn"===o[t+1].type&&le(e,t))a.children.push(...r.children);else{if("mn"===r.type&&ie(a))r.children=[...a.children,...r.children],n.pop();else if(("msup"===r.type||"msub"===r.type)&&r.children.length>=1&&a&&("mn"===a.type||ie(a))){const e=r.children[0];e instanceof q&&"mn"===e.type&&a&&(e.children=[...a.children,...e.children],n.pop())}n.push(r),a=r}}return n},pe=function(e,t,r=!1){return se(ue(e,t,r),r)},me=function(e,t){if(!e)return new T.MathNode("mrow");if(u[e.type]){return u[e.type](e,t)}throw new r("Got group of unknown type: '"+e.type+"'")},de=e=>new T.MathNode("mtd",[],[],{padding:"0",width:"50%"}),he=["mrow","mtd","mtable","mtr"],ge=e=>{for(const t of e.children)if(t.type&&he.includes(t.type)){if(t.classes&&"tml-label"===t.classes[0]){return t.label}{const e=ge(t);if(e)return e}}else if(!t.type){const e=ge(t);if(e)return e}};function fe(e,t,r,n){let o=null;1===e.length&&"tag"===e[0].type&&(o=e[0].tag,e=e[0].body);const a=ue(e,r);if(1===a.length&&a[0]instanceof k)return a[0];const s=n.displayMode||n.annotate?"none":n.wrap,i=0===a.length?null:a[0];let l=1===a.length&&null===o&&i instanceof q?a[0]:function(e,t,r){const n=[];let o=[],a=[],s=0,i=0,l=0;for(;i<e.length;){for(;e[i]instanceof g;)e.splice(i,1,...e[i].children);const r=e[i];if(r.attributes&&r.attributes.linebreak&&"newline"===r.attributes.linebreak){a.length>0&&o.push(new T.MathNode("mrow",a)),o.push(r),a=[];const e=new T.MathNode("mtd",o);e.style.textAlign="left",n.push(new T.MathNode("mtr",[e])),o=[],i+=1}else{if(a.push(r),r.type&&"mo"===r.type&&1===r.children.length&&!Object.hasOwn(r.attributes,"movablelimits")){const n=r.children[0].text;if("([{⌊⌈⟨⟮⎰⟦⦃".indexOf(n)>-1)l+=1;else if(")]}⌋⌉⟩⟯⎱⟦⦄".indexOf(n)>-1)l-=1;else if(0===l&&"="===t&&"="===n){if(s+=1,s>1){a.pop();const e=new T.MathNode("mrow",a);o.push(e),a=[r]}}else if(0===l&&"tex"===t&&"∇"!==n){const t=i<e.length-1?e[i+1]:null;let r=!0;if(!t||"mtext"!==t.type||!t.attributes.linebreak||"nobreak"!==t.attributes.linebreak)for(let t=i+1;t<e.length;t++){const n=e[t];if(!n.type||"mspace"!==n.type||n.attributes.linebreak&&"newline"===n.attributes.linebreak)break;a.push(n),i+=1,n.attributes&&n.attributes.linebreak&&"nobreak"===n.attributes.linebreak&&(r=!1)}if(r){const e=new T.MathNode("mrow",a);o.push(e),a=[]}}}i+=1}}if(a.length>0){const e=new T.MathNode("mrow",a);o.push(e)}if(n.length>0){const e=new T.MathNode("mtd",o);e.style.textAlign="left";const t=new T.MathNode("mtr",[e]);n.push(t);const a=new T.MathNode("mtable",n);return r||(a.setAttribute("columnalign","left"),a.setAttribute("rowspacing","0em")),a}return T.newDocumentFragment(o)}(a,s,n.displayMode);if(o&&(l=((e,t,r,n)=>{t=pe(t[0].body,r),(t=ae(t)).classes.push("tml-tag");const o=ge(e);e=new T.MathNode("mtd",[e]);const a=[de(),e,de()];a[n?0:2].classes.push(n?"tml-left":"tml-right"),a[n?0:2].children.push(t);const s=new T.MathNode("mtr",a,["tml-tageqn"]);o&&s.setAttribute("id",o);const i=new T.MathNode("mtable",[s]);return i.style.width="100%",i.setAttribute("displaystyle","true"),i})(l,o,r,n.leqno)),n.annotate){const e=new T.MathNode("annotation",[new T.TextNode(t)]);e.setAttribute("encoding","application/x-tex"),l=new T.MathNode("semantics",[l,e])}const c=new T.MathNode("math",[l]);return n.xml&&c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),l.style.width&&(c.style.width="100%"),n.displayMode&&(c.setAttribute("display","block"),c.style.display="block math",c.classes=["tml-display"]),c}const be="acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳",xe="ABCDEFGHIJKLMNOPQRSTUVWXYZbdfhkltΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩβδλζφθψ𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙𝐛𝐝𝐟𝐡𝐤𝐥𝐭",ye=new Set(["\\alpha","\\gamma","\\delta","\\epsilon","\\eta","\\iota","\\kappa","\\mu","\\nu","\\pi","\\rho","\\sigma","\\tau","\\upsilon","\\chi","\\psi","\\omega","\\imath","\\jmath"]),we=new Set(["\\Gamma","\\Delta","\\Sigma","\\Omega","\\beta","\\delta","\\lambda","\\theta","\\psi"]),ve=(e,t)=>{const r=e.isStretchy?C(e):new T.MathNode("mo",[ne(e.label,e.mode)]);if("\\vec"===e.label)r.style.transform="scale(0.75) translate(10%, 30%)";else if(r.style.mathStyle="normal",r.style.mathDepth="0",Ae.has(e.label)&&i.isCharacterBox(e.base)){let t="";const n=e.base.text;(be.indexOf(n)>-1||ye.has(n))&&(t="tml-xshift"),(xe.indexOf(n)>-1||we.has(n))&&(t="tml-capshift"),t&&r.classes.push(t)}e.isStretchy||r.setAttribute("stretchy","false");return new T.MathNode("\\c"===e.label?"munder":"mover",[me(e.base,t),r])},ke=new Set(["\\acute","\\grave","\\ddot","\\dddot","\\ddddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"]),Ae=new Set(["\\acute","\\bar","\\breve","\\check","\\dot","\\ddot","\\grave","\\hat","\\mathring","\\'","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v"]),qe={"\\`":"̀","\\'":"́","\\^":"̂","\\~":"̃","\\=":"̄","\\u":"̆","\\.":"̇",'\\"':"̈","\\r":"̊","\\H":"̋","\\v":"̌"};p({type:"accent",names:["\\acute","\\grave","\\ddot","\\dddot","\\ddddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\overparen","\\widecheck","\\widehat","\\wideparen","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{const r=d(t[0]),n=!ke.has(e.funcName);return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,base:r}},mathmlBuilder:ve}),p({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\c","\\u","\\.",'\\"',"\\r","\\H","\\v"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{const r=d(t[0]),n=e.parser.mode;return"math"===n&&e.parser.settings.strict&&console.log(`Temml parse error: Command ${e.funcName} is invalid in math mode.`),"text"===n&&r.text&&1===r.text.length&&e.funcName in qe&&be.indexOf(r.text)>-1?{type:"textord",mode:"text",text:r.text+qe[e.funcName]}:{type:"accent",mode:n,label:e.funcName,isStretchy:!1,base:r}},mathmlBuilder:ve}),p({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underparen","\\utilde"],props:{numArgs:1},handler:({parser:e,funcName:t},r)=>{const n=r[0];return{type:"accentUnder",mode:e.mode,label:t,base:n}},mathmlBuilder:(e,t)=>{const r=C(e);r.style["math-depth"]=0;return new T.MathNode("munder",[me(e.base,t),r])}});const _e={pt:800/803,pc:9600/803,dd:1238/1157*800/803,cc:12.792133216944668,nd:685/642*800/803,nc:1370/107*800/803,sp:1/65536*800/803,mm:25.4/72,cm:2.54/72,in:1/72,px:96/72},Se=["em","ex","mu","pt","mm","cm","in","px","bp","pc","dd","cc","nd","nc","sp"],Te=function(e){return"string"!=typeof e&&(e=e.unit),Se.indexOf(e)>-1},Ne=e=>[1,.7,.5][Math.max(e-1,0)],Oe=function(e,t){let n=e.number;if(t.maxSize[0]<0&&n>0)return{number:0,unit:"em"};const o=e.unit;switch(o){case"mm":case"cm":case"in":case"px":return n*_e[o]>t.maxSize[1]?{number:t.maxSize[1],unit:"pt"}:{number:n,unit:o};case"em":case"ex":return"ex"===o&&(n*=.431),n=Math.min(n/Ne(t.level),t.maxSize[0]),{number:i.round(n),unit:"em"};case"bp":return n>t.maxSize[1]&&(n=t.maxSize[1]),{number:n,unit:"pt"};case"pt":case"pc":case"dd":case"cc":case"nd":case"nc":case"sp":return n=Math.min(n*_e[o],t.maxSize[1]),{number:i.round(n),unit:"pt"};case"mu":return n=Math.min(n/18,t.maxSize[0]),{number:i.round(n),unit:"em"};default:throw new r("Invalid unit: '"+o+"'")}},$e=e=>{const t=new T.MathNode("mspace");return t.setAttribute("width",e+"em"),t},Me=(e,t=.3,r=0,n=!1)=>{if(null==e&&0===r)return $e(t);const o=e?[e]:[];if(0!==t&&o.unshift($e(t)),r>0&&o.push($e(r)),n){const e=new T.MathNode("mpadded",o);return e.setAttribute("height","0"),e}return new T.MathNode("mrow",o)},Be=(e,t)=>Number(e)/Ne(t),Ce=(e,t,r,n)=>{const o=B(e),a="eq"===e.slice(1,3),s="x"===e.charAt(1)?"1.75":"cd"===e.slice(2,4)?"3.0":a?"1.0":"2.0";o.setAttribute("lspace","0"),o.setAttribute("rspace",a?"0.5em":"0");const i=n.withLevel(n.level<2?2:3),l=Be(s,i.level),c=Be(s,3),u=Me(null,l.toFixed(4),0),p=Me(null,c.toFixed(4),0),m=Be(a?0:.3,i.level).toFixed(4);let d,h;const g=t&&t.body&&(t.body.body||t.body.length>0);if(g){let r=me(t,i);r=Me(r,m,m,"\\\\cdrightarrow"===e||"\\\\cdleftarrow"===e),d=new T.MathNode("mover",[r,p])}const f=r&&r.body&&(r.body.body||r.body.length>0);if(f){let e=me(r,i);e=Me(e,m,m),h=new T.MathNode("munder",[e,p])}let b;return b=g||f?g&&f?new T.MathNode("munderover",[o,h,d]):g?new T.MathNode("mover",[o,d]):new T.MathNode("munder",[o,h]):new T.MathNode("mover",[o,u]),"3.0"===s&&(b.style.height="1em"),b.setAttribute("accent","false"),b};p({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\yields","\\yieldsLeft","\\mesomerism","\\longrightharpoonup","\\longleftharpoondown","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:({parser:e,funcName:t},r,n)=>({type:"xArrow",mode:e.mode,name:t,body:r[0],below:n[0]}),mathmlBuilder(e,t){const r=[Ce(e.name,e.body,e.below,t)];return r.unshift($e(.2778)),r.push($e(.2778)),new T.MathNode("mrow",r)}});const ze={"\\xtofrom":["\\xrightarrow","\\xleftarrow"],"\\xleftrightharpoons":["\\xleftharpoonup","\\xrightharpoondown"],"\\xrightleftharpoons":["\\xrightharpoonup","\\xleftharpoondown"],"\\yieldsLeftRight":["\\yields","\\yieldsLeft"],"\\equilibrium":["\\longrightharpoonup","\\longleftharpoondown"],"\\equilibriumRight":["\\longrightharpoonup","\\eqleftharpoondown"],"\\equilibriumLeft":["\\eqrightharpoonup","\\longleftharpoondown"]};function Le(e,t){if(!e||e.type!==t)throw new Error(`Expected node of type ${t}, but got `+(e?`node of type ${e.type}`:String(e)));return e}function Ie(e){const t=De(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?`node of type ${e.type}`:String(e)));return t}function De(e){return e&&("atom"===e.type||Object.prototype.hasOwnProperty.call(L,e.type))?e:null}p({type:"stackedArrow",names:["\\xtofrom","\\xleftrightharpoons","\\xrightleftharpoons","\\yieldsLeftRight","\\equilibrium","\\equilibriumRight","\\equilibriumLeft"],props:{numArgs:1,numOptionalArgs:1},handler({parser:e,funcName:t},r,n){const o=r[0]?{type:"hphantom",mode:e.mode,body:r[0]}:null,a=n[0]?{type:"hphantom",mode:e.mode,body:n[0]}:null;return{type:"stackedArrow",mode:e.mode,name:t,body:r[0],upperArrowBelow:a,lowerArrowBody:o,below:n[0]}},mathmlBuilder(e,t){const r=ze[e.name][0],n=ze[e.name][1],o=Ce(r,e.body,e.upperArrowBelow,t),a=Ce(n,e.lowerArrowBody,e.below,t);let s;const i=new T.MathNode("mpadded",[o]);if(i.setAttribute("voffset","0.3em"),i.setAttribute("height","+0.3em"),i.setAttribute("depth","-0.3em"),"\\equilibriumLeft"===e.name){const e=new T.MathNode("mpadded",[a]);e.setAttribute("width","0.5em"),s=new T.MathNode("mpadded",[$e(.2778),e,i,$e(.2778)])}else i.setAttribute("width","\\equilibriumRight"===e.name?"0.5em":"0"),s=new T.MathNode("mpadded",[$e(.2778),i,a,$e(.2778)]);return s.setAttribute("voffset","-0.18em"),s.setAttribute("height","-0.18em"),s.setAttribute("depth","+0.18em"),s}});const Ee={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Fe=e=>"textord"===e.type&&"@"===e.text;function Ge(e,t,r){const n=Ee[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{const e={type:"atom",text:n,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[e],[]),r.callFunction("\\\\cdright",[t[1]],[])],semisimple:!0};return r.callFunction("\\\\cdparent",[o],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const e={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[e],[])}default:return{type:"textord",text:" ",mode:"math"}}}p({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:({parser:e,funcName:t},r)=>({type:"cdlabel",mode:e.mode,side:t.slice(4),label:r[0]}),mathmlBuilder(e,t){if(0===e.label.body.length)return new T.MathNode("mrow",t);const r=new T.MathNode("mtd",[me(e.label,t)]);r.style.padding="0";const n=new T.MathNode("mtr",[r]),o=new T.MathNode("mtable",[n]),a=new T.MathNode("mpadded",[o]);return a.setAttribute("width","0"),a.setAttribute("displaystyle","false"),a.setAttribute("scriptlevel","1"),"left"===e.side&&(a.style.display="flex",a.style.justifyContent="flex-end"),a}}),p({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:({parser:e},t)=>({type:"cdlabelparent",mode:e.mode,fragment:t[0]}),mathmlBuilder:(e,t)=>new T.MathNode("mrow",[me(e.fragment,t)])}),p({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler({parser:e,token:t},n){const o=Le(n[0],"ordgroup").body;let a="";for(let e=0;e<o.length;e++){a+=Le(o[e],"textord").text}const s=parseInt(a);if(isNaN(s))throw new r(`\\@char has non-numeric argument ${a}`,t);return{type:"textord",mode:e.mode,text:String.fromCodePoint(s)}}});const Pe=/^(#[a-f0-9]{3}|#?[a-f0-9]{6})$/i,Re=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i,je=/^ *\d{1,3} *(?:, *\d{1,3} *){2}$/,Ue=/^ *[10](?:\.\d*)? *(?:, *[10](?:\.\d*)? *){2}$/,Ve=/^[a-f0-9]{6}$/i,Ze=e=>{let t=e.toString(16);return 1===t.length&&(t="0"+t),t},He=JSON.parse('{\n  "Apricot": "#ffb484",\n  "Aquamarine": "#08b4bc",\n  "Bittersweet": "#c84c14",\n  "blue": "#0000FF",\n  "Blue": "#303494",\n  "BlueGreen": "#08b4bc",\n  "BlueViolet": "#503c94",\n  "BrickRed": "#b8341c",\n  "brown": "#BF8040",\n  "Brown": "#802404",\n  "BurntOrange": "#f8941c",\n  "CadetBlue": "#78749c",\n  "CarnationPink": "#f884b4",\n  "Cerulean": "#08a4e4",\n  "CornflowerBlue": "#40ace4",\n  "cyan": "#00FFFF",\n  "Cyan": "#08acec",\n  "Dandelion": "#ffbc44",\n  "darkgray": "#404040",\n  "DarkOrchid": "#a8548c",\n  "Emerald": "#08ac9c",\n  "ForestGreen": "#089c54",\n  "Fuchsia": "#90348c",\n  "Goldenrod": "#ffdc44",\n  "gray": "#808080",\n  "Gray": "#98949c",\n  "green": "#00FF00",\n  "Green": "#08a44c",\n  "GreenYellow": "#e0e474",\n  "JungleGreen": "#08ac9c",\n  "Lavender": "#f89cc4",\n  "lightgray": "#c0c0c0",\n  "lime": "#BFFF00",\n  "LimeGreen": "#90c43c",\n  "magenta": "#FF00FF",\n  "Magenta": "#f0048c",\n  "Mahogany": "#b0341c",\n  "Maroon": "#b03434",\n  "Melon": "#f89c7c",\n  "MidnightBlue": "#086494",\n  "Mulberry": "#b03c94",\n  "NavyBlue": "#086cbc",\n  "olive": "#7F7F00",\n  "OliveGreen": "#407c34",\n  "orange": "#FF8000",\n  "Orange": "#f8843c",\n  "OrangeRed": "#f0145c",\n  "Orchid": "#b074ac",\n  "Peach": "#f8945c",\n  "Periwinkle": "#8074bc",\n  "PineGreen": "#088c74",\n  "pink": "#ff7f7f",\n  "Plum": "#98248c",\n  "ProcessBlue": "#08b4ec",\n  "purple": "#BF0040",\n  "Purple": "#a0449c",\n  "RawSienna": "#983c04",\n  "red": "#ff0000",\n  "Red": "#f01c24",\n  "RedOrange": "#f86434",\n  "RedViolet": "#a0246c",\n  "Rhodamine": "#f0549c",\n  "Royallue": "#0874bc",\n  "RoyalPurple": "#683c9c",\n  "RubineRed": "#f0047c",\n  "Salmon": "#f8948c",\n  "SeaGreen": "#30bc9c",\n  "Sepia": "#701404",\n  "SkyBlue": "#48c4dc",\n  "SpringGreen": "#c8dc64",\n  "Tan": "#e09c74",\n  "teal": "#007F7F",\n  "TealBlue": "#08acb4",\n  "Thistle": "#d884b4",\n  "Turquoise": "#08b4cc",\n  "violet": "#800080",\n  "Violet": "#60449c",\n  "VioletRed": "#f054a4",\n  "WildStrawberry": "#f0246c",\n  "yellow": "#FFFF00",\n  "Yellow": "#fff404",\n  "YellowGreen": "#98cc6c",\n  "YellowOrange": "#ffa41c"\n}'),We=(e,t)=>{let n="";if("HTML"===e){if(!Pe.test(t))throw new r("Invalid HTML input.");n=t}else if("RGB"===e){if(!je.test(t))throw new r("Invalid RGB input.");t.split(",").map((e=>{n+=Ze(Number(e.trim()))}))}else{if(!Ue.test(t))throw new r("Invalid rbg input.");t.split(",").map((e=>{const t=Number(e.trim());if(t>1)throw new r("Color rgb input must be < 1.");n+=Ze(Number((255*t).toFixed(0)))}))}return"#"!==n.charAt(0)&&(n="#"+n),n},Xe=(e,t,n)=>{const o=`\\\\color@${e}`;if(!Re.exec(e))throw new r("Invalid color: '"+e+"'",n);return Ve.test(e)?"#"+e:("#"===e.charAt(0)||(t.has(o)?e=t.get(o).tokens[0].text:He[e]&&(e=He[e])),e)},Ke=(e,t)=>{let r=ue(e.body,t.withColor(e.color));return r=r.map((t=>(t.style.color=e.color,t))),T.newDocumentFragment(r)};p({type:"color",names:["\\textcolor"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","original"]},handler({parser:e,token:t},r,n){const o=n[0]&&Le(n[0],"raw").string;let a="";if(o){const e=Le(r[0],"raw").string;a=We(o,e)}else a=Xe(Le(r[0],"raw").string,e.gullet.macros,t);const s=r[1];return{type:"color",mode:e.mode,color:a,isTextColor:!0,body:h(s)}},mathmlBuilder:Ke}),p({type:"color",names:["\\color"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw"]},handler({parser:e,breakOnTokenText:t,token:r},n,o){const a=o[0]&&Le(o[0],"raw").string;let s="";if(a){const e=Le(n[0],"raw").string;s=We(a,e)}else s=Xe(Le(n[0],"raw").string,e.gullet.macros,r);const i=e.parseExpression(!0,t,!0);return{type:"color",mode:e.mode,color:s,isTextColor:!1,body:i}},mathmlBuilder:Ke}),p({type:"color",names:["\\definecolor"],props:{numArgs:3,allowedInText:!0,argTypes:["raw","raw","raw"]},handler({parser:e,funcName:t,token:n},o){const a=Le(o[0],"raw").string;if(!/^[A-Za-z]+$/.test(a))throw new r("Color name must be latin letters.",n);const s=Le(o[1],"raw").string;if(!["HTML","RGB","rgb"].includes(s))throw new r("Color model must be HTML, RGB, or rgb.",n);const i=Le(o[2],"raw").string,l=We(s,i);return e.gullet.macros.set(`\\\\color@${a}`,{tokens:[{text:l}],numArgs:0}),{type:"internal",mode:e.mode}}}),p({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler({parser:e},t,r){const n="["===e.gullet.future().text?e.parseSizeGroup(!0):null,o=!e.settings.displayMode;return{type:"cr",mode:e.mode,newLine:o,size:n&&Le(n,"size").value}},mathmlBuilder(e,t){const r=new T.MathNode("mo");if(e.newLine&&(r.setAttribute("linebreak","newline"),e.size)){const n=Oe(e.size,t);r.setAttribute("height",n.number+n.unit)}return r}});const Ye={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Je=e=>{const t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new r("Expected a control sequence",e);return t},Qe=(e,t,r,n)=>{let o=e.gullet.macros.get(r.text);null==o&&(r.noexpand=!0,o={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,o,n)};p({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler({parser:e,funcName:t}){e.consumeSpaces();const n=e.fetch();if(Ye[n.text])return"\\global"!==t&&"\\\\globallong"!==t||(n.text=Ye[n.text]),Le(e.parseFunction(),"internal");throw new r("Invalid token after macro prefix",n)}}),p({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=e.gullet.popToken();const o=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new r("Expected a control sequence",n);let a,s=0;const i=[[]];for(;"{"!==e.gullet.future().text;)if(n=e.gullet.popToken(),"#"===n.text){if("{"===e.gullet.future().text){a=e.gullet.future(),i[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new r(`Invalid argument number "${n.text}"`);if(parseInt(n.text)!==s+1)throw new r(`Argument number "${n.text}" out of order`);s++,i.push([])}else{if("EOF"===n.text)throw new r("Expected a macro definition");i[s].push(n.text)}let{tokens:l}=e.gullet.consumeArg();if(a&&l.unshift(a),"\\edef"===t||"\\xdef"===t){if(l=e.gullet.expandTokens(l),l.length>e.gullet.settings.maxExpand)throw new r("Too many expansions in an "+t);l.reverse()}return e.gullet.macros.set(o,{tokens:l,numArgs:s,delimiters:i},t===Ye[t]),{type:"internal",mode:e.mode}}}),p({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){const r=Je(e.gullet.popToken());e.gullet.consumeSpaces();const n=(e=>{let t=e.gullet.popToken();return"="===t.text&&(t=e.gullet.popToken()," "===t.text&&(t=e.gullet.popToken())),t})(e);return Qe(e,r,n,"\\\\globallet"===t),{type:"internal",mode:e.mode}}}),p({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){const r=Je(e.gullet.popToken()),n=e.gullet.popToken(),o=e.gullet.popToken();return Qe(e,r,o,"\\\\globalfuture"===t),e.gullet.pushToken(o),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}}),p({type:"internal",names:["\\newcommand","\\renewcommand","\\providecommand"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n="";const o=e.gullet.popToken();"{"===o.text?(n=Je(e.gullet.popToken()),e.gullet.popToken()):n=Je(o);const a=e.gullet.isDefined(n);if(a&&"\\newcommand"===t)throw new r(`\\newcommand{${n}} attempting to redefine ${n}; use \\renewcommand`);if(!a&&"\\renewcommand"===t)throw new r(`\\renewcommand{${n}} when command ${n} does not yet exist; use \\newcommand`);let s=0;if("["===e.gullet.future().text){let t=e.gullet.popToken();if(t=e.gullet.popToken(),!/^[0-9]$/.test(t.text))throw new r(`Invalid number of arguments: "${t.text}"`);if(s=parseInt(t.text),t=e.gullet.popToken(),"]"!==t.text)throw new r(`Invalid argument "${t.text}"`)}const{tokens:i}=e.gullet.consumeArg();return"\\providecommand"===t&&e.gullet.macros.has(n)||e.gullet.macros.set(n,{tokens:i,numArgs:s}),{type:"internal",mode:e.mode}}});const et={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},tt=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","⦇","\\llparenthesis","⦈","\\rrparenthesis","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lAngle","⟪","\\rAngle","⟫","\\llangle","⦉","\\rrangle","⦊","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","\\llbracket","\\rrbracket","⟦","⟦","\\lBrace","\\rBrace","⦃","⦄","/","\\backslash","|","\\vert","\\|","\\Vert","‖","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."],rt=["}","\\left","\\middle","\\right"],nt=e=>e.length>0&&(tt.includes(e)||et[e]||rt.includes(e)),ot=[0,1.2,1.8,2.4,3];function at(e,t){const n=De(e);if(n&&tt.includes(n.text))return["<","\\lt"].includes(n.text)&&(n.text="⟨"),[">","\\gt"].includes(n.text)&&(n.text="⟩"),n;throw new r(n?`Invalid delimiter '${n.text}' after '${t.funcName}'`:`Invalid delimiter type '${e.type}'`,e)}const st=["/","\\","\\backslash","\\vert","|"];p({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const r=at(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:et[e.funcName].size,mclass:et[e.funcName].mclass,delim:r.text}},mathmlBuilder:e=>{const t=[];"."===e.delim&&(e.delim=""),t.push(ne(e.delim,e.mode));const r=new T.MathNode("mo",t);return"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),(st.includes(e.delim)||e.delim.indexOf("arrow")>-1)&&r.setAttribute("stretchy","true"),r.setAttribute("symmetric","true"),r.setAttribute("minsize",ot[e.size]+"em"),r.setAttribute("maxsize",ot[e.size]+"em"),r}}),p({type:"leftright-right",names:["\\right"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>({type:"leftright-right",mode:e.parser.mode,delim:at(t[0],e).text})}),p({type:"leftright",names:["\\left"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const n=at(t[0],e),o=e.parser;++o.leftrightDepth;let a=o.parseExpression(!1,null,!0),s=o.fetch();for(;"\\middle"===s.text;){o.consume();const e=o.fetch().text;if(!I.math[e])throw new r(`Invalid delimiter '${e}' after '\\middle'`);at({type:"atom",mode:"math",text:e},{funcName:"\\middle"}),a.push({type:"middle",mode:"math",delim:e}),o.consume(),a=a.concat(o.parseExpression(!1,null,!0)),s=o.fetch()}--o.leftrightDepth,o.expect("\\right",!1);const i=Le(o.parseFunction(),"leftright-right");return{type:"leftright",mode:o.mode,body:a,left:n.text,right:i.delim}},mathmlBuilder:(e,t)=>{!function(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}(e);const r=ue(e.body,t);"."===e.left&&(e.left="");const n=new T.MathNode("mo",[ne(e.left,e.mode)]);n.setAttribute("fence","true"),n.setAttribute("form","prefix"),("/"===e.left||"\\"===e.left||e.left.indexOf("arrow")>-1)&&n.setAttribute("stretchy","true"),r.unshift(n),"."===e.right&&(e.right="");const o=new T.MathNode("mo",[ne(e.right,e.mode)]);if(o.setAttribute("fence","true"),o.setAttribute("form","postfix"),("∖"===e.right||e.right.indexOf("arrow")>-1)&&o.setAttribute("stretchy","true"),e.body.length>0){const t=e.body[e.body.length-1];"color"!==t.type||t.isTextColor||o.setAttribute("mathcolor",t.color)}return r.push(o),se(r)}}),p({type:"middle",names:["\\middle"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const n=at(t[0],e);if(!e.parser.leftrightDepth)throw new r("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},mathmlBuilder:(e,t)=>{const r=ne(e.delim,e.mode),n=new T.MathNode("mo",[r]);return n.setAttribute("fence","true"),e.delim.indexOf("arrow")>-1&&n.setAttribute("stretchy","true"),n.setAttribute("form","prefix"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});const it=e=>{const t=new T.MathNode("mspace");return t.setAttribute("width","3pt"),t},lt=(e,t)=>{let r;switch(r=e.label.indexOf("colorbox")>-1||"\\boxed"===e.label?new T.MathNode("mrow",[it(),me(e.body,t),it()]):new T.MathNode("menclose",[me(e.body,t)]),e.label){case"\\overline":r.setAttribute("notation","top"),r.classes.push("tml-overline");break;case"\\underline":r.setAttribute("notation","bottom"),r.classes.push("tml-underline");break;case"\\cancel":r.setAttribute("notation","updiagonalstrike"),r.children.push(new T.MathNode("mrow",[],["tml-cancel","upstrike"]));break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike"),r.children.push(new T.MathNode("mrow",[],["tml-cancel","downstrike"]));break;case"\\sout":r.setAttribute("notation","horizontalstrike"),r.children.push(new T.MathNode("mrow",[],["tml-cancel","sout"]));break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike"),r.classes.push("tml-xcancel");break;case"\\longdiv":r.setAttribute("notation","longdiv"),r.classes.push("longdiv-top"),r.children.push(new T.MathNode("mrow",[],["longdiv-arc"]));break;case"\\phase":r.setAttribute("notation","phasorangle"),r.classes.push("phasor-bottom"),r.children.push(new T.MathNode("mrow",[],["phasor-angle"]));break;case"\\textcircled":r.setAttribute("notation","circle"),r.classes.push("circle-pad"),r.children.push(new T.MathNode("mrow",[],["textcircle"]));break;case"\\angl":r.setAttribute("notation","actuarial"),r.classes.push("actuarial");break;case"\\boxed":r.setAttribute("notation","box"),r.classes.push("tml-box"),r.setAttribute("scriptlevel","0"),r.setAttribute("displaystyle","true");break;case"\\fbox":r.setAttribute("notation","box"),r.classes.push("tml-fbox");break;case"\\fcolorbox":case"\\colorbox":{const t={padding:"3pt 0 3pt 0"};"\\fcolorbox"===e.label&&(t.border="0.0667em solid "+String(e.borderColor)),r.style=t;break}}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};p({type:"enclose",names:["\\colorbox"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","text"]},handler({parser:e,funcName:t},r,n){const o=n[0]&&Le(n[0],"raw").string;let a="";if(o){const e=Le(r[0],"raw").string;a=We(o,e)}else a=Xe(Le(r[0],"raw").string,e.gullet.macros);const s=r[1];return{type:"enclose",mode:e.mode,label:t,backgroundColor:a,body:s}},mathmlBuilder:lt}),p({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","raw","text"]},handler({parser:e,funcName:t},r,n){const o=n[0]&&Le(n[0],"raw").string;let a,s="";if(o){const e=Le(r[0],"raw").string,t=Le(r[0],"raw").string;s=We(o,e),a=We(o,t)}else s=Xe(Le(r[0],"raw").string,e.gullet.macros),a=Xe(Le(r[1],"raw").string,e.gullet.macros);const i=r[2];return{type:"enclose",mode:e.mode,label:t,backgroundColor:a,borderColor:s,body:i}},mathmlBuilder:lt}),p({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:({parser:e},t)=>({type:"enclose",mode:e.mode,label:"\\fbox",body:t[0]})}),p({type:"enclose",names:["\\angl","\\cancel","\\bcancel","\\xcancel","\\sout","\\overline","\\boxed","\\longdiv","\\phase"],props:{numArgs:1},handler({parser:e,funcName:t},r){const n=r[0];return{type:"enclose",mode:e.mode,label:t,body:n}},mathmlBuilder:lt}),p({type:"enclose",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler({parser:e,funcName:t},r){const n=r[0];return{type:"enclose",mode:e.mode,label:t,body:n}},mathmlBuilder:lt}),p({type:"enclose",names:["\\textcircled"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},r){const n=r[0];return{type:"enclose",mode:e.mode,label:t,body:n}},mathmlBuilder:lt});const ct={};function ut({type:e,names:t,props:r,handler:n,mathmlBuilder:o}){const a={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n};for(let e=0;e<t.length;++e)ct[t[e]]=a;o&&(u[e]=o)}class pt{constructor(e,t,r){this.lexer=e,this.start=t,this.end=r}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new pt(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class mt{constructor(e,t){this.text=e,this.loc=t}range(e,t){return new mt(t,pt.range(this,e))}}const dt=0,ht=1,gt=2,ft=3,bt={};function xt(e,t){bt[e]=t}const yt=bt;xt("\\noexpand",(function(e){const t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),xt("\\expandafter",(function(e){const t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),xt("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),xt("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),xt("\\@ifnextchar",(function(e){const t=e.consumeArgs(3);e.consumeSpaces();const r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),xt("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),xt("\\TextOrMath",(function(e){const t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));const wt=e=>{let t="";for(let r=e.length-1;r>-1;r--)t+=e[r].text;return t},vt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},kt=e=>{const t=e.future().text;return"EOF"===t?[null,""]:[vt[t.charAt(0)],t]},At=(e,t,r)=>{for(let n=1;n<t.length;n++){e*=r,e+=vt[t.charAt(n)]}return e};function qt(e){const t=e.consumeArgs(1)[0];let r="",n=t[t.length-1].loc.start;for(let e=t.length-1;e>=0;e--){const o=t[e].loc.start;o>n&&(r+=" ",n=o),r+=t[e].text,n+=t[e].text.length}return r}xt("\\char",(function(e){let t,n=e.popToken(),o="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if(n=e.popToken(),"\\"===n.text[0])o=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new r("\\char` missing argument");o=n.text.charCodeAt(0)}else t=10;if(t){let a,s=n.text;if(o=vt[s.charAt(0)],null==o||o>=t)throw new r(`Invalid base-${t} digit ${n.text}`);for(o=At(o,s,t),[a,s]=kt(e);null!=a&&a<t;)o*=t,o+=a,o=At(o,s,t),e.popToken(),[a,s]=kt(e)}return`\\@char{${o}}`})),xt("\\surd","\\sqrt{\\vphantom{|}}"),xt("⊕","\\oplus"),xt("\\long",""),xt("\\bgroup","{"),xt("\\egroup","}"),xt("~","\\nobreakspace"),xt("\\lq","`"),xt("\\rq","'"),xt("\\aa","\\r a"),xt("\\Bbbk","\\Bbb{k}"),xt("\\mathstrut","\\vphantom{(}"),xt("\\underbar","\\underline{\\text{#1}}"),xt("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),xt("⋮","\\vdots"),xt("\\arraystretch","1"),xt("\\arraycolsep","6pt"),xt("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),xt("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),xt("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),xt("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");const _t={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcap":"\\dotsb","\\bigsqcup":"\\dotsb","\\bigtimes":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};xt("\\dots",(function(e){let t="\\dotso";const r=e.expandAfterFuture().text;return r in _t?t=_t[r]:("\\not"===r.slice(0,4)||r in I.math&&["bin","rel"].includes(I.math[r].group))&&(t="\\dotsb"),t}));const St={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};xt("\\dotso",(function(e){return e.future().text in St?"\\ldots\\,":"\\ldots"})),xt("\\dotsc",(function(e){const t=e.future().text;return t in St&&","!==t?"\\ldots\\,":"\\ldots"})),xt("\\cdots",(function(e){return e.future().text in St?"\\@cdots\\,":"\\@cdots"})),xt("\\dotsb","\\cdots"),xt("\\dotsm","\\cdots"),xt("\\dotsi","\\!\\cdots"),xt("\\idotsint","\\dotsi"),xt("\\dotsx","\\ldots\\,"),xt("\\DOTSI","\\relax"),xt("\\DOTSB","\\relax"),xt("\\DOTSX","\\relax"),xt("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),xt("\\,","{\\tmspace+{3mu}{.1667em}}"),xt("\\thinspace","\\,"),xt("\\>","\\mskip{4mu}"),xt("\\:","{\\tmspace+{4mu}{.2222em}}"),xt("\\medspace","\\:"),xt("\\;","{\\tmspace+{5mu}{.2777em}}"),xt("\\thickspace","\\;"),xt("\\!","{\\tmspace-{3mu}{.1667em}}"),xt("\\negthinspace","\\!"),xt("\\negmedspace","{\\tmspace-{4mu}{.2222em}}"),xt("\\negthickspace","{\\tmspace-{5mu}{.277em}}"),xt("\\enspace","\\kern.5em "),xt("\\enskip","\\hskip.5em\\relax"),xt("\\quad","\\hskip1em\\relax"),xt("\\qquad","\\hskip2em\\relax"),xt("\\AA","\\TextOrMath{\\Angstrom}{\\mathring{A}}\\relax"),xt("\\tag","\\@ifstar\\tag@literal\\tag@paren"),xt("\\tag@paren","\\tag@literal{({#1})}"),xt("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new r("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),xt("\\notag","\\nonumber"),xt("\\nonumber","\\gdef\\@eqnsw{0}"),xt("\\bmod","\\mathbin{\\text{mod}}"),xt("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),xt("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),xt("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),xt("\\newline","\\\\\\relax"),xt("\\TeX","\\textrm{T}\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125em\\textrm{X}"),xt("\\LaTeX","\\textrm{L}\\kern-.35em\\raisebox{0.2em}{\\scriptstyle A}\\kern-.15em\\TeX"),xt("\\Temml","\\textrm{T}\\kern-0.2em\\lower{0.2em}{\\textrm{E}}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}"),xt("\\hspace","\\@ifstar\\@hspacer\\@hspace"),xt("\\@hspace","\\hskip #1\\relax"),xt("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),xt("\\colon",'\\mathpunct{\\char"3a}'),xt("\\prescript","\\pres@cript{_{#1}^{#2}}{}{#3}"),xt("\\ordinarycolon",'\\char"3a'),xt("\\vcentcolon","\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}}"),xt("\\coloneq",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2212}'),xt("\\Coloneq",'\\mathrel{\\char"2237\\char"2212}'),xt("\\Eqqcolon",'\\mathrel{\\char"3d\\char"2237}'),xt("\\Eqcolon",'\\mathrel{\\char"2212\\char"2237}'),xt("\\colonapprox",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2248}'),xt("\\Colonapprox",'\\mathrel{\\char"2237\\char"2248}'),xt("\\colonsim",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}'),xt("\\Colonsim",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}'),xt("\\ratio","\\vcentcolon"),xt("\\coloncolon","\\dblcolon"),xt("\\colonequals","\\coloneqq"),xt("\\coloncolonequals","\\Coloneqq"),xt("\\equalscolon","\\eqqcolon"),xt("\\equalscoloncolon","\\Eqqcolon"),xt("\\colonminus","\\coloneq"),xt("\\coloncolonminus","\\Coloneq"),xt("\\minuscolon","\\eqcolon"),xt("\\minuscoloncolon","\\Eqcolon"),xt("\\coloncolonapprox","\\Colonapprox"),xt("\\coloncolonsim","\\Colonsim"),xt("\\notni","\\mathrel{\\char`∌}"),xt("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),xt("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),xt("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),xt("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),xt("\\varlimsup","\\DOTSB\\operatorname*{\\overline{\\text{lim}}}"),xt("\\varliminf","\\DOTSB\\operatorname*{\\underline{\\text{lim}}}"),xt("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{\\text{lim}}}"),xt("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{\\text{lim}}}"),xt("\\centerdot","{\\medspace\\rule{0.167em}{0.189em}\\medspace}"),xt("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),xt("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),xt("\\plim","\\DOTSB\\operatorname*{plim}"),xt("\\leftmodels","\\mathop{\\reflectbox{$\\models$}}"),xt("\\bra","\\mathinner{\\langle{#1}|}"),xt("\\ket","\\mathinner{|{#1}\\rangle}"),xt("\\braket","\\mathinner{\\langle{#1}\\rangle}"),xt("\\Bra","\\left\\langle#1\\right|"),xt("\\Ket","\\left|#1\\right\\rangle");const Tt=(e,t)=>{const r=`}\\,\\middle${"|"===t[0]?"\\vert":"\\Vert"}\\,{`;return e.slice(0,t.index)+r+e.slice(t.index+t[0].length)};xt("\\Braket",(function(e){let t=qt(e);const r=/\|\||\||\\\|/g;let n;for(;null!==(n=r.exec(t));)t=Tt(t,n);return"\\left\\langle{"+t+"}\\right\\rangle"})),xt("\\Set",(function(e){let t=qt(e);const r=/\|\||\||\\\|/.exec(t);return r&&(t=Tt(t,r)),"\\left\\{\\:{"+t+"}\\:\\right\\}"})),xt("\\set",(function(e){return"\\{{"+qt(e).replace(/\|/,"}\\mid{")+"}\\}"})),xt("\\angln","{\\angl n}"),xt("\\odv","\\@ifstar\\odv@next\\odv@numerator"),xt("\\odv@numerator","\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}"),xt("\\odv@next","\\frac{\\mathrm{d}}{\\mathrm{d}#2}#1"),xt("\\pdv","\\@ifstar\\pdv@next\\pdv@numerator");const Nt=e=>{const t=e[0][0].text,r=wt(e[1]).split(","),n=String(r.length),o="1"===n?"\\partial":`\\partial^${n}`;let a="";return r.map((e=>{a+="\\partial "+e.trim()+"\\,"})),[t,o,a.replace(/\\,$/,"")]};xt("\\pdv@numerator",(function(e){const[t,r,n]=Nt(e.consumeArgs(2));return`\\frac{${r} ${t}}{${n}}`})),xt("\\pdv@next",(function(e){const[t,r,n]=Nt(e.consumeArgs(2));return`\\frac{${r}}{${n}} ${t}`})),xt("\\upalpha","\\up@greek{\\alpha}"),xt("\\upbeta","\\up@greek{\\beta}"),xt("\\upgamma","\\up@greek{\\gamma}"),xt("\\updelta","\\up@greek{\\delta}"),xt("\\upepsilon","\\up@greek{\\epsilon}"),xt("\\upzeta","\\up@greek{\\zeta}"),xt("\\upeta","\\up@greek{\\eta}"),xt("\\uptheta","\\up@greek{\\theta}"),xt("\\upiota","\\up@greek{\\iota}"),xt("\\upkappa","\\up@greek{\\kappa}"),xt("\\uplambda","\\up@greek{\\lambda}"),xt("\\upmu","\\up@greek{\\mu}"),xt("\\upnu","\\up@greek{\\nu}"),xt("\\upxi","\\up@greek{\\xi}"),xt("\\upomicron","\\up@greek{\\omicron}"),xt("\\uppi","\\up@greek{\\pi}"),xt("\\upalpha","\\up@greek{\\alpha}"),xt("\\uprho","\\up@greek{\\rho}"),xt("\\upsigma","\\up@greek{\\sigma}"),xt("\\uptau","\\up@greek{\\tau}"),xt("\\upupsilon","\\up@greek{\\upsilon}"),xt("\\upphi","\\up@greek{\\phi}"),xt("\\upchi","\\up@greek{\\chi}"),xt("\\uppsi","\\up@greek{\\psi}"),xt("\\upomega","\\up@greek{\\omega}"),xt("\\invamp",'\\mathbin{\\char"214b}'),xt("\\parr",'\\mathbin{\\char"214b}'),xt("\\with",'\\mathbin{\\char"26}'),xt("\\multimapinv",'\\mathrel{\\char"27dc}'),xt("\\multimapboth",'\\mathrel{\\char"29df}'),xt("\\scoh",'{\\mkern5mu\\char"2322\\mkern5mu}'),xt("\\sincoh",'{\\mkern5mu\\char"2323\\mkern5mu}'),xt("\\coh",'{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2322}}}\n{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}'),xt("\\incoh",'{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}\n{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}'),xt("\\standardstate","\\text{\\tiny\\char`⦵}"),xt("\\ce",(function(e){return Ot(e.consumeArgs(1)[0],"ce")})),xt("\\pu",(function(e){return Ot(e.consumeArgs(1)[0],"pu")})),xt("\\uniDash","{\\rule{0.672em}{0.06em}}"),xt("\\triDash","{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}"),xt("\\tripleDash","\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em"),xt("\\tripleDashOverLine","\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em"),xt("\\tripleDashOverDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em"),xt("\\tripleDashBetweenDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");var Ot=function(e,t){for(var r="",n=e.length&&e[e.length-1].loc.start,o=e.length-1;o>=0;o--)e[o].loc.start>n&&(r+=" ",n=e[o].loc.start),r+=e[o].text,n+=e[o].text.length;return Mt.go($t.go(r,t))},$t={go:function(e,t){if(!e)return[];void 0===t&&(t="ce");var r,n="0",o={};o.parenthesisLevel=0,e=(e=(e=e.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var a=10,s=[];;){r!==e?(a=10,r=e):a--;var i=$t.stateMachines[t],l=i.transitions[n]||i.transitions["*"];e:for(var c=0;c<l.length;c++){var u=$t.patterns.match_(l[c].pattern,e);if(u){for(var p=l[c].task,m=0;m<p.action_.length;m++){var d;if(i.actions[p.action_[m].type_])d=i.actions[p.action_[m].type_](o,u.match_,p.action_[m].option);else{if(!$t.actions[p.action_[m].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+p.action_[m].type_+")"];d=$t.actions[p.action_[m].type_](o,u.match_,p.action_[m].option)}$t.concatArray(s,d)}if(n=p.nextState||n,!(e.length>0))return s;if(p.revisit||(e=u.remainder),!p.toContinue)break e}}if(a<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=$t.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return $t.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return $t.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return $t.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return $t.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return $t.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return $t.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return $t.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return $t.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return $t.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return $t.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return $t.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return $t.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return $t.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return $t.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return $t.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return $t.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return $t.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return $t.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return $t.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return $t.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:t[0],remainder:e.substr(t[0].length)};var r=$t.patterns.findObserveGroups(e,"","$","$","");return r&&(t=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,r,n,o,a,s,i,l,c){var u=function(e,t){if("string"==typeof t)return 0!==e.indexOf(t)?null:t;var r=e.match(t);return r?r[0]:null},p=u(e,t);if(null===p)return null;if(e=e.substr(p.length),null===(p=u(e,r)))return null;var m=function(e,t,r){for(var n=0;t<e.length;){var o=e.charAt(t),a=u(e.substr(t),r);if(null!==a&&0===n)return{endMatchBegin:t,endMatchEnd:t+a.length};if("{"===o)n++;else if("}"===o){if(0===n)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];n--}t++}return null}(e,p.length,n||o);if(null===m)return null;var d=e.substring(0,n?m.endMatchEnd:m.endMatchBegin);if(a||s){var h=this.findObserveGroups(e.substr(m.endMatchEnd),a,s,i,l);if(null===h)return null;var g=[d,h.match_];return{match_:c?g.join(""):g,remainder:h.remainder}}return{match_:d,remainder:e.substr(m.endMatchEnd)}},match_:function(e,t){var r=$t.patterns.patterns[e];if(void 0===r)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if("function"==typeof r)return $t.patterns.patterns[e](t);var n=t.match(r);return n?{match_:n[2]?[n[1],n[2]]:n[1]?n[1]:n[0],remainder:t.substr(n[0].length)}:null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,r){return{type_:r}},"insert+p1":function(e,t,r){return{type_:r,p1:t}},"insert+p1+p2":function(e,t,r){return{type_:r,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return $t.go(t,"text")},"{text}":function(e,t){var r=["{"];return $t.concatArray(r,$t.go(t,"text")),r.push("}"),r},"tex-math":function(e,t){return $t.go(t,"tex-math")},"tex-math tight":function(e,t){return $t.go(t,"tex-math tight")},bond:function(e,t,r){return{type_:"bond",kind_:r||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return $t.go(t)},"1/2":function(e,t){var r=[];t.match(/^[+\-]/)&&(r.push(t.substr(0,1)),t=t.substr(1));var n=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return n[1]=n[1].replace(/\$/g,""),r.push({type_:"frac",p1:n[1],p2:n[2]}),n[3]&&(n[3]=n[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:n[3]})),r},"9,9":function(e,t){return $t.go(t,"9,9")}},createTransitions:function(e){var t,r,n,o,a={};for(t in e)for(r in e[t])for(n=r.split("|"),e[t][r].stateArray=n,o=0;o<n.length;o++)a[n[o]]=[];for(t in e)for(r in e[t])for(n=e[t][r].stateArray||[],o=0;o<n.length;o++){var s=e[t][r];if(s.action_){s.action_=[].concat(s.action_);for(var i=0;i<s.action_.length;i++)"string"==typeof s.action_[i]&&(s.action_[i]={type_:s.action_[i]})}else s.action_=[];for(var l=t.split("|"),c=0;c<l.length;c++)if("*"===n[o])for(var u in a)a[u].push({pattern:l[c],task:s});else a[n[o]].push({pattern:l[c],task:s})}return a},stateMachines:{}};$t.stateMachines={ce:{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var r;if((e.d||"").match(/^[0-9]+$/)){var n=e.d;e.d=void 0,r=this.output(e),e.b=n}else r=this.output(e);return $t.actions["o="](e,t),r},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var r=[];return $t.concatArray(r,this.output(e)),$t.concatArray(r,$t.actions.bond(e,t,"-")),r}e.d=t},"- after o/d":function(e,t,r){var n=$t.patterns.match_("orbital",e.o||""),o=$t.patterns.match_("one lowercase greek letter $",e.o||""),a=$t.patterns.match_("one lowercase latin letter $",e.o||""),s=$t.patterns.match_("$one lowercase latin letter$ $",e.o||""),i="-"===t&&(n&&""===n.remainder||o||a||s);!i||e.a||e.b||e.p||e.d||e.q||n||!a||(e.o="$"+e.o+"$");var l=[];return i?($t.concatArray(l,this.output(e)),l.push({type_:"hyphen"})):(n=$t.patterns.match_("digits",e.d||""),r&&n&&""===n.remainder?($t.concatArray(l,$t.actions["d="](e,t)),$t.concatArray(l,this.output(e))):($t.concatArray(l,this.output(e)),$t.concatArray(l,$t.actions.bond(e,t,"-")))),l},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:$t.go(t,"o")}},comma:function(e,t){var r=t.replace(/\s*$/,"");return r!==t&&0===e.parenthesisLevel?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(e,t,r){var n,o,a;e.r?(o="M"===e.rdt?$t.go(e.rd,"tex-math"):"T"===e.rdt?[{type_:"text",p1:e.rd||""}]:$t.go(e.rd),a="M"===e.rqt?$t.go(e.rq,"tex-math"):"T"===e.rqt?[{type_:"text",p1:e.rq||""}]:$t.go(e.rq),n={type_:"arrow",r:e.r,rd:o,rq:a}):(n=[],(e.a||e.b||e.p||e.o||e.q||e.d||r)&&(e.sb&&n.push({type_:"entitySkip"}),e.o||e.q||e.d||e.b||e.p||2===r?e.o||e.q||e.d||!e.b&&!e.p?e.o&&"kv"===e.dType&&$t.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&"kv"===e.dType&&!e.q&&(e.dType=void 0):(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):(e.o=e.a,e.a=void 0),n.push({type_:"chemfive",a:$t.go(e.a,"a"),b:$t.go(e.b,"bd"),p:$t.go(e.p,"pq"),o:$t.go(e.o,"o"),q:$t.go(e.q,"pq"),d:$t.go(e.d,"oxidation"===e.dType?"oxidation":"bd"),dType:e.dType})));for(var s in e)"parenthesisLevel"!==s&&"beginsWithBond"!==s&&delete e[s];return n},"oxidation-output":function(e,t){var r=["{"];return $t.concatArray(r,$t.go(t,"oxidation")),r.push("}"),r},"frac-output":function(e,t){return{type_:"frac-ce",p1:$t.go(t[0]),p2:$t.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:$t.go(t[0]),p2:$t.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:$t.go(t[0]),p2:$t.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:$t.go(t[0]),p2:$t.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:$t.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,r){return{type_:"operator",kind_:r||t}}}},a:{transitions:$t.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:$t.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var r in e)delete e[r];return t}}}},pq:{transitions:$t.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:$t.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:$t.go(t[1],"pq")}}}},bd:{transitions:$t.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:$t.go(t[1],"bd")}}}},oxidation:{transitions:$t.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"tex-math tight":{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"9,9":{transitions:$t.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var r=[];return"+-"===t[0]||"+/-"===t[0]?r.push("\\pm "):t[0]&&r.push(t[0]),t[1]&&($t.concatArray(r,$t.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?$t.concatArray(r,$t.go(t[2],"pu-9,9")):r.push(t[2])),t[3]=t[4]||t[3],t[3]&&(t[3]=t[3].trim(),"e"===t[3]||"*"===t[3].substr(0,1)?r.push({type_:"cdot"}):r.push({type_:"times"}))),t[3]&&r.push("10^{"+t[5]+"}"),r},"number^":function(e,t){var r=[];return"+-"===t[0]||"+/-"===t[0]?r.push("\\pm "):t[0]&&r.push(t[0]),$t.concatArray(r,$t.go(t[1],"pu-9,9")),r.push("^{"+t[2]+"}"),r},operator:function(e,t,r){return{type_:"operator",kind_:r||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,r=$t.patterns.match_("{(...)}",e.d||"");r&&""===r.remainder&&(e.d=r.match_);var n=$t.patterns.match_("{(...)}",e.q||"");if(n&&""===n.remainder&&(e.q=n.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var o={d:$t.go(e.d,"pu"),q:$t.go(e.q,"pu")};"//"===e.o?t={type_:"pu-frac",p1:o.d,p2:o.q}:(t=o.d,o.d.length>1||o.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),$t.concatArray(t,o.q))}else t=$t.go(e.d,"pu-2");for(var a in e)delete e[a];return t}}},"pu-2":{transitions:$t.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var r=$t.patterns.match_("{(...)}",e.rm||"");t=r&&""===r.remainder?$t.go(r.match_,"pu"):{type_:"rm",p1:e.rm}}for(var n in e)delete e[n];return t}}},"pu-9,9":{transitions:$t.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var r=e.text_.length%3;0===r&&(r=3);for(var n=e.text_.length-3;n>0;n-=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,r)),t.reverse()}else t.push(e.text_);for(var o in e)delete e[o];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var r=e.text_.length-3,n=0;n<r;n+=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(n))}else t.push(e.text_);for(var o in e)delete e[o];return t}}}};var Mt={go:function(e,t){if(!e)return"";for(var r="",n=!1,o=0;o<e.length;o++){var a=e[o];"string"==typeof a?r+=a:(r+=Mt._go2(a),"1st-level escape"===a.type_&&(n=!0))}return t||n||!r||(r="{"+r+"}"),r},_goInner:function(e){return e?Mt.go(e,!0):e},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var r={a:Mt._goInner(e.a),b:Mt._goInner(e.b),p:Mt._goInner(e.p),o:Mt._goInner(e.o),q:Mt._goInner(e.q),d:Mt._goInner(e.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),t+=r.a+"\\,"),(r.b||r.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\vphantom{2}\\mathllap{"+(r.b||"")+"}}",t+="_{\\vphantom{2}\\mathllap{"+(r.p||"")+"}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),t+=r.o),"kv"===e.dType?((r.d||r.q)&&(t+="{\\vphantom{X}}"),r.d&&(t+="^{"+r.d+"}"),r.q&&(t+="_{"+r.q+"}")):"oxidation"===e.dType?(r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"),r.q&&(t+="{{}}",t+="_{"+r.q+"}")):(r.q&&(t+="{{}}",t+="_{"+r.q+"}"),r.d&&(t+="{{}}",t+="^{"+r.d+"}"));break;case"rm":case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+Mt._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+Mt._goInner(e.p1);break;case"bond":if(!(t=Mt._getBond(e.kind_)))throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var n="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+n+"}{"+n+"}{"+n+"}{"+n+"}";break;case"pu-frac":var o="\\frac{"+Mt._goInner(e.p1)+"}{"+Mt._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+o+"}{"+o+"}{"+o+"}{"+o+"}";break;case"tex-math":case"1st-level escape":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+Mt._goInner(e.p1)+"}{"+Mt._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+Mt._goInner(e.p1)+"}{"+Mt._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+Mt._goInner(e.p1)+"}{"+Mt._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+Mt._goInner(e.p1)+"}_{"+Mt._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+Mt._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var a={rd:Mt._goInner(e.rd),rq:Mt._goInner(e.rq)},s=Mt._getArrow(e.r);a.rq&&(s+="[{\\rm "+a.rq+"}]"),t=s+=a.rd?"{\\rm "+a.rd+"}":"{}";break;case"operator":t=Mt._getOperator(e.kind_);break;case"space":t=" ";break;case"entitySkip":case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\text{\\textbullet}\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":case"→":case"⟶":return"\\yields";case"<-":return"\\yieldsLeft";case"<->":return"\\mesomerism";case"<--\x3e":return"\\yieldsLeftRight";case"<=>":case"⇌":return"\\equilibrium";case"<=>>":return"\\equilibriumRight";case"<<=>":return"\\equilibriumLeft";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripleDash}";case"~-":return"{\\tripleDashOverLine}";case"~=":case"~--":return"{\\tripleDashOverDoubleLine}";case"-~-":return"{\\tripleDashBetweenDoubleLine}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function Bt(e){const t=[];e.consumeSpaces();let r=e.fetch().text;for("\\relax"===r&&(e.consume(),e.consumeSpaces(),r=e.fetch().text);"\\hline"===r||"\\hdashline"===r;)e.consume(),t.push("\\hdashline"===r),e.consumeSpaces(),r=e.fetch().text;return t}xt("\\darr","\\downarrow"),xt("\\dArr","\\Downarrow"),xt("\\Darr","\\Downarrow"),xt("\\lang","\\langle"),xt("\\rang","\\rangle"),xt("\\uarr","\\uparrow"),xt("\\uArr","\\Uparrow"),xt("\\Uarr","\\Uparrow"),xt("\\N","\\mathbb{N}"),xt("\\R","\\mathbb{R}"),xt("\\Z","\\mathbb{Z}"),xt("\\alef","\\aleph"),xt("\\alefsym","\\aleph"),xt("\\bull","\\bullet"),xt("\\clubs","\\clubsuit"),xt("\\cnums","\\mathbb{C}"),xt("\\Complex","\\mathbb{C}"),xt("\\Dagger","\\ddagger"),xt("\\diamonds","\\diamondsuit"),xt("\\empty","\\emptyset"),xt("\\exist","\\exists"),xt("\\harr","\\leftrightarrow"),xt("\\hArr","\\Leftrightarrow"),xt("\\Harr","\\Leftrightarrow"),xt("\\hearts","\\heartsuit"),xt("\\image","\\Im"),xt("\\infin","\\infty"),xt("\\isin","\\in"),xt("\\larr","\\leftarrow"),xt("\\lArr","\\Leftarrow"),xt("\\Larr","\\Leftarrow"),xt("\\lrarr","\\leftrightarrow"),xt("\\lrArr","\\Leftrightarrow"),xt("\\Lrarr","\\Leftrightarrow"),xt("\\natnums","\\mathbb{N}"),xt("\\plusmn","\\pm"),xt("\\rarr","\\rightarrow"),xt("\\rArr","\\Rightarrow"),xt("\\Rarr","\\Rightarrow"),xt("\\real","\\Re"),xt("\\reals","\\mathbb{R}"),xt("\\Reals","\\mathbb{R}"),xt("\\sdot","\\cdot"),xt("\\sect","\\S"),xt("\\spades","\\spadesuit"),xt("\\sub","\\subset"),xt("\\sube","\\subseteq"),xt("\\supe","\\supseteq"),xt("\\thetasym","\\vartheta"),xt("\\weierp","\\wp"),xt("\\quantity","{\\left\\{ #1 \\right\\}}"),xt("\\qty","{\\left\\{ #1 \\right\\}}"),xt("\\pqty","{\\left( #1 \\right)}"),xt("\\bqty","{\\left[ #1 \\right]}"),xt("\\vqty","{\\left\\vert #1 \\right\\vert}"),xt("\\Bqty","{\\left\\{ #1 \\right\\}}"),xt("\\absolutevalue","{\\left\\vert #1 \\right\\vert}"),xt("\\abs","{\\left\\vert #1 \\right\\vert}"),xt("\\norm","{\\left\\Vert #1 \\right\\Vert}"),xt("\\evaluated","{\\left.#1 \\right\\vert}"),xt("\\eval","{\\left.#1 \\right\\vert}"),xt("\\order","{\\mathcal{O} \\left( #1 \\right)}"),xt("\\commutator","{\\left[ #1 , #2 \\right]}"),xt("\\comm","{\\left[ #1 , #2 \\right]}"),xt("\\anticommutator","{\\left\\{ #1 , #2 \\right\\}}"),xt("\\acomm","{\\left\\{ #1 , #2 \\right\\}}"),xt("\\poissonbracket","{\\left\\{ #1 , #2 \\right\\}}"),xt("\\pb","{\\left\\{ #1 , #2 \\right\\}}"),xt("\\vectorbold","{\\boldsymbol{ #1 }}"),xt("\\vb","{\\boldsymbol{ #1 }}"),xt("\\vectorarrow","{\\vec{\\boldsymbol{ #1 }}}"),xt("\\va","{\\vec{\\boldsymbol{ #1 }}}"),xt("\\vectorunit","{{\\boldsymbol{\\hat{ #1 }}}}"),xt("\\vu","{{\\boldsymbol{\\hat{ #1 }}}}"),xt("\\dotproduct","\\mathbin{\\boldsymbol\\cdot}"),xt("\\vdot","{\\boldsymbol\\cdot}"),xt("\\crossproduct","\\mathbin{\\boldsymbol\\times}"),xt("\\cross","\\mathbin{\\boldsymbol\\times}"),xt("\\cp","\\mathbin{\\boldsymbol\\times}"),xt("\\gradient","{\\boldsymbol\\nabla}"),xt("\\grad","{\\boldsymbol\\nabla}"),xt("\\divergence","{\\grad\\vdot}"),xt("\\curl","{\\grad\\cross}"),xt("\\laplacian","\\nabla^2"),xt("\\tr","{\\operatorname{tr}}"),xt("\\Tr","{\\operatorname{Tr}}"),xt("\\rank","{\\operatorname{rank}}"),xt("\\erf","{\\operatorname{erf}}"),xt("\\Res","{\\operatorname{Res}}"),xt("\\principalvalue","{\\mathcal{P}}"),xt("\\pv","{\\mathcal{P}}"),xt("\\PV","{\\operatorname{P.V.}}"),xt("\\qqtext","{\\quad\\text{ #1 }\\quad}"),xt("\\qq","{\\quad\\text{ #1 }\\quad}"),xt("\\qcomma","{\\text{,}\\quad}"),xt("\\qc","{\\text{,}\\quad}"),xt("\\qcc","{\\quad\\text{c.c.}\\quad}"),xt("\\qif","{\\quad\\text{if}\\quad}"),xt("\\qthen","{\\quad\\text{then}\\quad}"),xt("\\qelse","{\\quad\\text{else}\\quad}"),xt("\\qotherwise","{\\quad\\text{otherwise}\\quad}"),xt("\\qunless","{\\quad\\text{unless}\\quad}"),xt("\\qgiven","{\\quad\\text{given}\\quad}"),xt("\\qusing","{\\quad\\text{using}\\quad}"),xt("\\qassume","{\\quad\\text{assume}\\quad}"),xt("\\qsince","{\\quad\\text{since}\\quad}"),xt("\\qlet","{\\quad\\text{let}\\quad}"),xt("\\qfor","{\\quad\\text{for}\\quad}"),xt("\\qall","{\\quad\\text{all}\\quad}"),xt("\\qeven","{\\quad\\text{even}\\quad}"),xt("\\qodd","{\\quad\\text{odd}\\quad}"),xt("\\qinteger","{\\quad\\text{integer}\\quad}"),xt("\\qand","{\\quad\\text{and}\\quad}"),xt("\\qor","{\\quad\\text{or}\\quad}"),xt("\\qas","{\\quad\\text{as}\\quad}"),xt("\\qin","{\\quad\\text{in}\\quad}"),xt("\\differential","{\\text{d}}"),xt("\\dd","{\\text{d}}"),xt("\\derivative","{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}"),xt("\\dv","{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}"),xt("\\partialderivative","{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}"),xt("\\variation","{\\delta}"),xt("\\var","{\\delta}"),xt("\\functionalderivative","{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}"),xt("\\fdv","{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}"),xt("\\innerproduct","{\\left\\langle {#1} \\mid { #2} \\right\\rangle}"),xt("\\outerproduct","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}"),xt("\\dyad","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}"),xt("\\ketbra","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}"),xt("\\op","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}"),xt("\\expectationvalue","{\\left\\langle {#1 } \\right\\rangle}"),xt("\\expval","{\\left\\langle {#1 } \\right\\rangle}"),xt("\\ev","{\\left\\langle {#1 } \\right\\rangle}"),xt("\\matrixelement","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}"),xt("\\matrixel","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}"),xt("\\mel","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");const Ct=e=>{if(!e.parser.settings.displayMode)throw new r(`{${e.envName}} can be used only in display mode.`)},zt=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Lt=e=>{let t=e.get("\\arraystretch");"string"!=typeof t&&(t=wt(t.tokens)),t=isNaN(t)?null:Number(t);let r=e.get("\\arraycolsep");"string"!=typeof r&&(r=wt(r.tokens));const n=zt.exec(r);return[t,n?{number:+(n[1]+n[2]),unit:n[3]}:null]},It=e=>{let t="";for(let n=0;n<e.length;n++)if("label"===e[n].type){if(t)throw new r("Multiple \\labels in one row");t=e[n].string}return t};function Dt(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Et(e,{cols:t,envClasses:n,autoTag:o,singleRow:a,emptySingleRow:s,maxNumCols:i,leqno:l,arraystretch:c,arraycolsep:u},p){e.gullet.beginGroup(),a||e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();let m=[];const d=[m],h=[],g=[],f=[],b=null!=o?[]:void 0;function x(){o&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new mt("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(o)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(x(),f.push(Bt(e));;){let t=e.parseExpression(!1,a?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),t={type:"ordgroup",mode:e.mode,body:t,semisimple:!0},m.push(t);const o=e.fetch().text;if("&"===o){if(i&&m.length===i){if(!n.includes("array"))throw new r(2===i?"The split environment accepts no more than two columns":"The equation environment accepts only one column",e.nextToken);if(e.settings.strict)throw new r("Too few columns specified in the {array} column argument.",e.nextToken)}e.consume()}else{if("\\end"===o){y(),1===m.length&&0===t.body.length&&(d.length>1||!s)&&d.pop(),g.push(It(t.body)),f.length<d.length+1&&f.push([]);break}if("\\\\"!==o)throw new r("Expected & or \\\\ or \\cr or \\end",e.nextToken);{let r;e.consume()," "!==e.gullet.future().text&&(r=e.parseSizeGroup(!0)),h.push(r?r.value:null),y(),g.push(It(t.body)),f.push(Bt(e)),m=[],d.push(m),x()}}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,body:d,cols:t,rowGaps:h,hLinesBeforeRow:f,envClasses:n,autoTag:o,scriptLevel:p,tags:b,labels:g,leqno:l,arraystretch:c,arraycolsep:u}}function Ft(e){return"d"===e.slice(0,1)?"display":"text"}const Gt={c:"center ",l:"left ",r:"right "},Pt=e=>{const t=new T.MathNode("mtd",[]);return t.style={padding:"0",width:"50%"},e.envClasses.includes("multline")&&(t.style.width="7.5%"),t},Rt=function(e,t){const r=[],n=e.body.length,o=e.hLinesBeforeRow;for(let a=0;a<n;a++){const s=e.body[a],i=[],l="text"===e.scriptLevel?ht:"script"===e.scriptLevel?gt:dt;for(let r=0;r<s.length;r++){const o=new T.MathNode("mtd",[me(s[r],t.withLevel(l))]);if(e.envClasses.includes("multline")){const e=0===a?"left":a===n-1?"right":"center";o.setAttribute("columnalign",e),"center"!==e&&o.classes.push("tml-"+e)}i.push(o)}const c=e.body[0].length;for(let e=0;e<c-s.length;e++)i.push(new T.MathNode("mtd",[],t));if(e.autoTag){const r=e.tags[a];let n;!0===r?n=new T.MathNode("mtext",[new w(["tml-eqn"])]):!1===r?n=new T.MathNode("mtext",[],[]):(n=pe(r[0].body,t.withLevel(l),!0),n=ae(n),n.classes=["tml-tag"]),n&&(i.unshift(Pt(e)),i.push(Pt(e)),e.leqno?(i[0].children.push(n),i[0].classes.push("tml-left")):(i[i.length-1].children.push(n),i[i.length-1].classes.push("tml-right")))}const u=new T.MathNode("mtr",i,[]),p=e.labels.shift();p&&e.tags&&e.tags[a]&&(u.setAttribute("id",p),Array.isArray(e.tags[a])&&u.classes.push("tml-tageqn")),0===a&&o[0].length>0&&(2===o[0].length?u.children.forEach((e=>{e.style.borderTop="0.15em double"})):u.children.forEach((e=>{e.style.borderTop=o[0][0]?"0.06em dashed":"0.06em solid"}))),o[a+1].length>0&&(2===o[a+1].length?u.children.forEach((e=>{e.style.borderBottom="0.15em double"})):u.children.forEach((e=>{e.style.borderBottom=o[a+1][0]?"0.06em dashed":"0.06em solid"}))),r.push(u)}if(e.envClasses.length>0){if(e.arraystretch&&1!==e.arraystretch){const t=String(1.4*e.arraystretch-.8)+"ex";for(let e=0;e<r.length;e++)for(let n=0;n<r[e].children.length;n++)r[e].children[n].style.paddingTop=t,r[e].children[n].style.paddingBottom=t}let n=e.envClasses.includes("abut")||e.envClasses.includes("cases")?"0":e.envClasses.includes("small")?"0.1389":e.envClasses.includes("cd")?"0.25":"0.4",o="em";if(e.arraycolsep){const r=Oe(e.arraycolsep,t);n=r.number.toFixed(4),o=r.unit}const a=0===r.length?0:r[0].children.length,s=(t,r)=>0===t&&0===r||t===a-1&&1===r?"0":"align"!==e.envClasses[0]?n:1===r?"0":e.autoTag?t%2?"1":"0":t%2?"0":"1";for(let e=0;e<r.length;e++)for(let t=0;t<r[e].children.length;t++)r[e].children[t].style.paddingLeft=`${s(t,0)}${o}`,r[e].children[t].style.paddingRight=`${s(t,1)}${o}`;const i=e.envClasses.includes("align")||e.envClasses.includes("alignat");for(let t=0;t<r.length;t++){const n=r[t];if(i){for(let e=0;e<n.children.length;e++)n.children[e].classes=["tml-"+(e%2?"left":"right")];if(e.autoTag){const t=e.leqno?0:n.children.length-1;n.children[t].classes=["tml-"+(e.leqno?"left":"right")]}}if(n.children.length>1&&e.envClasses.includes("cases")&&(n.children[1].style.paddingLeft="1em"),e.envClasses.includes("cases")||e.envClasses.includes("subarray"))for(const e of n.children)e.classes.push("tml-left")}}else for(let e=0;e<r.length;e++)r[e].children[0].style.paddingLeft="0em",r[e].children.length===r[0].children.length&&(r[e].children[r[e].children.length-1].style.paddingRight="0em");let a=new T.MathNode("mtable",r);e.envClasses.length>0&&(e.envClasses.includes("jot")?a.classes.push("tml-jot"):e.envClasses.includes("small")&&a.classes.push("tml-small")),"display"===e.scriptLevel&&a.setAttribute("displaystyle","true"),(e.autoTag||e.envClasses.includes("multline"))&&(a.style.width="100%");let s="";if(e.cols&&e.cols.length>0){const t=e.cols;let r=!1,n=0,o=t.length;for(;"separator"===t[n].type;)n+=1;for(;"separator"===t[o-1].type;)o-=1;if("separator"===t[0].type){const e="separator"===t[1].type?"0.15em double":"|"===t[0].separator?"0.06em solid ":"0.06em dashed ";for(const t of a.children)t.children[0].style.borderLeft=e}let i=e.autoTag?0:-1;for(let e=n;e<o;e++)if("align"===t[e].type){const n=Gt[t[e].align];s+=n,i+=1;for(const e of a.children)"center"!==n.trim()&&i<e.children.length&&(e.children[i].classes=["tml-"+n.trim()]);r=!0}else if("separator"===t[e].type){if(r){const r="separator"===t[e+1].type?"0.15em double":"|"===t[e].separator?"0.06em solid":"0.06em dashed";for(const e of a.children)i<e.children.length&&(e.children[i].style.borderRight=r)}r=!1}if("separator"===t[t.length-1].type){const e="separator"===t[t.length-2].type?"0.15em double":"|"===t[t.length-1].separator?"0.06em solid":"0.06em dashed";for(const t of a.children)t.children[t.children.length-1].style.borderRight=e,t.children[t.children.length-1].style.paddingRight="0.4em"}}return e.autoTag&&(s="left "+(s.length>0?s:"center ")+"right "),s&&a.setAttribute("columnalign",s.trim()),e.envClasses.includes("small")&&(a=new T.MathNode("mstyle",[a]),a.setAttribute("scriptlevel","1")),a},jt=function(e,t){-1===e.envName.indexOf("ed")&&Ct(e);const n="split"===e.envName,o=[],a=Et(e.parser,{cols:o,emptySingleRow:!0,autoTag:n?void 0:Dt(e.envName),envClasses:["abut","jot"],maxNumCols:"split"===e.envName?2:void 0,leqno:e.parser.settings.leqno},"display");let s,i=0;const l=e.envName.indexOf("at")>-1;if(t[0]&&l){let e="";for(let r=0;r<t[0].body.length;r++){e+=Le(t[0].body[r],"textord").text}if(isNaN(e))throw new r("The alignat enviroment requires a numeric first argument.");s=Number(e),i=2*s}a.body.forEach((function(e){if(l){const t=e.length/2;if(s<t)throw new r(`Too many math in a row: expected ${s}, but got ${t}`,e[0])}else i<e.length&&(i=e.length)}));for(let e=0;e<i;++e){let t="r";e%2==1&&(t="l"),o[e]={type:"align",align:t}}return"split"===e.envName||(l?a.envClasses.push("alignat"):a.envClasses[0]="align"),a};ut({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){const n=(De(t[0])?[t[0]]:Le(t[0],"ordgroup").body).map((function(e){const t=Ie(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new r("Unknown column alignment: "+t,e)})),[o,a]=Lt(e.parser.gullet.macros),s={cols:n,envClasses:["array"],maxNumCols:n.length,arraystretch:o,arraycolsep:a};return Et(e.parser,s,Ft(e.envName))},mathmlBuilder:Rt}),ut({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){const t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")];let n="c";const o={envClasses:[],cols:[]};if("*"===e.envName.charAt(e.envName.length-1)){const t=e.parser;if(t.consumeSpaces(),"["===t.fetch().text){if(t.consume(),t.consumeSpaces(),n=t.fetch().text,-1==="lcr".indexOf(n))throw new r("Expected l or c or r",t.nextToken);t.consume(),t.consumeSpaces(),t.expect("]"),t.consume(),o.cols=[]}}const a=Et(e.parser,o,"text");a.cols=new Array(a.body[0].length).fill({type:"align",align:n});const[s,i]=Lt(e.parser.gullet.macros);return t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0,arraystretch:s,arraycolsep:i}:a},mathmlBuilder:Rt}),ut({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){const t=Et(e.parser,{type:"small"},"script");return t.envClasses=["small"],t},mathmlBuilder:Rt}),ut({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){const n=(De(t[0])?[t[0]]:Le(t[0],"ordgroup").body).map((function(e){const t=Ie(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new r("Unknown column alignment: "+t,e)}));if(n.length>1)throw new r("{subarray} can contain only one column");let o={cols:n,envClasses:["small"]};if(o=Et(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new r("{subarray} can contain only one column");return o},mathmlBuilder:Rt}),ut({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){const t=Et(e.parser,{cols:[],envClasses:["cases"]},Ft(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},mathmlBuilder:Rt}),ut({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:jt,mathmlBuilder:Rt}),ut({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:jt,mathmlBuilder:Rt}),ut({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){"gathered"!==e.envName&&Ct(e);const t={cols:[],envClasses:["abut","jot"],autoTag:Dt(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Et(e.parser,t,"display")},mathmlBuilder:Rt}),ut({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ct(e);const t={autoTag:Dt(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,envClasses:["align"],leqno:e.parser.settings.leqno};return Et(e.parser,t,"display")},mathmlBuilder:Rt}),ut({type:"array",names:["multline","multline*"],props:{numArgs:0},handler(e){Ct(e);const t={autoTag:"multline"===e.envName,maxNumCols:1,envClasses:["jot","multline"],leqno:e.parser.settings.leqno};return Et(e.parser,t,"display")},mathmlBuilder:Rt}),ut({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ct(e),function(e){const t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();const n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new r("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}let n=[];const o=[n];for(let i=0;i<t.length;i++){const l=t[i];let c={type:"styling",body:[],mode:"math",scriptLevel:"display"};for(let t=0;t<l.length;t++)if(Fe(l[t])){n.push(c),t+=1;const o=Ie(l[t]).text,i=new Array(2);if(i[0]={type:"ordgroup",mode:"math",body:[]},i[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(o)>-1);else{if(!("<>AV".indexOf(o)>-1))throw new r('Expected one of "<>AV=|." after @.');for(let e=0;e<2;e++){let n=!0;for(let c=t+1;c<l.length;c++){if(s=o,("mathord"===(a=l[c]).type||"atom"===a.type)&&a.text===s){n=!1,t=c;break}if(Fe(l[c]))throw new r("Missing a "+o+" character to complete a CD arrow.",l[c]);i[e].body.push(l[c])}if(n)throw new r("Missing a "+o+" character to complete a CD arrow.",l[t])}}const u=Ge(o,i,e);n.push(u),c={type:"styling",body:[],mode:"math",scriptLevel:"display"}}else c.body.push(l[t]);i%2==0?n.push(c):n.shift(),n=[],o.push(n)}var a,s;return o.pop(),e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:o,tags:null,labels:new Array(o.length+1).fill(""),envClasses:["jot","cd"],cols:[],hLinesBeforeRow:new Array(o.length+1).fill([])}}(e.parser)),mathmlBuilder:Rt}),p({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new r(`${e.funcName} valid only within array environment`)}});const Ut=ct;p({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler({parser:e,funcName:t},n){const o=n[0];if("ordgroup"!==o.type)throw new r("Invalid environment name",o);let a="";for(let e=0;e<o.body.length;++e)a+=Le(o.body[e],"textord").text;if("\\begin"===t){if(!Object.prototype.hasOwnProperty.call(Ut,a))throw new r("No such environment: "+a,o);const t=Ut[a],{args:n,optArgs:s}=e.parseArguments("\\begin{"+a+"}",t),i={mode:e.mode,envName:a,parser:e},l=t.handler(i,n,s);e.expect("\\end",!1);const c=e.nextToken,u=Le(e.parseFunction(),"environment");if(u.name!==a)throw new r(`Mismatch: \\begin{${a}} matched by \\end{${u.name}}`,c);return l}return{type:"environment",mode:e.mode,name:a,nameGroup:o}}}),p({type:"envTag",names:["\\env@tag"],props:{numArgs:1,argTypes:["math"]},handler:({parser:e},t)=>({type:"envTag",mode:e.mode,body:t[0]}),mathmlBuilder:(e,t)=>new T.MathNode("mrow")}),p({type:"noTag",names:["\\env@notag"],props:{numArgs:0},handler:({parser:e})=>({type:"noTag",mode:e.mode}),mathmlBuilder:(e,t)=>new T.MathNode("mrow")});const Vt=(e,t)=>{const r=e.font,n=t.withFont(r),o=me(e.body,n);if(0===o.children.length)return o;if("boldsymbol"===r&&["mo","mpadded","mrow"].includes(o.type))return o.style.fontWeight="bold",o;if(((e,t)=>{if("mathrm"!==t||"ordgroup"!==e.body.type||1===e.body.body.length)return!1;if("mathord"!==e.body.body[0].type)return!1;for(let t=1;t<e.body.body.length;t++){const r=e.body.body[t].type;if("mathord"!==r&&("textord"!==r||isNaN(e.body.body[t].text)))return!1}return!0})(e,r)){const e=o.children[0].children[0];delete e.attributes.mathvariant;for(let t=1;t<o.children.length;t++)e.children[0].text+="mn"===o.children[t].type?o.children[t].children[0].text:o.children[t].children[0].children[0].text;const t=new T.MathNode("mtext",new T.TextNode("​"));return new T.MathNode("mrow",[t,e])}let a="mo"===o.children[0].type;for(let e=1;e<o.children.length;e++){"mo"===o.children[e].type&&"boldsymbol"===r&&(o.children[e].style.fontWeight="bold"),"mi"!==o.children[e].type&&(a=!1);"normal"!==(o.children[e].attributes&&o.children[e].attributes.mathvariant||"")&&(a=!1)}if(!a)return o;const s=o.children[0];for(let e=1;e<o.children.length;e++)s.children.push(o.children[e].children[0]);if(s.attributes.mathvariant&&"normal"===s.attributes.mathvariant){const e=new T.MathNode("mtext",new T.TextNode("​"));return new T.MathNode("mrow",[e,s])}return s},Zt={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};p({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\up@greek","\\boldsymbol","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathsfit","\\mathtt","\\Bbb","\\bm","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},r)=>{const n=d(r[0]);let o=t;return o in Zt&&(o=Zt[o]),{type:"font",mode:e.mode,font:o.slice(1),body:n}},mathmlBuilder:Vt}),p({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:({parser:e,funcName:t,breakOnTokenText:r},n)=>{const{mode:o}=e,a=e.parseExpression(!0,r,!0);return{type:"font",mode:o,font:`math${t.slice(1)}`,body:{type:"ordgroup",mode:e.mode,body:a}}},mathmlBuilder:Vt});const Ht=["display","text","script","scriptscript"],Wt={auto:-1,display:0,text:0,script:1,scriptscript:2},Xt=(e,t)=>{const r="auto"===e.scriptLevel?t.incrementLevel():"display"===e.scriptLevel?t.withLevel(ht):"text"===e.scriptLevel?t.withLevel(gt):t.withLevel(ft),n=me(e.numer,r),o=me(e.denom,r);3===t.level&&(n.style.mathDepth="2",n.setAttribute("scriptlevel","2"),o.style.mathDepth="2",o.setAttribute("scriptlevel","2"));let a=new T.MathNode("mfrac",[n,o]);if(e.hasBarLine){if(e.barSize){const r=Oe(e.barSize,t);a.setAttribute("linethickness",r.number+r.unit)}}else a.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){const t=[];if(null!=e.leftDelim){const r=new T.MathNode("mo",[new T.TextNode(e.leftDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}if(t.push(a),null!=e.rightDelim){const r=new T.MathNode("mo",[new T.TextNode(e.rightDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}a=se(t)}return"auto"!==e.scriptLevel&&(a=new T.MathNode("mstyle",[a]),a.setAttribute("displaystyle",String("display"===e.scriptLevel)),a.setAttribute("scriptlevel",Wt[e.scriptLevel])),a};p({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:({parser:e,funcName:t},r)=>{const n=r[0],o=r[1];let a=!1,s=null,i=null,l="auto";switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s="(",i=")";break;case"\\\\bracefrac":s="\\{",i="\\}";break;case"\\\\brackfrac":s="[",i="]";break;default:throw new Error("Unrecognized genfrac command")}switch(t){case"\\dfrac":case"\\dbinom":l="display";break;case"\\tfrac":case"\\tbinom":l="text"}return{type:"genfrac",mode:e.mode,continued:!1,numer:n,denom:o,hasBarLine:a,leftDelim:s,rightDelim:i,scriptLevel:l,barSize:null}},mathmlBuilder:Xt}),p({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:({parser:e,funcName:t},r)=>{const n=r[0],o=r[1];return{type:"genfrac",mode:e.mode,continued:!0,numer:n,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,scriptLevel:"display",barSize:null}}}),p({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler({parser:e,funcName:t,token:r}){let n;switch(t){case"\\over":n="\\frac";break;case"\\choose":n="\\binom";break;case"\\atop":n="\\\\atopfrac";break;case"\\brace":n="\\\\bracefrac";break;case"\\brack":n="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:n,token:r}}});const Kt=function(e){let t=null;return e.length>0&&(t=e,t="."===t?null:t),t};p({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler({parser:e},t){const r=t[4],n=t[5],o=d(t[0]),a="atom"===o.type&&"open"===o.family?Kt(o.text):null,s=d(t[1]),i="atom"===s.type&&"close"===s.family?Kt(s.text):null,l=Le(t[2],"size");let c,u=null;l.isBlank?c=!0:(u=l.value,c=u.number>0);let p="auto",m=t[3];if("ordgroup"===m.type){if(m.body.length>0){const e=Le(m.body[0],"textord");p=Ht[Number(e.text)]}}else m=Le(m,"textord"),p=Ht[Number(m.text)];return{type:"genfrac",mode:e.mode,numer:r,denom:n,continued:!1,hasBarLine:c,barSize:u,leftDelim:a,rightDelim:i,scriptLevel:p}},mathmlBuilder:Xt}),p({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:({parser:e,funcName:t,token:r},n)=>({type:"infix",mode:e.mode,replaceWith:"\\\\abovefrac",barSize:Le(n[0],"size").value,token:r})}),p({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:({parser:e,funcName:t},r)=>{const n=r[0],o=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Le(r[1],"infix").barSize),a=r[2],s=o.number>0;return{type:"genfrac",mode:e.mode,numer:n,denom:a,continued:!1,hasBarLine:s,barSize:o,leftDelim:null,rightDelim:null,scriptLevel:"auto"}},mathmlBuilder:Xt}),p({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["hbox"],allowedInArgument:!0,allowedInText:!1},handler:({parser:e},t)=>({type:"hbox",mode:e.mode,body:h(t[0])}),mathmlBuilder(e,t){const r=t.withLevel(ht),n=pe(e.body,r);return ae(n)}});p({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:({parser:e,funcName:t},r)=>({type:"horizBrace",mode:e.mode,label:t,isOver:/^\\over/.test(t),base:r[0]}),mathmlBuilder:(e,t)=>{const r=B(e.label);return r.style["math-depth"]=0,new T.MathNode(e.isOver?"mover":"munder",[me(e.base,t),r])}}),p({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:({parser:e,token:t},n)=>{const o=n[1],a=Le(n[0],"url").url;if(!e.settings.isTrusted({command:"\\href",url:a}))throw new r('Function "\\href" is not trusted',t);return{type:"href",mode:e.mode,href:a,body:h(o)}},mathmlBuilder:(e,t)=>{const r=new q("math",[pe(e.body,t)]);return new k(e.href,[],[r])}}),p({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:({parser:e,token:t},n)=>{const o=Le(n[0],"url").url;if(!e.settings.isTrusted({command:"\\url",url:o}))throw new r('Function "\\url" is not trusted',t);const a=[];for(let e=0;e<o.length;e++){let t=o[e];"~"===t&&(t="\\textasciitilde"),a.push({type:"textord",mode:"text",text:t})}const s={type:"text",mode:e.mode,font:"\\texttt",body:a};return{type:"href",mode:e.mode,href:o,body:h(s)}}}),p({type:"html",names:["\\class","\\id","\\style","\\data"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:({parser:e,funcName:t,token:n},o)=>{const a=Le(o[0],"raw").string,s=o[1];if(e.settings.strict)throw new r(`Function "${t}" is disabled in strict mode`,n);let i;const l={};switch(t){case"\\class":l.class=a,i={command:"\\class",class:a};break;case"\\id":l.id=a,i={command:"\\id",id:a};break;case"\\style":l.style=a,i={command:"\\style",style:a};break;case"\\data":{const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split("=");if(2!==n.length)throw new r("Error parsing key-value for \\data");l["data-"+n[0].trim()]=n[1].trim()}i={command:"\\data",attributes:l};break}default:throw new Error("Unrecognized html command")}if(!e.settings.isTrusted(i))throw new r(`Function "${t}" is not trusted`,n);return{type:"html",mode:e.mode,attributes:l,body:h(s)}},mathmlBuilder:(e,t)=>{const r=pe(e.body,t),n=[];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/)),r.classes=n;for(const t in e.attributes)"class"!==t&&Object.prototype.hasOwnProperty.call(e.attributes,t)&&r.setAttribute(t,e.attributes[t]);return r}});const Yt=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};{const t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new r("Invalid size: '"+e+"' in \\includegraphics");const n={number:+(t[1]+t[2]),unit:t[3]};if(!Te(n))throw new r("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n}};p({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:({parser:e,token:t},n,o)=>{let a={number:0,unit:"em"},s={number:.9,unit:"em"},i={number:0,unit:"em"},l="";if(o[0]){const e=Le(o[0],"raw").string.split(",");for(let t=0;t<e.length;t++){const n=e[t].split("=");if(2===n.length){const e=n[1].trim();switch(n[0].trim()){case"alt":l=e;break;case"width":a=Yt(e);break;case"height":s=Yt(e);break;case"totalheight":i=Yt(e);break;default:throw new r("Invalid key: '"+n[0]+"' in \\includegraphics.")}}}}const c=Le(n[0],"url").url;if(""===l&&(l=c,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),!e.settings.isTrusted({command:"\\includegraphics",url:c}))throw new r('Function "\\includegraphics" is not trusted',t);return{type:"includegraphics",mode:e.mode,alt:l,width:a,height:s,totalheight:i,src:c}},mathmlBuilder:(e,t)=>{const r=Oe(e.height,t),n={number:0,unit:"em"};e.totalheight.number>0&&e.totalheight.unit===r.unit&&e.totalheight.number>r.number&&(n.number=e.totalheight.number-r.number,n.unit=r.unit);let o=0;e.width.number>0&&(o=Oe(e.width,t));const a={height:r.number+n.number+"em"};o.number>0&&(a.width=o.number+o.unit),n.number>0&&(a.verticalAlign=-n.number+n.unit);const s=new A(e.src,e.alt,a);return s.height=r,s.depth=n,new T.MathNode("mtext",[s])}}),p({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler({parser:e,funcName:t,token:n},o){const a=Le(o[0],"size");if(e.settings.strict){const o="m"===t[1],s="mu"===a.value.unit;if(o){if(!s)throw new r(`LaTeX's ${t} supports only mu units, not ${a.value.unit} units`,n);if("math"!==e.mode)throw new r(`LaTeX's ${t} works only in math mode`,n)}else if(s)throw new r(`LaTeX's ${t} doesn't support mu units`,n)}return{type:"kern",mode:e.mode,dimension:a.value}},mathmlBuilder(e,t){const r=Oe(e.dimension,t),n="em"===r.unit?Jt(r.number):"";if("text"===e.mode&&n.length>0){const e=new T.TextNode(n);return new T.MathNode("mtext",[e])}{const e=new T.MathNode("mspace");return e.setAttribute("width",r.number+r.unit),r.number<0&&(e.style.marginLeft=r.number+r.unit),e}}});const Jt=function(e){return e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":""},Qt=/[^A-Za-z_0-9-]/g;p({type:"label",names:["\\label"],props:{numArgs:1,argTypes:["raw"]},handler:({parser:e},t)=>({type:"label",mode:e.mode,string:t[0].string.replace(Qt,"")}),mathmlBuilder(e,t){const r=new T.MathNode("mrow",[],["tml-label"]);return e.string.length>0&&r.setLabel(e.string),r}});const er=["\\clap","\\llap","\\rlap"];p({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap","\\clap","\\llap","\\rlap"],props:{numArgs:1,allowedInText:!0},handler:({parser:e,funcName:t,token:n},o)=>{if(er.includes(t)){if(e.settings.strict&&"text"!==e.mode)throw new r(`{${t}} can be used only in text mode.\n Try \\math${t.slice(1)}`,n);t=t.slice(1)}else t=t.slice(5);const a=o[0];return{type:"lap",mode:e.mode,alignment:t,body:a}},mathmlBuilder:(e,t)=>{let r;if("llap"===e.alignment){const n=ue(h(e.body),t),o=new T.MathNode("mphantom",n);r=new T.MathNode("mpadded",[o]),r.setAttribute("width","0px")}const n=me(e.body,t);let o;if("llap"===e.alignment?(n.style.position="absolute",n.style.right="0",n.style.bottom="0",o=new T.MathNode("mpadded",[r,n])):o=new T.MathNode("mpadded",[n]),"rlap"===e.alignment)e.body.body.length>0&&"genfrac"===e.body.body[0].type&&o.setAttribute("lspace","0.16667em");else{const t="llap"===e.alignment?"-1":"-0.5";o.setAttribute("lspace",t+"width"),"llap"===e.alignment?o.style.position="relative":(o.style.display="flex",o.style.justifyContent="center")}return o.setAttribute("width","0px"),o}}),p({type:"ordgroup",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler({funcName:e,parser:t},r){const n=t.mode;t.switchMode("math");const o="\\("===e?"\\)":"$",a=t.parseExpression(!1,o);return t.expect(o),t.switchMode(n),{type:"ordgroup",mode:t.mode,body:a}}}),p({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new r(`Mismatched ${e.funcName}`,t)}});p({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:({parser:e},t)=>({type:"mathchoice",mode:e.mode,display:h(t[0]),text:h(t[1]),script:h(t[2]),scriptscript:h(t[3])}),mathmlBuilder:(e,t)=>{const r=((e,t)=>{switch(t.level){case dt:return e.display;case ht:return e.text;case gt:return e.script;case ft:return e.scriptscript;default:return e.text}})(e,t);return pe(r,t)}});const tr=["text","textord","mathord","atom"],rr=e=>{const t=new T.MathNode("mspace");return t.setAttribute("width",e+"em"),t};function nr(e,t){let r;const n=ue(e.body,t);if("minner"===e.mclass)r=new T.MathNode("mpadded",n);else if("mord"===e.mclass)e.isCharacterBox||"mathord"===n[0].type?(r=n[0],r.type="mi",1===r.children.length&&r.children[0].text&&"∇"===r.children[0].text&&r.setAttribute("mathvariant","normal")):r=new T.MathNode("mi",n);else{r=new T.MathNode("mrow",n),e.mustPromote?(r=n[0],r.type="mo",e.isCharacterBox&&e.body[0].text&&/[A-Za-z]/.test(e.body[0].text)&&r.setAttribute("mathvariant","italic")):r=new T.MathNode("mrow",n);const o=t.level<2;"mrow"===r.type?o&&("mbin"===e.mclass?(r.children.unshift(rr(.2222)),r.children.push(rr(.2222))):"mrel"===e.mclass?(r.children.unshift(rr(.2778)),r.children.push(rr(.2778))):"mpunct"===e.mclass?r.children.push(rr(.1667)):"minner"===e.mclass&&(r.children.unshift(rr(.0556)),r.children.push(rr(.0556)))):"mbin"===e.mclass?(r.attributes.lspace=o?"0.2222em":"0",r.attributes.rspace=o?"0.2222em":"0"):"mrel"===e.mclass?(r.attributes.lspace=o?"0.2778em":"0",r.attributes.rspace=o?"0.2778em":"0"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace=o?"0.1667em":"0"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&o&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em"),"mopen"!==e.mclass&&"mclose"!==e.mclass&&(delete r.attributes.stretchy,delete r.attributes.form)}return r}p({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler({parser:e,funcName:t},r){const n=r[0],o=i.isCharacterBox(n);let a=!0;const s={type:"mathord",text:"",mode:e.mode},l=n.body?n.body:[n];for(const t of l){if(!tr.includes(t.type)){a=!1;break}I[e.mode][t.text]?s.text+=I[e.mode][t.text].replace:t.text?s.text+=t.text:t.body&&t.body.map((e=>{s.text+=e.text}))}return{type:"mclass",mode:e.mode,mclass:"m"+t.slice(5),body:h(a?s:n),isCharacterBox:o,mustPromote:a}},mathmlBuilder:nr});const or=e=>{const t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};p({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:({parser:e},t)=>({type:"mclass",mode:e.mode,mclass:or(t[0]),body:h(t[1]),isCharacterBox:i.isCharacterBox(t[1])})}),p({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler({parser:e,funcName:t},r){const n=r[1],o=r[0],a={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,stack:!0,suppressBaseShift:"\\stackrel"!==t,body:h(n)};return{type:"supsub",mode:o.mode,base:a,sup:"\\underset"===t?null:o,sub:"\\underset"===t?o:null}},mathmlBuilder:nr});const ar=(e,t,r)=>{if(!e)return r;const n=me(e,t);return"mrow"===n.type&&0===n.children.length?r:n};p({type:"multiscript",names:["\\sideset","\\pres@cript"],props:{numArgs:3},handler({parser:e,funcName:t,token:n},o){if(0===o[2].body.length)throw new r(t+"cannot parse an empty base.");const a=o[2].body[0];if(e.settings.strict&&"\\sideset"===t&&!a.symbol)throw new r("The base of \\sideset must be a big operator. Try \\prescript.");if(o[0].body.length>0&&"supsub"!==o[0].body[0].type||o[1].body.length>0&&"supsub"!==o[1].body[0].type)throw new r("\\sideset can parse only subscripts and superscripts in its first two arguments",n);const s=o[0].body.length>0?o[0].body[0]:null,i=o[1].body.length>0?o[1].body[0]:null;return s||i?s?{type:"multiscript",mode:e.mode,isSideset:"\\sideset"===t,prescripts:s,postscripts:i,base:a}:{type:"styling",mode:e.mode,scriptLevel:"text",body:[{type:"supsub",mode:e.mode,base:a,sup:i.sup,sub:i.sub}]}:a},mathmlBuilder(e,t){const r=me(e.base,t),n=new T.MathNode("mprescripts"),o=new T.MathNode("none");let a=[];const s=ar(e.prescripts.sub,t,o),i=ar(e.prescripts.sup,t,o);if(e.isSideset&&(s.setAttribute("style","text-align: left;"),i.setAttribute("style","text-align: left;")),e.postscripts){a=[r,ar(e.postscripts.sub,t,o),ar(e.postscripts.sup,t,o),n,s,i]}else a=[r,n,s,i];return new T.MathNode("mmultiscripts",a)}}),p({type:"not",names:["\\not"],props:{numArgs:1,primitive:!0,allowedInText:!1},handler({parser:e},t){const r=i.isCharacterBox(t[0]);let n;if(r)n=h(t[0]),"\\"===n[0].text.charAt(0)&&(n[0].text=I.math[n[0].text].replace),n[0].text=n[0].text.slice(0,1)+"̸"+n[0].text.slice(1);else{n=[{type:"textord",mode:"math",text:"̸"},{type:"kern",mode:"math",dimension:{number:-.6,unit:"em"}},t[0]]}return{type:"not",mode:e.mode,body:n,isCharacterBox:r}},mathmlBuilder(e,t){if(e.isCharacterBox){return ue(e.body,t,!0)[0]}return pe(e.body,t)}});const sr=["textord","mathord","atom"],ir=["\\smallint"],lr=["textord","mathord","ordgroup","close","leftright","font"],cr=e=>{e.attributes.lspace="0.1667em",e.attributes.rspace="0.1667em"},ur=(e,t)=>{let r;if(e.symbol)r=new q("mo",[ne(e.name,e.mode)]),ir.includes(e.name)?r.setAttribute("largeop","false"):r.setAttribute("movablelimits","false"),e.fromMathOp&&cr(r);else if(e.body)r=new q("mo",ue(e.body,t)),e.fromMathOp&&cr(r);else if(r=new q("mi",[new _(e.name.slice(1))]),!e.parentIsSupSub){const t=[r,new q("mo",[ne("⁡","text")])];if(e.needsLeadingSpace){const e=new q("mspace");e.setAttribute("width","0.1667em"),t.unshift(e)}if(!e.isFollowedByDelimiter){const e=new q("mspace");e.setAttribute("width","0.1667em"),t.push(e)}r=new q("mrow",t)}return r},pr={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨅":"\\bigsqcap","⨆":"\\bigsqcup","⨃":"\\bigcupdot","⨇":"\\bigdoublevee","⨈":"\\bigdoublewedge","⨉":"\\bigtimes"};p({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcupplus","\\bigcupdot","\\bigcap","\\bigcup","\\bigdoublevee","\\bigdoublewedge","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcap","\\bigsqcup","\\bigtimes","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:({parser:e,funcName:t},r)=>{let n=t;return 1===n.length&&(n=pr[n]),{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!0,stack:!1,name:n}},mathmlBuilder:ur}),p({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:({parser:e},t)=>{const r=t[0],n=r.body?r.body:[r],o=1===n.length&&sr.includes(n[0].type);return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:o,fromMathOp:!0,stack:!1,name:o?n[0].text:null,body:o?null:h(r)}},mathmlBuilder:ur});const mr={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint","∱":"\\intclockwise","∲":"\\varointclockwise","⨌":"\\iiiint","⨍":"\\intbar","⨎":"\\intBar","⨏":"\\fint","⨒":"\\rppolint","⨓":"\\scpolint","⨕":"\\pointint","⨖":"\\sqint","⨗":"\\intlarhk","⨘":"\\intx","⨙":"\\intcap","⨚":"\\intcup"};p({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\sgn","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler({parser:e,funcName:t}){const r=e.prevAtomType,n=e.gullet.future().text;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:nt(n),needsLeadingSpace:r.length>0&&lr.includes(r),name:t}},mathmlBuilder:ur}),p({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler({parser:e,funcName:t}){const r=e.prevAtomType,n=e.gullet.future().text;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:nt(n),needsLeadingSpace:r.length>0&&lr.includes(r),name:t}},mathmlBuilder:ur}),p({type:"op",names:["\\int","\\iint","\\iiint","\\iiiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\intbar","\\intBar","\\fint","\\rppolint","\\scpolint","\\pointint","\\sqint","\\intlarhk","\\intx","\\intcap","\\intcup","∫","∬","∭","∮","∯","∰","∱","∲","⨌","⨍","⨎","⨏","⨒","⨓","⨕","⨖","⨗","⨘","⨙","⨚"],props:{numArgs:0},handler({parser:e,funcName:t}){let r=t;return 1===r.length&&(r=mr[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,stack:!1,name:r}},mathmlBuilder:ur});p({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},r)=>{const n=r[0],o=e.prevAtomType,a=e.gullet.future().text;return{type:"operatorname",mode:e.mode,body:h(n),alwaysHandleSupSub:"\\operatornamewithlimits"===t,limits:!1,parentIsSupSub:!1,isFollowedByDelimiter:nt(a),needsLeadingSpace:o.length>0&&lr.includes(o)}},mathmlBuilder:(e,t)=>{let r,n=ue(e.body,t.withFont("mathrm")),o=!0;for(let e=0;e<n.length;e++){let t=n[e];if(t instanceof T.MathNode)switch("mrow"===t.type&&1===t.children.length&&t.children[0]instanceof T.MathNode&&(t=t.children[0]),t.type){case"mi":case"mn":case"ms":case"mtext":break;case"mspace":if(t.attributes.width){const r=t.attributes.width.replace("em",""),a=Jt(Number(r));""===a?o=!1:n[e]=new T.MathNode("mtext",[new T.TextNode(a)])}break;case"mo":{const e=t.children[0];1===t.children.length&&e instanceof T.TextNode?e.text=e.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):o=!1;break}default:o=!1}else o=!1}if(o){const e=n.map((e=>e.toText())).join("");n=[new T.TextNode(e)]}else if(1===n.length&&["mover","munder"].includes(n[0].type)&&("mi"===n[0].children[0].type||"mtext"===n[0].children[0].type)){if(n[0].children[0].type="mi",e.parentIsSupSub)return new T.MathNode("mrow",n);{const e=new T.MathNode("mo",[ne("⁡","text")]);return T.newDocumentFragment([n[0],e])}}if(o?(r=new T.MathNode("mi",n),1===n[0].text.length&&r.setAttribute("mathvariant","normal")):r=new T.MathNode("mrow",n),!e.parentIsSupSub){const t=[r,new T.MathNode("mo",[ne("⁡","text")])];if(e.needsLeadingSpace){const e=new T.MathNode("mspace");e.setAttribute("width","0.1667em"),t.unshift(e)}if(!e.isFollowedByDelimiter){const e=new T.MathNode("mspace");e.setAttribute("width","0.1667em"),t.push(e)}return T.newDocumentFragment(t)}return r}}),xt("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),m({type:"ordgroup",mathmlBuilder:(e,t)=>pe(e.body,t,e.semisimple)}),p({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{const r=t[0];return{type:"phantom",mode:e.mode,body:h(r)}},mathmlBuilder:(e,t)=>{const r=ue(e.body,t);return new T.MathNode("mphantom",r)}}),p({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{const r=t[0];return{type:"hphantom",mode:e.mode,body:r}},mathmlBuilder:(e,t)=>{const r=ue(h(e.body),t),n=new T.MathNode("mphantom",r),o=new T.MathNode("mpadded",[n]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),p({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{const r=t[0];return{type:"vphantom",mode:e.mode,body:r}},mathmlBuilder:(e,t)=>{const r=ue(h(e.body),t),n=new T.MathNode("mphantom",r),o=new T.MathNode("mpadded",[n]);return o.setAttribute("width","0px"),o}}),p({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>({type:"pmb",mode:e.mode,body:h(t[0])}),mathmlBuilder(e,t){const r=ue(e.body,t),n=S(r);return n.setAttribute("style","font-weight:bold"),n}});const dr=(e,t)=>{const r=t.withLevel(ht),n=new T.MathNode("mpadded",[me(e.body,r)]),o=Oe(e.dy,t);return n.setAttribute("voffset",o.number+o.unit),o.number>0?n.style.padding=o.number+o.unit+" 0 0 0":n.style.padding="0 0 "+Math.abs(o.number)+o.unit+" 0",n};p({type:"raise",names:["\\raise","\\lower"],props:{numArgs:2,argTypes:["size","primitive"],primitive:!0},handler({parser:e,funcName:t},r){const n=Le(r[0],"size").value;"\\lower"===t&&(n.number*=-1);const o=r[1];return{type:"raise",mode:e.mode,dy:n,body:o}},mathmlBuilder:dr}),p({type:"raise",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler({parser:e,funcName:t},r){const n=Le(r[0],"size").value,o=r[1];return{type:"raise",mode:e.mode,dy:n,body:o}},mathmlBuilder:dr}),p({type:"ref",names:["\\ref","\\eqref"],props:{numArgs:1,argTypes:["raw"]},handler:({parser:e,funcName:t},r)=>({type:"ref",mode:e.mode,funcName:t,string:r[0].string.replace(Qt,"")}),mathmlBuilder(e,t){const r="\\ref"===e.funcName?["tml-ref"]:["tml-ref","tml-eqref"];return new k("#"+e.string,r,null)}}),p({type:"reflect",names:["\\reflectbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:({parser:e},t)=>({type:"reflect",mode:e.mode,body:t[0]}),mathmlBuilder(e,t){const r=me(e.body,t);return r.style.transform="scaleX(-1)",r}}),p({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler:({parser:e})=>({type:"internal",mode:e.mode})}),p({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler({parser:e},t,r){const n=r[0],o=Le(t[0],"size"),a=Le(t[1],"size");return{type:"rule",mode:e.mode,shift:n&&Le(n,"size").value,width:o.value,height:a.value}},mathmlBuilder(e,t){const r=Oe(e.width,t),n=Oe(e.height,t),o=e.shift?Oe(e.shift,t):{number:0,unit:"em"},a=t.color&&t.getColor()||"black",s=new T.MathNode("mspace");if(r.number>0&&n.number>0&&s.setAttribute("mathbackground",a),s.setAttribute("width",r.number+r.unit),s.setAttribute("height",n.number+n.unit),0===o.number)return s;const i=new T.MathNode("mpadded",[s]);return o.number>=0?i.setAttribute("height","+"+o.number+o.unit):(i.setAttribute("height",o.number+o.unit),i.setAttribute("depth","+"+-o.number+o.unit)),i.setAttribute("voffset",o.number+o.unit),i}});const hr={"\\tiny":.5,"\\sixptsize":.6,"\\Tiny":.6,"\\scriptsize":.7,"\\footnotesize":.8,"\\small":.9,"\\normalsize":1,"\\large":1.2,"\\Large":1.44,"\\LARGE":1.728,"\\huge":2.074,"\\Huge":2.488};p({type:"sizing",names:["\\tiny","\\sixptsize","\\Tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],props:{numArgs:0,allowedInText:!0},handler:({breakOnTokenText:e,funcName:t,parser:r},n)=>{r.settings.strict&&"math"===r.mode&&console.log(`Temml strict-mode warning: Command ${t} is invalid in math mode.`);const o=r.parseExpression(!1,e,!0);return{type:"sizing",mode:r.mode,funcName:t,body:o}},mathmlBuilder:(e,t)=>{const r=t.withFontSize(hr[e.funcName]),n=ue(e.body,r),o=S(n),a=(hr[e.funcName]/t.fontSize).toFixed(4);return o.setAttribute("mathsize",a+"em"),o}}),p({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:({parser:e},t,r)=>{let n=!1,o=!1;const a=r[0]&&Le(r[0],"ordgroup");if(a){let e="";for(let t=0;t<a.body.length;++t){if(e=a.body[t].text,"t"===e)n=!0;else{if("b"!==e){n=!1,o=!1;break}o=!0}}}else n=!0,o=!0;const s=t[0];return{type:"smash",mode:e.mode,body:s,smashHeight:n,smashDepth:o}},mathmlBuilder:(e,t)=>{const r=new T.MathNode("mpadded",[me(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),p({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler({parser:e},t,r){const n=r[0],o=t[0];return{type:"sqrt",mode:e.mode,body:o,index:n}},mathmlBuilder(e,t){const{body:r,index:n}=e;return n?new T.MathNode("mroot",[me(r,t),me(n,t.incrementLevel())]):new T.MathNode("msqrt",[me(r,t)])}});const gr={display:0,text:1,script:2,scriptscript:3},fr={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]};p({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({breakOnTokenText:e,funcName:t,parser:r},n){const o=r.parseExpression(!0,e,!0),a=t.slice(1,t.length-5);return{type:"styling",mode:r.mode,scriptLevel:a,body:o}},mathmlBuilder(e,t){const r=t.withLevel(gr[e.scriptLevel]),n=ue(e.body,r),o=S(n),a=fr[e.scriptLevel];return o.setAttribute("scriptlevel",a[0]),o.setAttribute("displaystyle",a[1]),o}});const br=/^m(over|under|underover)$/;m({type:"supsub",mathmlBuilder(e,t){let r,n,o=!1,a=!1,s=!1,i=!1;e.base&&"horizBrace"===e.base.type&&(n=!!e.sup,n===e.base.isOver&&(o=!0,r=e.base.isOver)),!e.base||e.base.stack||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0,a=!e.base.symbol,s=a&&!e.isFollowedByDelimiter,i=e.base.needsLeadingSpace);const l=e.base&&e.base.stack?[me(e.base.body[0],t)]:[me(e.base,t)],c=t.inSubOrSup();if(e.sub){const r=me(e.sub,c);3===t.level&&r.setAttribute("scriptlevel","2"),l.push(r)}if(e.sup){const r=me(e.sup,c);3===t.level&&r.setAttribute("scriptlevel","2");const n="mrow"===r.type?r.children[0]:r;n&&"mo"===n.type&&n.classes.includes("tml-prime")&&e.base&&e.base.text&&"fF".indexOf(e.base.text)>-1&&n.classes.push("prime-pad"),l.push(r)}let u;if(o)u=r?"mover":"munder";else if(e.sub)if(e.sup){const r=e.base;u=r&&("op"===r.type&&r.limits||"multiscript"===r.type)&&(t.level===dt||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(t.level===dt||r.limits)?"munderover":"msubsup"}else{const r=e.base;u=r&&"op"===r.type&&r.limits&&(t.level===dt||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.level===dt)?"munder":"msub"}else{const r=e.base;u=r&&"op"===r.type&&r.limits&&(t.level===dt||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.level===dt)?"mover":"msup"}let p=new T.MathNode(u,l);if(a){const e=new T.MathNode("mo",[ne("⁡","text")]);if(i){const t=new T.MathNode("mspace");t.setAttribute("width","0.1667em"),p=T.newDocumentFragment([t,p,e])}else p=T.newDocumentFragment([p,e]);if(s){const e=new T.MathNode("mspace");e.setAttribute("width","0.1667em"),p.children.push(e)}}else br.test(u)&&(p=new T.MathNode("mrow",[p]));return p}});const xr=["\\shortmid","\\nshortmid","\\shortparallel","\\nshortparallel","\\smallsetminus"],yr=["\\Rsh","\\Lsh","\\restriction"];m({type:"atom",mathmlBuilder(e,t){const r=new T.MathNode("mo",[ne(e.text,e.mode)]);return"punct"===e.family?r.setAttribute("separator","true"):"open"===e.family||"close"===e.family?"open"===e.family?(r.setAttribute("form","prefix"),r.setAttribute("stretchy","false")):"close"===e.family&&(r.setAttribute("form","postfix"),r.setAttribute("stretchy","false")):"\\mid"===e.text?(r.setAttribute("lspace","0.22em"),r.setAttribute("rspace","0.22em"),r.setAttribute("stretchy","false")):"rel"===e.family&&(e=>{if(1===e.length){const t=e.codePointAt(0);return 8591<t&&t<8704}return e.indexOf("arrow")>-1||e.indexOf("harpoon")>-1||yr.includes(e)})(e.text)?r.setAttribute("stretchy","false"):xr.includes(e.text)?r.setAttribute("mathsize","70%"):":"===e.text&&(r.attributes.lspace="0.2222em",r.attributes.rspace="0.2222em"),r}});const wr={mathbf:"bold",mathrm:"normal",textit:"italic",mathit:"italic",mathnormal:"italic",mathbb:"double-struck",mathcal:"script",mathfrak:"fraktur",mathscr:"script",mathsf:"sans-serif",mathtt:"monospace"},vr=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsc"===t.fontFamily)return"normal";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"sans-serif-bold":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";const r=t.font;if(!r||"mathnormal"===r)return null;const n=e.mode;switch(r){case"mathit":case"greekItalic":return"italic";case"mathrm":{const t=e.text.codePointAt(0);return 939<t&&t<975?"italic":"normal"}case"up@greek":return"normal";case"boldsymbol":case"mathboldsymbol":return"bold-italic";case"mathbf":return"bold";case"mathbb":return"double-struck";case"mathfrak":return"fraktur";case"mathscr":case"mathcal":return"script";case"mathsf":return"sans-serif";case"mathsfit":return"sans-serif-italic";case"mathtt":return"monospace"}let o=e.text;return I[n][o]&&I[n][o].replace&&(o=I[n][o].replace),Object.prototype.hasOwnProperty.call(wr,r)?wr[r]:null},kr=Object.freeze({B:8426,E:8427,F:8427,H:8387,I:8391,L:8390,M:8422,R:8393,e:8394,g:8355,o:8389}),Ar=Object.freeze({C:8426,H:8388,I:8392,R:8394,Z:8398}),qr=Object.freeze({C:8383,H:8389,N:8391,P:8393,Q:8393,R:8395,Z:8394}),_r=Object.freeze({ϵ:119527,ϑ:119564,ϰ:119534,φ:119577,ϱ:119535,ϖ:119563}),Sr=Object.freeze({ϵ:119643,ϑ:119680,ϰ:119650,φ:119693,ϱ:119651,ϖ:119679}),Tr=Object.freeze({ϵ:119701,ϑ:119738,ϰ:119708,φ:119751,ϱ:119709,ϖ:119737}),Nr=Object.freeze({ϵ:119759,ϑ:119796,ϰ:119766,φ:119809,ϱ:119767,ϖ:119795}),Or=Object.freeze({upperCaseLatin:{normal:e=>0,bold:e=>119743,italic:e=>119795,"bold-italic":e=>119847,script:e=>kr[e]||119899,"script-bold":e=>119951,fraktur:e=>Ar[e]||120003,"fraktur-bold":e=>120107,"double-struck":e=>qr[e]||120055,"sans-serif":e=>120159,"sans-serif-bold":e=>120211,"sans-serif-italic":e=>120263,"sans-serif-bold-italic":e=>120380,monospace:e=>120367},lowerCaseLatin:{normal:e=>0,bold:e=>119737,italic:e=>"h"===e?8358:119789,"bold-italic":e=>119841,script:e=>kr[e]||119893,"script-bold":e=>119945,fraktur:e=>119997,"fraktur-bold":e=>120101,"double-struck":e=>120049,"sans-serif":e=>120153,"sans-serif-bold":e=>120205,"sans-serif-italic":e=>120257,"sans-serif-bold-italic":e=>120309,monospace:e=>120361},upperCaseGreek:{normal:e=>0,bold:e=>119575,italic:e=>119633,"bold-italic":e=>119575,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119749,"sans-serif-bold":e=>119749,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119807,monospace:e=>0},lowerCaseGreek:{normal:e=>0,bold:e=>119569,italic:e=>119627,"bold-italic":e=>"ϕ"===e?119678:119685,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119743,"sans-serif-bold":e=>119743,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119801,monospace:e=>0},varGreek:{normal:e=>0,bold:e=>_r[e]||-51,italic:e=>0,"bold-italic":e=>Sr[e]||58,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>Tr[e]||116,"sans-serif-bold":e=>Tr[e]||116,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>Nr[e]||174,monospace:e=>0},numeral:{normal:e=>0,bold:e=>120734,italic:e=>0,"bold-italic":e=>0,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>120744,"sans-serif":e=>120754,"sans-serif-bold":e=>120764,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>0,monospace:e=>120774}}),$r=(e,t)=>{const r=e.codePointAt(0),n=64<r&&r<91?"upperCaseLatin":96<r&&r<123?"lowerCaseLatin":912<r&&r<938?"upperCaseGreek":944<r&&r<970||"ϕ"===e?"lowerCaseGreek":120545<r&&r<120572||_r[e]?"varGreek":47<r&&r<58?"numeral":"other";return"other"===n?e:String.fromCodePoint(r+Or[n][t](e))},Mr=Object.freeze({a:"ᴀ",b:"ʙ",c:"ᴄ",d:"ᴅ",e:"ᴇ",f:"ꜰ",g:"ɢ",h:"ʜ",i:"ɪ",j:"ᴊ",k:"ᴋ",l:"ʟ",m:"ᴍ",n:"ɴ",o:"ᴏ",p:"ᴘ",q:"ǫ",r:"ʀ",s:"s",t:"ᴛ",u:"ᴜ",v:"ᴠ",w:"ᴡ",x:"x",y:"ʏ",z:"ᴢ"}),Br=/^\d(?:[\d,.]*\d)?$/,Cr=/[A-Ba-z]/,zr=new Set(["\\prime","\\dprime","\\trprime","\\qprime","\\backprime","\\backdprime","\\backtrprime"]);m({type:"mathord",mathmlBuilder(e,t){const r=ne(e.text,e.mode,t),n=r.text.codePointAt(0),o=912<n&&n<938?"normal":"italic",a=vr(e,t)||o;if("script"===a)return r.text=$r(r.text,a),new T.MathNode("mi",[r],[t.font]);"italic"!==a&&(r.text=$r(r.text,a));let s=new T.MathNode("mi",[r]);return"normal"===a&&(s.setAttribute("mathvariant","normal"),1===r.text.length&&(s=new T.MathNode("mrow",[s]))),s}}),m({type:"textord",mathmlBuilder(e,t){let r=e.text;const n=r.codePointAt(0);"textsc"===t.fontFamily&&96<n&&n<123&&(r=Mr[r]);const o=ne(r,e.mode,t),a=vr(e,t)||"normal";let s;if(Br.test(e.text)){const t="text"===e.mode?"mtext":"mn";if("italic"===a||"bold-italic"===a)return((e,t,r)=>{const n=new T.MathNode(r,[e]),o=new T.MathNode("mstyle",[n]);return o.style["font-style"]="italic",o.style["font-family"]="Cambria, 'Times New Roman', serif","bold-italic"===t&&(o.style["font-weight"]="bold"),o})(o,a,t);"normal"!==a&&(o.text=o.text.split("").map((e=>$r(e,a))).join("")),s=new T.MathNode(t,[o])}else if("text"===e.mode)"normal"!==a&&(o.text=$r(o.text,a)),s=new T.MathNode("mtext",[o]);else if(zr.has(e.text))s=new T.MathNode("mo",[o]),s.classes.push("tml-prime");else{const e=o.text;"italic"!==a&&(o.text=$r(o.text,a)),s=new T.MathNode("mi",[o]),o.text===e&&Cr.test(e)&&s.setAttribute("mathvariant","italic")}return s}});const Lr={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ir={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};m({type:"spacing",mathmlBuilder(e,t){let n;if(Object.prototype.hasOwnProperty.call(Ir,e.text))n=new T.MathNode("mtext",[new T.TextNode(" ")]);else{if(!Object.prototype.hasOwnProperty.call(Lr,e.text))throw new r(`Unknown type of space "${e.text}"`);n=new T.MathNode("mo"),"\\nobreak"===e.text&&n.setAttribute("linebreak","nobreak")}return n}}),m({type:"tag"});const Dr={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm","\\textsc":"textsc"},Er={"\\textbf":"textbf","\\textmd":"textmd"},Fr={"\\textit":"textit","\\textup":"textup"};p({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textsc","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},r){const n=r[0];return{type:"text",mode:e.mode,body:h(n),font:t}},mathmlBuilder(e,t){const r=((e,t)=>{const r=e.font;return r?Dr[r]?t.withTextFontFamily(Dr[r]):Er[r]?t.withTextFontWeight(Er[r]):"\\emph"===r?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Fr[r]):t})(e,t),n=pe(e.body,r);return ae(n)}}),p({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:({parser:e},t)=>({type:"vcenter",mode:e.mode,body:t[0]}),mathmlBuilder(e,t){const r=new T.MathNode("mtd",[me(e.body,t)]);r.style.padding="0";const n=new T.MathNode("mtr",[r]);return new T.MathNode("mtable",[n])}}),p({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new r("\\verb ended by end of line instead of matching delimiter")},mathmlBuilder(e,t){const r=new T.TextNode(Gr(e)),n=new T.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});const Gr=e=>e.body.replace(/ /g,e.star?"␣":" "),Pr=c,Rr="[ \r\n\t]",jr=`(\\\\[a-zA-Z@]+)${Rr}*`,Ur="[̀-ͯ]",Vr=new RegExp(`${Ur}+$`),Zr=`(${Rr}+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]${Ur}*|[\ud800-\udbff][\udc00-\udfff]${Ur}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${jr}|\\\\[^\ud800-\udfff])`;class Hr{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(Zr,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){const e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new mt("EOF",new pt(this,t,t));const n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new r(`Unexpected character: '${e[t]}'`,new mt(e[t],new pt(this,t,t+1)));const o=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[o]){const t=e.indexOf("\n",this.tokenRegex.lastIndex);if(-1===t){if(this.tokenRegex.lastIndex=e.length,this.settings.strict)throw new r("% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode")}else this.tokenRegex.lastIndex=t+1;return this.lex()}return new mt(o,new pt(this,t,this.tokenRegex.lastIndex))}}class Wr{constructor(e={},t={}){this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new r("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const e=this.undefStack.pop();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(void 0===e[t]?delete this.current[t]:this.current[t]=e[t])}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){return Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:this.builtins[e]}set(e,t,r=!1){if(r){for(let t=0;t<this.undefStack.length;t++)delete this.undefStack[t][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{const t=this.undefStack[this.undefStack.length-1];t&&!Object.prototype.hasOwnProperty.call(t,e)&&(t[e]=this.current[e])}this.current[e]=t}}const Xr={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Kr{constructor(e,t,r){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Wr(yt,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new Hr(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){let t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:t,end:r}=this.consumeArg());return this.pushToken(new mt("EOF",r.loc)),this.pushTokens(n),t.range(r,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){const t=[],n=e&&e.length>0;n||this.consumeSpaces();const o=this.future();let a,s=0,i=0;do{if(a=this.popToken(),t.push(a),"{"===a.text)++s;else if("}"===a.text){if(--s,-1===s)throw new r("Extra }",a)}else if("EOF"===a.text)throw new r("Unexpected end of input in a macro argument, expected '"+(e&&n?e[i]:"}")+"'",a);if(e&&n)if((0===s||1===s&&"{"===e[i])&&a.text===e[i]){if(++i,i===e.length){t.splice(-i,i);break}}else i=0}while(0!==s||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:a}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new r("The length of delimiters doesn't match the number of args!");const n=t[0];for(let e=0;e<n.length;e++){const t=this.popToken();if(n[e]!==t.text)throw new r("Use of the macro doesn't match its definition",t)}}const n=[];for(let r=0;r<e;r++)n.push(this.consumeArg(t&&t[r+1]).tokens);return n}expandOnce(e){const t=this.popToken(),n=t.text,o=t.noexpand?null:this._getExpansion(n);if(null==o||e&&o.unexpandable){if(e&&null==o&&"\\"===n[0]&&!this.isDefined(n))throw new r("Undefined control sequence: "+n);return this.pushToken(t),!1}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new r("Too many expansions: infinite loop or need to increase maxExpand setting");let a=o.tokens;const s=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){a=a.slice();for(let e=a.length-1;e>=0;--e){let t=a[e];if("#"===t.text){if(0===e)throw new r("Incomplete placeholder at end of macro body",t);if(t=a[--e],"#"===t.text)a.splice(e+1,1);else{if(!/^[1-9]$/.test(t.text))throw new r("Not a valid argument number",t);a.splice(e,2,...s[+t.text-1])}}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){const e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new mt(e)]):void 0}expandTokens(e){const t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){const e=this.stack.pop();e.treatAsRelax&&(e.noexpand=!1,e.treatAsRelax=!1),t.push(e)}return t}expandMacroAsText(e){const t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){const t=this.macros.get(e);if(null==t)return t;if(1===e.length){const t=this.lexer.catcodes[e];if(null!=t&&13!==t)return}const r="function"==typeof t?t(this):t;if("string"==typeof r){let e=0;if(-1!==r.indexOf("#")){const t=r.replace(/##/g,"");for(;-1!==t.indexOf("#"+(e+1));)++e}const t=new Hr(r,this.settings),n=[];let o=t.lex();for(;"EOF"!==o.text;)n.push(o),o=t.lex();n.reverse();return{tokens:n,numArgs:e}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(Pr,e)||Object.prototype.hasOwnProperty.call(I.math,e)||Object.prototype.hasOwnProperty.call(I.text,e)||Object.prototype.hasOwnProperty.call(Xr,e)}isExpandable(e){const t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Object.prototype.hasOwnProperty.call(Pr,e)&&!Pr[e].primitive}}const Yr=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Jr=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Qr=Object.freeze({𝒜:"A",ℬ:"B",𝒞:"C",𝒟:"D",ℰ:"E",ℱ:"F",𝒢:"G",ℋ:"H",ℐ:"I",𝒥:"J",𝒦:"K",ℒ:"L",ℳ:"M",𝒩:"N",𝒪:"O",𝒫:"P",𝒬:"Q",ℛ:"R",𝒮:"S",𝒯:"T",𝒰:"U",𝒱:"V",𝒲:"W",𝒳:"X",𝒴:"Y",𝒵:"Z"});var en={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},tn={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",č:"č",ĉ:"ĉ",ċ:"ċ",ď:"ď",ḋ:"ḋ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ĺ:"ĺ",ľ:"ľ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ď:"Ď",Ḋ:"Ḋ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ĺ:"Ĺ",Ľ:"Ľ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ť:"Ť",Ṫ:"Ṫ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};const rn=["bin","op","open","punct","rel"],nn=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;class on{constructor(e,t,r=!1){this.mode="math",this.gullet=new Kr(e,t,this.mode),this.settings=t,this.isPreamble=r,this.leftrightDepth=0,this.prevAtomType=""}expect(e,t=!0){if(this.fetch().text!==e)throw new r(`Expected '${e}', got '${this.fetch().text}'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");const e=this.parseExpression(!1);if(this.expect("EOF"),this.isPreamble){const e=Object.create(null);return Object.entries(this.gullet.macros.current).forEach((([t,r])=>{e[t]=r})),this.gullet.endGroup(),e}const t=this.gullet.macros.get("\\df@tag");return this.gullet.endGroup(),t&&(this.gullet.macros.current["\\df@tag"]=t),e}static get endOfExpression(){return["}","\\endgroup","\\end","\\right","\\endtoggle","&"]}subparse(e){const t=this.nextToken;this.consume(),this.gullet.pushToken(new mt("}")),this.gullet.pushTokens(e);const r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t,r){const n=[];for(this.prevAtomType="";;){"math"===this.mode&&this.consumeSpaces();const o=this.fetch();if(-1!==on.endOfExpression.indexOf(o.text))break;if(t&&o.text===t)break;if(r&&"\\middle"===o.text)break;if(e&&Pr[o.text]&&Pr[o.text].infix)break;const a=this.parseAtom(t);if(!a)break;"internal"!==a.type&&(n.push(a),this.prevAtomType="atom"===a.type?a.family:a.type)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){let t,n=-1;for(let o=0;o<e.length;o++)if("infix"===e[o].type){if(-1!==n)throw new r("only one infix operator per group",e[o].token);n=o,t=e[o].replaceWith}if(-1!==n&&t){let r,o;const a=e.slice(0,n),s=e.slice(n+1);let i;return r=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},o=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},i="\\\\abovefrac"===t?this.callFunction(t,[r,e[n],o],[]):this.callFunction(t,[r,o],[]),[i]}return e}handleSupSubscript(e){const t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();const o=this.parseGroup(e);if(!o)throw new r("Expected group after '"+n+"'",t);return o}formatUnsupportedCmd(e){const t=[];for(let r=0;r<e.length;r++)t.push({type:"textord",mode:"text",text:e[r]});const r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){const t=this.parseGroup("atom",e);if("text"===this.mode)return t;let n,o;for(;;){this.consumeSpaces();const e=this.fetch();if("\\limits"===e.text||"\\nolimits"===e.text){if(t&&"op"===t.type){const r="\\limits"===e.text;t.limits=r,t.alwaysHandleSupSub=!0}else{if(!t||"operatorname"!==t.type)throw new r("Limit controls must follow a math operator",e);t.alwaysHandleSupSub&&(t.limits="\\limits"===e.text)}this.consume()}else if("^"===e.text){if(n)throw new r("Double superscript",e);n=this.handleSupSubscript("superscript")}else if("_"===e.text){if(o)throw new r("Double subscript",e);o=this.handleSupSubscript("subscript")}else if("'"===e.text){if(n)throw new r("Double superscript",e);const t={type:"textord",mode:this.mode,text:"\\prime"},o=[t];for(this.consume();"'"===this.fetch().text;)o.push(t),this.consume();"^"===this.fetch().text&&o.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:o}}else{if(!Jr[e.text])break;{const t=Yr.test(e.text),r=[];for(r.push(new mt(Jr[e.text])),this.consume();;){const e=this.fetch().text;if(!Jr[e])break;if(Yr.test(e)!==t)break;r.unshift(new mt(Jr[e])),this.consume()}const a=this.subparse(r);t?o={type:"ordgroup",mode:"math",body:a}:n={type:"ordgroup",mode:"math",body:a}}}}if(n||o){if(t&&"multiscript"===t.type&&!t.postscripts)return t.postscripts={sup:n,sub:o},t;{const e=!t||"op"!==t.type&&"operatorname"!==t.type?void 0:nt(this.nextToken.text);return{type:"supsub",mode:this.mode,base:t,sup:n,sub:o,isFollowedByDelimiter:e}}}return t}parseFunction(e,t){const n=this.fetch(),o=n.text,a=Pr[o];if(!a)return null;if(this.consume(),t&&"atom"!==t&&!a.allowedInArgument)throw new r("Got function '"+o+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!a.allowedInText)throw new r("Can't use function '"+o+"' in text mode",n);if("math"===this.mode&&!1===a.allowedInMath)throw new r("Can't use function '"+o+"' in math mode",n);const s=this.prevAtomType,{args:i,optArgs:l}=this.parseArguments(o,a);return this.prevAtomType=s,this.callFunction(o,i,l,n,e)}callFunction(e,t,n,o,a){const s={funcName:e,parser:this,token:o,breakOnTokenText:a},i=Pr[e];if(i&&i.handler)return i.handler(s,t,n);throw new r(`No function handler for ${e}`)}parseArguments(e,t){const n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};const o=[],a=[];for(let s=0;s<n;s++){let n=t.argTypes&&t.argTypes[s];const i=s<t.numOptionalArgs;(t.primitive&&null==n||"sqrt"===t.type&&1===s&&null==a[0])&&(n="primitive");const l=this.parseGroupOfType(`argument to '${e}'`,n,i);if(i)a.push(l);else{if(null==l)throw new r("Null argument, please report this as a bug");o.push(l)}}return{args:o,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{const e=this.parseArgumentGroup(n,"text");return null!=e?{type:"styling",mode:e.mode,body:[e],scriptLevel:"text"}:null}case"raw":{const e=this.parseStringGroup("raw",n);return null!=e?{type:"raw",mode:"text",string:e.text}:null}case"primitive":{if(n)throw new r("A primitive argument cannot be optional");const t=this.parseGroup(e);if(null==t)throw new r("Expected group as "+e,this.fetch());return t}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new r("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;;){const e=this.fetch().text;if(" "!==e&&" "!==e&&"︎"!==e)break;this.consume()}}parseStringGroup(e,t){const r=this.gullet.scanArgument(t);if(null==r)return null;let n,o="";for(;"EOF"!==(n=this.fetch()).text;)o+=n.text,this.consume();return this.consume(),r.text=o,r}parseRegexGroup(e,t){const n=this.fetch();let o,a=n,s="";for(;"EOF"!==(o=this.fetch()).text&&e.test(s+o.text);)a=o,s+=a.text,this.consume();if(""===s)throw new r("Invalid "+t+": '"+n.text+"'",n);return n.range(a,s)}parseSizeGroup(e){let t,n=!1;if(this.gullet.consumeSpaces(),t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"),!t)return null;e||0!==t.text.length||(t.text="0pt",n=!0);const o=nn.exec(t.text);if(!o)throw new r("Invalid size: '"+t.text+"'",t);const a={number:+(o[1]+o[2]),unit:o[3]};if(!Te(a))throw new r("Invalid unit: '"+a.unit+"'",t);return{type:"size",mode:this.mode,value:a,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);const t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;let r=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return r=t.text.replace(/{\u2044}/g,"/"),{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,t){const r=this.gullet.scanArgument(e);if(null==r)return null;const n=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();const o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();const a={type:"ordgroup",mode:this.mode,loc:r.loc,body:o};return t&&this.switchMode(n),a}parseGroup(e,t){const r=this.fetch(),n=r.text;let o;if("{"===n||"\\begingroup"===n||"\\toggle"===n){this.consume();const e="{"===n?"}":"\\begingroup"===n?"\\endgroup":"\\endtoggle";this.gullet.beginGroup();const t=this.parseExpression(!1,e),a=this.fetch();this.expect(e),this.gullet.endGroup(),o={type:"\\endtoggle"===a.text?"toggle":"ordgroup",mode:this.mode,loc:pt.range(r,a),body:t,semisimple:"\\begingroup"===n||void 0}}else o=this.parseFunction(t,e)||this.parseSymbol(),null!=o||"\\"!==n[0]||Object.prototype.hasOwnProperty.call(Xr,n)||(o=this.formatUnsupportedCmd(n),this.consume());return o}formLigatures(e){let t=e.length-1;for(let r=0;r<t;++r){const n=e[r],o=n.text;"-"===o&&"-"===e[r+1].text&&(r+1<t&&"-"===e[r+2].text?(e.splice(r,3,{type:"textord",mode:"text",loc:pt.range(n,e[r+2]),text:"---"}),t-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:pt.range(n,e[r+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[r+1].text!==o||(e.splice(r,2,{type:"textord",mode:"text",loc:pt.range(n,e[r+1]),text:o+o}),t-=1)}}parseSymbol(){const e=this.fetch();let t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();let e=t.slice(5);const n="*"===e.charAt(0);if(n&&(e=e.slice(1)),e.length<2||e.charAt(0)!==e.slice(-1))throw new r("\\verb assertion failed --\n                    please report what input caused this bug");return e=e.slice(1,-1),{type:"verb",mode:"text",body:e,star:n}}if(Object.prototype.hasOwnProperty.call(tn,t[0])&&"math"===this.mode&&!I[this.mode][t[0]]){if(this.settings.strict&&"math"===this.mode)throw new r(`Accented Unicode text character "${t[0]}" used in math mode`,e);t=tn[t[0]]+t.slice(1)}const n="math"===this.mode?Vr.exec(t):null;let o;if(n&&(t=t.substring(0,n.index),"i"===t?t="ı":"j"===t&&(t="ȷ")),I[this.mode][t]){let r=I[this.mode][t].group;"bin"===r&&rn.includes(this.prevAtomType)&&(r="open");const n=pt.range(e);let a;if(Object.prototype.hasOwnProperty.call(z,r)){const e=r;a={type:"atom",mode:this.mode,family:e,loc:n,text:t}}else{if(Qr[t]){this.consume();const e=this.fetch().text.charCodeAt(0),r=65025===e?"mathscr":"mathcal";return 65024!==e&&65025!==e||this.consume(),{type:"font",mode:"math",font:r,body:{type:"mathord",mode:"math",loc:n,text:Qr[t]}}}a={type:r,mode:this.mode,loc:n,text:t}}o=a}else{if(!(t.charCodeAt(0)>=128||Vr.exec(t)))return null;if(this.settings.strict&&"math"===this.mode)throw new r(`Unicode text character "${t[0]}" used in math mode`,e);o={type:"textord",mode:"text",loc:pt.range(e),text:t}}if(this.consume(),n)for(let t=0;t<n[0].length;t++){const a=n[0][t];if(!en[a])throw new r(`Unknown accent ' ${a}'`,e);const s=en[a][this.mode]||en[a].text;if(!s)throw new r(`Accent ${a} unsupported in ${this.mode} mode`,e);o={type:"accent",mode:this.mode,loc:pt.range(e),label:s,isStretchy:!1,base:o}}return o}}const an=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("Temml can only parse string typed expression");const n=new on(e,t);delete n.gullet.macros.current["\\df@tag"];let o=n.parse();if(!(o.length>0&&o[0].type&&"array"===o[0].type&&o[0].addEqnNum)&&n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new r("\\tag works only in display mode");n.gullet.feed("\\df@tag"),o=[{type:"tag",mode:"text",body:o,tag:n.parse()}]}return o},sn=[2,2,3,3];class ln{constructor(e){this.level=e.level,this.color=e.color,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontSize=e.fontSize||1,this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.maxSize=e.maxSize}extend(e){const t={level:this.level,color:this.color,font:this.font,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return new ln(t)}withLevel(e){return this.extend({level:e})}incrementLevel(){return this.extend({level:Math.min(this.level+1,3)})}inSubOrSup(){return this.extend({level:sn[this.level]})}withColor(e){return this.extend({color:e})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withFontSize(e){return this.extend({fontSize:e})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}getColor(){return this.color}}let cn=function(e,t,r={}){t.textContent="";const n="math"===t.tagName.toLowerCase();n&&(r.wrap="none");const o=un(e,r);n||o.children.length>1?(t.textContent="",o.children.forEach((e=>{t.appendChild(e.toNode())}))):t.appendChild(o.toNode())};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: Temml doesn't work in quirks mode. Make sure your website has a suitable doctype."),cn=function(){throw new r("Temml doesn't work in quirks mode.")});const un=function(e,t){const n=new l(t);try{const t=an(e,n);return fe(t,e,new ln({level:n.displayMode?dt:ht,maxSize:n.maxSize}),n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof r))throw e;const o=new w(["temml-error"],[new v(t+"\n"+e.toString())]);return o.style.color=n.errorColor,o.style.whiteSpace="pre-line",o}(t,e,n)}};var pn={version:"0.10.34",render:cn,renderToString:function(e,t){return un(e,t).toMarkup()},postProcess:function(e){const t={};let r=0;const n=document.getElementsByClassName("tml-eqn");for(let e of n)for(r+=1,e.setAttribute("id","tml-eqn-"+String(r));"mtable"!==e.tagName;){if(e.getElementsByClassName("tml-label").length>0){const n=e.attributes.id.value;t[n]=String(r);break}e=e.parentElement}const o=document.getElementsByClassName("tml-tageqn");for(const e of o){if(e.getElementsByClassName("tml-label").length>0){const r=e.getElementsByClassName("tml-tag");if(r.length>0){const n=e.attributes.id.value;t[n]=r[0].textContent}}}[...e.getElementsByClassName("tml-ref")].forEach((e=>{const r=e.getAttribute("href");let n=t[r.slice(1)];-1===e.className.indexOf("tml-eqref")?(n=n.replace(/^\(/,""),n=n.replace(/\)$/,"")):("("!==n.charAt(0)&&(n="("+n),")"!==n.slice(-1)&&(n+=")"));const o=document.createElementNS("http://www.w3.org/1998/Math/MathML","mtext");o.appendChild(document.createTextNode(n));const a=document.createElementNS("http://www.w3.org/1998/Math/MathML","math");a.appendChild(o),e.appendChild(a)}))},ParseError:r,definePreamble:function(e,t){const r=new l(t);if(r.macros={},!("string"==typeof e||e instanceof String))throw new TypeError("Temml can only parse string typed expression");const n=new on(e,r,!0);delete n.gullet.macros.current["\\df@tag"];return n.parse()},__parse:function(e,t){const r=new l(t);return an(e,r)},__renderToMathMLTree:un,__defineSymbol:D,__defineMacro:xt};function mn(e,{displayMode:t=!0}={}){const r=pn.renderToString(e,{displayMode:t,annotate:!0,throwOnError:!0}),n=document.implementation.createHTMLDocument("");return n.body.innerHTML=r,n.body.querySelector("math")?.innerHTML??""}(window.wp=window.wp||{}).latexToMathml=t})();