const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dialog-select-provider-D4bT8Uyu.js","assets/list-Cwyb8-Jb.js","assets/dialog-select-server-BxF4x-y4.js","assets/server-row-A6wdF0dR.js","assets/dialog-settings-BvAU2P43.js","assets/switch-BvET_no4.js","assets/dialog-select-directory-B8r59wga.js","assets/file-icon-DGmzxl5W.js","assets/home-PBFdK0yd.js","assets/session-C5tLPMpz.js"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const Ae={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return z2(this.context.count)},getNextContextId(){return z2(this.context.count++)}};function z2(e){const t=String(e),n=t.length-1;return Ae.context.id+(n?String.fromCharCode(96+n):"")+t}function vo(e){Ae.context=e}const Z7=!1,pO=(e,t)=>e===t,ki=Symbol("solid-proxy"),G7=typeof Proxy=="function",Of=Symbol("solid-track"),Pf={equals:pO};let Pc=null,K7=Q7;const Xr=1,Uc=2,Y7={owned:null,cleanups:null,context:null,owner:null},Dm={};var Ke=null;let xe=null,gO=null,Et=null,Jn=null,An=null,G0=0;function Pn(e,t){const n=Et,r=Ke,i=e.length===0,o=t===void 0?r:t,s=i?Y7:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>We(()=>cs(s)));Ke=s,Et=null;try{return Ir(a,!0)}finally{Et=n,Ke=r}}function be(e,t){t=t?Object.assign({},Pf,t):Pf;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(xe&&xe.running&&xe.sources.has(n)?i=i(n.tValue):i=i(n.value)),X7(n,i));return[J7.bind(n),r]}function Bc(e,t,n){const r=Su(e,t,!0,Xr);$l(r)}function Ne(e,t,n){const r=Su(e,t,!1,Xr);$l(r)}function ie(e,t,n){K7=SO;const r=Su(e,t,!1,Xr),i=Gs&&mt(Gs);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),An?An.push(r):$l(r)}function U(e,t,n){n=n?Object.assign({},Pf,n):Pf;const r=Su(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,$l(r),J7.bind(r)}function vO(e){return e&&typeof e=="object"&&"then"in e}function Tl(e,t,n){let r,i,o;typeof t=="function"?(r=e,i=t,o=n||{}):(r=!0,i=e,o=t||{});let s=null,a=Dm,l=null,c=!1,u=!1,d="initialValue"in o,f=typeof r=="function"&&U(r);const h=new Set,[m,p]=(o.storage||be)(o.initialValue),[g,b]=be(void 0),[v,y]=be(void 0,{equals:!1}),[T,k]=be(d?"ready":"unresolved");Ae.context&&(l=Ae.getNextContextId(),o.ssrLoadFrom==="initial"?a=o.initialValue:Ae.load&&Ae.has(l)&&(a=Ae.load(l)));function x(F,R,E,S){return s===F&&(s=null,S!==void 0&&(d=!0),(F===a||R===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(S,{value:R})),a=Dm,xe&&F&&c?(xe.promises.delete(F),c=!1,Ir(()=>{xe.running=!0,_(R,E)},!1)):_(R,E)),R}function _(F,R){Ir(()=>{R===void 0&&p(()=>F),k(R!==void 0?"errored":d?"ready":"unresolved"),b(R);for(const E of h.keys())E.decrement();h.clear()},!1)}function A(){const F=Gs&&mt(Gs),R=m(),E=g();if(E!==void 0&&!s)throw E;return Et&&!Et.user&&F&&Bc(()=>{v(),s&&(F.resolved&&xe&&c?xe.promises.add(s):h.has(F)||(F.increment(),h.add(F)))}),R}function M(F=!0){if(F!==!1&&u)return;u=!1;const R=f?f():r;if(c=xe&&xe.running,R==null||R===!1){x(s,We(m));return}xe&&s&&xe.promises.delete(s);let E;const S=a!==Dm?a:We(()=>{try{return i(R,{value:m(),refetching:F})}catch($){E=$}});if(E!==void 0){x(s,void 0,mf(E),R);return}else if(!vO(S))return x(s,S,void 0,R),S;return s=S,"v"in S?(S.s===1?x(s,S.v,void 0,R):x(s,void 0,mf(S.v),R),S):(u=!0,queueMicrotask(()=>u=!1),Ir(()=>{k(d?"refreshing":"pending"),y()},!1),S.then($=>x(S,$,void 0,R),$=>x(S,void 0,mf($),R)))}Object.defineProperties(A,{state:{get:()=>T()},error:{get:()=>g()},loading:{get(){const F=T();return F==="pending"||F==="refreshing"}},latest:{get(){if(!d)return A();const F=g();if(F&&!s)throw F;return m()}}});let L=Ke;return f?Bc(()=>(L=Ke,M(!1))):M(!1),[A,{refetch:F=>bo(L,()=>M(F)),mutate:p}]}function et(e){return Ir(e,!1)}function We(e){if(Et===null)return e();const t=Et;Et=null;try{return e()}finally{Et=t}}function Qt(e,t,n){const r=Array.isArray(e);let i,o=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;ct(a,i,s));return i=a,l}}function Ht(e){ie(()=>We(e))}function oe(e){return Ke===null||(Ke.cleanups===null?Ke.cleanups=[e]:Ke.cleanups.push(e)),e}function bO(e,t){Pc||(Pc=Symbol("error")),Ke=Su(void 0,void 0,!0),Ke.context={...Ke.context,[Pc]:[t]},xe&&xe.running&&xe.sources.add(Ke);try{return e()}catch(n){_u(n)}finally{Ke=Ke.owner}}function bg(){return Et}function xi(){return Ke}function bo(e,t){const n=Ke,r=Et;Ke=e,Et=null;try{return Ir(t,!0)}catch(i){_u(i)}finally{Ke=n,Et=r}}function yO(e){if(xe&&xe.running)return e(),xe.done;const t=Et,n=Ke;return Promise.resolve().then(()=>{Et=t,Ke=n;let r;return Gs&&(r=xe||(xe={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),Ir(e,!1),Et=Ke=null,r?r.done:void 0})}const[phe,j2]=be(!1);function wO(e){An.push.apply(An,e),e.length=0}function wt(e,t){const n=Symbol("context");return{id:n,Provider:_O(n),defaultValue:e}}function mt(e){let t;return Ke&&Ke.context&&(t=Ke.context[e.id])!==void 0?t:e.defaultValue}function K0(e){const t=U(e),n=U(()=>yg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Gs;function kO(){return Gs||(Gs=wt())}function J7(){const e=xe&&xe.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Xr)$l(this);else{const t=Jn;Jn=null,Ir(()=>Rf(this),!1),Jn=t}if(Et){const t=this.observers?this.observers.length:0;Et.sources?(Et.sources.push(this),Et.sourceSlots.push(t)):(Et.sources=[this],Et.sourceSlots=[t]),this.observers?(this.observers.push(Et),this.observerSlots.push(Et.sources.length-1)):(this.observers=[Et],this.observerSlots=[Et.sources.length-1])}return e&&xe.sources.has(this)?this.tValue:this.value}function X7(e,t,n){let r=xe&&xe.running&&xe.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(xe){const i=xe.running;(i||!n&&xe.sources.has(e))&&(xe.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Ir(()=>{for(let i=0;i1e6)throw Jn=[],new Error},!1)}return t}function $l(e){if(!e.fn)return;cs(e);const t=G0;F2(e,xe&&xe.running&&xe.sources.has(e)?e.tValue:e.value,t),xe&&!xe.running&&xe.sources.has(e)&&queueMicrotask(()=>{Ir(()=>{xe&&(xe.running=!0),Et=Ke=e,F2(e,e.tValue,t),Et=Ke=null},!1)})}function F2(e,t,n){let r;const i=Ke,o=Et;Et=Ke=e;try{r=e.fn(t)}catch(s){return e.pure&&(xe&&xe.running?(e.tState=Xr,e.tOwned&&e.tOwned.forEach(cs),e.tOwned=void 0):(e.state=Xr,e.owned&&e.owned.forEach(cs),e.owned=null)),e.updatedAt=n+1,_u(s)}finally{Et=o,Ke=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?X7(e,r,!0):xe&&xe.running&&e.pure?(xe.sources.has(e)||(e.value=r),xe.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function Su(e,t,n,r=Xr,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ke,context:Ke?Ke.context:null,pure:n};return xe&&xe.running&&(o.state=0,o.tState=r),Ke===null||Ke!==Y7&&(xe&&xe.running&&Ke.pure?Ke.tOwned?Ke.tOwned.push(o):Ke.tOwned=[o]:Ke.owned?Ke.owned.push(o):Ke.owned=[o]),o}function Df(e){const t=xe&&xe.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===Uc)return Rf(e);if(e.suspense&&We(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--){if(e=n[r],t){let i=e,o=n[r+1];for(;(i=i.owner)&&i!==o;)if(xe.disposed.has(i))return}if((t?e.tState:e.state)===Xr)$l(e);else if((t?e.tState:e.state)===Uc){const i=Jn;Jn=null,Ir(()=>Rf(e,n[0]),!1),Jn=i}}}function Ir(e,t){if(Jn)return e();let n=!1;t||(Jn=[]),An?n=!0:An=[],G0++;try{const r=e();return xO(n),r}catch(r){n||(An=null),Jn=null,_u(r)}}function xO(e){if(Jn&&(Q7(Jn),Jn=null),e)return;let t;if(xe){if(!xe.promises.size&&!xe.queue.size){const r=xe.sources,i=xe.disposed;An.push.apply(An,xe.effects),t=xe.resolve;for(const o of An)"tState"in o&&(o.state=o.tState),delete o.tState;xe=null,Ir(()=>{for(const o of i)cs(o);for(const o of r){if(o.value=o.tValue,o.owned)for(let s=0,a=o.owned.length;sK7(n),!1),t&&t()}function Q7(e){for(let t=0;t=0;t--)cs(e.tOwned[t]);delete e.tOwned}if(xe&&xe.running&&e.pure)tk(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)cs(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}xe&&xe.running?e.tState=0:e.state=0}function tk(e,t){if(t||(e.tState=0,xe.disposed.add(e)),e.owned)for(let n=0;ni=We(()=>(Ke.context={...Ke.context,[e]:r.value},K0(()=>r.children))),void 0),i}}const wg=Symbol("fallback");function Nf(e){for(let t=0;t1?[]:null;return oe(()=>Nf(o)),()=>{let l=e()||[],c=l.length,u,d;return l[Of],We(()=>{let h,m,p,g,b,v,y,T,k;if(c===0)s!==0&&(Nf(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[wg],i[0]=Pn(x=>(o[0]=x,n.fallback())),s=1);else if(s===0){for(i=new Array(c),d=0;d=v&&T>=v&&r[y]===l[T];y--,T--)p[T]=i[y],g[T]=o[y],a&&(b[T]=a[y]);for(h=new Map,m=new Array(T+1),d=T;d>=v;d--)k=l[d],u=h.get(k),m[d]=u===void 0?-1:u,h.set(k,d);for(u=v;u<=y;u++)k=r[u],d=h.get(k),d!==void 0&&d!==-1?(p[d]=i[u],g[d]=o[u],a&&(b[d]=a[u]),d=m[d],h.set(k,d)):o[u]();for(d=v;dNf(o)),()=>{const c=e()||[],u=c.length;return c[Of],We(()=>{if(u===0)return a!==0&&(Nf(o),o=[],r=[],i=[],a=0,s=[]),n.fallback&&(r=[wg],i[0]=Pn(f=>(o[0]=f,n.fallback())),a=1),i;for(r[0]===wg&&(o[0](),o=[],r=[],i=[],a=0),l=0;lc[l]):l>=r.length&&(i[l]=Pn(d));for(;le(t||{}))}function fd(){return!0}const kg={get(e,t,n){return t===ki?n:e.get(t)},has(e,t){return t===ki?!0:e.has(t)},set:fd,deleteProperty:fd,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fd,deleteProperty:fd}},ownKeys(e){return e.keys()}};function Rm(e){return(e=typeof e=="function"?e():e)?e:{}}function EO(){for(let e=0,t=this.length;e=0;a--){const l=Rm(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Rm(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:EO.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const a=o[s],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function he(e,...t){const n=t.length;if(G7&&ki in e){const i=n>1?t.flat():t[0],o=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},kg));return o.push(new Proxy({get(s){return i.includes(s)?void 0:e[s]},has(s){return i.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!i.includes(s))}},kg)),o}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let o=n;for(let l=0;l{const o=Ae.context;if(o){const[a,l]=be();Ae.count||(Ae.count=0),Ae.count++,(n||(n=e())).then(c=>{!Ae.done&&vo(o),Ae.count--,l(()=>c.default),vo()}),t=a}else if(!t){const[a]=Tl(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return U(()=>(s=t())?We(()=>{if(!o||Ae.done)return s(i);const a=Ae.context;vo(o);const l=s(i);return vo(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let TO=0;function Cn(){return Ae.context?Ae.getNextContextId():`cl-${TO++}`}const rk=e=>`Stale read from <${e}>.`;function Kr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(CO(()=>e.each,e.children,t||void 0))}function ghe(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(IO(()=>e.each,e.children,t||void 0))}function Se(e){const t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(i,o)=>!i==!o});return U(()=>{const i=r();if(i){const o=e.children;return typeof o=="function"&&o.length>0?We(()=>o(t?i:()=>{if(!We(r))throw rk("Show");return n()})):o}return e.fallback},void 0,void 0)}function Ks(e){const t=K0(()=>e.children),n=U(()=>{const r=t(),i=Array.isArray(r)?r:[r];let o=()=>{};for(let s=0;sc()?void 0:l.when,void 0,void 0),d=l.keyed?u:U(u,void 0,{equals:(f,h)=>!f==!h});o=()=>c()||(d()?[a,u,l]:void 0)}return o});return U(()=>{const r=n()();if(!r)return e.fallback;const[i,o,s]=r,a=s.children;return typeof a=="function"&&a.length>0?We(()=>a(s.keyed?o():()=>{if(We(n)()?.[0]!==i)throw rk("Match");return o()})):a},void 0,void 0)}function On(e){return e}let Ya;function $O(){Ya&&[...Ya].forEach(e=>e())}function LO(e){let t;Ae.context&&Ae.load&&(t=Ae.load(Ae.getContextId()));const[n,r]=be(t,void 0);return Ya||(Ya=new Set),Ya.add(r),oe(()=>Ya.delete(r)),U(()=>{let i;if(i=n()){const o=e.fallback;return typeof o=="function"&&o.length?We(()=>o(i,()=>r())):o}return bO(()=>e.children,r)},void 0,void 0)}const AO=wt();function MO(e){let t=0,n,r,i,o,s;const[a,l]=be(!1),c=kO(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=xi();if(Ae.context&&Ae.load){const m=Ae.getContextId();let p=Ae.load(m);if(p&&(typeof p!="object"||p.s!==1?i=p:Ae.gather(m)),i&&i!=="$$f"){const[g,b]=be(void 0,{equals:!1});o=g,i.then(()=>{if(Ae.done)return b();Ae.gather(m),vo(r),b(),vo()},v=>{s=v,b()})}}const f=mt(AO);f&&(n=f.register(u.inFallback));let h;return oe(()=>h&&h()),I(c.Provider,{value:u,get children(){return U(()=>{if(s)throw s;if(r=Ae.context,o)return o(),o=void 0;r&&i==="$$f"&&vo();const m=U(()=>e.children);return U(p=>{const g=u.inFallback(),{showContent:b=!0,showFallback:v=!0}=n?n():{};if((!g||i&&i!=="$$f")&&b)return u.resolved=!0,h&&h(),h=r=i=void 0,wO(u.effects),m();if(v)return h?p:Pn(y=>(h=y,r&&(vo({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const OO=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],PO=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...OO]),DO=new Set(["innerHTML","textContent","innerText","children"]),RO=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),NO=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function zO(e,t){const n=NO[e];return typeof n=="object"?n[t]?n.$:void 0:n}const jO=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),FO=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),HO={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Je=e=>U(()=>e());function VO(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;su-a){const m=t[s];for(;a{i=o,t===document?e():J(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function ae(e,t,n,r){let i;const o=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},s=t?()=>We(()=>document.importNode(i||(i=o()),!0)):()=>(i||(i=o())).cloneNode(!0);return s.cloneNode=s,s}function Ar(e,t=window.document){const n=t[V2]||(t[V2]=new Set);for(let r=0,i=e.length;ri.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Ft(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;oi.children=qc(e,t.children,i.children)),Ne(()=>typeof t.ref=="function"&&fr(t.ref,e)),Ne(()=>WO(e,t,n,!0,i,!0)),i}function fr(e,t,n){return We(()=>e(t,n))}function J(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return qc(e,t,r,n);Ne(i=>qc(e,t(),i,n),r)}function WO(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=B2(e,s,null,i[s],n,o,t)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=B2(e,s,a,i[s],n,o,t)}}function ZO(e){let t,n;return!da()||!(t=Ae.registry.get(n=YO()))?e():(Ae.completed&&Ae.completed.add(t),Ae.registry.delete(n),t)}function da(e){return!!Ae.context&&!Ae.done&&(!e||e.isConnected)}function GO(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function U2(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i-1&&HO[t.split(":")[0]];f?BO(e,f,t,n):st(e,RO[t]||t,n)}return n}function KO(e){if(Ae.registry&&Ae.events&&Ae.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,o=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ae.registry&&!Ae.done&&(Ae.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();o(l[0]);for(let c=0;c{let l=t();for(;typeof l=="function";)l=l();n=qc(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(xg(l,t,n,i))return Ne(()=>n=qc(e,l,n,r,!0)),()=>n;if(o){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Ea(e,n,r),a)return n}else c?n.length===0?q2(e,l,r):VO(e,n,l):(n&&Ea(e),q2(e,l));n=l}else if(t.nodeType){if(o&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=Ea(e,n,r,t);Ea(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function xg(e,t,n,r){let i=!1;for(let o=0,s=t.length;o=0;s--){const a=t[s];if(i!==a){const l=a.parentNode===e;!o&&!s?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function YO(){return Ae.getNextContextId()}const JO=!1,XO="http://www.w3.org/2000/svg";function ik(e,t=!1,n=void 0){return t?document.createElementNS(XO,e):document.createElement(e,{is:n})}function fa(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=xi();let o,s=!!Ae.context;return ie(()=>{s&&(xi().user=s=!1),o||(o=bo(i,()=>U(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=be(!1),u=()=>c(!0);Pn(d=>J(a,()=>l()?d():o(),null)),oe(u)}else{const l=ik(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),J(c,o),a.appendChild(l),e.ref&&e.ref(l),oe(()=>a.removeChild(l))}},void 0,{render:!s}),n}function QO(e,t){const n=U(e);return U(()=>{const r=n();switch(typeof r){case"function":return We(()=>r(t));case"string":const i=FO.has(r),o=Ae.context?ZO():ik(r,i,We(()=>t.is));return Lr(o,t,i),o}})}function ok(e){const[,t]=he(e,["component"]);return QO(()=>e.component,t)}const eP="modulepreload",tP=function(e){return"/"+e},W2={},P=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");i=l(n.map(c=>{if(c=tP(c),c in W2)return;W2[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eP,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};function tn(e){const t=wt();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return I(t.Provider,{value:r,get children(){return n.children}});const o=U(()=>{const s=r.ready;return s===void 0||(typeof s=="function"?s():s)});return I(Se,{get when(){return o()},get children(){return I(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=mt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const{use:vhe,provider:nP}=tn({name:"Data",init:e=>({get store(){return e.data},get directory(){return e.directory},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref})}),sk=tn({name:"FileComponent",init:e=>e.component}),rP=sk.provider,bhe=sk.use,iP=e=>e!=null,yhe=e=>e.filter(iP);function oP(e){return(...t)=>{for(const n of e)n&&n(...t)}}const ce=e=>typeof e=="function"&&!e.length?e():e,Z2=e=>Array.isArray(e)?e:e?[e]:[];function sP(e,...t){return typeof e=="function"?e(...t):e}const Iv=oe;function aP(e,t,n){if(Ae.context){const[r,i]=be(e,n);return Ht(()=>i(()=>t())),[r,i]}return be(t(),n)}function whe(e,t,n,r){const i=e.length,o=t.length;let s=0;if(!o){for(;s{Z2(ce(e)).forEach(o=>{o&&Z2(ce(t)).forEach(s=>ak(o,s,n,r))})};typeof e=="function"?ie(i):Ne(i)}function cP(e,t=xi()){let n=0,r,i;return()=>(n++,oe(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||Pn(o=>r=e(i=o),t),r)}function uP(e){const t=xi(),n=cP(e,t);return()=>Ae.context?Pn(e,t):n()}function Ev(e,t=!1){const n=window.matchMedia(e),[r,i]=aP(t,()=>n.matches);return ak(n,"change",()=>i(n.matches)),r}function dP(e){return Ev("(prefers-color-scheme: dark)",e)}dP.bind(void 0,!1);const fP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function G2(e){const t={};let n;for(;n=fP.exec(e);)t[n[1]]=n[2];return t}function Ti(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=G2(e)}else typeof t=="string"&&(t=G2(t));return{...e,...t}}function Rt(...e){return oP(e)}function hP(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Sg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mP(e){return typeof e=="number"}function Ua(e){return Object.prototype.toString.call(e)==="[object String]"}function lk(e){return typeof e=="function"}function Ki(e){return t=>`${e()}-${t}`}function pP(){const e=new Map,t=(i,o,s,a)=>{const l=a?.once?(...c)=>{e.delete(s),s(...c)}:s;e.set(s,{type:o,eventTarget:i,fn:l,options:a}),i.addEventListener(o,s,a)},n=(i,o,s,a)=>{const l=e.get(s)?.fn||s;i.removeEventListener(o,l,a),e.delete(s)},r=()=>{e.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})};return oe(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function fn(e,t){return e?e===t||e.contains(t):!1}function wc(e,t=!1){const{activeElement:n}=or(e);if(!n?.nodeName)return null;if(ck(n)&&n.contentDocument)return wc(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=or(n).getElementById(r);if(i)return i}}return n}function Tv(e){return or(e).defaultView||window}function or(e){return e?e.ownerDocument||e:document}function ck(e){return e.tagName==="IFRAME"}var uk=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(uk||{});function dk(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function $v(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Y0(){return $v(/^Mac/i)}function gP(){return $v(/^iPhone/i)}function vP(){return $v(/^iPad/i)||Y0()&&navigator.maxTouchPoints>1}function bP(){return gP()||vP()}function yP(){return Y0()||bP()}function khe(){return dk(/AppleWebKit/i)&&!wP()}function wP(){return dk(/Chrome/i)}function Ze(e,t){return t&&(lk(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function un(e){return t=>{for(const n of e)Ze(t,n)}}function kP(e){return Y0()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function xn(e){if(e)if(xP())e.focus({preventScroll:!0});else{const t=SP(e);e.focus(),_P(t)}}var hd=null;function xP(){if(hd==null){hd=!1;try{document.createElement("div").focus({get preventScroll(){return hd=!0,!0}})}catch{}}return hd}function SP(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight{if(ck(i)&&i.contentDocument){const s=i.contentDocument.body,a=hk(s,!1);r.splice(o,1,...a)}}),r}function K2(e){return mk(e)&&!EP(e)}function mk(e){return e.matches(Lv)&&Av(e)}function EP(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Av(e,t){return e.nodeName!=="#comment"&&TP(e)&&$P(e,t)&&(!e.parentElement||Av(e.parentElement,e))}function TP(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:o,visibility:s}=i(e);r=o!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function $P(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function LP(e,t,n){const r=t?.tabbable?IP:Lv,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return t?.from?.contains(o)?NodeFilter.FILTER_REJECT:o.matches(r)&&Av(o)&&(!t?.accept||t.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function Y2(e){let t=e;for(;t&&!AP(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function AP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function MP(){}function pk(e){return[e.clientX,e.clientY]}function Mv(e,t){const[n,r]=e;let i=!1;const o=t.length;for(let s=o,a=0,l=s-1;a=f&&r0&&(r===f?r>h&&(i=!i):i=!i)}}else if(uu&&r<=f){if(m===0)return!0;m<0&&(r===f?r=d&&n<=c||n>=c&&n<=d))return!0}return i}function Ye(e,t){return re(e,t)}var ic=new Map,J2=new Set;function X2(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=ic.get(n.target);r||(r=new Set,ic.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=ic.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),ic.delete(n.target)),ic.size===0)){for(const i of J2)i();J2.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?X2():document.addEventListener("DOMContentLoaded",X2));function _g(e,t){const n=Q2(e,t,"left"),r=Q2(e,t,"top"),i=t.offsetWidth,o=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+i>l&&(s+=n+i-l),r<=a?a=r:r+o>c&&(a+=r+o-c),e.scrollLeft=s,e.scrollTop=a}function Q2(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function OP(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=Y2(e);for(;e&&i&&e!==n&&i!==n;)_g(i,e),e=i,i=Y2(e)}else{const{left:i,top:o}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(i-s)>1||Math.abs(o-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var PP={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},Wc="data-kb-top-layer",gk,Cg=!1,To=[];function Zc(e){return To.findIndex(t=>t.node===e)}function DP(e){return To[Zc(e)]}function RP(e){return To[To.length-1].node===e}function vk(){return To.filter(e=>e.isPointerBlocking)}function NP(){return[...vk()].slice(-1)[0]}function Ov(){return vk().length>0}function bk(e){const t=Zc(NP()?.node);return Zc(e)e.onMountAutoFocus?.(m),a=m=>e.onUnmountAutoFocus?.(m),l=()=>or(t()),c=()=>{const m=l().createElement("span");return m.setAttribute("data-focus-trap",""),m.tabIndex=0,Object.assign(m.style,PP),m},u=()=>{const m=t();return m?hk(m,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const m=u();return m.length>0?m[0]:null},f=()=>{const m=u();return m.length>0?m[m.length-1]:null},h=()=>{const m=t();if(!m)return!1;const p=wc(m);return!p||fn(m,p)?!1:mk(p)};ie(()=>{const m=t();if(!m)return;t6.add(i);const p=wc(m);if(!fn(m,p)){const b=new CustomEvent(Nm,e6);m.addEventListener(Nm,s),m.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{xn(d()),wc(m)===p&&xn(m)},0)}oe(()=>{m.removeEventListener(Nm,s),setTimeout(()=>{const b=new CustomEvent(zm,e6);h()&&b.preventDefault(),m.addEventListener(zm,a),m.dispatchEvent(b),b.defaultPrevented||xn(p??l().body),m.removeEventListener(zm,a),t6.remove(i)},0)})}),ie(()=>{const m=t();if(!m||!ce(e.trapFocus)||n())return;const p=b=>{const v=b.target;v?.closest(`[${Wc}]`)||(fn(m,v)?o=v:xn(o))},g=b=>{const y=b.relatedTarget??wc(m);y?.closest(`[${Wc}]`)||fn(m,y)||xn(o)};l().addEventListener("focusin",p),l().addEventListener("focusout",g),oe(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",g)})}),ie(()=>{const m=t();if(!m||!ce(e.trapFocus)||n())return;const p=c();m.insertAdjacentElement("afterbegin",p);const g=c();m.insertAdjacentElement("beforeend",g);function b(y){const T=d(),k=f();y.relatedTarget===T?xn(k):xn(T)}p.addEventListener("focusin",b),g.addEventListener("focusin",b);const v=new MutationObserver(y=>{for(const T of y)T.previousSibling===g&&(g.remove(),m.insertAdjacentElement("beforeend",g)),T.nextSibling===p&&(p.remove(),m.insertAdjacentElement("afterbegin",p))});v.observe(m,{childList:!0,subtree:!1}),oe(()=>{p.removeEventListener("focusin",b),g.removeEventListener("focusin",b),p.remove(),g.remove(),v.disconnect()})})}var UP="data-live-announcer";function wk(e){ie(()=>{ce(e.isDisabled)||oe(BP(ce(e.targets),ce(e.root)))})}var oc=new WeakMap,zr=[];function BP(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${UP}], [${Wc}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&o(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)o(f),f=u.nextNode()}},o=l=>{const c=oc.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),oc.set(l,c+1))};zr.length&&zr[zr.length-1].disconnect(),i(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return zr.push(a),()=>{s.disconnect();for(const l of r){const c=oc.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),oc.delete(l)):oc.set(l,c-1)}a===zr[zr.length-1]?(zr.pop(),zr.length&&zr[zr.length-1].observe()):zr.splice(zr.indexOf(a),1)}}var n6="interactOutside.pointerDownOutside",r6="interactOutside.focusOutside";function qP(e,t){let n,r=MP;const i=()=>or(t()),o=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof Element)||f.closest(`[${Wc}]`)||!fn(i(),f)||fn(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const h=t(),m=d.target;if(!h||!m||!l(d))return;const p=un([o,a]);m.addEventListener(n6,p,{once:!0});const g=new CustomEvent(n6,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||kP(d)&&d.button===0}});m.dispatchEvent(g)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const m=un([s,a]);h.addEventListener(r6,m,{once:!0});const p=new CustomEvent(r6,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};ie(()=>{ce(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),oe(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function WP(e){const t=n=>{n.key===uk.Escape&&e.onEscapeKeyDown?.(n)};ie(()=>{if(ce(e.isDisabled))return;const n=e.ownerDocument?.()??or();n.addEventListener("keydown",t),oe(()=>{n.removeEventListener("keydown",t)})})}function pt(e){const[t,n]=he(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return I(ok,re(n,{get component(){return t.as}}))}var kk=wt();function ZP(){return mt(kk)}function J0(e){let t;const n=ZP(),[r,i]=he(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),o=new Set([]),s=d=>{o.add(d);const f=n?.registerNestedLayer(d);return()=>{o.delete(d),f?.()}};qP({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>fn(f(),d))||[...o].some(f=>fn(f,d)):!1,onPointerDownOutside:d=>{!t||vr.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!vr.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),WP({ownerDocument:()=>or(t),onEscapeKeyDown:d=>{!t||!vr.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Ht(()=>{if(!t)return;vr.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);vr.assignPointerEventToLayers(),vr.disableBodyPointerEvents(t),oe(()=>{t&&(vr.removeLayer(t),d?.(),vr.assignPointerEventToLayers(),vr.restoreBodyPointerEvents(t))})}),ie(Qt([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=vr.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,vr.assignPointerEventToLayers()),f&&vr.disableBodyPointerEvents(d),oe(()=>{vr.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return I(kk.Provider,{value:u,get children(){return I(pt,re({as:"div",ref(d){var f=Rt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function Iu(e){const[t,n]=be(e.defaultValue?.()),r=U(()=>e.value?.()!==void 0),i=U(()=>r()?e.value?.():t());return[i,s=>{We(()=>{const a=sP(s,i());return Object.is(a,i())||(r()||n(a),e.onChange?.(a)),a})}]}function xk(e){const[t,n]=Iu(e);return[()=>t()??!1,n]}function GP(e){const[t,n]=Iu(e);return[()=>t()??[],n]}function ha(e={}){const[t,n]=xk({value:()=>ce(e.open),defaultValue:()=>!!ce(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function Eu(e,t){const[n,r]=be(i6(t?.()));return ie(()=>{r(e()?.tagName.toLowerCase()||i6(t?.()))}),n}function i6(e){return Ua(e)?e:void 0}var KP=Object.defineProperty,$i=(e,t)=>{for(var n in t)KP(e,n,{get:t[n],enumerable:!0})},YP={};$i(YP,{Button:()=>Pv,Root:()=>ma});var JP=["button","color","file","image","reset","submit"];function XP(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?JP.indexOf(e.type)!==-1:!1}function ma(e){let t;const n=Ye({type:"button"},e),[r,i]=he(n,["ref","type","disabled"]),o=Eu(()=>t,()=>"button"),s=U(()=>{const c=o();return c==null?!1:XP({tagName:c,type:r.type})}),a=U(()=>o()==="input"),l=U(()=>o()==="a"&&t?.getAttribute("href")!=null);return I(pt,re({as:"button",ref(c){var u=Rt(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return Je(()=>!!(s()||a()))()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return Je(()=>!!(s()||a()))()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var Pv=ma;function Kn(e){return t=>(e(t),()=>e(void 0))}var Vn=e=>typeof e=="function"?e():e,Ig=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},md=new Map,QP=e=>{ie(()=>{const t=Vn(e.style)??{},n=Vn(e.properties)??[],r={};for(const o in t)r[o]=e.element.style[o];const i=md.get(e.key);i?i.activeCount++:md.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(o=>o.key)}),Object.assign(e.element.style,e.style);for(const o of n)e.element.style.setProperty(o.key,o.value);oe(()=>{const o=md.get(e.key);if(o){if(o.activeCount!==1){o.activeCount--;return}md.delete(e.key);for(const[s,a]of Object.entries(o.originalStyles))e.element.style[s]=a;for(const s of o.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},o6=QP,eD=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},tD=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},nD=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,o=0,s=0,a=!1;do{const[l,c,u]=eD(i,t),d=u-l-r*c;(c!==0||d!==0)&&tD(i,t)&&(o+=d,s+=c),i===(n??document.documentElement)?a=!0:i=i._$host??i.parentElement}while(i&&!a);return[o,s]},[s6,a6]=be([]),rD=e=>s6().indexOf(e)===s6().length-1,iD=e=>{const t=re({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Cn();let r=[0,0],i=null,o=null;ie(()=>{Vn(t.enabled)&&(a6(c=>[...c,n]),oe(()=>{a6(c=>c.filter(u=>u!==n))}))}),ie(()=>{if(!Vn(t.enabled)||!Vn(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Vn(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Vn(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,m=window.scrollX;o6({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Vn(t.restoreScrollPosition)&&u>0&&window.scrollTo(m,h)}})}else o6({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),ie(()=>{!rD(n)||!Vn(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),oe(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=l6(c),i=null,o=null},a=c=>{const u=c.target,d=Vn(t.element),f=oD(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",m=h==="x"?f[0]:f[1],p=c6(u,h,m,d);let g;d&&Ig(d,u)?g=!p:g=!0,g&&c.cancelable&&c.preventDefault()},l=c=>{const u=Vn(t.element),d=c.target;let f;if(c.touches.length===2)f=!Vn(t.allowPinchZoom);else{if(i==null||o===null){const h=l6(c).map((p,g)=>r[g]-p),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=m,o=m==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=c6(d,i,o,u);u&&Ig(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},oD=e=>[e.deltaX,e.deltaY],l6=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],c6=(e,t,n,r)=>{const i=r!==null&&Ig(r,e),[o,s]=nD(e,t,i?r:void 0);return!(n>0&&Math.abs(o)<=1||n<0&&Math.abs(s)<1)},sD=iD,Sk=sD,aD=e=>{const t=U(()=>{const s=Vn(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,i]=be(Vn(e.show)?"present":"hidden");let o="none";return ie(s=>{const a=Vn(e.show);return We(()=>{if(s===a)return a;const l=o,c=n();a?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(s===!0&&l!==c?"hiding":"hidden")}),a}),ie(()=>{const s=Vn(e.element);if(!s)return;const a=c=>{c.target===s&&(o=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&i("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),oe(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},lD=aD,Ys=lD,cD={};$i(cD,{CloseButton:()=>Ck,Content:()=>Ik,Description:()=>Ek,Dialog:()=>es,Overlay:()=>Tk,Portal:()=>$k,Root:()=>Lk,Title:()=>Ak,Trigger:()=>Mk,useDialogContext:()=>vs});var _k=wt();function vs(){const e=mt(_k);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Ck(e){const t=vs(),[n,r]=he(e,["aria-label","onClick"]);return I(ma,re({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:o=>{Ze(o,n.onClick),t.close()}},r))}function Ik(e){let t;const n=vs(),r=Ye({id:n.generateId("content")},e),[i,o]=he(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=f=>{i.onPointerDownOutside?.(f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},c=f=>{i.onFocusOutside?.(f),n.modal()&&f.preventDefault()},u=f=>{i.onInteractOutside?.(f),!n.modal()&&(f.defaultPrevented||(s=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),fn(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{i.onCloseAutoFocus?.(f),n.modal()?(f.preventDefault(),xn(n.triggerRef())):(f.defaultPrevented||(s||xn(n.triggerRef()),f.preventDefault()),s=!1,a=!1)};return wk({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),Sk({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),yk({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),ie(()=>oe(n.registerContentId(o.id))),I(Se,{get when(){return n.contentPresent()},get children(){return I(J0,re({ref(f){var h=Rt(m=>{n.setContentRef(m),t=m},i.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return Je(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},o))}})}function Ek(e){const t=vs(),n=Ye({id:t.generateId("description")},e),[r,i]=he(n,["id"]);return ie(()=>oe(t.registerDescriptionId(r.id))),I(pt,re({as:"p",get id(){return r.id}},i))}function Tk(e){const t=vs(),[n,r]=he(e,["ref","style","onPointerDown"]),i=o=>{Ze(o,n.onPointerDown),o.target===o.currentTarget&&o.preventDefault()};return I(Se,{get when(){return t.overlayPresent()},get children(){return I(pt,re({as:"div",ref(o){var s=Rt(t.setOverlayRef,n.ref);typeof s=="function"&&s(o)},get style(){return Ti({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function $k(e){const t=vs();return I(Se,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return I(fa,e)}})}var u6={dismiss:"Dismiss"};function Lk(e){const t=`dialog-${Cn()}`,n=Ye({id:t,modal:!0,translations:u6},e),[r,i]=be(),[o,s]=be(),[a,l]=be(),[c,u]=be(),[d,f]=be(),[h,m]=be(),p=ha({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:T=>n.onOpenChange?.(T)}),g=()=>n.forceMount||p.isOpen(),{present:b}=Ys({show:g,element:()=>c()??null}),{present:v}=Ys({show:g,element:()=>d()??null}),y={translations:()=>n.translations??u6,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??y.modal(),contentId:r,titleId:o,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:d,setContentRef:f,overlayPresent:b,contentPresent:v,close:p.close,toggle:p.toggle,setTriggerRef:m,generateId:Ki(()=>n.id),registerContentId:Kn(i),registerTitleId:Kn(s),registerDescriptionId:Kn(l)};return I(_k.Provider,{value:y,get children(){return n.children}})}function Ak(e){const t=vs(),n=Ye({id:t.generateId("title")},e),[r,i]=he(n,["id"]);return ie(()=>oe(t.registerTitleId(r.id))),I(pt,re({as:"h2",get id(){return r.id}},i))}function Mk(e){const t=vs(),[n,r]=he(e,["ref","onClick"]);return I(ma,re({ref(o){var s=Rt(t.setTriggerRef,n.ref);typeof s=="function"&&s(o)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return Je(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:o=>{Ze(o,n.onClick),t.toggle()}},r))}var es=Object.assign(Lk,{CloseButton:Ck,Content:Ik,Description:Ek,Overlay:Tk,Portal:$k,Title:Ak,Trigger:Mk}),uD=ae("
");const Ok=wt();function dD(){const[e,t]=be(),n={current:void 0},r={value:!1};oe(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const s=e();if(!s||r.value)return;r.value=!0,s.onClose?.(),s.setClosing(!0);const a=s.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,s.dispose(),e()?.id===a&&t(void 0),r.value=!1},100)};return ie(()=>{if(!e())return;const s=a=>{a.key==="Escape"&&(i(),a.preventDefault(),a.stopPropagation())};window.addEventListener("keydown",s,!0),oe(()=>window.removeEventListener("keydown",s,!0))}),{get active(){return e()},close:i,show:(s,a,l)=>{const c=e();c&&(c.dispose(),t(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let d,f;const h=bo(a,()=>Pn(m=>{d=m;const[p,g]=be(!1);return f=g,I(es,{modal:!0,get open(){return!p()},onOpenChange:b=>{b||i()},get children(){return I(es.Portal,{get children(){return[I(es.Overlay,{"data-component":"dialog-overlay",onClick:i}),Je(()=>s())]}})}})}));!d||!f||t({id:u,node:h,dispose:d,owner:a,onClose:l,setClosing:f})}}}function fD(e){const t=dD();return I(Ok.Provider,{value:t,get children(){return[Je(()=>e.children),(()=>{var n=uD();return J(n,()=>t.active?.node),n})()]}})}function X0(){const e=mt(Ok),t=xi();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.active},show(n,r){const i=e.active?.owner??t;e.show(n,i,r)},close(){e.close()}}}const Pk={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function hD(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),o=t[i];return o===void 0?"":String(o)}):e}const mD={locale:()=>"en",t:(e,t)=>{const n=Pk[e]??String(e);return hD(n,t)}},Dk=wt(mD);function pD(e){return I(Dk.Provider,{get value(){return e.value},get children(){return e.children}})}function Ll(){return mt(Dk)}function Dv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pa=Dv();function Rk(e){pa=e}var Dc={exec:()=>null};function _t(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(tr.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,t)};return r}var gD=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},vD=/^(?:[ \t]*(?:\n|$))+/,bD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Rv=/(?:[*+-]|\d{1,9}[.)])/,Nk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zk=_t(Nk).replace(/bull/g,Rv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),kD=_t(Nk).replace(/bull/g,Rv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Nv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xD=/^[^\n]+/,zv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,SD=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_D=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Rv).getRegex(),Q0="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jv=/|$))/,CD=_t("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",jv).replace("tag",Q0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jk=_t(Nv).replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Q0).getRegex(),ID=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jk).getRegex(),Fv={blockquote:ID,code:bD,def:SD,fences:yD,heading:wD,hr:Tu,html:CD,lheading:zk,list:_D,newline:vD,paragraph:jk,table:Dc,text:xD},d6=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Q0).getRegex(),ED={...Fv,lheading:kD,table:d6,paragraph:_t(Nv).replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",d6).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Q0).getRegex()},TD={...Fv,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(Nv).replace("hr",Tu).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",zk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$D=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,LD=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fk=/^( {2,}|\\)\n(?!\s*$)/,AD=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",gD?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Uk=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,RD=_t(Uk,"u").replace(/punct/g,eh).getRegex(),ND=_t(Uk,"u").replace(/punct/g,Vk).getRegex(),Bk="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zD=_t(Bk,"gu").replace(/notPunctSpace/g,Hk).replace(/punctSpace/g,Hv).replace(/punct/g,eh).getRegex(),jD=_t(Bk,"gu").replace(/notPunctSpace/g,PD).replace(/punctSpace/g,OD).replace(/punct/g,Vk).getRegex(),FD=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hk).replace(/punctSpace/g,Hv).replace(/punct/g,eh).getRegex(),HD=_t(/\\(punct)/,"gu").replace(/punct/g,eh).getRegex(),VD=_t(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),UD=_t(jv).replace("(?:-->|$)","-->").getRegex(),BD=_t("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",UD).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,qD=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qk=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",zf).replace("ref",zv).getRegex(),Wk=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",zv).getRegex(),WD=_t("reflink|nolink(?!\\()","g").replace("reflink",qk).replace("nolink",Wk).getRegex(),f6=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vv={_backpedal:Dc,anyPunctuation:HD,autolink:VD,blockSkip:DD,br:Fk,code:LD,del:Dc,emStrongLDelim:RD,emStrongRDelimAst:zD,emStrongRDelimUnd:FD,escape:$D,link:qD,nolink:Wk,punctuation:MD,reflink:qk,reflinkSearch:WD,tag:BD,text:AD,url:Dc},ZD={...Vv,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",zf).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zf).getRegex()},Eg={...Vv,emStrongRDelimAst:jD,emStrongLDelim:ND,url:_t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",f6).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},h6=e=>KD[e];function ho(e,t){if(t){if(tr.escapeTest.test(e))return e.replace(tr.escapeReplace,h6)}else if(tr.escapeTestNoEncode.test(e))return e.replace(tr.escapeReplaceNoEncode,h6);return e}function m6(e){try{e=encodeURI(e).replace(tr.percentDecode,"%")}catch{return null}return e}function p6(e,t){let n=e.replace(tr.findPipe,(o,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(tr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length0?-2:-1}function g6(e,t,n,r,i){let o=t.href,s=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function JD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` `).map(o=>{let s=o.match(n.other.beginningSpace);if(s===null)return o;let[a]=s;return a.length>=i.length?o.slice(i.length):o}).join(` `)}var jf=class{options;rules;lexer;constructor(t){this.options=t||pa}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ac(r,` `)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let r=n[0],i=JD(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let i=ac(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:ac(n[0],` `)}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let r=ac(n[0],` `).split(` `),i="",o="",s=[];for(;r.length>0;){let a=!1,l=[],c;for(c=0;c1,o={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let s=this.rules.other.listItemRegex(r),a=!1;for(;t;){let c=!1,u="",d="";if(!(n=s.exec(t))||this.rules.block.hr.test(t))break;u=n[0],t=t.substring(u.length);let f=n[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,g=>" ".repeat(3*g.length)),h=t.split(` `,1)[0],m=!f.trim(),p=0;if(this.options.pedantic?(p=2,d=f.trimStart()):m?p=n[1].length+1:(p=n[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,d=f.slice(p),p+=n[1].length),m&&this.rules.other.blankLine.test(h)&&(u+=h+` `,t=t.substring(h.length+1),c=!0),!c){let g=this.rules.other.nextBulletRegex(p),b=this.rules.other.hrRegex(p),v=this.rules.other.fencesBeginRegex(p),y=this.rules.other.headingBeginRegex(p),T=this.rules.other.htmlBeginRegex(p);for(;t;){let k=t.split(` `,1)[0],x;if(h=k,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),x=h):x=h.replace(this.rules.other.tabCharGlobal," "),v.test(h)||y.test(h)||T.test(h)||g.test(h)||b.test(h))break;if(x.search(this.rules.other.nonSpaceChar)>=p||!h.trim())d+=` `+x.slice(p);else{if(m||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||y.test(f)||b.test(f))break;d+=` `+h}!m&&!h.trim()&&(m=!0),u+=k+` `,t=t.substring(k.length+1),f=x.slice(p)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),o.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),o.raw+=u}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c of o.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(c.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};c.checked=d.checked,o.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=d.raw+c.tokens[0].raw,c.tokens[0].text=d.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(d)):c.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):c.tokens.unshift(d)}}if(!o.loose){let u=c.tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=d}}if(o.loose)for(let c of o.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return o}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=p6(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],s={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let r=n[1].charAt(n[1].length-1)===` `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let s=ac(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{let s=YD(n[2],"()");if(s===-2)return;if(s>-1){let a=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],o=s[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),g6(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[i.toLowerCase()];if(!o){let s=r[0].charAt(0);return{type:"text",raw:s,text:s}}return g6(r,o,r[0],this.lexer,this.rules)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...i[0]].length-1,s,a,l=o,c=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*t.length+o);(i=u.exec(n))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(a=[...s].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&o%3&&!((o+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let d=[...i[0]][0].length,f=t.slice(0,o+i.index+d+a);if(Math.min(o,a)%2){let m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}let h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){let n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let r,i;return n[2]==="@"?(r=n[1],i="mailto:"+r):(r=n[1],i=r),{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,i;if(n[2]==="@")r=n[0],i="mailto:"+r;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);r=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},hi=class Tg{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||pa,this.options.tokenizer=this.options.tokenizer||new jf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:tr,block:pd.normal,inline:sc.normal};this.options.pedantic?(n.block=pd.pedantic,n.inline=sc.pedantic):this.options.gfm&&(n.block=pd.gfm,this.options.breaks?n.inline=sc.breaks:n.inline=sc.gfm),this.tokenizer.rules=n}static get rules(){return{block:pd,inline:sc}}static lex(t,n){return new Tg(n).lex(t)}static lexInline(t,n){return new Tg(n).inlineTokens(t)}lex(t){t=t.replace(tr.carriageReturn,` `),this.blockTokens(t,this.tokens);for(let n=0;n(i=s.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let s=n.at(-1);i.raw.length===1&&s!==void 0?s.raw+=` `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+i.raw,s.text+=` `+i.text,this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+i.raw,s.text+=` `+i.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let o=t;if(this.options.extensions?.startBlock){let s=1/0,a=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(o=t.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let s=n.at(-1);r&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+i.raw,s.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i),r=o.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let s=n.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+i.raw,s.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let s=!1,a="";for(;t;){s||(a=""),s=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,r,a)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if(this.options.extensions?.startInline){let u=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),s=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},Ff=class{options;parser;constructor(t){this.options=t||pa}space(t){return""}code({text:t,lang:n,escaped:r}){let i=(n||"").match(tr.notSpaceStart)?.[0],o=t.replace(tr.endingNewline,"")+` `;return i?'
'+(r?o:ho(o,!0))+`
`:"
"+(r?o:ho(o,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`${this.parser.parseInline(t)} `}hr(t){return`
`}list(t){let n=t.ordered,r=t.start,i="";for(let a=0;a `+i+" `}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • `}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let n="",r="";for(let o=0;o${i}`),` `+n+` `+i+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+` `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ho(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),o=m6(t);if(o===null)return i;t=o;let s='
    ",s}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let o=m6(t);if(o===null)return ho(r);t=o;let s=`${r}{let a=o[s].flat(1/0);r=r.concat(this.walkTokens(a,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=n.renderers[o.name];s?n.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=n[o.level];s?s.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),i.extensions=n),r.renderer){let o=this.defaults.renderer||new Ff(this.defaults);for(let s in r.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=r.renderer[a],c=o[a];o[a]=(...u)=>{let d=l.apply(o,u);return d===!1&&(d=c.apply(o,u)),d||""}}i.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new jf(this.defaults);for(let s in r.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=r.tokenizer[a],c=o[a];o[a]=(...u)=>{let d=l.apply(o,u);return d===!1&&(d=c.apply(o,u)),d}}i.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new kc;for(let s in r.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,l=r.hooks[a],c=o[a];kc.passThroughHooks.has(s)?o[a]=u=>{if(this.defaults.async&&kc.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(o,u);return c.call(o,f)})();let d=l.call(o,u);return c.call(o,d)}:o[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(o,u);return f===!1&&(f=await c.apply(o,u)),f})();let d=l.apply(o,u);return d===!1&&(d=c.apply(o,u)),d}}i.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,s=r.walkTokens;i.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return hi.lex(t,n??this.defaults)}parser(t,n){return mi.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},o={...this.defaults,...i},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(n):n,l=await(o.hooks?await o.hooks.provideLexer():t?hi.lex:hi.lexInline)(a,o),c=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let u=await(o.hooks?await o.hooks.provideParser():t?mi.parse:mi.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(u):u})().catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let a=(o.hooks?o.hooks.provideLexer():t?hi.lex:hi.lexInline)(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?mi.parse:mi.parseInline)(a,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(a){return s(a)}}}onError(t,n){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,t){let i="

    An error occurred:

    "+ho(r.message+"",!0)+"
    ";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Js=new XD;function Lt(e,t){return Js.parse(e,t)}Lt.options=Lt.setOptions=function(e){return Js.setOptions(e),Lt.defaults=Js.defaults,Rk(Lt.defaults),Lt};Lt.getDefaults=Dv;Lt.defaults=pa;Lt.use=function(...e){return Js.use(...e),Lt.defaults=Js.defaults,Rk(Lt.defaults),Lt};Lt.walkTokens=function(e,t){return Js.walkTokens(e,t)};Lt.parseInline=Js.parseInline;Lt.Parser=mi;Lt.parser=mi.parse;Lt.Renderer=Ff;Lt.TextRenderer=Uv;Lt.Lexer=hi;Lt.lexer=hi.lex;Lt.Tokenizer=jf;Lt.Hooks=kc;Lt.parse=Lt;Lt.options;Lt.setOptions;Lt.use;Lt.walkTokens;Lt.parseInline;mi.parse;hi.lex;class ur{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new ur(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class Er{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new Er(n,ur.range(this,t))}}class pe{constructor(t,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+t,i,o,s=n&&n.loc;if(s&&s.start<=s.end){var a=s.lexer.input;i=s.start,o=s.end,i===a.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=a.slice(i,o).replace(/[^]/g,"$&̲"),c;i>15?c="…"+a.slice(i-15,i):c=a.slice(0,i);var u;o+15":">","<":"<",'"':""","'":"'"},rR=/[&><"']/g;function iR(e){return String(e).replace(rR,t=>nR[t])}var Zk=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},oR=function(t){var n=Zk(t);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},sR=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},aR=function(t){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},St={deflt:QD,escape:iR,hyphenate:tR,getBaseElem:Zk,isCharacterBox:oR,protocolFromUrl:aR},pf={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function lR(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let Bv=class{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n in pf)if(pf.hasOwnProperty(n)){var r=pf[n];this[n]=t[n]!==void 0?r.processor?r.processor(t[n]):t[n]:lR(r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new pe("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var n=St.protocolFromUrl(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}},Bo=class{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Ni[cR[this.id]]}sub(){return Ni[uR[this.id]]}fracNum(){return Ni[dR[this.id]]}fracDen(){return Ni[fR[this.id]]}cramp(){return Ni[hR[this.id]]}text(){return Ni[mR[this.id]]}isTight(){return this.size>=2}};var qv=0,Hf=1,tl=2,So=3,Gc=4,qr=5,ml=6,nr=7,Ni=[new Bo(qv,0,!1),new Bo(Hf,0,!0),new Bo(tl,1,!1),new Bo(So,1,!0),new Bo(Gc,2,!1),new Bo(qr,2,!0),new Bo(ml,3,!1),new Bo(nr,3,!0)],cR=[Gc,qr,Gc,qr,ml,nr,ml,nr],uR=[qr,qr,qr,qr,nr,nr,nr,nr],dR=[tl,So,Gc,qr,ml,nr,ml,nr],fR=[So,So,qr,qr,nr,nr,nr,nr],hR=[Hf,Hf,So,So,qr,qr,nr,nr],mR=[qv,Hf,tl,So,tl,So,tl,So],je={DISPLAY:Ni[qv],TEXT:Ni[tl],SCRIPT:Ni[Gc],SCRIPTSCRIPT:Ni[ml]},Lg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function pR(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var gf=[];Lg.forEach(e=>e.blocks.forEach(t=>gf.push(...t)));function Gk(e){for(var t=0;t=gf[t]&&e<=gf[t+1])return!0;return!1}var Ta=80,gR=function(t,n){return"M95,"+(622+t+n)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 c69,-144,104.5,-217.7,106.5,-221 l`+t/2.075+" -"+t+` c5.3,-9.3,12,-14,20,-14 H400000v`+(40+t)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},vR=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+t/2.084+" -"+t+` c4.7,-7.3,11,-11,19,-11 H40000v`+(40+t)+`H1012.3 s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},bR=function(t,n){return"M983 "+(10+t+n)+` l`+t/3.13+" -"+t+` c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},yR=function(t,n){return"M424,"+(2398+t+n)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 v`+(40+t)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` h400000v`+(40+t)+"h-400000z"},wR=function(t,n){return"M473,"+(2713+t+n)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, 606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},kR=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},xR=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},SR=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=gR(n,Ta);break;case"sqrtSize1":i=vR(n,Ta);break;case"sqrtSize2":i=bR(n,Ta);break;case"sqrtSize3":i=yR(n,Ta);break;case"sqrtSize4":i=wR(n,Ta);break;case"sqrtTall":i=xR(n,Ta,r)}return i},_R=function(t,n){switch(t){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},v6={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 435 0h399565z`,leftgroupunder:`M400000 262 H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},CR=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class $u{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;nn.toText();return this.children.map(t).join("")}}var ji={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},gd={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},b6={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function IR(e,t){ji[e]=t}function Wv(e,t,n){if(!ji[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=ji[t][r];if(!i&&e[0]in b6&&(r=b6[e[0]].charCodeAt(0),i=ji[t][r]),!i&&n==="text"&&Gk(r)&&(i=ji[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var jm={};function ER(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!jm[t]){var n=jm[t]={cssEmPerMu:gd.quad[t]/18};for(var r in gd)gd.hasOwnProperty(r)&&(n[r]=gd[r][t])}return jm[t]}var TR=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],y6=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],w6=function(t,n){return n.size<2?t:TR[t-1][n.size-1]};class mo{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||mo.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=y6[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new mo(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:w6(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:y6[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=w6(mo.BASESIZE,t);return this.size===n&&this.textSize===mo.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==mo.BASESIZE?["sizing","reset-size"+this.size,"size"+mo.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=ER(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}mo.BASESIZE=6;var Ag={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},$R={ex:!0,em:!0,mu:!0},Kk=function(t){return typeof t!="string"&&(t=t.unit),t in Ag||t in $R||t==="ex"},Gt=function(t,n){var r;if(t.unit in Ag)r=Ag[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new pe("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},ye=function(t){return+t.toFixed(4)+"em"},us=function(t){return t.filter(n=>n).join(" ")},Yk=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},Jk=function(t){var n=document.createElement(t);n.className=us(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&n.setAttribute(i,this.attributes[i]);for(var o=0;o/=\x00-\x1f]/,Xk=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+St.escape(us(this.classes))+'"');var r="";for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=St.hyphenate(i)+":"+this.style[i]+";");r&&(n+=' style="'+St.escape(r)+'"');for(var o in this.attributes)if(this.attributes.hasOwnProperty(o)){if(LR.test(o))throw new pe("Invalid attribute name '"+o+"'");n+=" "+o+'="'+St.escape(this.attributes[o])+'"'}n+=">";for(var s=0;s",n};class Lu{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Yk.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Jk.call(this,"span")}toMarkup(){return Xk.call(this,"span")}}class Zv{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Yk.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Jk.call(this,"a")}toMarkup(){return Xk.call(this,"a")}}class AR{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t=''+St.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=ye(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=us(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=St.hyphenate(i)+":"+this.style[i]+";");r&&(t=!0,n+=' style="'+St.escape(r)+'"');var o=St.escape(this.text);return t?(n+=">",n+=o,n+="",n):o}}class $o{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Mg{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var PR={bin:1,close:1,inner:1,open:1,punct:1,rel:1},DR={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Dt={math:{},text:{}};function w(e,t,n,r,i,o){Dt[e][i]={font:t,group:n,replace:r},o&&r&&(Dt[e][r]=Dt[e][i])}var C="math",de="text",D="main",B="ams",Bt="accent-token",Ee="bin",ar="close",Al="inner",ze="mathord",hn="op-token",Mr="open",th="punct",q="rel",zo="spacing",K="textord";w(C,D,q,"≡","\\equiv",!0);w(C,D,q,"≺","\\prec",!0);w(C,D,q,"≻","\\succ",!0);w(C,D,q,"∼","\\sim",!0);w(C,D,q,"⊥","\\perp");w(C,D,q,"⪯","\\preceq",!0);w(C,D,q,"⪰","\\succeq",!0);w(C,D,q,"≃","\\simeq",!0);w(C,D,q,"∣","\\mid",!0);w(C,D,q,"≪","\\ll",!0);w(C,D,q,"≫","\\gg",!0);w(C,D,q,"≍","\\asymp",!0);w(C,D,q,"∥","\\parallel");w(C,D,q,"⋈","\\bowtie",!0);w(C,D,q,"⌣","\\smile",!0);w(C,D,q,"⊑","\\sqsubseteq",!0);w(C,D,q,"⊒","\\sqsupseteq",!0);w(C,D,q,"≐","\\doteq",!0);w(C,D,q,"⌢","\\frown",!0);w(C,D,q,"∋","\\ni",!0);w(C,D,q,"∝","\\propto",!0);w(C,D,q,"⊢","\\vdash",!0);w(C,D,q,"⊣","\\dashv",!0);w(C,D,q,"∋","\\owns");w(C,D,th,".","\\ldotp");w(C,D,th,"⋅","\\cdotp");w(C,D,K,"#","\\#");w(de,D,K,"#","\\#");w(C,D,K,"&","\\&");w(de,D,K,"&","\\&");w(C,D,K,"ℵ","\\aleph",!0);w(C,D,K,"∀","\\forall",!0);w(C,D,K,"ℏ","\\hbar",!0);w(C,D,K,"∃","\\exists",!0);w(C,D,K,"∇","\\nabla",!0);w(C,D,K,"♭","\\flat",!0);w(C,D,K,"ℓ","\\ell",!0);w(C,D,K,"♮","\\natural",!0);w(C,D,K,"♣","\\clubsuit",!0);w(C,D,K,"℘","\\wp",!0);w(C,D,K,"♯","\\sharp",!0);w(C,D,K,"♢","\\diamondsuit",!0);w(C,D,K,"ℜ","\\Re",!0);w(C,D,K,"♡","\\heartsuit",!0);w(C,D,K,"ℑ","\\Im",!0);w(C,D,K,"♠","\\spadesuit",!0);w(C,D,K,"§","\\S",!0);w(de,D,K,"§","\\S");w(C,D,K,"¶","\\P",!0);w(de,D,K,"¶","\\P");w(C,D,K,"†","\\dag");w(de,D,K,"†","\\dag");w(de,D,K,"†","\\textdagger");w(C,D,K,"‡","\\ddag");w(de,D,K,"‡","\\ddag");w(de,D,K,"‡","\\textdaggerdbl");w(C,D,ar,"⎱","\\rmoustache",!0);w(C,D,Mr,"⎰","\\lmoustache",!0);w(C,D,ar,"⟯","\\rgroup",!0);w(C,D,Mr,"⟮","\\lgroup",!0);w(C,D,Ee,"∓","\\mp",!0);w(C,D,Ee,"⊖","\\ominus",!0);w(C,D,Ee,"⊎","\\uplus",!0);w(C,D,Ee,"⊓","\\sqcap",!0);w(C,D,Ee,"∗","\\ast");w(C,D,Ee,"⊔","\\sqcup",!0);w(C,D,Ee,"◯","\\bigcirc",!0);w(C,D,Ee,"∙","\\bullet",!0);w(C,D,Ee,"‡","\\ddagger");w(C,D,Ee,"≀","\\wr",!0);w(C,D,Ee,"⨿","\\amalg");w(C,D,Ee,"&","\\And");w(C,D,q,"⟵","\\longleftarrow",!0);w(C,D,q,"⇐","\\Leftarrow",!0);w(C,D,q,"⟸","\\Longleftarrow",!0);w(C,D,q,"⟶","\\longrightarrow",!0);w(C,D,q,"⇒","\\Rightarrow",!0);w(C,D,q,"⟹","\\Longrightarrow",!0);w(C,D,q,"↔","\\leftrightarrow",!0);w(C,D,q,"⟷","\\longleftrightarrow",!0);w(C,D,q,"⇔","\\Leftrightarrow",!0);w(C,D,q,"⟺","\\Longleftrightarrow",!0);w(C,D,q,"↦","\\mapsto",!0);w(C,D,q,"⟼","\\longmapsto",!0);w(C,D,q,"↗","\\nearrow",!0);w(C,D,q,"↩","\\hookleftarrow",!0);w(C,D,q,"↪","\\hookrightarrow",!0);w(C,D,q,"↘","\\searrow",!0);w(C,D,q,"↼","\\leftharpoonup",!0);w(C,D,q,"⇀","\\rightharpoonup",!0);w(C,D,q,"↙","\\swarrow",!0);w(C,D,q,"↽","\\leftharpoondown",!0);w(C,D,q,"⇁","\\rightharpoondown",!0);w(C,D,q,"↖","\\nwarrow",!0);w(C,D,q,"⇌","\\rightleftharpoons",!0);w(C,B,q,"≮","\\nless",!0);w(C,B,q,"","\\@nleqslant");w(C,B,q,"","\\@nleqq");w(C,B,q,"⪇","\\lneq",!0);w(C,B,q,"≨","\\lneqq",!0);w(C,B,q,"","\\@lvertneqq");w(C,B,q,"⋦","\\lnsim",!0);w(C,B,q,"⪉","\\lnapprox",!0);w(C,B,q,"⊀","\\nprec",!0);w(C,B,q,"⋠","\\npreceq",!0);w(C,B,q,"⋨","\\precnsim",!0);w(C,B,q,"⪹","\\precnapprox",!0);w(C,B,q,"≁","\\nsim",!0);w(C,B,q,"","\\@nshortmid");w(C,B,q,"∤","\\nmid",!0);w(C,B,q,"⊬","\\nvdash",!0);w(C,B,q,"⊭","\\nvDash",!0);w(C,B,q,"⋪","\\ntriangleleft");w(C,B,q,"⋬","\\ntrianglelefteq",!0);w(C,B,q,"⊊","\\subsetneq",!0);w(C,B,q,"","\\@varsubsetneq");w(C,B,q,"⫋","\\subsetneqq",!0);w(C,B,q,"","\\@varsubsetneqq");w(C,B,q,"≯","\\ngtr",!0);w(C,B,q,"","\\@ngeqslant");w(C,B,q,"","\\@ngeqq");w(C,B,q,"⪈","\\gneq",!0);w(C,B,q,"≩","\\gneqq",!0);w(C,B,q,"","\\@gvertneqq");w(C,B,q,"⋧","\\gnsim",!0);w(C,B,q,"⪊","\\gnapprox",!0);w(C,B,q,"⊁","\\nsucc",!0);w(C,B,q,"⋡","\\nsucceq",!0);w(C,B,q,"⋩","\\succnsim",!0);w(C,B,q,"⪺","\\succnapprox",!0);w(C,B,q,"≆","\\ncong",!0);w(C,B,q,"","\\@nshortparallel");w(C,B,q,"∦","\\nparallel",!0);w(C,B,q,"⊯","\\nVDash",!0);w(C,B,q,"⋫","\\ntriangleright");w(C,B,q,"⋭","\\ntrianglerighteq",!0);w(C,B,q,"","\\@nsupseteqq");w(C,B,q,"⊋","\\supsetneq",!0);w(C,B,q,"","\\@varsupsetneq");w(C,B,q,"⫌","\\supsetneqq",!0);w(C,B,q,"","\\@varsupsetneqq");w(C,B,q,"⊮","\\nVdash",!0);w(C,B,q,"⪵","\\precneqq",!0);w(C,B,q,"⪶","\\succneqq",!0);w(C,B,q,"","\\@nsubseteqq");w(C,B,Ee,"⊴","\\unlhd");w(C,B,Ee,"⊵","\\unrhd");w(C,B,q,"↚","\\nleftarrow",!0);w(C,B,q,"↛","\\nrightarrow",!0);w(C,B,q,"⇍","\\nLeftarrow",!0);w(C,B,q,"⇏","\\nRightarrow",!0);w(C,B,q,"↮","\\nleftrightarrow",!0);w(C,B,q,"⇎","\\nLeftrightarrow",!0);w(C,B,q,"△","\\vartriangle");w(C,B,K,"ℏ","\\hslash");w(C,B,K,"▽","\\triangledown");w(C,B,K,"◊","\\lozenge");w(C,B,K,"Ⓢ","\\circledS");w(C,B,K,"®","\\circledR");w(de,B,K,"®","\\circledR");w(C,B,K,"∡","\\measuredangle",!0);w(C,B,K,"∄","\\nexists");w(C,B,K,"℧","\\mho");w(C,B,K,"Ⅎ","\\Finv",!0);w(C,B,K,"⅁","\\Game",!0);w(C,B,K,"‵","\\backprime");w(C,B,K,"▲","\\blacktriangle");w(C,B,K,"▼","\\blacktriangledown");w(C,B,K,"■","\\blacksquare");w(C,B,K,"⧫","\\blacklozenge");w(C,B,K,"★","\\bigstar");w(C,B,K,"∢","\\sphericalangle",!0);w(C,B,K,"∁","\\complement",!0);w(C,B,K,"ð","\\eth",!0);w(de,D,K,"ð","ð");w(C,B,K,"╱","\\diagup");w(C,B,K,"╲","\\diagdown");w(C,B,K,"□","\\square");w(C,B,K,"□","\\Box");w(C,B,K,"◊","\\Diamond");w(C,B,K,"¥","\\yen",!0);w(de,B,K,"¥","\\yen",!0);w(C,B,K,"✓","\\checkmark",!0);w(de,B,K,"✓","\\checkmark");w(C,B,K,"ℶ","\\beth",!0);w(C,B,K,"ℸ","\\daleth",!0);w(C,B,K,"ℷ","\\gimel",!0);w(C,B,K,"ϝ","\\digamma",!0);w(C,B,K,"ϰ","\\varkappa");w(C,B,Mr,"┌","\\@ulcorner",!0);w(C,B,ar,"┐","\\@urcorner",!0);w(C,B,Mr,"└","\\@llcorner",!0);w(C,B,ar,"┘","\\@lrcorner",!0);w(C,B,q,"≦","\\leqq",!0);w(C,B,q,"⩽","\\leqslant",!0);w(C,B,q,"⪕","\\eqslantless",!0);w(C,B,q,"≲","\\lesssim",!0);w(C,B,q,"⪅","\\lessapprox",!0);w(C,B,q,"≊","\\approxeq",!0);w(C,B,Ee,"⋖","\\lessdot");w(C,B,q,"⋘","\\lll",!0);w(C,B,q,"≶","\\lessgtr",!0);w(C,B,q,"⋚","\\lesseqgtr",!0);w(C,B,q,"⪋","\\lesseqqgtr",!0);w(C,B,q,"≑","\\doteqdot");w(C,B,q,"≓","\\risingdotseq",!0);w(C,B,q,"≒","\\fallingdotseq",!0);w(C,B,q,"∽","\\backsim",!0);w(C,B,q,"⋍","\\backsimeq",!0);w(C,B,q,"⫅","\\subseteqq",!0);w(C,B,q,"⋐","\\Subset",!0);w(C,B,q,"⊏","\\sqsubset",!0);w(C,B,q,"≼","\\preccurlyeq",!0);w(C,B,q,"⋞","\\curlyeqprec",!0);w(C,B,q,"≾","\\precsim",!0);w(C,B,q,"⪷","\\precapprox",!0);w(C,B,q,"⊲","\\vartriangleleft");w(C,B,q,"⊴","\\trianglelefteq");w(C,B,q,"⊨","\\vDash",!0);w(C,B,q,"⊪","\\Vvdash",!0);w(C,B,q,"⌣","\\smallsmile");w(C,B,q,"⌢","\\smallfrown");w(C,B,q,"≏","\\bumpeq",!0);w(C,B,q,"≎","\\Bumpeq",!0);w(C,B,q,"≧","\\geqq",!0);w(C,B,q,"⩾","\\geqslant",!0);w(C,B,q,"⪖","\\eqslantgtr",!0);w(C,B,q,"≳","\\gtrsim",!0);w(C,B,q,"⪆","\\gtrapprox",!0);w(C,B,Ee,"⋗","\\gtrdot");w(C,B,q,"⋙","\\ggg",!0);w(C,B,q,"≷","\\gtrless",!0);w(C,B,q,"⋛","\\gtreqless",!0);w(C,B,q,"⪌","\\gtreqqless",!0);w(C,B,q,"≖","\\eqcirc",!0);w(C,B,q,"≗","\\circeq",!0);w(C,B,q,"≜","\\triangleq",!0);w(C,B,q,"∼","\\thicksim");w(C,B,q,"≈","\\thickapprox");w(C,B,q,"⫆","\\supseteqq",!0);w(C,B,q,"⋑","\\Supset",!0);w(C,B,q,"⊐","\\sqsupset",!0);w(C,B,q,"≽","\\succcurlyeq",!0);w(C,B,q,"⋟","\\curlyeqsucc",!0);w(C,B,q,"≿","\\succsim",!0);w(C,B,q,"⪸","\\succapprox",!0);w(C,B,q,"⊳","\\vartriangleright");w(C,B,q,"⊵","\\trianglerighteq");w(C,B,q,"⊩","\\Vdash",!0);w(C,B,q,"∣","\\shortmid");w(C,B,q,"∥","\\shortparallel");w(C,B,q,"≬","\\between",!0);w(C,B,q,"⋔","\\pitchfork",!0);w(C,B,q,"∝","\\varpropto");w(C,B,q,"◀","\\blacktriangleleft");w(C,B,q,"∴","\\therefore",!0);w(C,B,q,"∍","\\backepsilon");w(C,B,q,"▶","\\blacktriangleright");w(C,B,q,"∵","\\because",!0);w(C,B,q,"⋘","\\llless");w(C,B,q,"⋙","\\gggtr");w(C,B,Ee,"⊲","\\lhd");w(C,B,Ee,"⊳","\\rhd");w(C,B,q,"≂","\\eqsim",!0);w(C,D,q,"⋈","\\Join");w(C,B,q,"≑","\\Doteq",!0);w(C,B,Ee,"∔","\\dotplus",!0);w(C,B,Ee,"∖","\\smallsetminus");w(C,B,Ee,"⋒","\\Cap",!0);w(C,B,Ee,"⋓","\\Cup",!0);w(C,B,Ee,"⩞","\\doublebarwedge",!0);w(C,B,Ee,"⊟","\\boxminus",!0);w(C,B,Ee,"⊞","\\boxplus",!0);w(C,B,Ee,"⋇","\\divideontimes",!0);w(C,B,Ee,"⋉","\\ltimes",!0);w(C,B,Ee,"⋊","\\rtimes",!0);w(C,B,Ee,"⋋","\\leftthreetimes",!0);w(C,B,Ee,"⋌","\\rightthreetimes",!0);w(C,B,Ee,"⋏","\\curlywedge",!0);w(C,B,Ee,"⋎","\\curlyvee",!0);w(C,B,Ee,"⊝","\\circleddash",!0);w(C,B,Ee,"⊛","\\circledast",!0);w(C,B,Ee,"⋅","\\centerdot");w(C,B,Ee,"⊺","\\intercal",!0);w(C,B,Ee,"⋒","\\doublecap");w(C,B,Ee,"⋓","\\doublecup");w(C,B,Ee,"⊠","\\boxtimes",!0);w(C,B,q,"⇢","\\dashrightarrow",!0);w(C,B,q,"⇠","\\dashleftarrow",!0);w(C,B,q,"⇇","\\leftleftarrows",!0);w(C,B,q,"⇆","\\leftrightarrows",!0);w(C,B,q,"⇚","\\Lleftarrow",!0);w(C,B,q,"↞","\\twoheadleftarrow",!0);w(C,B,q,"↢","\\leftarrowtail",!0);w(C,B,q,"↫","\\looparrowleft",!0);w(C,B,q,"⇋","\\leftrightharpoons",!0);w(C,B,q,"↶","\\curvearrowleft",!0);w(C,B,q,"↺","\\circlearrowleft",!0);w(C,B,q,"↰","\\Lsh",!0);w(C,B,q,"⇈","\\upuparrows",!0);w(C,B,q,"↿","\\upharpoonleft",!0);w(C,B,q,"⇃","\\downharpoonleft",!0);w(C,D,q,"⊶","\\origof",!0);w(C,D,q,"⊷","\\imageof",!0);w(C,B,q,"⊸","\\multimap",!0);w(C,B,q,"↭","\\leftrightsquigarrow",!0);w(C,B,q,"⇉","\\rightrightarrows",!0);w(C,B,q,"⇄","\\rightleftarrows",!0);w(C,B,q,"↠","\\twoheadrightarrow",!0);w(C,B,q,"↣","\\rightarrowtail",!0);w(C,B,q,"↬","\\looparrowright",!0);w(C,B,q,"↷","\\curvearrowright",!0);w(C,B,q,"↻","\\circlearrowright",!0);w(C,B,q,"↱","\\Rsh",!0);w(C,B,q,"⇊","\\downdownarrows",!0);w(C,B,q,"↾","\\upharpoonright",!0);w(C,B,q,"⇂","\\downharpoonright",!0);w(C,B,q,"⇝","\\rightsquigarrow",!0);w(C,B,q,"⇝","\\leadsto");w(C,B,q,"⇛","\\Rrightarrow",!0);w(C,B,q,"↾","\\restriction");w(C,D,K,"‘","`");w(C,D,K,"$","\\$");w(de,D,K,"$","\\$");w(de,D,K,"$","\\textdollar");w(C,D,K,"%","\\%");w(de,D,K,"%","\\%");w(C,D,K,"_","\\_");w(de,D,K,"_","\\_");w(de,D,K,"_","\\textunderscore");w(C,D,K,"∠","\\angle",!0);w(C,D,K,"∞","\\infty",!0);w(C,D,K,"′","\\prime");w(C,D,K,"△","\\triangle");w(C,D,K,"Γ","\\Gamma",!0);w(C,D,K,"Δ","\\Delta",!0);w(C,D,K,"Θ","\\Theta",!0);w(C,D,K,"Λ","\\Lambda",!0);w(C,D,K,"Ξ","\\Xi",!0);w(C,D,K,"Π","\\Pi",!0);w(C,D,K,"Σ","\\Sigma",!0);w(C,D,K,"Υ","\\Upsilon",!0);w(C,D,K,"Φ","\\Phi",!0);w(C,D,K,"Ψ","\\Psi",!0);w(C,D,K,"Ω","\\Omega",!0);w(C,D,K,"A","Α");w(C,D,K,"B","Β");w(C,D,K,"E","Ε");w(C,D,K,"Z","Ζ");w(C,D,K,"H","Η");w(C,D,K,"I","Ι");w(C,D,K,"K","Κ");w(C,D,K,"M","Μ");w(C,D,K,"N","Ν");w(C,D,K,"O","Ο");w(C,D,K,"P","Ρ");w(C,D,K,"T","Τ");w(C,D,K,"X","Χ");w(C,D,K,"¬","\\neg",!0);w(C,D,K,"¬","\\lnot");w(C,D,K,"⊤","\\top");w(C,D,K,"⊥","\\bot");w(C,D,K,"∅","\\emptyset");w(C,B,K,"∅","\\varnothing");w(C,D,ze,"α","\\alpha",!0);w(C,D,ze,"β","\\beta",!0);w(C,D,ze,"γ","\\gamma",!0);w(C,D,ze,"δ","\\delta",!0);w(C,D,ze,"ϵ","\\epsilon",!0);w(C,D,ze,"ζ","\\zeta",!0);w(C,D,ze,"η","\\eta",!0);w(C,D,ze,"θ","\\theta",!0);w(C,D,ze,"ι","\\iota",!0);w(C,D,ze,"κ","\\kappa",!0);w(C,D,ze,"λ","\\lambda",!0);w(C,D,ze,"μ","\\mu",!0);w(C,D,ze,"ν","\\nu",!0);w(C,D,ze,"ξ","\\xi",!0);w(C,D,ze,"ο","\\omicron",!0);w(C,D,ze,"π","\\pi",!0);w(C,D,ze,"ρ","\\rho",!0);w(C,D,ze,"σ","\\sigma",!0);w(C,D,ze,"τ","\\tau",!0);w(C,D,ze,"υ","\\upsilon",!0);w(C,D,ze,"ϕ","\\phi",!0);w(C,D,ze,"χ","\\chi",!0);w(C,D,ze,"ψ","\\psi",!0);w(C,D,ze,"ω","\\omega",!0);w(C,D,ze,"ε","\\varepsilon",!0);w(C,D,ze,"ϑ","\\vartheta",!0);w(C,D,ze,"ϖ","\\varpi",!0);w(C,D,ze,"ϱ","\\varrho",!0);w(C,D,ze,"ς","\\varsigma",!0);w(C,D,ze,"φ","\\varphi",!0);w(C,D,Ee,"∗","*",!0);w(C,D,Ee,"+","+");w(C,D,Ee,"−","-",!0);w(C,D,Ee,"⋅","\\cdot",!0);w(C,D,Ee,"∘","\\circ",!0);w(C,D,Ee,"÷","\\div",!0);w(C,D,Ee,"±","\\pm",!0);w(C,D,Ee,"×","\\times",!0);w(C,D,Ee,"∩","\\cap",!0);w(C,D,Ee,"∪","\\cup",!0);w(C,D,Ee,"∖","\\setminus",!0);w(C,D,Ee,"∧","\\land");w(C,D,Ee,"∨","\\lor");w(C,D,Ee,"∧","\\wedge",!0);w(C,D,Ee,"∨","\\vee",!0);w(C,D,K,"√","\\surd");w(C,D,Mr,"⟨","\\langle",!0);w(C,D,Mr,"∣","\\lvert");w(C,D,Mr,"∥","\\lVert");w(C,D,ar,"?","?");w(C,D,ar,"!","!");w(C,D,ar,"⟩","\\rangle",!0);w(C,D,ar,"∣","\\rvert");w(C,D,ar,"∥","\\rVert");w(C,D,q,"=","=");w(C,D,q,":",":");w(C,D,q,"≈","\\approx",!0);w(C,D,q,"≅","\\cong",!0);w(C,D,q,"≥","\\ge");w(C,D,q,"≥","\\geq",!0);w(C,D,q,"←","\\gets");w(C,D,q,">","\\gt",!0);w(C,D,q,"∈","\\in",!0);w(C,D,q,"","\\@not");w(C,D,q,"⊂","\\subset",!0);w(C,D,q,"⊃","\\supset",!0);w(C,D,q,"⊆","\\subseteq",!0);w(C,D,q,"⊇","\\supseteq",!0);w(C,B,q,"⊈","\\nsubseteq",!0);w(C,B,q,"⊉","\\nsupseteq",!0);w(C,D,q,"⊨","\\models");w(C,D,q,"←","\\leftarrow",!0);w(C,D,q,"≤","\\le");w(C,D,q,"≤","\\leq",!0);w(C,D,q,"<","\\lt",!0);w(C,D,q,"→","\\rightarrow",!0);w(C,D,q,"→","\\to");w(C,B,q,"≱","\\ngeq",!0);w(C,B,q,"≰","\\nleq",!0);w(C,D,zo," ","\\ ");w(C,D,zo," ","\\space");w(C,D,zo," ","\\nobreakspace");w(de,D,zo," ","\\ ");w(de,D,zo," "," ");w(de,D,zo," ","\\space");w(de,D,zo," ","\\nobreakspace");w(C,D,zo,null,"\\nobreak");w(C,D,zo,null,"\\allowbreak");w(C,D,th,",",",");w(C,D,th,";",";");w(C,B,Ee,"⊼","\\barwedge",!0);w(C,B,Ee,"⊻","\\veebar",!0);w(C,D,Ee,"⊙","\\odot",!0);w(C,D,Ee,"⊕","\\oplus",!0);w(C,D,Ee,"⊗","\\otimes",!0);w(C,D,K,"∂","\\partial",!0);w(C,D,Ee,"⊘","\\oslash",!0);w(C,B,Ee,"⊚","\\circledcirc",!0);w(C,B,Ee,"⊡","\\boxdot",!0);w(C,D,Ee,"△","\\bigtriangleup");w(C,D,Ee,"▽","\\bigtriangledown");w(C,D,Ee,"†","\\dagger");w(C,D,Ee,"⋄","\\diamond");w(C,D,Ee,"⋆","\\star");w(C,D,Ee,"◃","\\triangleleft");w(C,D,Ee,"▹","\\triangleright");w(C,D,Mr,"{","\\{");w(de,D,K,"{","\\{");w(de,D,K,"{","\\textbraceleft");w(C,D,ar,"}","\\}");w(de,D,K,"}","\\}");w(de,D,K,"}","\\textbraceright");w(C,D,Mr,"{","\\lbrace");w(C,D,ar,"}","\\rbrace");w(C,D,Mr,"[","\\lbrack",!0);w(de,D,K,"[","\\lbrack",!0);w(C,D,ar,"]","\\rbrack",!0);w(de,D,K,"]","\\rbrack",!0);w(C,D,Mr,"(","\\lparen",!0);w(C,D,ar,")","\\rparen",!0);w(de,D,K,"<","\\textless",!0);w(de,D,K,">","\\textgreater",!0);w(C,D,Mr,"⌊","\\lfloor",!0);w(C,D,ar,"⌋","\\rfloor",!0);w(C,D,Mr,"⌈","\\lceil",!0);w(C,D,ar,"⌉","\\rceil",!0);w(C,D,K,"\\","\\backslash");w(C,D,K,"∣","|");w(C,D,K,"∣","\\vert");w(de,D,K,"|","\\textbar",!0);w(C,D,K,"∥","\\|");w(C,D,K,"∥","\\Vert");w(de,D,K,"∥","\\textbardbl");w(de,D,K,"~","\\textasciitilde");w(de,D,K,"\\","\\textbackslash");w(de,D,K,"^","\\textasciicircum");w(C,D,q,"↑","\\uparrow",!0);w(C,D,q,"⇑","\\Uparrow",!0);w(C,D,q,"↓","\\downarrow",!0);w(C,D,q,"⇓","\\Downarrow",!0);w(C,D,q,"↕","\\updownarrow",!0);w(C,D,q,"⇕","\\Updownarrow",!0);w(C,D,hn,"∐","\\coprod");w(C,D,hn,"⋁","\\bigvee");w(C,D,hn,"⋀","\\bigwedge");w(C,D,hn,"⨄","\\biguplus");w(C,D,hn,"⋂","\\bigcap");w(C,D,hn,"⋃","\\bigcup");w(C,D,hn,"∫","\\int");w(C,D,hn,"∫","\\intop");w(C,D,hn,"∬","\\iint");w(C,D,hn,"∭","\\iiint");w(C,D,hn,"∏","\\prod");w(C,D,hn,"∑","\\sum");w(C,D,hn,"⨂","\\bigotimes");w(C,D,hn,"⨁","\\bigoplus");w(C,D,hn,"⨀","\\bigodot");w(C,D,hn,"∮","\\oint");w(C,D,hn,"∯","\\oiint");w(C,D,hn,"∰","\\oiiint");w(C,D,hn,"⨆","\\bigsqcup");w(C,D,hn,"∫","\\smallint");w(de,D,Al,"…","\\textellipsis");w(C,D,Al,"…","\\mathellipsis");w(de,D,Al,"…","\\ldots",!0);w(C,D,Al,"…","\\ldots",!0);w(C,D,Al,"⋯","\\@cdots",!0);w(C,D,Al,"⋱","\\ddots",!0);w(C,D,K,"⋮","\\varvdots");w(de,D,K,"⋮","\\varvdots");w(C,D,Bt,"ˊ","\\acute");w(C,D,Bt,"ˋ","\\grave");w(C,D,Bt,"¨","\\ddot");w(C,D,Bt,"~","\\tilde");w(C,D,Bt,"ˉ","\\bar");w(C,D,Bt,"˘","\\breve");w(C,D,Bt,"ˇ","\\check");w(C,D,Bt,"^","\\hat");w(C,D,Bt,"⃗","\\vec");w(C,D,Bt,"˙","\\dot");w(C,D,Bt,"˚","\\mathring");w(C,D,ze,"","\\@imath");w(C,D,ze,"","\\@jmath");w(C,D,K,"ı","ı");w(C,D,K,"ȷ","ȷ");w(de,D,K,"ı","\\i",!0);w(de,D,K,"ȷ","\\j",!0);w(de,D,K,"ß","\\ss",!0);w(de,D,K,"æ","\\ae",!0);w(de,D,K,"œ","\\oe",!0);w(de,D,K,"ø","\\o",!0);w(de,D,K,"Æ","\\AE",!0);w(de,D,K,"Œ","\\OE",!0);w(de,D,K,"Ø","\\O",!0);w(de,D,Bt,"ˊ","\\'");w(de,D,Bt,"ˋ","\\`");w(de,D,Bt,"ˆ","\\^");w(de,D,Bt,"˜","\\~");w(de,D,Bt,"ˉ","\\=");w(de,D,Bt,"˘","\\u");w(de,D,Bt,"˙","\\.");w(de,D,Bt,"¸","\\c");w(de,D,Bt,"˚","\\r");w(de,D,Bt,"ˇ","\\v");w(de,D,Bt,"¨",'\\"');w(de,D,Bt,"˝","\\H");w(de,D,Bt,"◯","\\textcircled");var Qk={"--":!0,"---":!0,"``":!0,"''":!0};w(de,D,K,"–","--",!0);w(de,D,K,"–","\\textendash");w(de,D,K,"—","---",!0);w(de,D,K,"—","\\textemdash");w(de,D,K,"‘","`",!0);w(de,D,K,"‘","\\textquoteleft");w(de,D,K,"’","'",!0);w(de,D,K,"’","\\textquoteright");w(de,D,K,"“","``",!0);w(de,D,K,"“","\\textquotedblleft");w(de,D,K,"”","''",!0);w(de,D,K,"”","\\textquotedblright");w(C,D,K,"°","\\degree",!0);w(de,D,K,"°","\\degree");w(de,D,K,"°","\\textdegree",!0);w(C,D,K,"£","\\pounds");w(C,D,K,"£","\\mathsterling",!0);w(de,D,K,"£","\\pounds");w(de,D,K,"£","\\textsterling",!0);w(C,B,K,"✠","\\maltese");w(de,B,K,"✠","\\maltese");var x6='0123456789/@."';for(var Fm=0;Fm0)return fi(o,c,i,n,s.concat(u));if(l){var d,f;if(l==="boldsymbol"){var h=zR(o,i,n,s,r);d=h.fontName,f=[h.fontClass]}else a?(d=n8[l].fontName,f=[l]):(d=wd(l,n.fontWeight,n.fontShape),f=[l,n.fontWeight,n.fontShape]);if(nh(o,d,i).metrics)return fi(o,d,i,n,s.concat(f));if(Qk.hasOwnProperty(o)&&d.slice(0,10)==="Typewriter"){for(var m=[],p=0;p{if(us(e.classes)!==us(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},HR=e=>{for(var t=0;tn&&(n=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},lr=function(t,n,r,i){var o=new Lu(t,n,r,i);return Gv(o),o},e8=(e,t,n,r)=>new Lu(e,t,n,r),VR=function(t,n,r){var i=lr([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=ye(i.height),i.maxFontSize=1,i},UR=function(t,n,r,i){var o=new Zv(t,n,r,i);return Gv(o),o},t8=function(t){var n=new $u(t);return Gv(n),n},BR=function(t,n){return t instanceof $u?lr([],[t],n):t},qR=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,o=i,s=1;s{var n=lr(["mspace"],[],t),r=Gt(e,t);return n.style.marginRight=ye(r),n},wd=function(t,n,r){var i="";switch(t){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=t}var o;return n==="textbf"&&r==="textit"?o="BoldItalic":n==="textbf"?o="Bold":n==="textit"?o="Italic":o="Regular",i+"-"+o},n8={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},r8={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},GR=function(t,n){var[r,i,o]=r8[t],s=new ds(r),a=new $o([s],{width:ye(i),height:ye(o),style:"width:"+ye(i),viewBox:"0 0 "+1e3*i+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),l=e8(["overlay"],[a],n);return l.height=o,l.style.height=ye(o),l.style.width=ye(i),l},ee={fontMap:n8,makeSymbol:fi,mathsym:NR,makeSpan:lr,makeSvgSpan:e8,makeLineSpan:VR,makeAnchor:UR,makeFragment:t8,wrapFragment:BR,makeVList:WR,makeOrd:jR,makeGlue:ZR,staticSvg:GR,svgData:r8,tryCombineChars:HR},Wt={number:3,unit:"mu"},Is={number:4,unit:"mu"},io={number:5,unit:"mu"},KR={mord:{mop:Wt,mbin:Is,mrel:io,minner:Wt},mop:{mord:Wt,mop:Wt,mrel:io,minner:Wt},mbin:{mord:Is,mop:Is,mopen:Is,minner:Is},mrel:{mord:io,mop:io,mopen:io,minner:io},mopen:{},mclose:{mop:Wt,mbin:Is,mrel:io,minner:Wt},mpunct:{mord:Wt,mop:Wt,mrel:io,mopen:Wt,mclose:Wt,mpunct:Wt,minner:Wt},minner:{mord:Wt,mop:Wt,mbin:Is,mrel:io,mopen:Wt,mpunct:Wt,minner:Wt}},YR={mord:{mop:Wt},mop:{mord:Wt,mop:Wt},mbin:{},mrel:{},mopen:{},mclose:{mop:Wt},mpunct:{},minner:{mop:Wt}},i8={},Uf={},Bf={};function Ce(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:s}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l{var g=p.classes[0],b=m.classes[0];g==="mbin"&&XR.includes(b)?p.classes[0]="mord":b==="mbin"&&JR.includes(g)&&(m.classes[0]="mord")},{node:d},f,h),E6(o,(m,p)=>{var g=Pg(p),b=Pg(m),v=g&&b?m.hasClass("mtight")?YR[g][b]:KR[g][b]:null;if(v)return ee.makeGlue(v,c)},{node:d},f,h),o},E6=function e(t,n,r,i,o){i&&t.push(i);for(var s=0;sf=>{t.splice(d+1,0,f),s++})(s)}i&&t.pop()},o8=function(t){return t instanceof $u||t instanceof Zv||t instanceof Lu&&t.hasClass("enclosing")?t:null},tN=function e(t,n){var r=o8(t);if(r){var i=r.children;if(i.length){if(n==="right")return e(i[i.length-1],"right");if(n==="left")return e(i[0],"left")}}return t},Pg=function(t,n){return t?(n&&(t=tN(t,n)),eN[t.classes[0]]||null):null},Kc=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Lo(n.concat(r))},yt=function(t,n,r){if(!t)return Lo();if(Uf[t.type]){var i=Uf[t.type](t,n);if(r&&n.size!==r.size){i=Lo(n.sizingClasses(r),[i],n);var o=n.sizeMultiplier/r.sizeMultiplier;i.height*=o,i.depth*=o}return i}else throw new pe("Got group of unknown type: '"+t.type+"'")};function kd(e,t){var n=Lo(["base"],e,t),r=Lo(["strut"]);return r.style.height=ye(n.height+n.depth),n.depth&&(r.style.verticalAlign=ye(-n.depth)),n.children.unshift(r),n}function Dg(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=_n(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var o=[],s=[],a=0;a0&&(o.push(kd(s,t)),s=[]),o.push(r[a]));s.length>0&&o.push(kd(s,t));var c;n?(c=kd(_n(n,t,!0)),c.classes=["tag"],o.push(c)):i&&o.push(i);var u=Lo(["katex-html"],o);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=ye(u.height+u.depth),u.depth&&(d.style.verticalAlign=ye(-u.depth))}return u}function s8(e){return new $u(e)}class _r{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=us(this.classes));for(var r=0;r0&&(t+=' class ="'+St.escape(us(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Fi{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return St.escape(this.toText())}toText(){return this.text}}class nN{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",ye(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var me={MathNode:_r,TextNode:Fi,SpaceNode:nN,newDocumentFragment:s8},ei=function(t,n,r){return Dt[n][t]&&Dt[n][t].replace&&t.charCodeAt(0)!==55349&&!(Qk.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Dt[n][t].replace),new me.TextNode(t)},Kv=function(t){return t.length===1?t[0]:new me.MathNode("mrow",t)},Yv=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var i=t.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var o=t.text;if(["\\imath","\\jmath"].includes(o))return null;Dt[i][o]&&Dt[i][o].replace&&(o=Dt[i][o].replace);var s=ee.fontMap[r].fontName;return Wv(o,s,i)?ee.fontMap[r].variant:null};function Bm(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Fi&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Fi&&n.text===","}else return!1}var pr=function(t,n,r){if(t.length===1){var i=Ot(t[0],n);return r&&i instanceof _r&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var o=[],s,a=0;a=1&&(s.type==="mn"||Bm(s))){var c=l.children[0];c instanceof _r&&c.type==="mn"&&(c.children=[...s.children,...c.children],o.pop())}else if(s.type==="mi"&&s.children.length===1){var u=s.children[0];if(u instanceof Fi&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Fi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),o.pop())}}}o.push(l),s=l}return o},fs=function(t,n,r){return Kv(pr(t,n,r))},Ot=function(t,n){if(!t)return new me.MathNode("mrow");if(Bf[t.type]){var r=Bf[t.type](t,n);return r}else throw new pe("Got group of unknown type: '"+t.type+"'")};function T6(e,t,n,r,i){var o=pr(e,n),s;o.length===1&&o[0]instanceof _r&&["mrow","mtable"].includes(o[0].type)?s=o[0]:s=new me.MathNode("mrow",o);var a=new me.MathNode("annotation",[new me.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new me.MathNode("semantics",[s,a]),c=new me.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return ee.makeSpan([u],[c])}var a8=function(t){return new mo({style:t.displayMode?je.DISPLAY:je.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},l8=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=ee.makeSpan(r,[t])}return t},rN=function(t,n,r){var i=a8(r),o;if(r.output==="mathml")return T6(t,n,i,r.displayMode,!0);if(r.output==="html"){var s=Dg(t,i);o=ee.makeSpan(["katex"],[s])}else{var a=T6(t,n,i,r.displayMode,!1),l=Dg(t,i);o=ee.makeSpan(["katex"],[a,l])}return l8(o,r)},iN=function(t,n,r){var i=a8(r),o=Dg(t,i),s=ee.makeSpan(["katex"],[o]);return l8(s,r)},oN={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},sN=function(t){var n=new me.MathNode("mo",[new me.TextNode(oN[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},aN={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},lN=function(t){return t.type==="ordgroup"?t.body.length:1},cN=function(t,n){function r(){var a=4e5,l=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var c=t,u=lN(c.base),d,f,h;if(u>5)l==="widehat"||l==="widecheck"?(d=420,a=2364,h=.42,f=l+"4"):(d=312,a=2340,h=.34,f="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],h=[0,.24,.3,.3,.36,.42][m],f=l+m):(a=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],h=[0,.26,.286,.3,.306,.34][m],f="tilde"+m)}var p=new ds(f),g=new $o([p],{width:"100%",height:ye(h),viewBox:"0 0 "+a+" "+d,preserveAspectRatio:"none"});return{span:ee.makeSvgSpan([],[g],n),minWidth:0,height:h}}else{var b=[],v=aN[l],[y,T,k]=v,x=k/1e3,_=y.length,A,M;if(_===1){var L=v[3];A=["hide-tail"],M=[L]}else if(_===2)A=["halfarrow-left","halfarrow-right"],M=["xMinYMin","xMaxYMin"];else if(_===3)A=["brace-left","brace-center","brace-right"],M=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support `+_+" children.");for(var F=0;F<_;F++){var R=new ds(y[F]),E=new $o([R],{width:"400em",height:ye(x),viewBox:"0 0 "+a+" "+k,preserveAspectRatio:M[F]+" slice"}),S=ee.makeSvgSpan([A[F]],[E],n);if(_===1)return{span:S,minWidth:T,height:x};S.style.height=ye(x),b.push(S)}return{span:ee.makeSpan(["stretchy"],b,n),minWidth:T,height:x}}}var{span:i,minWidth:o,height:s}=r();return i.height=s,i.style.height=ye(s),o>0&&(i.style.minWidth=ye(o)),i},uN=function(t,n,r,i,o){var s,a=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(s=ee.makeSpan(["stretchy",n],[],o),n==="fbox"){var l=o.color&&o.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new Mg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new Mg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new $o(c,{width:"100%",height:ye(a)});s=ee.makeSvgSpan([],[u],o)}return s.height=a,s.style.height=ye(a),s},Ao={encloseSpan:uN,mathMLnode:sN,svgSpan:cN};function nt(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 Jv(e){var t=rh(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 rh(e){return e&&(e.type==="atom"||DR.hasOwnProperty(e.type))?e:null}var Xv=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=nt(e.base,"accent"),n=r.base,e.base=n,i=OR(yt(e,t)),e.base=r):(r=nt(e,"accent"),n=r.base);var o=yt(n,t.havingCrampedStyle()),s=r.isShifty&&St.isCharacterBox(n),a=0;if(s){var l=St.getBaseElem(n),c=yt(l,t.havingCrampedStyle());a=k6(c).skew}var u=r.label==="\\c",d=u?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),f;if(r.isStretchy)f=Ao.svgSpan(r,t),f=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+ye(2*a)+")",marginLeft:ye(2*a)}:void 0}]},t);else{var h,m;r.label==="\\vec"?(h=ee.staticSvg("vec",t),m=ee.svgData.vec[1]):(h=ee.makeOrd({mode:r.mode,text:r.label},t,"textord"),h=k6(h),h.italic=0,m=h.width,u&&(d+=h.depth)),f=ee.makeSpan(["accent-body"],[h]);var p=r.label==="\\textcircled";p&&(f.classes.push("accent-full"),d=o.height);var g=a;p||(g-=m/2),f.style.left=ye(g),r.label==="\\textcircled"&&(f.style.top=".2em"),f=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-d},{type:"elem",elem:f}]},t)}var b=ee.makeSpan(["mord","accent"],[f],t);return i?(i.children[0]=b,i.height=Math.max(b.height,i.height),i.classes[0]="mord",i):b},c8=(e,t)=>{var n=e.isStretchy?Ao.mathMLnode(e.label):new me.MathNode("mo",[ei(e.label,e.mode)]),r=new me.MathNode("mover",[Ot(e.base,t),n]);return r.setAttribute("accent","true"),r},dN=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ce({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=qf(t[0]),r=!dN.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Xv,mathmlBuilder:c8});Ce({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Xv,mathmlBuilder:c8});Ce({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=yt(e.base,t),r=Ao.svgSpan(e,t),i=e.label==="\\utilde"?.12:0,o=ee.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return ee.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=Ao.mathMLnode(e.label),r=new me.MathNode("munder",[Ot(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var xd=e=>{var t=new me.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ce({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=ee.wrapFragment(yt(e.body,r,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(o+"-arrow-pad");var s;e.below&&(r=t.havingStyle(n.sub()),s=ee.wrapFragment(yt(e.below,r,t),t),s.classes.push(o+"-arrow-pad"));var a=Ao.svgSpan(e,t),l=-t.fontMetrics().axisHeight+.5*a.height,c=-t.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(s){var d=-t.fontMetrics().axisHeight+s.height+.5*a.height+.111;u=ee.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:s,shift:d}]},t)}else u=ee.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l}]},t);return u.children[0].children[0].children[1].classes.push("svg-align"),ee.makeSpan(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var n=Ao.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=xd(Ot(e.body,t));if(e.below){var o=xd(Ot(e.below,t));r=new me.MathNode("munderover",[n,o,i])}else r=new me.MathNode("mover",[n,i])}else if(e.below){var s=xd(Ot(e.below,t));r=new me.MathNode("munder",[n,s])}else r=xd(),r=new me.MathNode("mover",[n,r]);return r}});var fN=ee.makeSpan;function u8(e,t){var n=_n(e.body,t,!0);return fN([e.mclass],n,t)}function d8(e,t){var n,r=pr(e.body,t);return e.mclass==="minner"?n=new me.MathNode("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new me.MathNode("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new me.MathNode("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ce({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:an(i),isCharacterBox:St.isCharacterBox(i)}},htmlBuilder:u8,mathmlBuilder:d8});var ih=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ce({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:ih(t[0]),body:an(t[1]),isCharacterBox:St.isCharacterBox(t[1])}}});Ce({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],o=t[0],s;r!=="\\stackrel"?s=ih(i):s="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:an(i)},l={type:"supsub",mode:o.mode,base:a,sup:r==="\\underset"?null:o,sub:r==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:s,body:[l],isCharacterBox:St.isCharacterBox(l)}},htmlBuilder:u8,mathmlBuilder:d8});Ce({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:ih(t[0]),body:an(t[0])}},htmlBuilder(e,t){var n=_n(e.body,t,!0),r=ee.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=pr(e.body,t),r=new me.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var hN={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},$6=()=>({type:"styling",body:[],mode:"math",style:"display"}),L6=e=>e.type==="textord"&&e.text==="@",mN=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function pN(e,t,n){var r=hN[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:r,mode:"math",family:"rel"},s=n.callFunction("\\Big",[o],[]),a=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,a]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function gN(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new pe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],o=0;o-1))if("<>AV".indexOf(c)>-1)for(var d=0;d<2;d++){for(var f=!0,h=l+1;hAV=|." after @',s[l]);var m=pN(c,u,e),p={type:"styling",body:[m],mode:"math",style:"display"};r.push(p),a=$6()}o%2===0?r.push(a):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var g=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:g,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ce({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=ee.wrapFragment(yt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ye(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new me.MathNode("mrow",[Ot(e.label,t)]);return n=new me.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new me.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ce({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=ee.wrapFragment(yt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new me.MathNode("mrow",[Ot(e.fragment,t)])}});Ce({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=nt(t[0],"ordgroup"),i=r.body,o="",s=0;s=1114111)throw new pe("\\@char with invalid code point "+o);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var f8=(e,t)=>{var n=_n(e.body,t.withColor(e.color),!1);return ee.makeFragment(n)},h8=(e,t)=>{var n=pr(e.body,t.withColor(e.color)),r=new me.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ce({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=nt(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:an(i)}},htmlBuilder:f8,mathmlBuilder:h8});Ce({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=nt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var o=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:o}},htmlBuilder:f8,mathmlBuilder:h8});Ce({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,o=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:o,size:i&&nt(i,"size").value}},htmlBuilder(e,t){var n=ee.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ye(Gt(e.size,t)))),n},mathmlBuilder(e,t){var n=new me.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ye(Gt(e.size,t)))),n}});var Rg={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},m8=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new pe("Expected a control sequence",e);return t},vN=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},p8=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Ce({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Rg[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Rg[r.text]),nt(t.parseFunction(),"internal");throw new pe("Invalid token after macro prefix",r)}});Ce({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new pe("Expected a control sequence",r);for(var o=0,s,a=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){s=t.gullet.future(),a[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new pe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new pe('Argument number "'+r.text+'" out of order');o++,a.push([])}else{if(r.text==="EOF")throw new pe("Expected a macro definition");a[o].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:a},n===Rg[n]),{type:"internal",mode:t.mode}}});Ce({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=m8(t.gullet.popToken());t.gullet.consumeSpaces();var i=vN(t);return p8(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ce({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=m8(t.gullet.popToken()),i=t.gullet.popToken(),o=t.gullet.popToken();return p8(t,r,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var xc=function(t,n,r){var i=Dt.math[t]&&Dt.math[t].replace,o=Wv(i||t,n,r);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},Qv=function(t,n,r,i){var o=r.havingBaseStyle(n),s=ee.makeSpan(i.concat(o.sizingClasses(r)),[t],r),a=o.sizeMultiplier/r.sizeMultiplier;return s.height*=a,s.depth*=a,s.maxFontSize=o.sizeMultiplier,s},g8=function(t,n,r){var i=n.havingBaseStyle(r),o=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ye(o),t.height-=o,t.depth+=o},bN=function(t,n,r,i,o,s){var a=ee.makeSymbol(t,"Main-Regular",o,i),l=Qv(a,n,i,s);return r&&g8(l,i,n),l},yN=function(t,n,r,i){return ee.makeSymbol(t,"Size"+n+"-Regular",r,i)},v8=function(t,n,r,i,o,s){var a=yN(t,n,o,i),l=Qv(ee.makeSpan(["delimsizing","size"+n],[a],i),je.TEXT,i,s);return r&&g8(l,i,je.TEXT),l},qm=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var o=ee.makeSpan(["delimsizinginner",i],[ee.makeSpan([],[ee.makeSymbol(t,n,r)])]);return{type:"elem",elem:o}},Wm=function(t,n,r){var i=ji["Size4-Regular"][t.charCodeAt(0)]?ji["Size4-Regular"][t.charCodeAt(0)][4]:ji["Size1-Regular"][t.charCodeAt(0)][4],o=new ds("inner",_R(t,Math.round(1e3*n))),s=new $o([o],{width:ye(i),height:ye(n),style:"width:"+ye(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),a=ee.makeSvgSpan([],[s],r);return a.height=n,a.style.height=ye(n),a.style.width=ye(i),{type:"elem",elem:a}},Ng=.008,Sd={type:"kern",size:-1*Ng},wN=["|","\\lvert","\\rvert","\\vert"],kN=["\\|","\\lVert","\\rVert","\\Vert"],b8=function(t,n,r,i,o,s){var a,l,c,u,d="",f=0;a=c=u=t,l=null;var h="Size1-Regular";t==="\\uparrow"?c=u="⏐":t==="\\Uparrow"?c=u="‖":t==="\\downarrow"?a=c="⏐":t==="\\Downarrow"?a=c="‖":t==="\\updownarrow"?(a="\\uparrow",c="⏐",u="\\downarrow"):t==="\\Updownarrow"?(a="\\Uparrow",c="‖",u="\\Downarrow"):wN.includes(t)?(c="∣",d="vert",f=333):kN.includes(t)?(c="∥",d="doublevert",f=556):t==="["||t==="\\lbrack"?(a="⎡",c="⎢",u="⎣",h="Size4-Regular",d="lbrack",f=667):t==="]"||t==="\\rbrack"?(a="⎤",c="⎥",u="⎦",h="Size4-Regular",d="rbrack",f=667):t==="\\lfloor"||t==="⌊"?(c=a="⎢",u="⎣",h="Size4-Regular",d="lfloor",f=667):t==="\\lceil"||t==="⌈"?(a="⎡",c=u="⎢",h="Size4-Regular",d="lceil",f=667):t==="\\rfloor"||t==="⌋"?(c=a="⎥",u="⎦",h="Size4-Regular",d="rfloor",f=667):t==="\\rceil"||t==="⌉"?(a="⎤",c=u="⎥",h="Size4-Regular",d="rceil",f=667):t==="("||t==="\\lparen"?(a="⎛",c="⎜",u="⎝",h="Size4-Regular",d="lparen",f=875):t===")"||t==="\\rparen"?(a="⎞",c="⎟",u="⎠",h="Size4-Regular",d="rparen",f=875):t==="\\{"||t==="\\lbrace"?(a="⎧",l="⎨",u="⎩",c="⎪",h="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(a="⎫",l="⎬",u="⎭",c="⎪",h="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(a="⎧",u="⎩",c="⎪",h="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(a="⎫",u="⎭",c="⎪",h="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(a="⎧",u="⎭",c="⎪",h="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(a="⎫",u="⎩",c="⎪",h="Size4-Regular");var m=xc(a,h,o),p=m.height+m.depth,g=xc(c,h,o),b=g.height+g.depth,v=xc(u,h,o),y=v.height+v.depth,T=0,k=1;if(l!==null){var x=xc(l,h,o);T=x.height+x.depth,k=2}var _=p+y+T,A=Math.max(0,Math.ceil((n-_)/(k*b))),M=_+A*k*b,L=i.fontMetrics().axisHeight;r&&(L*=i.sizeMultiplier);var F=M/2-L,R=[];if(d.length>0){var E=M-p-y,S=Math.round(M*1e3),$=CR(d,Math.round(E*1e3)),O=new ds(d,$),V=(f/1e3).toFixed(3)+"em",Z=(S/1e3).toFixed(3)+"em",W=new $o([O],{width:V,height:Z,viewBox:"0 0 "+f+" "+S}),G=ee.makeSvgSpan([],[W],i);G.height=S/1e3,G.style.width=V,G.style.height=Z,R.push({type:"elem",elem:G})}else{if(R.push(qm(u,h,o)),R.push(Sd),l===null){var Y=M-p-y+2*Ng;R.push(Wm(c,Y,i))}else{var te=(M-p-y-T)/2+2*Ng;R.push(Wm(c,te,i)),R.push(Sd),R.push(qm(l,h,o)),R.push(Sd),R.push(Wm(c,te,i))}R.push(Sd),R.push(qm(a,h,o))}var we=i.havingBaseStyle(je.TEXT),$e=ee.makeVList({positionType:"bottom",positionData:F,children:R},we);return Qv(ee.makeSpan(["delimsizing","mult"],[$e],we),je.TEXT,i,s)},Zm=80,Gm=.08,Km=function(t,n,r,i,o){var s=SR(t,i,r),a=new ds(t,s),l=new $o([a],{width:"400em",height:ye(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return ee.makeSvgSpan(["hide-tail"],[l],o)},xN=function(t,n){var r=n.havingBaseSizing(),i=x8("\\surd",t*r.sizeMultiplier,k8,r),o=r.sizeMultiplier,s=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),a,l=0,c=0,u=0,d;return i.type==="small"?(u=1e3+1e3*s+Zm,t<1?o=1:t<1.4&&(o=.7),l=(1+s+Gm)/o,c=(1+s)/o,a=Km("sqrtMain",l,u,s,n),a.style.minWidth="0.853em",d=.833/o):i.type==="large"?(u=(1e3+Zm)*Rc[i.size],c=(Rc[i.size]+s)/o,l=(Rc[i.size]+s+Gm)/o,a=Km("sqrtSize"+i.size,l,u,s,n),a.style.minWidth="1.02em",d=1/o):(l=t+s+Gm,c=t+s,u=Math.floor(1e3*t+s)+Zm,a=Km("sqrtTall",l,u,s,n),a.style.minWidth="0.742em",d=1.056),a.height=c,a.style.height=ye(l),{span:a,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+s)*o}},y8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],SN=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],w8=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Rc=[0,1.2,1.8,2.4,3],_N=function(t,n,r,i,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),y8.includes(t)||w8.includes(t))return v8(t,n,!1,r,i,o);if(SN.includes(t))return b8(t,Rc[n],!1,r,i,o);throw new pe("Illegal delimiter: '"+t+"'")},CN=[{type:"small",style:je.SCRIPTSCRIPT},{type:"small",style:je.SCRIPT},{type:"small",style:je.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],IN=[{type:"small",style:je.SCRIPTSCRIPT},{type:"small",style:je.SCRIPT},{type:"small",style:je.TEXT},{type:"stack"}],k8=[{type:"small",style:je.SCRIPTSCRIPT},{type:"small",style:je.SCRIPT},{type:"small",style:je.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],EN=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},x8=function(t,n,r,i){for(var o=Math.min(2,3-i.style.size),s=o;sn)return r[s]}return r[r.length-1]},S8=function(t,n,r,i,o,s){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var a;w8.includes(t)?a=CN:y8.includes(t)?a=k8:a=IN;var l=x8(t,n,a,i);return l.type==="small"?bN(t,l.style,r,i,o,s):l.type==="large"?v8(t,l.size,r,i,o,s):b8(t,n,r,i,o,s)},TN=function(t,n,r,i,o,s){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(n-a,r+a),d=Math.max(u/500*l,2*u-c);return S8(t,d,!0,i,o,s)},_o={sqrtImage:xN,sizedDelim:_N,sizeToMaxHeight:Rc,customSizedDelim:S8,leftRightDelim:TN},A6={"\\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}},$N=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function oh(e,t){var n=rh(e);if(n&&$N.includes(n.text))return n;throw n?new pe("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new pe("Invalid delimiter type '"+e.type+"'",e)}Ce({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)=>{var n=oh(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:A6[e.funcName].size,mclass:A6[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?ee.makeSpan([e.mclass]):_o.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(ei(e.delim,e.mode));var n=new me.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ye(_o.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function M6(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ce({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new pe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:oh(t[0],e).text,color:n}}});Ce({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=oh(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var o=nt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{M6(e);for(var n=_n(e.body,t,!0,["mopen","mclose"]),r=0,i=0,o=!1,s=0;s{M6(e);var n=pr(e.body,t);if(e.left!=="."){var r=new me.MathNode("mo",[ei(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new me.MathNode("mo",[ei(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Kv(n)}});Ce({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=oh(t[0],e);if(!e.parser.leftrightDepth)throw new pe("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=Kc(t,[]);else{n=_o.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?ei("|","text"):ei(e.delim,e.mode),r=new me.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var eb=(e,t)=>{var n=ee.wrapFragment(yt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,o,s=0,a=St.isCharacterBox(e.body);if(r==="sout")o=ee.makeSpan(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/i,s=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=Gt({number:.6,unit:"pt"},t),c=Gt({number:.35,unit:"ex"},t),u=t.havingBaseSizing();i=i/u.sizeMultiplier;var d=n.height+n.depth+l+c;n.style.paddingLeft=ye(d/2+l);var f=Math.floor(1e3*d*i),h=kR(f),m=new $o([new ds("phase",h)],{width:"400em",height:ye(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});o=ee.makeSvgSpan(["hide-tail"],[m],t),o.style.height=ye(d),s=n.depth+l+c}else{/cancel/.test(r)?a||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var p=0,g=0,b=0;/box/.test(r)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r==="colorbox"?0:b),g=p):r==="angl"?(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*b,g=Math.max(0,.25-n.depth)):(p=a?.2:0,g=p),o=Ao.encloseSpan(n,r,p,g,t),/fbox|boxed|fcolorbox/.test(r)?(o.style.borderStyle="solid",o.style.borderWidth=ye(b)):r==="angl"&&b!==.049&&(o.style.borderTopWidth=ye(b),o.style.borderRightWidth=ye(b)),s=n.depth+g,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var v;if(e.backgroundColor)v=ee.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:s},{type:"elem",elem:n,shift:0}]},t);else{var y=/cancel|phase/.test(r)?["svg-align"]:[];v=ee.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:s,wrapperClasses:y}]},t)}return/cancel/.test(r)&&(v.height=n.height,v.depth=n.depth),/cancel/.test(r)&&!a?ee.makeSpan(["mord","cancel-lap"],[v],t):ee.makeSpan(["mord"],[v],t)},tb=(e,t)=>{var n=0,r=new me.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Ot(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ce({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,o=nt(t[0],"color-token").color,s=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,body:s}},htmlBuilder:eb,mathmlBuilder:tb});Ce({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,o=nt(t[0],"color-token").color,s=nt(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,borderColor:o,body:a}},htmlBuilder:eb,mathmlBuilder:tb});Ce({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ce({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:eb,mathmlBuilder:tb});Ce({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var _8={};function Yi(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:s}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var t=e.parser.settings;if(!t.displayMode)throw new pe("{"+e.envName+"} can be used only in display mode.")};function nb(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function bs(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:o,arraystretch:s,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!s){var h=e.gullet.expandMacroAsText("\\arraystretch");if(h==null)s=1;else if(s=parseFloat(h),!s||s<0)throw new pe("Invalid \\arraystretch: "+h)}e.gullet.beginGroup();var m=[],p=[m],g=[],b=[],v=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function T(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new Er("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(O6(e));;){var k=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),k={type:"ordgroup",mode:e.mode,body:k},n&&(k={type:"styling",mode:e.mode,style:n,body:[k]}),m.push(k);var x=e.fetch().text;if(x==="&"){if(d&&m.length===d){if(c||a)throw new pe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(x==="\\end"){T(),m.length===1&&k.type==="styling"&&k.body[0].body.length===0&&(p.length>1||!u)&&p.pop(),b.length0&&(y+=.25),c.push({pos:y,isDashed:Qn[Uo]})}for(T(s[0]),r=0;r0&&(F+=v,_Qn))for(r=0;r=a)){var Me=void 0;(i>0||t.hskipBeforeAndAfter)&&(Me=St.deflt(te.pregap,f),Me!==0&&($=ee.makeSpan(["arraycolsep"],[]),$.style.width=ye(Me),S.push($)));var ke=[];for(r=0;r0){for(var oi=ee.makeLineSpan("hline",n,u),it=ee.makeLineSpan("hdashline",n,u),H=[{type:"elem",elem:l,shift:0}];c.length>0;){var ft=c.pop(),xt=ft.pos-R;ft.isDashed?H.push({type:"elem",elem:it,shift:xt}):H.push({type:"elem",elem:oi,shift:xt})}l=ee.makeVList({positionType:"individualShift",children:H},n)}if(V.length===0)return ee.makeSpan(["mord"],[l],n);var gn=ee.makeVList({positionType:"individualShift",children:V},n);return gn=ee.makeSpan(["tag"],[gn],n),ee.makeFragment([l,gn])},LN={c:"center ",l:"left ",r:"right "},Xi=function(t,n){for(var r=[],i=new me.MathNode("mtd",[],["mtr-glue"]),o=new me.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var m=t.cols,p="",g=!1,b=0,v=m.length;m[0].type==="separator"&&(f+="top ",b=1),m[m.length-1].type==="separator"&&(f+="bottom ",v-=1);for(var y=b;y0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var M=1;M-1?"alignat":"align",o=t.envName==="split",s=bs(t.parser,{cols:r,addJot:!0,autoTag:o?void 0:nb(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),a,l=0,c={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var u="",d=0;d0&&h&&(g=1),r[m]={type:"align",align:p,pregap:g,postgap:0}}return s.colSeparationType=h?"align":"alignat",s};Yi({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=rh(t[0]),r=n?[t[0]]:nt(t[0],"ordgroup").body,i=r.map(function(s){var a=Jv(s),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new pe("Unknown column alignment: "+l,s)}),o={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return bs(e.parser,o,rb(e.envName))},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,"lcr".indexOf(n)===-1)throw new pe("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var o=bs(e.parser,r,rb(e.envName)),s=Math.max(0,...o.body.map(a=>a.length));return o.cols=new Array(s).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=bs(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=rh(t[0]),r=n?[t[0]]:nt(t[0],"ordgroup").body,i=r.map(function(s){var a=Jv(s),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new pe("Unknown column alignment: "+l,s)});if(i.length>1)throw new pe("{subarray} can contain only one column");var o={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=bs(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new pe("{subarray} can contain only one column");return o},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=bs(e.parser,t,rb(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:I8,htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&sh(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:nb(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return bs(e.parser,t,"display")},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:I8,htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){sh(e);var t={autoTag:nb(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return bs(e.parser,t,"display")},htmlBuilder:Ji,mathmlBuilder:Xi});Yi({type:"array",names:["CD"],props:{numArgs:0},handler(e){return sh(e),gN(e.parser)},htmlBuilder:Ji,mathmlBuilder:Xi});z("\\nonumber","\\gdef\\@eqnsw{0}");z("\\notag","\\nonumber");Ce({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new pe(e.funcName+" valid only within array environment")}});var P6=_8;Ce({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new pe("Invalid environment name",i);for(var o="",s=0;s{var n=e.font,r=t.withFont(n);return yt(e.body,r)},T8=(e,t)=>{var n=e.font,r=t.withFont(n);return Ot(e.body,r)},D6={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ce({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=qf(t[0]),o=r;return o in D6&&(o=D6[o]),{type:"font",mode:n.mode,font:o.slice(1),body:i}},htmlBuilder:E8,mathmlBuilder:T8});Ce({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=St.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:ih(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}});Ce({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:o}=n,s=n.parseExpression(!0,i),a="math"+r.slice(1);return{type:"font",mode:o,font:a,body:{type:"ordgroup",mode:n.mode,body:s}}},htmlBuilder:E8,mathmlBuilder:T8});var $8=(e,t)=>{var n=t;return e==="display"?n=n.id>=je.SCRIPT.id?n.text():je.DISPLAY:e==="text"&&n.size===je.DISPLAY.size?n=je.TEXT:e==="script"?n=je.SCRIPT:e==="scriptscript"&&(n=je.SCRIPTSCRIPT),n},ib=(e,t)=>{var n=$8(e.size,t.style),r=n.fracNum(),i=n.fracDen(),o;o=t.havingStyle(r);var s=yt(e.numer,o,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;s.height=s.height0?m=3*f:m=7*f,p=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,m=f):(h=t.fontMetrics().num3,m=3*f),p=t.fontMetrics().denom2);var g;if(u){var v=t.fontMetrics().axisHeight;h-s.depth-(v+.5*d){var n=new me.MathNode("mfrac",[Ot(e.numer,t),Ot(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Gt(e.barSize,t);n.setAttribute("linethickness",ye(r))}var i=$8(e.size,t.style);if(i.size!==t.style.size){n=new me.MathNode("mstyle",[n]);var o=i.size===je.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var a=new me.MathNode("mo",[new me.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}if(s.push(n),e.rightDelim!=null){var l=new me.MathNode("mo",[new me.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return Kv(s)}return n};Ce({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=t[1],s,a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,a="(",l=")";break;case"\\\\bracefrac":s=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:o,hasBarLine:s,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:ib,mathmlBuilder:ob});Ce({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Ce({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var R6=["display","text","script","scriptscript"],N6=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ce({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],o=qf(t[0]),s=o.type==="atom"&&o.family==="open"?N6(o.text):null,a=qf(t[1]),l=a.type==="atom"&&a.family==="close"?N6(a.text):null,c=nt(t[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var f="auto",h=t[3];if(h.type==="ordgroup"){if(h.body.length>0){var m=nt(h.body[0],"textord");f=R6[Number(m.text)]}}else h=nt(h,"textord"),f=R6[Number(h.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:s,rightDelim:l,size:f}},htmlBuilder:ib,mathmlBuilder:ob});Ce({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:nt(t[0],"size").value,token:i}}});Ce({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=sR(nt(t[1],"infix").size),s=t[2],a=o.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:s,continued:!1,hasBarLine:a,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ib,mathmlBuilder:ob});var L8=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?yt(e.sup,t.havingStyle(n.sup()),t):yt(e.sub,t.havingStyle(n.sub()),t),i=nt(e.base,"horizBrace")):i=nt(e,"horizBrace");var o=yt(i.base,t.havingBaseStyle(je.DISPLAY)),s=Ao.svgSpan(i,t),a;if(i.isOver?(a=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t),a.children[0].children[0].children[1].classes.push("svg-align")):(a=ee.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t),a.children[0].children[0].children[0].classes.push("svg-align")),r){var l=ee.makeSpan(["mord",i.isOver?"mover":"munder"],[a],t);i.isOver?a=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):a=ee.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return ee.makeSpan(["mord",i.isOver?"mover":"munder"],[a],t)},AN=(e,t)=>{var n=Ao.mathMLnode(e.label);return new me.MathNode(e.isOver?"mover":"munder",[Ot(e.base,t),n])};Ce({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:L8,mathmlBuilder:AN});Ce({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=nt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:an(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=_n(e.body,t,!1);return ee.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=fs(e.body,t);return n instanceof _r||(n=new _r("mrow",[n])),n.setAttribute("href",e.href),n}});Ce({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=nt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],o=0;o{var{parser:n,funcName:r,token:i}=e,o=nt(t[0],"raw").string,s=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(r){case"\\htmlClass":l.class=o,a={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,a={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,a={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var c=o.split(","),u=0;u{var n=_n(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=ee.makeSpan(r,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&i.setAttribute(o,e.attributes[o]);return i},mathmlBuilder:(e,t)=>fs(e.body,t)});Ce({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:an(t[0]),mathml:an(t[1])}},htmlBuilder:(e,t)=>{var n=_n(e.html,t,!1);return ee.makeFragment(n)},mathmlBuilder:(e,t)=>fs(e.mathml,t)});var Ym=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new pe("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!Kk(r))throw new pe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ce({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},o={number:.9,unit:"em"},s={number:0,unit:"em"},a="";if(n[0])for(var l=nt(n[0],"raw").string,c=l.split(","),u=0;u{var n=Gt(e.height,t),r=0;e.totalheight.number>0&&(r=Gt(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Gt(e.width,t));var o={height:ye(n+r)};i>0&&(o.width=ye(i)),r>0&&(o.verticalAlign=ye(-r));var s=new AR(e.src,e.alt,o);return s.height=n,s.depth=r,s},mathmlBuilder:(e,t)=>{var n=new me.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Gt(e.height,t),i=0;if(e.totalheight.number>0&&(i=Gt(e.totalheight,t)-r,n.setAttribute("valign",ye(-i))),n.setAttribute("height",ye(r+i)),e.width.number>0){var o=Gt(e.width,t);n.setAttribute("width",ye(o))}return n.setAttribute("src",e.src),n}});Ce({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=nt(t[0],"size");if(n.settings.strict){var o=r[1]==="m",s=i.value.unit==="mu";o?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return ee.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=Gt(e.dimension,t);return new me.SpaceNode(n)}});Ce({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=ee.makeSpan([],[yt(e.body,t)]),n=ee.makeSpan(["inner"],[n],t)):n=ee.makeSpan(["inner"],[yt(e.body,t)]);var r=ee.makeSpan(["fix"],[]),i=ee.makeSpan([e.alignment],[n,r],t),o=ee.makeSpan(["strut"]);return o.style.height=ye(i.height+i.depth),i.depth&&(o.style.verticalAlign=ye(-i.depth)),i.children.unshift(o),i=ee.makeSpan(["thinbox"],[i],t),ee.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new me.MathNode("mpadded",[Ot(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ce({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var o=n==="\\("?"\\)":"$",s=r.parseExpression(!1,o);return r.expect(o),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:s}}});Ce({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new pe("Mismatched "+e.funcName)}});var z6=(e,t)=>{switch(t.style.size){case je.DISPLAY.size:return e.display;case je.TEXT.size:return e.text;case je.SCRIPT.size:return e.script;case je.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ce({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:an(t[0]),text:an(t[1]),script:an(t[2]),scriptscript:an(t[3])}},htmlBuilder:(e,t)=>{var n=z6(e,t),r=_n(n,t,!1);return ee.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=z6(e,t);return fs(n,t)}});var A8=(e,t,n,r,i,o,s)=>{e=ee.makeSpan([],[e]);var a=n&&St.isCharacterBox(n),l,c;if(t){var u=yt(t,r.havingStyle(i.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=yt(n,r.havingStyle(i.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(c&&l){var h=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+s;f=ee.makeVList({positionType:"bottom",positionData:h,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ye(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ye(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(l){var m=e.height-s;f=ee.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ye(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},r)}else if(c){var p=e.depth+s;f=ee.makeVList({positionType:"bottom",positionData:p,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ye(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var g=[f];if(l&&o!==0&&!a){var b=ee.makeSpan(["mspace"],[],r);b.style.marginRight=ye(o),g.unshift(b)}return ee.makeSpan(["mop","op-limits"],g,r)},M8=["\\smallint"],Ml=(e,t)=>{var n,r,i=!1,o;e.type==="supsub"?(n=e.sup,r=e.sub,o=nt(e.base,"op"),i=!0):o=nt(e,"op");var s=t.style,a=!1;s.size===je.DISPLAY.size&&o.symbol&&!M8.includes(o.name)&&(a=!0);var l;if(o.symbol){var c=a?"Size2-Regular":"Size1-Regular",u="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(u=o.name.slice(1),o.name=u==="oiint"?"\\iint":"\\iiint"),l=ee.makeSymbol(o.name,c,"math",t,["mop","op-symbol",a?"large-op":"small-op"]),u.length>0){var d=l.italic,f=ee.staticSvg(u+"Size"+(a?"2":"1"),t);l=ee.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:a?.08:0}]},t),o.name="\\"+u,l.classes.unshift("mop"),l.italic=d}}else if(o.body){var h=_n(o.body,t,!0);h.length===1&&h[0]instanceof Qr?(l=h[0],l.classes[0]="mop"):l=ee.makeSpan(["mop"],h,t)}else{for(var m=[],p=1;p{var n;if(e.symbol)n=new _r("mo",[ei(e.name,e.mode)]),M8.includes(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new _r("mo",pr(e.body,t));else{n=new _r("mi",[new Fi(e.name.slice(1))]);var r=new _r("mo",[ei("⁡","text")]);e.parentIsSupSub?n=new _r("mrow",[n,r]):n=s8([n,r])}return n},MN={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ce({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=MN[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Ml,mathmlBuilder:Au});Ce({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:an(r)}},htmlBuilder:Ml,mathmlBuilder:Au});var ON={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ce({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Ml,mathmlBuilder:Au});Ce({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Ml,mathmlBuilder:Au});Ce({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=ON[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Ml,mathmlBuilder:Au});var O8=(e,t)=>{var n,r,i=!1,o;e.type==="supsub"?(n=e.sup,r=e.sub,o=nt(e.base,"operatorname"),i=!0):o=nt(e,"operatorname");var s;if(o.body.length>0){for(var a=o.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=_n(a,t.withFont("mathrm"),!0),c=0;c{for(var n=pr(e.body,t.withFont("mathrm")),r=!0,i=0;iu.toText()).join("");n=[new me.TextNode(a)]}var l=new me.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new me.MathNode("mo",[ei("⁡","text")]);return e.parentIsSupSub?new me.MathNode("mrow",[l,c]):me.newDocumentFragment([l,c])};Ce({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:an(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:O8,mathmlBuilder:PN});z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ga({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ee.makeFragment(_n(e.body,t,!1)):ee.makeSpan(["mord"],_n(e.body,t,!0),t)},mathmlBuilder(e,t){return fs(e.body,t,!0)}});Ce({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=yt(e.body,t.havingCrampedStyle()),r=ee.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,o=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return ee.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new me.MathNode("mo",[new me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new me.MathNode("mover",[Ot(e.body,t),n]);return r.setAttribute("accent","true"),r}});Ce({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:an(r)}},htmlBuilder:(e,t)=>{var n=_n(e.body,t.withPhantom(),!1);return ee.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=pr(e.body,t);return new me.MathNode("mphantom",n)}});Ce({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ee.makeSpan([],[yt(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=pr(an(e.body),t),r=new me.MathNode("mphantom",n),i=new me.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});Ce({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ee.makeSpan(["inner"],[yt(e.body,t.withPhantom())]),r=ee.makeSpan(["fix"],[]);return ee.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=pr(an(e.body),t),r=new me.MathNode("mphantom",n),i=new me.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ce({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=nt(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=yt(e.body,t),r=Gt(e.dy,t);return ee.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new me.MathNode("mpadded",[Ot(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Ce({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ce({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],o=nt(t[0],"size"),s=nt(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&nt(i,"size").value,width:o.value,height:s.value}},htmlBuilder(e,t){var n=ee.makeSpan(["mord","rule"],[],t),r=Gt(e.width,t),i=Gt(e.height,t),o=e.shift?Gt(e.shift,t):0;return n.style.borderRightWidth=ye(r),n.style.borderTopWidth=ye(i),n.style.bottom=ye(o),n.width=r,n.height=i+o,n.depth=-o,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Gt(e.width,t),r=Gt(e.height,t),i=e.shift?Gt(e.shift,t):0,o=t.color&&t.getColor()||"black",s=new me.MathNode("mspace");s.setAttribute("mathbackground",o),s.setAttribute("width",ye(n)),s.setAttribute("height",ye(r));var a=new me.MathNode("mpadded",[s]);return i>=0?a.setAttribute("height",ye(i)):(a.setAttribute("height",ye(i)),a.setAttribute("depth",ye(-i))),a.setAttribute("voffset",ye(i)),a}});function P8(e,t,n){for(var r=_n(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,o=0;o{var n=t.havingSize(e.size);return P8(e.body,n,t)};Ce({type:"sizing",names:j6,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:j6.indexOf(r)+1,body:o}},htmlBuilder:DN,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=pr(e.body,n),i=new me.MathNode("mstyle",r);return i.setAttribute("mathsize",ye(n.sizeMultiplier)),i}});Ce({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,o=!1,s=n[0]&&nt(n[0],"ordgroup");if(s)for(var a="",l=0;l{var n=ee.makeSpan([],[yt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new me.MathNode("mpadded",[Ot(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ce({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],o=t[0];return{type:"sqrt",mode:r.mode,body:o,index:i}},htmlBuilder(e,t){var n=yt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=ee.wrapFragment(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,o=i;t.style.idn.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var f=l.height-n.height-s-c;n.style.paddingLeft=ye(u);var h=ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+f)},{type:"elem",elem:l},{type:"kern",size:c}]},t);if(e.index){var m=t.havingStyle(je.SCRIPTSCRIPT),p=yt(e.index,m,t),g=.6*(h.height-h.depth),b=ee.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:p}]},t),v=ee.makeSpan(["root"],[b]);return ee.makeSpan(["mord","sqrt"],[v,h],t)}else return ee.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new me.MathNode("mroot",[Ot(n,t),Ot(r,t)]):new me.MathNode("msqrt",[Ot(n,t)])}});var F6={display:je.DISPLAY,text:je.TEXT,script:je.SCRIPT,scriptscript:je.SCRIPTSCRIPT};Ce({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!0,n),s=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:s,body:o}},htmlBuilder(e,t){var n=F6[e.style],r=t.havingStyle(n).withFont("");return P8(e.body,r,t)},mathmlBuilder(e,t){var n=F6[e.style],r=t.havingStyle(n),i=pr(e.body,r),o=new me.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=s[e.style];return o.setAttribute("scriptlevel",a[0]),o.setAttribute("displaystyle",a[1]),o}});var RN=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===je.DISPLAY.size||r.alwaysHandleSupSub);return i?Ml:null}else if(r.type==="operatorname"){var o=r.alwaysHandleSupSub&&(n.style.size===je.DISPLAY.size||r.limits);return o?O8:null}else{if(r.type==="accent")return St.isCharacterBox(r.base)?Xv:null;if(r.type==="horizBrace"){var s=!t.sub;return s===r.isOver?L8:null}else return null}else return null};ga({type:"supsub",htmlBuilder(e,t){var n=RN(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:o}=e,s=yt(r,t),a,l,c=t.fontMetrics(),u=0,d=0,f=r&&St.isCharacterBox(r);if(i){var h=t.havingStyle(t.style.sup());a=yt(i,h,t),f||(u=s.height-h.fontMetrics().supDrop*h.sizeMultiplier/t.sizeMultiplier)}if(o){var m=t.havingStyle(t.style.sub());l=yt(o,m,t),f||(d=s.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var p;t.style===je.DISPLAY?p=c.sup1:t.style.cramped?p=c.sup3:p=c.sup2;var g=t.sizeMultiplier,b=ye(.5/c.ptPerEm/g),v=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(s instanceof Qr||y)&&(v=ye(-s.italic))}var T;if(a&&l){u=Math.max(u,p,a.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var k=c.defaultRuleThickness,x=4*k;if(u-a.depth-(l.height-d)0&&(u+=_,d-=_)}var A=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:v},{type:"elem",elem:a,shift:-u,marginRight:b}];T=ee.makeVList({positionType:"individualShift",children:A},t)}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var M=[{type:"elem",elem:l,marginLeft:v,marginRight:b}];T=ee.makeVList({positionType:"shift",positionData:d,children:M},t)}else if(a)u=Math.max(u,p,a.depth+.25*c.xHeight),T=ee.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:b}]},t);else throw new Error("supsub must have either sup or sub.");var L=Pg(s,"right")||"mord";return ee.makeSpan([L],[s,ee.makeSpan(["msupsub"],[T])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[Ot(e.base,t)];e.sub&&o.push(Ot(e.sub,t)),e.sup&&o.push(Ot(e.sup,t));var s;if(n)s=r?"mover":"munder";else if(e.sub)if(e.sup){var c=e.base;c&&c.type==="op"&&c.limits&&t.style===je.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(t.style===je.DISPLAY||c.limits)?s="munderover":s="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===je.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===je.DISPLAY)?s="munder":s="msub"}else{var a=e.base;a&&a.type==="op"&&a.limits&&(t.style===je.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||t.style===je.DISPLAY)?s="mover":s="msup"}return new me.MathNode(s,o)}});ga({type:"atom",htmlBuilder(e,t){return ee.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new me.MathNode("mo",[ei(e.text,e.mode)]);if(e.family==="bin"){var r=Yv(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var D8={mi:"italic",mn:"normal",mtext:"normal"};ga({type:"mathord",htmlBuilder(e,t){return ee.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new me.MathNode("mi",[ei(e.text,e.mode,t)]),r=Yv(e,t)||"italic";return r!==D8[n.type]&&n.setAttribute("mathvariant",r),n}});ga({type:"textord",htmlBuilder(e,t){return ee.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=ei(e.text,e.mode,t),r=Yv(e,t)||"normal",i;return e.mode==="text"?i=new me.MathNode("mtext",[n]):/[0-9]/.test(e.text)?i=new me.MathNode("mn",[n]):e.text==="\\prime"?i=new me.MathNode("mo",[n]):i=new me.MathNode("mi",[n]),r!==D8[i.type]&&i.setAttribute("mathvariant",r),i}});var Jm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Xm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ga({type:"spacing",htmlBuilder(e,t){if(Xm.hasOwnProperty(e.text)){var n=Xm[e.text].className||"";if(e.mode==="text"){var r=ee.makeOrd(e,t,"textord");return r.classes.push(n),r}else return ee.makeSpan(["mspace",n],[ee.mathsym(e.text,e.mode,t)],t)}else{if(Jm.hasOwnProperty(e.text))return ee.makeSpan(["mspace",Jm[e.text]],[],t);throw new pe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Xm.hasOwnProperty(e.text))n=new me.MathNode("mtext",[new me.TextNode(" ")]);else{if(Jm.hasOwnProperty(e.text))return new me.MathNode("mspace");throw new pe('Unknown type of space "'+e.text+'"')}return n}});var H6=()=>{var e=new me.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ga({type:"tag",mathmlBuilder(e,t){var n=new me.MathNode("mtable",[new me.MathNode("mtr",[H6(),new me.MathNode("mtd",[fs(e.body,t)]),H6(),new me.MathNode("mtd",[fs(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var V6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},U6={"\\textbf":"textbf","\\textmd":"textmd"},NN={"\\textit":"textit","\\textup":"textup"},B6=(e,t)=>{var n=e.font;if(n){if(V6[n])return t.withTextFontFamily(V6[n]);if(U6[n])return t.withTextFontWeight(U6[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(NN[n])};Ce({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:an(i),font:r}},htmlBuilder(e,t){var n=B6(e,t),r=_n(e.body,n,!0);return ee.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=B6(e,t);return fs(e.body,n)}});Ce({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=yt(e.body,t),r=ee.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,o=ee.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return ee.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new me.MathNode("mo",[new me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new me.MathNode("munder",[Ot(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Ce({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=yt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return ee.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new me.MathNode("mpadded",[Ot(e.body,t)],["vcenter"])}});Ce({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new pe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=q6(e),r=[],i=t.havingStyle(t.style.text()),o=0;oe.body.replace(/ /g,e.star?"␣":" "),ts=i8,R8=`[ \r ]`,zN="\\\\[a-zA-Z@]+",jN="\\\\[^\uD800-\uDFFF]",FN="("+zN+")"+R8+"*",HN=`\\\\( |[ \r ]+ ?)[ \r ]*`,zg="[̀-ͯ]",VN=new RegExp(zg+"+$"),UN="("+R8+"+)|"+(HN+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(zg+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(zg+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+FN)+("|"+jN+")");class W6{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(UN,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Er("EOF",new ur(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new pe("Unexpected character: '"+t[n]+"'",new Er(t[n],new ur(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var o=t.indexOf(` `,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new Er(i,new ur(this,n,this.tokenRegex.lastIndex))}}class BN{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new pe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var qN=C8;z("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});z("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});z("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});z("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});z("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});z("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");z("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Z6={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};z("\\char",function(e){var t=e.popToken(),n,r="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new pe("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Z6[t.text],r==null||r>=n)throw new pe("Invalid base-"+n+" digit "+t.text);for(var i;(i=Z6[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new pe("\\newcommand's first argument must be a macro name");var o=i[0].text,s=e.isDefined(o);if(s&&!t)throw new pe("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!s&&!n)throw new pe("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var a=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new pe("Invalid number of arguments: "+l);a=parseInt(l),i=e.consumeArg().tokens}return s&&r||e.macros.set(o,{tokens:i,numArgs:a}),""};z("\\newcommand",e=>sb(e,!1,!0,!1));z("\\renewcommand",e=>sb(e,!0,!1,!1));z("\\providecommand",e=>sb(e,!0,!0,!0));z("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});z("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});z("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),ts[n],Dt.math[n],Dt.text[n]),""});z("\\bgroup","{");z("\\egroup","}");z("~","\\nobreakspace");z("\\lq","`");z("\\rq","'");z("\\aa","\\r a");z("\\AA","\\r A");z("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");z("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");z("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");z("ℬ","\\mathscr{B}");z("ℰ","\\mathscr{E}");z("ℱ","\\mathscr{F}");z("ℋ","\\mathscr{H}");z("ℐ","\\mathscr{I}");z("ℒ","\\mathscr{L}");z("ℳ","\\mathscr{M}");z("ℛ","\\mathscr{R}");z("ℭ","\\mathfrak{C}");z("ℌ","\\mathfrak{H}");z("ℨ","\\mathfrak{Z}");z("\\Bbbk","\\Bbb{k}");z("·","\\cdotp");z("\\llap","\\mathllap{\\textrm{#1}}");z("\\rlap","\\mathrlap{\\textrm{#1}}");z("\\clap","\\mathclap{\\textrm{#1}}");z("\\mathstrut","\\vphantom{(}");z("\\underbar","\\underline{\\text{#1}}");z("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');z("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");z("\\ne","\\neq");z("≠","\\neq");z("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");z("∉","\\notin");z("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");z("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");z("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");z("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");z("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");z("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");z("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");z("⟂","\\perp");z("‼","\\mathclose{!\\mkern-0.8mu!}");z("∌","\\notni");z("⌜","\\ulcorner");z("⌝","\\urcorner");z("⌞","\\llcorner");z("⌟","\\lrcorner");z("©","\\copyright");z("®","\\textregistered");z("️","\\textregistered");z("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');z("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');z("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');z("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');z("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");z("⋮","\\vdots");z("\\varGamma","\\mathit{\\Gamma}");z("\\varDelta","\\mathit{\\Delta}");z("\\varTheta","\\mathit{\\Theta}");z("\\varLambda","\\mathit{\\Lambda}");z("\\varXi","\\mathit{\\Xi}");z("\\varPi","\\mathit{\\Pi}");z("\\varSigma","\\mathit{\\Sigma}");z("\\varUpsilon","\\mathit{\\Upsilon}");z("\\varPhi","\\mathit{\\Phi}");z("\\varPsi","\\mathit{\\Psi}");z("\\varOmega","\\mathit{\\Omega}");z("\\substack","\\begin{subarray}{c}#1\\end{subarray}");z("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");z("\\boxed","\\fbox{$\\displaystyle{#1}$}");z("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");z("\\implies","\\DOTSB\\;\\Longrightarrow\\;");z("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");z("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");z("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var G6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};z("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in G6?t=G6[n]:(n.slice(0,4)==="\\not"||n in Dt.math&&["bin","rel"].includes(Dt.math[n].group))&&(t="\\dotsb"),t});var ab={")":!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};z("\\dotso",function(e){var t=e.future().text;return t in ab?"\\ldots\\,":"\\ldots"});z("\\dotsc",function(e){var t=e.future().text;return t in ab&&t!==","?"\\ldots\\,":"\\ldots"});z("\\cdots",function(e){var t=e.future().text;return t in ab?"\\@cdots\\,":"\\@cdots"});z("\\dotsb","\\cdots");z("\\dotsm","\\cdots");z("\\dotsi","\\!\\cdots");z("\\dotsx","\\ldots\\,");z("\\DOTSI","\\relax");z("\\DOTSB","\\relax");z("\\DOTSX","\\relax");z("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");z("\\,","\\tmspace+{3mu}{.1667em}");z("\\thinspace","\\,");z("\\>","\\mskip{4mu}");z("\\:","\\tmspace+{4mu}{.2222em}");z("\\medspace","\\:");z("\\;","\\tmspace+{5mu}{.2777em}");z("\\thickspace","\\;");z("\\!","\\tmspace-{3mu}{.1667em}");z("\\negthinspace","\\!");z("\\negmedspace","\\tmspace-{4mu}{.2222em}");z("\\negthickspace","\\tmspace-{5mu}{.277em}");z("\\enspace","\\kern.5em ");z("\\enskip","\\hskip.5em\\relax");z("\\quad","\\hskip1em\\relax");z("\\qquad","\\hskip2em\\relax");z("\\tag","\\@ifstar\\tag@literal\\tag@paren");z("\\tag@paren","\\tag@literal{({#1})}");z("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new pe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});z("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");z("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");z("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");z("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");z("\\newline","\\\\\\relax");z("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var N8=ye(ji["Main-Regular"][84][1]-.7*ji["Main-Regular"][65][1]);z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+N8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+N8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");z("\\hspace","\\@ifstar\\@hspacer\\@hspace");z("\\@hspace","\\hskip #1\\relax");z("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");z("\\ordinarycolon",":");z("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");z("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');z("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');z("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');z("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');z("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');z("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');z("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');z("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');z("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');z("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');z("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');z("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');z("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');z("∷","\\dblcolon");z("∹","\\eqcolon");z("≔","\\coloneqq");z("≕","\\eqqcolon");z("⩴","\\Coloneqq");z("\\ratio","\\vcentcolon");z("\\coloncolon","\\dblcolon");z("\\colonequals","\\coloneqq");z("\\coloncolonequals","\\Coloneqq");z("\\equalscolon","\\eqqcolon");z("\\equalscoloncolon","\\Eqqcolon");z("\\colonminus","\\coloneq");z("\\coloncolonminus","\\Coloneq");z("\\minuscolon","\\eqcolon");z("\\minuscoloncolon","\\Eqcolon");z("\\coloncolonapprox","\\Colonapprox");z("\\coloncolonsim","\\Colonsim");z("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");z("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");z("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");z("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");z("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");z("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");z("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");z("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");z("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");z("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");z("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");z("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");z("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");z("\\nleqq","\\html@mathml{\\@nleqq}{≰}");z("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");z("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");z("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");z("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");z("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");z("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");z("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");z("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");z("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");z("\\imath","\\html@mathml{\\@imath}{ı}");z("\\jmath","\\html@mathml{\\@jmath}{ȷ}");z("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");z("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");z("⟦","\\llbracket");z("⟧","\\rrbracket");z("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");z("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");z("⦃","\\lBrace");z("⦄","\\rBrace");z("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");z("⦵","\\minuso");z("\\darr","\\downarrow");z("\\dArr","\\Downarrow");z("\\Darr","\\Downarrow");z("\\lang","\\langle");z("\\rang","\\rangle");z("\\uarr","\\uparrow");z("\\uArr","\\Uparrow");z("\\Uarr","\\Uparrow");z("\\N","\\mathbb{N}");z("\\R","\\mathbb{R}");z("\\Z","\\mathbb{Z}");z("\\alef","\\aleph");z("\\alefsym","\\aleph");z("\\Alpha","\\mathrm{A}");z("\\Beta","\\mathrm{B}");z("\\bull","\\bullet");z("\\Chi","\\mathrm{X}");z("\\clubs","\\clubsuit");z("\\cnums","\\mathbb{C}");z("\\Complex","\\mathbb{C}");z("\\Dagger","\\ddagger");z("\\diamonds","\\diamondsuit");z("\\empty","\\emptyset");z("\\Epsilon","\\mathrm{E}");z("\\Eta","\\mathrm{H}");z("\\exist","\\exists");z("\\harr","\\leftrightarrow");z("\\hArr","\\Leftrightarrow");z("\\Harr","\\Leftrightarrow");z("\\hearts","\\heartsuit");z("\\image","\\Im");z("\\infin","\\infty");z("\\Iota","\\mathrm{I}");z("\\isin","\\in");z("\\Kappa","\\mathrm{K}");z("\\larr","\\leftarrow");z("\\lArr","\\Leftarrow");z("\\Larr","\\Leftarrow");z("\\lrarr","\\leftrightarrow");z("\\lrArr","\\Leftrightarrow");z("\\Lrarr","\\Leftrightarrow");z("\\Mu","\\mathrm{M}");z("\\natnums","\\mathbb{N}");z("\\Nu","\\mathrm{N}");z("\\Omicron","\\mathrm{O}");z("\\plusmn","\\pm");z("\\rarr","\\rightarrow");z("\\rArr","\\Rightarrow");z("\\Rarr","\\Rightarrow");z("\\real","\\Re");z("\\reals","\\mathbb{R}");z("\\Reals","\\mathbb{R}");z("\\Rho","\\mathrm{P}");z("\\sdot","\\cdot");z("\\sect","\\S");z("\\spades","\\spadesuit");z("\\sub","\\subset");z("\\sube","\\subseteq");z("\\supe","\\supseteq");z("\\Tau","\\mathrm{T}");z("\\thetasym","\\vartheta");z("\\weierp","\\wp");z("\\Zeta","\\mathrm{Z}");z("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");z("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");z("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");z("\\bra","\\mathinner{\\langle{#1}|}");z("\\ket","\\mathinner{|{#1}\\rangle}");z("\\braket","\\mathinner{\\langle{#1}\\rangle}");z("\\Bra","\\left\\langle#1\\right|");z("\\Ket","\\left|#1\\right\\rangle");var z8=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=d=>f=>{e&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",a));var h=d;if(!d&&i.length){var m=f.future();m.text==="|"&&(f.popToken(),h=!0)}return{tokens:h?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...o,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};z("\\bra@ket",z8(!1));z("\\bra@set",z8(!0));z("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");z("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");z("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");z("\\angln","{\\angl n}");z("\\blue","\\textcolor{##6495ed}{#1}");z("\\orange","\\textcolor{##ffa500}{#1}");z("\\pink","\\textcolor{##ff00af}{#1}");z("\\red","\\textcolor{##df0030}{#1}");z("\\green","\\textcolor{##28ae7b}{#1}");z("\\gray","\\textcolor{gray}{#1}");z("\\purple","\\textcolor{##9d38bd}{#1}");z("\\blueA","\\textcolor{##ccfaff}{#1}");z("\\blueB","\\textcolor{##80f6ff}{#1}");z("\\blueC","\\textcolor{##63d9ea}{#1}");z("\\blueD","\\textcolor{##11accd}{#1}");z("\\blueE","\\textcolor{##0c7f99}{#1}");z("\\tealA","\\textcolor{##94fff5}{#1}");z("\\tealB","\\textcolor{##26edd5}{#1}");z("\\tealC","\\textcolor{##01d1c1}{#1}");z("\\tealD","\\textcolor{##01a995}{#1}");z("\\tealE","\\textcolor{##208170}{#1}");z("\\greenA","\\textcolor{##b6ffb0}{#1}");z("\\greenB","\\textcolor{##8af281}{#1}");z("\\greenC","\\textcolor{##74cf70}{#1}");z("\\greenD","\\textcolor{##1fab54}{#1}");z("\\greenE","\\textcolor{##0d923f}{#1}");z("\\goldA","\\textcolor{##ffd0a9}{#1}");z("\\goldB","\\textcolor{##ffbb71}{#1}");z("\\goldC","\\textcolor{##ff9c39}{#1}");z("\\goldD","\\textcolor{##e07d10}{#1}");z("\\goldE","\\textcolor{##a75a05}{#1}");z("\\redA","\\textcolor{##fca9a9}{#1}");z("\\redB","\\textcolor{##ff8482}{#1}");z("\\redC","\\textcolor{##f9685d}{#1}");z("\\redD","\\textcolor{##e84d39}{#1}");z("\\redE","\\textcolor{##bc2612}{#1}");z("\\maroonA","\\textcolor{##ffbde0}{#1}");z("\\maroonB","\\textcolor{##ff92c6}{#1}");z("\\maroonC","\\textcolor{##ed5fa6}{#1}");z("\\maroonD","\\textcolor{##ca337c}{#1}");z("\\maroonE","\\textcolor{##9e034e}{#1}");z("\\purpleA","\\textcolor{##ddd7ff}{#1}");z("\\purpleB","\\textcolor{##c6b9fc}{#1}");z("\\purpleC","\\textcolor{##aa87ff}{#1}");z("\\purpleD","\\textcolor{##7854ab}{#1}");z("\\purpleE","\\textcolor{##543b78}{#1}");z("\\mintA","\\textcolor{##f5f9e8}{#1}");z("\\mintB","\\textcolor{##edf2df}{#1}");z("\\mintC","\\textcolor{##e0e5cc}{#1}");z("\\grayA","\\textcolor{##f6f7f7}{#1}");z("\\grayB","\\textcolor{##f0f1f2}{#1}");z("\\grayC","\\textcolor{##e3e5e6}{#1}");z("\\grayD","\\textcolor{##d6d8da}{#1}");z("\\grayE","\\textcolor{##babec2}{#1}");z("\\grayF","\\textcolor{##888d93}{#1}");z("\\grayG","\\textcolor{##626569}{#1}");z("\\grayH","\\textcolor{##3b3e40}{#1}");z("\\grayI","\\textcolor{##21242c}{#1}");z("\\kaBlue","\\textcolor{##314453}{#1}");z("\\kaGreen","\\textcolor{##71B307}{#1}");var j8={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class WN{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new BN(qN,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new W6(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new Er("EOF",r.loc)),this.pushTokens(i),new Er("",ur.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),o,s=0,a=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++s;else if(o.text==="}"){if(--s,s===-1)throw new pe("Extra }",o)}else if(o.text==="EOF")throw new pe("Unexpected end of input in a macro argument, expected '"+(t&&r?t[a]:"}")+"'",o);if(t&&r)if((s===0||s===1&&t[a]==="{")&&o.text===t[a]){if(++a,a===t.length){n.splice(-a,a);break}}else a=0}while(s!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new pe("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new pe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new pe("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var o=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){o=o.slice();for(var a=o.length-1;a>=0;--a){var l=o[a];if(l.text==="#"){if(a===0)throw new pe("Incomplete placeholder at end of macro body",l);if(l=o[--a],l.text==="#")o.splice(a+1,1);else if(/^[1-9]$/.test(l.text))o.splice(a,2,...s[+l.text-1]);else throw new pe("Not a valid argument number",l)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Er(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var o=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(o+1))!==-1;)++o;for(var a=new W6(i,this.settings),l=[],c=a.lex();c.text!=="EOF";)l.push(c),c=a.lex();l.reverse();var u={tokens:l,numArgs:o};return u}return i}isDefined(t){return this.macros.has(t)||ts.hasOwnProperty(t)||Dt.math.hasOwnProperty(t)||Dt.text.hasOwnProperty(t)||j8.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:ts.hasOwnProperty(t)&&!ts[t].primitive}}var K6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,_d=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Qm={"́":{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"}},Y6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class ah{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new WN(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new pe("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Er("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(ah.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||t&&ts[i.text]&&ts[i.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;r.push(o)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var a=Dt[this.mode][n].group,l=ur.range(t),c;if(PR.hasOwnProperty(a)){var u=a;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:a,mode:this.mode,loc:l,text:n};s=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(Gk(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),s={type:"textord",mode:"text",loc:ur.range(t),text:n};else return null;if(this.consume(),o)for(var d=0;djg.renderToString(n.text,{...e,displayMode:n.displayMode})+(t?` `:"")}function nz(e,t){const n=e&&e.nonStandard,r=n?QN:XN;return{name:"inlineKatex",level:"inline",start(i){let o,s=i;for(;s;){if(o=s.indexOf("$"),o===-1)return;if((n?o>-1:o===0||s.charAt(o-1)===" ")&&s.substring(o).match(r))return o;s=s.substring(o+1).replace(/^\$+/,"")}},tokenizer(i,o){const s=i.match(r);if(s)return{type:"inlineKatex",raw:s[0],text:s[2].trim(),displayMode:s[1].length===2}},renderer:t}}function rz(e,t){return{name:"blockKatex",level:"block",tokenizer(n,r){const i=n.match(ez);if(i)return{type:"blockKatex",raw:i[0],text:i[2].trim(),displayMode:i[1].length===2}},renderer:t}}function iz(e={}){const{highlight:t,container:n}=e;return{async:!0,async walkTokens(r){var i;if(r.type!=="code"||typeof t!="function")return;const[o="text",...s]=((i=r.lang)==null?void 0:i.split(" "))??[],{text:a}=r,l=await t(a,o,s),c=n?n.replace("%l",String(o).toUpperCase()).replace("%s",l).replace("%t",a):l;Object.assign(r,{type:"html",block:!0,text:`${c} `})}}}let dn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function oz(e){return ub(e)}function ub(e){return Array.isArray(e)?sz(e):e instanceof RegExp?e:typeof e=="object"?az(e):e}function sz(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function U8(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?U8(e.substring(0,e.length-1)):e.substr(~t+1)}var ep=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Cd=class{static hasCaptures(e){return e===null?!1:(ep.lastIndex=0,ep.test(e))}static replaceCaptures(e,t,n){return e.replace(ep,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function B8(e,t){return et?1:0}function q8(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>lz(e.parent,i.parentScopes));return r?new G8(r.fontStyle,r.foreground,r.background):null}},tp=class vf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new vf(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!cz(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function cz(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var G8=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function uz(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(g=m.slice(0,m.length-1),g.reverse()),n[r++]=new dz(p,g,i,l,c,u)}}return n}var dz=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},Zn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Zn||{});function fz(e,t){e.sort((l,c)=>{let u=B8(l.scope,c.scope);return u!==0||(u=q8(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new hz(t),s=new G8(n,o.getId(r),o.getId(i)),a=new pz(new Fg(0,null,-1,0,0),[]);for(let l=0,c=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},pz=class Hg{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Hg._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new Hg(this._mainRule.clone(),Fg.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=Fr.getLanguageId(t),c=Fr.getTokenType(t),u=Fr.containsBalancedBrackets(t)?1:0,d=Fr.getFontStyle(t),f=Fr.getForeground(t),h=Fr.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(u=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|c<<8|u<<10|d<<11|f<<15|h<<24)>>>0}};function Zf(e,t){const n=[],r=gz(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=s();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Q6(i)){const l=[];do l.push(i),i=r.next();while(Q6(i));return c=>t(l,c)}return null}function s(){const l=[];let c=o();for(;c;)l.push(c),c=o();return u=>l.every(d=>d(u))}function a(){const l=[];let c=s();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=s()}return u=>l.some(d=>d(u))}}function Q6(e){return!!e&&!!e.match(/[\w\.:]+/)}function gz(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Y8(e){typeof e.dispose=="function"&&e.dispose()}var Yc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},vz=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},bz=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},yz=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Yc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new bz;for(const n of e)wz(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Yc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function wz(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Yc?bf({baseGrammar:o,selfGrammar:i},r):Vg(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Yc(a))}function Vg(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Gf([r],t,n)}}function bf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Gf(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Gf(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Gf(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?V8({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Gf(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=J8(o);switch(s.kind){case 0:bf({...t,selfGrammar:t.baseGrammar},n);break;case 1:bf(t,n);break;case 2:Vg(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Vg(s.ruleName,l,n):bf(l,n)}else s.kind===4?n.add(new vz(s.scopeName,s.ruleName)):n.add(new Yc(s.scopeName));break}}}var kz=class{kind=0},xz=class{kind=1},Sz=class{constructor(e){this.ruleName=e}kind=2},_z=class{constructor(e){this.scopeName=e}kind=3},Cz=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function J8(e){if(e==="$base")return new kz;if(e==="$self")return new xz;const t=e.indexOf("#");if(t===-1)return new _z(e);if(t===0)return new Sz(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Cz(n,r)}}var Iz=/\\(\d+)/,ew=/\\(\d+)/g,Ez=-1,X8=-2;var Mu=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Cd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Cd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${U8(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Cd.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Cd.replaceCaptures(this._contentName,e,t)}},Tz=class extends Mu{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},$z=class extends Mu{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Jc(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Xc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tw=class extends Mu{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Xc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ug=class extends Mu{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r),this._begin=new Jc(i,this.id),this.beginCaptures=o,this._end=new Jc(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Xc;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Kf=class extends Mu{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Jc(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Jc(s,X8),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Xc;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Xc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Q8=class Hn{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Tz(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new $z(t.$vscodeTextmateLocation,t.id,t.name,t.match,Hn._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=V8({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new tw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Hn._compilePatterns(o,n,r))}return t.while?new Kf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Hn._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Hn._compileCaptures(t.whileCaptures||t.captures,n,r),Hn._compilePatterns(t.patterns,n,r)):new Ug(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Hn._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Hn._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Hn._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=Hn.getCompiledRuleId(t[s],n,r)),i[a]=Hn.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return ew.lastIndex=0,this.source.replace(ew,(i,o)=>W8(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new nw(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new nw(e,r,this._items.map(i=>i.ruleId))}},nw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new np(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Bg.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Az=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>W8(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},rw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function tx(e,t,n,r,i,o,s,a){const l=t.content.length;let c=!1,u=-1;if(s){const h=Mz(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,u=h.anchorPosition}const d=Date.now();for(;!c;){if(a!==0&&Date.now()-d>a)return new rw(i,!0);f()}return new rw(i,!1);function f(){const h=Oz(e,t,n,r,i,u);if(!h){o.produce(i,l),c=!0;return}const m=h.captureIndices,p=h.matchedRuleId,g=m&&m.length>0?m[0].end>r:!1;if(p===Ez){const b=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Sc(e,t,n,i,o,b.endCaptures,m),o.produce(i,m[0].end);const v=i;if(i=i.parent,u=v.getAnchorPos(),!g&&v.getEnterPos()===r){i=v,o.produce(i,l),c=!0;return}}else{const b=e.getRule(p);o.produce(i,m[0].start);const v=i,y=b.getName(t.content,m),T=i.contentNameScopesList.pushAttributed(y,e);if(i=i.push(p,r,u,m[0].end===l,null,T,T),b instanceof Ug){const k=b;Sc(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),u=m[0].end;const x=k.getContentName(t.content,m),_=T.pushAttributed(x,e);if(i=i.withContentNameScopesList(_),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!g&&v.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),c=!0;return}}else if(b instanceof Kf){const k=b;Sc(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),u=m[0].end;const x=k.getContentName(t.content,m),_=T.pushAttributed(x,e);if(i=i.withContentNameScopesList(_),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!g&&v.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),c=!0;return}}else if(Sc(e,t,n,i,o,b.captures,m),o.produce(i,m[0].end),i=i.pop(),!g){i=i.safePop(),o.produce(i,l),c=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Mz(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof Kf&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:u}=Rz(l.rule,e,l.stack.endRule,n,r===s),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==X8){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Sc(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function Oz(e,t,n,r,i,o){const s=Pz(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Dz(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const c=s.captureIndices[0].start,u=l.captureIndices[0].start;return u=a)&&(a=y,l=v.captureIndices,c=v.ruleId,u=m.priority,a===i))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function nx(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Rz(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Sc(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),c=[],u=s[0].end;for(let d=0;du)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const p=f.getName(a,s),g=r.contentNameScopesList.pushAttributed(p,e),b=f.getContentName(a,s),v=g.pushAttributed(b,e),y=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,g,v),T=e.createOnigString(a.substring(0,h.end));tx(e,T,n&&h.start===0,h.start,y,i,!1,0),Y8(T);continue}const m=f.getName(a,s);if(m!==null){const g=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);c.push(new Nz(g,h.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Nz=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function zz(e,t,n,r,i,o,s,a){return new Fz(e,t,n,r,i,o,s,a)}function iw(e,t,n,r,i){const o=Zf(t,Yf),s=Q8.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function Yf(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var Fz=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Lz(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=ow(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=Zf(l,Yf);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)iw(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&iw(t,l,a,this,a)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ow(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Q8.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===qg.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=pl.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Nc.createRootAndLookUpScopeName(f,d,this):h=Nc.createRoot("unknown",d),t=new qg(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` `;const o=this.createOnigString(e),s=o.content.length,a=new Vz(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=tx(this,o,i,0,t,a,!0,r);return Y8(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function ow(e,t){return e=oz(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Nc=class Pi{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=tp.push(i,o.scopeNames),r=new Pi(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new Pi(null,new tp(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new tp(null,t),s=r.themeProvider.themeMatch(o),a=Pi.mergeAttributes(n,i,s);return new Pi(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Pi.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),pl.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Pi._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=Pi._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=Pi.mergeAttributes(t.tokenAttributes,i,s);return new Pi(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},qg=class Ps{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new Ps(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ps._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Nc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ps._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new Ps(this,t,n,r,i,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ps(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Nc.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Ps(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Nc.fromExtension(r,n.contentNameScopesList))}},Hz=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Zf(n,Yf).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Zf(n,Yf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Vz=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=pl.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=pl.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Wg=qg.NULL;const qz=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ou{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ou.prototype.normal={};Ou.prototype.property={};Ou.prototype.space=void 0;function rx(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ou(n,r,t)}function Zg(e){return e.toLowerCase()}let gr=class{constructor(t,n){this.attribute=n,this.property=t}};gr.prototype.attribute="";gr.prototype.booleanish=!1;gr.prototype.boolean=!1;gr.prototype.commaOrSpaceSeparated=!1;gr.prototype.commaSeparated=!1;gr.prototype.defined=!1;gr.prototype.mustUseProperty=!1;gr.prototype.number=!1;gr.prototype.overloadedBoolean=!1;gr.prototype.property="";gr.prototype.spaceSeparated=!1;gr.prototype.space=void 0;let Wz=0;const tt=va(),ln=va(),Gg=va(),ge=va(),Pt=va(),nl=va(),kr=va();function va(){return 2**++Wz}const Kg=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:ln,commaOrSpaceSeparated:kr,commaSeparated:nl,number:ge,overloadedBoolean:Gg,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),rp=Object.keys(Kg);class db extends gr{constructor(t,n,r,i){let o=-1;if(super(t,n),sw(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Yz.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(aw,Qz);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!aw.test(o)){let s=o.replace(Kz,Xz);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=db}return new i(r,t)}function Xz(e){return"-"+e.toLowerCase()}function Qz(e){return e.charAt(1).toUpperCase()}const ej=rx([ix,Zz,ax,lx,cx],"html"),ux=rx([ix,Gz,ax,lx,cx],"svg"),lw={}.hasOwnProperty;function tj(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&lw.call(i,e)){const l=String(i[e]);s=lw.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const nj=/["&'<>`]/g,rj=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ij=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,oj=/[|\\{}()[\]^$+*?.]/g,cw=new WeakMap;function sj(e,t){if(e=e.replace(t.subset?aj(t.subset):nj,r),t.subset||t.escapeOnly)return e;return e.replace(rj,n).replace(ij,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function aj(e){let t=cw.get(e);return t||(t=lj(e),cw.set(e,t)),t}function lj(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},mj=["cent","copy","divide","gt","lt","not","para","times"],dx={}.hasOwnProperty,Yg={};let Id;for(Id in ip)dx.call(ip,Id)&&(Yg[ip[Id]]=Id);const pj=/[^\dA-Za-z]/;function gj(e,t,n,r){const i=String.fromCharCode(e);if(dx.call(Yg,i)){const o=Yg[i],s="&"+o;return n&&hj.includes(o)&&!mj.includes(o)&&(!r||t&&t!==61&&pj.test(String.fromCharCode(t)))?s:s+";"}return""}function vj(e,t,n){let r=uj(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=gj(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=fj(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],wj=["<",">"];function kj(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return rl(o,Object.assign({},r.settings.characterReferences,{subset:wj}))}}function xj(e,t,n,r){return""}function uw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Sj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function _j(e){return e.join(" ").trim()}const Cj=/[ \t\n\f\r]/g;function fb(e){return typeof e=="object"?e.type==="text"?dw(e.value):!1:dw(e)}function dw(e){return e.replace(Cj,"")===""}const In=hx(1),fx=hx(-1),Ij=[];function hx(e){return t;function t(n,r,i){const o=n?n.children:Ij;let s=(r||0)+e,a=o[s];if(!i)for(;a&&fb(a);)s+=e,a=o[s];return a}}const Ej={}.hasOwnProperty;function mx(e){return t;function t(n,r,i){return Ej.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const hb=mx({body:$j,caption:op,colgroup:op,dd:Oj,dt:Mj,head:op,html:Tj,li:Aj,optgroup:Pj,option:Dj,p:Lj,rp:fw,rt:fw,tbody:Nj,td:hw,tfoot:zj,th:hw,thead:Rj,tr:jj});function op(e,t,n){const r=In(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&fb(r.value.charAt(0)))}function Tj(e,t,n){const r=In(n,t);return!r||r.type!=="comment"}function $j(e,t,n){const r=In(n,t);return!r||r.type!=="comment"}function Lj(e,t,n){const r=In(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Aj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Mj(e,t,n){const r=In(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Oj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function fw(e,t,n){const r=In(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Pj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Dj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Rj(e,t,n){const r=In(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Nj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function zj(e,t,n){return!In(n,t)}function jj(e,t,n){const r=In(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function hw(e,t,n){const r=In(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Fj=mx({body:Uj,colgroup:Bj,head:Vj,html:Hj,tbody:qj});function Hj(e){const t=In(e,-1);return!t||t.type!=="comment"}function Vj(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function Uj(e){const t=In(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&fb(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Bj(e,t,n){const r=fx(n,t),i=In(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&hb(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function qj(e,t,n){const r=fx(n,t),i=In(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&hb(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Ed={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 \f\r "&'/<=>\``.split("")]],unquoted:[[` \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Wj(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=ux);const c=Zj(r,e.properties),u=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,u&&(s=!1),(c||!o||!Fj(e,t,n))&&(a.push("<",e.tagName,c?" "+c:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!s&&(!o||!hb(e,t,n))&&a.push(""),a.join("")}function Zj(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=Gj(e,i,t[i]);o&&n.push(o)}}for(;++ruw(n,e.alternative)&&(s=e.alternative),a=s+rl(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Ed.single:Ed.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const Kj=["<","&"];function px(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:rl(e.value,Object.assign({},r.settings.characterReferences,{subset:Kj}))}function Yj(e,t,n,r){return r.settings.allowDangerousHtml?e.value:px(e,t,n,r)}function Jj(e,t,n,r){return r.all(e)}const Xj=tj("type",{invalid:Qj,unknown:eF,handlers:{comment:kj,doctype:xj,element:Wj,raw:Yj,root:Jj,text:px}});function Qj(e){throw new Error("Expected node, not `"+e+"`")}function eF(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const tF={},nF={},rF=[];function Bi(e,t){const n=t||tF,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:iF,all:oF,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||qz,characterReferences:n.characterReferences||nF,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ux:ej,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function iF(e,t,n){return Xj(e,t,n,this)}function oF(e){const t=[],n=e&&e.children||rF;let r=-1;for(;++rt.default||t)}function mb(e){return!e||["plaintext","txt","text","plain"].includes(e)}function vx(e){return e==="ansi"||mb(e)}function pb(e){return e==="none"}function bx(e){return pb(e)}function yx(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function lh(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;oi);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let o=i,s=0;for(const a of t){if(on&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return nr-i);return n.length?e.map(r=>r.flatMap(i=>{const o=n.filter(s=>i.offsets-i.offset).sort((s,a)=>s-a);return o.length?cF(i,o):i})):e}function dF(e,t,n,r,i="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>Xf(e.variants[u])),a=new Set(s.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":f)};return s.forEach((u,d)=>{for(const f of a){const h=u[f]||"inherit";if(d===0&&r&&lF.includes(f))if(r===gb&&s.length>1){const m=t.findIndex(v=>v==="light"),p=t.findIndex(v=>v==="dark");if(m===-1||p===-1)throw new dn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const g=s[m][f]||"inherit",b=s[p][f]||"inherit";l[f]=`light-dark(${g}, ${b})`,i==="css-vars"&&(l[c(d,f)]=h)}else l[f]=h;else i==="css-vars"&&(l[c(d,f)]=h)}}),o.htmlStyle=l,o}function Xf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Zn.Italic&&(t["font-style"]="italic"),e.fontStyle&Zn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Zn.Underline&&n.push("underline"),e.fontStyle&Zn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Jg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const wx=new WeakMap;function ch(e,t){wx.set(e,t)}function Qc(e){return wx.get(e)}class Pl{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Pl(Object.fromEntries(sF(n).map(r=>[r,Wg])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return fF(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function fF(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function hF(e,t){if(!(e instanceof Pl))throw new dn("Invalid grammar state");return e.getInternalStack(t)}function mF(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new dn(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...i.indexToPos(s),offset:s}}else{const a=i.lines[s.line];if(a===void 0)throw new dn(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new dn(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:i.posToIndex(s.line,l)}}};const i=aF(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));pF(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return uF(n,i)},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(i.length!==r.converter.lines.length)throw new dn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,d,f,h){const m=i[u];let p="",g=-1,b=-1;if(d===0&&(g=0),f===0&&(b=0),f===Number.POSITIVE_INFINITY&&(b=m.children.length),g===-1||b===-1)for(let y=0;yp);return u.tagName=d.tagName||"span",u.properties={...u.properties,...h,class:u.properties.class},d.properties?.class&&yx(u,d.properties.class),u=m(u,f)||u,u}const l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of c){const{start:d,end:f}=u;if(d.line===f.line)o(d.line,d.character,f.character,u);else if(d.lines(h,u));o(f.line,0,f.character,u)}}l.forEach(u=>u())}}}function pF(e){for(let t=0;tn.end.offset)throw new dn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function yF(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)sp[r]&&t.push({type:"setDecoration",value:sp[r]});else if(r<=29){const i=sp[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:js[r-30]}});else if(r===38){const i=mw(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:js[r-40]}});else if(r===48){const i=mw(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:js[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:js[r-100+8]}})}return t}function wF(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const s=bF(r,o),a=s.sequence?r.substring(o,s.startPosition):r.substring(o);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=yF(s.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}o=s.position}while(oMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c{const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,u=e.colors?.[c];return[l,u||SF[l]]})),s=xF(o),a=wF();return i.map(l=>a.parse(l[0]).map(c=>{let u,d;c.decorations.has("reverse")?(u=c.background?s.value(c.background):e.bg,d=c.foreground?s.value(c.foreground):e.fg):(u=c.foreground?s.value(c.foreground):e.fg,d=c.background?s.value(c.background):void 0),u=rs(u,r),d=rs(d,r),c.decorations.has("dim")&&(u=CF(u));let f=Zn.None;return c.decorations.has("bold")&&(f|=Zn.Bold),c.decorations.has("italic")&&(f|=Zn.Italic),c.decorations.has("underline")&&(f|=Zn.Underline),c.decorations.has("strikethrough")&&(f|=Zn.Strikethrough),{content:c.value,offset:l[1],color:u,bgColor:d,fontStyle:f}}))}function CF(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],s=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${o}${o}${s}${s}${l}`}else if(r.length===3){const i=r[0],o=r[1],s=r[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function vb(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(mb(i)||pb(r))return lh(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:o,colorMap:s}=e.setTheme(r);if(i==="ansi")return _F(o,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new dn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new dn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return EF(t,a,o,s,n)}function IF(...e){if(e.length===2)return Qc(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(mb(i)||pb(o))throw new dn("Plain language does not have grammar state");if(i==="ansi")throw new dn("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new Pl(bb(n,l,s,a,r).stateStack,l.name,s.name)}function EF(e,t,n,r,i){const o=bb(e,t,n,r,i),s=new Pl(o.stateStack,t.name,n.name);return ch(o.tokens,s),o.tokens}function bb(e,t,n,r,i){const o=Jf(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=i,l=lh(e);let c=i.grammarState?hF(i.grammarState,n.name)??Wg:i.grammarContextCode!=null?bb(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Wg,u=[];const d=[];for(let f=0,h=l.length;f0&&m.length>=s){u=[],d.push([{content:m,offset:p,color:"",fontStyle:0}]);continue}let g,b,v;i.includeExplanation&&(g=t.tokenizeLine(m,c,a),b=g.tokens,v=0);const y=t.tokenizeLine2(m,c,a),T=y.tokens.length/2;for(let k=0;kO.trim());break;case"object":$=S.scope;break;default:continue}R.push({settings:S,selectors:$.map(O=>O.split(/ /))})}F.explanation=[];let E=0;for(;x+E<_;){const S=b[v],$=m.substring(S.startIndex,S.endIndex);E+=$.length,F.explanation.push({content:$,scopes:i.includeExplanation==="scopeName"?TF(S.scopes):$F(R,S.scopes)}),v+=1}}u.push(F)}d.push(u),u=[],c=y.ruleStack}return{tokens:d,stateStack:c}}function TF(e){return e.map(t=>({scopeName:t}))}function $F(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)pw(e[r],n[i])&&(r-=1),i-=1;return r===-1}function AF(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(LF(s,t,n)){r.push(o);break}return r}function xx(e,t,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const c=vb(e,t,{...n,theme:l.theme}),u=Qc(c),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:u,theme:d}}),o=MF(...i.map(l=>l.tokens)),s=o[0].map((l,c)=>l.map((u,d)=>{const f={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=u.explanation),o.forEach((h,m)=>{const{content:p,explanation:g,offset:b,...v}=h[c][d];f.variants[r[m].color]=v}),f})),a=i[0].state?new Pl(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return a&&ch(s,a),s}function MF(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,c)=>l.push(o[c]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;cb[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,v)=>b.color===c?-1:v.color===c?1:0);if(f.length===0)throw new dn("`themes` option must not be empty");const h=xx(e,t,n);if(l=Qc(h),c&&gb!==c&&!f.find(b=>b.color===c))throw new dn(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=f.map(b=>e.getTheme(b.theme)),p=f.map(b=>b.color);o=h.map(b=>b.map(v=>dF(v,p,u,c,d))),l&&ch(o,l);const g=f.map(b=>Jf(b.theme,n));i=gw(f,m,g,u,c,"fg",d),r=gw(f,m,g,u,c,"bg",d),s=`shiki-themes ${m.map(b=>b.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else if("theme"in n){const c=Jf(n.theme,n);o=vb(e,t,n);const u=e.getTheme(n.theme);r=rs(u.bg,c),i=rs(u.fg,c),s=u.name,l=Qc(o)}else throw new dn("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:s,rootStyle:a,grammarState:l}}function gw(e,t,n,r,i,o,s){return e.map((a,l)=>{const c=rs(t[l][o],n[l])||"inherit",u=`${r+a.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&i){if(i===gb&&e.length>1){const d=e.findIndex(p=>p.color==="light"),f=e.findIndex(p=>p.color==="dark");if(d===-1||f===-1)throw new dn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const h=rs(t[d][o],n[d])||"inherit",m=rs(t[f][o],n[f])||"inherit";return`light-dark(${h}, ${m});${u}`}return c}return s==="css-vars"?u:null}).filter(a=>!!a).join(";")}function t0(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>t0(e,i,o),codeToTokens:(i,o)=>e0(e,i,o)}){let i=t;for(const m of Qf(n))i=m.preprocess?.call(r,i,n)||i;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:c,grammarState:u}=e0(e,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?o=PF(o):d==="never"&&(o=DF(o)),f&&(o=RF(o));const h={...r,get source(){return i}};for(const m of Qf(n))o=m.tokens?.call(h,o)||o;return OF(o,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},h,u)}function OF(e,t,n,r=Qc(e)){const i=Qf(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[p,g]of Object.entries(t.meta||{}))p.startsWith("_")||(c[p]=g);let u={type:"element",tagName:"pre",properties:c,children:[]},d={type:"element",tagName:"code",properties:{},children:o};const f=[],h={...n,structure:a,addClassToHast:yx,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((p,g)=>{g&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:` `}));let b={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const y of p){let T={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const k=Jg(y.htmlStyle||Xf(y));k&&(T.properties.style=k);for(const x of i)T=x?.span?.call(h,T,g+1,v,b,y)||T;a==="inline"?s.children.push(T):a==="classic"&&b.children.push(T),v+=y.content.length}if(a==="classic"){for(const y of i)b=y?.line?.call(h,b,g+1)||b;f.push(b),o.push(b)}else a==="inline"&&f.push(b)}),a==="classic"){for(const p of i)d=p?.code?.call(h,d)||d;u.children.push(d);for(const p of i)u=p?.pre?.call(h,u)||u;s.children.push(u)}else if(a==="inline"){const p=[];let g={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const y of s.children)y.type==="element"&&y.tagName==="br"?(p.push(g),g={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(y.type==="element"||y.type==="text")&&g.children.push(y);p.push(g);let v={type:"element",tagName:"code",properties:{},children:p};for(const y of i)v=y?.code?.call(h,v)||v;s.children=[];for(let y=0;y0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const T=v.children[y];T.type==="element"&&s.children.push(...T.children)}}let m=s;for(const p of i)m=p?.root?.call(h,m)||m;return r&&ch(m,r),m}function PF(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,s)=>{const l=!(o.fontStyle&&(o.fontStyle&Zn.Underline||o.fontStyle&Zn.Strikethrough));l&&o.content.match(/^\s+$/)&&t[s+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(l?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function DF(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,o,s]=r;if(!i&&!s)return n;const a=[{...n,offset:n.offset+i.length,content:o}];return i&&a.unshift({content:i,offset:n.offset}),s&&a.push({content:s,offset:n.offset+i.length+o.length}),a}))}function RF(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],o=Jg(i.htmlStyle||Xf(i)),s=Jg(r.htmlStyle||Xf(r)),a=i.fontStyle&&(i.fontStyle&Zn.Underline||i.fontStyle&Zn.Strikethrough),l=r.fontStyle&&(r.fontStyle&Zn.Underline||r.fontStyle&Zn.Strikethrough);!a&&!l&&o===s?i.content+=r.content:n.push({...r})}return n})}const NF=Bi;function zF(e,t,n){const r={meta:{},options:n,codeToHast:(o,s)=>t0(e,o,s),codeToTokens:(o,s)=>e0(e,o,s)};let i=NF(t0(e,t,n,r));for(const o of Qf(n))i=o.postprocess?.call(r,i,n)||i;return i}const vw={light:"#333333",dark:"#bbbbbb"},bw={light:"#fffffe",dark:"#1e1e1e"},yw="__shiki_resolved";function uh(e){if(e?.[yw])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?vw.light:vw.dark),n||(n=t.type==="light"?bw.light:bw.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const u={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,u.settings.foreground=d}if(c){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,u.settings.background=d}return u});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,yw,{enumerable:!1,writable:!1,value:!0}),t}async function Sx(e){return Array.from(new Set((await Promise.all(e.filter(t=>!vx(t)).map(async t=>await gx(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function _x(e){return(await Promise.all(e.map(async n=>bx(n)?null:uh(await gx(n))))).filter(n=>!!n)}let jF=3;function FF(e,t=3){t>jF||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Ja=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Cx(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Ja(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class HF extends Bz{constructor(t,n,r,i={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=i,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=uh(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Wf.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Cx(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(o=>{this._alias[o]=t.name}),this._loadedLanguagesCache=null,n.size)for(const o of n)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const n=Array.from(this._langGraph.entries()),r=n.filter(([i,o])=>!o);if(r.length){const i=n.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(l=>r.map(([c])=>c).includes(l)):!1).filter(o=>!r.includes(o));throw new Ja(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${i.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[i,o]of n)this._resolver.addLanguage(o);for(const[i,o]of n)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class VF{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const o=n.slice(0,i).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let lc=0;function UF(e){lc+=1,e.warnings!==!1&&lc>=10&&lc%10===0&&console.warn(`[Shiki] ${lc} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Ja("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(uh),i=new VF(e.engine,n),o=new HF(i,r,n,e.langAlias);let s;function a(y){return Cx(y,e.langAlias)}function l(y){b();const T=o.getGrammar(typeof y=="string"?y:y.name);if(!T)throw new Ja(`Language \`${y}\` not found, you may need to load it first`);return T}function c(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const T=o.getTheme(y);if(!T)throw new Ja(`Theme \`${y}\` not found, you may need to load it first`);return T}function u(y){b();const T=c(y);s!==y&&(o.setTheme(T),s=y);const k=o.getColorMap();return{theme:T,colorMap:k}}function d(){return b(),o.getLoadedThemes()}function f(){return b(),o.getLoadedLanguages()}function h(...y){b(),o.loadLanguages(y.flat(1))}async function m(...y){return h(await Sx(y))}function p(...y){b();for(const T of y.flat(1))o.loadTheme(T)}async function g(...y){return b(),p(await _x(y))}function b(){if(t)throw new Ja("Shiki instance has been disposed")}function v(){t||(t=!0,o.dispose(),lc-=1)}return{setTheme:u,getTheme:c,getLanguage:l,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:a,loadLanguage:m,loadLanguageSync:h,loadTheme:g,loadThemeSync:p,dispose:v,[Symbol.dispose]:v}}async function BF(e){e.engine||FF("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([_x(e.themes||[]),Sx(e.langs||[]),e.engine]);return UF({...e,themes:t,langs:n,engine:r})}async function qF(e){const t=await BF(e);return{getLastGrammarState:(...n)=>IF(t,...n),codeToTokensBase:(n,r)=>vb(t,n,r),codeToTokensWithThemes:(n,r)=>xx(t,n,r),codeToTokens:(n,r)=>e0(t,n,r),codeToHast:(n,r)=>t0(t,n,r),codeToHtml:(n,r)=>zF(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function WF(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function s(d){if(typeof d=="string"){if(d=o.langAlias?.[d]||d,vx(d))return[];const f=t[d];if(!f)throw new dn(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}function a(d){if(bx(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new dn(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const l=(o.themes??[]).map(d=>a(d)),c=(o.langs??[]).map(d=>s(d)),u=await qF({engine:o.engine??r(),...o,themes:l,langs:c});return{...u,loadLanguage(...d){return u.loadLanguage(...d.map(s))},loadTheme(...d){return u.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const Ix=[{id:"abap",name:"ABAP",import:(()=>P(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>P(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>P(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>P(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>P(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>P(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>P(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>P(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>P(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>P(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>P(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>P(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>P(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>P(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>P(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>P(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>P(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>P(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>P(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>P(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>P(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>P(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>P(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>P(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>P(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>P(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>P(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>P(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>P(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>P(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>P(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>P(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>P(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>P(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>P(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>P(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>P(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>P(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>P(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>P(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>P(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>P(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>P(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>P(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>P(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>P(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>P(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>P(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>P(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>P(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>P(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>P(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>P(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>P(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>P(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>P(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>P(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>P(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>P(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>P(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>P(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>P(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>P(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>P(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>P(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>P(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>P(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>P(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>P(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>P(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>P(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>P(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>P(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>P(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>P(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>P(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>P(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>P(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>P(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>P(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>P(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>P(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>P(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>P(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>P(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>P(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>P(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>P(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>P(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>P(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>P(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>P(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>P(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>P(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>P(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>P(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>P(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>P(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>P(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>P(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>P(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>P(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>P(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>P(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>P(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>P(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>P(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>P(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>P(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>P(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>P(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>P(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>P(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>P(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>P(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>P(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>P(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>P(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>P(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>P(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>P(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>P(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>P(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>P(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>P(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>P(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>P(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>P(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>P(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>P(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>P(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>P(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>P(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>P(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>P(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>P(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>P(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>P(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>P(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>P(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>P(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>P(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>P(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>P(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>P(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>P(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>P(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>P(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>P(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>P(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>P(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>P(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>P(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>P(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>P(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>P(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>P(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>P(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>P(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>P(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>P(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>P(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>P(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>P(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>P(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>P(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>P(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>P(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>P(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>P(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>P(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>P(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>P(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>P(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>P(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>P(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>P(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>P(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>P(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>P(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>P(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>P(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>P(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>P(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>P(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>P(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>P(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>P(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>P(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>P(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>P(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>P(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>P(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>P(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>P(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>P(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>P(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>P(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>P(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>P(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>P(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>P(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>P(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>P(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>P(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>P(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>P(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>P(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>P(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>P(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>P(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>P(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>P(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>P(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>P(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>P(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>P(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>P(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>P(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>P(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>P(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>P(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>P(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>P(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>P(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>P(()=>import("./zig-VOosw3JB.js"),[]))}],ZF=Object.fromEntries(Ix.map(e=>[e.id,e.import])),GF=Object.fromEntries(Ix.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),eu={...ZF,...GF},KF=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>P(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>P(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>P(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>P(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>P(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>P(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>P(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>P(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>P(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>P(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>P(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>P(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>P(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>P(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>P(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>P(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>P(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>P(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>P(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>P(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>P(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>P(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>P(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>P(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>P(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>P(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>P(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>P(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>P(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>P(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>P(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>P(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>P(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>P(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>P(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>P(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>P(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>P(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>P(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>P(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>P(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>P(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>P(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>P(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>P(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>P(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>P(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>P(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>P(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>P(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>P(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>P(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>P(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>P(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>P(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>P(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>P(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>P(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>P(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>P(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],Ex=Object.fromEntries(KF.map(e=>[e.id,e.import]));class yb extends Error{constructor(t){super(t),this.name="ShikiError"}}function YF(){return 2147483648}function JF(){return typeof performance<"u"?performance.now():Date.now()}const XF=(e,t)=>e+(t-e%t)%t;async function QF(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,p){r.HEAPU8.copyWithin(h,m,m+p)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const p=YF();if(h>p)return!1;for(let g=1;g<=4;g*=2){let b=m*(1+.2/g);b=Math.min(b,h+100663296);const v=Math.min(p,XF(Math.max(h,b),65536));if(s(v))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(h,m,p=1024){const g=m+p;let b=m;for(;h[b]&&!(b>=g);)++b;if(b-m>16&&h.buffer&&l)return l.decode(h.subarray(m,b));let v="";for(;m>10,56320|x&1023)}}return v}function u(h,m){return h?c(r.HEAPU8,h,m):""}const d={emscripten_get_now:JF,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=u}return await f(),r}var eH=Object.defineProperty,tH=(e,t,n)=>t in e?eH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wn=(e,t,n)=>tH(e,typeof t!="symbol"?t+"":t,n);let Tn=null;function nH(e){throw new yb(e.UTF8ToString(e.getLastOnigError()))}class dh{constructor(t){wn(this,"utf16Length"),wn(this,"utf8Length"),wn(this,"utf16Value"),wn(this,"utf8Value"),wn(this,"utf16OffsetToUtf8"),wn(this,"utf8OffsetToUtf16");const n=t.length,r=dh._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let c=0;c=55296&&u<=56319&&c+1=56320&&h<=57343&&(d=(u-55296<<10)+65536|h-56320,f=!0)}i&&(o[c]=l,f&&(o[c+1]=l),d<=127?s[l+0]=c:d<=2047?(s[l+0]=c,s[l+1]=c):d<=65535?(s[l+0]=c,s[l+1]=c,s[l+2]=c):(s[l+0]=c,s[l+1]=c,s[l+2]=c,s[l+3]=c)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const fh=class Di{constructor(t){if(wn(this,"id",++Di.LAST_ID),wn(this,"_onigBinding"),wn(this,"content"),wn(this,"utf16Length"),wn(this,"utf8Length"),wn(this,"utf16OffsetToUtf8"),wn(this,"utf8OffsetToUtf16"),wn(this,"ptr"),!Tn)throw new yb("Must invoke loadWasm first.");this._onigBinding=Tn,this.content=t;const n=new dh(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Di._sharedPtrInUse?(Di._sharedPtr||(Di._sharedPtr=Tn.omalloc(1e4)),Di._sharedPtrInUse=!0,Tn.HEAPU8.set(n.utf8Value,Di._sharedPtr),this.ptr=Di._sharedPtr):this.ptr=n.createString(Tn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Di._sharedPtr?Di._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};wn(fh,"LAST_ID",0);wn(fh,"_sharedPtr",0);wn(fh,"_sharedPtrInUse",!1);let Tx=fh;class rH{constructor(t){if(wn(this,"_onigBinding"),wn(this,"_ptr"),!Tn)throw new yb("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),iH(r)?r=await r.instantiator(n):oH(r)?r=await r.default(n):(sH(r)&&(r=r.data),aH(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await uH(r)(n):r=await dH(r)(n):lH(r)?r=await ap(r)(n):r instanceof WebAssembly.Module?r=await ap(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await ap(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Td=t(),Td}function ap(e){return t=>WebAssembly.instantiate(e,t)}function uH(e){return t=>WebAssembly.instantiateStreaming(e,t)}function dH(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function $x(e){return e&&await cH(e),{createScanner(t){return new rH(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Tx(t)}}}const fH=WF({langs:eu,themes:Ex,engine:()=>$x(P(()=>import("./wasm-CG6Dc4jp.js"),[]))});function Dl(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function hH(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const wb=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Mn=String.raw;function Rl(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Lx=Mn`\[\^?`,Ax=`c.? | C(?:-.?)?|${Mn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Mn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Mn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Mn`o\{[^\}]*\}?`}|${Mn`\d{1,3}`}`,kb=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,$d=new RegExp(Mn` \\ (?: ${Ax} | [gk]<[^>]*>? | [gk]'[^']*'? | . ) | \( (?: \? (?: [:=!>({] | <[=!] | <[^>]*> | '[^']*' | ~\|? | #(?:[^)\\]|\\.?)* | [^:)]*[:)] )? | \*[^\)]*\)? )? | (?:${kb.source})+ | ${Lx} | . `.replace(/\s+/g,""),"gsu"),lp=new RegExp(Mn` \\ (?: ${Ax} | . ) | \[:(?:\^?\p{Alpha}+|\^):\] | ${Lx} | && | . `.replace(/\s+/g,""),"gsu");function mH(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=OH(n.flags),i=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:n.rules.singleline};let s=[],a;for($d.lastIndex=0;a=$d.exec(e);){const d=pH(o,e,a[0],$d.lastIndex);d.tokens?s.push(...d.tokens):d.token&&s.push(d.token),d.lastIndex!==void 0&&($d.lastIndex=d.lastIndex)}const l=[];let c=0;s.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});const u=c||l.length;return{tokens:s.map(d=>d.type==="EscapedNumber"?DH(d,u):d).flat(),flags:r}}function pH(e,t,n,r){const[i,o]=n;if(n==="["||n==="[^"){const s=gH(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(o))return{token:ww(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:IH(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ox(n)}}if(o==="K")return{token:Px("keep",n)};if(o==="N"||o==="R")return{token:Fs("newline",n,{negate:o==="N"})};if(o==="O")return{token:Fs("any",n)};if(o==="X")return{token:Fs("text_segment",n)};const s=Mx(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(i==="("){if(o==="*")return{token:LH(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:$H(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Ba("group",n)};if(n==="(?>")return{token:Ba("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Ba("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Ba("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:SH(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(` `,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:Fs("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":Mn`\A`,$:Mn`\Z`}[n]:n;return{token:ww(s,n)}}return n==="|"?{token:bH(n)}:kb.test(n)?{tokens:RH(n)}:{token:yo(Dl(n),n)}}function gH(e,t,n){const r=[kw(t[1]==="^",t)];let i=1,o;for(lp.lastIndex=n;o=lp.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,r.push(kw(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(yo(93,s));else if(i--,r.push(yH(s)),!i)break}else{const a=vH(s);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:lp.lastIndex||e.length}}function vH(e){if(e[0]==="\\")return Mx(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?\^?)(?[a-z]+):\]/.exec(e);if(!t||!wb.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Fs("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?wH(e):e==="&&"?kH(e):yo(Dl(e),e)}function Mx(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return TH(e);if("dDhHsSwW".includes(n))return AH(e);if(e.startsWith(Mn`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return MH(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...i].map(s=>{const a=[...o.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return yo(Dl(s),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return yo(PH(e),e);if(xw.has(n))return yo(xw.get(n),e);if(/\d/.test(n))return xH(t,e);if(e==="\\")throw new Error(Mn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return yo(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function bH(e){return{type:"Alternator",raw:e}}function ww(e,t){return{type:"Assertion",kind:e,raw:t}}function Ox(e){return{type:"Backreference",raw:e}}function yo(e,t){return{type:"Character",value:e,raw:t}}function yH(e){return{type:"CharacterClassClose",raw:e}}function wH(e){return{type:"CharacterClassHyphen",raw:e}}function kH(e){return{type:"CharacterClassIntersector",raw:e}}function kw(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Fs(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Px(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Rl(n.flags),raw:t}}function xH(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function SH(e){return{type:"GroupClose",raw:e}}function Ba(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function _H(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function CH(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function IH(e){return{type:"Subroutine",raw:e}}const EH=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),xw=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function TH(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return yo(Dl(t.toUpperCase())-64,e)}function $H(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=_w(n),s=_w(r),a={};if(o&&(a.enable=o),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(i),Px("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,Ba("group",e,{...(o||s)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function LH(e){const t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=i?i.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,a,l]=o,c=EH.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return _H(c,r??null,i?.split(",")??null,e)}function Sw(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=o===void 0?+i:o===""?1/0:+o,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return CH(t,n,r,e)}function AH(e){const t=e[1].toLowerCase();return Fs({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function MH(e){const{p:t,neg:n,value:r}=/^\\(?

    [pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return Fs("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function _w(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function OH(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function DH(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Ox(n)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(Mn`Octal encoded byte above 177 unsupported "${n}"`)}else c=Dl(l);o.push(yo(c,(a===0?"\\":"")+l))}return o}function RH(e){const t=[],n=new RegExp(kb,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const o=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(o){const{min:s,max:a}=o.groups;if(+s>+a&&i.endsWith("?")){n.lastIndex--,t.push(Sw(i.slice(0,-1)));continue}}}t.push(Sw(i))}return t}function Dx(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function NH(e){return zH.has(e.type)}const zH=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Rx(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=mH(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(f,h)=>{const m=r.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,m.type){case"Alternator":return Xs();case"Assertion":return jH(m);case"Backreference":return FH(m,o);case"Character":return hh(m.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return HH(m,o,h);case"CharacterClassOpen":return VH(m,o,h);case"CharacterSet":return UH(m,o);case"Directive":return KH(m.kind,{flags:m.flags});case"GroupOpen":return BH(m,o,h);case"NamedCallout":return JH(m.kind,m.tag,m.arguments);case"Quantifier":return qH(m,o);case"Subroutine":return WH(m,o);default:throw new Error(`Unexpected token type "${m.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},s=QH(YH(r.flags));let a=s.body[0];for(;o.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(Mn`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(Mn`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function jH({kind:e}){return Xg(Rl({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Mn`\B`||e===Mn`\Y`})}function FH({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(o,s=!1)=>{const a=t.capturingGroups.length;let l=!1;if(o>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Qg(s?a+1-o:o,{orphan:l})};if(n){const o=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Qg(r)}return i(+r)}function HH(e,t,n){const{tokens:r,walk:i}=t,o=t.parent,s=o.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return o.body.pop(),GH(s,l);throw new Error("Invalid character class range")}return hh(Dl("-"))}function VH({negate:e},t,n){const{tokens:r,walk:i}=t,o=r[t.nextIndex],s=[yf()];let a=Ew(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(yf()),t.nextIndex++;else{const c=s.at(-1);c.body.push(i(c,n))}a=Ew(r[t.nextIndex],o)}const l=yf({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function UH({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=r;if(e==="property"){const a=mh(n);if(wb.has(a)&&!s?.has(a))e="posix",n=a;else return qa(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?XH(n,{negate:t}):e1(e,{negate:t})}function BH(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:a}=t,l=eV(e),c=l.type==="AbsenceFunction",u=Iw(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&hH(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=Tw(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(Xs()),t.nextIndex++;else{const h=l.body.at(-1),m=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(h.body.push(m),(u||n.isInLookbehind)&&!s){const p="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Cw(m)||m.type==="CapturingGroup")throw new Error(p)}else if(Cw(m)||Iw(m)&&m.negate)throw new Error(p)}}f=Tw(r[t.nextIndex])}return t.nextIndex++,l}function qH({kind:e,min:t,max:n},r){const i=r.parent,o=i.body.at(-1);if(!o||!NH(o))throw new Error("Quantifier requires a repeatable token");const s=zx(e,t,n,o);return i.body.pop(),s}function WH({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const o=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(o){const a=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=jx(i);return r.push(s),s}function ZH(e,t){return{type:"AbsenceFunction",kind:e,body:Pu(t?.body)}}function Xs(e){return{type:"Alternative",body:Fx(e?.body)}}function Xg(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Qg(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Nx(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!tV(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Pu(t?.body)}}function hh(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function yf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Fx(e?.body)}}function GH(e,t){if(t.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function QH(e,t){return{type:"Regex",body:Pu(t?.body),flags:e}}function jx(e){return{type:"Subroutine",ref:e}}function qa(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(mh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=nV(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Mn`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function eV({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return ZH("repeater");case"atomic":return pi({atomic:!0});case"capturing":return Nx(i,{name:n});case"group":return pi({flags:e});case"lookahead":case"lookbehind":return Rs({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function Pu(e){if(e===void 0)e=[Xs()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Fx(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Cw(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Iw(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function tV(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function nV(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function mh(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Ew(e,t){return Rl(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Tw(e){return Rl(e,"Unclosed group")}function zc(e,t,n=null){function r(o,s){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function iV(e,t){for(let n=0;n=t&&e[n]++}function oV(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Wr=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function xb(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,a="";for(const l of e.matchAll(i)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===Wr.DEFAULT==!s)){n instanceof Function?a+=n(l,{context:s?Wr.CHAR_CLASS:Wr.DEFAULT,negated:o[o.length-1]}):a+=n;continue}c[0]==="["?(s++,o.push(c[1]==="^")):c==="]"&&s&&(s--,o.pop()),a+=c}return a}function Hx(e,t,n,r){xb(e,t,n,r)}function sV(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let o=0,s;for(;s=i.exec(e);){const{0:a,groups:{$skip:l}}=s;if(!l&&(!r||r===Wr.DEFAULT==!o))return s;a==="["?o++:a==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function Ad(e,t,n){return!!sV(e,t,0,n)}function aV(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,o=1,s;for(;s=n.exec(e);){const[a]=s;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=s.index;break}}return e.slice(t,r)}const $w=new RegExp(String.raw`(?${rV})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function lV(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",o="(?:(?=(",s=[0],a=[];let l=0,c=0,u=NaN,d;do{d=!1;let f=0,h=0,m=!1,p;for($w.lastIndex=Number.isNaN(u)?0:u+o.length;p=$w.exec(e);){const{0:g,index:b,groups:{capturingStart:v,noncapturingStart:y}}=p;if(g==="[")f++;else if(f)g==="]"&&f--;else if(g===i&&!m)u=b,m=!0;else if(m&&y)h++;else if(v)m?h++:(l++,s.push(l+c));else if(g===")"&&m){if(!h){c++;const T=l+c;if(e=`${e.slice(0,u)}${o}${e.slice(u+i.length,b)}))<$$${T}>)${e.slice(b+1)}`,d=!0,a.push(T),iV(n,T),r.size){const k=new Map;r.forEach((x,_)=>{k.set(_>=T?_+1:_,x.map(A=>A>=T?A+1:A))}),r=k}break}h--}}}while(d);return n.push(...a),e=xb(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:m}})=>{if(h){const p=+h;if(p>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[p]}`}return`\\${m}`},Wr.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Vx=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,cp=new RegExp(String.raw` \\(?: \d+ | c[A-Za-z] | [gk]<[^>]+> | [pPu]\{[^\}]+\} | u[A-Fa-f\d]{4} | x[A-Fa-f\d]{2} ) | \((?: \? (?: [:=!>] | <(?:[=!]|[^>]+>) | [A-Za-z\-]+: | \(DEFINE\) ))? | (?${Vx})(?[?+]?)(?[?*+\{]?) | \\?. `.replace(/\s+/g,""),"gsu");function cV(e){if(!new RegExp(`${Vx}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",o=0,s;for(cp.lastIndex=0;s=cp.exec(e);){const{0:a,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=s;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(u==="+"&&i&&!i.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(c))e=oV(e,l+c.length,u,"");else{if(i===")"||i==="]"){const h=i===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,h)}(?>${e.slice(h,l)}${c})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${c})${e.slice(l+a.length)}`;f+=4}cp.lastIndex+=f}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const Br=String.raw,uV=Br`\\g<(?[^>&]+)&R=(?[^>]+)>`,t1=Br`\(\?R=(?[^\)]+)\)|${uV}`,ph=Br`\(\?<(?![=!])(?[^>]+)>`,Ux=Br`${ph}|(?\()(?!\?)`,Es=new RegExp(Br`${ph}|${t1}|\(\?|\\?.`,"gsu"),up="Cannot use multiple overlapping recursions";function dV(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(t1,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Ad(e,Br`\(\?\(DEFINE\)`,Wr.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Ad(e,Br`\\[1-9]`,Wr.DEFAULT),a=new Map,l=[];let c=!1,u=0,d=0,f;for(Es.lastIndex=0;f=Es.exec(e);){const{0:h,groups:{captureName:m,rDepth:p,gRNameOrNum:g,gRDepth:b}}=f;if(h==="[")u++;else if(u)h==="]"&&u--;else if(p){if(Lw(p),c)throw new Error(up);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const v=e.slice(0,f.index),y=e.slice(Es.lastIndex);if(Ad(y,t1,Wr.DEFAULT))throw new Error(up);const T=+p-1;e=Aw(v,y,T,!1,n,o,d),i=Ow(i,v,T,o.length,0,d);break}else if(g){Lw(b);let v=!1;for(const R of l)if(R.name===g||R.num===+g){if(v=!0,R.hasRecursedWithin)throw new Error(up);break}if(!v)throw new Error(Br`Recursive \g cannot be used outside the referenced group "${r==="external"?g:Br`\g<${g}&R=${b}>`}"`);const y=a.get(g),T=aV(e,y);if(s&&Ad(T,Br`${ph}|\((?!\?)`,Wr.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const k=e.slice(y,f.index),x=T.slice(k.length+h.length),_=o.length,A=+b-1,M=Aw(k,x,A,!0,n,o,d);i=Ow(i,k,A,o.length-_,_,d);const L=e.slice(0,y),F=e.slice(y+T.length);e=`${L}${M}${F}`,Es.lastIndex+=M.length-h.length-k.length-x.length,l.forEach(R=>R.hasRecursedWithin=!0),c=!0}else if(m)d++,a.set(String(d),Es.lastIndex),a.set(m,Es.lastIndex),l.push({num:d,name:m});else if(h[0]==="("){const v=h==="(";v&&(d++,a.set(String(d),Es.lastIndex)),l.push(v?{num:d}:{})}else h===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Lw(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Aw(e,t,n,r,i,o,s){const a=new Set;r&&Hx(e+t,ph,({groups:{captureName:c}})=>{a.add(c)},Wr.DEFAULT);const l=[n,r?a:null,i,o,s];return`${e}${Mw(`(?:${e}`,"forward",...l)}(?:)${Mw(`${t})`,"backward",...l)}${t}`}function Mw(e,t,n,r,i,o,s){const l=u=>t==="forward"?u+2:n-u+2-1;let c="";for(let u=0;u[^>]+)>`,({0:f,groups:{captureName:h,unnamed:m,backref:p}})=>{if(p&&r&&!r.has(p))return f;const g=`_$${d}`;if(m||h){const b=s+o.length+1;return o.push(b),fV(i,b),m?f:`(?<${h}${g}>`}return Br`\k<${p}${g}>`},Wr.DEFAULT)}return c}function fV(e,t){for(let n=0;n=t&&e[n]++}function Ow(e,t,n,r,i,o){if(e.size&&r){let s=0;Hx(t,Ux,()=>s++,Wr.DEFAULT);const a=o-s+i,l=new Map;return e.forEach((c,u)=>{const d=(r-s*n)/n,f=s*n,h=u>a+s?u+r:u,m=[];for(const p of c)if(p<=a)m.push(p);else if(p>a+s+d)m.push(p+r);else if(p<=a+s)for(let g=0;g<=n;g++)m.push(p+s*g);else for(let g=0;g<=n;g++)m.push(p+f+d*g);l.set(h,m)}),l}return e}var kn=String.fromCodePoint,Qe=String.raw,Co={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};Co.bugFlagVLiteralHyphenIsRange=Co.unicodeSets?(()=>{try{new RegExp(Qe`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Co.bugNestedClassIgnoresNegation=Co.unicodeSets&&new RegExp("[[^a]]","v").test("a");function n0(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function tu(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function n1(e,t){return Pw[e]>=Pw[t]}function hV(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Pw={ES2025:2025,ES2024:2024,ES2018:2018},mV={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Bx(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!mV[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Co.flagGroups?"ES2025":Co.unicodeSets?"ES2024":"ES2018"),t}var pV="[ -\r ]",gV=new Set([kn(304),kn(305)]),oo=Qe`[\p{L}\p{M}\p{N}\p{Pc}]`;function qx(e){if(gV.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=yV.get(n),o=vV.get(n),s=bV.get(n);return[...r].length===1&&t.add(r),s&&t.add(s),i&&t.add(i),t.add(n),o&&t.add(o),[...t]}var Sb=new Map(`C Other Cc Control cntrl Cf Format Cn Unassigned Co Private_Use Cs Surrogate L Letter LC Cased_Letter Ll Lowercase_Letter Lm Modifier_Letter Lo Other_Letter Lt Titlecase_Letter Lu Uppercase_Letter M Mark Combining_Mark Mc Spacing_Mark Me Enclosing_Mark Mn Nonspacing_Mark N Number Nd Decimal_Number digit Nl Letter_Number No Other_Number P Punctuation punct Pc Connector_Punctuation Pd Dash_Punctuation Pe Close_Punctuation Pf Final_Punctuation Pi Initial_Punctuation Po Other_Punctuation Ps Open_Punctuation S Symbol Sc Currency_Symbol Sk Modifier_Symbol Sm Math_Symbol So Other_Symbol Z Separator Zl Line_Separator Zp Paragraph_Separator Zs Space_Separator ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component EComp Emoji_Modifier EMod Emoji_Modifier_Base EBase Emoji_Presentation EPres Extended_Pictographic ExtPict Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`.split(/\s/).map(e=>[mh(e),e])),vV=new Map([["s",kn(383)],[kn(383),"s"]]),bV=new Map([[kn(223),kn(7838)],[kn(107),kn(8490)],[kn(229),kn(8491)],[kn(969),kn(8486)]]),yV=new Map([Go(453),Go(456),Go(459),Go(498),...dp(8072,8079),...dp(8088,8095),...dp(8104,8111),Go(8124),Go(8140),Go(8188)]),wV=new Map([["alnum",Qe`[\p{Alpha}\p{Nd}]`],["alpha",Qe`\p{Alpha}`],["ascii",Qe`\p{ASCII}`],["blank",Qe`[\p{Zs}\t]`],["cntrl",Qe`\p{Cc}`],["digit",Qe`\p{Nd}`],["graph",Qe`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Qe`\p{Lower}`],["print",Qe`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Qe`[\p{P}\p{S}]`],["space",Qe`\p{space}`],["upper",Qe`\p{Upper}`],["word",Qe`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Qe`\p{AHex}`]]);function kV(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Go(e){const t=kn(e);return[t.toLowerCase(),t]}function dp(e,t){return kV(e,t).map(n=>Go(n))}var Wx=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function xV(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Zx(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:n1(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};zc(e,SV,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};zc(e,_V,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return zc(e,CV,s),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var SV={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const o=pi();o.body[0].body.push(Rs({negate:!0,body:r}),qa("Any"));const s=pi();s.body[0].body.push(zx("greedy",0,1/0,o)),n(rn(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o\r\n|${i?Qe`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Ko(qa("AHex",{negate:c}),t));else if(l==="newline")n(rn(so(c?`[^ ]`:`(?>\r ?|[ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${kn(d.codePointAt(0)-1)}${kn(d.codePointAt(2)+1)}-􏿿`),n(rn(so(`[${d}]`),t))}else n(rn(mp(so(wV.get(u)),c),t));else if(l==="property")Sb.has(mh(u))||(e.key="sc");else if(l==="space")n(Ko(qa("space",{negate:c}),t));else if(l==="word")n(rn(mp(so(oo),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=pi({flags:l});c.body[0].body=s(),i(rn(c,t),{traverse:!0})}else if(a==="keep"){const c=n.body[0],d=n.body.length===1&&Dx(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(Qe`Uses "\K" in a way that's unsupported`);const f=Rs({behind:!0});f.body[0].body=o(),i(rn(f,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(rn(Rs({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=pi();t.body[0].body.push(e.body),e.body=rn(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=Jx(o.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):i=!0}r&&!i&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Qe`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!hp(n)&&(n=fp(n,t),e.ref=n)}},_V={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){const c=i.get(e);if(c&&a.has(e.number)){const d=Ko(Dw(e.number),t);l.set(d,a.get(e.number)),n(d);return}a.set(e.number,e),s.set(e.number,[]),e.name&&tu(s,e.name,[]);const u=s.get(e.name??e.number);for(let d=0;df.type==="Group"&&!!f.flags)),d=u?n0(r.globalFlags,u):r.globalFlags;IV(d,r.currentFlags)||(c=pi({flags:$V(d)}),c.body[0].body.push(l))}n(rn(c,t),{traverse:!a})}},CV={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(s=>EV(s,e));if(!o.length)n(rn(Rs({negate:!0}),t));else if(o.length>1){const s=pi({atomic:!0,body:o.reverse().map(a=>Xs({body:[Qg(a.number)]}))});n(rn(s,t))}else e.ref=o[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function $V({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Yx(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Jx(e){const t=e.find(n=>n.kind==="search_start"||MV(n,{negate:!1})||!LV(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=Jx(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function Xx(e,t){const n=Yx(e)??[];for(const r of n)if(r===t||Xx(r,t))return!0;return!1}function LV({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function AV(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function MV(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Dx(e.body[0],{type:"Assertion",kind:"search_start"})}function hp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function so(e,t){const r=Rx(e,{...t,unicodePropertyMap:Sb}).body;return r.length>1||r[0].body.length>1?pi({body:r}):r[0].body[0]}function mp(e,t){return e.negate=t,e}function Ko(e,t){return e.parent=t,e}function rn(e,t){return Zx(e),e.parent=t,e}function OV(e,t){const n=Bx(t),r=n1(n.target,"ES2024"),i=n1(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,a=null;if(!i){const h=[e.flags.ignoreCase];zc(e,PV,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(m){h.push(m)},setHasCasedChar(){h.at(-1)?s=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)};let c=e;const u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(h){return u.lastNode=c,c=h,hV(DV[h.type],`Unexpected node type "${h.type}"`)(h,u,d)}const f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((h,m)=>{h.hidden&&f._hiddenCaptures.push(m),h.transferTo&&tu(f._captureTransfers,h.transferTo,[]).push(m)}),f}var PV={"*":{enter({node:e},t){if(Nw(e)){const n=t.getCurrentModI();t.pushModI(e.flags?n0({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Nw(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){_b(kn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Qx(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Wx.has(e.value)&&t.setHasCasedChar()}},DV={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Qe`\B`:Qe`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(s.hidden=!0,o>a.number&&(s.transferTo=a.number)),t.captureMap.set(o,s),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=kn(e),r=La(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&_b(n)){const i=qx(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:o}=e;let{body:s}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Co.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(zw)&&(s=[hh(45),...s.filter(c=>!zw(c))]);const a=()=>`[${i?"^":""}${s.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Co.bugNestedClassIgnoresNegation)&&!i){const u=s.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){const d=pi(),f=d.body[0];return d.parent=o,f.parent=d,s=s.filter(h=>!u.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):d.body.pop(),u.forEach(h=>{const m=Xs({body:[h]});h.parent=m,m.parent=d,d.body.push(m)}),n(d)}}t.inCharClass=!0;const c=a();return t.inCharClass=!1,c}const l=s[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(Co.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=La(n,i),s=La(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=Qx(e);FV(l).forEach(u=>{a.add(Array.isArray(u)?`${La(u[0],i)}-${La(u[1],i)}`:La(u,i))})}return`${o}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Qe`[^\n]`;if(e==="digit")return t?Qe`\D`:Qe`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Wx.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Qe`\P`:Qe`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Qe`\W`:Qe`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,o){const s=i.currentFlags;n&&(i.currentFlags=n0(s,n));const a=t.map(o).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${HV(e,n,i.useFlagMods)}${a})`;return i.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+VV(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Qe`\g<${t}&R=${r}>`}},RV=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),NV=new Set(["-","\\","]","^","["]),zV=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Rw=new Map([[9,Qe`\t`],[10,Qe`\n`],[11,Qe`\v`],[12,Qe`\f`],[13,Qe`\r`],[8232,Qe`\u2028`],[8233,Qe`\u2029`],[65279,Qe`\uFEFF`]]),jV=/^\p{Cased}$/u;function _b(e){return jV.test(e)}function Qx(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,o=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return o;for(let s=r;s<=i;s++){const a=kn(s);if(!_b(a))continue;const l=qx(a).filter(c=>{const u=c.codePointAt(0);return ui});if(l.length&&(o.push(...l),n))break}return o}function La(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Rw.has(e))return Rw.get(e);if(e<32||e>126&&e<160||e>262143||t&&UV(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?zV:NV:RV,o=kn(e);return(i.has(o)?"\\":"")+o}function FV(e){const t=e.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),n=[];let r=null;for(let i=0;i";let r="";if(t&&n){const{enable:i,disable:o}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function VV({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Nw({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function UV(e){return e>47&&e<58}function zw({type:e,value:t}){return e==="Character"&&t===45}var BV=class r1 extends RegExp{#e=new Map;#n=null;#t;#i=null;#r=null;rawOptions={};get source(){return this.#t||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#t=o.source,o instanceof r1&&(this.#e=o.#e,this.#i=o.#i,this.#r=o.#r,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#t=t,this.#e=WV(o.hiddenCaptures,o.transfers),this.#r=o.strategy,this.rawOptions=r??{}}i||(this.#n=this)}exec(t){if(!this.#n){const{lazyCompile:i,...o}=this.rawOptions;this.#n=new r1(this.#t,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#o(t.slice(r));return i&&(qV(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#o(t)}#o(t){this.#n.lastIndex=this.lastIndex;const n=super.exec.call(this.#n,t);if(this.lastIndex=this.#n.lastIndex,!n||!this.#e.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s{const a=o[s];a&&(o[s]=[a[0]+t,a[1]+t])})}}function WV(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const o of i)tu(n,o,{}).transferTo=r;return n}function ZV(e){const t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:a,name:l}}=o;s==="["?r++:r?s==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function GV(e,t){const n=KV(e,t);return n.options?new BV(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function KV(e,t){const n=Bx(t),r=Rx(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Sb}),i=xV(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=OV(i,n),s=dV(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=cV(s.pattern),l=lV(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=l.hiddenCaptures.sort((m,p)=>m-p),d=Array.from(l.captureTransfers),f=i._strategy,h=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||f||h)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...f&&{strategy:f},...h&&{lazyCompile:h}})}return c}const jw=4294967295;class YV{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:o}=n;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(s=>{if(typeof s!="string")return s;const a=i?.get(s);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=o(s);return i?.set(s,l),l}catch(l){if(i?.set(s,l),r)return null;throw l}})}regexps;findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,o=[];function s(a,l,c=0){return{index:a,captureIndices:l.indices.map(u=>u==null?{start:jw,end:jw,length:0}:{start:u[0]+c,end:u[1]+c,length:u[1]-u[0]})}}for(let a=0;al[1].index));for(const[l,c,u]of o)if(c.index===a)return s(l,c,u)}return null}}function JV(e,t){return GV(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function XV(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>JV(n,{target:t.target}),{createScanner(n){return new YV(n,t)},createString(n){return{content:n}}}}const r0="diffs-container",QV=/(?=^diff --git)/gm,eU=/(?=^@@ )/gm,tU=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,wf=/(?<=\n)/,nU=/^(---|\+\+\+)\s+([^\t\r\n]+)/,rU=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,iU=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,oU=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Cb="header-prefix",Ib="header-metadata",Yn={dark:"pierre-dark",light:"pierre-light"},Eb="data-unsafe-css",il=1,Tb={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,hunkSeparatorHeight:32,fileGap:8},sU=Object.freeze({fromStart:0,fromEnd:0}),i0={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},e9={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Fw(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Mo(e){return{type:"text",value:e}}function at({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function o0({name:e,width:t=16,height:n=16,properties:r}){return at({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[at({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function aU(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Xa(e){return at({tagName:"div",properties:{"data-gutter":""},children:e})}function t9(e,t,n){return at({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n},children:t!=null?[at({tagName:"span",properties:{"data-line-number-content":""},children:[Mo(`${t}`)]})]:void 0})}function Vr(e,t,n){return at({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function lU(){return at({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[o0({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function cU(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var n9=class{hoveredLine;pre;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e){const t=!(e===this.selectedRange||Fw(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode==="diff"&&this.hoveredLine.type==="diff-line")return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode==="file"&&this.hoveredLine.type==="line")return{lineNumber:this.hoveredLine.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:r}=this.options;t==null&&n==null&&r==null||this.options.onGutterUtilityClick!=null&&Uw(e.composedPath())||(ao(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:r,enableGutterUtility:i=!1}=this.options;t==="disabled"&&!i&&n==null&&r==null||(ao(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(ao(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null){ao(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no .hoveredLine");return}this.gutterUtilityContainer?.remove(),this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,r=t.composedPath();ao(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});const i=this.resolvePointerTarget(r);ao(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",i);const{onLineClick:o,onLineNumberClick:s,onLineEnter:a,onLineLeave:l,onHunkExpand:c}=this.options;switch(e){case"move":if(cc(i)&&this.hoveredLine?.lineElement===i.lineElement)break;this.hoveredLine!=null&&(this.gutterUtilityContainer?.remove(),l?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),cc(i)&&(this.setHoveredLine(this.toEventBaseProps(i)),this.gutterUtilityContainer!=null&&i.numberElement.appendChild(this.gutterUtilityContainer),a?.({...this.hoveredLine,event:t}));break;case"click":{if(i==null)break;if(dU(i)&&c!=null){c(i.hunkIndex,i.direction,t.shiftKey);break}if(!cc(i))break;const u=this.toEventBaseProps(i);s!=null&&i.numberColumn?s({...u,event:t}):o?.({...u,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:i,onLineEnter:o,onLineLeave:s,onHunkExpand:a,enableGutterUtility:l=!1,enableLineSelection:c=!1,onGutterUtilityClick:u}=this.options,d=u!=null,f=n!=="disabled"||r!=null||i!=null||a!=null||o!=null||s!=null||l||c||d;f&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,ao(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const p=[];return(t==="both"||t==="click")&&(r!=null&&p.push("onLineClick"),i!=null&&p.push("onLineNumberClick"),a!=null&&p.push("expandable hunk separators")),p})()),ao(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),ao(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!f&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const h=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",m=this.pointerSession.mode==="gutterSelecting";(!c&&h||!d&&m)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Uw(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e,t):this.startLineSelectionFromPointerDown(e,t)};startLineSelectionFromPointerDown(e,t){const{enableLineSelection:n=!1}=this.options;if(!n)return;const r=this.getSelectionPointerInfo(t,!0);if(r==null)return;const{pre:i}=this;if(i==null)return;e.preventDefault();const{lineNumber:o,eventSide:s,lineIndex:a}=r;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const c=l.start<=l.end?a>=l.start:a<=l.end;this.selectionAnchor={lineNumber:c?this.selectedRange.start:this.selectedRange.end,side:c?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(o,s,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===o&&this.selectedRange?.end===o){const l={lineNumber:o,side:s};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.selectedRange=null,this.selectionAnchor={lineNumber:o,side:s},this.updateSelection(o,s,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e,t){const{enableLineSelection:n=!1,onGutterUtilityClick:r}=this.options;if(r==null)return;const i=this.getSelectionPointFromPath(t);i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:i,current:i},n&&(this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.selectedRange)),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointFromPath(e.composedPath());if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointerInfo(e.composedPath(),!1);if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointerInfo(e.composedPath(),!1);if(n==null||this.selectionAnchor==null)return;const r={lineNumber:n.lineNumber,side:n.eventSide};if(cU(this.pointerSession.pending,r))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.selectedRange),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;const r=this.getSelectionPointFromPath(e.composedPath());r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=Bi(lU());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}getSelectionPointerInfo(e,t){const n=this.resolvePointerTarget(e);if(cc(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}getSelectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(cc(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}updateSelection(e,t,n=!0){const{selectedRange:r}=this;let i;if(e==null)i=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(s,e,o,t)}Fw(r??void 0,i??void 0)||(this.selectedRange=i,n&&this.notifySelectionChangeDelta(),this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection))}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const a of e)a.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const i=r.start===r.end,o=Math.min(r.start,r.end),s=Math.max(r.start,r.end);for(const a of t){const[l,c]=a.children,u=c.children.length;if(u!==l.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let d=0;ds)break;if(m==null||m{switch(n){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return r.hasAttribute("data-deletions")?"deletions":"additions"}})();return{kind:"line",lineType:n,lineElement:i,lineNumber:l,numberColumn:t,numberElement:s,side:u,splitLineIndex:c}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(r=>Number.parseInt(r,10)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function s0({enableGutterUtility:e,enableHoverUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:o,onLineLeave:s,onLineNumberClick:a,renderGutterUtility:l,renderHoverUtility:c,__debugPointerEvents:u,enableLineSelection:d,onLineSelected:f,onLineSelectionStart:h,onLineSelectionChange:m,onLineSelectionEnd:p},g,b){return{enableGutterUtility:uU({enableGutterUtility:e,enableHoverUtility:t,renderGutterUtility:l,renderHoverUtility:c,onGutterUtilityClick:r}),usesCustomGutterUtility:l!=null||c!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:g,onLineClick:i,onLineEnter:o,onLineLeave:s,onLineNumberClick:a,__debugPointerEvents:u,enableLineSelection:d,onLineSelected:f,onLineSelectionStart:h,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:b}}function uU({enableGutterUtility:e,enableHoverUtility:t,renderGutterUtility:n,renderHoverUtility:r,onGutterUtilityClick:i}){if(e!==void 0&&t!==void 0)throw new Error("Cannot use both 'enableGutterUtility' and deprecated 'enableHoverUtility'. Use only 'enableGutterUtility'.");if(n!=null&&r!=null)throw new Error("Cannot use both 'renderGutterUtility' and deprecated 'renderHoverUtility'. Use only 'renderGutterUtility'.");if(i!=null&&(n!=null||r!=null))throw new Error("Cannot use both 'onGutterUtilityClick' and render utility callbacks ('renderGutterUtility'/'renderHoverUtility'). Use only one gutter utility API.");return e??t??!1}function cc(e){return e!=null&&"kind"in e&&e.kind==="line"}function dU(e){return"type"in e&&e.type==="line-info"}function Hw(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Vw(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function Uw(e){for(const t of e)if(t instanceof HTMLElement&&t.hasAttribute("data-utility-button"))return!0;return!1}function ao(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var r9=class{observedNodes=new Map;timeoutID;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.timeoutID!=null&&clearTimeout(this.timeoutID)}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=e.querySelectorAll("code"),r=new Map(this.observedNodes);this.observedNodes.clear();for(const i of n){let o=r.get(i);if(o!=null){this.observedNodes.set(i,o),r.delete(i);continue}let s=i.querySelector("[data-gutter]");s instanceof HTMLElement||(s=null),o={type:"code",codeElement:i,numberElement:s,codeWidth:"auto",numberWidth:0},this.observedNodes.set(i,o),this.resizeObserver.observe(i),s!=null&&(this.observedNodes.set(s,o),this.resizeObserver.observe(s))}if(n.length>1&&!t){const i=e.querySelectorAll('[data-line-annotation*=","]'),o=new Map;for(const s of i){if(!(s instanceof HTMLElement))continue;const{lineAnnotation:a=""}=s.dataset;if(!/^\d+,\d+$/.test(a)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:a,element:s});continue}let l=o.get(a);l==null&&(l=[],o.set(a,l)),l.push(s)}for(const[s,a]of o){if(a.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",s,a);continue}const[l,c]=a,u=l.firstElementChild,d=c.firstElementChild;if(!(l instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(d instanceof HTMLElement))continue;let f=r.get(u);if(f!=null){this.observedNodes.set(u,f),this.observedNodes.set(d,f),r.delete(u),r.delete(d);continue}f={type:"annotations",column1:{container:l,child:u,childHeight:u.getBoundingClientRect().height},column2:{container:c,child:d,childHeight:d.getBoundingClientRect().height},currentHeight:"auto"};const h=Math.max(f.column1.childHeight,f.column2.childHeight);this.applyNewHeight(f,h),this.observedNodes.set(u,f),this.observedNodes.set(d,f),this.resizeObserver.observe(u),this.resizeObserver.observe(d)}}for(const i of r.keys())i.isConnected&&(i.style.removeProperty("--diffs-column-content-width"),i.style.removeProperty("--diffs-column-number-width"),i.style.removeProperty("--diffs-column-width"),i.parentElement instanceof HTMLElement&&i.parentElement.style.removeProperty("--diffs-annotation-min-height")),this.resizeObserver.unobserve(i);r.clear()}handleResizeObserver=e=>{for(const t of e){const{target:n,borderBoxSize:r}=t;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",t);continue}const i=this.observedNodes.get(n);if(i==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",t);continue}const o=r[0];if(i.type==="annotations"){const s=(()=>{if(n===i.column1.child)return i.column1;if(n===i.column2.child)return i.column2})();if(s==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:i,target:n});continue}s.childHeight=o.blockSize;const a=Math.max(i.column1.childHeight,i.column2.childHeight);this.applyNewHeight(i,a)}else i.type==="code"&&(this.queuedUpdates.set(n,[i,o]),this.queueColumnUpdate())}};queueColumnUpdate(){this.timeoutID!=null&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(this.handleColumnChange,1e3/30)}handleColumnChange=()=>{this.timeoutID=void 0;for(const[e,[t,n]]of this.queuedUpdates)if(e===t.codeElement){const r=Math.max(Math.floor(n.inlineSize),0);if(r!==t.codeWidth){t.codeWidth=r;const i=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty("--diffs-column-content-width",`${i===0?"auto":`${i}px`}`),t.codeElement.style.setProperty("--diffs-column-width",`${t.codeWidth===0?"auto":`${t.codeWidth}px`}`)}}else if(e===t.numberElement){const r=Math.max(Math.ceil(n.inlineSize),0);if(r!==t.numberWidth&&(t.numberWidth=r,t.codeElement.style.setProperty("--diffs-column-number-width",`${t.numberWidth===0?"auto":`${t.numberWidth}px`}`),t.codeWidth!=="auto")){const i=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty("--diffs-column-content-width",`${i===0?"auto":`${i}px`}`)}}this.queuedUpdates.clear()};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`),e.column2.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`))}};const Qs=new Map,pp=new Map,fU=new Map,i1=new Set;function a0(e){for(const t of Array.isArray(e)?e:[e])if(!i1.has(t))return!1;return!0}function Bw(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(i1.has(n.name))continue;let r=Qs.get(n.name);r==null&&(r=n,Qs.set(n.name,r)),i1.add(r.name),t.loadLanguageSync(r.data)}}function i9(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function o9(e){if(i9())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=pp.get(e);if(t!=null)return t;try{let n=fU.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(eu,e)&&(n=eu[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const r=n().then(({default:i})=>{const o={name:e,data:i};return Qs.has(e)||Qs.set(e,o),o});return pp.set(e,r),await r}finally{pp.delete(e)}}function s9(e){return Qs.get(e)??o9(e)}const Io=new Map,gp=new Map,o1=new Map,s1=new Set;function a1(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=Io.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,Io.has(n)||Io.set(n,r);s1.has(n)||(s1.add(n),t.loadThemeSync(r))}}async function a9(e){if(i9())throw new Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=gp.get(e);if(t!=null)return t;try{const n=o1.get(e)??Ex[e];if(n==null)throw new Error(`resolveTheme: No valid loader for ${e}`);const r=n().then(o=>hU(e,"default"in o?o.default:o));gp.set(e,r);const i=await r;if(i.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${i.name}`);return Io.set(i.name,i),i}finally{gp.delete(e)}}function hU(e,t){const n=Io.get(e);return n??(t=uh(t),Io.set(e,t),t)}function l9(e){return Io.get(e)??a9(e)}function $b(e,t){if(o1.has(e)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}o1.set(e,t)}let zi;async function gl({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){zi??=fH({themes:[],langs:["text"],engine:n==="shiki-wasm"?$x(P(()=>import("./wasm-CG6Dc4jp.js"),[])):XV()});const r=mU(zi)?await zi:zi;zi=r;const i=[];for(const s of t){if(s==="text"||s==="ansi")continue;const a=s9(s);"then"in a?i.push(a):Bw(a,r)}const o=[];for(const s of e){const a=l9(s);"then"in a?o.push(a):a1(a,zi)}return(i.length>0||o.length>0)&&await Promise.all([Promise.all(i).then(s=>{Bw(s,r)}),Promise.all(o).then(s=>{a1(s,r)})]),r}function c9(){if(zi!=null&&!("then"in zi))return zi}function mU(e=zi){return e!=null&&"then"in e}$b("pierre-dark",async()=>{const e=await P(()=>import("./pierre-dark-ClCaJvdG.js"),[]);return{...e.default??e,name:"pierre-dark"}});$b("pierre-light",async()=>{const e=await P(()=>import("./pierre-light-zjGsWSiE.js"),[]);return{...e.default??e,name:"pierre-light"}});function nu(e=Yn){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function jc(e){for(const t of nu(e))if(!s1.has(t))return!1;return!0}function l1(e){for(const t of e)if(!Io.has(t))return!1;return!0}function gh(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Lb(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function kf(e){return at({tagName:"div",children:[at({tagName:"div",children:e.annotations?.map(t=>at({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function pU(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function u9({fileOrDiff:e,themeStyles:t,themeType:n}){const r="type"in e?e:void 0,i={"data-diffs-header":"","data-change-type":r?.type,"data-theme-type":n!=="system"?n:void 0,style:t};return at({tagName:"div",children:[gU({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),vU(r)],properties:i})}function gU({name:e,prevName:t,iconType:n}){const r=[at({tagName:"slot",properties:{name:Cb}}),o0({name:pU(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(at({tagName:"div",children:[Mo(t)],properties:{"data-prev-name":""}})),r.push(o0({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(at({tagName:"div",children:[Mo(e)],properties:{"data-title":""}})),at({tagName:"div",children:r,properties:{"data-header-content":""}})}function vU(e){const t=[];if(e!=null){let n=0,r=0;for(const i of e.hunks)n+=i.additionLines,r+=i.deletionLines;(r>0||n===0)&&t.push(at({tagName:"span",children:[Mo(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(at({tagName:"span",children:[Mo(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(at({tagName:"slot",properties:{name:Ib}})),at({tagName:"div",children:t,properties:{"data-metadata":""}})}function d9(e){return at({tagName:"pre",properties:bU(e)})}function bU({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,themeType:o,themeStyles:s,totalLines:a,type:l}){const c={"data-diff":l==="diff"?"":void 0,"data-file":l==="file"?"":void 0,"data-diff-type":l==="diff"?i?"split":"single":void 0,"data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,"data-theme-type":o!=="system"?o:void 0,style:s,tabIndex:0};return c.style+=`--diffs-min-number-column-width-default:${`${a}`.length}ch;`,c}const Aa=new Map,uc={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Yr(e){if(Aa.has(e))return Aa.get(e)??"text";if(uc[e]!=null)return uc[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Aa.has(t[1]))return Aa.get(t[1])??"text";if(uc[t[1]]!=null)return uc[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Aa.has(n)?Aa.get(n)??"text":uc[n]??"text"}function f9(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:nu(t),preferredHighlighter:n}}function ea(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function ta(e){return e.replace(/\n$|\r\n$/,"")}function yU(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(r==null){const i=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(i,{node:e,line:t,state:n}),new Error(i)}return e.tagName="div",e.properties["data-line"]=r.lineNumber,e.properties["data-alt-line"]=r.altLineNumber,e.properties["data-line-type"]=r.type,e.properties["data-line-index"]=r.lineIndex,e.children.length===0&&e.children.push(Mo(` `)),e}function wU(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=e,i=new Map;function o(a){return Object.entries(a).map(([l,c])=>`${l}:${c}`).join(";")}function s(a){const l=typeof a=="string"?a:o(a);let c=t+kU(l)+n;return c=r(c),i.has(c)||i.set(c,typeof a=="string"?a:{...a}),c}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=s(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const c of l){if(!c.htmlStyle)continue;const u=s(c.htmlStyle);c.htmlStyle={},c.htmlAttrs||={},c.htmlAttrs.class?c.htmlAttrs.class+=` ${u}`:c.htmlAttrs.class=u}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,c]of i.entries())a+=`.${l}{${typeof c=="string"?c:o(c)}}`;return a},clearRegistry(){i.clear()}}}function kU(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,o;i>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function h9(e=!1){const t={lineInfo:[]},n=[{line(r){return delete r.properties.class,r},pre(r){const i=aU(r),o=[];if(i!=null){let s=1;for(const a of i.children)a.type==="element"&&(o.push(yU(a,s,t)),s++);i.children=o}return r}}];return e&&n.push(xU,qw),{state:t,transformers:n,toClass:qw}}const qw=wU({classPrefix:"hl-"}),xU={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function xr(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function m9({theme:e=Yn,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const i=t.getTheme(e);r+=`color:${i.fg};`,r+=`background-color:${i.bg};`,r+=`${xr("global")}fg:${i.fg};`,r+=`${xr("global")}bg:${i.bg};`,r+=vp(i,n)}else{let i=t.getTheme(e.dark);r+=`${xr("global")}dark:${i.fg};`,r+=`${xr("global")}dark-bg:${i.bg};`,r+=vp(i,"dark"),i=t.getTheme(e.light),r+=`${xr("global")}light:${i.fg};`,r+=`${xr("global")}light-bg:${i.bg};`,r+=vp(i,"light")}return r}function vp(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${xr("global")}${t}addition-color:${r};`);const i=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];i!=null&&(n+=`${xr("global")}${t}deletion-color:${i};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(n+=`${xr("global")}${t}modified-color:${o};`),n}function c1(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function l0({lines:e,startingLine:t=0,totalLines:n=1/0,callback:r}){const i=Math.min(t+n,e.length),o=(()=>{const s=e.at(-1);return s===""||s===` `||s===`\r `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s0||s<1/0,{state:c,transformers:u}=h9(),d=i?"text":e.lang??Yr(e.name),f=(()=>{if(typeof n=="string")return t.getTheme(n).type})(),h=m9({theme:n,highlighter:t});c.lineInfo=b=>({type:"context",lineIndex:b-1+o,lineNumber:b+o});const m=typeof n=="string"?{lang:d,theme:n,transformers:u,defaultColor:!1,cssVariablePrefix:xr("token"),tokenizeMaxLineLength:r}:{lang:d,themes:n,transformers:u,defaultColor:!1,cssVariablePrefix:xr("token"),tokenizeMaxLineLength:r},p=c1(t.codeToHast(l?_U(a??u1(e.contents),o,s):ta(e.contents),m)),g=l?new Array(o):p;return l&&g.push(...p),{code:g,themeStyles:h,baseThemeType:f}}function _U(e,t,n){let r="";return l0({lines:e,startingLine:t,totalLines:n,callback({content:i}){r+=i}}),r}function g9(e,t){return at({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}let CU=-1;var IU=class{__id=`file-renderer:${++CU}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:Yn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=jc(e.theme??Yn)?c9():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&this.mergeOptions({themeType:e})}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0,this.lineCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getFileResultCache(e);n!=null&&!bp(t,n.options)&&(n=void 0),this.renderCache??={file:e,options:t,highlighted:!0,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightFileAST(this,e):this.asyncHighlight(e).then(({result:r,options:i})=>{this.onHighlightSuccess(e,r,i)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:r=Yn,tokenizeMaxLineLength:i=1e3}=this.options;return{theme:r,tokenizeMaxLineLength:i}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.file||!bp(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,u1(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:u1(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=i0){if(e==null)return;const n=this.workerManager?.getFileResultCache(e);n!=null&&this.renderCache==null&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...n});const{options:r,forceRender:i}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:r,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!gh(this.renderCache.renderRange,t))&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,this.getOrCreateLineCache(e)),this.renderCache.renderRange=t),t.totalLines>0&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Yr(e.name);const o=this.highlighter!=null&&jc(r.theme),s=this.highlighter!=null&&a0(this.computedLang);if(this.highlighter!=null&&o&&(i||!this.renderCache.highlighted&&s||this.renderCache.result==null)){const{result:a,options:l}=this.renderFileWithHighlighter(e,this.highlighter,!s);this.renderCache={file:e,options:l,highlighted:s,result:a,renderRange:void 0}}(!o||!s)&&this.asyncHighlight(e).then(({result:a,options:l})=>{this.onHighlightSuccess(e,a,l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=i0){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){this.computedLang=e.lang??Yr(e.name);const t=this.highlighter!=null&&l1(nu(this.options.theme)),n=this.highlighter!=null&&a0(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:p9(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){const{disableFileHeader:o=!1}=this.options,s=[],a=Xa(),l=this.getOrCreateLineCache(e);let c=0;return l0({lines:l,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:u,lineNumber:d})=>{const f=n[u];if(f==null){const h="FileRenderer.processFileResult: Line doesnt exist";throw console.error(h,{name:e.name,lineIndex:u,lineNumber:d,lines:l}),new Error(h)}if(f!=null){a.children.push(t9("context",d,`${u}`)),s.push(f),c++;const h=this.lineAnnotations[d];h!=null&&(a.children.push(Vr("context","annotation",1)),s.push(kf({hunkIndex:0,lineIndex:d,annotations:h.map(m=>ea(m))})),c++)}}}),a.properties.style=`grid-row: span ${c}`,{gutterAST:a.children??[],contentAST:s,preAST:this.createPreElement(l.length,r,i),headerAST:o?void 0:this.renderHeader(e,r,i),totalLines:l.length,rowCount:c,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e,t,n){const{themeType:r="system"}=this.options;return u9({fileOrDiff:e,themeStyles:t,themeType:n??r})}renderFullHTML(e){return Bi(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(at({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Xa();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,g9(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return Bi(t?at({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await gl(f9(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.file!==e||!this.renderCache.highlighted||!bp(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e,t,n){const{disableLineNumbers:r=!1,overflow:i="scroll",themeType:o="system"}=this.options;return d9({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:r,overflow:i,themeStyles:t,themeType:n??o,split:!1,totalLines:e})}};function bp(e,t){return Lb(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}const v9=``;function c0(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function EU(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function b9(e,t){return e==null||t==null?e===t:e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.themeStyles===t.themeStyles&&e.themeType===t.themeType&&e.totalLines===t.totalLines}function y9(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function w9(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e}function k9(){const e=document.createElement("style");return e.setAttribute(Eb,""),e}var TU=`@layer base, theme, unsafe; @layer base { :host { --diffs-bg: #fff; --diffs-fg: #000; --diffs-font-fallback: 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; --diffs-header-font-fallback: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif; --diffs-mixer: light-dark(black, white); --diffs-gap-fallback: 8px; /* // Available CSS Color Overrides --diffs-bg-buffer-override --diffs-bg-hover-override --diffs-bg-context-override --diffs-bg-separator-override --diffs-fg-number-override --diffs-fg-number-addition-override --diffs-fg-number-deletion-override --diffs-deletion-color-override --diffs-addition-color-override --diffs-modified-color-override --diffs-bg-deletion-override --diffs-bg-deletion-number-override --diffs-bg-deletion-hover-override --diffs-bg-deletion-emphasis-override --diffs-bg-addition-override --diffs-bg-addition-number-override --diffs-bg-addition-hover-override --diffs-bg-addition-emphasis-override // Line Selection Color Overrides (for enableLineSelection) --diffs-selection-color-override --diffs-bg-selection-override --diffs-bg-selection-number-override --diffs-bg-selection-background-override --diffs-bg-selection-number-background-override // Available CSS Layout Overrides --diffs-gap-inline --diffs-gap-block --diffs-gap-style --diffs-tab-size */ color-scheme: light dark; display: block; font-family: var( --diffs-header-font-family, var(--diffs-header-font-fallback) ); font-size: var(--diffs-font-size, 13px); line-height: var(--diffs-line-height, 20px); font-feature-settings: var(--diffs-font-features); } /* NOTE(mdo): Some semantic HTML elements (e.g. \`pre\`, \`code\`) have default * user-agent styles. These must be overridden to use our custom styles. */ pre, code, [data-error-wrapper] { isolation: isolate; margin: 0; padding: 0; display: block; outline: none; font-family: var(--diffs-font-family, var(--diffs-font-fallback)); } pre, code { background-color: var(--diffs-bg); } code { contain: content; } *, *::before, *::after { box-sizing: border-box; } [data-icon-sprite] { display: none; } /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset * their font-family explicitly. */ [data-diffs-header], [data-separator] { font-family: var( --diffs-header-font-family, var(--diffs-header-font-fallback) ); } [data-file-info] { padding: 10px; font-weight: 700; color: var(--fg); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ background-color: color-mix(in lab, var(--bg) 98%, var(--fg)); border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg)); } [data-diffs-header], [data-diff], [data-file], [data-error-wrapper], [data-virtualizer-buffer] { --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg)); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ --diffs-bg-buffer: var( --diffs-bg-buffer-override, light-dark( color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)) ) ); --diffs-bg-hover: var( --diffs-bg-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer)) ) ); --diffs-bg-context: var( --diffs-bg-context-override, light-dark( color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer)) ) ); --diffs-bg-context-number: var( --diffs-bg-context-number-override, light-dark( color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg)) ) ); --diffs-bg-separator: var( --diffs-bg-separator-override, light-dark( color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer)) ) ); --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark)); --diffs-fg-number: var( --diffs-fg-number-override, light-dark( color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)) ) ); --diffs-deletion-base: var( --diffs-deletion-color-override, light-dark( var( --diffs-light-deletion-color, var(--diffs-deletion-color, rgb(255, 0, 0)) ), var( --diffs-dark-deletion-color, var(--diffs-deletion-color, rgb(255, 0, 0)) ) ) ); --diffs-addition-base: var( --diffs-addition-color-override, light-dark( var( --diffs-light-addition-color, var(--diffs-addition-color, rgb(0, 255, 0)) ), var( --diffs-dark-addition-color, var(--diffs-addition-color, rgb(0, 255, 0)) ) ) ); --diffs-modified-base: var( --diffs-modified-color-override, light-dark( var( --diffs-light-modified-color, var(--diffs-modified-color, rgb(0, 0, 255)) ), var( --diffs-dark-modified-color, var(--diffs-modified-color, rgb(0, 0, 255)) ) ) ); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ --diffs-bg-deletion: var( --diffs-bg-deletion-override, light-dark( color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-number: var( --diffs-bg-deletion-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-hover: var( --diffs-bg-deletion-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-emphasis: var( --diffs-bg-deletion-emphasis-override, light-dark( rgb(from var(--diffs-deletion-base) r g b / 0.15), rgb(from var(--diffs-deletion-base) r g b / 0.2) ) ); --diffs-bg-addition: var( --diffs-bg-addition-override, light-dark( color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-number: var( --diffs-bg-addition-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-hover: var( --diffs-bg-addition-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-emphasis: var( --diffs-bg-addition-emphasis-override, light-dark( rgb(from var(--diffs-addition-base) r g b / 0.15), rgb(from var(--diffs-addition-base) r g b / 0.2) ) ); --diffs-selection-base: var(--diffs-modified-base); --diffs-selection-number-fg: light-dark( color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)) ); --diffs-bg-selection: var( --diffs-bg-selection-override, light-dark( color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)) ) ); --diffs-bg-selection-number: var( --diffs-bg-selection-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)), color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base)) ) ); background-color: var(--diffs-bg); color: var(--diffs-fg); } [data-diff], [data-file] { /* This feels a bit crazy to me... so I need to think about it a bit more... */ --diffs-grid-number-column-width: minmax(min-content, max-content); --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr; &[data-dehydrated] { --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr); } &[data-theme-type='light'], & { [data-line] span { color: light-dark( var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)) ); font-weight: var(--diffs-token-light-font-weight, inherit); font-style: var(--diffs-token-light-font-style, inherit); -webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit); text-decoration: var(--diffs-token-light-text-decoration, inherit); } } &[data-theme-type='dark'] [data-line] span { font-weight: var(--diffs-token-dark-font-weight, inherit); font-style: var(--diffs-token-dark-font-style, inherit); -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit); text-decoration: var(--diffs-token-dark-text-decoration, inherit); } &:hover [data-code]::-webkit-scrollbar-thumb { background-color: var(--diffs-bg-context); } } [data-line] span { background-color: light-dark( var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit) ); } [data-line], [data-gutter-buffer], [data-line-annotation], [data-no-newline] { color: var(--diffs-fg); background-color: var(--diffs-line-bg, var(--diffs-bg)); } [data-no-newline] { -webkit-user-select: none; user-select: none; span { opacity: 0.6; } } @media (prefers-color-scheme: dark) { [data-diffs-header], [data-error-wrapper], [data-diff], [data-file] { color-scheme: dark; } [data-content] [data-line] span { font-weight: var(--diffs-token-dark-font-weight, inherit); font-style: var(--diffs-token-dark-font-style, inherit); -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit); text-decoration: var(--diffs-token-dark-text-decoration, inherit); } } [data-diffs-header], [data-diff], [data-file] { &[data-theme-type='light'] { color-scheme: light; } &[data-theme-type='dark'] { color-scheme: dark; } } [data-diff-type='split'][data-overflow='scroll'] { display: grid; grid-template-columns: 1fr 1fr; [data-additions] { border-left: 1px solid var(--diffs-bg); } [data-deletions] { border-right: 1px solid var(--diffs-bg); } } [data-code] { display: grid; grid-auto-flow: dense; grid-template-columns: var(--diffs-code-grid); overflow: scroll clip; overscroll-behavior-x: none; tab-size: var(--diffs-tab-size, 2); align-self: flex-start; padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback)); padding-bottom: max( 0px, calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px) ); } [data-container-size] { container-type: inline-size; } [data-code]::-webkit-scrollbar { width: 0; height: 6px; } [data-code]::-webkit-scrollbar-track { background: transparent; } [data-code]::-webkit-scrollbar-thumb { background-color: transparent; border: 1px solid transparent; background-clip: content-box; border-radius: 3px; } [data-code]::-webkit-scrollbar-corner { background-color: transparent; } /* * If we apply these rules globally it will mean that webkit will opt into the * standards compliant version of custom css scrollbars, which we do not want * because the custom stuff will look better */ @supports (-moz-appearance: none) { [data-code] { scrollbar-width: thin; scrollbar-color: var(--diffs-bg-context) transparent; padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback)); } } [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] { [data-code], &[data-overflow='wrap'] { padding-top: 0; } } [data-gutter] { display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; grid-column: 1; z-index: 3; position: relative; background-color: var(--diffs-bg); [data-gutter-buffer], [data-column-number] { border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg)); } } [data-content] { display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; grid-column: 2; min-width: 0; } [data-diff-type='split'][data-overflow='wrap'] { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, var(--diffs-code-grid)); padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); [data-deletions] { display: contents; [data-gutter] { grid-column: 1; } [data-content] { grid-column: 2; border-right: 1px solid var(--diffs-bg); } } [data-additions] { display: contents; [data-gutter] { grid-column: 3; border-left: 1px solid var(--diffs-bg); } [data-content] { grid-column: 4; } } } [data-overflow='scroll'] [data-gutter] { position: sticky; left: 0; } [data-line-annotation][data-selected-line] { background-color: unset; &::before { content: ''; /* FIXME(amadeus): This needs to be audited ... */ position: sticky; top: 0; left: 0; display: block; border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg)); background-color: var(--diffs-bg-selection-number); } [data-annotation-content] { background-color: var(--diffs-bg-selection); } } [data-interactive-lines] [data-line] { cursor: pointer; } [data-content-buffer], [data-gutter-buffer] { position: relative; -webkit-user-select: none; user-select: none; min-height: 1lh; } [data-gutter-buffer='annotation'] { min-height: 0; } [data-gutter-buffer='buffer'] { background-size: 8px 8px; background-position: 0 0; background-origin: border-box; background-color: var(--diffs-bg); /* This is incredibley expensive... */ background-image: repeating-linear-gradient( -45deg, transparent, transparent calc(3px * 1.414), rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414), rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414) ); } [data-content-buffer] { grid-column: 1; /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */ background-size: 8px 8px; background-position: 5px 0; background-origin: border-box; background-color: var(--diffs-bg); /* This is incredibley expensive... */ background-image: repeating-linear-gradient( -45deg, transparent, transparent calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414) ); } [data-separator] { box-sizing: content-box; background-color: var(--diffs-bg); } [data-separator='simple'] { min-height: 4px; } [data-separator='line-info'], [data-separator='line-info-basic'], [data-separator='metadata'], [data-separator='simple'] { background-color: var(--diffs-bg-separator); } [data-separator='line-info'], [data-separator='line-info-basic'], [data-separator='metadata'] { height: 32px; position: relative; } [data-separator-wrapper] { -webkit-user-select: none; user-select: none; fill: currentColor; position: absolute; inset-inline: 0; display: flex; align-items: center; background-color: var(--diffs-bg); height: 100%; } [data-content] [data-separator-wrapper] { display: none; } [data-separator='metadata'] [data-separator-wrapper] { inset-inline: 100% auto; padding-inline: 1ch; height: 100%; background-color: var(--diffs-bg-separator); color: var(--diffs-fg-number); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: min-content; } [data-separator='line-info'] { margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); } [data-separator='line-info-basic'], [data-separator='metadata'] { margin-block: 0; } [data-separator='line-info'][data-separator-first] { margin-top: 0; } [data-separator='line-info'][data-separator-last] { margin-bottom: 0; } [data-expand-index] [data-separator-wrapper] { display: grid; grid-template-columns: 32px auto; } [data-expand-index] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 32px 32px auto; } [data-expand-button], [data-separator-content] { display: flex; flex: 0 0 auto; align-items: center; background-color: var(--diffs-bg-separator); } [data-expand-button] { justify-content: center; flex-shrink: 0; cursor: pointer; min-width: 32px; align-self: stretch; color: var(--diffs-fg-number); border-right: 2px solid var(--diffs-bg); &:hover { color: var(--diffs-fg); } } [data-expand-down] [data-icon] { transform: scaleY(-1); } [data-separator-content] { flex: 1 1 auto; padding: 0 1ch; height: 100%; color: var(--diffs-fg-number); overflow: hidden; justify-content: flex-start; } [data-separator='line-info'], [data-separator='line-info-basic'] { [data-separator-content] { height: 100%; -webkit-user-select: none; user-select: none; overflow: clip; } } @supports (width: 1cqi) { [data-unified] { [data-separator='line-info'] [data-separator-wrapper] { padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback)); width: 100cqi; [data-separator-content] { border-radius: 6px; } } [data-separator='line-info'][data-expand-index] [data-separator-wrapper] [data-separator-content] { border-top-left-radius: unset; border-bottom-left-radius: unset; } } [data-gutter] { [data-separator='line-info'] [data-separator-wrapper] { padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback)); } [data-separator='line-info'] [data-separator-content] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } [data-separator='line-info'][data-expand-index] [data-separator-content] { border-top-left-radius: unset; border-bottom-left-radius: unset; } } [data-additions] { [data-content] [data-separator='line-info'] { background-color: var(--diffs-bg); [data-separator-wrapper] { display: none; } } [data-gutter] [data-separator='line-info'] [data-separator-wrapper] { display: block; height: 100%; background-color: var(--diffs-bg-separator); border-top-right-radius: 6px; border-bottom-right-radius: 6px; [data-separator-content], [data-expand-button] { display: none; } } } [data-overflow='scroll'] [data-additions] [data-gutter] [data-separator='line-info'] [data-separator-wrapper] { width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback))); } [data-overflow='wrap'] [data-additions] [data-content] [data-separator='line-info'] [data-separator-wrapper] { background-color: var(--diffs-bg-separator); display: block; height: 100%; margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback)); border-top-right-radius: 6px; border-bottom-right-radius: 6px; [data-separator-content], [data-expand-button] { display: none; } } [data-separator='line-info'] [data-separator-wrapper] { [data-expand-both], [data-expand-down], [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } } @media (pointer: fine) { [data-separator='line-info'] [data-separator-wrapper] { &[data-separator-multi-button] { [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: unset; } [data-expand-down] { border-bottom-left-radius: 6px; border-top-left-radius: unset; } } } } } @media (pointer: coarse) { [data-separator='line-info-basic'] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 34px 34px auto; [data-separator-content] { grid-column: unset; grid-row: unset; } } @supports (width: 1cqi) { [data-separator='line-info'] [data-separator-wrapper] { [data-expand-both], [data-expand-down], [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } &[data-separator-multi-button] { [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } [data-expand-down] { border-bottom-left-radius: unset; border-top-left-radius: unset; } } } } } @media (pointer: fine) { [data-separator-wrapper][data-separator-multi-button] { display: grid; grid-template-rows: 50% 50%; [data-separator-content] { grid-column: 2; grid-row: 1 / -1; min-width: min-content; } [data-expand-button] { grid-column: 1; } } [data-separator='line-info'] [data-separator-wrapper], [data-separator='line-info'] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 34px auto; } [data-separator='line-info-basic'][data-expand-index] [data-separator-wrapper] { grid-template-columns: 100% auto; } [data-separator='line-info'], [data-separator='line-info-basic'] { [data-separator-multi-button] { [data-expand-up] { border-bottom: 1px solid var(--diffs-bg); border-right: 2px solid var(--diffs-bg); } [data-expand-down] { border-top: 1px solid var(--diffs-bg); border-right: 2px solid var(--diffs-bg); } } } } [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator='line-info-basic'] [data-separator-wrapper], [data-content] [data-separator-wrapper] { display: none; } [data-line-annotation], [data-gutter-buffer='annotation'] { --diffs-line-bg: var(--diffs-bg-context); } [data-line-annotation] { min-height: var(--diffs-annotation-min-height, 0); z-index: 2; } [data-separator='custom'] { display: grid; grid-template-columns: subgrid; } [data-line], [data-column-number], [data-no-newline] { position: relative; padding-inline: 1ch; } [data-indicators='classic'] [data-line] { padding-inline-start: 2ch; } [data-indicators='classic'] { [data-line-type='change-addition'], [data-line-type='change-deletion'] { &[data-no-newline], &[data-line] { &::before { display: inline-block; width: 1ch; height: 1lh; position: absolute; top: 0; left: 0; -webkit-user-select: none; user-select: none; } } } [data-line-type='change-addition'] { &[data-line], &[data-no-newline] { &::before { content: '+'; color: var(--diffs-addition-base); } } } [data-line-type='change-deletion'] { &[data-line], &[data-no-newline] { &::before { content: '-'; color: var(--diffs-deletion-base); } } } } [data-indicators='bars'] { [data-line-type='change-deletion'], [data-line-type='change-addition'] { &[data-column-number] { &::before { content: ''; display: block; width: 4px; height: 100%; position: absolute; top: 0; left: 0; -webkit-user-select: none; user-select: none; contain: strict; } } } [data-line-type='change-deletion'] { &[data-column-number] { &::before { background-image: linear-gradient( 0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50% ); background-repeat: repeat; background-size: 2px 2px; background-size: calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px)); } } } [data-line-type='change-addition'] { &[data-column-number] { &::before { background-color: var(--diffs-addition-base); } } } } [data-overflow='wrap'] { [data-line], [data-annotation-content] { white-space: pre-wrap; word-break: break-word; } } [data-overflow='scroll'] [data-line] { white-space: pre; min-height: 1lh; } [data-column-number] { box-sizing: content-box; text-align: right; -webkit-user-select: none; user-select: none; background-color: var(--diffs-bg); color: var(--diffs-fg-number); padding-left: 2ch; } [data-line-number-content] { display: inline-block; min-width: var( --diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch) ); } [data-disable-line-numbers] { [data-column-number] { min-width: 4px; padding: 0; } [data-line-number-content] { display: none; } [data-gutter-utility-slot] { right: unset; left: 0; justify-content: flex-start; } &[data-indicators='bars'] [data-gutter-utility-slot] { /* Using 5px here because theres a 1px separator after the bar */ left: 5px; } } [data-file][data-disable-line-numbers] { [data-gutter-buffer], [data-column-number] { min-width: 0; border-right: 0; } } [data-interactive-line-numbers] [data-column-number] { cursor: pointer; } [data-diff-span] { border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; } [data-line-type='change-addition'] { &[data-column-number] { color: var( --diffs-fg-number-addition-override, var(--diffs-addition-base) ); } > [data-diff-span] { background-color: var(--diffs-bg-addition-emphasis); } } [data-line-type='change-deletion'] { &[data-column-number] { color: var( --diffs-fg-number-deletion-override, var(--diffs-deletion-base) ); } [data-diff-span] { background-color: var(--diffs-bg-deletion-emphasis); } } [data-background] [data-line-type='change-addition'] { --diffs-line-bg: var(--diffs-bg-addition); &[data-column-number] { background-color: var(--diffs-bg-addition-number); } } [data-background] [data-line-type='change-deletion'] { --diffs-line-bg: var(--diffs-bg-deletion); &[data-column-number] { background-color: var(--diffs-bg-deletion-number); } } @media (pointer: fine) { [data-column-number], [data-line] { &[data-hovered] { background-color: var(--diffs-bg-hover); } } [data-background] { [data-column-number], [data-line] { &[data-hovered] { &[data-line-type='change-deletion'] { background-color: var(--diffs-bg-deletion-hover); } &[data-line-type='change-addition'] { background-color: var(--diffs-bg-addition-hover); } } } } } [data-diffs-header] { position: relative; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); min-height: calc( 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3) ); padding-inline: 16px; top: 0; z-index: 2; } [data-header-content] { display: flex; flex-direction: row; align-items: center; gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); min-width: 0; white-space: nowrap; } [data-header-content] [data-prev-name], [data-header-content] [data-title] { direction: rtl; overflow: hidden; text-overflow: ellipsis; min-width: 0; white-space: nowrap; } [data-prev-name] { opacity: 0.7; } [data-rename-icon] { fill: currentColor; flex-shrink: 0; flex-grow: 0; } [data-diffs-header] [data-metadata] { display: flex; align-items: center; gap: 1ch; white-space: nowrap; } [data-diffs-header] [data-additions-count] { font-family: var(--diffs-font-family, var(--diffs-font-fallback)); color: var(--diffs-addition-base); } [data-diffs-header] [data-deletions-count] { font-family: var(--diffs-font-family, var(--diffs-font-fallback)); color: var(--diffs-deletion-base); } [data-annotation-content] { position: relative; display: flow-root; align-self: flex-start; z-index: 2; min-width: 0; isolation: isolate; } /* Sticky positioning has a composite costs, so we should _only_ pay it if we * need to */ [data-overflow='scroll'] [data-annotation-content] { position: sticky; width: var(--diffs-column-content-width, auto); left: var(--diffs-column-number-width, 0); } /* Undo some of the stuff that the 'pre' tag does */ [data-annotation-slot] { text-wrap-mode: wrap; word-break: normal; white-space-collapse: collapse; } [data-change-icon] { fill: currentColor; flex-shrink: 0; } [data-change-icon='change'], [data-change-icon='rename-pure'], [data-change-icon='rename-changed'] { color: var(--diffs-modified-base); } [data-change-icon='new'] { color: var(--diffs-addition-base); } [data-change-icon='deleted'] { color: var(--diffs-deletion-base); } [data-change-icon='file'] { opacity: 0.6; } /* Line selection highlighting */ [data-selected-line] { &[data-gutter-buffer='annotation'], &[data-column-number] { color: var(--diffs-selection-number-fg); background-color: var(--diffs-bg-selection-number); } &[data-line] { background-color: var(--diffs-bg-selection); } } [data-line-type='change-addition'], [data-line-type='change-deletion'] { &[data-selected-line] { &[data-line], &[data-line][data-hovered] { background-color: light-dark( color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 82%, var(--diffs-selection-base) ), color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 75%, var(--diffs-selection-base) ) ); } &[data-column-number], &[data-column-number][data-hovered] { color: var(--diffs-selection-number-fg); background-color: light-dark( color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 75%, var(--diffs-selection-base) ), color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 60%, var(--diffs-selection-base) ) ); } } } [data-gutter-utility-slot] { position: absolute; top: 0; bottom: 0; right: 0; display: flex; justify-content: flex-end; } [data-unmodified-lines] { display: block; overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; } [data-error-wrapper] { overflow: auto; padding: var(--diffs-gap-block, var(--diffs-gap-fallback)) var(--diffs-gap-inline, var(--diffs-gap-fallback)); max-height: 400px; scrollbar-width: none; [data-error-message] { font-weight: bold; font-size: 18px; color: var(--diffs-deletion-base); } [data-error-stack] { color: var(--diffs-fg-number); } } [data-placeholder] { contain: strict; } [data-utility-button] { display: flex; align-items: center; justify-content: center; border: none; appearance: none; width: 1lh; height: 1lh; margin-right: calc((1lh - 1ch) * -1); padding: 0; cursor: pointer; font-size: var(--diffs-font-size, 13px); line-height: var(--diffs-line-height, 20px); border-radius: 4px; background-color: var(--diffs-modified-base); color: var(--diffs-bg); fill: currentColor; position: relative; z-index: 4; } } `;const $U="@layer base, theme, unsafe;";function x9(e){return`${$U} @layer unsafe { ${e} }`}function xf({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),r!=null?e.style.setProperty("grid-row",`span ${r}`):e.style.removeProperty("grid-row"),i?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function S9(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function _9(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:o,split:s,themeStyles:a,themeType:l,totalLines:c}){switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),l==="system"?e.removeAttribute("data-theme-type"):e.setAttribute("data-theme-type",l),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return i?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),r?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",s?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.tabIndex=0,e.style=a,e.style.setProperty("--diffs-min-number-column-width-default",`${`${c}`.length}ch`),e}if(typeof HTMLElement<"u"&&customElements.get(r0)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(TU)),r.adoptedStyleSheets=[e]}}customElements.define(r0,t)}const C9=!0,LU=[];let AU=-1;var I9=class{static LoadedCustomComponent=C9;__id=`file:${++AU}`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;unsafeCSSStyle;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;appliedPreAttributes;lastRowCount;headerElement;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];file;renderRange;constructor(t={theme:Yn},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new IU(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new r9,this.interactionManager=new n9("file",s0(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}setOptions(t){t!=null&&(this.options=t,this.interactionManager.setOptions(s0(t)))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){if((this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.fileRenderer.setThemeType(t),this.headerElement!=null&&(t==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=t),this.pre!=null))switch(t){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=t;break}}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t){this.interactionManager.setSelection(t)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.renderRange=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0,this.placeHolder=void 0}hydrate(t){const{fileContainer:n,prerenderedHTML:r}=t;S9(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(Eb)){this.unsafeCSSStyle=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}if(this.pre==null)this.render(t);else{const{file:i,lineAnnotations:o}=t,{overflow:s="scroll"}=this.options;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=o??this.lineAnnotations,this.file=i,this.fileRenderer.hydrate(i),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,s==="wrap")}}getOrCreateLineCache(t=this.file){return t!=null?this.fileRenderer.getOrCreateLineCache(t):LU}render({file:t,fileContainer:n,forceRender:r=!1,containerWrapper:i,lineAnnotations:o,renderRange:s}){const{collapsed:a=!1}=this.options,l=a?void 0:s,c=this.renderRange,u=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1,d=!c0(this.file,t);if(!a&&!r&&gh(l,this.renderRange)&&!d&&!u)return!1;this.renderRange=l,this.file=t,this.fileRenderer.setOptions(this.options),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:f=!1,disableFileHeader:h=!1,overflow:m="scroll"}=this.options;if(h&&(this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.headerPrefix!=null&&(this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerPrefix=void 0),this.headerMetadata!=null&&(this.headerMetadata.parentNode?.removeChild(this.headerMetadata),this.headerMetadata=void 0)),n=this.getOrCreateFileContainerNode(n,i),a){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const p=this.fileRenderer.renderFile(t,e9);p?.headerAST!=null&&this.applyHeaderToDOM(p.headerAST,n),this.injectUnsafeCSS()}catch(p){if(f)throw p;console.error(p),p instanceof Error&&this.applyErrorToDOM(p,n)}return!0}try{const p=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(r,u,d)||!this.applyPartialRender(c,l)){const g=this.fileRenderer.renderFile(t,l);if(g==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;g.headerAST!=null&&this.applyHeaderToDOM(g.headerAST,n),this.applyFullRender(g,p)}this.applyBuffers(p,l),this.injectUnsafeCSS(),this.interactionManager.setup(p),this.resizeManager.setup(p,m==="wrap"),this.renderAnnotations(),this.renderGutterUtility()}catch(p){if(f)throw p;console.error(p),p instanceof Error&&this.applyErrorToDOM(p,n)}return!0}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.annotationCache.values())t.parentNode?.removeChild(t);this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(t,n,r){return!(t||n||r)}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:r}of this.annotationCache.values())r.parentNode?.removeChild(r);this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,i]of this.lineAnnotations.entries()){const o=`${r}-${ea(i)}`;let s=this.annotationCache.get(o);if(s==null||!EU(i,s.annotation)){s?.element.parentElement?.removeChild(s.element);const a=n(i);if(a==null)continue;s={element:y9(ea(i)),annotation:i},s.element.appendChild(a),this.fileContainer.appendChild(s.element),this.annotationCache.set(o,s)}t.delete(o)}for(const[r,{element:i}]of t.entries())this.annotationCache.delete(r),i.parentNode?.removeChild(i)}renderGutterUtility(){const t=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.parentNode?.removeChild(this.gutterUtilityContent),this.gutterUtilityContent=void 0;return}const r=w9();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=k9(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=x9(t)}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t),this.code=xf({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(t)),n.replaceChildren(this.code),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:r,code:i}=this,o=i!=null?this.getColumns(i):void 0;if(r==null||i==null||o==null)return!1;const s=t.startingLine,a=n.startingLine,l=t.totalLines===1/0?Number.POSITIVE_INFINITY:s+t.totalLines,c=n.totalLines===1/0?Number.POSITIVE_INFINITY:a+n.totalLines,u=Math.max(s,a),d=Math.min(l,c);if(d<=u||!this.trimDOMToOverlap(o.gutter,u,d)||!this.trimDOMToOverlap(o.content,u,d))return!1;let{length:f}=o.content.children;const h=(b,v)=>{if(!(v<=0))return this.fileRenderer.renderFile(r,{startingLine:b,totalLines:v,bufferBefore:0,bufferAfter:0})},m=ad?h(d,p):void 0;return g===void 0&&c>d?!1:(this.cleanupErrorWrapper(),m!=null&&(o.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(m.gutterAST)),o.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(m.contentAST)),f+=m.rowCount),g!=null&&(o.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.gutterAST)),o.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.contentAST)),f+=g.rowCount),this.lastRowCount!==f&&(o.gutter.style.setProperty("grid-row",`span ${f}`),o.content.style.setProperty("grid-row",`span ${f}`),this.lastRowCount=f),!0)}getColumns(t){const n=t.children[0],r=t.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}trimDOMToOverlap(t,n,r){const i=this.getDOMBoundaryIndices(t,[n,r]),o=i.get(n)??t.children.length,s=i.get(r)??t.children.length;if(o>s)return!1;for(let a=t.children.length-1;a>=s;a-=1)t.children[a]?.remove();for(let a=o-1;a>=0;a-=1)t.children[a]?.remove();return!0}getDOMBoundaryIndices(t,n){const r=[...new Set(n)].sort((l,c)=>l-c),i=new Map;if(r.length===0)return i;let o=0,s=r[o];const{children:a}=t;for(let l=0;l=s;)i.set(s,l),o+=1,s=r[o];if(o>=r.length)break}}for(const l of r)i.has(l)||i.set(l,a.length);return i}getLineIndexFromDOMNode(t){const n=t.dataset.lineIndex;if(n==null)return;const r=Number(n);return Number.isNaN(r)?void 0:r}applyBuffers(t,n){const{disableVirtualizationBuffers:r=!1}=this.options;if(r||n==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyHeaderToDOM(t,n){const{file:r}=this;if(r==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const i=Bi(t);if(i!==this.lastRenderedHeaderHTML){const c=document.createElement("div");c.innerHTML=i;const u=c.firstElementChild;if(!(u instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(u,this.headerElement):n.shadowRoot?.prepend(u),this.headerElement=u,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:o,renderCustomMetadata:s}=this.options;this.headerPrefix!=null&&this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const a=o?.(r)??void 0,l=s?.(r)??void 0;a!=null&&(this.headerPrefix=document.createElement("div"),this.headerPrefix.slot=Cb,a instanceof Element?this.headerPrefix.appendChild(a):this.headerPrefix.innerText=`${a}`,n.appendChild(this.headerPrefix)),l!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=Ib,l instanceof Element?this.headerMetadata.appendChild(l):this.headerMetadata.innerText=`${l}`,n.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(t,n){const r=this.fileContainer;if(this.fileContainer=t??this.fileContainer??document.createElement(r0),r!=null&&r!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=v9;const o=i.firstChild;o instanceof SVGElement&&(this.spriteSVG=o,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(t.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}applyPreNodeAttributes(t,{totalLines:n,themeStyles:r,baseThemeType:i}){const{overflow:o="scroll",themeType:s="system",disableLineNumbers:a=!1}=this.options,l={type:"file",split:!1,themeStyles:r,overflow:o,disableLineNumbers:a,themeType:i??s,diffIndicators:"none",disableBackground:!0,totalLines:n};b9(l,this.appliedPreAttributes)||(_9(t,l),this.appliedPreAttributes=l)}applyErrorToDOM(t,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0,this.appliedPreAttributes=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const o=document.createElement("div");o.dataset.errorMessage="",o.innerText=t.message,this.errorWrapper.appendChild(o);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},MU=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Md(e){return at({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Od(e){return at({tagName:"div",children:[at({tagName:"span",children:[Mo("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function yp(e){return at({tagName:"div",children:[o0({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{"data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function Ma({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:o,isLastHunk:s}){const a=[];if(e==="metadata"&&t!=null&&a.push(at({tagName:"div",children:[Mo(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const l=[];n!=null&&(r?(o||l.push(yp("up")),s||l.push(yp("down"))):l.push(yp(!o&&!s?"both":o?"down":"up"))),l.push(at({tagName:"div",children:[at({tagName:"span",children:[Mo(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),a.push(at({tagName:"div",children:l,properties:{"data-separator-wrapper":"","data-separator-multi-button":l.length>2?"":void 0}}))}return e==="custom"&&i!=null&&a.push(at({tagName:"slot",properties:{name:i}})),at({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function OU(e,t){return`hunk-separator-${e}-${t}`}function PU(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function DU(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}class Ab{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const o=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(o,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(t,n,r,i){var o;const s=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const d=(o=r.timeout)!==null&&o!==void 0?o:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=l&&m+1>=a)return s(this.buildValues(h[0].lastComponent,n,t));let p=-1/0,g=1/0;const b=()=>{for(let v=Math.max(p,-c);v<=Math.min(g,c);v+=2){let y;const T=h[v-1],k=h[v+1];T&&(h[v-1]=void 0);let x=!1;if(k){const A=k.oldPos-v;x=k&&0<=A&&A=l&&m+1>=a)return s(this.buildValues(y.lastComponent,n,t))||!0;h[v]=y,y.oldPos+1>=l&&(g=Math.min(g,v-1)),m+1>=a&&(p=Math.max(p,v+1))}c++};if(i)(function v(){setTimeout(function(){if(c>u||Date.now()>f)return i(void 0);b()||v()},0)})();else for(;c<=u&&Date.now()<=f;){const v=b();if(v)return v}}addToPath(t,n,r,i,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,i,o){const s=n.length,a=r.length;let l=t.oldPos,c=l-i,u=0;for(;c+1f.length?m:f}),u.value=this.join(d)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return i}}class RU extends Ab{}const NU=new RU;function zU(e,t,n){return NU.diff(e,t,n)}const Ww="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class jU extends Ab{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${Ww}]+|[^\\S\\n\\r]+|[^${Ww}]`,"ug");return t.match(n)||[]}}const FU=new jU;function HU(e,t,n){return FU.diff(e,t,n)}class VU extends Ab{constructor(){super(...arguments),this.tokenize=BU}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(` `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(` `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(` `)&&(t=t.slice(0,-1)),n.endsWith(` `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const UU=new VU;function Zw(e,t,n){return UU.diff(e,t,n)}function BU(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:u}=a;Zw(n,r,Object.assign(Object.assign({},a),{callback:d=>{const f=c(d);u(f)}}))}else return c(Zw(n,r,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function d(v){return v.map(function(y){return" "+y})}const f=[];let h=0,m=0,p=[],g=1,b=1;for(let v=0;v0?d(k.lines.slice(-l)):[],h-=p.length,m-=p.length)}for(const k of T)p.push((y.added?"+":"-")+k);y.added?b+=T.length:g+=T.length}else{if(h)if(T.length<=l*2&&v1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(r=>E9(r,t)).join(` `)}const n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;rr+` `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Gw({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function Pd({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){const o=t[t.length-1];if(o==null||i||!n){t.push([r?0:1,e.value]);return}const s=o[0]===0;if(r===s||r&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([r?0:1,e.value])}function u0({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:o=il,callback:s}){const a={finalHunk:e.hunks.at(-1),viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:0,unifiedCount:0,shouldBreak(){if(!a.isWindowedHighlight)return!1;const l=a.unifiedCount>=n+r,c=a.splitCount>=n+r;return t==="unified"?l:(t==="split"||l)&&c},shouldSkip(l,c){if(!a.isWindowedHighlight)return!1;const u=a.unifiedCount+l=n-l&&a.unifiedCount=n-l&&a.splitCount0?0:t==="unified"?x===c.unifiedLineStart+c.unifiedLineCount-1?d.collapsedLines:0:_===c.splitLineStart+c.splitLineCount-1?d.collapsedLines:0},m=function(){if(u.collapsedLines===0)return 0;const x=u.collapsedLines;return u.collapsedLines=0,x};if(a.shouldBreak())break;const u=Kw(e.isPartial,c.collapsedBefore,i,l,o),d=(()=>{if(c!==a.finalHunk||!KU(e))return;const x=e.additionLines.length-(c.additionLineIndex+c.additionCount),_=e.deletionLines.length-(c.deletionLineIndex+c.deletionCount);if(x!==_)throw new Error(`iterateOverDiff: trailing context mismatch (additions=${x}, deletions=${_}) for ${e.name}`);const A=Math.min(x,_);return Kw(e.isPartial,A,i,e.hunks.length,o)})(),f=u.fromStart+u.fromEnd;if(a.shouldSkip(f,f))a.incrementCounts(f,f),m();else{let x=c.unifiedLineStart-u.rangeSize,_=c.splitLineStart-u.rangeSize,A=c.deletionLineIndex-u.rangeSize,M=c.additionLineIndex-u.rangeSize,L=c.deletionStart-u.rangeSize,F=c.additionStart-u.rangeSize,R=0;for(;R=t;return{fromStart:c?t:s,fromEnd:c?0:a,rangeSize:t,collapsedLines:Math.max(t-l,0)}}function KU(e){const t=e.hunks.at(-1);return t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0?!1:t.additionLineIndex+t.additionCount=e.viewportEnd)return;const h=Math.max(0,e.viewportStart-d),m=Math.min(f,e.viewportEnd-d);return m>h?[h,m]:void 0}function l(d,f){return o==="split"?d:f==="additions"?[d[0]+t.deletions,d[1]+t.deletions]:d}function c(d,f){if(d==null)return;const[h,m]=l(d,f);m>h&&s.push([h,m])}if(r&&(c(a(e.unifiedCount,t.deletions),"deletions"),c(a(e.unifiedCount+t.deletions,t.additions),"additions")),i&&(c(a(e.splitCount,t.deletions),"deletions"),c(a(e.splitCount,t.additions),"additions")),s.length===0)return s;s.sort((d,f)=>d[0]-f[0]);const u=[s[0]];for(const[d,f]of s.slice(1)){const h=u[u.length-1];d<=h[1]?h[1]=Math.max(h[1],f):u.push([d,f])}return u}function JU({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:o,unifiedLineIndex:s,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:c,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:h,unifiedCount:m,splitCount:p}){const g=o=f.deletions?s+o:void 0:o=f.deletions?l+(o-f.deletions):void 0:o=f.deletions?u+(o-f.deletions):void 0:o0||o<1/0,c=(()=>{const v=n.theme??Yn;if(typeof v=="string")return t.getTheme(v).type})(),u=m9({theme:n.theme,highlighter:t}),d=r&&!l&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,f={deletionLines:[],additionLines:[]},h=!r&&!e.isPartial,m=r?s:void 0,p=new Map;function g(v){const y=h?0:v,T=p.get(y)??eB();return p.set(y,T),T}function b(v,y,T,k){if(l){let x=T.at(-1);(x==null||x.targetIndex+x.count!==y)&&(x={targetIndex:y,originalOffset:k.length,count:0},T.push(x)),x.count++}k.push(v)}u0({diff:e,diffStyle:"both",startingLine:i,totalLines:o,expandedHunks:l?m:!0,collapsedContextThreshold:a,callback:({hunkIndex:v,additionLine:y,deletionLine:T,type:k})=>{const x=g(v),_=y!=null?y.splitLineIndex:T.splitLineIndex;k==="change"&&y!=null&&T!=null&&QU({additionLine:e.additionLines[y.lineIndex],deletionLine:e.deletionLines[T.lineIndex],deletionLineIndex:x.deletionContent.length,additionLineIndex:x.additionContent.length,deletionDecorations:x.deletionDecorations,additionDecorations:x.additionDecorations,lineDiffType:d}),T!=null&&(b(e.deletionLines[T.lineIndex],T.lineIndex,x.deletionSegments,x.deletionContent),x.deletionInfo.push({type:k==="change"?"change-deletion":k,lineNumber:T.lineNumber,altLineNumber:k==="change"?void 0:y.lineNumber??void 0,lineIndex:`${T.unifiedLineIndex},${_}`})),y!=null&&(b(e.additionLines[y.lineIndex],y.lineIndex,x.additionSegments,x.additionContent),x.additionInfo.push({type:k==="change"?"change-addition":k,lineNumber:y.lineNumber,altLineNumber:k==="change"?void 0:T.lineNumber??void 0,lineIndex:`${y.unifiedLineIndex},${_}`}))}});for(const v of p.values()){if(v.deletionContent.length===0&&v.additionContent.length===0)continue;const y={name:e.prevName??e.name,contents:v.deletionContent.value},T={name:e.name,contents:v.additionContent.value},{deletionLines:k,additionLines:x}=tB({deletionFile:y,deletionInfo:v.deletionInfo,deletionDecorations:v.deletionDecorations,additionFile:T,additionInfo:v.additionInfo,additionDecorations:v.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang});if(h){f.deletionLines=k,f.additionLines=x;continue}if(v.deletionSegments.length>0)for(const _ of v.deletionSegments)for(let A=0;A<_.count;A++)f.deletionLines[_.targetIndex+A]=k[_.originalOffset+A];else f.deletionLines.push(...k);if(v.additionSegments.length>0)for(const _ of v.additionSegments)for(let A=0;A<_.count;A++)f.additionLines[_.targetIndex+A]=x[_.originalOffset+A];else f.additionLines.push(...x)}return{code:f,themeStyles:u,baseThemeType:c}}function QU({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:o,lineDiffType:s}){if(e==null||t==null||s==="none")return;e=ta(e),t=ta(t);const a=s==="char"?zU(e,t):HU(e,t),l=[],c=[],u=s==="word-alt",d=a.at(-1);for(const h of a){const m=h===d;!h.added&&!h.removed?(Pd({item:h,arr:l,enableJoin:u,isNeutral:!0,isLastItem:m}),Pd({item:h,arr:c,enableJoin:u,isNeutral:!0,isLastItem:m})):h.removed?Pd({item:h,arr:l,enableJoin:u,isLastItem:m}):Pd({item:h,arr:c,enableJoin:u,isLastItem:m})}let f=0;for(const h of l)h[0]===1&&i.push(Gw({line:n,spanStart:f,spanLength:h[1].length})),f+=h[1].length;f=0;for(const h of c)h[0]===1&&o.push(Gw({line:r,spanStart:f,spanLength:h[1].length})),f+=h[1].length}function eB(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function tB({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:o,additionDecorations:s,languageOverride:a,options:{theme:l=Yn,...c}}){const u=a??Yr(e.name),d=a??Yr(t.name),{state:f,transformers:h}=h9(),m=typeof l=="string"?{...c,lang:"text",theme:l,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:xr("token")}:{...c,lang:"text",themes:l,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:xr("token")};return{deletionLines:e.contents===""?[]:(m.lang=u,f.lineInfo=n,m.decorations=o,c1(i.codeToHast(ta(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=d,m.decorations=s,f.lineInfo=r,c1(i.codeToHast(ta(t.contents),m)))}}let nB=-1;var rB=class{__id=`diff-hunks-renderer:${++nB}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:Yn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=jc(e.theme??Yn)?c9():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){const{expansionLineCount:n}=this.getOptionsWithDefaults(),r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&(this.renderCache=void 0),this.expandedHunks.set(e,r)}expandHunkFully(e){this.renderCache?.highlighted!==!0&&(this.renderCache=void 0),this.expandedHunks.set(e,{fromStart:Number.POSITIVE_INFINITY,fromEnd:Number.POSITIVE_INFINITY})}getExpandedHunk(e){return this.expandedHunks.get(e)??sU}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=il,expansionLineCount:c=100,hunkSeparators:u="line-info",lineDiffType:d="word-alt",maxLineDiffLength:f=1e3,overflow:h="scroll",theme:m=Yn,themeType:p="system",tokenizeMaxLineLength:g=1e3,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:a,collapsedContextThreshold:l,expansionLineCount:c,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:h,theme:this.workerManager?.getDiffRenderOptions().theme??m,themeType:p,tokenizeMaxLineLength:g,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await gl(f9(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getDiffResultCache(e);n!=null&&!wp(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:r,options:i})=>{this.onHighlightSuccess(e,r,i)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:i,lineDiffType:o}=this.getOptionsWithDefaults();return{theme:r,tokenizeMaxLineLength:i,lineDiffType:o}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.diff||!wp(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff,t=i0){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),i=this.workerManager?.getDiffResultCache(e);i!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...i});const{options:o,forceRender:s}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:o,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!gh(this.renderCache.renderRange,t))&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,DU(t)||n?!0:this.expandedHunks,r),this.renderCache.renderRange=t),t.totalLines>0&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??Yr(e.name);const a=this.highlighter!=null&&jc(o.theme),l=this.highlighter!=null&&a0(this.computedLang);if(this.highlighter!=null&&a&&(s||!this.renderCache.highlighted&&l||this.renderCache.result==null)){const{result:c,options:u}=this.renderDiffWithHighlighter(e,this.highlighter,!l);this.renderCache={diff:e,options:u,highlighted:l,result:c,renderRange:void 0}}(!a||!l)&&this.asyncHighlight(e).then(({result:c,options:u})=>{this.onHighlightSuccess(e,c,u)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=i0){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n,r){const{diffIndicators:i,disableBackground:o,disableLineNumbers:s,overflow:a,themeType:l}=this.getOptionsWithDefaults();return d9({type:"diff",diffIndicators:i,disableBackground:o,disableLineNumbers:s,overflow:a,themeStyles:n,split:e,themeType:r??l,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??Yr(e.name);const t=this.highlighter!=null&&jc(this.options.theme??Yn),n=this.highlighter!=null&&a0(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:T9(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.diff!==e||!this.renderCache.highlighted||!wp(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){const{diffStyle:o,disableFileHeader:s,expandUnchanged:a,expansionLineCount:l,collapsedContextThreshold:c,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;const d=o==="unified";let f=[],h=[],m=[];const p=[],{additionLines:g,deletionLines:b}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:h,unifiedContentAST:m,unifiedGutterAST:Xa(),deletionsGutterAST:Xa(),additionsGutterAST:Xa(),expansionLineCount:l,hunkData:p,incrementRowCount($=1){v.rowCount+=$},pushToGutter($,O){switch($){case"unified":v.unifiedGutterAST.children.push(O);break;case"deletions":v.deletionsGutterAST.children.push(O);break;case"additions":v.additionsGutterAST.children.push(O);break}}},y=iB(e);let T=0,k;function x($,O,V,Z){v.pushToGutter($,t9(O,V,Z))}function _(){if(o!=="unified"){if(T<=0||k==null){T=0,k=void 0;return}k==="additions"?(v.pushToGutter("additions",Vr(void 0,"buffer",T)),f?.push(Md(T))):(v.pushToGutter("deletions",Vr(void 0,"buffer",T)),h?.push(Md(T))),T=0,k=void 0}}function A($){_(),o==="unified"?kp("unified",$,v):(kp("deletions",$,v),kp("additions",$,v))}u0({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.expandedHunks,collapsedContextThreshold:c,callback:({hunkIndex:$,hunk:O,collapsedBefore:V,collapsedAfter:Z,additionLine:W,deletionLine:G,type:Y})=>{const te=G!=null?G.splitLineIndex:W.splitLineIndex,we=W!=null?W.unifiedLineIndex:G.unifiedLineIndex;o==="split"&&Y!=="change"&&_(),V>0&&A({hunkIndex:$,collapsedLines:V,rangeSize:Math.max(O?.collapsedBefore??0,0),hunkSpecs:O?.hunkSpecs,isFirstHunk:$===0,isLastHunk:!1,isExpandable:!e.isPartial});const $e=o==="unified"?we:te;if(o==="unified"){const Me=G!=null?b[G.lineIndex]:void 0,ke=W!=null?g[W.lineIndex]:void 0;if(Me==null&&ke==null){const gt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(gt,{file:e.name}),new Error(gt)}x("unified",Y==="change"?W!=null?"change-addition":"change-deletion":Y,W!=null?W.lineNumber:G.lineNumber,`${we},${te}`),Jw({diffStyle:"unified",type:Y,deletionLine:Me,additionLine:ke,unifiedSpan:this.getAnnotations("unified",G?.lineNumber,W?.lineNumber,$,$e),context:v})}else{const Me=G!=null?b[G.lineIndex]:void 0,ke=W!=null?g[W.lineIndex]:void 0;if(Me==null&&ke==null){const Kt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Kt,{file:e.name}),new Error(Kt)}const gt=(()=>{if(Y==="change"){if(ke==null)return"additions";if(Me==null)return"deletions"}})();if(gt!=null){if(k!=null&&k!==gt)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");k=gt,T++}const jt=this.getAnnotations("split",G?.lineNumber,W?.lineNumber,$,$e);jt!=null&&T>0&&_(),G!=null&&x("deletions",Y==="change"?"change-deletion":Y,G.lineNumber,`${G.unifiedLineIndex},${te}`),W!=null&&x("additions",Y==="change"?"change-addition":Y,W.lineNumber,`${W.unifiedLineIndex},${te}`),Jw({diffStyle:"split",type:Y,additionLine:ke,deletionLine:Me,...jt,context:v})}const Le=G?.noEOFCR??!1,ct=W?.noEOFCR??!1;if(ct||Le){if(Le){const Me=Y==="context"||Y==="context-expanded"?Y:"change-deletion";o==="unified"?(v.unifiedContentAST.push(Od(Me)),v.pushToGutter("unified",Vr(Me,"metadata",1))):(v.deletionsContentAST.push(Od(Me)),v.pushToGutter("deletions",Vr(Me,"metadata",1)),ct||(v.pushToGutter("additions",Vr(void 0,"buffer",1)),v.additionsContentAST.push(Md(1))))}if(ct){const Me=Y==="context"||Y==="context-expanded"?Y:"change-addition";o==="unified"?(v.unifiedContentAST.push(Od(Me)),v.pushToGutter("unified",Vr(Me,"metadata",1))):(v.additionsContentAST.push(Od(Me)),v.pushToGutter("additions",Vr(Me,"metadata",1)),Le||(v.pushToGutter("deletions",Vr(void 0,"buffer",1)),v.deletionsContentAST.push(Md(1))))}v.incrementRowCount(1)}Z>0&&u!=="simple"&&A({hunkIndex:Y==="context-expanded"?$:$+1,collapsedLines:Z,rangeSize:y,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),o==="split"&&_();const M=Math.max(PU(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),L=t.bufferBefore>0||t.bufferAfter>0,F=!d&&e.type!=="deleted",R=!d&&e.type!=="new",E=v.rowCount>0||L;f=F&&E?f:void 0,h=R&&E?h:void 0,m=d&&E?m:void 0;const S=this.createPreElement(h!=null&&f!=null,M,r,i);return{unifiedGutterAST:d&&E?v.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:R&&E?v.deletionsGutterAST.children:void 0,deletionsContentAST:h,additionsGutterAST:F&&E?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:p,preNode:S,themeStyles:r,baseThemeType:i,headerElement:s?void 0:this.renderHeader(this.diff,r,i),totalLines:M,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,r=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;const i=Xa(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,g9(r,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",r=this.renderCodeAST("unified",e);if(r!=null)return t.push(at({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const i=this.renderCodeAST("deletions",e);i!=null&&t.push(at({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const o=this.renderCodeAST("additions",e);return o!=null&&t.push(at({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Bi(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?Bi(e):Bi(at({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}getAnnotations(e,t,n,r,i){const o={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(const a of this.deletionAnnotations[t]??[])o.annotations.push(ea(a));const s={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(const a of this.additionAnnotations[n]??[])(e==="unified"?o:s).annotations.push(ea(a));if(e==="unified")return o.annotations.length>0?o:void 0;if(!(s.annotations.length===0&&o.annotations.length===0))return{deletionSpan:o,additionSpan:s}}renderHeader(e,t,n){const{themeType:r}=this.getOptionsWithDefaults();return u9({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function wp(e,t){return Lb(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function Yw(e){return`${e} unmodified line${e>1?"s":""}`}function Jw({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:o,additionSpan:s,context:a}){let l=!1;if(e==="unified"){if(r!=null?a.unifiedContentAST.push(r):n!=null&&a.unifiedContentAST.push(n),i!=null){const c=t==="change"?n!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(kf(i)),a.pushToGutter("unified",Vr(c,"annotation",1)),l=!0}}else if(e==="split"){if(n!=null&&a.deletionsContentAST.push(n),r!=null&&a.additionsContentAST.push(r),o!=null){const c=t==="change"?n!=null?"change-deletion":"context":t;a.deletionsContentAST.push(kf(o)),a.pushToGutter("deletions",Vr(c,"annotation",1)),l=!0}if(s!=null){const c=t==="change"?r!=null?"change-addition":"context":t;a.additionsContentAST.push(kf(s)),a.pushToGutter("additions",Vr(c,"annotation",1)),l=!0}}l&&a.incrementRowCount(1)}function kp(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:o,isLastHunk:s,isExpandable:a},l){if(n<=0)return;const c=e==="unified"?l.unifiedContentAST:e==="deletions"?l.deletionsContentAST:l.additionsContentAST;if(l.hunkSeparators==="metadata"){i!=null&&(l.pushToGutter(e,Ma({type:"metadata",content:i,isFirstHunk:o,isLastHunk:s})),c.push(Ma({type:"metadata",content:i,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&l.incrementRowCount(1));return}if(l.hunkSeparators==="simple"){t>0&&(l.pushToGutter(e,Ma({type:"simple",isFirstHunk:o,isLastHunk:!1})),c.push(Ma({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions"&&l.incrementRowCount(1));return}const u=OU(e,t),d=r>l.expansionLineCount,f=a?t:void 0;l.pushToGutter(e,Ma({type:l.hunkSeparators,content:Yw(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:o,isLastHunk:s})),c.push(Ma({type:l.hunkSeparators,content:Yw(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&l.incrementRowCount(1),l.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:a?{up:!o,down:!s,chunked:d}:void 0})}function iB(e){const t=e.hunks.at(-1);if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-(t.additionLineIndex+t.additionCount),r=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==r)throw new Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${r}) for ${e.name}`);return Math.min(n,r)}function oB(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function sB(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function aB(e){const t=e[0];if(t!=="+"&&t!=="-"&&t!==" "&&t!=="\\"){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}const n=e.substring(1);return{line:n===""?` `:n,type:t===" "?"context":t==="\\"?"metadata":t==="+"?"addition":"deletion"}}function lB(e,{cacheKey:t,isGitDiff:n=QV.test(e),oldFile:r,newFile:i,throwOnError:o=!1}={}){let s=0;const a=e.split(eU);let l;const c=r==null||i==null;let u=0,d=0;for(const f of a){const h=f.split(wf),m=h.shift();if(m==null){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}const p=m.match(tU);let g=0,b=0;if(p==null||l==null){if(l!=null){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:c,additionLines:!c&&r!=null&&i!=null?i.contents.split(wf):[],deletionLines:!c&&r!=null&&i!=null?r.contents.split(wf):[],cacheKey:t},l.additionLines.length===1&&i?.contents===""&&(l.additionLines.length=0),l.deletionLines.length===1&&r?.contents===""&&(l.deletionLines.length=0),h.unshift(m);for(const _ of h){const A=_.match(n?rU:nU);if(_.startsWith("diff --git")){const[,,M,,L]=_.trim().match(iU)??[];l.name=L.trim(),M!==L&&(l.prevName=M.trim())}else if(A!=null){const[,M,L]=A;M==="---"&&L!=="/dev/null"?(l.prevName=L.trim(),l.name=L.trim()):M==="+++"&&L!=="/dev/null"&&(l.name=L.trim())}else if(n){if(_.startsWith("new mode ")&&(l.mode=_.replace("new mode","").trim()),_.startsWith("old mode ")&&(l.prevMode=_.replace("old mode","").trim()),_.startsWith("new file mode")&&(l.type="new",l.mode=_.replace("new file mode","").trim()),_.startsWith("deleted file mode")&&(l.type="deleted",l.mode=_.replace("deleted file mode","").trim()),_.startsWith("similarity index")&&(_.startsWith("similarity index 100%")?l.type="rename-pure":l.type="rename-changed"),_.startsWith("index ")){const[,M,L,F]=_.trim().match(oU)??[];M!=null&&(l.prevObjectId=M),L!=null&&(l.newObjectId=L),F!=null&&(l.mode=F)}_.startsWith("rename from ")&&(l.prevName=_.replace("rename from ","")),_.startsWith("rename to ")&&(l.name=_.replace("rename to ","").trim())}}continue}let v,y;for(;h.length>0&&(h[h.length-1]===` `||h[h.length-1]==="\r"||h[h.length-1]===`\r `||h[h.length-1]==="");)h.pop();const T=parseInt(p[3]),k=parseInt(p[1]);u=c?u:k-1,d=c?d:T-1;const x={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(p[4]??"1"),additionStart:T,additionLines:g,deletionCount:parseInt(p[2]??"1"),deletionStart:k,deletionLines:b,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:p[5],hunkSpecs:m,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(x.additionCount)||isNaN(x.deletionCount)||isNaN(x.additionStart)||isNaN(x.deletionStart)){if(o)throw Error("parsePatchContent: invalid hunk metadata");console.error("parsePatchContent: invalid hunk metadata",x);continue}for(const _ of h){const A=aB(_);if(A==null){console.error("processFile: invalid rawLine:",_);continue}const{type:M,line:L}=A;if(M==="addition")(v==null||v.type!=="change")&&(v=xp("change",u,d),x.hunkContent.push(v)),d++,c&&l.additionLines.push(L),v.additions++,g++,y="addition";else if(M==="deletion")(v==null||v.type!=="change")&&(v=xp("change",u,d),x.hunkContent.push(v)),u++,c&&l.deletionLines.push(L),v.deletions++,b++,y="deletion";else if(M==="context")(v==null||v.type!=="context")&&(v=xp("context",u,d),x.hunkContent.push(v)),d++,u++,c&&(l.deletionLines.push(L),l.additionLines.push(L)),v.lines++,y="context";else if(M==="metadata"&&v!=null){if(v.type==="context"?(x.noEOFCRAdditions=!0,x.noEOFCRDeletions=!0):y==="deletion"?x.noEOFCRDeletions=!0:y==="addition"&&(x.noEOFCRAdditions=!0),c&&(y==="addition"||y==="context")){const F=l.additionLines.length-1;F>=0&&(l.additionLines[F]=ta(l.additionLines[F]))}if(c&&(y==="deletion"||y==="context")){const F=l.deletionLines.length-1;F>=0&&(l.deletionLines[F]=ta(l.deletionLines[F]))}}}x.additionLines=g,x.deletionLines=b,x.collapsedBefore=Math.max(x.additionStart-1-s,0),l.hunks.push(x),s=x.additionStart+x.additionCount-1;for(const _ of x.hunkContent)_.type==="context"?(x.splitLineCount+=_.lines,x.unifiedLineCount+=_.lines):(x.splitLineCount+=Math.max(_.additions,_.deletions),x.unifiedLineCount+=_.deletions+_.additions);x.splitLineStart=l.splitLineCount+x.collapsedBefore,x.unifiedLineStart=l.unifiedLineCount+x.collapsedBefore,l.splitLineCount+=x.collapsedBefore+x.splitLineCount,l.unifiedLineCount+=x.collapsedBefore+x.unifiedLineCount}if(l!=null){if(l.hunks.length>0&&!c&&l.additionLines.length>0&&l.deletionLines.length>0){const f=l.hunks[l.hunks.length-1],h=f.additionStart+f.additionCount-1,m=l.additionLines.length,p=Math.max(m-h,0);l.splitLineCount+=p,l.unifiedLineCount+=p}return n||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type="rename-changed":l.type="rename-pure":i!=null&&i.contents===""?l.type="deleted":r!=null&&r.contents===""&&(l.type="new")),l.type!=="rename-pure"&&l.type!=="rename-changed"&&(l.prevName=void 0),l}}function xp(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}function d1(e,t,n,r=!1){const i=lB(ZU(e.name,t.name,e.contents,t.contents,e.header,t.header),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return i}let cB=-1;var $9=class{static LoadedCustomComponent=C9;__id=`file-diff:${++cB}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;unsafeCSSStyle;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:Yn},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=new rB({...e,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new r9,this.scrollSyncManager=new MU,this.interactionManager=new n9("diff",s0(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let r,i;e:for(const o of this.fileDiff.hunks){let s=t==="deletions"?o.deletionStart:o.additionStart;const a=t==="deletions"?o.deletionCount:o.additionCount;let l=o.splitLineStart,c=o.unifiedLineStart;if(e=s+a){if(o===n){const u=e-(s+a);r=c+o.unifiedLineCount+u,i=l+o.splitLineCount+u;break e}continue}for(const u of o.hunkContent)if(u.type==="context")if(ethis.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML="",this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{overflow:t="scroll",diffStyle:n="split"}=this.options,{fileContainer:r,prerenderedHTML:i}=e;S9(r,i);for(const o of r.shadowRoot?.children??[]){if(o instanceof SVGElement){this.spriteSVG=o;continue}if(o instanceof HTMLElement){if(o instanceof HTMLPreElement){this.pre=o;for(const s of o.children)!(s instanceof HTMLElement)||s.tagName.toLowerCase()!=="code"||("deletions"in s.dataset&&(this.codeDeletions=s),"additions"in s.dataset&&(this.codeAdditions=s),"unified"in s.dataset&&(this.codeUnified=s));continue}if("diffsHeader"in o.dataset){this.headerElement=o;continue}if(o instanceof HTMLStyleElement&&o.hasAttribute(Eb)){this.unsafeCSSStyle=o;continue}}}if(this.pre!=null&&this.syncCodeNodesFromPre(this.pre),this.pre==null)this.render(e);else{const{lineAnnotations:o,oldFile:s,newFile:a,fileDiff:l}=e;this.fileContainer=r,delete this.pre.dataset.dehydrated,this.lineAnnotations=o??this.lineAnnotations,this.additionFile=a,this.deletionFile=s,this.fileDiff=l??(s!=null&&a!=null?d1(s,a):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),t==="scroll"&&n==="split"&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions)}}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({oldFile:this.deletionFile,newFile:this.additionFile,fileDiff:this.fileDiff,forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t,n=!1)=>{if(n){this.expandHunkFully(e);return}this.expandHunk(e,t)};expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.rerender()}expandHunkFully(e){this.hunksRenderer.expandHunkFully(e),this.rerender()}render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,lineAnnotations:i,fileContainer:o,containerWrapper:s,renderRange:a}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:l=!1}=this.options,c=l?void 0:a,u=e!=null&&t!=null&&(!c0(e,this.deletionFile)||!c0(t,this.additionFile));let d=n!=null&&n!==this.fileDiff;const f=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!l&&gh(c,this.renderRange)&&!r&&!f&&(n!=null&&n===this.fileDiff||n==null&&!u))return!1;const{renderRange:h}=this;if(this.renderRange=c,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&u&&(d=!0,this.fileDiff=d1(e,t)),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{diffStyle:m="split",disableErrorHandling:p=!1,disableFileHeader:g=!1,overflow:b="scroll"}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.headerPrefix!=null&&(this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerPrefix=void 0),this.headerMetadata!=null&&(this.headerMetadata.parentNode?.removeChild(this.headerMetadata),this.headerMetadata=void 0)),o=this.getOrCreateFileContainer(o,s),l){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const v=this.hunksRenderer.renderDiff(this.fileDiff,e9);v?.headerElement!=null&&this.applyHeaderToDOM(v.headerElement,o),this.renderSeparators([]),this.injectUnsafeCSS()}catch(v){if(p)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,o)}return!0}try{const v=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(r,f,u||d)&&this.applyPartialRender({previousRenderRange:h,renderRange:c}))){const y=this.hunksRenderer.renderDiff(this.fileDiff,c);if(y==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;y.headerElement!=null&&this.applyHeaderToDOM(y.headerElement,o),y.additionsContentAST!=null||y.deletionsContentAST!=null||y.unifiedContentAST!=null?this.applyHunksToDOM(v,y):this.pre!=null&&(this.pre.parentNode?.removeChild(this.pre),this.pre=void 0),this.renderSeparators(y.hunkData)}this.applyBuffers(v,c),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(v),this.resizeManager.setup(v,b==="wrap"),b==="scroll"&&m==="split"?this.scrollSyncManager.setup(v,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(v){if(p)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,o)}return!0}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.separatorCache.values())e.parentNode?.removeChild(e);this.separatorCache.clear();for(const{element:e}of this.annotationCache.values())e.parentNode?.removeChild(e);this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(e){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:r}of this.separatorCache.values())r.parentNode?.removeChild(r);this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const r of e){const i=r.slotName;let o=this.separatorCache.get(i);if(o==null||!sB(r,o.hunkData)){o?.element.parentNode?.removeChild(o.element);const s=document.createElement("div");s.style.display="contents",s.slot=r.slotName,s.appendChild(t(r,this)),this.fileContainer.appendChild(s),o={element:s,hunkData:r},this.separatorCache.set(i,o)}n.delete(i)}for(const[r,{element:i}]of n.entries())this.separatorCache.delete(r),i.parentNode?.removeChild(i)}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.parentNode?.removeChild(n);this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,r]of this.lineAnnotations.entries()){const i=`${n}-${ea(r)}`;let o=this.annotationCache.get(i);if(o==null||!oB(r,o.annotation)){o?.element.parentElement?.removeChild(o.element);const s=t(r);if(s==null)continue;o={element:y9(ea(r)),annotation:r},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(i,o)}e.delete(i)}for(const[n,{element:r}]of e.entries())this.annotationCache.delete(n),r.parentNode?.removeChild(r)}renderGutterUtility(){const e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.parentNode?.removeChild(this.gutterUtilityContent),this.gutterUtilityContent=void 0;return}const n=w9();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const n=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(r0),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=v9;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const t of Array.from(e.children))t instanceof HTMLElement&&("unified"in t.dataset?this.codeUnified=t:"deletions"in t.dataset?this.codeDeletions=t:"additions"in t.dataset&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const n=Bi(e);if(n!==this.lastRenderedHeaderHTML){const a=document.createElement("div");a.innerHTML=n;const l=a.firstElementChild;if(!(l instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(l,this.headerElement):t.shadowRoot?.prepend(l),this.headerElement=l,this.lastRenderedHeaderHTML=n}if(this.isContainerManaged)return;const{renderHeaderPrefix:r,renderHeaderMetadata:i}=this.options;this.headerPrefix!=null&&this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const o=r?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0,s=i?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0;o!=null&&(this.headerPrefix=document.createElement("div"),this.headerPrefix.slot=Cb,o instanceof Element?this.headerPrefix.appendChild(o):this.headerPrefix.innerText=`${o}`,t.appendChild(this.headerPrefix)),s!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=Ib,s instanceof Element?this.headerMetadata.appendChild(s):this.headerMetadata.innerText=`${s}`,t.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;e==null||e===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=k9(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=x9(e))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,r=(this.options.hunkSeparators??"line-info")==="line-info",i=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1;const s=[],a=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),c=this.hunksRenderer.renderCodeAST("additions",t);a!=null?(o=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=xf({code:this.codeUnified,columnType:"unified",rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(a),s.push(this.codeUnified)):l!=null||c!=null?(l!=null?(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=xf({code:this.codeDeletions,columnType:"deletions",rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),s.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),c!=null?(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=xf({code:this.codeAdditions,columnType:"additions",rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(c),s.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),s.length===0?e.textContent="":o&&e.replaceChildren(...s),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:o,options:{diffStyle:s="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(s,r,o,i);if(a==null)return!1;const l=e.startingLine,c=t.startingLine,u=l+e.totalLines,d=c+t.totalLines,f=Math.max(l,c),h=Math.min(u,d);if(h<=f)return!1;const m=Math.max(0,f-l),p=Math.max(0,u-h),g=this.trimColumns({columns:a,trimStart:m,trimEnd:p,previousStart:l,overlapStart:f,overlapEnd:h,diffStyle:s});if(g<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(_<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:x,totalLines:_,bufferBefore:0,bufferAfter:0})},y=v(c,Math.max(f-c,0));if(y==null&&ch)return!1;const k=(x,_)=>{if(x!=null){if(s==="unified"&&!Array.isArray(a))this.insertPartialHTML(s,a,x,_);else if(s==="split"&&Array.isArray(a))this.insertPartialHTML(s,a,x,_);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");b+=x.rowCount}};return this.cleanupErrorWrapper(),k(y,"afterbegin"),k(T,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(s,a,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,r){if(e==="unified"&&!Array.isArray(t)){const i=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,i,r)}else if(e==="split"&&Array.isArray(t)){const i=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],i,r),this.renderPartialColumn(t[1],o,r)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const r=Xw(t[0]),i=Xw(t[1]);if(r==null||i==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const o=i.at(0);n==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);const s=i.at(-1);n==="afterbegin"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const s=this.getBufferSize(t.dataset);s!=null&&(o?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,s+e),this.updateBufferSize(n,s+e))}applyRowSpan(e,t,n){const r=i=>{i!=null&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))r(t);else if(e==="split"&&Array.isArray(t))r(t[0]),r(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let r=0,i=0,o=0,s=!1;const a=n>=0;if(e==null)return 0;const l=Array.from(e.content.children),c=Array.from(e.gutter.children);if(l.length!==c.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;o0||a&&r>=n)&&(u.remove(),d.remove(),t>0&&(t--,t===0&&(s=!0)),i++),r++;continue}if("separator"in u.dataset&&"separator"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="metadata"&&"noNewline"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="buffer"&&"contentBuffer"in d.dataset){const f=this.getBufferSize(d.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const h=Math.min(t,f),m=f-h;m>0?(this.updateBufferSize(u,m),this.updateBufferSize(d,m),i+=h):(u.remove(),d.remove(),i+=f),t-=h}else if(a){const h=r,m=r+f-1;if(n<=h)u.remove(),d.remove(),i+=f;else if(n<=m){const p=m-n+1,g=f-p;this.updateBufferSize(u,g),this.updateBufferSize(d,g),i+=p}}r+=f;continue}throw console.error({gutterElement:u,contentElement:d}),new Error("FileDiff.trimColumnRows: unknown row elements")}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:o,trimStart:s}){const a=Math.max(0,r-i),l=n-i;if(l<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const c=s>0,u=o>0;if(!c&&!u)return 0;const d=c?a:0,f=u?l:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t==="split"&&Array.isArray(e)){const h=this.trimColumnRows(e[0],d,f),m=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&h!==m)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?h:m}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(o){if(o==null)return;const s=o.children[0],a=o.children[1];if(!(!(s instanceof HTMLElement)||!(a instanceof HTMLElement)||s.dataset.gutter==null||a.dataset.content==null))return{gutter:s,content:a}}if(e==="unified")return i(t);{const o=i(n),s=i(r);return o!=null||s!=null?[o,s]:void 0}}applyBuffers(e,t){const{disableVirtualizationBuffers:n=!1}=this.options;if(n||t==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{themeStyles:t,baseThemeType:n,additionsContentAST:r,deletionsContentAST:i,totalLines:o}){const{diffIndicators:s="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:c="scroll",themeType:u="system",diffStyle:d="split"}=this.options,f={type:"diff",diffIndicators:s,disableBackground:a,disableLineNumbers:l,overflow:c,split:d==="unified"?!1:r!=null&&i!=null,themeStyles:t,themeType:n??u,totalLines:o};b9(f,this.appliedPreAttributes)||(_9(e,f),this.appliedPreAttributes=f)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();const n=this.getOrCreatePreNode(t);n.innerHTML="",n.parentNode?.removeChild(n),this.pre=void 0,this.appliedPreAttributes=void 0;const r=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",r.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function Xw(e){if(!(e==null||e.type!=="element"))return e.children??[]}const Sf=new Set;let _f=new Set,f1=null,h1=!1;function ai(e){if(h1){Sf.add(e);return}_f.add(e),f1??=requestAnimationFrame(L9)}function L9(e){h1=!0;for(const t of _f)try{t(e)}catch(n){console.error(n)}_f.clear(),Sf.size>0?(_f=new Set(Sf),Sf.clear(),f1=requestAnimationFrame(L9)):f1=null,h1=!1}let uB=-1;var dB=class extends I9{__id=`virtualized-file:${++uB}`;top;height=0;heightCache=new Map;isVisible=!1;constructor(e,t,n=Tb,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}getLineHeight(e,t=!1){const n=this.heightCache.get(e);if(n!=null)return n;const r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(e==null)return;const t=this.options.overflow,n=this.options.collapsed;super.setOptions(e),(t!==this.options.overflow||n!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){if(this.fileContainer==null||this.file==null){this.height=0;return}const{overflow:e="scroll"}=this.options;if(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),e==="scroll"&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let t=!1;if(this.code==null)return;const n=this.code.children[1];if(n instanceof HTMLElement){for(const r of n.children){if(!(r instanceof HTMLElement))continue;const i=r.dataset.lineIndex;if(i==null)continue;const o=Number(i);let s=r.getBoundingClientRect().height,a=!1;r.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in r.nextElementSibling.dataset||"noNewline"in r.nextElementSibling.dataset)&&("noNewline"in r.nextElementSibling.dataset&&(a=!0),s+=r.nextElementSibling.getBoundingClientRect().height);const l=this.getLineHeight(o,a);s!==l&&(t=!0,s===this.metrics.lineHeight*(a?2:1)?this.heightCache.delete(o):this.heightCache.set(o,s))}(t||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render({file:this.file}));cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}computeApproximateSize(){const e=this.height===0;if(this.height=0,this.file==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:r="scroll"}=this.options,{diffHeaderHeight:i,fileGap:o,lineHeight:s}=this.metrics,a=this.getOrCreateLineCache(this.file);if(t?this.height+=o:this.height+=i,!n&&(r==="scroll"&&this.lineAnnotations.length===0?this.height+=this.getOrCreateLineCache(this.file).length*s:l0({lines:a,callback:({lineIndex:l})=>{this.height+=this.getLineHeight(l,!1)}}),a.length>0&&(this.height+=o),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e)){const l=this.fileContainer.getBoundingClientRect();l.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:l.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}}setVisibility(e){this.fileContainer!=null&&(e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}render({fileContainer:e,file:t,...n}){const r=this.fileContainer==null;if(this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(r?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);const i=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(this.file,this.top,i);return super.render({file:this.file,fileContainer:e,renderRange:o,...n})}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:i=!1,overflow:o="scroll"}=this.options,{diffHeaderHeight:s,fileGap:a,hunkLineCount:l,lineHeight:c}=this.metrics,u=this.getOrCreateLineCache(e),d=u.length,f=this.height,h=i?a:s;if(tr)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-h-a};if(d<=l)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};const m=Math.ceil(Math.max(r-n,0)/c),p=Math.ceil(m/l)*l+l*2,g=p/l,b=(n+r)/2;if(o==="scroll"&&this.lineAnnotations.length===0){const V=Math.floor((b-(t+h))/c),Z=Math.floor(V/l)-Math.floor(g/2),W=Math.ceil(d/l),G=Math.max(0,Math.min(Z,W))*l,Y=Z<0?p+Z*l:p,te=G*c,we=Math.min(Y,d-G);return{startingLine:G,totalLines:Y,bufferBefore:te,bufferAfter:Math.max(0,(d-G-we)*c)}}const v=g,y=[];let T=t+h,k=0,x,_,A;if(l0({lines:u,callback:({lineIndex:V})=>{const Z=k%l===0;if(Z&&(y.push(T-(t+h)),A!=null)){if(A<=0)return!0;A--}const W=this.getLineHeight(V,!1),G=Math.floor(k/l);return T>n-W&&Tb&&(_??=G),A==null&&T>=r&&Z&&(A=v),k++,T+=W,!1}}),x==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-h-a};const M=y.length;_??=x;const L=Math.round(_-g/2),F=Math.max(0,M-g),R=Math.max(0,Math.min(L,F)),E=R*l,S=L<0?p+L*l:p,$=y[R]??0,O=R+S/l;return{startingLine:E,totalLines:S,bufferBefore:$,bufferAfter:Othis.fileContainer==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}expandHunkFully(e){this.hunksRenderer.expandHunkFully(e),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}setVisibility(e){this.fileContainer!=null&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){const e=this.height===0;if(this.height=0,this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=il,hunkSeparators:o="line-info"}=this.options,{diffHeaderHeight:s,fileGap:a,hunkSeparatorHeight:l}=this.metrics,c=this.getDiffStyle(),u=o!=="simple"&&o!=="metadata"&&o!=="line-info-basic"?a:0;if(t?o!=="simple"&&o!=="metadata"&&(this.height+=a):this.height+=s,!r&&(u0({diff:this.fileDiff,diffStyle:c,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:d,collapsedBefore:f,collapsedAfter:h,deletionLine:m,additionLine:p})=>{const g=p!=null?p.splitLineIndex:m.splitLineIndex,b=p!=null?p.unifiedLineIndex:m.unifiedLineIndex,v=(p?.noEOFCR??!1)||(m?.noEOFCR??!1);f>0&&(d>0&&(this.height+=u),this.height+=l+u),this.height+=this.getLineHeight(c==="split"?g:b,v),h>0&&o!=="simple"&&(this.height+=u+l)}}),this.fileDiff.hunks.length>0&&(this.height+=a),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e)){const d=this.fileContainer.getBoundingClientRect();d.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:d.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...i}={}){const o=this.fileContainer==null;if(this.fileDiff??=r??(t!=null&&n!=null?d1(t,n):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(o?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);const s=this.virtualizer.getWindowSpecs(),a=this.computeRenderRangeFromWindow(this.fileDiff,this.top,s);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:a,oldFile:t,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??"split"}getExpandedRegion(e,t,n){if(n<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};const{expandUnchanged:r=!1,collapsedContextThreshold:i=il}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};const o=this.hunksRenderer.getExpandedHunk(t),s=Math.min(Math.max(o.fromStart,0),n),a=Math.min(Math.max(o.fromEnd,0),n),l=s+a,c=l>=n;return{fromStart:s,fromEnd:a,collapsedLines:Math.max(n-l,0),renderAll:c}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const i of e.hunks)n+=t==="split"?i.splitLineCount:i.unifiedLineCount;return n}for(const[i,o]of e.hunks.entries()){const s=t==="split"?o.splitLineCount:o.unifiedLineCount;n+=s;const a=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:c,renderAll:u}=this.getExpandedRegion(e.isPartial,i,a);a>0&&(n+=u?a:l+c)}const r=e.hunks.at(-1);if(r!=null&&gB(e)){const i=e.additionLines.length-(r.additionLineIndex+r.additionCount),o=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&i!==o)throw new Error(`VirtualizedFileDiff: trailing context mismatch (additions=${i}, deletions=${o}) for ${e.name}`);const s=Math.min(i,o);if(r!=null&&s>0){const{fromStart:a,renderAll:l}=this.getExpandedRegion(e.isPartial,e.hunks.length,s);n+=l?s:a}}return n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:i=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=il,hunkSeparators:a="line-info"}=this.options,{diffHeaderHeight:l,fileGap:c,hunkLineCount:u,hunkSeparatorHeight:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),m=this.height,p=this.getExpandedLineCount(e,h),g=i?c:l;if(tr)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-c};if(p<=u||e.hunks.length===0)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};const b=Math.ceil(Math.max(r-n,0)/f),v=Math.ceil(b/u)*u+u,y=v/u,T=y,k=[],x=(n+r)/2,_=a==="simple"||a==="metadata"||a==="line-info-basic"?0:c;let A=t+g,M=0,L,F,R;if(u0({diff:e,diffStyle:h,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:Y,collapsedBefore:te,collapsedAfter:we,deletionLine:$e,additionLine:Le})=>{const ct=Le!=null?Le.splitLineIndex:$e.splitLineIndex,Me=Le!=null?Le.unifiedLineIndex:$e.unifiedLineIndex,ke=(Le?.noEOFCR??!1)||($e?.noEOFCR??!1);let gt=te>0?d+_+(Y>0?_:0):0;Y===0&&a==="simple"&&(gt=0),A+=gt;const jt=M%u===0;if(jt&&(k.push(A-(t+g+gt)),R!=null)){if(R<=0)return!0;R--}const Kt=this.getLineHeight(h==="split"?ct:Me,ke),oi=Math.floor(M/u);return A>n-Kt&&Ax&&(F=oi),R==null&&A>=r&&jt&&(R=T),M++,A+=Kt,we>0&&a!=="simple"&&(A+=d+_),!1}}),L==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-c};const E=k.length;F??=L;const S=Math.round(F-y/2),$=Math.max(0,E-y),O=Math.max(0,Math.min(S,$)),V=O*u,Z=S<0?v+S*u:v,W=k[O]??0,G=O+Z/u;return{startingLine:V,totalLines:Z,bufferBefore:W,bufferAfter:G=t||i){const u=Math.max(e-r,0),d=Math.min(e+a,t)-r;return{top:u,bottom:Math.max(d,u)}}let l=e+n/2-s/2,c=l+s;return l<0&&(l=0),c>t&&(c=t),l=Math.floor(Math.max(l-r,0)),{top:l,bottom:Math.ceil(Math.max(Math.min(c,t)-r,l))}}const A9=1e3,yB=A9*4,wB=[0,1e-6,.99999,1],kB={overscrollSize:A9,intersectionObserverMargin:yB,resizeDebugging:!1};let Dd=0,xB=-1;var M9=class Ri{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++xB}`;config;type="basic";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(t){this.config={...kB,...t}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:wB,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{Ri.__STOP?(Ri.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Ri.__lastScrollPosition}),ai(this.computeRenderRangeAndEmit)):(Ri.__lastScrollPosition=this.getScrollTop(),Ri.__STOP=!0)};for(const[r,i]of this.connectQueue.entries())this.connect(r,i);this.connectQueue.clear(),this.markDOMDirty(),ai(this.computeRenderRangeAndEmit)}}instanceChanged(t){this.instancesChanged.add(t),this.markDOMDirty(),ai(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=Qw({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(t,n){const r=this.getScrollTop(),i=this.getHeight(),o=this.config.intersectionObserverMargin,s=r-o,a=r+i+o;return!(ta)}handleContainerResize=t=>{if(this.root==null)return;let n=!1;for(const r of t){const i=r.borderBoxSize[0].blockSize;this.root instanceof Document?i!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:i-Dd,newSize:i}),Dd=i)):r.target===this.root?i!==this.height&&(this.heightDirty=!0,n=!0):r.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:i-Dd,newSize:i}),Dd=i))}n&&ai(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(t){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),t??=this.root.firstElementChild??void 0,t instanceof HTMLElement&&(this.contentContainer=t,this.resizeObserver?.observe(t))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(t){return this.getScrollTop()+dc(t,this.getScrollContainerElement())}connect(t,n){if(this.observers.has(t))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(t,n):(this.intersectionObserver.observe(t),this.observers.set(t,n),this.instancesChanged.add(n),this.markDOMDirty(),ai(this.computeRenderRangeAndEmit)),()=>this.disconnect(t)}disconnect(t){const n=this.observers.get(t);this.connectQueue.delete(t),n!=null&&(this.intersectionObserver?.unobserve(t),this.observers.delete(t),this.visibleInstances.delete(t)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),ai(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{Ri.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,ai(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{Ri.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,ai(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{Ri.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,ai(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(Ri.__STOP)return;const t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;if(this.instancesChanged.size===0){const i=Qw({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(bB(this.windowSpecs,i)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;this.windowSpecs=i}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const n=this.getScrollAnchor(this.height),r=new Set;for(const i of t?this.observers.values():this.visibleInstances.values())i.onRender(t)&&r.add(i);for(const i of this.instancesChanged)r.has(i)||i.onRender(t)&&r.add(i);this.scrollFix(n),this.instancesChanged.size>0&&this.markDOMDirty();for(const i of r)i.reconcileHeights();(this.instancesChanged.size>0||t)&&ai(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(t){if(t==null)return;const n=this.getScrollContainerElement(),{lineIndex:r,lineOffset:i,fileElement:o,fileOffset:s,fileTypeOffset:a}=t;if(r!=null&&i!=null){const c=o.shadowRoot?.querySelector(`[data-line][data-line-index="${r}"]`);if(c instanceof HTMLElement){const u=dc(c,n);if(u!==i){const d=u-i;this.applyScrollFix(d)}return}}const l=dc(o,n);if(a==="top")l!==s&&this.applyScrollFix(l-s);else{const c=l+o.getBoundingClientRect().height;c!==s&&this.applyScrollFix(c-s)}}applyScrollFix(t){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+t,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+t,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(t){const n=this.getScrollContainerElement();let r;for(const[i]of this.visibleInstances.entries()){const o=dc(i,n),s=o+i.offsetHeight;let a,l;s<=0?(a=s,l="bottom"):(a=o,l="top");let c,u;if(s>0&&o=0&&(r.fileOffset<0||ar.fileOffset))&&(d=!0),d&&(r={fileElement:i,fileTypeOffset:l,fileOffset:a,lineIndex:c,lineOffset:u})}return r}handleIntersectionChange=t=>{this.scrollDirty=!0;for(const{target:n,isIntersecting:r}of t){if(!(n instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const i=this.observers.get(n);if(i==null)throw new Error("Virtualizer.handleIntersectionChange: no instance for target");r&&!this.visibleInstances.has(n)?(i.setVisibility(!0),this.visibleInstances.set(n,i),this.visibleInstancesDirty=!0):!r&&this.visibleInstances.has(n)&&(i.setVisibility(!1),this.visibleInstances.delete(n),this.visibleInstancesDirty=!0)}this.visibleInstancesDirty&&ai(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let t=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return t=Math.max(0,Math.min(t,this.getScrollHeight()-this.getHeight())),this.scrollTop=t,t}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function dc(e,t){const n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}function e3(e){const t=[];for(const n of e){const r=Qs.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(r)}return t}function t3(e){for(const t of Array.isArray(e)?e:[e])if(!Qs.has(t))return!1;return!0}async function n3(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const i=s9(r)??o9(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function r3(e){const t=[];for(const n of e){const r=Io.get(n);if(r==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);t.push(r)}return t}async function i3(e){const t=[],n=[];for(const r of e){const i=l9(r)??a9(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r)i!=null&&t.push(i)}),t}$b("OpenCode",()=>Promise.resolve({name:"OpenCode",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}}));function SB(e){let t=e;const n=/\$\$([\s\S]*?)\$\$/g;t=t.replace(n,(i,o)=>{try{return jg.renderToString(o,{displayMode:!0,throwOnError:!1})}catch{return`$$${o}$$`}});const r=/(?{try{return jg.renderToString(o,{displayMode:!1,throwOnError:!1})}catch{return`$${o}$`}}),t}function _B(e){const t=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return e.split(t).map((r,i)=>i%2===1?r:SB(r)).join("")}async function CB(e){const t=/

    ([\s\S]*?)<\/code><\/pre>/g,n=[...e.matchAll(t)];if(n.length===0)return e;const r=await gl({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});let i=e;for(const o of n){const[s,a,l]=o,c=l.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");let u=a||"text";u in eu||(u="text"),r.getLoadedLanguages().includes(u)||await r.loadLanguage(u);const d=r.codeToHtml(c,{lang:u,theme:"OpenCode",tabindex:!1});i=i.replace(s,()=>d)}return i}const{use:Phe,provider:IB}=tn({name:"Marked",init:e=>{const t=Lt.use({renderer:{link({href:n,title:r,text:i}){const o=r?` title="${r}"`:"";return`${i}`}}},tz({throwOnError:!1,nonStandard:!0}),iz({async highlight(n,r){const i=await gl({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});return r in eu||(r="text"),i.getLoadedLanguages().includes(r)||await i.loadLanguage(r),i.codeToHtml(n,{lang:r||"text",theme:"OpenCode",tabindex:!1})}}));if(e.nativeParser){const n=e.nativeParser;return{async parse(r){const i=await n(r),o=_B(i);return CB(o)}}}return t}});function ut(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCharCode(r)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function EB(e){const t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}function d0(e){if(!e)return;let t=2166136261;for(let n=0;n>>0).toString(36)}function o3(e,t=5e5){if(!e)return;if(e.length<=t)return d0(e);const n=4096,i=[0,Math.floor(e.length*.25),Math.floor(e.length*.5),Math.floor(e.length*.75),e.length-n].map(o=>{const s=Math.max(0,Math.min(e.length-n,o-Math.floor(n/2)));return d0(e.slice(s,s+n))??""}).join(":");return`${e.length}:${i}`}const O9=`
    [data-annotation-slot] {
      padding: 12px;
      box-sizing: border-box;
    }
    
    [data-component="line-comment"] {
      position: absolute;
      right: 24px;
      z-index: var(--line-comment-z, 30);
    }
    
    [data-component="line-comment"][data-inline] {
      position: relative;
      right: auto;
      display: flex;
      width: 100%;
      min-width: 0;
      align-items: flex-start;
    }
    
    [data-component="line-comment"][data-open] {
      z-index: var(--line-comment-open-z, 100);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"] {
      width: 20px;
      height: 20px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--icon-interactive-base);
      box-shadow: var(--shadow-xs);
      cursor: default;
      border: none;
    }
    
    [data-component="line-comment"][data-variant="add"] [data-slot="line-comment-button"] {
      background: var(--syntax-diff-add);
    }
    
    [data-component="line-comment"] [data-component="icon"] {
      color: var(--white);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-icon"] {
      width: 12px;
      height: 12px;
      color: var(--white);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"]:focus {
      outline: none;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"]:focus-visible {
      box-shadow: var(--shadow-xs-border-focus);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-popover"] {
      position: absolute;
      top: calc(100% + 4px);
      right: -8px;
      z-index: var(--line-comment-popover-z, 40);
      min-width: 200px;
      max-width: none;
      box-sizing: border-box;
      border-radius: 8px;
      background: var(--surface-raised-stronger-non-alpha);
      box-shadow: var(--shadow-xxs-border);
      padding: 12px;
    }
    
    [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"] {
      position: relative;
      top: auto;
      right: auto;
      margin-left: 8px;
      flex: 1 1 0%;
      width: auto;
      max-width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"][data-inline-body] {
      margin-left: 0;
    }
    
    [data-component="line-comment"][data-inline][data-variant="default"] [data-slot="line-comment-popover"][data-inline-body] {
      cursor: pointer;
    }
    
    [data-component="line-comment"][data-variant="editor"] [data-slot="line-comment-popover"] {
      width: 380px;
      max-width: none;
      padding: 8px;
      border-radius: 14px;
    }
    
    [data-component="line-comment"][data-inline][data-variant="editor"] [data-slot="line-comment-popover"] {
      width: 100%;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-content"] {
      display: flex;
      flex-direction: column;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-head"] {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-text"] {
      flex: 1;
      min-width: 0;
      font-family: var(--font-family-sans);
      font-size: var(--font-size-base);
      font-weight: var(--font-weight-regular);
      line-height: var(--line-height-x-large);
      letter-spacing: var(--letter-spacing-normal);
      color: var(--text-strong);
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-tools"] {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-label"],
    [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      font-weight: var(--font-weight-medium);
      line-height: var(--line-height-large);
      letter-spacing: var(--letter-spacing-normal);
      color: var(--text-weak);
      min-width: 0;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-editor"] {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-textarea"] {
      width: 100%;
      box-sizing: border-box;
      resize: vertical;
      padding: 8px;
      border-radius: var(--radius-md);
      background: var(--surface-base);
      border: 1px solid var(--border-base);
      color: var(--text-strong);
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      line-height: var(--line-height-large);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-textarea"]:focus {
      outline: none;
      box-shadow: var(--shadow-xs-border-select);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-actions"] {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      padding-left: 8px;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
      flex: 1 1 220px;
      margin-right: auto;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"] {
      border: 1px solid var(--border-base);
      background: var(--surface-base);
      color: var(--text-strong);
      border-radius: var(--radius-md);
      height: 28px;
      padding: 0 10px;
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      font-weight: var(--font-weight-medium);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="ghost"] {
      background: transparent;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="primary"] {
      background: var(--text-strong);
      border-color: var(--text-strong);
      color: var(--background-base);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"]:disabled {
      opacity: 0.5;
      pointer-events: none;
    }
    `;let Sp=!1;function Dhe(){if(Sp||typeof document>"u")return;const e="opencode-line-comment-styles";if(document.getElementById(e)){Sp=!0;return}const t=document.createElement("style");t.id=e,t.textContent=O9,document.head.appendChild(t),Sp=!0}const TB=`
    [data-diff],
    [data-file] {
      --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
      --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark( color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
      --diffs-bg-hover: var(--diffs-bg-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))));
      --diffs-bg-context: var(--diffs-bg-context-override, light-dark( color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
      --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark( color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
      --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark));
      --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
      --diffs-deletion-base: var(--syntax-diff-delete);
      --diffs-addition-base: var(--syntax-diff-add);
      --diffs-modified-base: var(--syntax-diff-unknown);
      --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark( color-mix(in lab, var(--diffs-bg) 98%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-number: var(--diffs-bg-deletion-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-hover: var(--diffs-bg-deletion-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / 0.7), rgb(from var(--diffs-deletion-base) r g b / 0.1)));
      --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark( color-mix(in lab, var(--diffs-bg) 98%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-addition-base))));
      --diffs-bg-addition-number: var(--diffs-bg-addition-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))));
      --diffs-bg-addition-hover: var(--diffs-bg-addition-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))));
      --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / 0.07), rgb(from var(--diffs-addition-base) r g b / 0.1)));
      --diffs-selection-base: var(--surface-warning-strong);
      --diffs-selection-border: var(--border-warning-base);
      --diffs-selection-number-fg: #1c1917;
      /* Use explicit alpha instead of color-mix(..., transparent) to avoid Safari's non-premultiplied interpolation bugs. */
      --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--surface-warning-base) r g b / 0.65));
      --diffs-bg-selection-number: var(
        --diffs-bg-selection-number-override,
        rgb(from var(--surface-warning-base) r g b / 0.85)
      );
      --diffs-bg-selection-text: rgb(from var(--surface-warning-strong) r g b / 0.2);
    }
    
    :host([data-color-scheme='dark']) [data-diff],
    :host([data-color-scheme='dark']) [data-file] {
      --diffs-selection-number-fg: #fdfbfb;
      --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--solaris-dark-6) r g b / 0.65));
      --diffs-bg-selection-number: var(
        --diffs-bg-selection-number-override,
        rgb(from var(--solaris-dark-6) r g b / 0.85)
      );
    }
    
    [data-diff] ::selection,
    [data-file] ::selection {
      background-color: var(--diffs-bg-selection-text);
    }
    
    ::highlight(opencode-find) {
      background-color: rgb(from var(--surface-warning-base) r g b / 0.35);
    }
    
    ::highlight(opencode-find-current) {
      background-color: rgb(from var(--surface-warning-strong) r g b / 0.55);
    }
    
    [data-diff] [data-line][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-file] [data-line][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-diff] [data-column-number][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-file] [data-column-number][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-diff] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-file] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-diff] [data-line][data-selected-line] {
      background-color: var(--diffs-bg-selection);
      box-shadow: inset 2px 0 0 var(--diffs-selection-border);
    }
    
    [data-file] [data-line][data-selected-line] {
      background-color: var(--diffs-bg-selection);
      box-shadow: inset 2px 0 0 var(--diffs-selection-border);
    }
    
    [data-diff] [data-column-number][data-selected-line] {
      background-color: var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-file] [data-column-number][data-selected-line] {
      background-color: var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-diff] [data-column-number][data-line-type='context'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='context-expanded'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='change-addition'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='change-deletion'][data-selected-line] {
      color: var(--diffs-selection-number-fg);
    }
    
    /* The deletion word-diff emphasis is stronger than additions; soften it while selected so the selection highlight reads consistently. */
    [data-diff] [data-line][data-line-type='change-deletion'][data-selected-line] {
      --diffs-bg-deletion-emphasis: light-dark(
        rgb(from var(--diffs-deletion-base) r g b / 0.07),
        rgb(from var(--diffs-deletion-base) r g b / 0.1)
      );
    }
    
    [data-diff-header],
    [data-diff],
    [data-file] {
      [data-separator] {
        height: 24px;
      }
      [data-column-number] {
        background-color: var(--background-stronger);
        cursor: default !important;
      }
    
      &[data-interactive-line-numbers] [data-column-number] {
        cursor: default !important;
      }
    
      &[data-interactive-lines] [data-line] {
        cursor: auto !important;
      }
      [data-code] {
        overflow-x: auto !important;
        overflow-y: clip !important;
      }
    }
    
    ${O9}
    
    `;function P9(e){return{theme:"OpenCode",themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:e??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:e==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:TB}}const $B={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function D9(e){const t=e.closest("[data-line], [data-alt-line]");if(t instanceof HTMLElement){const r=t.dataset.lineType;if(r==="change-deletion")return"deletions";if(r==="change-addition"||r==="change-additions")return"additions"}const n=e.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function m1(e,t){const n=t.dataset.lineIndex;if(!n)return;const r=n.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(r.length!==0)return e&&r.length===2?r[1]:r[0]}function f0(e,t,n,r){const i=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(s=>s instanceof HTMLElement);if(i.length===0)return;const o=r??"additions";for(const s of i)if(D9(s)===o||parseInt(s.dataset.altLine??"",10)===n)return m1(t,s)}function s3(e,t){if(!t)return t;if(!e)return;const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=f0(e,r,t.start,t.side),o=f0(e,r,t.end,t.endSide??t.side);if(i===void 0||o===void 0)return e.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=o)return t;const s=t.endSide??t.side,a={start:t.end,end:t.start};return s&&(a.side=s),t.endSide&&t.side&&(a.endSide=t.side),a}function R9(e){const t=e.dataset.lineAnnotation?.split(",")[1];if(!t)return;const n=parseInt(t,10);if(!Number.isNaN(n))return n}function N9(e){const t=Array.from(e.querySelectorAll("[data-comment-selected]"));for(const n of t)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function LB(e,t){N9(e);const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Array.from(n.querySelectorAll("[data-line-index]")).filter(s=>s instanceof HTMLElement);if(i.length===0)return;const o=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(s=>s instanceof HTMLElement);for(const s of t){const a=f0(e,r,s.start,s.side);if(a===void 0)continue;const l=s.end===s.start&&(s.endSide==null||s.endSide===s.side)?a:f0(e,r,s.end,s.endSide??s.side);if(l===void 0)continue;const c=Math.min(a,l),u=Math.max(a,l);for(const d of i){const f=m1(r,d);f===void 0||fu||d.setAttribute("data-comment-selected","")}for(const d of o){const f=R9(d);f===void 0||fu||d.setAttribute("data-comment-selected","")}}}function AB(e,t){N9(e);const n=Array.from(e.querySelectorAll("[data-line-annotation]")).filter(r=>r instanceof HTMLElement);for(const r of t){const i=Math.max(1,Math.min(r.start,r.end)),o=Math.max(r.start,r.end);for(let s=i;s<=o;s++){const a=Array.from(e.querySelectorAll(`[data-line="${s}"], [data-column-number="${s}"]`));for(const l of a)l instanceof HTMLElement&&l.setAttribute("data-comment-selected","")}for(const s of n){const a=R9(s);a===void 0||ao||s.setAttribute("data-comment-selected","")}}}const h0=Symbol("store-raw"),ol=Symbol("store-node"),po=Symbol("store-has"),z9=Symbol("store-self");function j9(e){let t=e[ki];if(!t&&(Object.defineProperty(e,ki,{value:t=new Proxy(e,PB)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,o=n.length;ie[ki][t]),n}function F9(e){bg()&&ru(m0(e,ol),z9)()}function OB(e){return F9(e),Reflect.ownKeys(e)}const PB={get(e,t,n){if(t===h0)return e;if(t===ki)return n;if(t===Of)return F9(e),n;const r=m0(e,ol),i=r[t];let o=i?i():e[t];if(t===ol||t===po||t==="__proto__")return o;if(!i){const s=Object.getOwnPropertyDescriptor(e,t);bg()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(o=ru(r,t,o)())}return Zi(o)?j9(o):o},has(e,t){return t===h0||t===ki||t===Of||t===ol||t===po||t==="__proto__"?!0:(bg()&&ru(m0(e,po),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:OB,getOwnPropertyDescriptor:MB};function cr(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],o=e.length;n===void 0?(delete e[t],e[po]&&e[po][t]&&i!==void 0&&e[po][t].$()):(e[t]=n,e[po]&&e[po][t]&&i===void 0&&e[po][t].$());let s=m0(e,ol),a;if((a=ru(s,t,i))&&a.$(()=>n),Array.isArray(e)&&e.length!==o){for(let l=e.length;l1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l1){_c(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(i,n),o===i)||r===void 0&&o==null||(o=na(o),r===void 0||Zi(i)&&Zi(o)&&!Array.isArray(o)?H9(i,o):cr(e,r,o))}function Ue(...[e,t]){const n=na(e||{}),r=Array.isArray(n),i=j9(n);function o(...s){et(()=>{r&&s.length===1?DB(n,s[0]):_c(n,s)})}return[i,o]}const p1=Symbol("store-root");function Wa(e,t,n,r,i){const o=t[n];if(e===o)return;const s=Array.isArray(e);if(n!==p1&&(!Zi(e)||!Zi(o)||s!==Array.isArray(o)||i&&e[i]!==o[i])){cr(t,n,e);return}if(s){if(e.length&&o.length&&(!r||i&&e[0]&&e[0][i]!=null)){let c,u,d,f,h,m,p,g;for(d=0,f=Math.min(o.length,e.length);d=d&&h>=d&&(o[f]===e[h]||i&&o[f]&&e[h]&&o[f][i]&&o[f][i]===e[h][i]);f--,h--)b[h]=o[f];if(d>h||d>f){for(u=d;u<=h;u++)cr(o,u,e[u]);for(;ue.length&&cr(o,"length",e.length);return}for(p=new Array(h+1),u=h;u>=d;u--)m=e[u],g=i&&m?m[i]:m,c=v.get(g),p[u]=c===void 0?-1:c,v.set(g,u);for(c=d;c<=f;c++)m=o[c],g=i&&m?m[i]:m,u=v.get(g),u!==void 0&&u!==-1&&(b[u]=o[c],u=p[u],v.set(g,u));for(u=d;ue.length&&cr(o,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c{if(!Zi(o)||!Zi(i))return i;const s=Wa(i,{[p1]:o},p1,n,r);return s===void 0?o:s}}const p0=new WeakMap,V9={get(e,t){if(t===h0)return e;const n=e[t];let r;return Zi(n)?p0.get(n)||(p0.set(n,r=new Proxy(n,V9)),r):n},set(e,t,n){return cr(e,t,na(n)),!0},deleteProperty(e,t){return cr(e,t,void 0,!0),!0}};function He(e){return t=>{if(Zi(t)){let n;(n=p0.get(t))||p0.set(t,n=new Proxy(t,V9)),e(n)}return t}}const g0=new Set;let Yo,Hr,a3=!1;function RB(e){return e instanceof HTMLElement?e.closest("[data-prevent-autofocus]")||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function l3(e){if(e instanceof Node)for(const t of g0){const n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function NB(){a3||typeof window>"u"||(a3=!0,window.addEventListener("keydown",e=>{if(e.defaultPrevented||RB(e.target)||!(e.metaKey||e.ctrlKey))return;const n=e.key.toLowerCase();if(n==="g"){const o=Hr;if(!o||!o.isOpen())return;e.preventDefault(),e.stopPropagation(),o.next(e.shiftKey?-1:1);return}if(n!=="f")return;const r=Hr;if(r&&r.isOpen()){e.preventDefault(),e.stopPropagation(),r.open();return}const i=l3(document.activeElement)??l3(e.target)??Yo??Array.from(g0)[0];i&&(e.preventDefault(),e.stopPropagation(),i.open())},{capture:!0}))}function Oa(){const e=globalThis.CSS?.highlights;e&&(e.delete("opencode-find"),e.delete("opencode-find-current"))}function c3(){const e=globalThis;return typeof e.Highlight=="function"&&e.CSS?.highlights!=null}function u3(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function zB(e){let t,n,r=[],i="overlay",o=[];const[s,a]=Ue({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),l=()=>s.open,c=()=>s.query,u=()=>s.index,d=()=>s.count,f=()=>s.pos,h=()=>{for(const R of r)R.removeEventListener("scroll",g);r=[]},m=()=>{const R=e.overlay();R&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),R.innerHTML="")},p=()=>{if(i!=="overlay"){m();return}const R=e.wrapper(),E=e.overlay();if(!R||!E||(m(),o.length===0))return;const S=R.getBoundingClientRect(),$=u(),O=document.createDocumentFragment();for(let V=0;V{n=void 0,p()}))}const b=()=>{if(i!=="overlay")return;const R=e.getRoot(),E=R?Array.from(R.querySelectorAll("[data-code]")).filter(S=>S instanceof HTMLElement):[];if(!(E.length===r.length&&E.every((S,$)=>S===r[$]))){h(),r=E;for(const S of r)S.addEventListener("scroll",g,{passive:!0})}},v=()=>{Oa(),m(),h(),o=[],a("count",0),a("index",0)},y=()=>{if(typeof window>"u")return;const R=e.wrapper();if(!R)return;const E=u3(R)??R,S=E.getBoundingClientRect(),$=parseFloat(getComputedStyle(E).getPropertyValue("--session-title-height")),O=Number.isNaN($)?0:$;a("pos",{top:Math.round(S.top)+O-4,right:Math.round(window.innerWidth-S.right)+8})},T=(R,E)=>{const S=E.toLowerCase(),$=[],O=Array.from(R.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(V=>V instanceof HTMLElement);for(const V of O){const Z=V.textContent;if(!Z)continue;const W=Z.toLowerCase();let G=W.indexOf(S);if(G===-1)continue;const Y=[],te=[],we=document.createTreeWalker(V,NodeFilter.SHOW_TEXT);let $e=we.nextNode(),Le=0;for(;$e;)$e instanceof Text&&(Le+=$e.data.length,Y.push($e),te.push(Le)),$e=we.nextNode();if(Y.length===0)continue;const ct=Me=>{let ke=0,gt=te.length-1;for(;ke>1;te[Kt]>=Me?gt=Kt:ke=Kt+1}const jt=ke===0?0:te[ke-1];return{node:Y[ke],offset:Me-jt}};for(;G!==-1;){const Me=ct(G),ke=ct(G+E.length),gt=document.createRange();gt.setStart(Me.node,Me.offset),gt.setEnd(ke.node,ke.offset),$.push(gt),G=W.indexOf(S,G+E.length)}}return $},k=R=>{const E=R.startContainer;(E instanceof Element?E:E.parentElement)?.scrollIntoView({block:"center",inline:"center"})},x=(R,E)=>{const S=globalThis.CSS?.highlights,$=globalThis.Highlight;if(!S||typeof $!="function")return!1;S.delete("opencode-find"),S.delete("opencode-find-current");const O=R[E];O&&S.set("opencode-find-current",new $(O));const V=R.filter((Z,W)=>W!==E);return V.length>0&&S.set("opencode-find",new $(...V)),!0},_=R=>{if(!l())return;const E=c().trim();if(!E){v();return}const S=e.getRoot();if(!S)return;i=c3()?"highlights":"overlay";const $=T(S,E),O=$.length,V=R?.reset?0:u(),Z=O?Math.min(V,O-1):0;o=$,a("count",O),a("index",Z);const W=$[Z];if(i==="highlights"){m(),h(),x($,Z)||(i="overlay",Oa(),b(),g()),R?.scroll&&W&&k(W);return}Oa(),b(),R?.scroll&&W&&k(W),g()},A=()=>{a("open",!1),a("query",""),v(),Hr===F&&(Hr=void 0)},M=()=>{Hr&&Hr!==F&&Hr.close(),Hr=F,Yo=F,l()||a("open",!0),requestAnimationFrame(()=>{_({scroll:!0}),t?.focus(),t?.select()})},L=R=>{if(!l())return;const E=d();if(E<=0)return;const S=(u()+R+E)%E;a("index",S);const $=o[S];if($){if(i==="highlights"){if(!x(o,S)){i="overlay",_({reset:!0,scroll:!0});return}k($);return}Oa(),b(),k($),g()}},F={element:e.wrapper,isOpen:()=>l(),next:L,open:M,close:A};return Ht(()=>{i=c3()?"highlights":"overlay",NB(),g0.add(F),Yo||(Yo=F),oe(()=>{g0.delete(F),Hr===F&&(Hr=void 0,Oa()),Yo===F&&(Yo=void 0)})}),ie(()=>{if(!l())return;const R=()=>y();requestAnimationFrame(R),window.addEventListener("resize",R,{passive:!0});const E=e.wrapper();if(!E)return;const S=u3(E)??E,$=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>R());$?.observe(S),oe(()=>{window.removeEventListener("resize",R),$?.disconnect()})}),oe(()=>{h(),m(),Hr===F&&(Hr=void 0,Oa())}),{open:l,query:c,count:d,index:u,pos:f,setInput:R=>{t=R},setQuery:R=>{a("query",R),a("index",0),_({reset:!0,scroll:!0})},focus:M,close:A,next:L,refresh:R=>_(R),onPointerDown:()=>{Yo=F,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Yo=F},onInputKeyDown:R=>{if(R.key==="Escape"){R.preventDefault(),A();return}R.key==="Enter"&&(R.preventDefault(),L(R.shiftKey?-1:1))}}}function jB(){return{token:0}}function Fc(e){e.observer?.disconnect(),e.observer=void 0}function U9(e){if(!e)return;const t=e.querySelector("diffs-container");if(t instanceof HTMLElement)return t}function FB(e){return U9(e)?.shadowRoot??void 0}function g1(e){if(!e||typeof document>"u")return;const t=document.documentElement.dataset.colorScheme;if(t==="dark"||t==="light"){e.dataset.colorScheme=t;return}e.removeAttribute("data-color-scheme")}function HB(e){if(typeof document>"u")return()=>{};if(g1(e()),typeof MutationObserver>"u")return()=>{};const t=document.documentElement,n=new MutationObserver(()=>g1(e()));return n.observe(t,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function VB(e){Fc(e.state),e.state.token+=1;const t=e.state.token,n=Math.max(0,e.settleFrames??0),r=()=>{const s=a=>{if(t===e.state.token){if(a<=0){e.onReady();return}requestAnimationFrame(()=>s(a-1))}};requestAnimationFrame(()=>s(n))},i=s=>{if(e.isReady(s)){r();return}typeof MutationObserver>"u"||(Fc(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(s)&&(Fc(e.state),r())}),e.state.observer.observe(s,{childList:!0,subtree:!0}))},o=e.getRoot();if(!o){if(typeof MutationObserver>"u")return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;const s=e.getRoot();s&&i(s)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}i(o)}function Rhe(e,t){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);return n===r?t("ui.sessionReview.selection.line",{line:n}):t("ui.sessionReview.selection.lines",{start:n,end:r})}function Nhe(e,t){const n=Math.max(1,Math.min(t.start,t.end)),r=Math.max(t.start,t.end),i=e.split(`
    `).slice(n-1,r);if(i.length!==0)return i.slice(0,2).join(`
    `)}function zhe(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function jhe(e,t,n){if(!e)return!1;const r=Math.min(e.start,e.end),i=Math.max(e.start,e.end);if(ti)return!1;if(!n)return!0;const o=e.side,s=e.endSide??o;return!o&&!s?!0:!o||!s?(o??s)===n:o===s||t===r?o===n:t===i?s===n:!0}function UB(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function BB(e){if(e instanceof Range)return e;const t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function B9(e,t){!e||!t||requestAnimationFrame(()=>{const n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function qB(){let e="none",t,n=!1,r=!1;const i=()=>{e="none",t=void 0,n=!1};return{begin(o,s){if(!o){e="text";return}e="numbers",t=s,n=!1},track(o,s){return e!=="numbers"?!1:(o&1)===0?(i(),!0):(s!==void 0&&t!==void 0&&s!==t&&(n=!0),!0)},finish(){const o=e;return r=o==="numbers"&&n,i(),o},consume(o){const s=r&&!UB(o);return r=!1,s},reset(){r=!1,i()}}}function vh(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function WB(e){const t=vh(e);if(!t)return;const n=t.closest("[data-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r}function d3(e){const t=vh(e);if(!t)return;const n=t.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r;const i=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function ZB(e){const t=vh(e);if(!t)return;const n=t.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function q9(e){const t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;const n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),r=n?.startContainer??t.anchorNode,i=n?.endContainer??t.focusNode;if(!r||!i||!e.root.contains(r)||!e.root.contains(i))return;const o=e.lineForNode(r),s=e.lineForNode(i);if(o===void 0||s===void 0)return;const a=e.sideForNode?.(r),l=e.sideForNode?.(i),c=a??l,u={start:o,end:s};return c&&(u.side=c),l&&c&&l!==c&&(u.endSide=l),{range:u,text:e.preserveTextSelection&&n?BB(n).cloneRange():void 0}}const Rd=new WeakMap,GB={lineHeight:24,hunkSeparatorHeight:24,fileGap:0};function KB(e){return e==="auto"||e==="scroll"||e==="overlay"}function f3(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(KB(n.overflowY))return t;t=t.parentElement}}function YB(e){if(typeof document>"u")return;const t=e.closest("[data-component='session-review']");if(t instanceof HTMLElement){const r=f3(e)??t,i=t.querySelector("[data-slot='session-review-container']");return{key:t,root:r,content:i instanceof HTMLElement?i:void 0}}const n=f3(e);if(n){const r=n.querySelector("[role='log']");return{key:n,root:n,content:r instanceof HTMLElement?r:void 0}}return{key:document,root:document,content:void 0}}function JB(e){const t=YB(e);if(!t)return;let n=Rd.get(t.key);if(!n){const i=new M9;i.setup(t.root,t.content),n={virtualizer:i,refs:0},Rd.set(t.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;const i=Rd.get(t.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),Rd.delete(t.key)))}}}function XB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cc={exports:{}},QB=Cc.exports,h3;function eq(){return h3||(h3=1,(function(e,t){(function(n,r){r(t)})(QB,function(n){const r=Symbol("newer"),i=Symbol("older");class o{constructor(d,f){typeof d!="number"&&(f=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,f&&(this.assign(f),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[r]&&(d===this.oldest&&(this.oldest=d[r]),d[r][i]=d[i]),d[i]&&(d[i][r]=d[r]),d[r]=void 0,d[i]=this.newest,this.newest&&(this.newest[r]=d),this.newest=d)}assign(d){let f,h=this.limit||Number.MAX_VALUE;this._keymap.clear();let m=d[Symbol.iterator]();for(let p=m.next();!p.done;p=m.next()){let g=new s(p.value[0],p.value[1]);if(this._keymap.set(g.key,g),f?(f[r]=g,g[i]=f):this.oldest=g,f=g,h--==0)throw new Error("overflow")}this.newest=f,this.size=this._keymap.size}get(d){var f=this._keymap.get(d);return f?(this._markEntryAsUsed(f),f.value):void 0}set(d,f){var h=this._keymap.get(d);return h?(h.value=f,this._markEntryAsUsed(h),this):(this._keymap.set(d,h=new s(d,f)),this.newest?(this.newest[r]=h,h[i]=this.newest):this.oldest=h,this.newest=h,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),d[r]=d[i]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let f=this._keymap.get(d);return f?f.value:void 0}has(d){return this._keymap.has(d)}delete(d){var f=this._keymap.get(d);return f?(this._keymap.delete(f.key),f[r]&&f[i]?(f[i][r]=f[r],f[r][i]=f[i]):f[r]?(f[r][i]=void 0,this.oldest=f[r]):f[i]?(f[i][r]=void 0,this.newest=f[i]):this.oldest=this.newest=void 0,this.size--,f.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new c(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(d,f){typeof f!="object"&&(f=this);let h=this.oldest;for(;h;)d.call(f,h.value,h.key,this),h=h[r]}toJSON(){for(var d=new Array(this.size),f=0,h=this.oldest;h;)d[f++]={key:h.key,value:h.value},h=h[r];return d}toString(){for(var d="",f=this.oldest;f;)d+=String(f.key)+":"+f.value,f=f[r],f&&(d+=" < ");return d}}n.LRUMap=o;function s(u,d){this.key=u,this.value=d,this[r]=void 0,this[i]=void 0}function a(u){this.entry=u}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:[u.key,u.value]}):{done:!0,value:void 0}};function l(u){this.entry=u}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.key}):{done:!0,value:void 0}};function c(u){this.entry=u}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(Cc,Cc.exports)),Cc.exports}var tq=eq();const m3=XB(tq),_p=Symbol("IGNORE_RESPONSE");var nq=class{highlighter;preferredHighlighter;renderOptions;initialized=!1;workers=[];taskQueue=new Map;pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;constructor(e,{langs:t,theme:n=Yn,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3,preferredHighlighter:o="shiki-js"}){this.options=e,this.preferredHighlighter=o,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new m3.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new m3.LRUMap(e.totalASTLRUCacheSize??100),this.initialize(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=Yn,lineDiffType:t="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:e,lineDiffType:t,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=Lb(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const o=nu(e);let s=[];if(i||(l1(o)?s=r3(o):s=await i3(o)),this.highlighter!=null)a1(s,this.highlighter),await this.setRenderOptionsOnWorkers(r,s);else{const[a]=await Promise.all([gl({themes:o,langs:["text"],preferredHighlighter:this.preferredHighlighter}),this.setRenderOptionsOnWorkers(r,s)]);this.highlighter=a}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const a of this.themeSubscribers)a.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t}=this.renderOptions;return{theme:t,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,o)=>{const s=this.generateRequestId(),a={type:"set-render-options",id:s,request:{type:"set-render-options",id:s,renderOptions:e,resolvedThemes:t},resolve:i,reject:o,requestStart:Date.now()};this.pendingTasks.set(s,a),r.worker.postMessage(a.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpPendingTasks(e){this.taskQueue.delete(e);const t=this.instanceRequestMap.get(e);t!=null&&(this.pendingTasks.delete(t),this.instanceRequestMap.delete(e)),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((t,n)=>{(async()=>{try{const r=nu(this.renderOptions.theme);let i=[];l1(r)?i=r3(r):i=await i3(r);let o=[];t3(e)?o=e3(e):o=await n3(e);const[s]=await Promise.all([gl({themes:r,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,o)]);if(this.initialized===!1)throw this.terminateWorkers(),new Error("WorkerPoolManager: workers failed to initialize");this.highlighter=s,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),t()}catch(r){this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(r)}})()}),this.queueBroadcastStateChanges();else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),o={worker:i,request_id:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:s})=>s)])};i.addEventListener("message",s=>{this.handleWorkerMessage(o,s.data)}),i.addEventListener("error",s=>console.error("Worker error:",s,o)),this.workers.push(o),n.push(new Promise((s,a)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t},resolve(){o.initialized=!0,s()},reject:a,requestStart:Date.now()};this.pendingTasks.set(l,c),this.executeTask(o,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.size===0)){for(const[e,t]of this.taskQueue){if(this.instanceRequestMap.has(e))continue;const n=p3(t),r=this.getAvailableWorker(n);if(r==null)break;this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){if((t.lang??Yr(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="file"&&c0(t,r.request.file))return;this.submitTask(e,{type:"file",file:t})}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.initialize();return}return p9(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){if((t.lang??Yr(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="diff"&&r.request.diff===t)return;this.submitTask(e,{type:"diff",diff:t})}}getPlainDiffAST(e,t,n,r,i){return this.highlighter!=null?T9(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i}):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.clear(),this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.request_id!=null).length,queuedTasks:this.taskQueue.size,pendingTasks:this.pendingTasks.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(t.type){case"file":return{type:"file",id:n,request:{...t,id:n},instance:e,requestStart:r};case"diff":return{type:"diff",id:n,request:{...t,id:n},instance:e,requestStart:r}}})();this.taskQueue.set(e,i),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const r=n.filter(i=>!e.langs.has(i));r.length>0&&(t3(r)?t.request.resolvedLanguages=e3(r):t.request.resolvedLanguages=await n3(r)),this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t)}}handleWorkerMessage(e,t){const n=this.pendingTasks.get(t.id);try{if(n==null)throw _p;if(t.type==="error"){const r=new Error(t.error);throw t.stack&&(r.stack=t.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==t.id)throw _p;switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:o,request:s}=n;s.file.cacheKey!=null&&this.fileCache.set(s.file.cacheKey,{result:r,options:i}),o.onHighlightSuccess(s.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:o,request:s}=n;s.diff.cacheKey!=null&&this.diffCache.set(s.diff.cacheKey,{result:r,options:i}),o.onHighlightSuccess(s.diff,r,i);break}}}}catch(r){r!==_p&&console.error(r,n,t)}this.cleanWorkerAndTask(e,n),this.queueBroadcastStateChanges(),this.taskQueue.size>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.request_id=e.id,"instance"in e&&(this.taskQueue.delete(e.instance),this.instanceRequestMap.set(e.instance,e.id)),this.pendingTasks.set(e.id,e)}cleanWorkerAndTask(e,t){e.request_id=void 0,t!=null&&("instance"in t&&this.instanceRequestMap.delete(t.instance),this.pendingTasks.delete(t.id))}executeTask(e,t){this.assignWorkerToTask(t,e);for(const n of p3(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){this.cleanWorkerAndTask(e,t),console.error("Failed to post message to worker:",n),"instance"in t?t.instance.onHighlightError(n):"reject"in t&&t.reject(n)}this.queueBroadcastStateChanges()}getAvailableWorker(e){let t;for(const n of this.workers){if(n.request_id!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const i of e)if(!n.langs.has(i)){r=!1;break}if(r)break}return t}generateRequestId(){return`req_${++this.nextRequestId}`}};function p3(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??Yr(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??Yr(e.request.diff.name)),t.add(e.request.diff.lang??Yr(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}const rq="/assets/worker-DXsJPwkg.js";function iq(){return new Worker(rq,{type:"module"})}function g3(e){const t=new nq({workerFactory:iq,poolSize:2},{theme:"OpenCode",lineDiffType:e,preferredHighlighter:"shiki-wasm"});return t.initialize(),t}let Cp,Ip;function v1(e){if(!(typeof window>"u"))return e==="split"?(Ip||(Ip=g3("word-alt")),Ip):(Cp||(Cp=g3("none")),Cp)}const oq=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),sq=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function bh(e){if(!(!e||typeof e!="object"))return e}function Mb(e){if(!e)return;const t=e.split(";",1)[0]?.trim().toLowerCase();if(t)return t==="audio/x-aac"?"audio/aac":t==="audio/x-m4a"?"audio/mp4":t}function aq(e){if(!e)return"";const t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function lq(e){const t=aq(e);if(t==="svg")return"svg";if(oq.has(t))return"image";if(sq.has(t))return"audio"}function cq(e){return bh(e)?.type==="binary"}function uq(e,t){if(t==="svg")return e.startsWith("data:image/svg+xml")?e:void 0;if(t==="image")return e.startsWith("data:image/")?e:void 0;if(e.startsWith("data:audio/x-aac;"))return e.replace("data:audio/x-aac;","data:audio/aac;");if(e.startsWith("data:audio/x-m4a;"))return e.replace("data:audio/x-m4a;","data:audio/mp4;");if(e.startsWith("data:audio/"))return e}function Ep(e,t){if(!e)return;if(typeof e=="string")return uq(e,t);const n=bh(e);if(!n||typeof n.content!="string")return;const r=Mb(typeof n.mimeType=="string"?n.mimeType:void 0);if(r){if(t==="svg")return r!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(t==="image"&&!r.startsWith("image/"))&&!(t==="audio"&&!r.startsWith("audio/"))&&n.encoding==="base64")return`data:${r};base64,${n.content}`}}function dq(e){if(typeof atob=="function")try{const t=atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):t}catch{}}function fq(e){const t=bh(e);if(!(!t||typeof t.content!="string"||Mb(typeof t.mimeType=="string"?t.mimeType:void 0)!=="image/svg+xml"))return t.encoding==="base64"?dq(t.content):t.content}function Tp(e){if(typeof e=="string")return e.length>0;const t=bh(e);return t?typeof t.content=="string"&&t.content.length>0:!1}var hq=ae('
    '),Nd=ae('
    '),mq=ae('
    '),pq=ae('