Security context
Low· 3.1GHSA-jh5r-qr3c-85q8 CVE-2026-102279CWE-80Published Sep 29, 2026

Laravel: XSS in Debug Page Information

Research this vulnerability

Research is free — Hunters explains how the bug works, the root-cause code pattern, how the fix addresses it, and how to test whether a target is affected, in chat. Investigate & write exploit is a paid run — the engine reads the advisory and fix commits, then builds and validates a working proof-of-concept exploit with reproduction steps.

Affected versions

0 → fixed in 12.69.013.0.0 → fixed in 13.30.0

Details

### Impact When `APP_DEBUG=true`, attacker-controlled input is passed to a Tippy.js tooltip configured with `allowHTML: true`, enabling DOM-based XSS during mouse hover. ### Patches [#61381](https://github.com/laravel/framework/pull/61381)

The fix

[12.x] Disable html by default on Laravel exception page

Mior Muhammad Zaki· Aug 31, 2026, 01:27 PM+11−1284fe08cd67
src/Illuminate/Foundation/resources/exceptions/renderer/components/formatted-source.blade.php+1 −1
@@ -19,5 +19,5 @@
language="php"
truncate
class="text-xs min-w-0"
- data-tippy-content="{{ $source }}"
+ data-tippy-html-content="{{ $source }}"
/>
src/Illuminate/Foundation/resources/exceptions/renderer/dist/scripts.js+10 −11
@@ -1,10 +1,10 @@
-var cr=!1,lr=!1,ot=[],ur=-1;function Vl(e){Zl(e)}function Zl(e){ot.includes(e)||ot.push(e),Xl()}function Yl(e){let t=ot.indexOf(e);t!==-1&&t>ur&&ot.splice(t,1)}function Xl(){!lr&&!cr&&(cr=!0,queueMicrotask(Kl))}function Kl(){cr=!1,lr=!0;for(let e=0;e<ot.length;e++)ot[e](),ur=e;ot.length=0,ur=-1,lr=!1}var Pt,gt,Dt,ao,pr=!0;function Ql(e){pr=!1,e(),pr=!0}function Jl(e){Pt=e.reactive,Dt=e.release,gt=t=>e.effect(t,{scheduler:n=>{pr?Vl(n):n()}}),ao=e.raw}function Pi(e){gt=e}function eu(e){let t=()=>{};return[a=>{let r=gt(a);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(i=>i())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),Dt(r))},r},()=>{t()}]}function ro(e,t){let n=!0,a,r=gt(()=>{let i=e();JSON.stringify(i),n?a=i:queueMicrotask(()=>{t(i,a),a=i}),n=!1});return()=>Dt(r)}var io=[],so=[],oo=[];function tu(e){oo.push(e)}function Vr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,so.push(t))}function co(e){io.push(e)}function lo(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function uo(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,a])=>{(t===void 0||t.includes(n))&&(a.forEach(r=>r()),delete e._x_attributeCleanups[n])})}function nu(e){for(e._x_effects?.forEach(Yl);e._x_cleanups?.length;)e._x_cleanups.pop()()}var Zr=new MutationObserver(Qr),Yr=!1;function Xr(){Zr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Yr=!0}function po(){au(),Zr.disconnect(),Yr=!1}var Kt=[];function au(){let e=Zr.takeRecords();Kt.push(()=>e.length>0&&Qr(e));let t=Kt.length;queueMicrotask(()=>{if(Kt.length===t)for(;Kt.length>0;)Kt.shift()()})}function z(e){if(!Yr)return e();po();let t=e();return Xr(),t}var Kr=!1,ia=[];function ru(){Kr=!0}function iu(){Kr=!1,Qr(ia),ia=[]}function Qr(e){if(Kr){ia=ia.concat(e);return}let t=[],n=new Set,a=new Map,r=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].removedNodes.forEach(s=>{s.nodeType===1&&s._x_marker&&n.add(s)}),e[i].addedNodes.forEach(s=>{if(s.nodeType===1){if(n.has(s)){n.delete(s);return}s._x_marker||t.push(s)}})),e[i].type==="attributes")){let s=e[i].target,o=e[i].attributeName,c=e[i].oldValue,l=()=>{a.has(s)||a.set(s,[]),a.get(s).push({name:o,value:s.getAttribute(o)})},u=()=>{r.has(s)||r.set(s,[]),r.get(s).push(o)};s.hasAttribute(o)&&c===null?l():s.hasAttribute(o)?(u(),l()):u()}r.forEach((i,s)=>{uo(s,i)}),a.forEach((i,s)=>{io.forEach(o=>o(s,i))});for(let i of n)t.some(s=>s.contains(i))||so.forEach(s=>s(i));for(let i of t)i.isConnected&&oo.forEach(s=>s(i));t=null,n=null,a=null,r=null}function mo(e){return wn(At(e))}function vn(e,t,n){return e._x_dataStack=[t,...At(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(a=>a!==t)}}function At(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?At(e.host):e.parentNode?At(e.parentNode):[]}function wn(e){return new Proxy({objects:e},su)}var su={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(n=>Object.prototype.hasOwnProperty.call(n,t)||Reflect.has(n,t))},get({objects:e},t,n){return t=="toJSON"?ou:Reflect.get(e.find(a=>Reflect.has(a,t))||{},t,n)},set({objects:e},t,n,a){const r=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],i=Object.getOwnPropertyDescriptor(r,t);return i?.set&&i?.get?i.set.call(a,n)||!0:Reflect.set(r,t,n)}};function ou(){return Reflect.ownKeys(this).reduce((t,n)=>(t[n]=Reflect.get(this,n),t),{})}function ho(e){let t=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,n=(a,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(a)).forEach(([i,{value:s,enumerable:o}])=>{if(o===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=r===""?i:`${r}.${i}`;typeof s=="object"&&s!==null&&s._x_interceptor?a[i]=s.initialize(e,c,i):t(s)&&s!==a&&!(s instanceof Element)&&n(s,c)})};return n(e)}function go(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(a,r,i){return e(this.initialValue,()=>cu(a,r),s=>dr(a,r,s),r,i)}};return t(n),a=>{if(typeof a=="object"&&a!==null&&a._x_interceptor){let r=n.initialize.bind(n);n.initialize=(i,s,o)=>{let c=a.initialize(i,s,o);return n.initialValue=c,r(i,s,o)}}else n.initialValue=a;return n}}function cu(e,t){return t.split(".").reduce((n,a)=>n[a],e)}function dr(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),dr(e[t[0]],t.slice(1),n)}}var fo={};function ve(e,t){fo[e]=t}function mr(e,t){let n=lu(t);return Object.entries(fo).forEach(([a,r])=>{Object.defineProperty(e,`$${a}`,{get(){return r(t,n)},enumerable:!1})}),e}function lu(e){let[t,n]=xo(e),a={interceptor:go,...t};return Vr(e,n),a}function uu(e,t,n,...a){try{return n(...a)}catch(r){dn(r,e,t)}}function dn(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
+var cr=!1,lr=!1,ot=[],ur=-1;function Zl(e){Yl(e)}function Yl(e){ot.includes(e)||ot.push(e),Kl()}function Xl(e){let t=ot.indexOf(e);t!==-1&&t>ur&&ot.splice(t,1)}function Kl(){!lr&&!cr&&(cr=!0,queueMicrotask(Ql))}function Ql(){cr=!1,lr=!0;for(let e=0;e<ot.length;e++)ot[e](),ur=e;ot.length=0,ur=-1,lr=!1}var Pt,gt,Dt,ao,pr=!0;function Jl(e){pr=!1,e(),pr=!0}function eu(e){Pt=e.reactive,Dt=e.release,gt=t=>e.effect(t,{scheduler:n=>{pr?Zl(n):n()}}),ao=e.raw}function Pi(e){gt=e}function tu(e){let t=()=>{};return[a=>{let r=gt(a);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(i=>i())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),Dt(r))},r},()=>{t()}]}function ro(e,t){let n=!0,a,r=gt(()=>{let i=e();JSON.stringify(i),n?a=i:queueMicrotask(()=>{t(i,a),a=i}),n=!1});return()=>Dt(r)}var io=[],so=[],oo=[];function nu(e){oo.push(e)}function Vr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,so.push(t))}function co(e){io.push(e)}function lo(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function uo(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,a])=>{(t===void 0||t.includes(n))&&(a.forEach(r=>r()),delete e._x_attributeCleanups[n])})}function au(e){for(e._x_effects?.forEach(Xl);e._x_cleanups?.length;)e._x_cleanups.pop()()}var Zr=new MutationObserver(Qr),Yr=!1;function Xr(){Zr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Yr=!0}function po(){ru(),Zr.disconnect(),Yr=!1}var Qt=[];function ru(){let e=Zr.takeRecords();Qt.push(()=>e.length>0&&Qr(e));let t=Qt.length;queueMicrotask(()=>{if(Qt.length===t)for(;Qt.length>0;)Qt.shift()()})}function z(e){if(!Yr)return e();po();let t=e();return Xr(),t}var Kr=!1,ia=[];function iu(){Kr=!0}function su(){Kr=!1,Qr(ia),ia=[]}function Qr(e){if(Kr){ia=ia.concat(e);return}let t=[],n=new Set,a=new Map,r=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].removedNodes.forEach(s=>{s.nodeType===1&&s._x_marker&&n.add(s)}),e[i].addedNodes.forEach(s=>{if(s.nodeType===1){if(n.has(s)){n.delete(s);return}s._x_marker||t.push(s)}})),e[i].type==="attributes")){let s=e[i].target,o=e[i].attributeName,c=e[i].oldValue,l=()=>{a.has(s)||a.set(s,[]),a.get(s).push({name:o,value:s.getAttribute(o)})},u=()=>{r.has(s)||r.set(s,[]),r.get(s).push(o)};s.hasAttribute(o)&&c===null?l():s.hasAttribute(o)?(u(),l()):u()}r.forEach((i,s)=>{uo(s,i)}),a.forEach((i,s)=>{io.forEach(o=>o(s,i))});for(let i of n)t.some(s=>s.contains(i))||so.forEach(s=>s(i));for(let i of t)i.isConnected&&oo.forEach(s=>s(i));t=null,n=null,a=null,r=null}function mo(e){return xn(At(e))}function wn(e,t,n){return e._x_dataStack=[t,...At(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(a=>a!==t)}}function At(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?At(e.host):e.parentNode?At(e.parentNode):[]}function xn(e){return new Proxy({objects:e},ou)}var ou={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(n=>Object.prototype.hasOwnProperty.call(n,t)||Reflect.has(n,t))},get({objects:e},t,n){return t=="toJSON"?cu:Reflect.get(e.find(a=>Reflect.has(a,t))||{},t,n)},set({objects:e},t,n,a){const r=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],i=Object.getOwnPropertyDescriptor(r,t);return i?.set&&i?.get?i.set.call(a,n)||!0:Reflect.set(r,t,n)}};function cu(){return Reflect.ownKeys(this).reduce((t,n)=>(t[n]=Reflect.get(this,n),t),{})}function ho(e){let t=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,n=(a,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(a)).forEach(([i,{value:s,enumerable:o}])=>{if(o===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=r===""?i:`${r}.${i}`;typeof s=="object"&&s!==null&&s._x_interceptor?a[i]=s.initialize(e,c,i):t(s)&&s!==a&&!(s instanceof Element)&&n(s,c)})};return n(e)}function go(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(a,r,i){return e(this.initialValue,()=>lu(a,r),s=>dr(a,r,s),r,i)}};return t(n),a=>{if(typeof a=="object"&&a!==null&&a._x_interceptor){let r=n.initialize.bind(n);n.initialize=(i,s,o)=>{let c=a.initialize(i,s,o);return n.initialValue=c,r(i,s,o)}}else n.initialValue=a;return n}}function lu(e,t){return t.split(".").reduce((n,a)=>n[a],e)}function dr(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),dr(e[t[0]],t.slice(1),n)}}var fo={};function ve(e,t){fo[e]=t}function mr(e,t){let n=uu(t);return Object.entries(fo).forEach(([a,r])=>{Object.defineProperty(e,`$${a}`,{get(){return r(t,n)},enumerable:!1})}),e}function uu(e){let[t,n]=xo(e),a={interceptor:go,...t};return Vr(e,n),a}function pu(e,t,n,...a){try{return n(...a)}catch(r){mn(r,e,t)}}function mn(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
${n?'Expression: "'+n+`"
-`:""}`,t),setTimeout(()=>{throw e},0)}var Jn=!0;function bo(e){let t=Jn;Jn=!1;let n=e();return Jn=t,n}function ct(e,t,n={}){let a;return ne(e,t)(r=>a=r,n),a}function ne(...e){return _o(...e)}var _o=yo;function pu(e){_o=e}function yo(e,t){let n={};mr(n,e);let a=[n,...At(e)],r=typeof t=="function"?du(a,t):hu(a,t,e);return uu.bind(null,e,t,r)}function du(e,t){return(n=()=>{},{scope:a={},params:r=[]}={})=>{let i=t.apply(wn([a,...e]),r);sa(n,i)}}var Ma={};function mu(e,t){if(Ma[e])return Ma[e];let n=Object.getPrototypeOf(async function(){}).constructor,a=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let s=new n(["__self","scope"],`with (scope) { __self.result = ${a} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return dn(s,t,e),Promise.resolve()}})();return Ma[e]=i,i}function hu(e,t,n){let a=mu(t,n);return(r=()=>{},{scope:i={},params:s=[]}={})=>{a.result=void 0,a.finished=!1;let o=wn([i,...e]);if(typeof a=="function"){let c=a(a,o).catch(l=>dn(l,n,t));a.finished?(sa(r,a.result,o,s,n),a.result=void 0):c.then(l=>{sa(r,l,o,s,n)}).catch(l=>dn(l,n,t)).finally(()=>a.result=void 0)}}}function sa(e,t,n,a,r){if(Jn&&typeof t=="function"){let i=t.apply(n,a);i instanceof Promise?i.then(s=>sa(e,s,n,a)).catch(s=>dn(s,r,t)):e(i)}else typeof t=="object"&&t instanceof Promise?t.then(i=>e(i)):e(t)}var Jr="x-";function Mt(e=""){return Jr+e}function gu(e){Jr=e}var oa={};function W(e,t){return oa[e]=t,{before(n){if(!oa[n]){console.warn(String.raw`Cannot find directive \`${n}\`. \`${e}\` will use the default order of execution`);return}const a=rt.indexOf(n);rt.splice(a>=0?a:rt.indexOf("DEFAULT"),0,e)}}}function fu(e){return Object.keys(oa).includes(e)}function ei(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let i=Object.entries(e._x_virtualDirectives).map(([o,c])=>({name:o,value:c})),s=vo(i);i=i.map(o=>s.find(c=>c.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),t=t.concat(i)}let a={};return t.map(Eo((i,s)=>a[i]=s)).filter($o).map(yu(a,n)).sort(vu).map(i=>_u(e,i))}function vo(e){return Array.from(e).map(Eo()).filter(t=>!$o(t))}var hr=!1,nn=new Map,wo=Symbol();function bu(e){hr=!0;let t=Symbol();wo=t,nn.set(t,[]);let n=()=>{for(;nn.get(t).length;)nn.get(t).shift()();nn.delete(t)},a=()=>{hr=!1,n()};e(n),a()}function xo(e){let t=[],n=o=>t.push(o),[a,r]=eu(e);return t.push(r),[{Alpine:xn,effect:a,cleanup:n,evaluateLater:ne.bind(ne,e),evaluate:ct.bind(ct,e)},()=>t.forEach(o=>o())]}function _u(e,t){let n=()=>{},a=oa[t.type]||n,[r,i]=xo(e);lo(e,t.original,i);let s=()=>{e._x_ignore||e._x_ignoreSelf||(a.inline&&a.inline(e,t,r),a=a.bind(a,e,t,r),hr?nn.get(wo).push(a):a())};return s.runCleanups=i,s}var ko=(e,t)=>({name:n,value:a})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:a}),Co=e=>e;function Eo(e=()=>{}){return({name:t,value:n})=>{let{name:a,value:r}=Fo.reduce((i,s)=>s(i),{name:t,value:n});return a!==t&&e(a,t),{name:a,value:r}}}var Fo=[];function ti(e){Fo.push(e)}function $o({name:e}){return jo().test(e)}var jo=()=>new RegExp(`^${Jr}([^:^.]+)\\b`);function yu(e,t){return({name:n,value:a})=>{let r=n.match(jo()),i=n.match(/:([a-zA-Z0-9\-_:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],o=t||e[n]||n;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:a,original:o}}}var gr="DEFAULT",rt=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",gr,"teleport"];function vu(e,t){let n=rt.indexOf(e.type)===-1?gr:e.type,a=rt.indexOf(t.type)===-1?gr:t.type;return rt.indexOf(n)-rt.indexOf(a)}function rn(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function dt(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(r=>dt(r,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let a=e.firstElementChild;for(;a;)dt(a,t),a=a.nextElementSibling}function pe(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Di=!1;function wu(){Di&&pe("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Di=!0,document.body||pe("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),rn(document,"alpine:init"),rn(document,"alpine:initializing"),Xr(),tu(t=>Pe(t,dt)),Vr(t=>zt(t)),co((t,n)=>{ei(t,n).forEach(a=>a())});let e=t=>!ka(t.parentElement,!0);Array.from(document.querySelectorAll(To().join(","))).filter(e).forEach(t=>{Pe(t)}),rn(document,"alpine:initialized"),setTimeout(()=>{Eu()})}var ni=[],So=[];function Ao(){return ni.map(e=>e())}function To(){return ni.concat(So).map(e=>e())}function Ro(e){ni.push(e)}function Oo(e){So.push(e)}function ka(e,t=!1){return qt(e,n=>{if((t?To():Ao()).some(r=>n.matches(r)))return!0})}function qt(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return qt(e.parentElement,t)}}function xu(e){return Ao().some(t=>e.matches(t))}var Io=[];function ku(e){Io.push(e)}var Cu=1;function Pe(e,t=dt,n=()=>{}){qt(e,a=>a._x_ignore)||bu(()=>{t(e,(a,r)=>{a._x_marker||(n(a,r),Io.forEach(i=>i(a,r)),ei(a,a.attributes).forEach(i=>i()),a._x_ignore||(a._x_marker=Cu++),a._x_ignore&&r())})})}function zt(e,t=dt){t(e,n=>{nu(n),uo(n),delete n._x_marker})}function Eu(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,n,a])=>{fu(n)||a.some(r=>{if(document.querySelector(r))return pe(`found "${r}", but missing ${t} plugin`),!0})})}var fr=[],ai=!1;function ri(e=()=>{}){return queueMicrotask(()=>{ai||setTimeout(()=>{br()})}),new Promise(t=>{fr.push(()=>{e(),t()})})}function br(){for(ai=!1;fr.length;)fr.shift()()}function Fu(){ai=!0}function ii(e,t){return Array.isArray(t)?Mi(e,t.join(" ")):typeof t=="object"&&t!==null?$u(e,t):typeof t=="function"?ii(e,t()):Mi(e,t)}function Mi(e,t){let n=r=>r.split(" ").filter(i=>!e.classList.contains(i)).filter(Boolean),a=r=>(e.classList.add(...r),()=>{e.classList.remove(...r)});return t=t===!0?t="":t||"",a(n(t))}function $u(e,t){let n=o=>o.split(" ").filter(Boolean),a=Object.entries(t).flatMap(([o,c])=>c?n(o):!1).filter(Boolean),r=Object.entries(t).flatMap(([o,c])=>c?!1:n(o)).filter(Boolean),i=[],s=[];return r.forEach(o=>{e.classList.contains(o)&&(e.classList.remove(o),s.push(o))}),a.forEach(o=>{e.classList.contains(o)||(e.classList.add(o),i.push(o))}),()=>{s.forEach(o=>e.classList.add(o)),i.forEach(o=>e.classList.remove(o))}}function Ca(e,t){return typeof t=="object"&&t!==null?ju(e,t):Su(e,t)}function ju(e,t){let n={};return Object.entries(t).forEach(([a,r])=>{n[a]=e.style[a],a.startsWith("--")||(a=Au(a)),e.style.setProperty(a,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{Ca(e,n)}}function Su(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Au(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}W("transition",(e,{value:t,modifiers:n,expression:a},{evaluate:r})=>{typeof a=="function"&&(a=r(a)),a!==!1&&(!a||typeof a=="boolean"?Ru(e,n,t):Tu(e,a,t))});function Tu(e,t,n){No(e,ii,""),{enter:r=>{e._x_transition.enter.during=r},"enter-start":r=>{e._x_transition.enter.start=r},"enter-end":r=>{e._x_transition.enter.end=r},leave:r=>{e._x_transition.leave.during=r},"leave-start":r=>{e._x_transition.leave.start=r},"leave-end":r=>{e._x_transition.leave.end=r}}[n](t)}function Ru(e,t,n){No(e,Ca);let a=!t.includes("in")&&!t.includes("out")&&!n,r=a||t.includes("in")||["enter"].includes(n),i=a||t.includes("out")||["leave"].includes(n);t.includes("in")&&!a&&(t=t.filter((b,_)=>_<t.indexOf("out"))),t.includes("out")&&!a&&(t=t.filter((b,_)=>_>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),o=s||t.includes("opacity"),c=s||t.includes("scale"),l=o?0:1,u=c?Qt(t,"scale",95)/100:1,p=Qt(t,"delay",0)/1e3,d=Qt(t,"origin","center"),m="opacity, transform",g=Qt(t,"duration",150)/1e3,v=Qt(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${g}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function No(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(a=()=>{},r=()=>{}){yr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},a,r)},out(a=()=>{},r=()=>{}){yr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},a,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,a){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):i():e._x_transition?e._x_transition.in(n):i();return}e._x_hidePromise=e._x_transition?new Promise((s,o)=>{e._x_transition.out(()=>{},()=>s(a)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>o({isFromCancelledTransition:!0}))}):Promise.resolve(a),queueMicrotask(()=>{let s=Lo(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):r(()=>{let o=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(o)]).then(([u])=>u?.());return delete c._x_hidePromise,delete c._x_hideChildren,l};o(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function Lo(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Lo(t)}function yr(e,t,{during:n,start:a,end:r}={},i=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(a).length===0&&Object.keys(r).length===0){i(),s();return}let o,c,l;Ou(e,{start(){o=t(e,a)},during(){c=t(e,n)},before:i,end(){o(),l=t(e,r)},after:s,cleanup(){c(),l()}})}function Ou(e,t){let n,a,r,i=_r(()=>{z(()=>{n=!0,a||t.before(),r||(t.end(),br()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:_r(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},z(()=>{t.start(),t.during()}),Fu(),requestAnimationFrame(()=>{if(n)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),z(()=>{t.before()}),a=!0,requestAnimationFrame(()=>{n||(z(()=>{t.end()}),br(),setTimeout(e._x_transitioning.finish,s+o),r=!0)})})}function Qt(e,t,n){if(e.indexOf(t)===-1)return n;const a=e[e.indexOf(t)+1];if(!a||t==="scale"&&isNaN(a))return n;if(t==="duration"||t==="delay"){let r=a.match(/([0-9]+)ms/);if(r)return r[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[a,e[e.indexOf(t)+2]].join(" "):a}var He=!1;function Ve(e,t=()=>{}){return(...n)=>He?t(...n):e(...n)}function Iu(e){return(...t)=>He&&e(...t)}var Po=[];function Ea(e){Po.push(e)}function Nu(e,t){Po.forEach(n=>n(e,t)),He=!0,Do(()=>{Pe(t,(n,a)=>{a(n,()=>{})})}),He=!1}var vr=!1;function Lu(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),He=!0,vr=!0,Do(()=>{Pu(t)}),He=!1,vr=!1}function Pu(e){let t=!1;Pe(e,(a,r)=>{dt(a,(i,s)=>{if(t&&xu(i))return s();t=!0,r(i,s)})})}function Do(e){let t=gt;Pi((n,a)=>{let r=t(n);return Dt(r),()=>{}}),e(),Pi(t)}function Mo(e,t,n,a=[]){switch(e._x_bindings||(e._x_bindings=Pt({})),e._x_bindings[t]=n,t=a.includes("camel")?Hu(t):t,t){case"value":Du(e,n);break;case"style":qu(e,n);break;case"class":Mu(e,n);break;case"selected":case"checked":zu(e,t,n);break;default:qo(e,t,n);break}}function Du(e,t){if(Uo(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=ea(e.value)===t:e.checked=qi(e.value,t));else if(si(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>qi(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Gu(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function Mu(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ii(e,t)}function qu(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ca(e,t)}function zu(e,t,n){qo(e,t,n),Uu(e,t,n)}function qo(e,t,n){[null,void 0,!1].includes(n)&&Vu(t)?e.removeAttribute(t):(zo(t)&&(n=t),Bu(e,t,n))}function Bu(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function Uu(e,t,n){e[t]!==n&&(e[t]=n)}function Gu(e,t){const n=[].concat(t).map(a=>a+"");Array.from(e.options).forEach(a=>{a.selected=n.includes(a.value)})}function Hu(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function qi(e,t){return e==t}function ea(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Wu=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function zo(e){return Wu.has(e)}function Vu(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Zu(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Bo(e,t,n)}function Yu(e,t,n,a=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let r=e._x_inlineBindings[t];return r.extract=a,bo(()=>ct(e,r.expression))}return Bo(e,t,n)}function Bo(e,t,n){let a=e.getAttribute(t);return a===null?typeof n=="function"?n():n:a===""?!0:zo(t)?!![t,"true"].includes(a):a}function si(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Uo(e){return e.type==="radio"||e.localName==="ui-radio"}function Go(e,t){var n;return function(){var a=this,r=arguments,i=function(){n=null,e.apply(a,r)};clearTimeout(n),n=setTimeout(i,t)}}function Ho(e,t){let n;return function(){let a=this,r=arguments;n||(e.apply(a,r),n=!0,setTimeout(()=>n=!1,t))}}function Wo({get:e,set:t},{get:n,set:a}){let r=!0,i,s=gt(()=>{let o=e(),c=n();if(r)a(qa(o)),r=!1;else{let l=JSON.stringify(o),u=JSON.stringify(c);l!==i?a(qa(o)):l!==u&&t(qa(c))}i=JSON.stringify(e()),JSON.stringify(n())});return()=>{Dt(s)}}function qa(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function Xu(e){(Array.isArray(e)?e:[e]).forEach(n=>n(xn))}var et={},zi=!1;function Ku(e,t){if(zi||(et=Pt(et),zi=!0),t===void 0)return et[e];et[e]=t,ho(et[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&et[e].init()}function Qu(){return et}var Vo={};function Ju(e,t){let n=typeof t!="function"?()=>t:t;return e instanceof Element?Zo(e,n()):(Vo[e]=n,()=>{})}function ep(e){return Object.entries(Vo).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...a)=>n(...a)}})}),e}function Zo(e,t,n){let a=[];for(;a.length;)a.pop()();let r=Object.entries(t).map(([s,o])=>({name:s,value:o})),i=vo(r);return r=r.map(s=>i.find(o=>o.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ei(e,r,n).map(s=>{a.push(s.runCleanups),s()}),()=>{for(;a.length;)a.pop()()}}var Yo={};function tp(e,t){Yo[e]=t}function np(e,t){return Object.entries(Yo).forEach(([n,a])=>{Object.defineProperty(e,n,{get(){return(...r)=>a.bind(t)(...r)},enumerable:!1})}),e}var ap={get reactive(){return Pt},get release(){return Dt},get effect(){return gt},get raw(){return ao},version:"3.14.9",flushAndStopDeferringMutations:iu,dontAutoEvaluateFunctions:bo,disableEffectScheduling:Ql,startObservingMutations:Xr,stopObservingMutations:po,setReactivityEngine:Jl,onAttributeRemoved:lo,onAttributesAdded:co,closestDataStack:At,skipDuringClone:Ve,onlyDuringClone:Iu,addRootSelector:Ro,addInitSelector:Oo,interceptClone:Ea,addScopeToNode:vn,deferMutations:ru,mapAttributes:ti,evaluateLater:ne,interceptInit:ku,setEvaluator:pu,mergeProxies:wn,extractProp:Yu,findClosest:qt,onElRemoved:Vr,closestRoot:ka,destroyTree:zt,interceptor:go,transition:yr,setStyles:Ca,mutateDom:z,directive:W,entangle:Wo,throttle:Ho,debounce:Go,evaluate:ct,initTree:Pe,nextTick:ri,prefixed:Mt,prefix:gu,plugin:Xu,magic:ve,store:Ku,start:wu,clone:Lu,cloneNode:Nu,bound:Zu,$data:mo,watch:ro,walk:dt,data:tp,bind:Ju},xn=ap;function rp(e,t){const n=Object.create(null),a=e.split(",");for(let r=0;r<a.length;r++)n[a[r]]=!0;return r=>!!n[r]}var ip=Object.freeze({}),sp=Object.prototype.hasOwnProperty,Fa=(e,t)=>sp.call(e,t),lt=Array.isArray,sn=e=>Xo(e)==="[object Map]",op=e=>typeof e=="string",oi=e=>typeof e=="symbol",$a=e=>e!==null&&typeof e=="object",cp=Object.prototype.toString,Xo=e=>cp.call(e),Ko=e=>Xo(e).slice(8,-1),ci=e=>op(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,lp=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},up=lp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qo=(e,t)=>e!==t&&(e===e||t===t),wr=new WeakMap,Jt=[],Ee,ut=Symbol("iterate"),xr=Symbol("Map key iterate");function pp(e){return e&&e._isEffect===!0}function dp(e,t=ip){pp(e)&&(e=e.raw);const n=gp(e,t);return t.lazy||n(),n}function mp(e){e.active&&(Jo(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var hp=0;function gp(e,t){const n=function(){if(!n.active)return e();if(!Jt.includes(n)){Jo(n);try{return bp(),Jt.push(n),Ee=n,e()}finally{Jt.pop(),ec(),Ee=Jt[Jt.length-1]}}};return n.id=hp++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function Jo(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Tt=!0,li=[];function fp(){li.push(Tt),Tt=!1}function bp(){li.push(Tt),Tt=!0}function ec(){const e=li.pop();Tt=e===void 0?!0:e}function ye(e,t,n){if(!Tt||Ee===void 0)return;let a=wr.get(e);a||wr.set(e,a=new Map);let r=a.get(n);r||a.set(n,r=new Set),r.has(Ee)||(r.add(Ee),Ee.deps.push(r),Ee.options.onTrack&&Ee.options.onTrack({effect:Ee,target:e,type:t,key:n}))}function We(e,t,n,a,r,i){const s=wr.get(e);if(!s)return;const o=new Set,c=u=>{u&&u.forEach(p=>{(p!==Ee||p.allowRecurse)&&o.add(p)})};if(t==="clear")s.forEach(c);else if(n==="length"&&lt(e))s.forEach((u,p)=>{(p==="length"||p>=a)&&c(u)});else switch(n!==void 0&&c(s.get(n)),t){case"add":lt(e)?ci(n)&&c(s.get("length")):(c(s.get(ut)),sn(e)&&c(s.get(xr)));break;case"delete":lt(e)||(c(s.get(ut)),sn(e)&&c(s.get(xr)));break;case"set":sn(e)&&c(s.get(ut));break}const l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:n,type:t,newValue:a,oldValue:r,oldTarget:i}),u.options.scheduler?u.options.scheduler(u):u()};o.forEach(l)}var _p=rp("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(oi)),yp=nc(),vp=nc(!0),Bi=wp();function wp(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const a=M(this);for(let i=0,s=this.length;i<s;i++)ye(a,"get",i+"");const r=a[t](...n);return r===-1||r===!1?a[t](...n.map(M)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){fp();const a=M(this)[t].apply(this,n);return ec(),a}}),e}function nc(e=!1,t=!1){return function(a,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_raw"&&i===(e?t?Np:sc:t?Ip:ic).get(a))return a;const s=lt(a);if(!e&&s&&Fa(Bi,r))return Reflect.get(Bi,r,i);const o=Reflect.get(a,r,i);return(oi(r)?tc.has(r):_p(r))||(e||ye(a,"get",r),t)?o:kr(o)?!s||!ci(r)?o.value:o:$a(o)?e?oc(o):mi(o):o}}var xp=kp();function kp(e=!1){return function(n,a,r,i){let s=n[a];if(!e&&(r=M(r),s=M(s),!lt(n)&&kr(s)&&!kr(r)))return s.value=r,!0;const o=lt(n)&&ci(a)?Number(a)<n.length:Fa(n,a),c=Reflect.set(n,a,r,i);return n===M(i)&&(o?Qo(r,s)&&We(n,"set",a,r,s):We(n,"add",a,r)),c}}function Cp(e,t){const n=Fa(e,t),a=e[t],r=Reflect.deleteProperty(e,t);return r&&n&&We(e,"delete",t,void 0,a),r}function Ep(e,t){const n=Reflect.has(e,t);return(!oi(t)||!tc.has(t))&&ye(e,"has",t),n}function Fp(e){return ye(e,"iterate",lt(e)?"length":ut),Reflect.ownKeys(e)}var $p={get:yp,set:xp,deleteProperty:Cp,has:Ep,ownKeys:Fp},jp={get:vp,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},ui=e=>$a(e)?mi(e):e,pi=e=>$a(e)?oc(e):e,di=e=>e,ja=e=>Reflect.getPrototypeOf(e);function qn(e,t,n=!1,a=!1){e=e.__v_raw;const r=M(e),i=M(t);t!==i&&!n&&ye(r,"get",t),!n&&ye(r,"get",i);const{has:s}=ja(r),o=a?di:n?pi:ui;if(s.call(r,t))return o(e.get(t));if(s.call(r,i))return o(e.get(i));e!==r&&e.get(t)}function zn(e,t=!1){const n=this.__v_raw,a=M(n),r=M(e);return e!==r&&!t&&ye(a,"has",e),!t&&ye(a,"has",r),e===r?n.has(e):n.has(e)||n.has(r)}function Bn(e,t=!1){return e=e.__v_raw,!t&&ye(M(e),"iterate",ut),Reflect.get(e,"size",e)}function Ui(e){e=M(e);const t=M(this);return ja(t).has.call(t,e)||(t.add(e),We(t,"add",e,e)),this}function Gi(e,t){t=M(t);const n=M(this),{has:a,get:r}=ja(n);let i=a.call(n,e);i?rc(n,a,e):(e=M(e),i=a.call(n,e));const s=r.call(n,e);return n.set(e,t),i?Qo(t,s)&&We(n,"set",e,t,s):We(n,"add",e,t),this}function Hi(e){const t=M(this),{has:n,get:a}=ja(t);let r=n.call(t,e);r?rc(t,n,e):(e=M(e),r=n.call(t,e));const i=a?a.call(t,e):void 0,s=t.delete(e);return r&&We(t,"delete",e,void 0,i),s}function Wi(){const e=M(this),t=e.size!==0,n=sn(e)?new Map(e):new Set(e),a=e.clear();return t&&We(e,"clear",void 0,void 0,n),a}function Un(e,t){return function(a,r){const i=this,s=i.__v_raw,o=M(s),c=t?di:e?pi:ui;return!e&&ye(o,"iterate",ut),s.forEach((l,u)=>a.call(r,c(l),c(u),i))}}function Gn(e,t,n){return function(...a){const r=this.__v_raw,i=M(r),s=sn(i),o=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=r[e](...a),u=n?di:t?pi:ui;return!t&&ye(i,"iterate",c?xr:ut),{next(){const{value:p,done:d}=l.next();return d?{value:p,done:d}:{value:o?[u(p[0]),u(p[1])]:u(p),done:d}},[Symbol.iterator](){return this}}}}function ze(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${up(e)} operation ${n}failed: target is readonly.`,M(this))}return e==="delete"?!1:this}}function Sp(){const e={get(i){return qn(this,i)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!1)},t={get(i){return qn(this,i,!1,!0)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!0)},n={get(i){return qn(this,i,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!1)},a={get(i){return qn(this,i,!0,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gn(i,!1,!1),n[i]=Gn(i,!0,!1),t[i]=Gn(i,!1,!0),a[i]=Gn(i,!0,!0)}),[e,n,t,a]}var[Ap,Tp]=Sp();function ac(e,t){const n=e?Tp:Ap;return(a,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?a:Reflect.get(Fa(n,r)&&r in a?n:a,r,i)}var Rp={get:ac(!1)},Op={get:ac(!0)};function rc(e,t,n){const a=M(n);if(a!==n&&t.call(e,a)){const r=Ko(e);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ic=new WeakMap,Ip=new WeakMap,sc=new WeakMap,Np=new WeakMap;function Lp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pp(e){return e.__v_skip||!Object.isExtensible(e)?0:Lp(Ko(e))}function mi(e){return e&&e.__v_isReadonly?e:cc(e,!1,$p,Rp,ic)}function oc(e){return cc(e,!0,jp,Op,sc)}function cc(e,t,n,a,r){if(!$a(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const s=Pp(e);if(s===0)return e;const o=new Proxy(e,s===2?a:n);return r.set(e,o),o}function M(e){return e&&M(e.__v_raw)||e}function kr(e){return!!(e&&e.__v_isRef===!0)}ve("nextTick",()=>ri);ve("dispatch",e=>rn.bind(rn,e));ve("watch",(e,{evaluateLater:t,cleanup:n})=>(a,r)=>{let i=t(a),o=ro(()=>{let c;return i(l=>c=l),c},r);n(o)});ve("store",Qu);ve("data",e=>mo(e));ve("root",e=>ka(e));ve("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=wn(Dp(e))),e._x_refs_proxy));function Dp(e){let t=[];return qt(e,n=>{n._x_refs&&t.push(n._x_refs)}),t}var za={};function lc(e){return za[e]||(za[e]=0),++za[e]}function Mp(e,t){return qt(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function qp(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=lc(t))}ve("id",(e,{cleanup:t})=>(n,a=null)=>{let r=`${n}${a?`-${a}`:""}`;return zp(e,r,t,()=>{let i=Mp(e,n),s=i?i._x_ids[n]:lc(n);return a?`${n}-${s}-${a}`:`${n}-${s}`})});Ea((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function zp(e,t,n,a){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let r=a();return e._x_id[t]=r,n(()=>{delete e._x_id[t]}),r}ve("el",e=>e);uc("Focus","focus","focus");uc("Persist","persist","persist");function uc(e,t,n){ve(t,a=>pe(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}W("modelable",(e,{expression:t},{effect:n,evaluateLater:a,cleanup:r})=>{let i=a(t),s=()=>{let u;return i(p=>u=p),u},o=a(`${t} = __placeholder`),c=u=>o(()=>{},{scope:{__placeholder:u}}),l=s();c(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,p=e._x_model.set,d=Wo({get(){return u()},set(m){p(m)}},{get(){return s()},set(m){c(m)}});r(d)})});W("teleport",(e,{modifiers:t,expression:n},{cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-teleport can only be used on a <template> tag",e);let r=Vi(n),i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,c=>{c.stopPropagation(),e.dispatchEvent(new c.constructor(c.type,c))})}),vn(i,{},e);let s=(o,c,l)=>{l.includes("prepend")?c.parentNode.insertBefore(o,c):l.includes("append")?c.parentNode.insertBefore(o,c.nextSibling):c.appendChild(o)};z(()=>{s(i,r,t),Ve(()=>{Pe(i)})()}),e._x_teleportPutBack=()=>{let o=Vi(n);z(()=>{s(e._x_teleport,o,t)})},a(()=>z(()=>{i.remove(),zt(i)}))});var Bp=document.createElement("div");function Vi(e){let t=Ve(()=>document.querySelector(e),()=>Bp)();return t||pe(`Cannot find x-teleport element for selector: "${e}"`),t}var pc=()=>{};pc.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};W("ignore",pc);W("effect",Ve((e,{expression:t},{effect:n})=>{n(ne(e,t))}));function Cr(e,t,n,a){let r=e,i=c=>a(c),s={},o=(c,l)=>u=>l(c,u);if(n.includes("dot")&&(t=Up(t)),n.includes("camel")&&(t=Gp(t)),n.includes("passive")&&(s.passive=!0),n.includes("capture")&&(s.capture=!0),n.includes("window")&&(r=window),n.includes("document")&&(r=document),n.includes("debounce")){let c=n[n.indexOf("debounce")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Go(i,l)}if(n.includes("throttle")){let c=n[n.indexOf("throttle")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Ho(i,l)}return n.includes("prevent")&&(i=o(i,(c,l)=>{l.preventDefault(),c(l)})),n.includes("stop")&&(i=o(i,(c,l)=>{l.stopPropagation(),c(l)})),n.includes("once")&&(i=o(i,(c,l)=>{c(l),r.removeEventListener(t,i,s)})),(n.includes("away")||n.includes("outside"))&&(r=document,i=o(i,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),n.includes("self")&&(i=o(i,(c,l)=>{l.target===e&&c(l)})),(Wp(t)||dc(t))&&(i=o(i,(c,l)=>{Vp(l,n)||c(l)})),r.addEventListener(t,i,s),()=>{r.removeEventListener(t,i,s)}}function Up(e){return e.replace(/-/g,".")}function Gp(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function ca(e){return!Array.isArray(e)&&!isNaN(e)}function Hp(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Wp(e){return["keydown","keyup"].includes(e)}function dc(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Vp(e,t){let n=t.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(i));if(n.includes("debounce")){let i=n.indexOf("debounce");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let i=n.indexOf("throttle");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&Zi(e.key).includes(n[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>n.includes(i));return n=n.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===r.length&&(dc(e.type)||Zi(e.key).includes(n[0])))}function Zi(e){if(!e)return[];e=Hp(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}W("model",(e,{modifiers:t,expression:n},{effect:a,cleanup:r})=>{let i=e;t.includes("parent")&&(i=e.parentNode);let s=ne(i,n),o;typeof n=="string"?o=ne(i,`${n} = __placeholder`):typeof n=="function"&&typeof n()=="string"?o=ne(i,`${n()} = __placeholder`):o=()=>{};let c=()=>{let d;return s(m=>d=m),Yi(d)?d.get():d},l=d=>{let m;s(g=>m=g),Yi(m)?m.set(d):o(()=>{},{scope:{__placeholder:d}})};typeof n=="string"&&e.type==="radio"&&z(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});var u=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let p=He?()=>{}:Cr(e,u,t,d=>{l(Ba(e,t,d,c()))});if(t.includes("fill")&&([void 0,null,""].includes(c())||si(e)&&Array.isArray(c())||e.tagName.toLowerCase()==="select"&&e.multiple)&&l(Ba(e,t,{target:e},c())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=p,r(()=>e._x_removeModelListeners.default()),e.form){let d=Cr(e.form,"reset",[],m=>{ri(()=>e._x_model&&e._x_model.set(Ba(e,t,{target:e},c())))});r(()=>d())}e._x_model={get(){return c()},set(d){l(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof n=="string"&&n.match(/\./)&&(d=""),window.fromModel=!0,z(()=>Mo(e,"value",d)),delete window.fromModel},a(()=>{let d=c();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function Ba(e,t,n,a){return z(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(si(e))if(Array.isArray(a)){let r=null;return t.includes("number")?r=Ua(n.target.value):t.includes("boolean")?r=ea(n.target.value):r=n.target.value,n.target.checked?a.includes(r)?a:a.concat([r]):a.filter(i=>!Zp(i,r))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return Ua(i)}):t.includes("boolean")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return ea(i)}):Array.from(n.target.selectedOptions).map(r=>r.value||r.text);{let r;return Uo(e)?n.target.checked?r=n.target.value:r=a:r=n.target.value,t.includes("number")?Ua(r):t.includes("boolean")?ea(r):t.includes("trim")?r.trim():r}}})}function Ua(e){let t=e?parseFloat(e):null;return Yp(t)?t:e}function Zp(e,t){return e==t}function Yp(e){return!Array.isArray(e)&&!isNaN(e)}function Yi(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}W("cloak",e=>queueMicrotask(()=>z(()=>e.removeAttribute(Mt("cloak")))));Oo(()=>`[${Mt("init")}]`);W("init",Ve((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));W("text",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.textContent=i})})})});W("html",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Pe(e),delete e._x_ignoreSelf})})})});ti(ko(":",Co(Mt("bind:"))));var mc=(e,{value:t,modifiers:n,expression:a,original:r},{effect:i,cleanup:s})=>{if(!t){let c={};ep(c),ne(e,a)(u=>{Zo(e,u,r)},{scope:c});return}if(t==="key")return Xp(e,a);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=ne(e,a);i(()=>o(c=>{c===void 0&&typeof a=="string"&&a.match(/\./)&&(c=""),z(()=>Mo(e,t,c,n))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};mc.inline=(e,{value:t,modifiers:n,expression:a})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:a,extract:!1})};W("bind",mc);function Xp(e,t){e._x_keyExpression=t}Ro(()=>`[${Mt("data")}]`);W("data",(e,{expression:t},{cleanup:n})=>{if(Kp(e))return;t=t===""?"{}":t;let a={};mr(a,e);let r={};np(r,a);let i=ct(e,t,{scope:r});(i===void 0||i===!0)&&(i={}),mr(i,e);let s=Pt(i);ho(s);let o=vn(e,s);s.init&&ct(e,s.init),n(()=>{s.destroy&&ct(e,s.destroy),o()})});Ea((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function Kp(e){return He?vr?!0:e.hasAttribute("data-has-alpine-state"):!1}W("show",(e,{modifiers:t,expression:n},{effect:a})=>{let r=ne(e,n);e._x_doHide||(e._x_doHide=()=>{z(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{z(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},o=()=>setTimeout(s),c=_r(p=>p?s():i(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,i):p?o():i()}),l,u=!0;a(()=>r(p=>{!u&&p===l||(t.includes("immediate")&&(p?o():i()),c(p),l=p,u=!1)}))});W("for",(e,{expression:t},{effect:n,cleanup:a})=>{let r=Jp(t),i=ne(e,r.items),s=ne(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},n(()=>Qp(e,r,i,s)),a(()=>{Object.values(e._x_lookup).forEach(o=>z(()=>{zt(o),o.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function Qp(e,t,n,a){let r=s=>typeof s=="object"&&!Array.isArray(s),i=e;n(s=>{ed(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let o=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(r(s))s=Object.entries(s).map(([f,b])=>{let _=Xi(t,b,f,s);a(w=>{u.includes(w)&&pe("Duplicate key on x-for",e),u.push(w)},{scope:{index:f,..._}}),l.push(_)});else for(let f=0;f<s.length;f++){let b=Xi(t,s[f],f,s);a(_=>{u.includes(_)&&pe("Duplicate key on x-for",e),u.push(_)},{scope:{index:f,...b}}),l.push(b)}let p=[],d=[],m=[],g=[];for(let f=0;f<c.length;f++){let b=c[f];u.indexOf(b)===-1&&m.push(b)}c=c.filter(f=>!m.includes(f));let v="template";for(let f=0;f<u.length;f++){let b=u[f],_=c.indexOf(b);if(_===-1)c.splice(f,0,b),p.push([v,f]);else if(_!==f){let w=c.splice(f,1)[0],h=c.splice(_-1,1)[0];c.splice(f,0,h),c.splice(_,0,w),d.push([w,h])}else g.push(b);v=b}for(let f=0;f<m.length;f++){let b=m[f];b in o&&(z(()=>{zt(o[b]),o[b].remove()}),delete o[b])}for(let f=0;f<d.length;f++){let[b,_]=d[f],w=o[b],h=o[_],C=document.createElement("div");z(()=>{h||pe('x-for ":key" is undefined or invalid',i,_,o),h.after(C),w.after(h),h._x_currentIfEl&&h.after(h._x_currentIfEl),C.before(w),w._x_currentIfEl&&w.after(w._x_currentIfEl),C.remove()}),h._x_refreshXForScope(l[u.indexOf(_)])}for(let f=0;f<p.length;f++){let[b,_]=p[f],w=b==="template"?i:o[b];w._x_currentIfEl&&(w=w._x_currentIfEl);let h=l[_],C=u[_],k=document.importNode(i.content,!0).firstElementChild,$=Pt(h);vn(k,$,i),k._x_refreshXForScope=T=>{Object.entries(T).forEach(([N,I])=>{$[N]=I})},z(()=>{w.after(k),Ve(()=>Pe(k))()}),typeof C=="object"&&pe("x-for key cannot be an object, it must be a string or an integer",i),o[C]=k}for(let f=0;f<g.length;f++)o[g[f]]._x_refreshXForScope(l[u.indexOf(g[f])]);i._x_prevKeys=u})}function Jp(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,a=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=e.match(a);if(!r)return;let i={};i.items=r[2].trim();let s=r[1].replace(n,"").trim(),o=s.match(t);return o?(i.item=s.replace(t,"").trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=s,i}function Xi(e,t,n,a){let r={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,o)=>{r[s]=t[o]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{r[s]=t[s]}):r[e.item]=t,e.index&&(r[e.index]=n),e.collection&&(r[e.collection]=a),r}function ed(e){return!Array.isArray(e)&&!isNaN(e)}function hc(){}hc.inline=(e,{expression:t},{cleanup:n})=>{let a=ka(e);a._x_refs||(a._x_refs={}),a._x_refs[t]=e,n(()=>delete a._x_refs[t])};W("ref",hc);W("if",(e,{expression:t},{effect:n,cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-if can only be used on a <template> tag",e);let r=ne(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return vn(o,{},e),z(()=>{e.after(o),Ve(()=>Pe(o))()}),e._x_currentIfEl=o,e._x_undoIf=()=>{z(()=>{zt(o),o.remove()}),delete e._x_currentIfEl},o},s=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>r(o=>{o?i():s()})),a(()=>e._x_undoIf&&e._x_undoIf())});W("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(r=>qp(e,r))});Ea((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});ti(ko("@",Co(Mt("on:"))));W("on",Ve((e,{value:t,modifiers:n,expression:a},{cleanup:r})=>{let i=a?ne(e,a):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=Cr(e,t,n,o=>{i(()=>{},{scope:{$event:o},params:[o]})});r(()=>s())}));Sa("Collapse","collapse","collapse");Sa("Intersect","intersect","intersect");Sa("Focus","trap","focus");Sa("Mask","mask","mask");function Sa(e,t,n){W(t,a=>pe(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}xn.setEvaluator(yo);xn.setReactivityEngine({reactive:mi,effect:dp,release:mp,raw:M});var td=xn,gc=td,ae="top",he="bottom",ge="right",re="left",hi="auto",kn=[ae,he,ge,re],Rt="start",mn="end",nd="clippingParents",fc="viewport",en="popper",ad="reference",Ki=kn.reduce(function(e,t){return e.concat([t+"-"+Rt,t+"-"+mn])},[]),bc=[].concat(kn,[hi]).reduce(function(e,t){return e.concat([t,t+"-"+Rt,t+"-"+mn])},[]),rd="beforeRead",id="read",sd="afterRead",od="beforeMain",cd="main",ld="afterMain",ud="beforeWrite",pd="write",dd="afterWrite",md=[rd,id,sd,od,cd,ld,ud,pd,dd];function je(e){return e?(e.nodeName||"").toLowerCase():null}function oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mt(e){var t=oe(e).Element;return e instanceof t||e instanceof Element}function me(e){var t=oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function gi(e){if(typeof ShadowRoot>"u")return!1;var t=oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hd(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!me(i)||!je(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(s){var o=r[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function gd(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},s=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),o=s.reduce(function(c,l){return c[l]="",c},{});!me(r)||!je(r)||(Object.assign(r.style,o),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const _c={name:"applyStyles",enabled:!0,phase:"write",fn:hd,effect:gd,requires:["computeStyles"]};function $e(e){return e.split("-")[0]}var pt=Math.max,la=Math.min,Ot=Math.round;function Er(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yc(){return!/^((?!chrome|android).)*safari/i.test(Er())}function It(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),r=1,i=1;t&&me(e)&&(r=e.offsetWidth>0&&Ot(a.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ot(a.height)/e.offsetHeight||1);var s=mt(e)?oe(e):window,o=s.visualViewport,c=!yc()&&n,l=(a.left+(c&&o?o.offsetLeft:0))/r,u=(a.top+(c&&o?o.offsetTop:0))/i,p=a.width/r,d=a.height/i;return{width:p,height:d,top:u,right:l+p,bottom:u+d,left:l,x:l,y:u}}function fi(e){var t=It(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function vc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&gi(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function De(e){return oe(e).getComputedStyle(e)}function fd(e){return["table","td","th"].indexOf(je(e))>=0}function Ze(e){return((mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return je(e)==="html"?e:e.assignedSlot||e.parentNode||(gi(e)?e.host:null)||Ze(e)}function Qi(e){return!me(e)||De(e).position==="fixed"?null:e.offsetParent}function bd(e){var t=/firefox/i.test(Er()),n=/Trident/i.test(Er());if(n&&me(e)){var a=De(e);if(a.position==="fixed")return null}var r=Aa(e);for(gi(r)&&(r=r.host);me(r)&&["html","body"].indexOf(je(r))<0;){var i=De(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Cn(e){for(var t=oe(e),n=Qi(e);n&&fd(n)&&De(n).position==="static";)n=Qi(n);return n&&(je(n)==="html"||je(n)==="body"&&De(n).position==="static")?t:n||bd(e)||t}function bi(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function on(e,t,n){return pt(e,la(t,n))}function _d(e,t,n){var a=on(e,t,n);return a>n?n:a}function wc(){return{top:0,right:0,bottom:0,left:0}}function xc(e){return Object.assign({},wc(),e)}function kc(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var yd=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,xc(typeof t!="number"?t:kc(t,kn))};function vd(e){var t,n=e.state,a=e.name,r=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=$e(n.placement),c=bi(o),l=[re,ge].indexOf(o)>=0,u=l?"height":"width";if(!(!i||!s)){var p=yd(r.padding,n),d=fi(i),m=c==="y"?ae:re,g=c==="y"?he:ge,v=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],f=s[c]-n.rects.reference[c],b=Cn(i),_=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,w=v/2-f/2,h=p[m],C=_-d[u]-p[g],k=_/2-d[u]/2+w,$=on(h,k,C),T=c;n.modifiersData[a]=(t={},t[T]=$,t.centerOffset=$-k,t)}}function wd(e){var t=e.state,n=e.options,a=n.element,r=a===void 0?"[data-popper-arrow]":a;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||vc(t.elements.popper,r)&&(t.elements.arrow=r))}const xd={name:"arrow",enabled:!0,phase:"main",fn:vd,effect:wd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nt(e){return e.split("-")[1]}var kd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Cd(e,t){var n=e.x,a=e.y,r=t.devicePixelRatio||1;return{x:Ot(n*r)/r||0,y:Ot(a*r)/r||0}}function Ji(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.variation,s=e.offsets,o=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,g=s.y,v=g===void 0?0:g,f=typeof u=="function"?u({x:m,y:v}):{x:m,y:v};m=f.x,v=f.y;var b=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),w=re,h=ae,C=window;if(l){var k=Cn(n),$="clientHeight",T="clientWidth";if(k===oe(n)&&(k=Ze(n),De(k).position!=="static"&&o==="absolute"&&($="scrollHeight",T="scrollWidth")),k=k,r===ae||(r===re||r===ge)&&i===mn){h=he;var N=p&&k===C&&C.visualViewport?C.visualViewport.height:k[$];v-=N-a.height,v*=c?1:-1}if(r===re||(r===ae||r===he)&&i===mn){w=ge;var I=p&&k===C&&C.visualViewport?C.visualViewport.width:k[T];m-=I-a.width,m*=c?1:-1}}var D=Object.assign({position:o},l&&kd),R=u===!0?Cd({x:m,y:v},oe(n)):{x:m,y:v};if(m=R.x,v=R.y,c){var L;return Object.assign({},D,(L={},L[h]=_?"0":"",L[w]=b?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",L))}return Object.assign({},D,(t={},t[h]=_?v+"px":"",t[w]=b?m+"px":"",t.transform="",t))}function Ed(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,c=o===void 0?!0:o,l={placement:$e(t.placement),variation:Nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ji(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ji(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Fd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ed,data:{}};var Hn={passive:!0};function $d(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,s=a.resize,o=s===void 0?!0:s,c=oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Hn)}),o&&c.addEventListener("resize",n.update,Hn),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Hn)}),o&&c.removeEventListener("resize",n.update,Hn)}}const jd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$d,data:{}};var Sd={left:"right",right:"left",bottom:"top",top:"bottom"};function ta(e){return e.replace(/left|right|bottom|top/g,function(t){return Sd[t]})}var Ad={start:"end",end:"start"};function es(e){return e.replace(/start|end/g,function(t){return Ad[t]})}function _i(e){var t=oe(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function yi(e){return It(Ze(e)).left+_i(e).scrollLeft}function Td(e,t){var n=oe(e),a=Ze(e),r=n.visualViewport,i=a.clientWidth,s=a.clientHeight,o=0,c=0;if(r){i=r.width,s=r.height;var l=yc();(l||!l&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:o+yi(e),y:c}}function Rd(e){var t,n=Ze(e),a=_i(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=pt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=pt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-a.scrollLeft+yi(e),c=-a.scrollTop;return De(r||n).direction==="rtl"&&(o+=pt(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:o,y:c}}function vi(e){var t=De(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function Cc(e){return["html","body","#document"].indexOf(je(e))>=0?e.ownerDocument.body:me(e)&&vi(e)?e:Cc(Aa(e))}function cn(e,t){var n;t===void 0&&(t=[]);var a=Cc(e),r=a===((n=e.ownerDocument)==null?void 0:n.body),i=oe(a),s=r?[i].concat(i.visualViewport||[],vi(a)?a:[]):a,o=t.concat(s);return r?o:o.concat(cn(Aa(s)))}function Fr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Od(e,t){var n=It(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ts(e,t,n){return t===fc?Fr(Td(e,n)):mt(t)?Od(t,n):Fr(Rd(Ze(e)))}function Id(e){var t=cn(Aa(e)),n=["absolute","fixed"].indexOf(De(e).position)>=0,a=n&&me(e)?Cn(e):e;return mt(a)?t.filter(function(r){return mt(r)&&vc(r,a)&&je(r)!=="body"}):[]}function Nd(e,t,n,a){var r=t==="clippingParents"?Id(e):[].concat(t),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(c,l){var u=ts(e,l,a);return c.top=pt(u.top,c.top),c.right=la(u.right,c.right),c.bottom=la(u.bottom,c.bottom),c.left=pt(u.left,c.left),c},ts(e,s,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Ec(e){var t=e.reference,n=e.element,a=e.placement,r=a?$e(a):null,i=a?Nt(a):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,c;switch(r){case ae:c={x:s,y:t.y-n.height};break;case he:c={x:s,y:t.y+t.height};break;case ge:c={x:t.x+t.width,y:o};break;case re:c={x:t.x-n.width,y:o};break;default:c={x:t.x,y:t.y}}var l=r?bi(r):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case Rt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case mn:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function hn(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.strategy,s=i===void 0?e.strategy:i,o=n.boundary,c=o===void 0?nd:o,l=n.rootBoundary,u=l===void 0?fc:l,p=n.elementContext,d=p===void 0?en:p,m=n.altBoundary,g=m===void 0?!1:m,v=n.padding,f=v===void 0?0:v,b=xc(typeof f!="number"?f:kc(f,kn)),_=d===en?ad:en,w=e.rects.popper,h=e.elements[g?_:d],C=Nd(mt(h)?h:h.contextElement||Ze(e.elements.popper),c,u,s),k=It(e.elements.reference),$=Ec({reference:k,element:w,placement:r}),T=Fr(Object.assign({},w,$)),N=d===en?T:k,I={top:C.top-N.top+b.top,bottom:N.bottom-C.bottom+b.bottom,left:C.left-N.left+b.left,right:N.right-C.right+b.right},D=e.modifiersData.offset;if(d===en&&D){var R=D[r];Object.keys(I).forEach(function(L){var q=[ge,he].indexOf(L)>=0?1:-1,U=[ae,he].indexOf(L)>=0?"y":"x";I[L]+=R[U]*q})}return I}function Ld(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?bc:c,u=Nt(a),p=u?o?Ki:Ki.filter(function(g){return Nt(g)===u}):kn,d=p.filter(function(g){return l.indexOf(g)>=0});d.length===0&&(d=p);var m=d.reduce(function(g,v){return g[v]=hn(e,{placement:v,boundary:r,rootBoundary:i,padding:s})[$e(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Pd(e){if($e(e)===hi)return[];var t=ta(e);return[es(e),t,es(t)]}function Dd(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!0:s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,v=n.allowedAutoPlacements,f=t.options.placement,b=$e(f),_=b===f,w=c||(_||!g?[ta(f)]:Pd(f)),h=[f].concat(w).reduce(function(Se,fe){return Se.concat($e(fe)===hi?Ld(t,{placement:fe,boundary:u,rootBoundary:p,padding:l,flipVariations:g,allowedAutoPlacements:v}):fe)},[]),C=t.rects.reference,k=t.rects.popper,$=new Map,T=!0,N=h[0],I=0;I<h.length;I++){var D=h[I],R=$e(D),L=Nt(D)===Rt,q=[ae,he].indexOf(R)>=0,U=q?"width":"height",G=hn(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),Q=q?L?ge:re:L?he:ae;C[U]>k[U]&&(Q=ta(Q));var K=ta(Q),we=[];if(i&&we.push(G[R]<=0),o&&we.push(G[Q]<=0,G[K]<=0),we.every(function(Se){return Se})){N=D,T=!1;break}$.set(D,we)}if(T)for(var xe=g?3:1,Ye=function(fe){var Ae=h.find(function(bt){var Te=$.get(bt);if(Te)return Te.slice(0,fe).every(function(_t){return _t})});if(Ae)return N=Ae,"break"},ke=xe;ke>0;ke--){var Xe=Ye(ke);if(Xe==="break")break}t.placement!==N&&(t.modifiersData[a]._skip=!0,t.placement=N,t.reset=!0)}}const Md={name:"flip",enabled:!0,phase:"main",fn:Dd,requiresIfExists:["offset"],data:{_skip:!1}};function ns(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function as(e){return[ae,ge,he,re].some(function(t){return e[t]>=0})}function qd(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=hn(t,{elementContext:"reference"}),o=hn(t,{altBoundary:!0}),c=ns(s,a),l=ns(o,r,i),u=as(c),p=as(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const zd={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qd};function Bd(e,t,n){var a=$e(e),r=[re,ae].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*r,[re,ge].indexOf(a)>=0?{x:o,y:s}:{x:s,y:o}}function Ud(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,s=bc.reduce(function(u,p){return u[p]=Bd(p,t.rects,i),u},{}),o=s[t.placement],c=o.x,l=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[a]=s}const Gd={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ud};function Hd(e){var t=e.state,n=e.name;t.modifiersData[n]=Ec({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Wd={name:"popperOffsets",enabled:!0,phase:"read",fn:Hd,data:{}};function Vd(e){return e==="x"?"y":"x"}function Zd(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!1:s,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,g=n.tetherOffset,v=g===void 0?0:g,f=hn(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:u}),b=$e(t.placement),_=Nt(t.placement),w=!_,h=bi(b),C=Vd(h),k=t.modifiersData.popperOffsets,$=t.rects.reference,T=t.rects.popper,N=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,I=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(k){if(i){var L,q=h==="y"?ae:re,U=h==="y"?he:ge,G=h==="y"?"height":"width",Q=k[h],K=Q+f[q],we=Q-f[U],xe=m?-T[G]/2:0,Ye=_===Rt?$[G]:T[G],ke=_===Rt?-T[G]:-$[G],Xe=t.elements.arrow,Se=m&&Xe?fi(Xe):{width:0,height:0},fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wc(),Ae=fe[q],bt=fe[U],Te=on(0,$[G],Se[G]),_t=w?$[G]/2-xe-Te-Ae-I.mainAxis:Ye-Te-Ae-I.mainAxis,Me=w?-$[G]/2+xe+Te+bt+I.mainAxis:ke+Te+bt+I.mainAxis,yt=t.elements.arrow&&Cn(t.elements.arrow),Sn=yt?h==="y"?yt.clientTop||0:yt.clientLeft||0:0,Wt=(L=D?.[h])!=null?L:0,An=Q+_t-Wt-Sn,Tn=Q+Me-Wt,Vt=on(m?la(K,An):K,Q,m?pt(we,Tn):we);k[h]=Vt,R[h]=Vt-Q}if(o){var Zt,Rn=h==="x"?ae:re,On=h==="x"?he:ge,Re=k[C],qe=C==="y"?"height":"width",Yt=Re+f[Rn],Ke=Re-f[On],Xt=[ae,re].indexOf(b)!==-1,In=(Zt=D?.[C])!=null?Zt:0,Nn=Xt?Yt:Re-$[qe]-T[qe]-In+I.altAxis,Ln=Xt?Re+$[qe]+T[qe]-In-I.altAxis:Ke,Pn=m&&Xt?_d(Nn,Re,Ln):on(m?Nn:Yt,Re,m?Ln:Ke);k[C]=Pn,R[C]=Pn-Re}t.modifiersData[a]=R}}const Yd={name:"preventOverflow",enabled:!0,phase:"main",fn:Zd,requiresIfExists:["offset"]};function Xd(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Kd(e){return e===oe(e)||!me(e)?_i(e):Xd(e)}function Qd(e){var t=e.getBoundingClientRect(),n=Ot(t.width)/e.offsetWidth||1,a=Ot(t.height)/e.offsetHeight||1;return n!==1||a!==1}function Jd(e,t,n){n===void 0&&(n=!1);var a=me(t),r=me(t)&&Qd(t),i=Ze(t),s=It(e,r,n),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&((je(t)!=="body"||vi(i))&&(o=Kd(t)),me(t)?(c=It(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=yi(i))),{x:s.left+o.scrollLeft-c.x,y:s.top+o.scrollTop-c.y,width:s.width,height:s.height}}function em(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var c=t.get(o);c&&r(c)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function tm(e){var t=em(e);return md.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function nm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function am(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign({},r,a,{options:Object.assign({},r.options,a.options),data:Object.assign({},r.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var rs={placement:"bottom",modifiers:[],strategy:"absolute"};function is(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function rm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?rs:r;return function(o,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},rs,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},p=[],d=!1,m={state:u,setOptions:function(b){var _=typeof b=="function"?b(u.options):b;v(),u.options=Object.assign({},i,u.options,_),u.scrollParents={reference:mt(o)?cn(o):o.contextElement?cn(o.contextElement):[],popper:cn(c)};var w=tm(am([].concat(a,u.options.modifiers)));return u.orderedModifiers=w.filter(function(h){return h.enabled}),g(),m.update()},forceUpdate:function(){if(!d){var b=u.elements,_=b.reference,w=b.popper;if(is(_,w)){u.rects={reference:Jd(_,Cn(w),u.options.strategy==="fixed"),popper:fi(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var h=0;h<u.orderedModifiers.length;h++){if(u.reset===!0){u.reset=!1,h=-1;continue}var C=u.orderedModifiers[h],k=C.fn,$=C.options,T=$===void 0?{}:$,N=C.name;typeof k=="function"&&(u=k({state:u,options:T,name:N,instance:m})||u)}}}},update:nm(function(){return new Promise(function(f){m.forceUpdate(),f(u)})}),destroy:function(){v(),d=!0}};if(!is(o,c))return m;m.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)});function g(){u.orderedModifiers.forEach(function(f){var b=f.name,_=f.options,w=_===void 0?{}:_,h=f.effect;if(typeof h=="function"){var C=h({state:u,name:b,instance:m,options:w}),k=function(){};p.push(C||k)}})}function v(){p.forEach(function(f){return f()}),p=[]}return m}}var im=[jd,Wd,Fd,_c,Gd,Md,Yd,xd,zd],sm=rm({defaultModifiers:im}),om="tippy-box",Fc="tippy-content",cm="tippy-backdrop",$c="tippy-arrow",jc="tippy-svg-arrow",tt={passive:!0,capture:!0},Sc=function(){return document.body};function Ga(e,t,n){if(Array.isArray(e)){var a=e[t];return a??(Array.isArray(n)?n[t]:n)}return e}function wi(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Ac(e,t){return typeof e=="function"?e.apply(void 0,t):e}function ss(e,t){if(t===0)return e;var n;return function(a){clearTimeout(n),n=setTimeout(function(){e(a)},t)}}function lm(e){return e.split(/\s+/).filter(Boolean)}function Ct(e){return[].concat(e)}function os(e,t){e.indexOf(t)===-1&&e.push(t)}function um(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function pm(e){return e.split("-")[0]}function ua(e){return[].slice.call(e)}function cs(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ln(){return document.createElement("div")}function Ta(e){return["Element","Fragment"].some(function(t){return wi(e,t)})}function dm(e){return wi(e,"NodeList")}function mm(e){return wi(e,"MouseEvent")}function hm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function gm(e){return Ta(e)?[e]:dm(e)?ua(e):Array.isArray(e)?e:ua(document.querySelectorAll(e))}function Ha(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function ls(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function fm(e){var t,n=Ct(e),a=n[0];return a!=null&&(t=a.ownerDocument)!=null&&t.body?a.ownerDocument:document}function bm(e,t){var n=t.clientX,a=t.clientY;return e.every(function(r){var i=r.popperRect,s=r.popperState,o=r.props,c=o.interactiveBorder,l=pm(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=l==="bottom"?u.top.y:0,d=l==="top"?u.bottom.y:0,m=l==="right"?u.left.x:0,g=l==="left"?u.right.x:0,v=i.top-a+p>c,f=a-i.bottom-d>c,b=i.left-n+m>c,_=n-i.right-g>c;return v||f||b||_})}function Wa(e,t,n){var a=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){e[a](r,n)})}function us(e,t){for(var n=t;n;){var a;if(e.contains(n))return!0;n=n.getRootNode==null||(a=n.getRootNode())==null?void 0:a.host}return!1}var Fe={isTouch:!1},ps=0;function _m(){Fe.isTouch||(Fe.isTouch=!0,window.performance&&document.addEventListener("mousemove",Tc))}function Tc(){var e=performance.now();e-ps<20&&(Fe.isTouch=!1,document.removeEventListener("mousemove",Tc)),ps=e}function ym(){var e=document.activeElement;if(hm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function vm(){document.addEventListener("touchstart",_m,tt),window.addEventListener("blur",ym)}var wm=typeof window<"u"&&typeof document<"u",xm=wm?!!window.msCrypto:!1,km={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Cm={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_e=Object.assign({appendTo:Sc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},km,Cm),Em=Object.keys(_e),Fm=function(t){var n=Object.keys(t);n.forEach(function(a){_e[a]=t[a]})};function Rc(e){var t=e.plugins||[],n=t.reduce(function(a,r){var i=r.name,s=r.defaultValue;if(i){var o;a[i]=e[i]!==void 0?e[i]:(o=_e[i])!=null?o:s}return a},{});return Object.assign({},e,n)}function $m(e,t){var n=t?Object.keys(Rc(Object.assign({},_e,{plugins:t}))):Em,a=n.reduce(function(r,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return r;if(i==="content")r[i]=s;else try{r[i]=JSON.parse(s)}catch{r[i]=s}return r},{});return a}function ds(e,t){var n=Object.assign({},t,{content:Ac(t.content,[e])},t.ignoreAttributes?{}:$m(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var jm=function(){return"innerHTML"};function $r(e,t){e[jm()]=t}function ms(e){var t=ln();return e===!0?t.className=$c:(t.className=jc,Ta(e)?t.appendChild(e):$r(t,e)),t}function hs(e,t){Ta(t.content)?($r(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$r(e,t.content):e.textContent=t.content)}function jr(e){var t=e.firstElementChild,n=ua(t.children);return{box:t,content:n.find(function(a){return a.classList.contains(Fc)}),arrow:n.find(function(a){return a.classList.contains($c)||a.classList.contains(jc)}),backdrop:n.find(function(a){return a.classList.contains(cm)})}}function Oc(e){var t=ln(),n=ln();n.className=om,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var a=ln();a.className=Fc,a.setAttribute("data-state","hidden"),hs(a,e.props),t.appendChild(n),n.appendChild(a),r(e.props,e.props);function r(i,s){var o=jr(t),c=o.box,l=o.content,u=o.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&hs(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(ms(s.arrow))):c.appendChild(ms(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:r}}Oc.$$tippy=!0;var Sm=1,Wn=[],Va=[];function Am(e,t){var n=ds(e,Object.assign({},_e,Rc(cs(t)))),a,r,i,s=!1,o=!1,c=!1,l=!1,u,p,d,m=[],g=ss(An,n.interactiveDebounce),v,f=Sm++,b=null,_=um(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:f,reference:e,popper:ln(),popperInstance:b,props:n,state:w,plugins:_,clearDelayTimeouts:Nn,setProps:Ln,setContent:Pn,show:zl,hide:Bl,hideWithInteractivity:Ul,enable:Xt,disable:In,unmount:Gl,destroy:Hl};if(!n.render)return h;var C=n.render(h),k=C.popper,$=C.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+h.id,h.popper=k,e._tippy=h,k._tippy=h;var T=_.map(function(y){return y.fn(h)}),N=e.hasAttribute("aria-expanded");return yt(),xe(),Q(),K("onCreate",[h]),n.showOnCreate&&Yt(),k.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",g)}),h;function I(){var y=h.props.touch;return Array.isArray(y)?y:[y,0]}function D(){return I()[0]==="hold"}function R(){var y;return!!((y=h.props.render)!=null&&y.$$tippy)}function L(){return v||e}function q(){var y=L().parentNode;return y?fm(y):document}function U(){return jr(k)}function G(y){return h.state.isMounted&&!h.state.isVisible||Fe.isTouch||u&&u.type==="focus"?0:Ga(h.props.delay,y?0:1,_e.delay)}function Q(y){y===void 0&&(y=!1),k.style.pointerEvents=h.props.interactive&&!y?"":"none",k.style.zIndex=""+h.props.zIndex}function K(y,E,F){if(F===void 0&&(F=!0),T.forEach(function(A){A[y]&&A[y].apply(A,E)}),F){var O;(O=h.props)[y].apply(O,E)}}function we(){var y=h.props.aria;if(y.content){var E="aria-"+y.content,F=k.id,O=Ct(h.props.triggerTarget||e);O.forEach(function(A){var te=A.getAttribute(E);if(h.state.isVisible)A.setAttribute(E,te?te+" "+F:F);else{var ce=te&&te.replace(F,"").trim();ce?A.setAttribute(E,ce):A.removeAttribute(E)}})}}function xe(){if(!(N||!h.props.aria.expanded)){var y=Ct(h.props.triggerTarget||e);y.forEach(function(E){h.props.interactive?E.setAttribute("aria-expanded",h.state.isVisible&&E===L()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ye(){q().removeEventListener("mousemove",g),Wn=Wn.filter(function(y){return y!==g})}function ke(y){if(!(Fe.isTouch&&(c||y.type==="mousedown"))){var E=y.composedPath&&y.composedPath()[0]||y.target;if(!(h.props.interactive&&us(k,E))){if(Ct(h.props.triggerTarget||e).some(function(F){return us(F,E)})){if(Fe.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else K("onClickOutside",[h,y]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),o=!0,setTimeout(function(){o=!1}),h.state.isMounted||Ae())}}}function Xe(){c=!0}function Se(){c=!1}function fe(){var y=q();y.addEventListener("mousedown",ke,!0),y.addEventListener("touchend",ke,tt),y.addEventListener("touchstart",Se,tt),y.addEventListener("touchmove",Xe,tt)}function Ae(){var y=q();y.removeEventListener("mousedown",ke,!0),y.removeEventListener("touchend",ke,tt),y.removeEventListener("touchstart",Se,tt),y.removeEventListener("touchmove",Xe,tt)}function bt(y,E){_t(y,function(){!h.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&E()})}function Te(y,E){_t(y,E)}function _t(y,E){var F=U().box;function O(A){A.target===F&&(Wa(F,"remove",O),E())}if(y===0)return E();Wa(F,"remove",p),Wa(F,"add",O),p=O}function Me(y,E,F){F===void 0&&(F=!1);var O=Ct(h.props.triggerTarget||e);O.forEach(function(A){A.addEventListener(y,E,F),m.push({node:A,eventType:y,handler:E,options:F})})}function yt(){D()&&(Me("touchstart",Wt,{passive:!0}),Me("touchend",Tn,{passive:!0})),lm(h.props.trigger).forEach(function(y){if(y!=="manual")switch(Me(y,Wt),y){case"mouseenter":Me("mouseleave",Tn);break;case"focus":Me(xm?"focusout":"blur",Vt);break;case"focusin":Me("focusout",Vt);break}})}function Sn(){m.forEach(function(y){var E=y.node,F=y.eventType,O=y.handler,A=y.options;E.removeEventListener(F,O,A)}),m=[]}function Wt(y){var E,F=!1;if(!(!h.state.isEnabled||Zt(y)||o)){var O=((E=u)==null?void 0:E.type)==="focus";u=y,v=y.currentTarget,xe(),!h.state.isVisible&&mm(y)&&Wn.forEach(function(A){return A(y)}),y.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?F=!0:Yt(y),y.type==="click"&&(s=!F),F&&!O&&Ke(y)}}function An(y){var E=y.target,F=L().contains(E)||k.contains(E);if(!(y.type==="mousemove"&&F)){var O=qe().concat(k).map(function(A){var te,ce=A._tippy,vt=(te=ce.popperInstance)==null?void 0:te.state;return vt?{popperRect:A.getBoundingClientRect(),popperState:vt,props:n}:null}).filter(Boolean);bm(O,y)&&(Ye(),Ke(y))}}function Tn(y){var E=Zt(y)||h.props.trigger.indexOf("click")>=0&&s;if(!E){if(h.props.interactive){h.hideWithInteractivity(y);return}Ke(y)}}function Vt(y){h.props.trigger.indexOf("focusin")<0&&y.target!==L()||h.props.interactive&&y.relatedTarget&&k.contains(y.relatedTarget)||Ke(y)}function Zt(y){return Fe.isTouch?D()!==y.type.indexOf("touch")>=0:!1}function Rn(){On();var y=h.props,E=y.popperOptions,F=y.placement,O=y.offset,A=y.getReferenceClientRect,te=y.moveTransition,ce=R()?jr(k).arrow:null,vt=A?{getBoundingClientRect:A,contextElement:A.contextElement||L()}:e,Li={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Dn){var wt=Dn.state;if(R()){var Wl=U(),Da=Wl.box;["placement","reference-hidden","escaped"].forEach(function(Mn){Mn==="placement"?Da.setAttribute("data-placement",wt.placement):wt.attributes.popper["data-popper-"+Mn]?Da.setAttribute("data-"+Mn,""):Da.removeAttribute("data-"+Mn)}),wt.attributes.popper={}}}},Qe=[{name:"offset",options:{offset:O}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},Li];R()&&ce&&Qe.push({name:"arrow",options:{element:ce,padding:3}}),Qe.push.apply(Qe,E?.modifiers||[]),h.popperInstance=sm(vt,k,Object.assign({},E,{placement:F,onFirstUpdate:d,modifiers:Qe}))}function On(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function Re(){var y=h.props.appendTo,E,F=L();h.props.interactive&&y===Sc||y==="parent"?E=F.parentNode:E=Ac(y,[F]),E.contains(k)||E.appendChild(k),h.state.isMounted=!0,Rn()}function qe(){return ua(k.querySelectorAll("[data-tippy-root]"))}function Yt(y){h.clearDelayTimeouts(),y&&K("onTrigger",[h,y]),fe();var E=G(!0),F=I(),O=F[0],A=F[1];Fe.isTouch&&O==="hold"&&A&&(E=A),E?a=setTimeout(function(){h.show()},E):h.show()}function Ke(y){if(h.clearDelayTimeouts(),K("onUntrigger",[h,y]),!h.state.isVisible){Ae();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(y.type)>=0&&s)){var E=G(!1);E?r=setTimeout(function(){h.state.isVisible&&h.hide()},E):i=requestAnimationFrame(function(){h.hide()})}}function Xt(){h.state.isEnabled=!0}function In(){h.hide(),h.state.isEnabled=!1}function Nn(){clearTimeout(a),clearTimeout(r),cancelAnimationFrame(i)}function Ln(y){if(!h.state.isDestroyed){K("onBeforeUpdate",[h,y]),Sn();var E=h.props,F=ds(e,Object.assign({},E,cs(y),{ignoreAttributes:!0}));h.props=F,yt(),E.interactiveDebounce!==F.interactiveDebounce&&(Ye(),g=ss(An,F.interactiveDebounce)),E.triggerTarget&&!F.triggerTarget?Ct(E.triggerTarget).forEach(function(O){O.removeAttribute("aria-expanded")}):F.triggerTarget&&e.removeAttribute("aria-expanded"),xe(),Q(),$&&$(E,F),h.popperInstance&&(Rn(),qe().forEach(function(O){requestAnimationFrame(O._tippy.popperInstance.forceUpdate)})),K("onAfterUpdate",[h,y])}}function Pn(y){h.setProps({content:y})}function zl(){var y=h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Fe.isTouch&&!h.props.touch,A=Ga(h.props.duration,0,_e.duration);if(!(y||E||F||O)&&!L().hasAttribute("disabled")&&(K("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,R()&&(k.style.visibility="visible"),Q(),fe(),h.state.isMounted||(k.style.transition="none"),R()){var te=U(),ce=te.box,vt=te.content;Ha([ce,vt],0)}d=function(){var Qe;if(!(!h.state.isVisible||l)){if(l=!0,k.offsetHeight,k.style.transition=h.props.moveTransition,R()&&h.props.animation){var Pa=U(),Dn=Pa.box,wt=Pa.content;Ha([Dn,wt],A),ls([Dn,wt],"visible")}we(),xe(),os(Va,h),(Qe=h.popperInstance)==null||Qe.forceUpdate(),K("onMount",[h]),h.props.animation&&R()&&Te(A,function(){h.state.isShown=!0,K("onShown",[h])})}},Re()}}function Bl(){var y=!h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Ga(h.props.duration,1,_e.duration);if(!(y||E||F)&&(K("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,l=!1,s=!1,R()&&(k.style.visibility="hidden"),Ye(),Ae(),Q(!0),R()){var A=U(),te=A.box,ce=A.content;h.props.animation&&(Ha([te,ce],O),ls([te,ce],"hidden"))}we(),xe(),h.props.animation?R()&&bt(O,h.unmount):h.unmount()}}function Ul(y){q().addEventListener("mousemove",g),os(Wn,g),g(y)}function Gl(){h.state.isVisible&&h.hide(),h.state.isMounted&&(On(),qe().forEach(function(y){y._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Va=Va.filter(function(y){return y!==h}),h.state.isMounted=!1,K("onHidden",[h]))}function Hl(){h.state.isDestroyed||(h.clearDelayTimeouts(),h.unmount(),Sn(),delete e._tippy,h.state.isDestroyed=!0,K("onDestroy",[h]))}}function En(e,t){t===void 0&&(t={});var n=_e.plugins.concat(t.plugins||[]);vm();var a=Object.assign({},t,{plugins:n}),r=gm(e),i=r.reduce(function(s,o){var c=o&&Am(o,a);return c&&s.push(c),s},[]);return Ta(e)?i[0]:i}En.defaultProps=_e;En.setDefaultProps=Fm;En.currentInput=Fe;Object.assign({},_c,{effect:function(t){var n=t.state,a={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,a.popper),n.styles=a,n.elements.arrow&&Object.assign(n.elements.arrow.style,a.arrow)}});En.setDefaultProps({render:Oc});let Y=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Tm(e){return xi(e)}function xi(e){return Array.isArray(e)?Rm(e):e instanceof RegExp?e:typeof e=="object"?Om(e):e}function Rm(e){let t=[];for(let n=0,a=e.length;n<a;n++)t[n]=xi(e[n]);return t}function Om(e){let t={};for(let n in e)t[n]=xi(e[n]);return t}function Ic(e,...t){return t.forEach(n=>{for(let a in n)e[a]=n[a]}),e}function Nc(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Nc(e.substring(0,e.length-1)):e.substr(~t+1)}var Za=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Vn=class{static hasCaptures(e){return e===null?!1:(Za.lastIndex=0,Za.test(e))}static replaceCaptures(e,t,n){return e.replace(Za,(a,r,i,s)=>{let o=n[parseInt(r||i,10)];if(o){let c=t.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(s){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Lc(e,t){return e<t?-1:e>t?1:0}function Pc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,a=t.length;if(n===a){for(let r=0;r<n;r++){let i=Lc(e[r],t[r]);if(i!==0)return i}return 0}return n-a}function gs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Dc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Mc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},pa=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Lm(e),t)}static createFromParsedTheme(e,t){return Dm(e,t)}_cachedMatchRoot=new Mc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,a=this._cachedMatchRoot.get(t).find(r=>Im(e.parent,r.parentScopes));return a?new qc(a.fontStyle,a.foreground,a.background):null}},Ya=class na{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const a of n)t=new na(t,a);return t}static from(...t){let n=null;for(let a=0;a<t.length;a++)n=new na(n,t[a]);return n}push(t){return new na(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push(a.scopeName),a=a.parent;return a===t?n.reverse():void 0}};function Im(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let a=t[n],r=!1;if(a===">"){if(n===t.length-1)return!1;a=t[++n],r=!0}for(;e&&!Nm(e.scopeName,a);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Nm(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Lm(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],a=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let o;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(s.scope)?o=s.scope:o=[""];let c=-1;if(typeof s.settings.fontStyle=="string"){c=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof s.settings.foreground=="string"&&gs(s.settings.foreground)&&(l=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&gs(s.settings.background)&&(u=s.settings.background);for(let p=0,d=o.length;p<d;p++){let g=o[p].trim().split(" "),v=g[g.length-1],f=null;g.length>1&&(f=g.slice(0,g.length-1),f.reverse()),n[a++]=new Pm(v,f,r,c,l,u)}}return n}var Pm=class{constructor(e,t,n,a,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},ee=(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))(ee||{});function Dm(e,t){e.sort((c,l)=>{let u=Lc(c.scope,l.scope);return u!==0||(u=Pc(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new Mm(t),s=new qc(n,i.getId(a),i.getId(r)),o=new zm(new Sr(0,null,-1,0,0),[]);for(let c=0,l=e.length;c<l;c++){let u=e[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pa(i,s,o)}var Mm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},qm=Object.freeze([]),Sr=class zc{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,a,r,i){this.scopeDepth=t,this.parentScopes=n||qm,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new zc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let a=0,r=t.length;a<r;a++)n[a]=t[a].clone();return n}acceptOverwrite(t,n,a,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},zm=class Ar{constructor(t,n=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let a=0,r=0;for(;t.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),r,i;if(a===-1?(r=t,i=""):(r=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ar._cmpBySpecificity),n}insert(t,n,a,r,i,s){if(n===""){this._doInsertHere(t,a,r,i,s);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Ar(this._mainRule.clone(),Sr.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,a,r,i,s)}_doInsertHere(t,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(t,a,r,i);return}for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let c=this._rulesWithParentScopes[s];if(Pc(c.parentScopes,n)===0){c.acceptOverwrite(t,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Sr(t,n,a,r,i))}},Lt=class le{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=le.getLanguageId(t),a=le.getTokenType(t),r=le.getFontStyle(t),i=le.getForeground(t),s=le.getBackground(t);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>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,a,r,i,s,o){let c=le.getLanguageId(t),l=le.getTokenType(t),u=le.containsBalancedBrackets(t)?1:0,p=le.getFontStyle(t),d=le.getForeground(t),m=le.getBackground(t);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(p=i),s!==0&&(d=s),o!==0&&(m=o),(c<<0|l<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function da(e,t){const n=[],a=Bm(e);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=s();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=o();return r===")"&&(r=a.next()),c}if(fs(r)){const c=[];do c.push(r),r=a.next();while(fs(r));return l=>t(c,l)}return null}function s(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(p=>p(u))}function o(){const c=[];let l=s();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=s()}return u=>c.some(p=>p(u))}}function fs(e){return!!e&&!!e.match(/[\w\.:]+/)}function Bm(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const a=n[0];return n=t.exec(e),a}}}function Bc(e){typeof e.dispose=="function"&&e.dispose()}var gn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Um=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Gm=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))}},Hm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new gn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Gm;for(const n of e)Wm(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof gn){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 Wm(e,t,n,a){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof gn?aa({baseGrammar:i,selfGrammar:r},a):Tr(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const s=n.injections(e.scopeName);if(s)for(const o of s)a.add(new gn(o))}function Tr(e,t,n){if(t.repository&&t.repository[e]){const a=t.repository[e];ma([a],t,n)}}function aa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ma(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ma(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ma(e,t,n){for(const a of e){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?Ic({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ma(a.patterns,{...t,repository:r},n);const i=a.include;if(!i)continue;const s=Uc(i);switch(s.kind){case 0:aa({...t,selfGrammar:t.baseGrammar},n);break;case 1:aa(t,n);break;case 2:Tr(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const o=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(o){const c={baseGrammar:t.baseGrammar,selfGrammar:o,repository:r};s.kind===4?Tr(s.ruleName,c,n):aa(c,n)}else s.kind===4?n.add(new Um(s.scopeName,s.ruleName)):n.add(new gn(s.scopeName));break}}}var Vm=class{kind=0},Zm=class{kind=1},Ym=class{constructor(e){this.ruleName=e}kind=2},Xm=class{constructor(e){this.scopeName=e}kind=3},Km=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uc(e){if(e==="$base")return new Vm;if(e==="$self")return new Zm;const t=e.indexOf("#");if(t===-1)return new Xm(e);if(t===0)return new Ym(e.substring(1));{const n=e.substring(0,t),a=e.substring(t+1);return new Km(n,a)}}var Qm=/\\(\d+)/,bs=/\\(\d+)/g,Jm=-1,Gc=-2;var Fn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,a){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Vn.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Vn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nc(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:Vn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Vn.replaceCaptures(this._contentName,e,t)}},eh=class extends Fn{retokenizeCapturedWithRuleId;constructor(e,t,n,a,r){super(e,t,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,a){throw new Error("Not supported!")}},th=class extends Fn{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,null),this._match=new fn(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_s=class extends Fn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rr=class extends Fn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r,i,s,o,c,l){super(e,t,n,a),this._begin=new fn(r,this.id),this.beginCaptures=i,this._end=new fn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bn;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}},ha=class extends Fn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,a,r,i,s,o,c){super(e,t,n,a),this._begin=new fn(r,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new fn(s,Gc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bn;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,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new bn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Hc=class J{static createCaptureRule(t,n,a,r,i){return t.registerRule(s=>new eh(n,s,a,r,i))}static getCompiledRuleId(t,n,a){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new th(t.$vscodeTextmateLocation,t.id,t.name,t.match,J._compileCaptures(t.captures,n,a));if(typeof t.begin>"u"){t.repository&&(a=Ic({},a,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new _s(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,J._compilePatterns(i,n,a))}return t.while?new ha(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.while,J._compileCaptures(t.whileCaptures||t.captures,n,a),J._compilePatterns(t.patterns,n,a)):new Rr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.end,J._compileCaptures(t.endCaptures||t.captures,n,a),t.applyEndPatternLast,J._compilePatterns(t.patterns,n,a))}),t.id}static _compileCaptures(t,n,a){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);o>i&&(i=o)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);let c=0;t[s].patterns&&(c=J.getCompiledRuleId(t[s],n,a)),r[o]=J.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,c)}}return r}static _compilePatterns(t,n,a){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i];let c=-1;if(o.include){const l=Uc(o.include);switch(l.kind){case 0:case 1:c=J.getCompiledRuleId(a[o.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=J.getCompiledRuleId(u,n,a));break;case 3:case 4:const p=l.scopeName,d=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(p,a);if(m)if(d){let g=m.repository[d];g&&(c=J.getCompiledRuleId(g,n,m.repository))}else c=J.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else c=J.getCompiledRuleId(o,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof _s||l instanceof Rr||l instanceof ha)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},fn=class Wc{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const a=t.length;let r=0,i=[],s=!1;for(let o=0;o<a;o++)if(t.charAt(o)==="\\"&&o+1<a){const l=t.charAt(o+1);l==="z"?(i.push(t.substring(r,o)),i.push("$(?!\\n)(?<!\\n)"),r=o+2):(l==="A"||l==="G")&&(s=!0),o++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Qm.test(this.source):this.hasBackReferences=!1}clone(){return new Wc(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>t.substring(r.start,r.end));return bs.lastIndex=0,this.source.replace(bs,(r,i)=>Dc(a[parseInt(i,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=[],a=[],r=[],i,s,o,c;for(i=0,s=this.source.length;i<s;i++)o=this.source.charAt(i),t[i]=o,n[i]=o,a[i]=o,r[i]=o,o==="\\"&&i+1<s&&(c=this.source.charAt(i+1),c==="A"?(t[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):c==="G"?(t[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(t[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},bn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ys(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 a=this._items.map(r=>r.resolveAnchors(t,n));return new ys(e,a,this._items.map(r=>r.ruleId))}},ys=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<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
-`)}findNextMatchSync(e,t,n){const a=this.scanner.findNextMatchSync(e,t,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},Xa=class{constructor(e,t){this.languageId=e,this.tokenType=t}},nh=class Or{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Xa(t,8),this._embeddedLanguagesMatcher=new ah(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Or._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Xa(0,0);_getBasicScopeAttributes=new Mc(t=>{const n=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new Xa(n,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Or.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/},ah=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,a])=>Dc(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])}},vs=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Vc(e,t,n,a,r,i,s,o){const c=t.content.length;let l=!1,u=-1;if(s){const m=rh(e,t,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!l;){if(o!==0&&Date.now()-p>o)return new vs(r,!0);d()}return new vs(r,!1);function d(){const m=ih(e,t,n,a,r,u);if(!m){i.produce(r,c),l=!0;return}const g=m.captureIndices,v=m.matchedRuleId,f=g&&g.length>0?g[0].end>a:!1;if(v===Jm){const b=r.getRule(e);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),an(e,t,n,r,i,b.endCaptures,g),i.produce(r,g[0].end);const _=r;if(r=r.parent,u=_.getAnchorPos(),!f&&_.getEnterPos()===a){r=_,i.produce(r,c),l=!0;return}}else{const b=e.getRule(v);i.produce(r,g[0].start);const _=r,w=b.getName(t.content,g),h=r.contentNameScopesList.pushAttributed(w,e);if(r=r.push(v,a,u,g[0].end===c,null,h,h),b instanceof Rr){const C=b;an(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(b instanceof ha){const C=b;an(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(an(e,t,n,r,i,b.captures,g),i.produce(r,g[0].end),r=r.pop(),!f){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function rh(e,t,n,a,r,i){let s=r.beginRuleCapturedEOL?0:-1;const o=[];for(let c=r;c;c=c.pop()){const l=c.getRule(e);l instanceof ha&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:u}=ch(c.rule,e,c.stack.endRule,n,a===s),p=l.findNextMatchSync(t,a,u);if(p){if(p.ruleId!==Gc){r=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(c.stack,p.captureIndices[0].start),an(e,t,n,c.stack,i,c.rule.whileCaptures,p.captureIndices),i.produce(c.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>a&&(a=p.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:s,isFirstLine:n}}function ih(e,t,n,a,r,i){const s=sh(e,t,n,a,r,i),o=e.getInjections();if(o.length===0)return s;const c=oh(o,e,t,n,a,r,i);if(!c)return s;if(!s)return c;const l=s.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:s}function sh(e,t,n,a,r,i){const s=r.getRule(e),{ruleScanner:o,findOptions:c}=Zc(s,e,r.endRule,n,a===i),l=o.findNextMatchSync(t,a,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function oh(e,t,n,a,r,i,s){let o=Number.MAX_VALUE,c=null,l,u=0;const p=i.contentNameScopesList.getScopeNames();for(let d=0,m=e.length;d<m;d++){const g=e[d];if(!g.matcher(p))continue;const v=t.getRule(g.ruleId),{ruleScanner:f,findOptions:b}=Zc(v,t,null,a,r===s),_=f.findNextMatchSync(n,r,b);if(!_)continue;const w=_.captureIndices[0].start;if(!(w>=o)&&(o=w,c=_.captureIndices,l=_.ruleId,u=g.priority,o===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Zc(e,t,n,a,r){return{ruleScanner:e.compileAG(t,n,a,r),findOptions:0}}function ch(e,t,n,a,r){return{ruleScanner:e.compileWhileAG(t,n,a,r),findOptions:0}}function an(e,t,n,a,r,i,s){if(i.length===0)return;const o=t.content,c=Math.min(i.length,s.length),l=[],u=s[0].end;for(let p=0;p<c;p++){const d=i[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),d.retokenizeCapturedWithRuleId){const v=d.getName(o,s),f=a.contentNameScopesList.pushAttributed(v,e),b=d.getContentName(o,s),_=f.pushAttributed(b,e),w=a.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,f,_),h=e.createOnigString(o.substring(0,m.end));Vc(e,h,n&&m.start===0,m.start,w,r,!1,0),Bc(h);continue}const g=d.getName(o,s);if(g!==null){const f=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,e);l.push(new lh(f,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var lh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function uh(e,t,n,a,r,i,s,o){return new dh(e,t,n,a,r,i,s,o)}function ws(e,t,n,a,r){const i=da(t,ga),s=Hc.getCompiledRuleId(n,a,r.repository);for(const o of i)e.push({debugSelector:t,matcher:o.matcher,ruleId:s,grammar:r,priority:o.priority})}function ga(e,t){if(t.length<e.length)return!1;let n=0;return e.every(a=>{for(let r=n;r<t.length;r++)if(ph(t[r],a))return n=r+1,!0;return!1})}function ph(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var dh=class{constructor(e,t,n,a,r,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new nh(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=xs(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=da(c,ga);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_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:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,a=e.lookup(n);if(a){const r=a.injections;if(r)for(let s in r)ws(t,s,r[s],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const o=this.getExternalGrammar(s);if(o){const c=o.injectionSelector;c&&ws(t,c,o,this,o)}})}return t.sort((r,i)=>r.priority-i.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]=xs(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const a=this._tokenize(e,t,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,n=0){const a=this._tokenize(e,t,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,n,a){this._rootId===-1&&(this._rootId=Hc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Ir.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Lt.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=un.createRootAndLookUpScopeName(d,p,this):m=un.createRoot("unknown",p),t=new Ir(null,this._rootId,-1,-1,!1,null,m,m)}else r=!1,t.reset();e=e+`
-`;const i=this.createOnigString(e),s=i.content.length,o=new hh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Vc(this,i,r,0,t,o,!0,a);return Bc(i),{lineLength:s,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function xs(e,t){return e=Tm(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 un=class Ce{constructor(t,n,a){this.parent=t,this.scopePath=n,this.tokenAttributes=a}static fromExtension(t,n){let a=t,r=t?.scopePath??null;for(const i of n)r=Ya.push(r,i.scopeNames),a=new Ce(a,r,i.encodedTokenAttributes);return a}static createRoot(t,n){return new Ce(null,new Ya(null,t),n)}static createRootAndLookUpScopeName(t,n,a){const r=a.getMetadataForScope(t),i=new Ya(null,t),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(n,r,s);return new Ce(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ce.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,a){let r=-1,i=0,s=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,s=a.backgroundId),Lt.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ce._pushAttributed(this,t,n);const a=t.split(/ /g);let r=this;for(const i of a)r=Ce._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,a){const r=a.getMetadataForScope(n),i=t.scopePath.push(n),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(t.tokenAttributes,r,s);return new Ce(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?n.reverse():void 0}},Ir=class nt{constructor(t,n,a,r,i,s,o,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new nt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:nt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?un.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(){nt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,a,r,i,s,o){return new nt(this,t,n,a,r,i,s,o)}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 nt(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 a=un.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new nt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,un.fromExtension(a,n.contentNameScopesList))}},mh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):da(n,ga).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>da(n,ga).map(a=>a.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}},hh=class{constructor(e,t,n,a){this.balancedBracketSelectors=a,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 a=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(a=Lt.set(a,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=Lt.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},gh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,a,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,uh(e,i,t,n,a,r,this,this._onigLib))}return this._grammars.get(e)}},fh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new gh(pa.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(pa.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,a){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,n,a){return this._loadGrammar(t,n,a.embeddedLanguages,a.tokenTypes,new mh(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,a,r,i){const s=new Hm(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(o=>this._loadSingleGrammar(o.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(t,n=[],a=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,a,r)}_grammarForScopeName(t,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,a,r,i)}},Nr=Ir.NULL;const bh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class $n{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}$n.prototype.normal={};$n.prototype.property={};$n.prototype.space=void 0;function Yc(e,t){const n={},a={};for(const r of e)Object.assign(n,r.property),Object.assign(a,r.normal);return new $n(n,a,t)}function Lr(e){return e.toLowerCase()}class ie{constructor(t,n){this.attribute=n,this.property=t}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let _h=0;const S=ft(),H=ft(),Pr=ft(),x=ft(),P=ft(),jt=ft(),se=ft();function ft(){return 2**++_h}const Dr=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:H,commaOrSpaceSeparated:se,commaSeparated:jt,number:x,overloadedBoolean:Pr,spaceSeparated:P},Symbol.toStringTag,{value:"Module"})),Ka=Object.keys(Dr);class ki extends ie{constructor(t,n,a,r){let i=-1;if(super(t,n),ks(this,"space",r),typeof a=="number")for(;++i<Ka.length;){const s=Ka[i];ks(this,Ka[i],(a&Dr[s])===Dr[s])}}}ki.prototype.defined=!0;function ks(e,t,n){n&&(e[t]=n)}function Bt(e){const t={},n={};for(const[a,r]of Object.entries(e.properties)){const i=new ki(a,e.transform(e.attributes||{},a),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),t[a]=i,n[Lr(a)]=a,n[Lr(i.attribute)]=a}return new $n(t,n,e.space)}const Xc=Bt({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:H,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:P,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:x,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:P,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:H,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function Qc(e,t){return Kc(e,t.toLowerCase())}const yh=Bt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jt,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:P,autoFocus:S,autoPlay:S,blocking:P,capture:null,charSet:null,checked:S,cite:null,className:P,cols:x,colSpan:null,content:null,contentEditable:H,controls:S,controlsList:P,coords:x|jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Pr,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:P,height:x,hidden:Pr,high:x,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:P,itemRef:P,itemScope:S,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S,optimum:x,pattern:null,ping:P,placeholder:null,playsInline:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:P,required:S,reversed:S,rows:x,rowSpan:x,sandbox:P,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:H,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:Qc}),vh=Bt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:se,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jt,g2:jt,glyphName:jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:se,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:se,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:se,rev:se,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:se,requiredFeatures:se,requiredFonts:se,requiredFormats:se,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:se,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:se,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:se,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kc}),Jc=Bt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),el=Bt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qc}),tl=Bt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wh=/[A-Z]/g,Cs=/-[a-z]/g,xh=/^data[-\w.:]+$/i;function kh(e,t){const n=Lr(t);let a=t,r=ie;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xh.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Cs,Eh);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Cs.test(i)){let s=i.replace(wh,Ch);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=ki}return new r(a,t)}function Ch(e){return"-"+e.toLowerCase()}function Eh(e){return e.charAt(1).toUpperCase()}const Fh=Yc([Xc,yh,Jc,el,tl],"html"),nl=Yc([Xc,vh,Jc,el,tl],"svg"),Es={}.hasOwnProperty;function $h(e,t){const n=t||{};function a(r,...i){let s=a.invalid;const o=a.handlers;if(r&&Es.call(r,e)){const c=String(r[e]);s=Es.call(o,c)?o[c]:a.unknown}if(s)return s.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const jh=/["&'<>`]/g,Sh=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ah=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Th=/[|\\{}()[\]^$+*?.]/g,Fs=new WeakMap;function Rh(e,t){if(e=e.replace(t.subset?Oh(t.subset):jh,a),t.subset||t.escapeOnly)return e;return e.replace(Sh,n).replace(Ah,a);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function a(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function Oh(e){let t=Fs.get(e);return t||(t=Ih(e),Fs.set(e,t)),t}function Ih(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Th,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Nh=/[\dA-Fa-f]/;function Lh(e,t,n){const a="&#x"+e.toString(16).toUpperCase();return n&&t&&!Nh.test(String.fromCharCode(t))?a:a+";"}const Ph=/\d/;function Dh(e,t,n){const a="&#"+String(e);return n&&t&&!Ph.test(String.fromCharCode(t))?a:a+";"}const Mh=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Qa={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},qh=["cent","copy","divide","gt","lt","not","para","times"],al={}.hasOwnProperty,Mr={};let Zn;for(Zn in Qa)al.call(Qa,Zn)&&(Mr[Qa[Zn]]=Zn);const zh=/[^\dA-Za-z]/;function Bh(e,t,n,a){const r=String.fromCharCode(e);if(al.call(Mr,r)){const i=Mr[r],s="&"+i;return n&&Mh.includes(i)&&!qh.includes(i)&&(!a||t&&t!==61&&zh.test(String.fromCharCode(t)))?s:s+";"}return""}function Uh(e,t,n){let a=Lh(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Bh(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Dh(e,t,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function St(e,t){return Rh(e,Object.assign({format:Uh},t))}const Gh=/^>|^->|<!--|-->|--!>|<!-$/g,Hh=[">"],Wh=["<",">"];function Vh(e,t,n,a){return a.settings.bogusComments?"<?"+St(e.value,Object.assign({},a.settings.characterReferences,{subset:Hh}))+">":"<!--"+e.value.replace(Gh,r)+"-->";function r(i){return St(i,Object.assign({},a.settings.characterReferences,{subset:Wh}))}}function Zh(e,t,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function $s(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(t);for(;r!==-1;)a++,r=n.indexOf(t,r+t.length);return a}function Yh(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Xh(e){return e.join(" ").trim()}const Kh=/[ \t\n\f\r]/g;function Ci(e){return typeof e=="object"?e.type==="text"?js(e.value):!1:js(e)}function js(e){return e.replace(Kh,"")===""}const Z=il(1),rl=il(-1),Qh=[];function il(e){return t;function t(n,a,r){const i=n?n.children:Qh;let s=(a||0)+e,o=i[s];if(!r)for(;o&&Ci(o);)s+=e,o=i[s];return o}}const Jh={}.hasOwnProperty;function sl(e){return t;function t(n,a,r){return Jh.call(e,n.tagName)&&e[n.tagName](n,a,r)}}const Ei=sl({body:tg,caption:Ja,colgroup:Ja,dd:ig,dt:rg,head:Ja,html:eg,li:ag,optgroup:sg,option:og,p:ng,rp:Ss,rt:Ss,tbody:lg,td:As,tfoot:ug,th:As,thead:cg,tr:pg});function Ja(e,t,n){const a=Z(n,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&Ci(a.value.charAt(0)))}function eg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function tg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ng(e,t,n){const a=Z(n,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 ag(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="li"}function rg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function ig(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Ss(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function sg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function og(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function cg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function lg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function ug(e,t,n){return!Z(n,t)}function pg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="tr"}function As(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const dg=sl({body:gg,colgroup:fg,head:hg,html:mg,tbody:bg});function mg(e){const t=Z(e,-1);return!t||t.type!=="comment"}function hg(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const n=e.children[0];return!n||n.type==="element"}function gg(e){const t=Z(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ci(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fg(e,t,n){const a=rl(n,t),r=Z(e,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function bg(e,t,n){const a=rl(n,t),r=Z(e,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Yn={name:[[`
+`:""}`,t),setTimeout(()=>{throw e},0)}var Jn=!0;function bo(e){let t=Jn;Jn=!1;let n=e();return Jn=t,n}function ct(e,t,n={}){let a;return ne(e,t)(r=>a=r,n),a}function ne(...e){return _o(...e)}var _o=yo;function du(e){_o=e}function yo(e,t){let n={};mr(n,e);let a=[n,...At(e)],r=typeof t=="function"?mu(a,t):gu(a,t,e);return pu.bind(null,e,t,r)}function mu(e,t){return(n=()=>{},{scope:a={},params:r=[]}={})=>{let i=t.apply(xn([a,...e]),r);sa(n,i)}}var Ma={};function hu(e,t){if(Ma[e])return Ma[e];let n=Object.getPrototypeOf(async function(){}).constructor,a=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let s=new n(["__self","scope"],`with (scope) { __self.result = ${a} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return mn(s,t,e),Promise.resolve()}})();return Ma[e]=i,i}function gu(e,t,n){let a=hu(t,n);return(r=()=>{},{scope:i={},params:s=[]}={})=>{a.result=void 0,a.finished=!1;let o=xn([i,...e]);if(typeof a=="function"){let c=a(a,o).catch(l=>mn(l,n,t));a.finished?(sa(r,a.result,o,s,n),a.result=void 0):c.then(l=>{sa(r,l,o,s,n)}).catch(l=>mn(l,n,t)).finally(()=>a.result=void 0)}}}function sa(e,t,n,a,r){if(Jn&&typeof t=="function"){let i=t.apply(n,a);i instanceof Promise?i.then(s=>sa(e,s,n,a)).catch(s=>mn(s,r,t)):e(i)}else typeof t=="object"&&t instanceof Promise?t.then(i=>e(i)):e(t)}var Jr="x-";function Mt(e=""){return Jr+e}function fu(e){Jr=e}var oa={};function W(e,t){return oa[e]=t,{before(n){if(!oa[n]){console.warn(String.raw`Cannot find directive \`${n}\`. \`${e}\` will use the default order of execution`);return}const a=rt.indexOf(n);rt.splice(a>=0?a:rt.indexOf("DEFAULT"),0,e)}}}function bu(e){return Object.keys(oa).includes(e)}function ei(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let i=Object.entries(e._x_virtualDirectives).map(([o,c])=>({name:o,value:c})),s=vo(i);i=i.map(o=>s.find(c=>c.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),t=t.concat(i)}let a={};return t.map(Eo((i,s)=>a[i]=s)).filter($o).map(vu(a,n)).sort(wu).map(i=>yu(e,i))}function vo(e){return Array.from(e).map(Eo()).filter(t=>!$o(t))}var hr=!1,an=new Map,wo=Symbol();function _u(e){hr=!0;let t=Symbol();wo=t,an.set(t,[]);let n=()=>{for(;an.get(t).length;)an.get(t).shift()();an.delete(t)},a=()=>{hr=!1,n()};e(n),a()}function xo(e){let t=[],n=o=>t.push(o),[a,r]=tu(e);return t.push(r),[{Alpine:kn,effect:a,cleanup:n,evaluateLater:ne.bind(ne,e),evaluate:ct.bind(ct,e)},()=>t.forEach(o=>o())]}function yu(e,t){let n=()=>{},a=oa[t.type]||n,[r,i]=xo(e);lo(e,t.original,i);let s=()=>{e._x_ignore||e._x_ignoreSelf||(a.inline&&a.inline(e,t,r),a=a.bind(a,e,t,r),hr?an.get(wo).push(a):a())};return s.runCleanups=i,s}var ko=(e,t)=>({name:n,value:a})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:a}),Co=e=>e;function Eo(e=()=>{}){return({name:t,value:n})=>{let{name:a,value:r}=Fo.reduce((i,s)=>s(i),{name:t,value:n});return a!==t&&e(a,t),{name:a,value:r}}}var Fo=[];function ti(e){Fo.push(e)}function $o({name:e}){return jo().test(e)}var jo=()=>new RegExp(`^${Jr}([^:^.]+)\\b`);function vu(e,t){return({name:n,value:a})=>{let r=n.match(jo()),i=n.match(/:([a-zA-Z0-9\-_:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],o=t||e[n]||n;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:a,original:o}}}var gr="DEFAULT",rt=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",gr,"teleport"];function wu(e,t){let n=rt.indexOf(e.type)===-1?gr:e.type,a=rt.indexOf(t.type)===-1?gr:t.type;return rt.indexOf(n)-rt.indexOf(a)}function sn(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function dt(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(r=>dt(r,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let a=e.firstElementChild;for(;a;)dt(a,t),a=a.nextElementSibling}function pe(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Di=!1;function xu(){Di&&pe("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Di=!0,document.body||pe("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),sn(document,"alpine:init"),sn(document,"alpine:initializing"),Xr(),nu(t=>Pe(t,dt)),Vr(t=>zt(t)),co((t,n)=>{ei(t,n).forEach(a=>a())});let e=t=>!ka(t.parentElement,!0);Array.from(document.querySelectorAll(To().join(","))).filter(e).forEach(t=>{Pe(t)}),sn(document,"alpine:initialized"),setTimeout(()=>{Fu()})}var ni=[],So=[];function Ao(){return ni.map(e=>e())}function To(){return ni.concat(So).map(e=>e())}function Ro(e){ni.push(e)}function Oo(e){So.push(e)}function ka(e,t=!1){return qt(e,n=>{if((t?To():Ao()).some(r=>n.matches(r)))return!0})}function qt(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return qt(e.parentElement,t)}}function ku(e){return Ao().some(t=>e.matches(t))}var Io=[];function Cu(e){Io.push(e)}var Eu=1;function Pe(e,t=dt,n=()=>{}){qt(e,a=>a._x_ignore)||_u(()=>{t(e,(a,r)=>{a._x_marker||(n(a,r),Io.forEach(i=>i(a,r)),ei(a,a.attributes).forEach(i=>i()),a._x_ignore||(a._x_marker=Eu++),a._x_ignore&&r())})})}function zt(e,t=dt){t(e,n=>{au(n),uo(n),delete n._x_marker})}function Fu(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,n,a])=>{bu(n)||a.some(r=>{if(document.querySelector(r))return pe(`found "${r}", but missing ${t} plugin`),!0})})}var fr=[],ai=!1;function ri(e=()=>{}){return queueMicrotask(()=>{ai||setTimeout(()=>{br()})}),new Promise(t=>{fr.push(()=>{e(),t()})})}function br(){for(ai=!1;fr.length;)fr.shift()()}function $u(){ai=!0}function ii(e,t){return Array.isArray(t)?Mi(e,t.join(" ")):typeof t=="object"&&t!==null?ju(e,t):typeof t=="function"?ii(e,t()):Mi(e,t)}function Mi(e,t){let n=r=>r.split(" ").filter(i=>!e.classList.contains(i)).filter(Boolean),a=r=>(e.classList.add(...r),()=>{e.classList.remove(...r)});return t=t===!0?t="":t||"",a(n(t))}function ju(e,t){let n=o=>o.split(" ").filter(Boolean),a=Object.entries(t).flatMap(([o,c])=>c?n(o):!1).filter(Boolean),r=Object.entries(t).flatMap(([o,c])=>c?!1:n(o)).filter(Boolean),i=[],s=[];return r.forEach(o=>{e.classList.contains(o)&&(e.classList.remove(o),s.push(o))}),a.forEach(o=>{e.classList.contains(o)||(e.classList.add(o),i.push(o))}),()=>{s.forEach(o=>e.classList.add(o)),i.forEach(o=>e.classList.remove(o))}}function Ca(e,t){return typeof t=="object"&&t!==null?Su(e,t):Au(e,t)}function Su(e,t){let n={};return Object.entries(t).forEach(([a,r])=>{n[a]=e.style[a],a.startsWith("--")||(a=Tu(a)),e.style.setProperty(a,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{Ca(e,n)}}function Au(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Tu(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}W("transition",(e,{value:t,modifiers:n,expression:a},{evaluate:r})=>{typeof a=="function"&&(a=r(a)),a!==!1&&(!a||typeof a=="boolean"?Ou(e,n,t):Ru(e,a,t))});function Ru(e,t,n){No(e,ii,""),{enter:r=>{e._x_transition.enter.during=r},"enter-start":r=>{e._x_transition.enter.start=r},"enter-end":r=>{e._x_transition.enter.end=r},leave:r=>{e._x_transition.leave.during=r},"leave-start":r=>{e._x_transition.leave.start=r},"leave-end":r=>{e._x_transition.leave.end=r}}[n](t)}function Ou(e,t,n){No(e,Ca);let a=!t.includes("in")&&!t.includes("out")&&!n,r=a||t.includes("in")||["enter"].includes(n),i=a||t.includes("out")||["leave"].includes(n);t.includes("in")&&!a&&(t=t.filter((b,_)=>_<t.indexOf("out"))),t.includes("out")&&!a&&(t=t.filter((b,_)=>_>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),o=s||t.includes("opacity"),c=s||t.includes("scale"),l=o?0:1,u=c?Jt(t,"scale",95)/100:1,p=Jt(t,"delay",0)/1e3,d=Jt(t,"origin","center"),m="opacity, transform",g=Jt(t,"duration",150)/1e3,v=Jt(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${g}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function No(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(a=()=>{},r=()=>{}){yr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},a,r)},out(a=()=>{},r=()=>{}){yr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},a,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,a){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):i():e._x_transition?e._x_transition.in(n):i();return}e._x_hidePromise=e._x_transition?new Promise((s,o)=>{e._x_transition.out(()=>{},()=>s(a)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>o({isFromCancelledTransition:!0}))}):Promise.resolve(a),queueMicrotask(()=>{let s=Lo(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):r(()=>{let o=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(o)]).then(([u])=>u?.());return delete c._x_hidePromise,delete c._x_hideChildren,l};o(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function Lo(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Lo(t)}function yr(e,t,{during:n,start:a,end:r}={},i=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(a).length===0&&Object.keys(r).length===0){i(),s();return}let o,c,l;Iu(e,{start(){o=t(e,a)},during(){c=t(e,n)},before:i,end(){o(),l=t(e,r)},after:s,cleanup(){c(),l()}})}function Iu(e,t){let n,a,r,i=_r(()=>{z(()=>{n=!0,a||t.before(),r||(t.end(),br()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:_r(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},z(()=>{t.start(),t.during()}),$u(),requestAnimationFrame(()=>{if(n)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),z(()=>{t.before()}),a=!0,requestAnimationFrame(()=>{n||(z(()=>{t.end()}),br(),setTimeout(e._x_transitioning.finish,s+o),r=!0)})})}function Jt(e,t,n){if(e.indexOf(t)===-1)return n;const a=e[e.indexOf(t)+1];if(!a||t==="scale"&&isNaN(a))return n;if(t==="duration"||t==="delay"){let r=a.match(/([0-9]+)ms/);if(r)return r[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[a,e[e.indexOf(t)+2]].join(" "):a}var He=!1;function Ve(e,t=()=>{}){return(...n)=>He?t(...n):e(...n)}function Nu(e){return(...t)=>He&&e(...t)}var Po=[];function Ea(e){Po.push(e)}function Lu(e,t){Po.forEach(n=>n(e,t)),He=!0,Do(()=>{Pe(t,(n,a)=>{a(n,()=>{})})}),He=!1}var vr=!1;function Pu(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),He=!0,vr=!0,Do(()=>{Du(t)}),He=!1,vr=!1}function Du(e){let t=!1;Pe(e,(a,r)=>{dt(a,(i,s)=>{if(t&&ku(i))return s();t=!0,r(i,s)})})}function Do(e){let t=gt;Pi((n,a)=>{let r=t(n);return Dt(r),()=>{}}),e(),Pi(t)}function Mo(e,t,n,a=[]){switch(e._x_bindings||(e._x_bindings=Pt({})),e._x_bindings[t]=n,t=a.includes("camel")?Wu(t):t,t){case"value":Mu(e,n);break;case"style":zu(e,n);break;case"class":qu(e,n);break;case"selected":case"checked":Bu(e,t,n);break;default:qo(e,t,n);break}}function Mu(e,t){if(Uo(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=ea(e.value)===t:e.checked=qi(e.value,t));else if(si(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>qi(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Hu(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function qu(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ii(e,t)}function zu(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ca(e,t)}function Bu(e,t,n){qo(e,t,n),Gu(e,t,n)}function qo(e,t,n){[null,void 0,!1].includes(n)&&Zu(t)?e.removeAttribute(t):(zo(t)&&(n=t),Uu(e,t,n))}function Uu(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function Gu(e,t,n){e[t]!==n&&(e[t]=n)}function Hu(e,t){const n=[].concat(t).map(a=>a+"");Array.from(e.options).forEach(a=>{a.selected=n.includes(a.value)})}function Wu(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function qi(e,t){return e==t}function ea(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Vu=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function zo(e){return Vu.has(e)}function Zu(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Yu(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Bo(e,t,n)}function Xu(e,t,n,a=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let r=e._x_inlineBindings[t];return r.extract=a,bo(()=>ct(e,r.expression))}return Bo(e,t,n)}function Bo(e,t,n){let a=e.getAttribute(t);return a===null?typeof n=="function"?n():n:a===""?!0:zo(t)?!![t,"true"].includes(a):a}function si(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Uo(e){return e.type==="radio"||e.localName==="ui-radio"}function Go(e,t){var n;return function(){var a=this,r=arguments,i=function(){n=null,e.apply(a,r)};clearTimeout(n),n=setTimeout(i,t)}}function Ho(e,t){let n;return function(){let a=this,r=arguments;n||(e.apply(a,r),n=!0,setTimeout(()=>n=!1,t))}}function Wo({get:e,set:t},{get:n,set:a}){let r=!0,i,s=gt(()=>{let o=e(),c=n();if(r)a(qa(o)),r=!1;else{let l=JSON.stringify(o),u=JSON.stringify(c);l!==i?a(qa(o)):l!==u&&t(qa(c))}i=JSON.stringify(e()),JSON.stringify(n())});return()=>{Dt(s)}}function qa(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function Ku(e){(Array.isArray(e)?e:[e]).forEach(n=>n(kn))}var et={},zi=!1;function Qu(e,t){if(zi||(et=Pt(et),zi=!0),t===void 0)return et[e];et[e]=t,ho(et[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&et[e].init()}function Ju(){return et}var Vo={};function ep(e,t){let n=typeof t!="function"?()=>t:t;return e instanceof Element?Zo(e,n()):(Vo[e]=n,()=>{})}function tp(e){return Object.entries(Vo).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...a)=>n(...a)}})}),e}function Zo(e,t,n){let a=[];for(;a.length;)a.pop()();let r=Object.entries(t).map(([s,o])=>({name:s,value:o})),i=vo(r);return r=r.map(s=>i.find(o=>o.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ei(e,r,n).map(s=>{a.push(s.runCleanups),s()}),()=>{for(;a.length;)a.pop()()}}var Yo={};function np(e,t){Yo[e]=t}function ap(e,t){return Object.entries(Yo).forEach(([n,a])=>{Object.defineProperty(e,n,{get(){return(...r)=>a.bind(t)(...r)},enumerable:!1})}),e}var rp={get reactive(){return Pt},get release(){return Dt},get effect(){return gt},get raw(){return ao},version:"3.14.9",flushAndStopDeferringMutations:su,dontAutoEvaluateFunctions:bo,disableEffectScheduling:Jl,startObservingMutations:Xr,stopObservingMutations:po,setReactivityEngine:eu,onAttributeRemoved:lo,onAttributesAdded:co,closestDataStack:At,skipDuringClone:Ve,onlyDuringClone:Nu,addRootSelector:Ro,addInitSelector:Oo,interceptClone:Ea,addScopeToNode:wn,deferMutations:iu,mapAttributes:ti,evaluateLater:ne,interceptInit:Cu,setEvaluator:du,mergeProxies:xn,extractProp:Xu,findClosest:qt,onElRemoved:Vr,closestRoot:ka,destroyTree:zt,interceptor:go,transition:yr,setStyles:Ca,mutateDom:z,directive:W,entangle:Wo,throttle:Ho,debounce:Go,evaluate:ct,initTree:Pe,nextTick:ri,prefixed:Mt,prefix:fu,plugin:Ku,magic:ve,store:Qu,start:xu,clone:Pu,cloneNode:Lu,bound:Yu,$data:mo,watch:ro,walk:dt,data:np,bind:ep},kn=rp;function ip(e,t){const n=Object.create(null),a=e.split(",");for(let r=0;r<a.length;r++)n[a[r]]=!0;return r=>!!n[r]}var sp=Object.freeze({}),op=Object.prototype.hasOwnProperty,Fa=(e,t)=>op.call(e,t),lt=Array.isArray,on=e=>Xo(e)==="[object Map]",cp=e=>typeof e=="string",oi=e=>typeof e=="symbol",$a=e=>e!==null&&typeof e=="object",lp=Object.prototype.toString,Xo=e=>lp.call(e),Ko=e=>Xo(e).slice(8,-1),ci=e=>cp(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,up=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},pp=up(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qo=(e,t)=>e!==t&&(e===e||t===t),wr=new WeakMap,en=[],Ee,ut=Symbol("iterate"),xr=Symbol("Map key iterate");function dp(e){return e&&e._isEffect===!0}function mp(e,t=sp){dp(e)&&(e=e.raw);const n=fp(e,t);return t.lazy||n(),n}function hp(e){e.active&&(Jo(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var gp=0;function fp(e,t){const n=function(){if(!n.active)return e();if(!en.includes(n)){Jo(n);try{return _p(),en.push(n),Ee=n,e()}finally{en.pop(),ec(),Ee=en[en.length-1]}}};return n.id=gp++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function Jo(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Tt=!0,li=[];function bp(){li.push(Tt),Tt=!1}function _p(){li.push(Tt),Tt=!0}function ec(){const e=li.pop();Tt=e===void 0?!0:e}function ye(e,t,n){if(!Tt||Ee===void 0)return;let a=wr.get(e);a||wr.set(e,a=new Map);let r=a.get(n);r||a.set(n,r=new Set),r.has(Ee)||(r.add(Ee),Ee.deps.push(r),Ee.options.onTrack&&Ee.options.onTrack({effect:Ee,target:e,type:t,key:n}))}function We(e,t,n,a,r,i){const s=wr.get(e);if(!s)return;const o=new Set,c=u=>{u&&u.forEach(p=>{(p!==Ee||p.allowRecurse)&&o.add(p)})};if(t==="clear")s.forEach(c);else if(n==="length"&&lt(e))s.forEach((u,p)=>{(p==="length"||p>=a)&&c(u)});else switch(n!==void 0&&c(s.get(n)),t){case"add":lt(e)?ci(n)&&c(s.get("length")):(c(s.get(ut)),on(e)&&c(s.get(xr)));break;case"delete":lt(e)||(c(s.get(ut)),on(e)&&c(s.get(xr)));break;case"set":on(e)&&c(s.get(ut));break}const l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:n,type:t,newValue:a,oldValue:r,oldTarget:i}),u.options.scheduler?u.options.scheduler(u):u()};o.forEach(l)}var yp=ip("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(oi)),vp=nc(),wp=nc(!0),Bi=xp();function xp(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const a=M(this);for(let i=0,s=this.length;i<s;i++)ye(a,"get",i+"");const r=a[t](...n);return r===-1||r===!1?a[t](...n.map(M)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){bp();const a=M(this)[t].apply(this,n);return ec(),a}}),e}function nc(e=!1,t=!1){return function(a,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_raw"&&i===(e?t?Lp:sc:t?Np:ic).get(a))return a;const s=lt(a);if(!e&&s&&Fa(Bi,r))return Reflect.get(Bi,r,i);const o=Reflect.get(a,r,i);return(oi(r)?tc.has(r):yp(r))||(e||ye(a,"get",r),t)?o:kr(o)?!s||!ci(r)?o.value:o:$a(o)?e?oc(o):mi(o):o}}var kp=Cp();function Cp(e=!1){return function(n,a,r,i){let s=n[a];if(!e&&(r=M(r),s=M(s),!lt(n)&&kr(s)&&!kr(r)))return s.value=r,!0;const o=lt(n)&&ci(a)?Number(a)<n.length:Fa(n,a),c=Reflect.set(n,a,r,i);return n===M(i)&&(o?Qo(r,s)&&We(n,"set",a,r,s):We(n,"add",a,r)),c}}function Ep(e,t){const n=Fa(e,t),a=e[t],r=Reflect.deleteProperty(e,t);return r&&n&&We(e,"delete",t,void 0,a),r}function Fp(e,t){const n=Reflect.has(e,t);return(!oi(t)||!tc.has(t))&&ye(e,"has",t),n}function $p(e){return ye(e,"iterate",lt(e)?"length":ut),Reflect.ownKeys(e)}var jp={get:vp,set:kp,deleteProperty:Ep,has:Fp,ownKeys:$p},Sp={get:wp,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},ui=e=>$a(e)?mi(e):e,pi=e=>$a(e)?oc(e):e,di=e=>e,ja=e=>Reflect.getPrototypeOf(e);function qn(e,t,n=!1,a=!1){e=e.__v_raw;const r=M(e),i=M(t);t!==i&&!n&&ye(r,"get",t),!n&&ye(r,"get",i);const{has:s}=ja(r),o=a?di:n?pi:ui;if(s.call(r,t))return o(e.get(t));if(s.call(r,i))return o(e.get(i));e!==r&&e.get(t)}function zn(e,t=!1){const n=this.__v_raw,a=M(n),r=M(e);return e!==r&&!t&&ye(a,"has",e),!t&&ye(a,"has",r),e===r?n.has(e):n.has(e)||n.has(r)}function Bn(e,t=!1){return e=e.__v_raw,!t&&ye(M(e),"iterate",ut),Reflect.get(e,"size",e)}function Ui(e){e=M(e);const t=M(this);return ja(t).has.call(t,e)||(t.add(e),We(t,"add",e,e)),this}function Gi(e,t){t=M(t);const n=M(this),{has:a,get:r}=ja(n);let i=a.call(n,e);i?rc(n,a,e):(e=M(e),i=a.call(n,e));const s=r.call(n,e);return n.set(e,t),i?Qo(t,s)&&We(n,"set",e,t,s):We(n,"add",e,t),this}function Hi(e){const t=M(this),{has:n,get:a}=ja(t);let r=n.call(t,e);r?rc(t,n,e):(e=M(e),r=n.call(t,e));const i=a?a.call(t,e):void 0,s=t.delete(e);return r&&We(t,"delete",e,void 0,i),s}function Wi(){const e=M(this),t=e.size!==0,n=on(e)?new Map(e):new Set(e),a=e.clear();return t&&We(e,"clear",void 0,void 0,n),a}function Un(e,t){return function(a,r){const i=this,s=i.__v_raw,o=M(s),c=t?di:e?pi:ui;return!e&&ye(o,"iterate",ut),s.forEach((l,u)=>a.call(r,c(l),c(u),i))}}function Gn(e,t,n){return function(...a){const r=this.__v_raw,i=M(r),s=on(i),o=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=r[e](...a),u=n?di:t?pi:ui;return!t&&ye(i,"iterate",c?xr:ut),{next(){const{value:p,done:d}=l.next();return d?{value:p,done:d}:{value:o?[u(p[0]),u(p[1])]:u(p),done:d}},[Symbol.iterator](){return this}}}}function ze(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${pp(e)} operation ${n}failed: target is readonly.`,M(this))}return e==="delete"?!1:this}}function Ap(){const e={get(i){return qn(this,i)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!1)},t={get(i){return qn(this,i,!1,!0)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!0)},n={get(i){return qn(this,i,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!1)},a={get(i){return qn(this,i,!0,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gn(i,!1,!1),n[i]=Gn(i,!0,!1),t[i]=Gn(i,!1,!0),a[i]=Gn(i,!0,!0)}),[e,n,t,a]}var[Tp,Rp]=Ap();function ac(e,t){const n=e?Rp:Tp;return(a,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?a:Reflect.get(Fa(n,r)&&r in a?n:a,r,i)}var Op={get:ac(!1)},Ip={get:ac(!0)};function rc(e,t,n){const a=M(n);if(a!==n&&t.call(e,a)){const r=Ko(e);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ic=new WeakMap,Np=new WeakMap,sc=new WeakMap,Lp=new WeakMap;function Pp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dp(e){return e.__v_skip||!Object.isExtensible(e)?0:Pp(Ko(e))}function mi(e){return e&&e.__v_isReadonly?e:cc(e,!1,jp,Op,ic)}function oc(e){return cc(e,!0,Sp,Ip,sc)}function cc(e,t,n,a,r){if(!$a(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const s=Dp(e);if(s===0)return e;const o=new Proxy(e,s===2?a:n);return r.set(e,o),o}function M(e){return e&&M(e.__v_raw)||e}function kr(e){return!!(e&&e.__v_isRef===!0)}ve("nextTick",()=>ri);ve("dispatch",e=>sn.bind(sn,e));ve("watch",(e,{evaluateLater:t,cleanup:n})=>(a,r)=>{let i=t(a),o=ro(()=>{let c;return i(l=>c=l),c},r);n(o)});ve("store",Ju);ve("data",e=>mo(e));ve("root",e=>ka(e));ve("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=xn(Mp(e))),e._x_refs_proxy));function Mp(e){let t=[];return qt(e,n=>{n._x_refs&&t.push(n._x_refs)}),t}var za={};function lc(e){return za[e]||(za[e]=0),++za[e]}function qp(e,t){return qt(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function zp(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=lc(t))}ve("id",(e,{cleanup:t})=>(n,a=null)=>{let r=`${n}${a?`-${a}`:""}`;return Bp(e,r,t,()=>{let i=qp(e,n),s=i?i._x_ids[n]:lc(n);return a?`${n}-${s}-${a}`:`${n}-${s}`})});Ea((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function Bp(e,t,n,a){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let r=a();return e._x_id[t]=r,n(()=>{delete e._x_id[t]}),r}ve("el",e=>e);uc("Focus","focus","focus");uc("Persist","persist","persist");function uc(e,t,n){ve(t,a=>pe(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}W("modelable",(e,{expression:t},{effect:n,evaluateLater:a,cleanup:r})=>{let i=a(t),s=()=>{let u;return i(p=>u=p),u},o=a(`${t} = __placeholder`),c=u=>o(()=>{},{scope:{__placeholder:u}}),l=s();c(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,p=e._x_model.set,d=Wo({get(){return u()},set(m){p(m)}},{get(){return s()},set(m){c(m)}});r(d)})});W("teleport",(e,{modifiers:t,expression:n},{cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-teleport can only be used on a <template> tag",e);let r=Vi(n),i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,c=>{c.stopPropagation(),e.dispatchEvent(new c.constructor(c.type,c))})}),wn(i,{},e);let s=(o,c,l)=>{l.includes("prepend")?c.parentNode.insertBefore(o,c):l.includes("append")?c.parentNode.insertBefore(o,c.nextSibling):c.appendChild(o)};z(()=>{s(i,r,t),Ve(()=>{Pe(i)})()}),e._x_teleportPutBack=()=>{let o=Vi(n);z(()=>{s(e._x_teleport,o,t)})},a(()=>z(()=>{i.remove(),zt(i)}))});var Up=document.createElement("div");function Vi(e){let t=Ve(()=>document.querySelector(e),()=>Up)();return t||pe(`Cannot find x-teleport element for selector: "${e}"`),t}var pc=()=>{};pc.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};W("ignore",pc);W("effect",Ve((e,{expression:t},{effect:n})=>{n(ne(e,t))}));function Cr(e,t,n,a){let r=e,i=c=>a(c),s={},o=(c,l)=>u=>l(c,u);if(n.includes("dot")&&(t=Gp(t)),n.includes("camel")&&(t=Hp(t)),n.includes("passive")&&(s.passive=!0),n.includes("capture")&&(s.capture=!0),n.includes("window")&&(r=window),n.includes("document")&&(r=document),n.includes("debounce")){let c=n[n.indexOf("debounce")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Go(i,l)}if(n.includes("throttle")){let c=n[n.indexOf("throttle")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Ho(i,l)}return n.includes("prevent")&&(i=o(i,(c,l)=>{l.preventDefault(),c(l)})),n.includes("stop")&&(i=o(i,(c,l)=>{l.stopPropagation(),c(l)})),n.includes("once")&&(i=o(i,(c,l)=>{c(l),r.removeEventListener(t,i,s)})),(n.includes("away")||n.includes("outside"))&&(r=document,i=o(i,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),n.includes("self")&&(i=o(i,(c,l)=>{l.target===e&&c(l)})),(Vp(t)||dc(t))&&(i=o(i,(c,l)=>{Zp(l,n)||c(l)})),r.addEventListener(t,i,s),()=>{r.removeEventListener(t,i,s)}}function Gp(e){return e.replace(/-/g,".")}function Hp(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function ca(e){return!Array.isArray(e)&&!isNaN(e)}function Wp(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Vp(e){return["keydown","keyup"].includes(e)}function dc(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Zp(e,t){let n=t.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(i));if(n.includes("debounce")){let i=n.indexOf("debounce");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let i=n.indexOf("throttle");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&Zi(e.key).includes(n[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>n.includes(i));return n=n.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===r.length&&(dc(e.type)||Zi(e.key).includes(n[0])))}function Zi(e){if(!e)return[];e=Wp(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}W("model",(e,{modifiers:t,expression:n},{effect:a,cleanup:r})=>{let i=e;t.includes("parent")&&(i=e.parentNode);let s=ne(i,n),o;typeof n=="string"?o=ne(i,`${n} = __placeholder`):typeof n=="function"&&typeof n()=="string"?o=ne(i,`${n()} = __placeholder`):o=()=>{};let c=()=>{let d;return s(m=>d=m),Yi(d)?d.get():d},l=d=>{let m;s(g=>m=g),Yi(m)?m.set(d):o(()=>{},{scope:{__placeholder:d}})};typeof n=="string"&&e.type==="radio"&&z(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});var u=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let p=He?()=>{}:Cr(e,u,t,d=>{l(Ba(e,t,d,c()))});if(t.includes("fill")&&([void 0,null,""].includes(c())||si(e)&&Array.isArray(c())||e.tagName.toLowerCase()==="select"&&e.multiple)&&l(Ba(e,t,{target:e},c())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=p,r(()=>e._x_removeModelListeners.default()),e.form){let d=Cr(e.form,"reset",[],m=>{ri(()=>e._x_model&&e._x_model.set(Ba(e,t,{target:e},c())))});r(()=>d())}e._x_model={get(){return c()},set(d){l(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof n=="string"&&n.match(/\./)&&(d=""),window.fromModel=!0,z(()=>Mo(e,"value",d)),delete window.fromModel},a(()=>{let d=c();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function Ba(e,t,n,a){return z(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(si(e))if(Array.isArray(a)){let r=null;return t.includes("number")?r=Ua(n.target.value):t.includes("boolean")?r=ea(n.target.value):r=n.target.value,n.target.checked?a.includes(r)?a:a.concat([r]):a.filter(i=>!Yp(i,r))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return Ua(i)}):t.includes("boolean")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return ea(i)}):Array.from(n.target.selectedOptions).map(r=>r.value||r.text);{let r;return Uo(e)?n.target.checked?r=n.target.value:r=a:r=n.target.value,t.includes("number")?Ua(r):t.includes("boolean")?ea(r):t.includes("trim")?r.trim():r}}})}function Ua(e){let t=e?parseFloat(e):null;return Xp(t)?t:e}function Yp(e,t){return e==t}function Xp(e){return!Array.isArray(e)&&!isNaN(e)}function Yi(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}W("cloak",e=>queueMicrotask(()=>z(()=>e.removeAttribute(Mt("cloak")))));Oo(()=>`[${Mt("init")}]`);W("init",Ve((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));W("text",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.textContent=i})})})});W("html",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Pe(e),delete e._x_ignoreSelf})})})});ti(ko(":",Co(Mt("bind:"))));var mc=(e,{value:t,modifiers:n,expression:a,original:r},{effect:i,cleanup:s})=>{if(!t){let c={};tp(c),ne(e,a)(u=>{Zo(e,u,r)},{scope:c});return}if(t==="key")return Kp(e,a);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=ne(e,a);i(()=>o(c=>{c===void 0&&typeof a=="string"&&a.match(/\./)&&(c=""),z(()=>Mo(e,t,c,n))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};mc.inline=(e,{value:t,modifiers:n,expression:a})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:a,extract:!1})};W("bind",mc);function Kp(e,t){e._x_keyExpression=t}Ro(()=>`[${Mt("data")}]`);W("data",(e,{expression:t},{cleanup:n})=>{if(Qp(e))return;t=t===""?"{}":t;let a={};mr(a,e);let r={};ap(r,a);let i=ct(e,t,{scope:r});(i===void 0||i===!0)&&(i={}),mr(i,e);let s=Pt(i);ho(s);let o=wn(e,s);s.init&&ct(e,s.init),n(()=>{s.destroy&&ct(e,s.destroy),o()})});Ea((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function Qp(e){return He?vr?!0:e.hasAttribute("data-has-alpine-state"):!1}W("show",(e,{modifiers:t,expression:n},{effect:a})=>{let r=ne(e,n);e._x_doHide||(e._x_doHide=()=>{z(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{z(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},o=()=>setTimeout(s),c=_r(p=>p?s():i(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,i):p?o():i()}),l,u=!0;a(()=>r(p=>{!u&&p===l||(t.includes("immediate")&&(p?o():i()),c(p),l=p,u=!1)}))});W("for",(e,{expression:t},{effect:n,cleanup:a})=>{let r=ed(t),i=ne(e,r.items),s=ne(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},n(()=>Jp(e,r,i,s)),a(()=>{Object.values(e._x_lookup).forEach(o=>z(()=>{zt(o),o.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function Jp(e,t,n,a){let r=s=>typeof s=="object"&&!Array.isArray(s),i=e;n(s=>{td(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let o=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(r(s))s=Object.entries(s).map(([f,b])=>{let _=Xi(t,b,f,s);a(w=>{u.includes(w)&&pe("Duplicate key on x-for",e),u.push(w)},{scope:{index:f,..._}}),l.push(_)});else for(let f=0;f<s.length;f++){let b=Xi(t,s[f],f,s);a(_=>{u.includes(_)&&pe("Duplicate key on x-for",e),u.push(_)},{scope:{index:f,...b}}),l.push(b)}let p=[],d=[],m=[],g=[];for(let f=0;f<c.length;f++){let b=c[f];u.indexOf(b)===-1&&m.push(b)}c=c.filter(f=>!m.includes(f));let v="template";for(let f=0;f<u.length;f++){let b=u[f],_=c.indexOf(b);if(_===-1)c.splice(f,0,b),p.push([v,f]);else if(_!==f){let w=c.splice(f,1)[0],h=c.splice(_-1,1)[0];c.splice(f,0,h),c.splice(_,0,w),d.push([w,h])}else g.push(b);v=b}for(let f=0;f<m.length;f++){let b=m[f];b in o&&(z(()=>{zt(o[b]),o[b].remove()}),delete o[b])}for(let f=0;f<d.length;f++){let[b,_]=d[f],w=o[b],h=o[_],C=document.createElement("div");z(()=>{h||pe('x-for ":key" is undefined or invalid',i,_,o),h.after(C),w.after(h),h._x_currentIfEl&&h.after(h._x_currentIfEl),C.before(w),w._x_currentIfEl&&w.after(w._x_currentIfEl),C.remove()}),h._x_refreshXForScope(l[u.indexOf(_)])}for(let f=0;f<p.length;f++){let[b,_]=p[f],w=b==="template"?i:o[b];w._x_currentIfEl&&(w=w._x_currentIfEl);let h=l[_],C=u[_],k=document.importNode(i.content,!0).firstElementChild,$=Pt(h);wn(k,$,i),k._x_refreshXForScope=T=>{Object.entries(T).forEach(([N,I])=>{$[N]=I})},z(()=>{w.after(k),Ve(()=>Pe(k))()}),typeof C=="object"&&pe("x-for key cannot be an object, it must be a string or an integer",i),o[C]=k}for(let f=0;f<g.length;f++)o[g[f]]._x_refreshXForScope(l[u.indexOf(g[f])]);i._x_prevKeys=u})}function ed(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,a=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=e.match(a);if(!r)return;let i={};i.items=r[2].trim();let s=r[1].replace(n,"").trim(),o=s.match(t);return o?(i.item=s.replace(t,"").trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=s,i}function Xi(e,t,n,a){let r={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,o)=>{r[s]=t[o]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{r[s]=t[s]}):r[e.item]=t,e.index&&(r[e.index]=n),e.collection&&(r[e.collection]=a),r}function td(e){return!Array.isArray(e)&&!isNaN(e)}function hc(){}hc.inline=(e,{expression:t},{cleanup:n})=>{let a=ka(e);a._x_refs||(a._x_refs={}),a._x_refs[t]=e,n(()=>delete a._x_refs[t])};W("ref",hc);W("if",(e,{expression:t},{effect:n,cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-if can only be used on a <template> tag",e);let r=ne(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return wn(o,{},e),z(()=>{e.after(o),Ve(()=>Pe(o))()}),e._x_currentIfEl=o,e._x_undoIf=()=>{z(()=>{zt(o),o.remove()}),delete e._x_currentIfEl},o},s=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>r(o=>{o?i():s()})),a(()=>e._x_undoIf&&e._x_undoIf())});W("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(r=>zp(e,r))});Ea((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});ti(ko("@",Co(Mt("on:"))));W("on",Ve((e,{value:t,modifiers:n,expression:a},{cleanup:r})=>{let i=a?ne(e,a):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=Cr(e,t,n,o=>{i(()=>{},{scope:{$event:o},params:[o]})});r(()=>s())}));Sa("Collapse","collapse","collapse");Sa("Intersect","intersect","intersect");Sa("Focus","trap","focus");Sa("Mask","mask","mask");function Sa(e,t,n){W(t,a=>pe(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}kn.setEvaluator(yo);kn.setReactivityEngine({reactive:mi,effect:mp,release:hp,raw:M});var nd=kn,gc=nd,ae="top",he="bottom",ge="right",re="left",hi="auto",Cn=[ae,he,ge,re],Rt="start",hn="end",ad="clippingParents",fc="viewport",tn="popper",rd="reference",Ki=Cn.reduce(function(e,t){return e.concat([t+"-"+Rt,t+"-"+hn])},[]),bc=[].concat(Cn,[hi]).reduce(function(e,t){return e.concat([t,t+"-"+Rt,t+"-"+hn])},[]),id="beforeRead",sd="read",od="afterRead",cd="beforeMain",ld="main",ud="afterMain",pd="beforeWrite",dd="write",md="afterWrite",hd=[id,sd,od,cd,ld,ud,pd,dd,md];function je(e){return e?(e.nodeName||"").toLowerCase():null}function oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mt(e){var t=oe(e).Element;return e instanceof t||e instanceof Element}function me(e){var t=oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function gi(e){if(typeof ShadowRoot>"u")return!1;var t=oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function gd(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!me(i)||!je(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(s){var o=r[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function fd(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},s=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),o=s.reduce(function(c,l){return c[l]="",c},{});!me(r)||!je(r)||(Object.assign(r.style,o),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const _c={name:"applyStyles",enabled:!0,phase:"write",fn:gd,effect:fd,requires:["computeStyles"]};function $e(e){return e.split("-")[0]}var pt=Math.max,la=Math.min,Ot=Math.round;function Er(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yc(){return!/^((?!chrome|android).)*safari/i.test(Er())}function It(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),r=1,i=1;t&&me(e)&&(r=e.offsetWidth>0&&Ot(a.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ot(a.height)/e.offsetHeight||1);var s=mt(e)?oe(e):window,o=s.visualViewport,c=!yc()&&n,l=(a.left+(c&&o?o.offsetLeft:0))/r,u=(a.top+(c&&o?o.offsetTop:0))/i,p=a.width/r,d=a.height/i;return{width:p,height:d,top:u,right:l+p,bottom:u+d,left:l,x:l,y:u}}function fi(e){var t=It(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function vc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&gi(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function De(e){return oe(e).getComputedStyle(e)}function bd(e){return["table","td","th"].indexOf(je(e))>=0}function Ze(e){return((mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return je(e)==="html"?e:e.assignedSlot||e.parentNode||(gi(e)?e.host:null)||Ze(e)}function Qi(e){return!me(e)||De(e).position==="fixed"?null:e.offsetParent}function _d(e){var t=/firefox/i.test(Er()),n=/Trident/i.test(Er());if(n&&me(e)){var a=De(e);if(a.position==="fixed")return null}var r=Aa(e);for(gi(r)&&(r=r.host);me(r)&&["html","body"].indexOf(je(r))<0;){var i=De(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function En(e){for(var t=oe(e),n=Qi(e);n&&bd(n)&&De(n).position==="static";)n=Qi(n);return n&&(je(n)==="html"||je(n)==="body"&&De(n).position==="static")?t:n||_d(e)||t}function bi(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cn(e,t,n){return pt(e,la(t,n))}function yd(e,t,n){var a=cn(e,t,n);return a>n?n:a}function wc(){return{top:0,right:0,bottom:0,left:0}}function xc(e){return Object.assign({},wc(),e)}function kc(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var vd=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,xc(typeof t!="number"?t:kc(t,Cn))};function wd(e){var t,n=e.state,a=e.name,r=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=$e(n.placement),c=bi(o),l=[re,ge].indexOf(o)>=0,u=l?"height":"width";if(!(!i||!s)){var p=vd(r.padding,n),d=fi(i),m=c==="y"?ae:re,g=c==="y"?he:ge,v=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],f=s[c]-n.rects.reference[c],b=En(i),_=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,w=v/2-f/2,h=p[m],C=_-d[u]-p[g],k=_/2-d[u]/2+w,$=cn(h,k,C),T=c;n.modifiersData[a]=(t={},t[T]=$,t.centerOffset=$-k,t)}}function xd(e){var t=e.state,n=e.options,a=n.element,r=a===void 0?"[data-popper-arrow]":a;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||vc(t.elements.popper,r)&&(t.elements.arrow=r))}const kd={name:"arrow",enabled:!0,phase:"main",fn:wd,effect:xd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nt(e){return e.split("-")[1]}var Cd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ed(e,t){var n=e.x,a=e.y,r=t.devicePixelRatio||1;return{x:Ot(n*r)/r||0,y:Ot(a*r)/r||0}}function Ji(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.variation,s=e.offsets,o=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,g=s.y,v=g===void 0?0:g,f=typeof u=="function"?u({x:m,y:v}):{x:m,y:v};m=f.x,v=f.y;var b=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),w=re,h=ae,C=window;if(l){var k=En(n),$="clientHeight",T="clientWidth";if(k===oe(n)&&(k=Ze(n),De(k).position!=="static"&&o==="absolute"&&($="scrollHeight",T="scrollWidth")),k=k,r===ae||(r===re||r===ge)&&i===hn){h=he;var N=p&&k===C&&C.visualViewport?C.visualViewport.height:k[$];v-=N-a.height,v*=c?1:-1}if(r===re||(r===ae||r===he)&&i===hn){w=ge;var I=p&&k===C&&C.visualViewport?C.visualViewport.width:k[T];m-=I-a.width,m*=c?1:-1}}var D=Object.assign({position:o},l&&Cd),R=u===!0?Ed({x:m,y:v},oe(n)):{x:m,y:v};if(m=R.x,v=R.y,c){var L;return Object.assign({},D,(L={},L[h]=_?"0":"",L[w]=b?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",L))}return Object.assign({},D,(t={},t[h]=_?v+"px":"",t[w]=b?m+"px":"",t.transform="",t))}function Fd(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,c=o===void 0?!0:o,l={placement:$e(t.placement),variation:Nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ji(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ji(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const $d={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fd,data:{}};var Hn={passive:!0};function jd(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,s=a.resize,o=s===void 0?!0:s,c=oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Hn)}),o&&c.addEventListener("resize",n.update,Hn),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Hn)}),o&&c.removeEventListener("resize",n.update,Hn)}}const Sd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jd,data:{}};var Ad={left:"right",right:"left",bottom:"top",top:"bottom"};function ta(e){return e.replace(/left|right|bottom|top/g,function(t){return Ad[t]})}var Td={start:"end",end:"start"};function es(e){return e.replace(/start|end/g,function(t){return Td[t]})}function _i(e){var t=oe(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function yi(e){return It(Ze(e)).left+_i(e).scrollLeft}function Rd(e,t){var n=oe(e),a=Ze(e),r=n.visualViewport,i=a.clientWidth,s=a.clientHeight,o=0,c=0;if(r){i=r.width,s=r.height;var l=yc();(l||!l&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:o+yi(e),y:c}}function Od(e){var t,n=Ze(e),a=_i(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=pt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=pt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-a.scrollLeft+yi(e),c=-a.scrollTop;return De(r||n).direction==="rtl"&&(o+=pt(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:o,y:c}}function vi(e){var t=De(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function Cc(e){return["html","body","#document"].indexOf(je(e))>=0?e.ownerDocument.body:me(e)&&vi(e)?e:Cc(Aa(e))}function ln(e,t){var n;t===void 0&&(t=[]);var a=Cc(e),r=a===((n=e.ownerDocument)==null?void 0:n.body),i=oe(a),s=r?[i].concat(i.visualViewport||[],vi(a)?a:[]):a,o=t.concat(s);return r?o:o.concat(ln(Aa(s)))}function Fr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Id(e,t){var n=It(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ts(e,t,n){return t===fc?Fr(Rd(e,n)):mt(t)?Id(t,n):Fr(Od(Ze(e)))}function Nd(e){var t=ln(Aa(e)),n=["absolute","fixed"].indexOf(De(e).position)>=0,a=n&&me(e)?En(e):e;return mt(a)?t.filter(function(r){return mt(r)&&vc(r,a)&&je(r)!=="body"}):[]}function Ld(e,t,n,a){var r=t==="clippingParents"?Nd(e):[].concat(t),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(c,l){var u=ts(e,l,a);return c.top=pt(u.top,c.top),c.right=la(u.right,c.right),c.bottom=la(u.bottom,c.bottom),c.left=pt(u.left,c.left),c},ts(e,s,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Ec(e){var t=e.reference,n=e.element,a=e.placement,r=a?$e(a):null,i=a?Nt(a):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,c;switch(r){case ae:c={x:s,y:t.y-n.height};break;case he:c={x:s,y:t.y+t.height};break;case ge:c={x:t.x+t.width,y:o};break;case re:c={x:t.x-n.width,y:o};break;default:c={x:t.x,y:t.y}}var l=r?bi(r):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case Rt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case hn:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function gn(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.strategy,s=i===void 0?e.strategy:i,o=n.boundary,c=o===void 0?ad:o,l=n.rootBoundary,u=l===void 0?fc:l,p=n.elementContext,d=p===void 0?tn:p,m=n.altBoundary,g=m===void 0?!1:m,v=n.padding,f=v===void 0?0:v,b=xc(typeof f!="number"?f:kc(f,Cn)),_=d===tn?rd:tn,w=e.rects.popper,h=e.elements[g?_:d],C=Ld(mt(h)?h:h.contextElement||Ze(e.elements.popper),c,u,s),k=It(e.elements.reference),$=Ec({reference:k,element:w,placement:r}),T=Fr(Object.assign({},w,$)),N=d===tn?T:k,I={top:C.top-N.top+b.top,bottom:N.bottom-C.bottom+b.bottom,left:C.left-N.left+b.left,right:N.right-C.right+b.right},D=e.modifiersData.offset;if(d===tn&&D){var R=D[r];Object.keys(I).forEach(function(L){var q=[ge,he].indexOf(L)>=0?1:-1,U=[ae,he].indexOf(L)>=0?"y":"x";I[L]+=R[U]*q})}return I}function Pd(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?bc:c,u=Nt(a),p=u?o?Ki:Ki.filter(function(g){return Nt(g)===u}):Cn,d=p.filter(function(g){return l.indexOf(g)>=0});d.length===0&&(d=p);var m=d.reduce(function(g,v){return g[v]=gn(e,{placement:v,boundary:r,rootBoundary:i,padding:s})[$e(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Dd(e){if($e(e)===hi)return[];var t=ta(e);return[es(e),t,es(t)]}function Md(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!0:s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,v=n.allowedAutoPlacements,f=t.options.placement,b=$e(f),_=b===f,w=c||(_||!g?[ta(f)]:Dd(f)),h=[f].concat(w).reduce(function(Se,fe){return Se.concat($e(fe)===hi?Pd(t,{placement:fe,boundary:u,rootBoundary:p,padding:l,flipVariations:g,allowedAutoPlacements:v}):fe)},[]),C=t.rects.reference,k=t.rects.popper,$=new Map,T=!0,N=h[0],I=0;I<h.length;I++){var D=h[I],R=$e(D),L=Nt(D)===Rt,q=[ae,he].indexOf(R)>=0,U=q?"width":"height",G=gn(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),Q=q?L?ge:re:L?he:ae;C[U]>k[U]&&(Q=ta(Q));var K=ta(Q),we=[];if(i&&we.push(G[R]<=0),o&&we.push(G[Q]<=0,G[K]<=0),we.every(function(Se){return Se})){N=D,T=!1;break}$.set(D,we)}if(T)for(var xe=g?3:1,Ye=function(fe){var Ae=h.find(function(bt){var Te=$.get(bt);if(Te)return Te.slice(0,fe).every(function(_t){return _t})});if(Ae)return N=Ae,"break"},ke=xe;ke>0;ke--){var Xe=Ye(ke);if(Xe==="break")break}t.placement!==N&&(t.modifiersData[a]._skip=!0,t.placement=N,t.reset=!0)}}const qd={name:"flip",enabled:!0,phase:"main",fn:Md,requiresIfExists:["offset"],data:{_skip:!1}};function ns(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function as(e){return[ae,ge,he,re].some(function(t){return e[t]>=0})}function zd(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=gn(t,{elementContext:"reference"}),o=gn(t,{altBoundary:!0}),c=ns(s,a),l=ns(o,r,i),u=as(c),p=as(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Bd={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zd};function Ud(e,t,n){var a=$e(e),r=[re,ae].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*r,[re,ge].indexOf(a)>=0?{x:o,y:s}:{x:s,y:o}}function Gd(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,s=bc.reduce(function(u,p){return u[p]=Ud(p,t.rects,i),u},{}),o=s[t.placement],c=o.x,l=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[a]=s}const Hd={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gd};function Wd(e){var t=e.state,n=e.name;t.modifiersData[n]=Ec({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Vd={name:"popperOffsets",enabled:!0,phase:"read",fn:Wd,data:{}};function Zd(e){return e==="x"?"y":"x"}function Yd(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!1:s,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,g=n.tetherOffset,v=g===void 0?0:g,f=gn(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:u}),b=$e(t.placement),_=Nt(t.placement),w=!_,h=bi(b),C=Zd(h),k=t.modifiersData.popperOffsets,$=t.rects.reference,T=t.rects.popper,N=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,I=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(k){if(i){var L,q=h==="y"?ae:re,U=h==="y"?he:ge,G=h==="y"?"height":"width",Q=k[h],K=Q+f[q],we=Q-f[U],xe=m?-T[G]/2:0,Ye=_===Rt?$[G]:T[G],ke=_===Rt?-T[G]:-$[G],Xe=t.elements.arrow,Se=m&&Xe?fi(Xe):{width:0,height:0},fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wc(),Ae=fe[q],bt=fe[U],Te=cn(0,$[G],Se[G]),_t=w?$[G]/2-xe-Te-Ae-I.mainAxis:Ye-Te-Ae-I.mainAxis,Me=w?-$[G]/2+xe+Te+bt+I.mainAxis:ke+Te+bt+I.mainAxis,yt=t.elements.arrow&&En(t.elements.arrow),Sn=yt?h==="y"?yt.clientTop||0:yt.clientLeft||0:0,Vt=(L=D?.[h])!=null?L:0,An=Q+_t-Vt-Sn,Tn=Q+Me-Vt,Zt=cn(m?la(K,An):K,Q,m?pt(we,Tn):we);k[h]=Zt,R[h]=Zt-Q}if(o){var Yt,Rn=h==="x"?ae:re,On=h==="x"?he:ge,Re=k[C],qe=C==="y"?"height":"width",Xt=Re+f[Rn],Ke=Re-f[On],Kt=[ae,re].indexOf(b)!==-1,In=(Yt=D?.[C])!=null?Yt:0,Nn=Kt?Xt:Re-$[qe]-T[qe]-In+I.altAxis,Ln=Kt?Re+$[qe]+T[qe]-In-I.altAxis:Ke,Pn=m&&Kt?yd(Nn,Re,Ln):cn(m?Nn:Xt,Re,m?Ln:Ke);k[C]=Pn,R[C]=Pn-Re}t.modifiersData[a]=R}}const Xd={name:"preventOverflow",enabled:!0,phase:"main",fn:Yd,requiresIfExists:["offset"]};function Kd(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Qd(e){return e===oe(e)||!me(e)?_i(e):Kd(e)}function Jd(e){var t=e.getBoundingClientRect(),n=Ot(t.width)/e.offsetWidth||1,a=Ot(t.height)/e.offsetHeight||1;return n!==1||a!==1}function em(e,t,n){n===void 0&&(n=!1);var a=me(t),r=me(t)&&Jd(t),i=Ze(t),s=It(e,r,n),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&((je(t)!=="body"||vi(i))&&(o=Qd(t)),me(t)?(c=It(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=yi(i))),{x:s.left+o.scrollLeft-c.x,y:s.top+o.scrollTop-c.y,width:s.width,height:s.height}}function tm(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var c=t.get(o);c&&r(c)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function nm(e){var t=tm(e);return hd.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function am(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function rm(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign({},r,a,{options:Object.assign({},r.options,a.options),data:Object.assign({},r.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var rs={placement:"bottom",modifiers:[],strategy:"absolute"};function is(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function im(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?rs:r;return function(o,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},rs,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},p=[],d=!1,m={state:u,setOptions:function(b){var _=typeof b=="function"?b(u.options):b;v(),u.options=Object.assign({},i,u.options,_),u.scrollParents={reference:mt(o)?ln(o):o.contextElement?ln(o.contextElement):[],popper:ln(c)};var w=nm(rm([].concat(a,u.options.modifiers)));return u.orderedModifiers=w.filter(function(h){return h.enabled}),g(),m.update()},forceUpdate:function(){if(!d){var b=u.elements,_=b.reference,w=b.popper;if(is(_,w)){u.rects={reference:em(_,En(w),u.options.strategy==="fixed"),popper:fi(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var h=0;h<u.orderedModifiers.length;h++){if(u.reset===!0){u.reset=!1,h=-1;continue}var C=u.orderedModifiers[h],k=C.fn,$=C.options,T=$===void 0?{}:$,N=C.name;typeof k=="function"&&(u=k({state:u,options:T,name:N,instance:m})||u)}}}},update:am(function(){return new Promise(function(f){m.forceUpdate(),f(u)})}),destroy:function(){v(),d=!0}};if(!is(o,c))return m;m.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)});function g(){u.orderedModifiers.forEach(function(f){var b=f.name,_=f.options,w=_===void 0?{}:_,h=f.effect;if(typeof h=="function"){var C=h({state:u,name:b,instance:m,options:w}),k=function(){};p.push(C||k)}})}function v(){p.forEach(function(f){return f()}),p=[]}return m}}var sm=[Sd,Vd,$d,_c,Hd,qd,Xd,kd,Bd],om=im({defaultModifiers:sm}),cm="tippy-box",Fc="tippy-content",lm="tippy-backdrop",$c="tippy-arrow",jc="tippy-svg-arrow",tt={passive:!0,capture:!0},Sc=function(){return document.body};function Ga(e,t,n){if(Array.isArray(e)){var a=e[t];return a??(Array.isArray(n)?n[t]:n)}return e}function wi(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Ac(e,t){return typeof e=="function"?e.apply(void 0,t):e}function ss(e,t){if(t===0)return e;var n;return function(a){clearTimeout(n),n=setTimeout(function(){e(a)},t)}}function um(e){return e.split(/\s+/).filter(Boolean)}function Ct(e){return[].concat(e)}function os(e,t){e.indexOf(t)===-1&&e.push(t)}function pm(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function dm(e){return e.split("-")[0]}function ua(e){return[].slice.call(e)}function cs(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function un(){return document.createElement("div")}function Ta(e){return["Element","Fragment"].some(function(t){return wi(e,t)})}function mm(e){return wi(e,"NodeList")}function hm(e){return wi(e,"MouseEvent")}function gm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function fm(e){return Ta(e)?[e]:mm(e)?ua(e):Array.isArray(e)?e:ua(document.querySelectorAll(e))}function Ha(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function ls(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function bm(e){var t,n=Ct(e),a=n[0];return a!=null&&(t=a.ownerDocument)!=null&&t.body?a.ownerDocument:document}function _m(e,t){var n=t.clientX,a=t.clientY;return e.every(function(r){var i=r.popperRect,s=r.popperState,o=r.props,c=o.interactiveBorder,l=dm(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=l==="bottom"?u.top.y:0,d=l==="top"?u.bottom.y:0,m=l==="right"?u.left.x:0,g=l==="left"?u.right.x:0,v=i.top-a+p>c,f=a-i.bottom-d>c,b=i.left-n+m>c,_=n-i.right-g>c;return v||f||b||_})}function Wa(e,t,n){var a=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){e[a](r,n)})}function us(e,t){for(var n=t;n;){var a;if(e.contains(n))return!0;n=n.getRootNode==null||(a=n.getRootNode())==null?void 0:a.host}return!1}var Fe={isTouch:!1},ps=0;function ym(){Fe.isTouch||(Fe.isTouch=!0,window.performance&&document.addEventListener("mousemove",Tc))}function Tc(){var e=performance.now();e-ps<20&&(Fe.isTouch=!1,document.removeEventListener("mousemove",Tc)),ps=e}function vm(){var e=document.activeElement;if(gm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function wm(){document.addEventListener("touchstart",ym,tt),window.addEventListener("blur",vm)}var xm=typeof window<"u"&&typeof document<"u",km=xm?!!window.msCrypto:!1,Cm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Em={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_e=Object.assign({appendTo:Sc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Cm,Em),Fm=Object.keys(_e),$m=function(t){var n=Object.keys(t);n.forEach(function(a){_e[a]=t[a]})};function Rc(e){var t=e.plugins||[],n=t.reduce(function(a,r){var i=r.name,s=r.defaultValue;if(i){var o;a[i]=e[i]!==void 0?e[i]:(o=_e[i])!=null?o:s}return a},{});return Object.assign({},e,n)}function jm(e,t){var n=t?Object.keys(Rc(Object.assign({},_e,{plugins:t}))):Fm,a=n.reduce(function(r,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return r;if(i==="content")r[i]=s;else try{r[i]=JSON.parse(s)}catch{r[i]=s}return r},{});return a}function ds(e,t){var n=Object.assign({},t,{content:Ac(t.content,[e])},t.ignoreAttributes?{}:jm(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var Sm=function(){return"innerHTML"};function $r(e,t){e[Sm()]=t}function ms(e){var t=un();return e===!0?t.className=$c:(t.className=jc,Ta(e)?t.appendChild(e):$r(t,e)),t}function hs(e,t){Ta(t.content)?($r(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$r(e,t.content):e.textContent=t.content)}function jr(e){var t=e.firstElementChild,n=ua(t.children);return{box:t,content:n.find(function(a){return a.classList.contains(Fc)}),arrow:n.find(function(a){return a.classList.contains($c)||a.classList.contains(jc)}),backdrop:n.find(function(a){return a.classList.contains(lm)})}}function Oc(e){var t=un(),n=un();n.className=cm,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var a=un();a.className=Fc,a.setAttribute("data-state","hidden"),hs(a,e.props),t.appendChild(n),n.appendChild(a),r(e.props,e.props);function r(i,s){var o=jr(t),c=o.box,l=o.content,u=o.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&hs(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(ms(s.arrow))):c.appendChild(ms(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:r}}Oc.$$tippy=!0;var Am=1,Wn=[],Va=[];function Tm(e,t){var n=ds(e,Object.assign({},_e,Rc(cs(t)))),a,r,i,s=!1,o=!1,c=!1,l=!1,u,p,d,m=[],g=ss(An,n.interactiveDebounce),v,f=Am++,b=null,_=pm(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:f,reference:e,popper:un(),popperInstance:b,props:n,state:w,plugins:_,clearDelayTimeouts:Nn,setProps:Ln,setContent:Pn,show:Bl,hide:Ul,hideWithInteractivity:Gl,enable:Kt,disable:In,unmount:Hl,destroy:Wl};if(!n.render)return h;var C=n.render(h),k=C.popper,$=C.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+h.id,h.popper=k,e._tippy=h,k._tippy=h;var T=_.map(function(y){return y.fn(h)}),N=e.hasAttribute("aria-expanded");return yt(),xe(),Q(),K("onCreate",[h]),n.showOnCreate&&Xt(),k.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",g)}),h;function I(){var y=h.props.touch;return Array.isArray(y)?y:[y,0]}function D(){return I()[0]==="hold"}function R(){var y;return!!((y=h.props.render)!=null&&y.$$tippy)}function L(){return v||e}function q(){var y=L().parentNode;return y?bm(y):document}function U(){return jr(k)}function G(y){return h.state.isMounted&&!h.state.isVisible||Fe.isTouch||u&&u.type==="focus"?0:Ga(h.props.delay,y?0:1,_e.delay)}function Q(y){y===void 0&&(y=!1),k.style.pointerEvents=h.props.interactive&&!y?"":"none",k.style.zIndex=""+h.props.zIndex}function K(y,E,F){if(F===void 0&&(F=!0),T.forEach(function(A){A[y]&&A[y].apply(A,E)}),F){var O;(O=h.props)[y].apply(O,E)}}function we(){var y=h.props.aria;if(y.content){var E="aria-"+y.content,F=k.id,O=Ct(h.props.triggerTarget||e);O.forEach(function(A){var te=A.getAttribute(E);if(h.state.isVisible)A.setAttribute(E,te?te+" "+F:F);else{var ce=te&&te.replace(F,"").trim();ce?A.setAttribute(E,ce):A.removeAttribute(E)}})}}function xe(){if(!(N||!h.props.aria.expanded)){var y=Ct(h.props.triggerTarget||e);y.forEach(function(E){h.props.interactive?E.setAttribute("aria-expanded",h.state.isVisible&&E===L()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ye(){q().removeEventListener("mousemove",g),Wn=Wn.filter(function(y){return y!==g})}function ke(y){if(!(Fe.isTouch&&(c||y.type==="mousedown"))){var E=y.composedPath&&y.composedPath()[0]||y.target;if(!(h.props.interactive&&us(k,E))){if(Ct(h.props.triggerTarget||e).some(function(F){return us(F,E)})){if(Fe.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else K("onClickOutside",[h,y]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),o=!0,setTimeout(function(){o=!1}),h.state.isMounted||Ae())}}}function Xe(){c=!0}function Se(){c=!1}function fe(){var y=q();y.addEventListener("mousedown",ke,!0),y.addEventListener("touchend",ke,tt),y.addEventListener("touchstart",Se,tt),y.addEventListener("touchmove",Xe,tt)}function Ae(){var y=q();y.removeEventListener("mousedown",ke,!0),y.removeEventListener("touchend",ke,tt),y.removeEventListener("touchstart",Se,tt),y.removeEventListener("touchmove",Xe,tt)}function bt(y,E){_t(y,function(){!h.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&E()})}function Te(y,E){_t(y,E)}function _t(y,E){var F=U().box;function O(A){A.target===F&&(Wa(F,"remove",O),E())}if(y===0)return E();Wa(F,"remove",p),Wa(F,"add",O),p=O}function Me(y,E,F){F===void 0&&(F=!1);var O=Ct(h.props.triggerTarget||e);O.forEach(function(A){A.addEventListener(y,E,F),m.push({node:A,eventType:y,handler:E,options:F})})}function yt(){D()&&(Me("touchstart",Vt,{passive:!0}),Me("touchend",Tn,{passive:!0})),um(h.props.trigger).forEach(function(y){if(y!=="manual")switch(Me(y,Vt),y){case"mouseenter":Me("mouseleave",Tn);break;case"focus":Me(km?"focusout":"blur",Zt);break;case"focusin":Me("focusout",Zt);break}})}function Sn(){m.forEach(function(y){var E=y.node,F=y.eventType,O=y.handler,A=y.options;E.removeEventListener(F,O,A)}),m=[]}function Vt(y){var E,F=!1;if(!(!h.state.isEnabled||Yt(y)||o)){var O=((E=u)==null?void 0:E.type)==="focus";u=y,v=y.currentTarget,xe(),!h.state.isVisible&&hm(y)&&Wn.forEach(function(A){return A(y)}),y.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?F=!0:Xt(y),y.type==="click"&&(s=!F),F&&!O&&Ke(y)}}function An(y){var E=y.target,F=L().contains(E)||k.contains(E);if(!(y.type==="mousemove"&&F)){var O=qe().concat(k).map(function(A){var te,ce=A._tippy,vt=(te=ce.popperInstance)==null?void 0:te.state;return vt?{popperRect:A.getBoundingClientRect(),popperState:vt,props:n}:null}).filter(Boolean);_m(O,y)&&(Ye(),Ke(y))}}function Tn(y){var E=Yt(y)||h.props.trigger.indexOf("click")>=0&&s;if(!E){if(h.props.interactive){h.hideWithInteractivity(y);return}Ke(y)}}function Zt(y){h.props.trigger.indexOf("focusin")<0&&y.target!==L()||h.props.interactive&&y.relatedTarget&&k.contains(y.relatedTarget)||Ke(y)}function Yt(y){return Fe.isTouch?D()!==y.type.indexOf("touch")>=0:!1}function Rn(){On();var y=h.props,E=y.popperOptions,F=y.placement,O=y.offset,A=y.getReferenceClientRect,te=y.moveTransition,ce=R()?jr(k).arrow:null,vt=A?{getBoundingClientRect:A,contextElement:A.contextElement||L()}:e,Li={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Dn){var wt=Dn.state;if(R()){var Vl=U(),Da=Vl.box;["placement","reference-hidden","escaped"].forEach(function(Mn){Mn==="placement"?Da.setAttribute("data-placement",wt.placement):wt.attributes.popper["data-popper-"+Mn]?Da.setAttribute("data-"+Mn,""):Da.removeAttribute("data-"+Mn)}),wt.attributes.popper={}}}},Qe=[{name:"offset",options:{offset:O}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},Li];R()&&ce&&Qe.push({name:"arrow",options:{element:ce,padding:3}}),Qe.push.apply(Qe,E?.modifiers||[]),h.popperInstance=om(vt,k,Object.assign({},E,{placement:F,onFirstUpdate:d,modifiers:Qe}))}function On(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function Re(){var y=h.props.appendTo,E,F=L();h.props.interactive&&y===Sc||y==="parent"?E=F.parentNode:E=Ac(y,[F]),E.contains(k)||E.appendChild(k),h.state.isMounted=!0,Rn()}function qe(){return ua(k.querySelectorAll("[data-tippy-root]"))}function Xt(y){h.clearDelayTimeouts(),y&&K("onTrigger",[h,y]),fe();var E=G(!0),F=I(),O=F[0],A=F[1];Fe.isTouch&&O==="hold"&&A&&(E=A),E?a=setTimeout(function(){h.show()},E):h.show()}function Ke(y){if(h.clearDelayTimeouts(),K("onUntrigger",[h,y]),!h.state.isVisible){Ae();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(y.type)>=0&&s)){var E=G(!1);E?r=setTimeout(function(){h.state.isVisible&&h.hide()},E):i=requestAnimationFrame(function(){h.hide()})}}function Kt(){h.state.isEnabled=!0}function In(){h.hide(),h.state.isEnabled=!1}function Nn(){clearTimeout(a),clearTimeout(r),cancelAnimationFrame(i)}function Ln(y){if(!h.state.isDestroyed){K("onBeforeUpdate",[h,y]),Sn();var E=h.props,F=ds(e,Object.assign({},E,cs(y),{ignoreAttributes:!0}));h.props=F,yt(),E.interactiveDebounce!==F.interactiveDebounce&&(Ye(),g=ss(An,F.interactiveDebounce)),E.triggerTarget&&!F.triggerTarget?Ct(E.triggerTarget).forEach(function(O){O.removeAttribute("aria-expanded")}):F.triggerTarget&&e.removeAttribute("aria-expanded"),xe(),Q(),$&&$(E,F),h.popperInstance&&(Rn(),qe().forEach(function(O){requestAnimationFrame(O._tippy.popperInstance.forceUpdate)})),K("onAfterUpdate",[h,y])}}function Pn(y){h.setProps({content:y})}function Bl(){var y=h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Fe.isTouch&&!h.props.touch,A=Ga(h.props.duration,0,_e.duration);if(!(y||E||F||O)&&!L().hasAttribute("disabled")&&(K("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,R()&&(k.style.visibility="visible"),Q(),fe(),h.state.isMounted||(k.style.transition="none"),R()){var te=U(),ce=te.box,vt=te.content;Ha([ce,vt],0)}d=function(){var Qe;if(!(!h.state.isVisible||l)){if(l=!0,k.offsetHeight,k.style.transition=h.props.moveTransition,R()&&h.props.animation){var Pa=U(),Dn=Pa.box,wt=Pa.content;Ha([Dn,wt],A),ls([Dn,wt],"visible")}we(),xe(),os(Va,h),(Qe=h.popperInstance)==null||Qe.forceUpdate(),K("onMount",[h]),h.props.animation&&R()&&Te(A,function(){h.state.isShown=!0,K("onShown",[h])})}},Re()}}function Ul(){var y=!h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Ga(h.props.duration,1,_e.duration);if(!(y||E||F)&&(K("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,l=!1,s=!1,R()&&(k.style.visibility="hidden"),Ye(),Ae(),Q(!0),R()){var A=U(),te=A.box,ce=A.content;h.props.animation&&(Ha([te,ce],O),ls([te,ce],"hidden"))}we(),xe(),h.props.animation?R()&&bt(O,h.unmount):h.unmount()}}function Gl(y){q().addEventListener("mousemove",g),os(Wn,g),g(y)}function Hl(){h.state.isVisible&&h.hide(),h.state.isMounted&&(On(),qe().forEach(function(y){y._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Va=Va.filter(function(y){return y!==h}),h.state.isMounted=!1,K("onHidden",[h]))}function Wl(){h.state.isDestroyed||(h.clearDelayTimeouts(),h.unmount(),Sn(),delete e._tippy,h.state.isDestroyed=!0,K("onDestroy",[h]))}}function Bt(e,t){t===void 0&&(t={});var n=_e.plugins.concat(t.plugins||[]);wm();var a=Object.assign({},t,{plugins:n}),r=fm(e),i=r.reduce(function(s,o){var c=o&&Tm(o,a);return c&&s.push(c),s},[]);return Ta(e)?i[0]:i}Bt.defaultProps=_e;Bt.setDefaultProps=$m;Bt.currentInput=Fe;Object.assign({},_c,{effect:function(t){var n=t.state,a={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,a.popper),n.styles=a,n.elements.arrow&&Object.assign(n.elements.arrow.style,a.arrow)}});Bt.setDefaultProps({render:Oc});let Y=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Rm(e){return xi(e)}function xi(e){return Array.isArray(e)?Om(e):e instanceof RegExp?e:typeof e=="object"?Im(e):e}function Om(e){let t=[];for(let n=0,a=e.length;n<a;n++)t[n]=xi(e[n]);return t}function Im(e){let t={};for(let n in e)t[n]=xi(e[n]);return t}function Ic(e,...t){return t.forEach(n=>{for(let a in n)e[a]=n[a]}),e}function Nc(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Nc(e.substring(0,e.length-1)):e.substr(~t+1)}var Za=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Vn=class{static hasCaptures(e){return e===null?!1:(Za.lastIndex=0,Za.test(e))}static replaceCaptures(e,t,n){return e.replace(Za,(a,r,i,s)=>{let o=n[parseInt(r||i,10)];if(o){let c=t.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(s){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Lc(e,t){return e<t?-1:e>t?1:0}function Pc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,a=t.length;if(n===a){for(let r=0;r<n;r++){let i=Lc(e[r],t[r]);if(i!==0)return i}return 0}return n-a}function gs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Dc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Mc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},pa=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Pm(e),t)}static createFromParsedTheme(e,t){return Mm(e,t)}_cachedMatchRoot=new Mc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,a=this._cachedMatchRoot.get(t).find(r=>Nm(e.parent,r.parentScopes));return a?new qc(a.fontStyle,a.foreground,a.background):null}},Ya=class na{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const a of n)t=new na(t,a);return t}static from(...t){let n=null;for(let a=0;a<t.length;a++)n=new na(n,t[a]);return n}push(t){return new na(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push(a.scopeName),a=a.parent;return a===t?n.reverse():void 0}};function Nm(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let a=t[n],r=!1;if(a===">"){if(n===t.length-1)return!1;a=t[++n],r=!0}for(;e&&!Lm(e.scopeName,a);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lm(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Pm(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],a=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let o;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(s.scope)?o=s.scope:o=[""];let c=-1;if(typeof s.settings.fontStyle=="string"){c=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof s.settings.foreground=="string"&&gs(s.settings.foreground)&&(l=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&gs(s.settings.background)&&(u=s.settings.background);for(let p=0,d=o.length;p<d;p++){let g=o[p].trim().split(" "),v=g[g.length-1],f=null;g.length>1&&(f=g.slice(0,g.length-1),f.reverse()),n[a++]=new Dm(v,f,r,c,l,u)}}return n}var Dm=class{constructor(e,t,n,a,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},ee=(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))(ee||{});function Mm(e,t){e.sort((c,l)=>{let u=Lc(c.scope,l.scope);return u!==0||(u=Pc(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new qm(t),s=new qc(n,i.getId(a),i.getId(r)),o=new Bm(new Sr(0,null,-1,0,0),[]);for(let c=0,l=e.length;c<l;c++){let u=e[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pa(i,s,o)}var qm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},zm=Object.freeze([]),Sr=class zc{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,a,r,i){this.scopeDepth=t,this.parentScopes=n||zm,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new zc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let a=0,r=t.length;a<r;a++)n[a]=t[a].clone();return n}acceptOverwrite(t,n,a,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},Bm=class Ar{constructor(t,n=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let a=0,r=0;for(;t.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),r,i;if(a===-1?(r=t,i=""):(r=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ar._cmpBySpecificity),n}insert(t,n,a,r,i,s){if(n===""){this._doInsertHere(t,a,r,i,s);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Ar(this._mainRule.clone(),Sr.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,a,r,i,s)}_doInsertHere(t,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(t,a,r,i);return}for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let c=this._rulesWithParentScopes[s];if(Pc(c.parentScopes,n)===0){c.acceptOverwrite(t,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Sr(t,n,a,r,i))}},Lt=class le{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=le.getLanguageId(t),a=le.getTokenType(t),r=le.getFontStyle(t),i=le.getForeground(t),s=le.getBackground(t);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>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,a,r,i,s,o){let c=le.getLanguageId(t),l=le.getTokenType(t),u=le.containsBalancedBrackets(t)?1:0,p=le.getFontStyle(t),d=le.getForeground(t),m=le.getBackground(t);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(p=i),s!==0&&(d=s),o!==0&&(m=o),(c<<0|l<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function da(e,t){const n=[],a=Um(e);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=s();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=o();return r===")"&&(r=a.next()),c}if(fs(r)){const c=[];do c.push(r),r=a.next();while(fs(r));return l=>t(c,l)}return null}function s(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(p=>p(u))}function o(){const c=[];let l=s();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=s()}return u=>c.some(p=>p(u))}}function fs(e){return!!e&&!!e.match(/[\w\.:]+/)}function Um(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const a=n[0];return n=t.exec(e),a}}}function Bc(e){typeof e.dispose=="function"&&e.dispose()}var fn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Gm=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Hm=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))}},Wm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Hm;for(const n of e)Vm(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof fn){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 Vm(e,t,n,a){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof fn?aa({baseGrammar:i,selfGrammar:r},a):Tr(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const s=n.injections(e.scopeName);if(s)for(const o of s)a.add(new fn(o))}function Tr(e,t,n){if(t.repository&&t.repository[e]){const a=t.repository[e];ma([a],t,n)}}function aa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ma(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ma(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ma(e,t,n){for(const a of e){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?Ic({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ma(a.patterns,{...t,repository:r},n);const i=a.include;if(!i)continue;const s=Uc(i);switch(s.kind){case 0:aa({...t,selfGrammar:t.baseGrammar},n);break;case 1:aa(t,n);break;case 2:Tr(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const o=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(o){const c={baseGrammar:t.baseGrammar,selfGrammar:o,repository:r};s.kind===4?Tr(s.ruleName,c,n):aa(c,n)}else s.kind===4?n.add(new Gm(s.scopeName,s.ruleName)):n.add(new fn(s.scopeName));break}}}var Zm=class{kind=0},Ym=class{kind=1},Xm=class{constructor(e){this.ruleName=e}kind=2},Km=class{constructor(e){this.scopeName=e}kind=3},Qm=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uc(e){if(e==="$base")return new Zm;if(e==="$self")return new Ym;const t=e.indexOf("#");if(t===-1)return new Km(e);if(t===0)return new Xm(e.substring(1));{const n=e.substring(0,t),a=e.substring(t+1);return new Qm(n,a)}}var Jm=/\\(\d+)/,bs=/\\(\d+)/g,eh=-1,Gc=-2;var Fn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,a){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Vn.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Vn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nc(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:Vn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Vn.replaceCaptures(this._contentName,e,t)}},th=class extends Fn{retokenizeCapturedWithRuleId;constructor(e,t,n,a,r){super(e,t,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,a){throw new Error("Not supported!")}},nh=class extends Fn{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,null),this._match=new bn(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _n,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_s=class extends Fn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _n,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rr=class extends Fn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r,i,s,o,c,l){super(e,t,n,a),this._begin=new bn(r,this.id),this.beginCaptures=i,this._end=new bn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _n;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}},ha=class extends Fn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,a,r,i,s,o,c){super(e,t,n,a),this._begin=new bn(r,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new bn(s,Gc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _n;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,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new _n,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Hc=class J{static createCaptureRule(t,n,a,r,i){return t.registerRule(s=>new th(n,s,a,r,i))}static getCompiledRuleId(t,n,a){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new nh(t.$vscodeTextmateLocation,t.id,t.name,t.match,J._compileCaptures(t.captures,n,a));if(typeof t.begin>"u"){t.repository&&(a=Ic({},a,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new _s(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,J._compilePatterns(i,n,a))}return t.while?new ha(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.while,J._compileCaptures(t.whileCaptures||t.captures,n,a),J._compilePatterns(t.patterns,n,a)):new Rr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.end,J._compileCaptures(t.endCaptures||t.captures,n,a),t.applyEndPatternLast,J._compilePatterns(t.patterns,n,a))}),t.id}static _compileCaptures(t,n,a){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);o>i&&(i=o)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);let c=0;t[s].patterns&&(c=J.getCompiledRuleId(t[s],n,a)),r[o]=J.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,c)}}return r}static _compilePatterns(t,n,a){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i];let c=-1;if(o.include){const l=Uc(o.include);switch(l.kind){case 0:case 1:c=J.getCompiledRuleId(a[o.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=J.getCompiledRuleId(u,n,a));break;case 3:case 4:const p=l.scopeName,d=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(p,a);if(m)if(d){let g=m.repository[d];g&&(c=J.getCompiledRuleId(g,n,m.repository))}else c=J.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else c=J.getCompiledRuleId(o,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof _s||l instanceof Rr||l instanceof ha)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},bn=class Wc{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const a=t.length;let r=0,i=[],s=!1;for(let o=0;o<a;o++)if(t.charAt(o)==="\\"&&o+1<a){const l=t.charAt(o+1);l==="z"?(i.push(t.substring(r,o)),i.push("$(?!\\n)(?<!\\n)"),r=o+2):(l==="A"||l==="G")&&(s=!0),o++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Jm.test(this.source):this.hasBackReferences=!1}clone(){return new Wc(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>t.substring(r.start,r.end));return bs.lastIndex=0,this.source.replace(bs,(r,i)=>Dc(a[parseInt(i,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=[],a=[],r=[],i,s,o,c;for(i=0,s=this.source.length;i<s;i++)o=this.source.charAt(i),t[i]=o,n[i]=o,a[i]=o,r[i]=o,o==="\\"&&i+1<s&&(c=this.source.charAt(i+1),c==="A"?(t[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):c==="G"?(t[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(t[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},_n=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ys(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 a=this._items.map(r=>r.resolveAnchors(t,n));return new ys(e,a,this._items.map(r=>r.ruleId))}},ys=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<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
+`)}findNextMatchSync(e,t,n){const a=this.scanner.findNextMatchSync(e,t,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},Xa=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ah=class Or{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Xa(t,8),this._embeddedLanguagesMatcher=new rh(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Or._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Xa(0,0);_getBasicScopeAttributes=new Mc(t=>{const n=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new Xa(n,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Or.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/},rh=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,a])=>Dc(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])}},vs=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Vc(e,t,n,a,r,i,s,o){const c=t.content.length;let l=!1,u=-1;if(s){const m=ih(e,t,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!l;){if(o!==0&&Date.now()-p>o)return new vs(r,!0);d()}return new vs(r,!1);function d(){const m=sh(e,t,n,a,r,u);if(!m){i.produce(r,c),l=!0;return}const g=m.captureIndices,v=m.matchedRuleId,f=g&&g.length>0?g[0].end>a:!1;if(v===eh){const b=r.getRule(e);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),rn(e,t,n,r,i,b.endCaptures,g),i.produce(r,g[0].end);const _=r;if(r=r.parent,u=_.getAnchorPos(),!f&&_.getEnterPos()===a){r=_,i.produce(r,c),l=!0;return}}else{const b=e.getRule(v);i.produce(r,g[0].start);const _=r,w=b.getName(t.content,g),h=r.contentNameScopesList.pushAttributed(w,e);if(r=r.push(v,a,u,g[0].end===c,null,h,h),b instanceof Rr){const C=b;rn(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(b instanceof ha){const C=b;rn(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(rn(e,t,n,r,i,b.captures,g),i.produce(r,g[0].end),r=r.pop(),!f){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function ih(e,t,n,a,r,i){let s=r.beginRuleCapturedEOL?0:-1;const o=[];for(let c=r;c;c=c.pop()){const l=c.getRule(e);l instanceof ha&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:u}=lh(c.rule,e,c.stack.endRule,n,a===s),p=l.findNextMatchSync(t,a,u);if(p){if(p.ruleId!==Gc){r=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(c.stack,p.captureIndices[0].start),rn(e,t,n,c.stack,i,c.rule.whileCaptures,p.captureIndices),i.produce(c.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>a&&(a=p.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:s,isFirstLine:n}}function sh(e,t,n,a,r,i){const s=oh(e,t,n,a,r,i),o=e.getInjections();if(o.length===0)return s;const c=ch(o,e,t,n,a,r,i);if(!c)return s;if(!s)return c;const l=s.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:s}function oh(e,t,n,a,r,i){const s=r.getRule(e),{ruleScanner:o,findOptions:c}=Zc(s,e,r.endRule,n,a===i),l=o.findNextMatchSync(t,a,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function ch(e,t,n,a,r,i,s){let o=Number.MAX_VALUE,c=null,l,u=0;const p=i.contentNameScopesList.getScopeNames();for(let d=0,m=e.length;d<m;d++){const g=e[d];if(!g.matcher(p))continue;const v=t.getRule(g.ruleId),{ruleScanner:f,findOptions:b}=Zc(v,t,null,a,r===s),_=f.findNextMatchSync(n,r,b);if(!_)continue;const w=_.captureIndices[0].start;if(!(w>=o)&&(o=w,c=_.captureIndices,l=_.ruleId,u=g.priority,o===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Zc(e,t,n,a,r){return{ruleScanner:e.compileAG(t,n,a,r),findOptions:0}}function lh(e,t,n,a,r){return{ruleScanner:e.compileWhileAG(t,n,a,r),findOptions:0}}function rn(e,t,n,a,r,i,s){if(i.length===0)return;const o=t.content,c=Math.min(i.length,s.length),l=[],u=s[0].end;for(let p=0;p<c;p++){const d=i[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),d.retokenizeCapturedWithRuleId){const v=d.getName(o,s),f=a.contentNameScopesList.pushAttributed(v,e),b=d.getContentName(o,s),_=f.pushAttributed(b,e),w=a.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,f,_),h=e.createOnigString(o.substring(0,m.end));Vc(e,h,n&&m.start===0,m.start,w,r,!1,0),Bc(h);continue}const g=d.getName(o,s);if(g!==null){const f=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,e);l.push(new uh(f,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var uh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ph(e,t,n,a,r,i,s,o){return new mh(e,t,n,a,r,i,s,o)}function ws(e,t,n,a,r){const i=da(t,ga),s=Hc.getCompiledRuleId(n,a,r.repository);for(const o of i)e.push({debugSelector:t,matcher:o.matcher,ruleId:s,grammar:r,priority:o.priority})}function ga(e,t){if(t.length<e.length)return!1;let n=0;return e.every(a=>{for(let r=n;r<t.length;r++)if(dh(t[r],a))return n=r+1,!0;return!1})}function dh(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var mh=class{constructor(e,t,n,a,r,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new ah(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=xs(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=da(c,ga);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_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:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,a=e.lookup(n);if(a){const r=a.injections;if(r)for(let s in r)ws(t,s,r[s],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const o=this.getExternalGrammar(s);if(o){const c=o.injectionSelector;c&&ws(t,c,o,this,o)}})}return t.sort((r,i)=>r.priority-i.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]=xs(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const a=this._tokenize(e,t,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,n=0){const a=this._tokenize(e,t,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,n,a){this._rootId===-1&&(this._rootId=Hc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Ir.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Lt.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=pn.createRootAndLookUpScopeName(d,p,this):m=pn.createRoot("unknown",p),t=new Ir(null,this._rootId,-1,-1,!1,null,m,m)}else r=!1,t.reset();e=e+`
+`;const i=this.createOnigString(e),s=i.content.length,o=new gh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Vc(this,i,r,0,t,o,!0,a);return Bc(i),{lineLength:s,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function xs(e,t){return e=Rm(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 pn=class Ce{constructor(t,n,a){this.parent=t,this.scopePath=n,this.tokenAttributes=a}static fromExtension(t,n){let a=t,r=t?.scopePath??null;for(const i of n)r=Ya.push(r,i.scopeNames),a=new Ce(a,r,i.encodedTokenAttributes);return a}static createRoot(t,n){return new Ce(null,new Ya(null,t),n)}static createRootAndLookUpScopeName(t,n,a){const r=a.getMetadataForScope(t),i=new Ya(null,t),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(n,r,s);return new Ce(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ce.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,a){let r=-1,i=0,s=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,s=a.backgroundId),Lt.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ce._pushAttributed(this,t,n);const a=t.split(/ /g);let r=this;for(const i of a)r=Ce._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,a){const r=a.getMetadataForScope(n),i=t.scopePath.push(n),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(t.tokenAttributes,r,s);return new Ce(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?n.reverse():void 0}},Ir=class nt{constructor(t,n,a,r,i,s,o,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new nt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:nt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?pn.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(){nt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,a,r,i,s,o){return new nt(this,t,n,a,r,i,s,o)}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 nt(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 a=pn.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new nt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,pn.fromExtension(a,n.contentNameScopesList))}},hh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):da(n,ga).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>da(n,ga).map(a=>a.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}},gh=class{constructor(e,t,n,a){this.balancedBracketSelectors=a,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 a=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(a=Lt.set(a,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=Lt.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},fh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,a,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,ph(e,i,t,n,a,r,this,this._onigLib))}return this._grammars.get(e)}},bh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new fh(pa.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(pa.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,a){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,n,a){return this._loadGrammar(t,n,a.embeddedLanguages,a.tokenTypes,new hh(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,a,r,i){const s=new Wm(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(o=>this._loadSingleGrammar(o.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(t,n=[],a=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,a,r)}_grammarForScopeName(t,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,a,r,i)}},Nr=Ir.NULL;const _h=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class $n{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}$n.prototype.normal={};$n.prototype.property={};$n.prototype.space=void 0;function Yc(e,t){const n={},a={};for(const r of e)Object.assign(n,r.property),Object.assign(a,r.normal);return new $n(n,a,t)}function Lr(e){return e.toLowerCase()}class ie{constructor(t,n){this.attribute=n,this.property=t}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let yh=0;const S=ft(),H=ft(),Pr=ft(),x=ft(),P=ft(),jt=ft(),se=ft();function ft(){return 2**++yh}const Dr=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:H,commaOrSpaceSeparated:se,commaSeparated:jt,number:x,overloadedBoolean:Pr,spaceSeparated:P},Symbol.toStringTag,{value:"Module"})),Ka=Object.keys(Dr);class ki extends ie{constructor(t,n,a,r){let i=-1;if(super(t,n),ks(this,"space",r),typeof a=="number")for(;++i<Ka.length;){const s=Ka[i];ks(this,Ka[i],(a&Dr[s])===Dr[s])}}}ki.prototype.defined=!0;function ks(e,t,n){n&&(e[t]=n)}function Ut(e){const t={},n={};for(const[a,r]of Object.entries(e.properties)){const i=new ki(a,e.transform(e.attributes||{},a),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),t[a]=i,n[Lr(a)]=a,n[Lr(i.attribute)]=a}return new $n(t,n,e.space)}const Xc=Ut({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:H,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:P,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:x,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:P,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:H,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function Qc(e,t){return Kc(e,t.toLowerCase())}const vh=Ut({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jt,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:P,autoFocus:S,autoPlay:S,blocking:P,capture:null,charSet:null,checked:S,cite:null,className:P,cols:x,colSpan:null,content:null,contentEditable:H,controls:S,controlsList:P,coords:x|jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Pr,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:P,height:x,hidden:Pr,high:x,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:P,itemRef:P,itemScope:S,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S,optimum:x,pattern:null,ping:P,placeholder:null,playsInline:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:P,required:S,reversed:S,rows:x,rowSpan:x,sandbox:P,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:H,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:Qc}),wh=Ut({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:se,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jt,g2:jt,glyphName:jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:se,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:se,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:se,rev:se,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:se,requiredFeatures:se,requiredFonts:se,requiredFormats:se,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:se,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:se,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:se,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kc}),Jc=Ut({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),el=Ut({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qc}),tl=Ut({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xh=/[A-Z]/g,Cs=/-[a-z]/g,kh=/^data[-\w.:]+$/i;function Ch(e,t){const n=Lr(t);let a=t,r=ie;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kh.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Cs,Fh);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Cs.test(i)){let s=i.replace(xh,Eh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=ki}return new r(a,t)}function Eh(e){return"-"+e.toLowerCase()}function Fh(e){return e.charAt(1).toUpperCase()}const $h=Yc([Xc,vh,Jc,el,tl],"html"),nl=Yc([Xc,wh,Jc,el,tl],"svg"),Es={}.hasOwnProperty;function jh(e,t){const n=t||{};function a(r,...i){let s=a.invalid;const o=a.handlers;if(r&&Es.call(r,e)){const c=String(r[e]);s=Es.call(o,c)?o[c]:a.unknown}if(s)return s.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const Sh=/["&'<>`]/g,Ah=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Th=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Rh=/[|\\{}()[\]^$+*?.]/g,Fs=new WeakMap;function Oh(e,t){if(e=e.replace(t.subset?Ih(t.subset):Sh,a),t.subset||t.escapeOnly)return e;return e.replace(Ah,n).replace(Th,a);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function a(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function Ih(e){let t=Fs.get(e);return t||(t=Nh(e),Fs.set(e,t)),t}function Nh(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Rh,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Lh=/[\dA-Fa-f]/;function Ph(e,t,n){const a="&#x"+e.toString(16).toUpperCase();return n&&t&&!Lh.test(String.fromCharCode(t))?a:a+";"}const Dh=/\d/;function Mh(e,t,n){const a="&#"+String(e);return n&&t&&!Dh.test(String.fromCharCode(t))?a:a+";"}const qh=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Qa={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zh=["cent","copy","divide","gt","lt","not","para","times"],al={}.hasOwnProperty,Mr={};let Zn;for(Zn in Qa)al.call(Qa,Zn)&&(Mr[Qa[Zn]]=Zn);const Bh=/[^\dA-Za-z]/;function Uh(e,t,n,a){const r=String.fromCharCode(e);if(al.call(Mr,r)){const i=Mr[r],s="&"+i;return n&&qh.includes(i)&&!zh.includes(i)&&(!a||t&&t!==61&&Bh.test(String.fromCharCode(t)))?s:s+";"}return""}function Gh(e,t,n){let a=Ph(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Uh(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Mh(e,t,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function St(e,t){return Oh(e,Object.assign({format:Gh},t))}const Hh=/^>|^->|<!--|-->|--!>|<!-$/g,Wh=[">"],Vh=["<",">"];function Zh(e,t,n,a){return a.settings.bogusComments?"<?"+St(e.value,Object.assign({},a.settings.characterReferences,{subset:Wh}))+">":"<!--"+e.value.replace(Hh,r)+"-->";function r(i){return St(i,Object.assign({},a.settings.characterReferences,{subset:Vh}))}}function Yh(e,t,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function $s(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(t);for(;r!==-1;)a++,r=n.indexOf(t,r+t.length);return a}function Xh(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Kh(e){return e.join(" ").trim()}const Qh=/[ \t\n\f\r]/g;function Ci(e){return typeof e=="object"?e.type==="text"?js(e.value):!1:js(e)}function js(e){return e.replace(Qh,"")===""}const Z=il(1),rl=il(-1),Jh=[];function il(e){return t;function t(n,a,r){const i=n?n.children:Jh;let s=(a||0)+e,o=i[s];if(!r)for(;o&&Ci(o);)s+=e,o=i[s];return o}}const eg={}.hasOwnProperty;function sl(e){return t;function t(n,a,r){return eg.call(e,n.tagName)&&e[n.tagName](n,a,r)}}const Ei=sl({body:ng,caption:Ja,colgroup:Ja,dd:sg,dt:ig,head:Ja,html:tg,li:rg,optgroup:og,option:cg,p:ag,rp:Ss,rt:Ss,tbody:ug,td:As,tfoot:pg,th:As,thead:lg,tr:dg});function Ja(e,t,n){const a=Z(n,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&Ci(a.value.charAt(0)))}function tg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ng(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ag(e,t,n){const a=Z(n,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 rg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="li"}function ig(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function sg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Ss(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function og(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function cg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function lg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function ug(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function pg(e,t,n){return!Z(n,t)}function dg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="tr"}function As(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const mg=sl({body:fg,colgroup:bg,head:gg,html:hg,tbody:_g});function hg(e){const t=Z(e,-1);return!t||t.type!=="comment"}function gg(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const n=e.children[0];return!n||n.type==="element"}function fg(e){const t=Z(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ci(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function bg(e,t,n){const a=rl(n,t),r=Z(e,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function _g(e,t,n){const a=rl(n,t),r=Z(e,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Yn={name:[[`
\f\r &/=>`.split(""),`
\f\r "&'/=>\``.split("")],[`\0
\f\r "&'/<=>`.split(""),`\0
@@ -12,8 +12,8 @@ ${n?'Expression: "'+n+`"
\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 _g(e,t,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let s=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const o=[];let c;r.space==="html"&&e.tagName==="svg"&&(a.schema=nl);const l=yg(a,e.properties),u=a.all(r.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=r,u&&(s=!1),(l||!i||!dg(e,t,n))&&(o.push("<",e.tagName,l?" "+l:""),s&&(r.space==="svg"||a.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!a.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!Ei(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function yg(e,t){const n=[];let a=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=vg(e,r,t[r]);i&&n.push(i)}}for(;++a<n.length;){const i=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function vg(e,t,n){const a=kh(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=St(a.attribute,Object.assign({},e.settings.characterReferences,{subset:Yn.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?Yh:Xh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(o=St(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yn.unquoted[r][i]}))),o!==n&&(e.settings.quoteSmart&&$s(n,s)>$s(n,e.alternative)&&(s=e.alternative),o=s+St(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Yn.single:Yn.double)[r][i],attribute:!0}))+s),c+(o&&"="+o))}const wg=["<","&"];function ol(e,t,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:St(e.value,Object.assign({},a.settings.characterReferences,{subset:wg}))}function xg(e,t,n,a){return a.settings.allowDangerousHtml?e.value:ol(e,t,n,a)}function kg(e,t,n,a){return a.all(e)}const Cg=$h("type",{invalid:Eg,unknown:Fg,handlers:{comment:Vh,doctype:Zh,element:_g,raw:xg,root:kg,text:ol}});function Eg(e){throw new Error("Expected node, not `"+e+"`")}function Fg(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const $g={},jg={},Sg=[];function Ag(e,t){const n=t||$g,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:Tg,all:Rg,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||bh,characterReferences:n.characterReferences||jg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nl:Fh,quote:a,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Tg(e,t,n){return Cg(e,t,n,this)}function Rg(e){const t=[],n=e&&e.children||Sg;let a=-1;for(;++a<n.length;)t[a]=this.one(n[a],a,e);return t.join("")}function fa(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function Ge(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Og(e){return Array.isArray(e)?e:[e]}async function cl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Fi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ig(e){return e==="ansi"||Fi(e)}function $i(e){return e==="none"}function Ng(e){return $i(e)}function ll(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 a of n)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function Ra(e,t=!1){const n=e.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function Lg(e){const t=Ra(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const o of t){if(i<o.length)break;i-=o.length,s++}return{line:s,character:i}}function a(r,i){let s=0;for(let o=0;o<r;o++)s+=t[o].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:a}}const ji="light-dark()",Pg=["color","background-color"];function Dg(e,t){let n=0;const a=[];for(const r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a}function Mg(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((a,r)=>a-r);return n.length?e.map(a=>a.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,o)=>s-o);return i.length?Dg(r,i):r})):e}function qg(e,t,n,a,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>ba(e.variants[u])),o=new Set(s.flatMap(u=>Object.keys(u))),c={},l=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of o){const m=u[d]||"inherit";if(p===0&&a&&Pg.includes(d))if(a===ji&&s.length>1){const g=t.findIndex(_=>_==="light"),v=t.findIndex(_=>_==="dark");if(g===-1||v===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=s[g][d]||"inherit",b=s[v][d]||"inherit";c[d]=`light-dark(${f}, ${b})`,r==="css-vars"&&(c[l(p,d)]=m)}else c[d]=m;else r==="css-vars"&&(c[l(p,d)]=m)}}),i.htmlStyle=c,i}function ba(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ee.Italic&&(t["font-style"]="italic"),e.fontStyle&ee.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ee.Underline&&n.push("underline"),e.fontStyle&ee.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function qr(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const ul=new WeakMap;function Oa(e,t){ul.set(e,t)}function _n(e){return ul.get(e)}class Ut{_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 Ut(Object.fromEntries(Og(n).map(a=>[a,Nr])),t)}constructor(...t){if(t.length===2){const[n,a]=t;this.lang=a,this._stacks=n}else{const[n,a,r]=t;this.lang=a,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return zg(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function zg(e){const t=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&a(r.parent)}return a(e),t}function Bg(e,t){if(!(e instanceof Ut))throw new Y("Invalid grammar state");return e.getInternalStack(t)}function Ug(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Y(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const o=r.lines[s.line];if(o===void 0)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let c=s.character;if(c<0&&(c=o.length+c),c<0||c>o.length)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${o.length}`);return{...s,character:c,offset:r.posToIndex(s.line,c)}}};const r=Lg(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:a(s.start),end:a(s.end)}));Gg(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return Mg(n,r)},code(n){if(!this.options.decorations?.length)return;const a=t(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new Y(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,p,d,m){const g=r[u];let v="",f=-1,b=-1;if(p===0&&(f=0),d===0&&(b=0),d===Number.POSITIVE_INFINITY&&(b=g.children.length),f===-1||b===-1)for(let w=0;w<g.children.length;w++)v+=pl(g.children[w]),f===-1&&v.length===p&&(f=w+1),b===-1&&v.length===d&&(b=w+1);if(f===-1)throw new Y(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(b===-1)throw new Y(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=g.children.slice(f,b);if(!m.alwaysWrap&&_.length===g.children.length)o(g,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")o(_[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:_};o(w,m,"wrapper"),g.children.splice(f,_.length,w)}}function s(u,p){r[u]=o(r[u],p,"line")}function o(u,p,d){const m=p.properties||{},g=p.transform||(v=>v);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&ll(u,p.properties.class),u=g(u,d)||u,u}const c=[],l=a.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of l){const{start:p,end:d}=u;if(p.line===d.line)i(p.line,p.character,d.character,u);else if(p.line<d.line){i(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)c.unshift(()=>s(m,u));i(d.line,0,d.character,u)}}c.forEach(u=>u())}}}function Gg(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Y(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=t+1;a<e.length;a++){const r=e[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,o=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||o||c){if(i&&s||o&&c||o&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Y(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function pl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(pl).join(""):""}const Hg=[Ug()];function _a(e){const t=Wg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Hg]}function Wg(e){const t=[],n=[],a=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:t,post:n,normal:a}}var it=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],er={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Vg(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const a=e.indexOf("m",n);if(a!==-1)return{sequence:e.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:e.length}}function Ts(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Zg(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)er[a]&&t.push({type:"setDecoration",value:er[a]});else if(a<=29){const r=er[a-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:it[a-30]}});else if(a===38){const r=Ts(e);r&&t.push({type:"setForegroundColor",value:r})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-40]}});else if(a===48){const r=Ts(e);r&&t.push({type:"setBackgroundColor",value:r})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:it[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-100+8]}})}return t}function Yg(){let e=null,t=null,n=new Set;return{parse(a){const r=[];let i=0;do{const s=Vg(a,i),o=s.sequence?a.substring(i,s.startPosition):a.substring(i);if(o.length>0&&r.push({value:o,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const c=Zg(s.sequence);for(const l of c)l.type==="resetAll"?(e=null,t=null,n.clear()):l.type==="resetForegroundColor"?e=null:l.type==="resetBackgroundColor"?t=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?e=l.value:l.type==="setBackgroundColor"?t=l.value:l.type==="setDecoration"&&n.add(l.value)}i=s.position}while(i<a.length);return r}}}var Xg={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Kg(e=Xg){function t(o){return e[o]}function n(o){return`#${o.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<it.length;l++)a.push(t(it[l]));let o=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)a.push(n([o[l],o[u],o[p]]));let c=8;for(let l=0;l<24;l++,c+=10)a.push(n([c,c,c]));return a}function i(o){return r()[o]}function s(o){switch(o.type){case"named":return t(o.name);case"rgb":return n(o.rgb);case"table":return i(o.index)}}return{value:s}}function Qg(e,t,n){const a=fa(e,n),r=Ra(t),i=Kg(Object.fromEntries(it.map(o=>[o,e.colors?.[`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`]]))),s=Yg();return r.map(o=>s.parse(o[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):e.bg,u=c.foreground?i.value(c.foreground):e.fg):(l=c.foreground?i.value(c.foreground):e.fg,u=c.background?i.value(c.background):void 0),l=Ge(l,a),u=Ge(u,a),c.decorations.has("dim")&&(l=Jg(l));let p=ee.None;return c.decorations.has("bold")&&(p|=ee.Bold),c.decorations.has("italic")&&(p|=ee.Italic),c.decorations.has("underline")&&(p|=ee.Underline),c.decorations.has("strikethrough")&&(p|=ee.Strikethrough),{content:c.value,offset:o[1],color:l,bgColor:u,fontStyle:p}}))}function Jg(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const a=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${a}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(a=>`${a}${a}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Si(e,t,n={}){const{lang:a="text",theme:r=e.getLoadedThemes()[0]}=n;if(Fi(a)||$i(r))return Ra(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:i,colorMap:s}=e.setTheme(r);if(a==="ansi")return Qg(i,t,n);const o=e.getLanguage(a);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Y(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Y(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return tf(t,o,i,s,n)}function ef(...e){if(e.length===2)return _n(e[1]);const[t,n,a={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=a;if(Fi(r)||$i(i))throw new Y("Plain language does not have grammar state");if(r==="ansi")throw new Y("ANSI language does not have grammar state");const{theme:s,colorMap:o}=t.setTheme(i),c=t.getLanguage(r);return new Ut(ya(n,c,s,o,a).stateStack,c.name,s.name)}function tf(e,t,n,a,r){const i=ya(e,t,n,a,r),s=new Ut(ya(e,t,n,a,r).stateStack,t.name,n.name);return Oa(i.tokens,s),i.tokens}function ya(e,t,n,a,r){const i=fa(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=r,c=Ra(e);let l=r.grammarState?Bg(r.grammarState,n.name)??Nr:r.grammarContextCode!=null?ya(r.grammarContextCode,t,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Nr,u=[];const p=[];for(let d=0,m=c.length;d<m;d++){const[g,v]=c[d];if(g===""){u=[],p.push([]);continue}if(s>0&&g.length>=s){u=[],p.push([{content:g,offset:v,color:"",fontStyle:0}]);continue}let f,b,_;r.includeExplanation&&(f=t.tokenizeLine(g,l,o),b=f.tokens,_=0);const w=t.tokenizeLine2(g,l,o),h=w.tokens.length/2;for(let C=0;C<h;C++){const k=w.tokens[2*C],$=C+1<h?w.tokens[2*C+2]:g.length;if(k===$)continue;const T=w.tokens[2*C+1],N=Ge(a[Lt.getForeground(T)],i),I=Lt.getFontStyle(T),D={content:g.substring(k,$),offset:v+k,color:N,fontStyle:I};if(r.includeExplanation){const R=[];if(r.includeExplanation!=="scopeName")for(const q of n.settings){let U;switch(typeof q.scope){case"string":U=q.scope.split(/,/).map(G=>G.trim());break;case"object":U=q.scope;break;default:continue}R.push({settings:q,selectors:U.map(G=>G.split(/ /))})}D.explanation=[];let L=0;for(;k+L<$;){const q=b[_],U=g.substring(q.startIndex,q.endIndex);L+=U.length,D.explanation.push({content:U,scopes:r.includeExplanation==="scopeName"?nf(q.scopes):af(R,q.scopes)}),_+=1}}u.push(D)}p.push(u),u=[],l=w.ruleStack}return{tokens:p,stateStack:l}}function nf(e){return e.map(t=>({scopeName:t}))}function af(e,t){const n=[];for(let a=0,r=t.length;a<r;a++){const i=t[a];n[a]={scopeName:i,themeMatches:sf(e,i,t.slice(0,a))}}return n}function Rs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function rf(e,t,n){if(!Rs(e[e.length-1],t))return!1;let a=e.length-2,r=n.length-1;for(;a>=0&&r>=0;)Rs(e[a],n[r])&&(a-=1),r-=1;return a===-1}function sf(e,t,n){const a=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(rf(s,t,n)){a.push(i);break}return a}function dl(e,t,n){const a=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),r=a.map(c=>{const l=Si(e,t,{...n,theme:c.theme}),u=_n(l),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:l,state:u,theme:p}}),i=of(...r.map(c=>c.tokens)),s=i[0].map((c,l)=>c.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((m,g)=>{const{content:v,explanation:f,offset:b,..._}=m[l][p];d.variants[a[g].color]=_}),d})),o=r[0].state?new Ut(Object.fromEntries(r.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),r[0].state.lang):void 0;return o&&Oa(s,o),s}function of(...e){const t=e.map(()=>[]),n=e.length;for(let a=0;a<e[0].length;a++){const r=e.map(c=>c[a]),i=t.map(()=>[]);t.forEach((c,l)=>c.push(i[l]));const s=r.map(()=>0),o=r.map(c=>c[0]);for(;o.every(c=>c);){const c=Math.min(...o.map(l=>l.content.length));for(let l=0;l<n;l++){const u=o[l];u.content.length===c?(i[l].push(u),s[l]+=1,o[l]=r[l][s[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),o[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return t}function va(e,t,n){let a,r,i,s,o,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,_)=>b.color===l?-1:_.color===l?1:0);if(d.length===0)throw new Y("`themes` option must not be empty");const m=dl(e,t,n);if(c=_n(m),l&&ji!==l&&!d.find(b=>b.color===l))throw new Y(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=d.map(b=>e.getTheme(b.theme)),v=d.map(b=>b.color);i=m.map(b=>b.map(_=>qg(_,v,u,l,p))),c&&Oa(i,c);const f=d.map(b=>fa(b.theme,n));r=Os(d,g,f,u,l,"fg",p),a=Os(d,g,f,u,l,"bg",p),s=`shiki-themes ${g.map(b=>b.name).join(" ")}`,o=l?void 0:[r,a].join(";")}else if("theme"in n){const l=fa(n.theme,n);i=Si(e,t,n);const u=e.getTheme(n.theme);a=Ge(u.bg,l),r=Ge(u.fg,l),s=u.name,c=_n(i)}else throw new Y("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:s,rootStyle:o,grammarState:c}}function Os(e,t,n,a,r,i,s){return e.map((o,c)=>{const l=Ge(t[c][i],n[c])||"inherit",u=`${a+o.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===ji&&e.length>1){const p=e.findIndex(v=>v.color==="light"),d=e.findIndex(v=>v.color==="dark");if(p===-1||d===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=Ge(t[p][i],n[p])||"inherit",g=Ge(t[d][i],n[d])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return s==="css-vars"?u:null}).filter(o=>!!o).join(";")}function wa(e,t,n,a={meta:{},options:n,codeToHast:(r,i)=>wa(e,r,i),codeToTokens:(r,i)=>va(e,r,i)}){let r=t;for(const g of _a(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:s,bg:o,themeName:c,rootStyle:l,grammarState:u}=va(e,r,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?i=lf(i):p==="never"&&(i=uf(i)),d&&(i=pf(i));const m={...a,get source(){return r}};for(const g of _a(n))i=g.tokens?.call(m,i)||i;return cf(i,{...n,fg:s,bg:o,themeName:c,rootStyle:l},m,u)}function cf(e,t,n,a=_n(e)){const r=_a(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:c="0"}=t;let l={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([g])=>!g.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:i};const p=[],d={...n,structure:o,addClassToHast:ll,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return l},get code(){return u},get lines(){return p}};if(e.forEach((g,v)=>{v&&(o==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
-`}));let f={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of g){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const h=qr(_.htmlStyle||ba(_));h&&(w.properties.style=h);for(const C of r)w=C?.span?.call(d,w,v+1,b,f,_)||w;o==="inline"?s.children.push(w):o==="classic"&&f.children.push(w),b+=_.content.length}if(o==="classic"){for(const _ of r)f=_?.line?.call(d,f,v+1)||f;p.push(f),i.push(f)}}),o==="classic"){for(const g of r)u=g?.code?.call(d,u)||u;l.children.push(u);for(const g of r)l=g?.pre?.call(d,l)||l;s.children.push(l)}let m=s;for(const g of r)m=g?.root?.call(d,m)||m;return a&&Oa(m,a),m}function lf(e){return e.map(t=>{const n=[];let a="",r=0;return t.forEach((i,s)=>{const c=!(i.fontStyle&&(i.fontStyle&ee.Underline||i.fontStyle&ee.Strikethrough));c&&i.content.match(/^\s+$/)&&t[s+1]?(r||(r=i.offset),a+=i.content):a?(c?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=0,a=""):n.push(i)}),n})}function uf(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,s]=a;if(!r&&!s)return n;const o=[{...n,offset:n.offset+r.length,content:i}];return r&&o.unshift({content:r,offset:n.offset}),s&&o.push({content:s,offset:n.offset+r.length+i.length}),o}))}function pf(e){return e.map(t=>{const n=[];for(const a of t){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=qr(r.htmlStyle||ba(r)),s=qr(a.htmlStyle||ba(a)),o=r.fontStyle&&(r.fontStyle&ee.Underline||r.fontStyle&ee.Strikethrough),c=a.fontStyle&&(a.fontStyle&ee.Underline||a.fontStyle&ee.Strikethrough);!o&&!c&&i===s?r.content+=a.content:n.push({...a})}return n})}const df=Ag;function mf(e,t,n){const a={meta:{},options:n,codeToHast:(i,s)=>wa(e,i,s),codeToTokens:(i,s)=>va(e,i,s)};let r=df(wa(e,t,n,a));for(const i of _a(n))r=i.postprocess?.call(a,r,n)||r;return r}const Is={light:"#333333",dark:"#bbbbbb"},Ns={light:"#fffffe",dark:"#1e1e1e"},Ls="__shiki_resolved";function Ai(e){if(e?.[Ls])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:a}=t;if(!n||!a){const o=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;o?.settings?.foreground&&(a=o.settings.foreground),o?.settings?.background&&(n=o.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),a||(a=t.type==="light"?Is.light:Is.dark),n||(n=t.type==="light"?Ns.light:Ns.dark),t.fg=a,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 r=0;const i=new Map;function s(o){if(i.has(o))return i.get(o);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?s(o):(i.set(o,c),c)}t.settings=t.settings.map(o=>{const c=o.settings?.foreground&&!o.settings.foreground.startsWith("#"),l=o.settings?.background&&!o.settings.background.startsWith("#");if(!c&&!l)return o;const u={...o,settings:{...o.settings}};if(c){const p=s(o.settings.foreground);t.colorReplacements[p]=o.settings.foreground,u.settings.foreground=p}if(l){const p=s(o.settings.background);t.colorReplacements[p]=o.settings.background,u.settings.background=p}return u});for(const o of Object.keys(t.colors||{}))if((o==="editor.foreground"||o==="editor.background"||o.startsWith("terminal.ansi"))&&!t.colors[o]?.startsWith("#")){const c=s(t.colors[o]);t.colorReplacements[c]=t.colors[o],t.colors[o]=c}return Object.defineProperty(t,Ls,{enumerable:!1,writable:!1,value:!0}),t}async function hf(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ig(t)).map(async t=>await cl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function gf(e){return(await Promise.all(e.map(async n=>Ng(n)?null:Ai(await cl(n))))).filter(n=>!!n)}class $t extends Error{constructor(t){super(t),this.name="ShikiError"}}class ff extends fh{constructor(t,n,a,r={}){super(t),this._resolver=t,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=Ai(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=pa.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new $t(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const a={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,a);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,s])=>s&&s.embeddedLangs?.some(o=>a.map(([c])=>c).includes(o))).filter(i=>!a.includes(i));throw new $t(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class bf{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:a=>t.createScanner(a),createOnigString:a=>t.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let tn=0;function _f(e){tn+=1,e.warnings!==!1&&tn>=10&&tn%10===0&&console.warn(`[Shiki] ${tn} 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 $t("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Ai),r=new bf(e.engine,n),i=new ff(r,a,n,e.langAlias);let s;function o(_){f();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new $t(`Language \`${_}\` not found, you may need to load it first`);return w}function c(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};f();const w=i.getTheme(_);if(!w)throw new $t(`Theme \`${_}\` not found, you may need to load it first`);return w}function l(_){f();const w=c(_);s!==_&&(i.setTheme(w),s=_);const h=i.getColorMap();return{theme:w,colorMap:h}}function u(){return f(),i.getLoadedThemes()}function p(){return f(),i.getLoadedLanguages()}function d(..._){f(),i.loadLanguages(_.flat(1))}async function m(..._){return d(await hf(_))}function g(..._){f();for(const w of _.flat(1))i.loadTheme(w)}async function v(..._){return f(),g(await gf(_))}function f(){if(t)throw new $t("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),tn-=1)}return{setTheme:l,getTheme:c,getLanguage:o,getLoadedThemes:u,getLoadedLanguages:p,loadLanguage:m,loadLanguageSync:d,loadTheme:v,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}function yf(e){const t=_f(e);return{getLastGrammarState:(...n)=>ef(t,...n),codeToTokensBase:(n,a)=>Si(t,n,a),codeToTokensWithThemes:(n,a)=>dl(t,n,a),codeToTokens:(n,a)=>va(t,n,a),codeToHast:(n,a)=>wa(t,n,a),codeToHtml:(n,a)=>mf(t,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Gt(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function vf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Ti=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),X=String.raw;function Ht(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ml=X`\[\^?`,hl=`c.? | C(?:-.?)?|${X`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${X`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${X`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${X`o\{[^\}]*\}?`}|${X`\d{1,3}`}`,Ri=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Xn=new RegExp(X`
+\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yg(e,t,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let s=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const o=[];let c;r.space==="html"&&e.tagName==="svg"&&(a.schema=nl);const l=vg(a,e.properties),u=a.all(r.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=r,u&&(s=!1),(l||!i||!mg(e,t,n))&&(o.push("<",e.tagName,l?" "+l:""),s&&(r.space==="svg"||a.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!a.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!Ei(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function vg(e,t){const n=[];let a=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=wg(e,r,t[r]);i&&n.push(i)}}for(;++a<n.length;){const i=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function wg(e,t,n){const a=Ch(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=St(a.attribute,Object.assign({},e.settings.characterReferences,{subset:Yn.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?Xh:Kh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(o=St(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yn.unquoted[r][i]}))),o!==n&&(e.settings.quoteSmart&&$s(n,s)>$s(n,e.alternative)&&(s=e.alternative),o=s+St(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Yn.single:Yn.double)[r][i],attribute:!0}))+s),c+(o&&"="+o))}const xg=["<","&"];function ol(e,t,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:St(e.value,Object.assign({},a.settings.characterReferences,{subset:xg}))}function kg(e,t,n,a){return a.settings.allowDangerousHtml?e.value:ol(e,t,n,a)}function Cg(e,t,n,a){return a.all(e)}const Eg=jh("type",{invalid:Fg,unknown:$g,handlers:{comment:Zh,doctype:Yh,element:yg,raw:kg,root:Cg,text:ol}});function Fg(e){throw new Error("Expected node, not `"+e+"`")}function $g(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const jg={},Sg={},Ag=[];function Tg(e,t){const n=t||jg,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:Rg,all:Og,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||_h,characterReferences:n.characterReferences||Sg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nl:$h,quote:a,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Rg(e,t,n){return Eg(e,t,n,this)}function Og(e){const t=[],n=e&&e.children||Ag;let a=-1;for(;++a<n.length;)t[a]=this.one(n[a],a,e);return t.join("")}function fa(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function Ge(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ig(e){return Array.isArray(e)?e:[e]}async function cl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Fi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ng(e){return e==="ansi"||Fi(e)}function $i(e){return e==="none"}function Lg(e){return $i(e)}function ll(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 a of n)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function Ra(e,t=!1){const n=e.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function Pg(e){const t=Ra(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const o of t){if(i<o.length)break;i-=o.length,s++}return{line:s,character:i}}function a(r,i){let s=0;for(let o=0;o<r;o++)s+=t[o].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:a}}const ji="light-dark()",Dg=["color","background-color"];function Mg(e,t){let n=0;const a=[];for(const r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a}function qg(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((a,r)=>a-r);return n.length?e.map(a=>a.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,o)=>s-o);return i.length?Mg(r,i):r})):e}function zg(e,t,n,a,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>ba(e.variants[u])),o=new Set(s.flatMap(u=>Object.keys(u))),c={},l=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of o){const m=u[d]||"inherit";if(p===0&&a&&Dg.includes(d))if(a===ji&&s.length>1){const g=t.findIndex(_=>_==="light"),v=t.findIndex(_=>_==="dark");if(g===-1||v===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=s[g][d]||"inherit",b=s[v][d]||"inherit";c[d]=`light-dark(${f}, ${b})`,r==="css-vars"&&(c[l(p,d)]=m)}else c[d]=m;else r==="css-vars"&&(c[l(p,d)]=m)}}),i.htmlStyle=c,i}function ba(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ee.Italic&&(t["font-style"]="italic"),e.fontStyle&ee.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ee.Underline&&n.push("underline"),e.fontStyle&ee.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function qr(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const ul=new WeakMap;function Oa(e,t){ul.set(e,t)}function yn(e){return ul.get(e)}class Gt{_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 Gt(Object.fromEntries(Ig(n).map(a=>[a,Nr])),t)}constructor(...t){if(t.length===2){const[n,a]=t;this.lang=a,this._stacks=n}else{const[n,a,r]=t;this.lang=a,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Bg(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Bg(e){const t=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&a(r.parent)}return a(e),t}function Ug(e,t){if(!(e instanceof Gt))throw new Y("Invalid grammar state");return e.getInternalStack(t)}function Gg(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Y(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const o=r.lines[s.line];if(o===void 0)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let c=s.character;if(c<0&&(c=o.length+c),c<0||c>o.length)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${o.length}`);return{...s,character:c,offset:r.posToIndex(s.line,c)}}};const r=Pg(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:a(s.start),end:a(s.end)}));Hg(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return qg(n,r)},code(n){if(!this.options.decorations?.length)return;const a=t(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new Y(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,p,d,m){const g=r[u];let v="",f=-1,b=-1;if(p===0&&(f=0),d===0&&(b=0),d===Number.POSITIVE_INFINITY&&(b=g.children.length),f===-1||b===-1)for(let w=0;w<g.children.length;w++)v+=pl(g.children[w]),f===-1&&v.length===p&&(f=w+1),b===-1&&v.length===d&&(b=w+1);if(f===-1)throw new Y(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(b===-1)throw new Y(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=g.children.slice(f,b);if(!m.alwaysWrap&&_.length===g.children.length)o(g,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")o(_[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:_};o(w,m,"wrapper"),g.children.splice(f,_.length,w)}}function s(u,p){r[u]=o(r[u],p,"line")}function o(u,p,d){const m=p.properties||{},g=p.transform||(v=>v);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&ll(u,p.properties.class),u=g(u,d)||u,u}const c=[],l=a.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of l){const{start:p,end:d}=u;if(p.line===d.line)i(p.line,p.character,d.character,u);else if(p.line<d.line){i(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)c.unshift(()=>s(m,u));i(d.line,0,d.character,u)}}c.forEach(u=>u())}}}function Hg(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Y(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=t+1;a<e.length;a++){const r=e[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,o=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||o||c){if(i&&s||o&&c||o&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Y(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function pl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(pl).join(""):""}const Wg=[Gg()];function _a(e){const t=Vg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Wg]}function Vg(e){const t=[],n=[],a=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:t,post:n,normal:a}}var it=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],er={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Zg(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const a=e.indexOf("m",n);if(a!==-1)return{sequence:e.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:e.length}}function Ts(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Yg(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)er[a]&&t.push({type:"setDecoration",value:er[a]});else if(a<=29){const r=er[a-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:it[a-30]}});else if(a===38){const r=Ts(e);r&&t.push({type:"setForegroundColor",value:r})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-40]}});else if(a===48){const r=Ts(e);r&&t.push({type:"setBackgroundColor",value:r})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:it[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-100+8]}})}return t}function Xg(){let e=null,t=null,n=new Set;return{parse(a){const r=[];let i=0;do{const s=Zg(a,i),o=s.sequence?a.substring(i,s.startPosition):a.substring(i);if(o.length>0&&r.push({value:o,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const c=Yg(s.sequence);for(const l of c)l.type==="resetAll"?(e=null,t=null,n.clear()):l.type==="resetForegroundColor"?e=null:l.type==="resetBackgroundColor"?t=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?e=l.value:l.type==="setBackgroundColor"?t=l.value:l.type==="setDecoration"&&n.add(l.value)}i=s.position}while(i<a.length);return r}}}var Kg={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Qg(e=Kg){function t(o){return e[o]}function n(o){return`#${o.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<it.length;l++)a.push(t(it[l]));let o=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)a.push(n([o[l],o[u],o[p]]));let c=8;for(let l=0;l<24;l++,c+=10)a.push(n([c,c,c]));return a}function i(o){return r()[o]}function s(o){switch(o.type){case"named":return t(o.name);case"rgb":return n(o.rgb);case"table":return i(o.index)}}return{value:s}}function Jg(e,t,n){const a=fa(e,n),r=Ra(t),i=Qg(Object.fromEntries(it.map(o=>[o,e.colors?.[`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`]]))),s=Xg();return r.map(o=>s.parse(o[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):e.bg,u=c.foreground?i.value(c.foreground):e.fg):(l=c.foreground?i.value(c.foreground):e.fg,u=c.background?i.value(c.background):void 0),l=Ge(l,a),u=Ge(u,a),c.decorations.has("dim")&&(l=ef(l));let p=ee.None;return c.decorations.has("bold")&&(p|=ee.Bold),c.decorations.has("italic")&&(p|=ee.Italic),c.decorations.has("underline")&&(p|=ee.Underline),c.decorations.has("strikethrough")&&(p|=ee.Strikethrough),{content:c.value,offset:o[1],color:l,bgColor:u,fontStyle:p}}))}function ef(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const a=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${a}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(a=>`${a}${a}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Si(e,t,n={}){const{lang:a="text",theme:r=e.getLoadedThemes()[0]}=n;if(Fi(a)||$i(r))return Ra(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:i,colorMap:s}=e.setTheme(r);if(a==="ansi")return Jg(i,t,n);const o=e.getLanguage(a);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Y(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Y(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return nf(t,o,i,s,n)}function tf(...e){if(e.length===2)return yn(e[1]);const[t,n,a={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=a;if(Fi(r)||$i(i))throw new Y("Plain language does not have grammar state");if(r==="ansi")throw new Y("ANSI language does not have grammar state");const{theme:s,colorMap:o}=t.setTheme(i),c=t.getLanguage(r);return new Gt(ya(n,c,s,o,a).stateStack,c.name,s.name)}function nf(e,t,n,a,r){const i=ya(e,t,n,a,r),s=new Gt(ya(e,t,n,a,r).stateStack,t.name,n.name);return Oa(i.tokens,s),i.tokens}function ya(e,t,n,a,r){const i=fa(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=r,c=Ra(e);let l=r.grammarState?Ug(r.grammarState,n.name)??Nr:r.grammarContextCode!=null?ya(r.grammarContextCode,t,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Nr,u=[];const p=[];for(let d=0,m=c.length;d<m;d++){const[g,v]=c[d];if(g===""){u=[],p.push([]);continue}if(s>0&&g.length>=s){u=[],p.push([{content:g,offset:v,color:"",fontStyle:0}]);continue}let f,b,_;r.includeExplanation&&(f=t.tokenizeLine(g,l,o),b=f.tokens,_=0);const w=t.tokenizeLine2(g,l,o),h=w.tokens.length/2;for(let C=0;C<h;C++){const k=w.tokens[2*C],$=C+1<h?w.tokens[2*C+2]:g.length;if(k===$)continue;const T=w.tokens[2*C+1],N=Ge(a[Lt.getForeground(T)],i),I=Lt.getFontStyle(T),D={content:g.substring(k,$),offset:v+k,color:N,fontStyle:I};if(r.includeExplanation){const R=[];if(r.includeExplanation!=="scopeName")for(const q of n.settings){let U;switch(typeof q.scope){case"string":U=q.scope.split(/,/).map(G=>G.trim());break;case"object":U=q.scope;break;default:continue}R.push({settings:q,selectors:U.map(G=>G.split(/ /))})}D.explanation=[];let L=0;for(;k+L<$;){const q=b[_],U=g.substring(q.startIndex,q.endIndex);L+=U.length,D.explanation.push({content:U,scopes:r.includeExplanation==="scopeName"?af(q.scopes):rf(R,q.scopes)}),_+=1}}u.push(D)}p.push(u),u=[],l=w.ruleStack}return{tokens:p,stateStack:l}}function af(e){return e.map(t=>({scopeName:t}))}function rf(e,t){const n=[];for(let a=0,r=t.length;a<r;a++){const i=t[a];n[a]={scopeName:i,themeMatches:of(e,i,t.slice(0,a))}}return n}function Rs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function sf(e,t,n){if(!Rs(e[e.length-1],t))return!1;let a=e.length-2,r=n.length-1;for(;a>=0&&r>=0;)Rs(e[a],n[r])&&(a-=1),r-=1;return a===-1}function of(e,t,n){const a=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(sf(s,t,n)){a.push(i);break}return a}function dl(e,t,n){const a=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),r=a.map(c=>{const l=Si(e,t,{...n,theme:c.theme}),u=yn(l),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:l,state:u,theme:p}}),i=cf(...r.map(c=>c.tokens)),s=i[0].map((c,l)=>c.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((m,g)=>{const{content:v,explanation:f,offset:b,..._}=m[l][p];d.variants[a[g].color]=_}),d})),o=r[0].state?new Gt(Object.fromEntries(r.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),r[0].state.lang):void 0;return o&&Oa(s,o),s}function cf(...e){const t=e.map(()=>[]),n=e.length;for(let a=0;a<e[0].length;a++){const r=e.map(c=>c[a]),i=t.map(()=>[]);t.forEach((c,l)=>c.push(i[l]));const s=r.map(()=>0),o=r.map(c=>c[0]);for(;o.every(c=>c);){const c=Math.min(...o.map(l=>l.content.length));for(let l=0;l<n;l++){const u=o[l];u.content.length===c?(i[l].push(u),s[l]+=1,o[l]=r[l][s[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),o[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return t}function va(e,t,n){let a,r,i,s,o,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,_)=>b.color===l?-1:_.color===l?1:0);if(d.length===0)throw new Y("`themes` option must not be empty");const m=dl(e,t,n);if(c=yn(m),l&&ji!==l&&!d.find(b=>b.color===l))throw new Y(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=d.map(b=>e.getTheme(b.theme)),v=d.map(b=>b.color);i=m.map(b=>b.map(_=>zg(_,v,u,l,p))),c&&Oa(i,c);const f=d.map(b=>fa(b.theme,n));r=Os(d,g,f,u,l,"fg",p),a=Os(d,g,f,u,l,"bg",p),s=`shiki-themes ${g.map(b=>b.name).join(" ")}`,o=l?void 0:[r,a].join(";")}else if("theme"in n){const l=fa(n.theme,n);i=Si(e,t,n);const u=e.getTheme(n.theme);a=Ge(u.bg,l),r=Ge(u.fg,l),s=u.name,c=yn(i)}else throw new Y("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:s,rootStyle:o,grammarState:c}}function Os(e,t,n,a,r,i,s){return e.map((o,c)=>{const l=Ge(t[c][i],n[c])||"inherit",u=`${a+o.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===ji&&e.length>1){const p=e.findIndex(v=>v.color==="light"),d=e.findIndex(v=>v.color==="dark");if(p===-1||d===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=Ge(t[p][i],n[p])||"inherit",g=Ge(t[d][i],n[d])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return s==="css-vars"?u:null}).filter(o=>!!o).join(";")}function wa(e,t,n,a={meta:{},options:n,codeToHast:(r,i)=>wa(e,r,i),codeToTokens:(r,i)=>va(e,r,i)}){let r=t;for(const g of _a(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:s,bg:o,themeName:c,rootStyle:l,grammarState:u}=va(e,r,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?i=uf(i):p==="never"&&(i=pf(i)),d&&(i=df(i));const m={...a,get source(){return r}};for(const g of _a(n))i=g.tokens?.call(m,i)||i;return lf(i,{...n,fg:s,bg:o,themeName:c,rootStyle:l},m,u)}function lf(e,t,n,a=yn(e)){const r=_a(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:c="0"}=t;let l={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([g])=>!g.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:i};const p=[],d={...n,structure:o,addClassToHast:ll,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return l},get code(){return u},get lines(){return p}};if(e.forEach((g,v)=>{v&&(o==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
+`}));let f={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of g){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const h=qr(_.htmlStyle||ba(_));h&&(w.properties.style=h);for(const C of r)w=C?.span?.call(d,w,v+1,b,f,_)||w;o==="inline"?s.children.push(w):o==="classic"&&f.children.push(w),b+=_.content.length}if(o==="classic"){for(const _ of r)f=_?.line?.call(d,f,v+1)||f;p.push(f),i.push(f)}}),o==="classic"){for(const g of r)u=g?.code?.call(d,u)||u;l.children.push(u);for(const g of r)l=g?.pre?.call(d,l)||l;s.children.push(l)}let m=s;for(const g of r)m=g?.root?.call(d,m)||m;return a&&Oa(m,a),m}function uf(e){return e.map(t=>{const n=[];let a="",r=0;return t.forEach((i,s)=>{const c=!(i.fontStyle&&(i.fontStyle&ee.Underline||i.fontStyle&ee.Strikethrough));c&&i.content.match(/^\s+$/)&&t[s+1]?(r||(r=i.offset),a+=i.content):a?(c?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=0,a=""):n.push(i)}),n})}function pf(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,s]=a;if(!r&&!s)return n;const o=[{...n,offset:n.offset+r.length,content:i}];return r&&o.unshift({content:r,offset:n.offset}),s&&o.push({content:s,offset:n.offset+r.length+i.length}),o}))}function df(e){return e.map(t=>{const n=[];for(const a of t){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=qr(r.htmlStyle||ba(r)),s=qr(a.htmlStyle||ba(a)),o=r.fontStyle&&(r.fontStyle&ee.Underline||r.fontStyle&ee.Strikethrough),c=a.fontStyle&&(a.fontStyle&ee.Underline||a.fontStyle&ee.Strikethrough);!o&&!c&&i===s?r.content+=a.content:n.push({...a})}return n})}const mf=Tg;function hf(e,t,n){const a={meta:{},options:n,codeToHast:(i,s)=>wa(e,i,s),codeToTokens:(i,s)=>va(e,i,s)};let r=mf(wa(e,t,n,a));for(const i of _a(n))r=i.postprocess?.call(a,r,n)||r;return r}const Is={light:"#333333",dark:"#bbbbbb"},Ns={light:"#fffffe",dark:"#1e1e1e"},Ls="__shiki_resolved";function Ai(e){if(e?.[Ls])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:a}=t;if(!n||!a){const o=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;o?.settings?.foreground&&(a=o.settings.foreground),o?.settings?.background&&(n=o.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),a||(a=t.type==="light"?Is.light:Is.dark),n||(n=t.type==="light"?Ns.light:Ns.dark),t.fg=a,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 r=0;const i=new Map;function s(o){if(i.has(o))return i.get(o);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?s(o):(i.set(o,c),c)}t.settings=t.settings.map(o=>{const c=o.settings?.foreground&&!o.settings.foreground.startsWith("#"),l=o.settings?.background&&!o.settings.background.startsWith("#");if(!c&&!l)return o;const u={...o,settings:{...o.settings}};if(c){const p=s(o.settings.foreground);t.colorReplacements[p]=o.settings.foreground,u.settings.foreground=p}if(l){const p=s(o.settings.background);t.colorReplacements[p]=o.settings.background,u.settings.background=p}return u});for(const o of Object.keys(t.colors||{}))if((o==="editor.foreground"||o==="editor.background"||o.startsWith("terminal.ansi"))&&!t.colors[o]?.startsWith("#")){const c=s(t.colors[o]);t.colorReplacements[c]=t.colors[o],t.colors[o]=c}return Object.defineProperty(t,Ls,{enumerable:!1,writable:!1,value:!0}),t}async function gf(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ng(t)).map(async t=>await cl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function ff(e){return(await Promise.all(e.map(async n=>Lg(n)?null:Ai(await cl(n))))).filter(n=>!!n)}class $t extends Error{constructor(t){super(t),this.name="ShikiError"}}class bf extends bh{constructor(t,n,a,r={}){super(t),this._resolver=t,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=Ai(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=pa.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new $t(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const a={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,a);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,s])=>s&&s.embeddedLangs?.some(o=>a.map(([c])=>c).includes(o))).filter(i=>!a.includes(i));throw new $t(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class _f{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:a=>t.createScanner(a),createOnigString:a=>t.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let nn=0;function yf(e){nn+=1,e.warnings!==!1&&nn>=10&&nn%10===0&&console.warn(`[Shiki] ${nn} 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 $t("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Ai),r=new _f(e.engine,n),i=new bf(r,a,n,e.langAlias);let s;function o(_){f();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new $t(`Language \`${_}\` not found, you may need to load it first`);return w}function c(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};f();const w=i.getTheme(_);if(!w)throw new $t(`Theme \`${_}\` not found, you may need to load it first`);return w}function l(_){f();const w=c(_);s!==_&&(i.setTheme(w),s=_);const h=i.getColorMap();return{theme:w,colorMap:h}}function u(){return f(),i.getLoadedThemes()}function p(){return f(),i.getLoadedLanguages()}function d(..._){f(),i.loadLanguages(_.flat(1))}async function m(..._){return d(await gf(_))}function g(..._){f();for(const w of _.flat(1))i.loadTheme(w)}async function v(..._){return f(),g(await ff(_))}function f(){if(t)throw new $t("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),nn-=1)}return{setTheme:l,getTheme:c,getLanguage:o,getLoadedThemes:u,getLoadedLanguages:p,loadLanguage:m,loadLanguageSync:d,loadTheme:v,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}function vf(e){const t=yf(e);return{getLastGrammarState:(...n)=>tf(t,...n),codeToTokensBase:(n,a)=>Si(t,n,a),codeToTokensWithThemes:(n,a)=>dl(t,n,a),codeToTokens:(n,a)=>va(t,n,a),codeToHast:(n,a)=>wa(t,n,a),codeToHtml:(n,a)=>hf(t,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ht(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function wf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Ti=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),X=String.raw;function Wt(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ml=X`\[\^?`,hl=`c.? | C(?:-.?)?|${X`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${X`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${X`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${X`o\{[^\}]*\}?`}|${X`\d{1,3}`}`,Ri=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Xn=new RegExp(X`
\\ (?:
${hl}
| [gk]<[^>]*>?
@@ -44,8 +44,8 @@ ${n?'Expression: "'+n+`"
| ${ml}
| &&
| .
-`.replace(/\s+/g,""),"gsu");function wf(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 a=qf(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(p){r.push(p)},replaceCurrentModX(p){r[r.length-1]=p},singleline:n.rules.singleline};let s=[],o;for(Xn.lastIndex=0;o=Xn.exec(e);){const p=xf(i,e,o[0],Xn.lastIndex);p.tokens?s.push(...p.tokens):p.token&&s.push(p.token),p.lastIndex!==void 0&&(Xn.lastIndex=p.lastIndex)}const c=[];let l=0;s.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++l:p.raw==="("&&c.push(p)}),l||c.forEach((p,d)=>{p.kind="capturing",p.number=d+1});const u=l||c.length;return{tokens:s.map(p=>p.type==="EscapedNumber"?Bf(p,u):p).flat(),flags:a}}function xf(e,t,n,a){const[r,i]=n;if(n==="["||n==="[^"){const s=kf(t,n,a);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Ps(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Of(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fl(n)}}if(i==="K")return{token:bl("keep",n)};if(i==="N"||i==="R")return{token:st("newline",n,{negate:i==="N"})};if(i==="O")return{token:st("any",n)};if(i==="X")return{token:st("text_segment",n)};const s=gl(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(i==="*")return{token:Pf(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Lf(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Et("group",n)};if(n==="(?>")return{token:Et("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Et(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Et("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Et("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:Af(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
-`,a);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=a,{lastIndex:s.exec(t)?s.lastIndex:a}}}if(n===".")return{token:st("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":X`\A`,$:X`\Z`}[n]:n;return{token:Ps(s,n)}}return n==="|"?{token:Ef(n)}:Ri.test(n)?{tokens:Uf(n)}:{token:Ne(Gt(n),n)}}function kf(e,t,n){const a=[Ds(t[1]==="^",t)];let r=1,i;for(tr.lastIndex=n;i=tr.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")r++,a.push(Ds(s[1]==="^",s));else if(s==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Ne(93,s));else if(r--,a.push(Ff(s)),!r)break}else{const o=Cf(s);Array.isArray(o)?a.push(...o):a.push(o)}}return{tokens:a,lastIndex:tr.lastIndex||e.length}}function Cf(e){if(e[0]==="\\")return gl(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ti.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return st("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?$f(e):e==="&&"?jf(e):Ne(Gt(e),e)}function gl(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Nf(e);if("dDhHsSwW".includes(n))return Df(e);if(e.startsWith(X`\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 Mf(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const a=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(s=>{const o=[...i.encode(s)].map(c=>`\\x${c.toString(16)}`).join("");return Ne(Gt(s),o)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ne(zf(e),e);if(Ms.has(n))return Ne(Ms.get(n),e);if(/\d/.test(n))return Sf(t,e);if(e==="\\")throw new Error(X`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ne(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ef(e){return{type:"Alternator",raw:e}}function Ps(e,t){return{type:"Assertion",kind:e,raw:t}}function fl(e){return{type:"Backreference",raw:e}}function Ne(e,t){return{type:"Character",value:e,raw:t}}function Ff(e){return{type:"CharacterClassClose",raw:e}}function $f(e){return{type:"CharacterClassHyphen",raw:e}}function jf(e){return{type:"CharacterClassIntersector",raw:e}}function Ds(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function st(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function bl(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ht(n.flags),raw:t}}function Sf(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Af(e){return{type:"GroupClose",raw:e}}function Et(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Tf(e,t,n,a){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:a}}function Rf(e,t,n,a){return{type:"Quantifier",kind:e,min:t,max:n,raw:a}}function Of(e){return{type:"Subroutine",raw:e}}const If=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Ms=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Nf(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 Ne(Gt(t.toUpperCase())-64,e)}function Lf(e,t){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;a??="";const r=(t.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=zs(n),s=zs(a),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),bl("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,Et("group",e,{...(i||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function Pf(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:a,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,o,c]=i,l=If.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 o=="number"||!/^(?:[<>!=]=|[<>])$/.test(o))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return Tf(l,a??null,r?.split(",")??null,e)}function qs(e){let t=null,n,a;if(e[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||i&&+i>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(t="possessive",[n,a]=[a,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,a=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Rf(t,n,a,e)}function Df(e){const t=e[1].toLowerCase();return st({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Mf(e){const{p:t,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return st("property",e,{value:a,negate:t==="P"&&!n||t==="p"&&!!n})}function zs(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 qf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const a=e[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return t}function zf(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Bf(e,t){const{raw:n,inCharClass:a}=e,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[fl(n)];const i=[],s=r.match(/^[0-7]+|\d/g);for(let o=0;o<s.length;o++){const c=s[o];let l;if(o===0&&c!=="8"&&c!=="9"){if(l=parseInt(c,8),l>127)throw new Error(X`Octal encoded byte above 177 unsupported "${n}"`)}else l=Gt(c);i.push(Ne(l,(o===0?"\\":"")+c))}return i}function Uf(e){const t=[],n=new RegExp(Ri,"gy");let a;for(;a=n.exec(e);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:s,max:o}=i.groups;if(+s>+o&&r.endsWith("?")){n.lastIndex--,t.push(qs(r.slice(0,-1)));continue}}}t.push(qs(r))}return t}function _l(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(a=>t[a]===n[a])}function Gf(e){return Hf.has(e.type)}const Hf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function yl(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},a=wf(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(d,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=d,i.nextIndex++,g.type){case"Alternator":return ht();case"Assertion":return Wf(g);case"Backreference":return Vf(g,i);case"Character":return Ia(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return Zf(g,i,m);case"CharacterClassOpen":return Yf(g,i,m);case"CharacterSet":return Xf(g,i);case"Directive":return nb(g.kind,{flags:g.flags});case"GroupOpen":return Kf(g,i,m);case"NamedCallout":return rb(g.kind,g.tag,g.arguments);case"Quantifier":return Qf(g,i);case"Subroutine":return Jf(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=sb(ab(a.flags));let o=s.body[0];for(;i.nextIndex<a.tokens.length;){const d=r(o,{});d.type==="Alternative"?(s.body.push(d),o=d):o.body.push(d)}const{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:p}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of p)if(typeof d=="number"){if(d>c.length)throw new Error("Subroutine uses a group number that's not defined");d&&(c[d-1].isSubroutined=!0)}else if(u.has(d)){if(u.get(d).length>1)throw new Error(X`Subroutine uses a duplicate group name "\g<${d}>"`);u.get(d)[0].isSubroutined=!0}else throw new Error(X`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Wf({kind:e}){return zr(Ht({"^":"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===X`\B`||e===X`\Y`})}function Vf({raw:e},t){const n=/^\\k[<']/.test(e),a=n?e.slice(3,-1):e.slice(1),r=(i,s=!1)=>{const o=t.capturingGroups.length;let c=!1;if(i>o)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Br(s?o+1-i:i,{orphan:c})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${e}"`);return Br(a)}return r(+a)}function Zf(e,t,n){const{tokens:a,walk:r}=t,i=t.parent,s=i.body.at(-1),o=a[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&o&&o.type!=="CharacterClassOpen"&&o.type!=="CharacterClassClose"&&o.type!=="CharacterClassIntersector"){const c=r(i,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&c.type==="Character")return i.body.pop(),tb(s,c);throw new Error("Invalid character class range")}return Ia(Gt("-"))}function Yf({negate:e},t,n){const{tokens:a,walk:r}=t,i=a[t.nextIndex],s=[ra()];let o=Gs(i);for(;o.type!=="CharacterClassClose";){if(o.type==="CharacterClassIntersector")s.push(ra()),t.nextIndex++;else{const l=s.at(-1);l.body.push(r(l,n))}o=Gs(a[t.nextIndex],i)}const c=ra({negate:e});return s.length===1?c.body=s[0].body:(c.kind="intersection",c.body=s.map(l=>l.body.length===1?l.body[0]:l)),t.nextIndex++,c}function Xf({kind:e,negate:t,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s}=a;if(e==="property"){const o=Na(n);if(Ti.has(o)&&!s?.has(o))e="posix",n=o;else return Ft(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s})}return e==="posix"?ib(n,{negate:t}):Ur(e,{negate:t})}function Kf(e,t,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:s,walk:o}=t,c=ob(e),l=c.type==="AbsenceFunction",u=Us(c),p=u&&c.negate;if(c.type==="CapturingGroup"&&(r.push(c),c.name&&vf(i,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Hs(a[t.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")c.body.push(ht()),t.nextIndex++;else{const m=c.body.at(-1),g=o(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(m.body.push(g),(u||n.isInLookbehind)&&!s){const v="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(Bs(g)||g.type==="CapturingGroup")throw new Error(v)}else if(Bs(g)||Us(g)&&g.negate)throw new Error(v)}}d=Hs(a[t.nextIndex])}return t.nextIndex++,c}function Qf({kind:e,min:t,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!Gf(i))throw new Error("Quantifier requires a repeatable token");const s=wl(e,t,n,i);return r.body.pop(),s}function Jf({raw:e},t){const{capturingGroups:n,subroutines:a}=t;let r=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const o=+i.groups.num,c=n.length;if(t.hasNumberedRef=!0,r={"":o,"+":c+o,"-":c+1-o}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=xl(r);return a.push(s),s}function eb(e,t){return{type:"AbsenceFunction",kind:e,body:jn(t?.body)}}function ht(e){return{type:"Alternative",body:kl(e?.body)}}function zr(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Br(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function vl(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!cb(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:jn(t?.body)}}function Ia(e,t){const n={useLastValid:!1,...t};if(e>1114111){const a=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:e}}function ra(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:kl(e?.body)}}function tb(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ur(e,t){const n=!!t?.negate,a={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(a.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(a.variableLength=!0),a}function nb(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ht(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function ab(e){return{type:"Flags",...e}}function be(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:jn(e?.body)}}function at(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:jn(e?.body)}}function rb(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function ib(e,t){const n=!!t?.negate;if(!Ti.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function wl(e,t,n,a){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:a}}function sb(e,t){return{type:"Regex",body:jn(t?.body),flags:e}}function xl(e){return{type:"Subroutine",ref:e}}function Ft(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let a=n.unicodePropertyMap?.get(Na(e));if(!a){if(n.normalizeUnknownPropertyNames)a=lb(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(X`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:a??e,negate:n.negate}}function ob({flags:e,kind:t,name:n,negate:a,number:r}){switch(t){case"absence_repeater":return eb("repeater");case"atomic":return be({atomic:!0});case"capturing":return vl(r,{name:n});case"group":return be({flags:e});case"lookahead":case"lookbehind":return at({behind:t==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${t}"`)}}function jn(e){if(e===void 0)e=[ht()];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 kl(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 Bs(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Us(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function cb(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function lb(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 Na(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Gs(e,t){return Ht(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Hs(e){return Ht(e,"Unclosed group")}function pn(e,t,n=null){function a(i,s){for(let o=0;o<i.length;o++){const c=r(i[o],s,o,i);o=Math.max(-1,o+c)}}function r(i,s=null,o=null,c=null){let l=0,u=!1;const p={node:i,parent:s,key:o,container:c,root:e,remove(){Kn(c).splice(Math.max(0,xt(o)+l),1),l--,u=!0},removeAllNextSiblings(){return Kn(c).splice(xt(o)+1)},removeAllPrevSiblings(){const b=xt(o)+l;return l-=b,Kn(c).splice(0,Math.max(0,b))},replaceWith(b,_={}){const w=!!_.traverse;c?c[Math.max(0,xt(o)+l)]=b:Ht(s,"Can't replace root node")[o]=b,w&&r(b,s,o,c),u=!0},replaceWithMultiple(b,_={}){const w=!!_.traverse;if(Kn(c).splice(Math.max(0,xt(o)+l),1,...b),l+=b.length-1,w){let h=0;for(let C=0;C<b.length;C++)h+=r(b[C],s,xt(o)+C+h,c)}u=!0},skip(){u=!0}},{type:d}=i,m=t["*"],g=t[d],v=typeof m=="function"?m:m?.enter,f=typeof g=="function"?g:g?.enter;if(v?.(p,n),f?.(p,n),!u)switch(d){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return g?.exit?.(p,n),m?.exit?.(p,n),l}return r(e),e}function Kn(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function xt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const ub=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function pb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function db(e,t,n,a){return e.slice(0,t)+a+e.slice(t+n.length)}const de=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Oi(e,t,n,a){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let s=0,o="";for(const c of e.matchAll(r)){const{0:l,groups:{$skip:u}}=c;if(!u&&(!a||a===de.DEFAULT==!s)){n instanceof Function?o+=n(c,{context:s?de.CHAR_CLASS:de.DEFAULT,negated:i[i.length-1]}):o+=n;continue}l[0]==="["?(s++,i.push(l[1]==="^")):l==="]"&&s&&(s--,i.pop()),o+=l}return o}function Cl(e,t,n,a){Oi(e,t,n,a)}function mb(e,t,n=0,a){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,s;for(;s=r.exec(e);){const{0:o,groups:{$skip:c}}=s;if(!c&&(!a||a===de.DEFAULT==!i))return s;o==="["?i++:o==="]"&&i&&i--,r.lastIndex==s.index&&r.lastIndex++}return null}function Qn(e,t,n){return!!mb(e,t,0,n)}function hb(e,t){const n=/\\?./gsu;n.lastIndex=t;let a=e.length,r=0,i=1,s;for(;s=n.exec(e);){const[o]=s;if(o==="[")r++;else if(r)o==="]"&&r--;else if(o==="(")i++;else if(o===")"&&(i--,!i)){a=s.index;break}}return e.slice(t,a)}const Ws=new RegExp(String.raw`(?<noncapturingStart>${ub})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function gb(e,t){const n=t?.hiddenCaptures??[];let a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",s=[0],o=[];let c=0,l=0,u=NaN,p;do{p=!1;let d=0,m=0,g=!1,v;for(Ws.lastIndex=Number.isNaN(u)?0:u+i.length;v=Ws.exec(e);){const{0:f,index:b,groups:{capturingStart:_,noncapturingStart:w}}=v;if(f==="[")d++;else if(d)f==="]"&&d--;else if(f===r&&!g)u=b,g=!0;else if(g&&w)m++;else if(_)g?m++:(c++,s.push(c+l));else if(f===")"&&g){if(!m){l++;const h=c+l;if(e=`${e.slice(0,u)}${i}${e.slice(u+r.length,b)}))<$$${h}>)${e.slice(b+1)}`,p=!0,o.push(h),pb(n,h),a.size){const C=new Map;a.forEach((k,$)=>{C.set($>=h?$+1:$,k.map(T=>T>=h?T+1:T))}),a=C}break}m--}}}while(p);return n.push(...o),e=Oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const v=+m;if(v>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[v]}`}return`\\${g}`},de.DEFAULT),{pattern:e,captureTransfers:a,hiddenCaptures:n}}const El=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,nr=new RegExp(String.raw`
+`.replace(/\s+/g,""),"gsu");function xf(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 a=zf(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(p){r.push(p)},replaceCurrentModX(p){r[r.length-1]=p},singleline:n.rules.singleline};let s=[],o;for(Xn.lastIndex=0;o=Xn.exec(e);){const p=kf(i,e,o[0],Xn.lastIndex);p.tokens?s.push(...p.tokens):p.token&&s.push(p.token),p.lastIndex!==void 0&&(Xn.lastIndex=p.lastIndex)}const c=[];let l=0;s.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++l:p.raw==="("&&c.push(p)}),l||c.forEach((p,d)=>{p.kind="capturing",p.number=d+1});const u=l||c.length;return{tokens:s.map(p=>p.type==="EscapedNumber"?Uf(p,u):p).flat(),flags:a}}function kf(e,t,n,a){const[r,i]=n;if(n==="["||n==="[^"){const s=Cf(t,n,a);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Ps(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:If(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fl(n)}}if(i==="K")return{token:bl("keep",n)};if(i==="N"||i==="R")return{token:st("newline",n,{negate:i==="N"})};if(i==="O")return{token:st("any",n)};if(i==="X")return{token:st("text_segment",n)};const s=gl(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(i==="*")return{token:Df(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Pf(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Et("group",n)};if(n==="(?>")return{token:Et("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Et(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Et("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Et("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:Tf(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
+`,a);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=a,{lastIndex:s.exec(t)?s.lastIndex:a}}}if(n===".")return{token:st("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":X`\A`,$:X`\Z`}[n]:n;return{token:Ps(s,n)}}return n==="|"?{token:Ff(n)}:Ri.test(n)?{tokens:Gf(n)}:{token:Ne(Ht(n),n)}}function Cf(e,t,n){const a=[Ds(t[1]==="^",t)];let r=1,i;for(tr.lastIndex=n;i=tr.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")r++,a.push(Ds(s[1]==="^",s));else if(s==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Ne(93,s));else if(r--,a.push($f(s)),!r)break}else{const o=Ef(s);Array.isArray(o)?a.push(...o):a.push(o)}}return{tokens:a,lastIndex:tr.lastIndex||e.length}}function Ef(e){if(e[0]==="\\")return gl(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ti.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return st("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?jf(e):e==="&&"?Sf(e):Ne(Ht(e),e)}function gl(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Lf(e);if("dDhHsSwW".includes(n))return Mf(e);if(e.startsWith(X`\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 qf(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const a=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(s=>{const o=[...i.encode(s)].map(c=>`\\x${c.toString(16)}`).join("");return Ne(Ht(s),o)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ne(Bf(e),e);if(Ms.has(n))return Ne(Ms.get(n),e);if(/\d/.test(n))return Af(t,e);if(e==="\\")throw new Error(X`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ne(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ff(e){return{type:"Alternator",raw:e}}function Ps(e,t){return{type:"Assertion",kind:e,raw:t}}function fl(e){return{type:"Backreference",raw:e}}function Ne(e,t){return{type:"Character",value:e,raw:t}}function $f(e){return{type:"CharacterClassClose",raw:e}}function jf(e){return{type:"CharacterClassHyphen",raw:e}}function Sf(e){return{type:"CharacterClassIntersector",raw:e}}function Ds(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function st(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function bl(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Wt(n.flags),raw:t}}function Af(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Tf(e){return{type:"GroupClose",raw:e}}function Et(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Rf(e,t,n,a){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:a}}function Of(e,t,n,a){return{type:"Quantifier",kind:e,min:t,max:n,raw:a}}function If(e){return{type:"Subroutine",raw:e}}const Nf=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Ms=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Lf(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 Ne(Ht(t.toUpperCase())-64,e)}function Pf(e,t){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;a??="";const r=(t.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=zs(n),s=zs(a),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),bl("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,Et("group",e,{...(i||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function Df(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:a,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,o,c]=i,l=Nf.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 o=="number"||!/^(?:[<>!=]=|[<>])$/.test(o))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return Rf(l,a??null,r?.split(",")??null,e)}function qs(e){let t=null,n,a;if(e[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||i&&+i>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(t="possessive",[n,a]=[a,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,a=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Of(t,n,a,e)}function Mf(e){const t=e[1].toLowerCase();return st({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function qf(e){const{p:t,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return st("property",e,{value:a,negate:t==="P"&&!n||t==="p"&&!!n})}function zs(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 zf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const a=e[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return t}function Bf(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Uf(e,t){const{raw:n,inCharClass:a}=e,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[fl(n)];const i=[],s=r.match(/^[0-7]+|\d/g);for(let o=0;o<s.length;o++){const c=s[o];let l;if(o===0&&c!=="8"&&c!=="9"){if(l=parseInt(c,8),l>127)throw new Error(X`Octal encoded byte above 177 unsupported "${n}"`)}else l=Ht(c);i.push(Ne(l,(o===0?"\\":"")+c))}return i}function Gf(e){const t=[],n=new RegExp(Ri,"gy");let a;for(;a=n.exec(e);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:s,max:o}=i.groups;if(+s>+o&&r.endsWith("?")){n.lastIndex--,t.push(qs(r.slice(0,-1)));continue}}}t.push(qs(r))}return t}function _l(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(a=>t[a]===n[a])}function Hf(e){return Wf.has(e.type)}const Wf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function yl(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},a=xf(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(d,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=d,i.nextIndex++,g.type){case"Alternator":return ht();case"Assertion":return Vf(g);case"Backreference":return Zf(g,i);case"Character":return Ia(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return Yf(g,i,m);case"CharacterClassOpen":return Xf(g,i,m);case"CharacterSet":return Kf(g,i);case"Directive":return ab(g.kind,{flags:g.flags});case"GroupOpen":return Qf(g,i,m);case"NamedCallout":return ib(g.kind,g.tag,g.arguments);case"Quantifier":return Jf(g,i);case"Subroutine":return eb(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=ob(rb(a.flags));let o=s.body[0];for(;i.nextIndex<a.tokens.length;){const d=r(o,{});d.type==="Alternative"?(s.body.push(d),o=d):o.body.push(d)}const{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:p}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of p)if(typeof d=="number"){if(d>c.length)throw new Error("Subroutine uses a group number that's not defined");d&&(c[d-1].isSubroutined=!0)}else if(u.has(d)){if(u.get(d).length>1)throw new Error(X`Subroutine uses a duplicate group name "\g<${d}>"`);u.get(d)[0].isSubroutined=!0}else throw new Error(X`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Vf({kind:e}){return zr(Wt({"^":"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===X`\B`||e===X`\Y`})}function Zf({raw:e},t){const n=/^\\k[<']/.test(e),a=n?e.slice(3,-1):e.slice(1),r=(i,s=!1)=>{const o=t.capturingGroups.length;let c=!1;if(i>o)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Br(s?o+1-i:i,{orphan:c})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${e}"`);return Br(a)}return r(+a)}function Yf(e,t,n){const{tokens:a,walk:r}=t,i=t.parent,s=i.body.at(-1),o=a[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&o&&o.type!=="CharacterClassOpen"&&o.type!=="CharacterClassClose"&&o.type!=="CharacterClassIntersector"){const c=r(i,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&c.type==="Character")return i.body.pop(),nb(s,c);throw new Error("Invalid character class range")}return Ia(Ht("-"))}function Xf({negate:e},t,n){const{tokens:a,walk:r}=t,i=a[t.nextIndex],s=[ra()];let o=Gs(i);for(;o.type!=="CharacterClassClose";){if(o.type==="CharacterClassIntersector")s.push(ra()),t.nextIndex++;else{const l=s.at(-1);l.body.push(r(l,n))}o=Gs(a[t.nextIndex],i)}const c=ra({negate:e});return s.length===1?c.body=s[0].body:(c.kind="intersection",c.body=s.map(l=>l.body.length===1?l.body[0]:l)),t.nextIndex++,c}function Kf({kind:e,negate:t,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s}=a;if(e==="property"){const o=Na(n);if(Ti.has(o)&&!s?.has(o))e="posix",n=o;else return Ft(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s})}return e==="posix"?sb(n,{negate:t}):Ur(e,{negate:t})}function Qf(e,t,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:s,walk:o}=t,c=cb(e),l=c.type==="AbsenceFunction",u=Us(c),p=u&&c.negate;if(c.type==="CapturingGroup"&&(r.push(c),c.name&&wf(i,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Hs(a[t.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")c.body.push(ht()),t.nextIndex++;else{const m=c.body.at(-1),g=o(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(m.body.push(g),(u||n.isInLookbehind)&&!s){const v="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(Bs(g)||g.type==="CapturingGroup")throw new Error(v)}else if(Bs(g)||Us(g)&&g.negate)throw new Error(v)}}d=Hs(a[t.nextIndex])}return t.nextIndex++,c}function Jf({kind:e,min:t,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!Hf(i))throw new Error("Quantifier requires a repeatable token");const s=wl(e,t,n,i);return r.body.pop(),s}function eb({raw:e},t){const{capturingGroups:n,subroutines:a}=t;let r=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const o=+i.groups.num,c=n.length;if(t.hasNumberedRef=!0,r={"":o,"+":c+o,"-":c+1-o}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=xl(r);return a.push(s),s}function tb(e,t){return{type:"AbsenceFunction",kind:e,body:jn(t?.body)}}function ht(e){return{type:"Alternative",body:kl(e?.body)}}function zr(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Br(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function vl(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!lb(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:jn(t?.body)}}function Ia(e,t){const n={useLastValid:!1,...t};if(e>1114111){const a=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:e}}function ra(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:kl(e?.body)}}function nb(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ur(e,t){const n=!!t?.negate,a={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(a.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(a.variableLength=!0),a}function ab(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Wt(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function rb(e){return{type:"Flags",...e}}function be(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:jn(e?.body)}}function at(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:jn(e?.body)}}function ib(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function sb(e,t){const n=!!t?.negate;if(!Ti.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function wl(e,t,n,a){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:a}}function ob(e,t){return{type:"Regex",body:jn(t?.body),flags:e}}function xl(e){return{type:"Subroutine",ref:e}}function Ft(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let a=n.unicodePropertyMap?.get(Na(e));if(!a){if(n.normalizeUnknownPropertyNames)a=ub(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(X`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:a??e,negate:n.negate}}function cb({flags:e,kind:t,name:n,negate:a,number:r}){switch(t){case"absence_repeater":return tb("repeater");case"atomic":return be({atomic:!0});case"capturing":return vl(r,{name:n});case"group":return be({flags:e});case"lookahead":case"lookbehind":return at({behind:t==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${t}"`)}}function jn(e){if(e===void 0)e=[ht()];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 kl(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 Bs(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Us(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function lb(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function ub(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 Na(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Gs(e,t){return Wt(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Hs(e){return Wt(e,"Unclosed group")}function dn(e,t,n=null){function a(i,s){for(let o=0;o<i.length;o++){const c=r(i[o],s,o,i);o=Math.max(-1,o+c)}}function r(i,s=null,o=null,c=null){let l=0,u=!1;const p={node:i,parent:s,key:o,container:c,root:e,remove(){Kn(c).splice(Math.max(0,xt(o)+l),1),l--,u=!0},removeAllNextSiblings(){return Kn(c).splice(xt(o)+1)},removeAllPrevSiblings(){const b=xt(o)+l;return l-=b,Kn(c).splice(0,Math.max(0,b))},replaceWith(b,_={}){const w=!!_.traverse;c?c[Math.max(0,xt(o)+l)]=b:Wt(s,"Can't replace root node")[o]=b,w&&r(b,s,o,c),u=!0},replaceWithMultiple(b,_={}){const w=!!_.traverse;if(Kn(c).splice(Math.max(0,xt(o)+l),1,...b),l+=b.length-1,w){let h=0;for(let C=0;C<b.length;C++)h+=r(b[C],s,xt(o)+C+h,c)}u=!0},skip(){u=!0}},{type:d}=i,m=t["*"],g=t[d],v=typeof m=="function"?m:m?.enter,f=typeof g=="function"?g:g?.enter;if(v?.(p,n),f?.(p,n),!u)switch(d){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return g?.exit?.(p,n),m?.exit?.(p,n),l}return r(e),e}function Kn(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function xt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const pb=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function db(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mb(e,t,n,a){return e.slice(0,t)+a+e.slice(t+n.length)}const de=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Oi(e,t,n,a){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let s=0,o="";for(const c of e.matchAll(r)){const{0:l,groups:{$skip:u}}=c;if(!u&&(!a||a===de.DEFAULT==!s)){n instanceof Function?o+=n(c,{context:s?de.CHAR_CLASS:de.DEFAULT,negated:i[i.length-1]}):o+=n;continue}l[0]==="["?(s++,i.push(l[1]==="^")):l==="]"&&s&&(s--,i.pop()),o+=l}return o}function Cl(e,t,n,a){Oi(e,t,n,a)}function hb(e,t,n=0,a){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,s;for(;s=r.exec(e);){const{0:o,groups:{$skip:c}}=s;if(!c&&(!a||a===de.DEFAULT==!i))return s;o==="["?i++:o==="]"&&i&&i--,r.lastIndex==s.index&&r.lastIndex++}return null}function Qn(e,t,n){return!!hb(e,t,0,n)}function gb(e,t){const n=/\\?./gsu;n.lastIndex=t;let a=e.length,r=0,i=1,s;for(;s=n.exec(e);){const[o]=s;if(o==="[")r++;else if(r)o==="]"&&r--;else if(o==="(")i++;else if(o===")"&&(i--,!i)){a=s.index;break}}return e.slice(t,a)}const Ws=new RegExp(String.raw`(?<noncapturingStart>${pb})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function fb(e,t){const n=t?.hiddenCaptures??[];let a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",s=[0],o=[];let c=0,l=0,u=NaN,p;do{p=!1;let d=0,m=0,g=!1,v;for(Ws.lastIndex=Number.isNaN(u)?0:u+i.length;v=Ws.exec(e);){const{0:f,index:b,groups:{capturingStart:_,noncapturingStart:w}}=v;if(f==="[")d++;else if(d)f==="]"&&d--;else if(f===r&&!g)u=b,g=!0;else if(g&&w)m++;else if(_)g?m++:(c++,s.push(c+l));else if(f===")"&&g){if(!m){l++;const h=c+l;if(e=`${e.slice(0,u)}${i}${e.slice(u+r.length,b)}))<$$${h}>)${e.slice(b+1)}`,p=!0,o.push(h),db(n,h),a.size){const C=new Map;a.forEach((k,$)=>{C.set($>=h?$+1:$,k.map(T=>T>=h?T+1:T))}),a=C}break}m--}}}while(p);return n.push(...o),e=Oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const v=+m;if(v>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[v]}`}return`\\${g}`},de.DEFAULT),{pattern:e,captureTransfers:a,hiddenCaptures:n}}const El=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,nr=new RegExp(String.raw`
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
@@ -60,7 +60,7 @@ ${n?'Expression: "'+n+`"
))?
| (?<qBase>${El})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
| \\?.
-`.replace(/\s+/g,""),"gsu");function fb(e){if(!new RegExp(`${El}\\+`).test(e))return{pattern:e};const t=[];let n=null,a=null,r="",i=0,s;for(nr.lastIndex=0;s=nr.exec(e);){const{0:o,index:c,groups:{qBase:l,qMod:u,invalidQ:p}}=s;if(o==="[")i||(a=c),i++;else if(o==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${o}"`);let d=-1;if(/^\{\d+\}$/.test(l))e=db(e,c+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,m)}(?>${e.slice(m,c)}${l})${e.slice(c+o.length)}`}else e=`${e.slice(0,c-r.length)}(?>${r}${l})${e.slice(c+o.length)}`;d+=4}nr.lastIndex+=d}else o[0]==="("?t.push(c):o===")"&&(n=t.length?t.pop():null);r=o}return{pattern:e}}const ue=String.raw,bb=ue`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Gr=ue`\(\?R=(?<rDepth>[^\)]+)\)|${bb}`,La=ue`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fl=ue`${La}|(?<unnamed>\()(?!\?)`,Je=new RegExp(ue`${La}|${Gr}|\(\?|\\?.`,"gsu"),ar="Cannot use multiple overlapping recursions";function _b(e,t){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(Gr,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&Qn(e,ue`\(\?\(DEFINE\)`,de.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=Qn(e,ue`\\[1-9]`,de.DEFAULT),o=new Map,c=[];let l=!1,u=0,p=0,d;for(Je.lastIndex=0;d=Je.exec(e);){const{0:m,groups:{captureName:g,rDepth:v,gRNameOrNum:f,gRDepth:b}}=d;if(m==="[")u++;else if(u)m==="]"&&u--;else if(v){if(Vs(v),l)throw new Error(ar);if(s)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,d.index),w=e.slice(Je.lastIndex);if(Qn(w,Gr,de.DEFAULT))throw new Error(ar);const h=+v-1;e=Zs(_,w,h,!1,n,i,p),r=Xs(r,_,h,i.length,0,p);break}else if(f){Vs(b);let _=!1;for(const R of c)if(R.name===f||R.num===+f){if(_=!0,R.hasRecursedWithin)throw new Error(ar);break}if(!_)throw new Error(ue`Recursive \g cannot be used outside the referenced group "${a==="external"?f:ue`\g<${f}&R=${b}>`}"`);const w=o.get(f),h=hb(e,w);if(s&&Qn(h,ue`${La}|\((?!\?)`,de.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(w,d.index),k=h.slice(C.length+m.length),$=i.length,T=+b-1,N=Zs(C,k,T,!0,n,i,p);r=Xs(r,C,T,i.length-$,$,p);const I=e.slice(0,w),D=e.slice(w+h.length);e=`${I}${N}${D}`,Je.lastIndex+=N.length-m.length-C.length-k.length,c.forEach(R=>R.hasRecursedWithin=!0),l=!0}else if(g)p++,o.set(String(p),Je.lastIndex),o.set(g,Je.lastIndex),c.push({num:p,name:g});else if(m[0]==="("){const _=m==="(";_&&(p++,o.set(String(p),Je.lastIndex)),c.push(_?{num:p}:{})}else m===")"&&c.pop()}return n.push(...i),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function Vs(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 Zs(e,t,n,a,r,i,s){const o=new Set;a&&Cl(e+t,La,({groups:{captureName:l}})=>{o.add(l)},de.DEFAULT);const c=[n,a?o:null,r,i,s];return`${e}${Ys(`(?:${e}`,"forward",...c)}(?:)${Ys(`${t})`,"backward",...c)}${t}`}function Ys(e,t,n,a,r,i,s){const c=u=>t==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const p=c(u);l+=Oi(e,ue`${Fl}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:m,unnamed:g,backref:v}})=>{if(v&&a&&!a.has(v))return d;const f=`_$${p}`;if(g||m){const b=s+i.length+1;return i.push(b),yb(r,b),g?d:`(?<${m}${f}>`}return ue`\k<${v}${f}>`},de.DEFAULT)}return l}function yb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xs(e,t,n,a,r,i){if(e.size&&a){let s=0;Cl(t,Fl,()=>s++,de.DEFAULT);const o=i-s+r,c=new Map;return e.forEach((l,u)=>{const p=(a-s*n)/n,d=s*n,m=u>o+s?u+a:u,g=[];for(const v of l)if(v<=o)g.push(v);else if(v>o+s+p)g.push(v+a);else if(v<=o+s)for(let f=0;f<=n;f++)g.push(v+s*f);else for(let f=0;f<=n;f++)g.push(v+d+p*f);c.set(m,g)}),c}return e}var V=String.fromCodePoint,j=String.raw,Le={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("","v")}catch{return!1}return!0})()};Le.bugFlagVLiteralHyphenIsRange=Le.unicodeSets?(()=>{try{new RegExp(j`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Le.bugNestedClassIgnoresNegation=Le.unicodeSets&&new RegExp("[[^a]]","v").test("a");function xa(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function yn(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Hr(e,t){return Ks[e]>=Ks[t]}function vb(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Ks={ES2025:2025,ES2024:2024,ES2018:2018},wb={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $l(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!wb[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=Le.flagGroups?"ES2025":Le.unicodeSets?"ES2024":"ES2018"),t}var xb="[ -\r ]",kb=new Set([V(304),V(305)]),Oe=j`[\p{L}\p{M}\p{N}\p{Pc}]`;function jl(e){if(kb.has(e))return[e];const t=new Set,n=e.toLowerCase(),a=n.toUpperCase(),r=Fb.get(n),i=Cb.get(n),s=Eb.get(n);return[...a].length===1&&t.add(a),s&&t.add(s),r&&t.add(r),t.add(n),i&&t.add(i),[...t]}var Ii=new Map(`C Other
+`.replace(/\s+/g,""),"gsu");function bb(e){if(!new RegExp(`${El}\\+`).test(e))return{pattern:e};const t=[];let n=null,a=null,r="",i=0,s;for(nr.lastIndex=0;s=nr.exec(e);){const{0:o,index:c,groups:{qBase:l,qMod:u,invalidQ:p}}=s;if(o==="[")i||(a=c),i++;else if(o==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${o}"`);let d=-1;if(/^\{\d+\}$/.test(l))e=mb(e,c+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,m)}(?>${e.slice(m,c)}${l})${e.slice(c+o.length)}`}else e=`${e.slice(0,c-r.length)}(?>${r}${l})${e.slice(c+o.length)}`;d+=4}nr.lastIndex+=d}else o[0]==="("?t.push(c):o===")"&&(n=t.length?t.pop():null);r=o}return{pattern:e}}const ue=String.raw,_b=ue`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Gr=ue`\(\?R=(?<rDepth>[^\)]+)\)|${_b}`,La=ue`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fl=ue`${La}|(?<unnamed>\()(?!\?)`,Je=new RegExp(ue`${La}|${Gr}|\(\?|\\?.`,"gsu"),ar="Cannot use multiple overlapping recursions";function yb(e,t){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(Gr,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&Qn(e,ue`\(\?\(DEFINE\)`,de.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=Qn(e,ue`\\[1-9]`,de.DEFAULT),o=new Map,c=[];let l=!1,u=0,p=0,d;for(Je.lastIndex=0;d=Je.exec(e);){const{0:m,groups:{captureName:g,rDepth:v,gRNameOrNum:f,gRDepth:b}}=d;if(m==="[")u++;else if(u)m==="]"&&u--;else if(v){if(Vs(v),l)throw new Error(ar);if(s)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,d.index),w=e.slice(Je.lastIndex);if(Qn(w,Gr,de.DEFAULT))throw new Error(ar);const h=+v-1;e=Zs(_,w,h,!1,n,i,p),r=Xs(r,_,h,i.length,0,p);break}else if(f){Vs(b);let _=!1;for(const R of c)if(R.name===f||R.num===+f){if(_=!0,R.hasRecursedWithin)throw new Error(ar);break}if(!_)throw new Error(ue`Recursive \g cannot be used outside the referenced group "${a==="external"?f:ue`\g<${f}&R=${b}>`}"`);const w=o.get(f),h=gb(e,w);if(s&&Qn(h,ue`${La}|\((?!\?)`,de.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(w,d.index),k=h.slice(C.length+m.length),$=i.length,T=+b-1,N=Zs(C,k,T,!0,n,i,p);r=Xs(r,C,T,i.length-$,$,p);const I=e.slice(0,w),D=e.slice(w+h.length);e=`${I}${N}${D}`,Je.lastIndex+=N.length-m.length-C.length-k.length,c.forEach(R=>R.hasRecursedWithin=!0),l=!0}else if(g)p++,o.set(String(p),Je.lastIndex),o.set(g,Je.lastIndex),c.push({num:p,name:g});else if(m[0]==="("){const _=m==="(";_&&(p++,o.set(String(p),Je.lastIndex)),c.push(_?{num:p}:{})}else m===")"&&c.pop()}return n.push(...i),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function Vs(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 Zs(e,t,n,a,r,i,s){const o=new Set;a&&Cl(e+t,La,({groups:{captureName:l}})=>{o.add(l)},de.DEFAULT);const c=[n,a?o:null,r,i,s];return`${e}${Ys(`(?:${e}`,"forward",...c)}(?:)${Ys(`${t})`,"backward",...c)}${t}`}function Ys(e,t,n,a,r,i,s){const c=u=>t==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const p=c(u);l+=Oi(e,ue`${Fl}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:m,unnamed:g,backref:v}})=>{if(v&&a&&!a.has(v))return d;const f=`_$${p}`;if(g||m){const b=s+i.length+1;return i.push(b),vb(r,b),g?d:`(?<${m}${f}>`}return ue`\k<${v}${f}>`},de.DEFAULT)}return l}function vb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xs(e,t,n,a,r,i){if(e.size&&a){let s=0;Cl(t,Fl,()=>s++,de.DEFAULT);const o=i-s+r,c=new Map;return e.forEach((l,u)=>{const p=(a-s*n)/n,d=s*n,m=u>o+s?u+a:u,g=[];for(const v of l)if(v<=o)g.push(v);else if(v>o+s+p)g.push(v+a);else if(v<=o+s)for(let f=0;f<=n;f++)g.push(v+s*f);else for(let f=0;f<=n;f++)g.push(v+d+p*f);c.set(m,g)}),c}return e}var V=String.fromCodePoint,j=String.raw,Le={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("","v")}catch{return!1}return!0})()};Le.bugFlagVLiteralHyphenIsRange=Le.unicodeSets?(()=>{try{new RegExp(j`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Le.bugNestedClassIgnoresNegation=Le.unicodeSets&&new RegExp("[[^a]]","v").test("a");function xa(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function vn(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Hr(e,t){return Ks[e]>=Ks[t]}function wb(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Ks={ES2025:2025,ES2024:2024,ES2018:2018},xb={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $l(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!xb[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=Le.flagGroups?"ES2025":Le.unicodeSets?"ES2024":"ES2018"),t}var kb="[ -\r ]",Cb=new Set([V(304),V(305)]),Oe=j`[\p{L}\p{M}\p{N}\p{Pc}]`;function jl(e){if(Cb.has(e))return[e];const t=new Set,n=e.toLowerCase(),a=n.toUpperCase(),r=$b.get(n),i=Eb.get(n),s=Fb.get(n);return[...a].length===1&&t.add(a),s&&t.add(s),r&&t.add(r),t.add(n),i&&t.add(i),[...t]}var Ii=new Map(`C Other
Cc Control cntrl
Cf Format
Cn Unassigned
@@ -150,7 +150,7 @@ Uppercase Upper
Variation_Selector VS
White_Space space
XID_Continue XIDC
-XID_Start XIDS`.split(/\s/).map(e=>[Na(e),e])),Cb=new Map([["s",V(383)],[V(383),"s"]]),Eb=new Map([[V(223),V(7838)],[V(107),V(8490)],[V(229),V(8491)],[V(969),V(8486)]]),Fb=new Map([Be(453),Be(456),Be(459),Be(498),...rr(8072,8079),...rr(8088,8095),...rr(8104,8111),Be(8124),Be(8140),Be(8188)]),$b=new Map([["alnum",j`[\p{Alpha}\p{Nd}]`],["alpha",j`\p{Alpha}`],["ascii",j`\p{ASCII}`],["blank",j`[\p{Zs}\t]`],["cntrl",j`\p{Cc}`],["digit",j`\p{Nd}`],["graph",j`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",j`\p{Lower}`],["print",j`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",j`[\p{P}\p{S}]`],["space",j`\p{space}`],["upper",j`\p{Upper}`],["word",j`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",j`\p{AHex}`]]);function jb(e,t){const n=[];for(let a=e;a<=t;a++)n.push(a);return n}function Be(e){const t=V(e);return[t.toLowerCase(),t]}function rr(e,t){return jb(e,t).map(n=>Be(n))}var Sl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Sb(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Al(e);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Hr(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};pn(e,Ab,a);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};pn(e,Tb,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return pn(e,Rb,s),e._originMap=i.groupOriginByCopy,e._strategy=a.strategy,e}var Ab={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:a,kind:r}=e;if(r==="repeater"){const i=be();i.body[0].body.push(at({negate:!0,body:a}),Ft("Any"));const s=be();s.body[0].body.push(wl("greedy",0,1/0,i)),n(B(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:a}){const r=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];yn(a,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Rl(t.get(e));if(n){const a=be({flags:n});a.body[0].body=e.body,e.body=[B(a,e)]}}}},Assertion({node:e,parent:t,key:n,container:a,root:r,remove:i,replaceWith:s},o){const{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:p,supportedGNodes:d,wordIsAscii:m}=o;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(c==="line_end")s(B(at({body:[ht({body:[zr("string_end")]}),ht({body:[Ia(10)]})]}),t));else if(c==="line_start")s(B(Ie(j`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(d.has(e))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&Db(g))s(B(at({negate:!0}),t));else{if(p)throw new Error(j`Uses "\G" in a way that requires a subclass`);s(Ue(zr("string_start"),t)),o.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")s(B(Ie(j`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${Oe})(?!${Oe})|(?<!${Oe})(?=${Oe}))`,v=`(?:(?<=${Oe})(?=${Oe})|(?<!${Oe})(?!${Oe}))`;s(B(Ie(l?v:g),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!sr(n)&&(n=ir(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:a}=e;a&&!sr(a)&&(a=ir(a,t),e.name=a),n.set(e.number,e),a&&n.set(a,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const a=ra({body:[e]});n(B(a,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){const{kind:c,negate:l,value:u}=e;if(i&&(c==="digit"||u==="digit")){n(Ue(Ur("digit",{negate:l}),t));return}if(s&&(c==="space"||u==="space")){n(B(or(Ie(xb),l),t));return}if(o&&(c==="word"||u==="word")){n(Ue(Ur("word",{negate:l}),t));return}if(c==="any")n(Ue(Ft("Any"),t));else if(c==="digit")n(Ue(Ft("Nd",{negate:l}),t));else if(c!=="dot")if(c==="text_segment"){if(a==="strict")throw new Error(j`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=j`\p{RI}{2}|${p}(?:\u200D${p})*`;n(B(Ie(j`(?>\r\n|${r?j`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(Ue(Ft("AHex",{negate:l}),t));else if(c==="newline")n(B(Ie(l?`[^
+XID_Start XIDS`.split(/\s/).map(e=>[Na(e),e])),Eb=new Map([["s",V(383)],[V(383),"s"]]),Fb=new Map([[V(223),V(7838)],[V(107),V(8490)],[V(229),V(8491)],[V(969),V(8486)]]),$b=new Map([Be(453),Be(456),Be(459),Be(498),...rr(8072,8079),...rr(8088,8095),...rr(8104,8111),Be(8124),Be(8140),Be(8188)]),jb=new Map([["alnum",j`[\p{Alpha}\p{Nd}]`],["alpha",j`\p{Alpha}`],["ascii",j`\p{ASCII}`],["blank",j`[\p{Zs}\t]`],["cntrl",j`\p{Cc}`],["digit",j`\p{Nd}`],["graph",j`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",j`\p{Lower}`],["print",j`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",j`[\p{P}\p{S}]`],["space",j`\p{space}`],["upper",j`\p{Upper}`],["word",j`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",j`\p{AHex}`]]);function Sb(e,t){const n=[];for(let a=e;a<=t;a++)n.push(a);return n}function Be(e){const t=V(e);return[t.toLowerCase(),t]}function rr(e,t){return Sb(e,t).map(n=>Be(n))}var Sl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Ab(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Al(e);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Hr(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};dn(e,Tb,a);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};dn(e,Rb,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return dn(e,Ob,s),e._originMap=i.groupOriginByCopy,e._strategy=a.strategy,e}var Tb={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:a,kind:r}=e;if(r==="repeater"){const i=be();i.body[0].body.push(at({negate:!0,body:a}),Ft("Any"));const s=be();s.body[0].body.push(wl("greedy",0,1/0,i)),n(B(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:a}){const r=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];vn(a,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Rl(t.get(e));if(n){const a=be({flags:n});a.body[0].body=e.body,e.body=[B(a,e)]}}}},Assertion({node:e,parent:t,key:n,container:a,root:r,remove:i,replaceWith:s},o){const{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:p,supportedGNodes:d,wordIsAscii:m}=o;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(c==="line_end")s(B(at({body:[ht({body:[zr("string_end")]}),ht({body:[Ia(10)]})]}),t));else if(c==="line_start")s(B(Ie(j`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(d.has(e))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&Mb(g))s(B(at({negate:!0}),t));else{if(p)throw new Error(j`Uses "\G" in a way that requires a subclass`);s(Ue(zr("string_start"),t)),o.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")s(B(Ie(j`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${Oe})(?!${Oe})|(?<!${Oe})(?=${Oe}))`,v=`(?:(?<=${Oe})(?=${Oe})|(?<!${Oe})(?!${Oe}))`;s(B(Ie(l?v:g),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!sr(n)&&(n=ir(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:a}=e;a&&!sr(a)&&(a=ir(a,t),e.name=a),n.set(e.number,e),a&&n.set(a,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const a=ra({body:[e]});n(B(a,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){const{kind:c,negate:l,value:u}=e;if(i&&(c==="digit"||u==="digit")){n(Ue(Ur("digit",{negate:l}),t));return}if(s&&(c==="space"||u==="space")){n(B(or(Ie(kb),l),t));return}if(o&&(c==="word"||u==="word")){n(Ue(Ur("word",{negate:l}),t));return}if(c==="any")n(Ue(Ft("Any"),t));else if(c==="digit")n(Ue(Ft("Nd",{negate:l}),t));else if(c!=="dot")if(c==="text_segment"){if(a==="strict")throw new Error(j`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=j`\p{RI}{2}|${p}(?:\u200D${p})*`;n(B(Ie(j`(?>\r\n|${r?j`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(Ue(Ft("AHex",{negate:l}),t));else if(c==="newline")n(B(Ie(l?`[^
]`:`(?>\r
?|[
-\v\f

[12.x] Disable html by default on Laravel exception page

Mior Muhammad Zaki· Aug 31, 2026, 07:11 PM+11−12b495ca2ec4
src/Illuminate/Foundation/resources/exceptions/renderer/components/formatted-source.blade.php+1 −1
@@ -19,5 +19,5 @@
language="php"
truncate
class="text-xs min-w-0"
- data-tippy-content="{{ $source }}"
+ data-tippy-html-content="{{ $source }}"
/>
src/Illuminate/Foundation/resources/exceptions/renderer/dist/scripts.js+10 −11
@@ -1,10 +1,10 @@
-var cr=!1,lr=!1,ot=[],ur=-1;function Vl(e){Zl(e)}function Zl(e){ot.includes(e)||ot.push(e),Xl()}function Yl(e){let t=ot.indexOf(e);t!==-1&&t>ur&&ot.splice(t,1)}function Xl(){!lr&&!cr&&(cr=!0,queueMicrotask(Kl))}function Kl(){cr=!1,lr=!0;for(let e=0;e<ot.length;e++)ot[e](),ur=e;ot.length=0,ur=-1,lr=!1}var Pt,gt,Dt,ao,pr=!0;function Ql(e){pr=!1,e(),pr=!0}function Jl(e){Pt=e.reactive,Dt=e.release,gt=t=>e.effect(t,{scheduler:n=>{pr?Vl(n):n()}}),ao=e.raw}function Pi(e){gt=e}function eu(e){let t=()=>{};return[a=>{let r=gt(a);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(i=>i())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),Dt(r))},r},()=>{t()}]}function ro(e,t){let n=!0,a,r=gt(()=>{let i=e();JSON.stringify(i),n?a=i:queueMicrotask(()=>{t(i,a),a=i}),n=!1});return()=>Dt(r)}var io=[],so=[],oo=[];function tu(e){oo.push(e)}function Vr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,so.push(t))}function co(e){io.push(e)}function lo(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function uo(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,a])=>{(t===void 0||t.includes(n))&&(a.forEach(r=>r()),delete e._x_attributeCleanups[n])})}function nu(e){for(e._x_effects?.forEach(Yl);e._x_cleanups?.length;)e._x_cleanups.pop()()}var Zr=new MutationObserver(Qr),Yr=!1;function Xr(){Zr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Yr=!0}function po(){au(),Zr.disconnect(),Yr=!1}var Kt=[];function au(){let e=Zr.takeRecords();Kt.push(()=>e.length>0&&Qr(e));let t=Kt.length;queueMicrotask(()=>{if(Kt.length===t)for(;Kt.length>0;)Kt.shift()()})}function z(e){if(!Yr)return e();po();let t=e();return Xr(),t}var Kr=!1,ia=[];function ru(){Kr=!0}function iu(){Kr=!1,Qr(ia),ia=[]}function Qr(e){if(Kr){ia=ia.concat(e);return}let t=[],n=new Set,a=new Map,r=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].removedNodes.forEach(s=>{s.nodeType===1&&s._x_marker&&n.add(s)}),e[i].addedNodes.forEach(s=>{if(s.nodeType===1){if(n.has(s)){n.delete(s);return}s._x_marker||t.push(s)}})),e[i].type==="attributes")){let s=e[i].target,o=e[i].attributeName,c=e[i].oldValue,l=()=>{a.has(s)||a.set(s,[]),a.get(s).push({name:o,value:s.getAttribute(o)})},u=()=>{r.has(s)||r.set(s,[]),r.get(s).push(o)};s.hasAttribute(o)&&c===null?l():s.hasAttribute(o)?(u(),l()):u()}r.forEach((i,s)=>{uo(s,i)}),a.forEach((i,s)=>{io.forEach(o=>o(s,i))});for(let i of n)t.some(s=>s.contains(i))||so.forEach(s=>s(i));for(let i of t)i.isConnected&&oo.forEach(s=>s(i));t=null,n=null,a=null,r=null}function mo(e){return wn(At(e))}function vn(e,t,n){return e._x_dataStack=[t,...At(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(a=>a!==t)}}function At(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?At(e.host):e.parentNode?At(e.parentNode):[]}function wn(e){return new Proxy({objects:e},su)}var su={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(n=>Object.prototype.hasOwnProperty.call(n,t)||Reflect.has(n,t))},get({objects:e},t,n){return t=="toJSON"?ou:Reflect.get(e.find(a=>Reflect.has(a,t))||{},t,n)},set({objects:e},t,n,a){const r=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],i=Object.getOwnPropertyDescriptor(r,t);return i?.set&&i?.get?i.set.call(a,n)||!0:Reflect.set(r,t,n)}};function ou(){return Reflect.ownKeys(this).reduce((t,n)=>(t[n]=Reflect.get(this,n),t),{})}function ho(e){let t=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,n=(a,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(a)).forEach(([i,{value:s,enumerable:o}])=>{if(o===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=r===""?i:`${r}.${i}`;typeof s=="object"&&s!==null&&s._x_interceptor?a[i]=s.initialize(e,c,i):t(s)&&s!==a&&!(s instanceof Element)&&n(s,c)})};return n(e)}function go(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(a,r,i){return e(this.initialValue,()=>cu(a,r),s=>dr(a,r,s),r,i)}};return t(n),a=>{if(typeof a=="object"&&a!==null&&a._x_interceptor){let r=n.initialize.bind(n);n.initialize=(i,s,o)=>{let c=a.initialize(i,s,o);return n.initialValue=c,r(i,s,o)}}else n.initialValue=a;return n}}function cu(e,t){return t.split(".").reduce((n,a)=>n[a],e)}function dr(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),dr(e[t[0]],t.slice(1),n)}}var fo={};function ve(e,t){fo[e]=t}function mr(e,t){let n=lu(t);return Object.entries(fo).forEach(([a,r])=>{Object.defineProperty(e,`$${a}`,{get(){return r(t,n)},enumerable:!1})}),e}function lu(e){let[t,n]=xo(e),a={interceptor:go,...t};return Vr(e,n),a}function uu(e,t,n,...a){try{return n(...a)}catch(r){dn(r,e,t)}}function dn(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
+var cr=!1,lr=!1,ot=[],ur=-1;function Zl(e){Yl(e)}function Yl(e){ot.includes(e)||ot.push(e),Kl()}function Xl(e){let t=ot.indexOf(e);t!==-1&&t>ur&&ot.splice(t,1)}function Kl(){!lr&&!cr&&(cr=!0,queueMicrotask(Ql))}function Ql(){cr=!1,lr=!0;for(let e=0;e<ot.length;e++)ot[e](),ur=e;ot.length=0,ur=-1,lr=!1}var Pt,gt,Dt,ao,pr=!0;function Jl(e){pr=!1,e(),pr=!0}function eu(e){Pt=e.reactive,Dt=e.release,gt=t=>e.effect(t,{scheduler:n=>{pr?Zl(n):n()}}),ao=e.raw}function Pi(e){gt=e}function tu(e){let t=()=>{};return[a=>{let r=gt(a);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(i=>i())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),Dt(r))},r},()=>{t()}]}function ro(e,t){let n=!0,a,r=gt(()=>{let i=e();JSON.stringify(i),n?a=i:queueMicrotask(()=>{t(i,a),a=i}),n=!1});return()=>Dt(r)}var io=[],so=[],oo=[];function nu(e){oo.push(e)}function Vr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,so.push(t))}function co(e){io.push(e)}function lo(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function uo(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,a])=>{(t===void 0||t.includes(n))&&(a.forEach(r=>r()),delete e._x_attributeCleanups[n])})}function au(e){for(e._x_effects?.forEach(Xl);e._x_cleanups?.length;)e._x_cleanups.pop()()}var Zr=new MutationObserver(Qr),Yr=!1;function Xr(){Zr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Yr=!0}function po(){ru(),Zr.disconnect(),Yr=!1}var Qt=[];function ru(){let e=Zr.takeRecords();Qt.push(()=>e.length>0&&Qr(e));let t=Qt.length;queueMicrotask(()=>{if(Qt.length===t)for(;Qt.length>0;)Qt.shift()()})}function z(e){if(!Yr)return e();po();let t=e();return Xr(),t}var Kr=!1,ia=[];function iu(){Kr=!0}function su(){Kr=!1,Qr(ia),ia=[]}function Qr(e){if(Kr){ia=ia.concat(e);return}let t=[],n=new Set,a=new Map,r=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].removedNodes.forEach(s=>{s.nodeType===1&&s._x_marker&&n.add(s)}),e[i].addedNodes.forEach(s=>{if(s.nodeType===1){if(n.has(s)){n.delete(s);return}s._x_marker||t.push(s)}})),e[i].type==="attributes")){let s=e[i].target,o=e[i].attributeName,c=e[i].oldValue,l=()=>{a.has(s)||a.set(s,[]),a.get(s).push({name:o,value:s.getAttribute(o)})},u=()=>{r.has(s)||r.set(s,[]),r.get(s).push(o)};s.hasAttribute(o)&&c===null?l():s.hasAttribute(o)?(u(),l()):u()}r.forEach((i,s)=>{uo(s,i)}),a.forEach((i,s)=>{io.forEach(o=>o(s,i))});for(let i of n)t.some(s=>s.contains(i))||so.forEach(s=>s(i));for(let i of t)i.isConnected&&oo.forEach(s=>s(i));t=null,n=null,a=null,r=null}function mo(e){return xn(At(e))}function wn(e,t,n){return e._x_dataStack=[t,...At(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(a=>a!==t)}}function At(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?At(e.host):e.parentNode?At(e.parentNode):[]}function xn(e){return new Proxy({objects:e},ou)}var ou={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(n=>Object.prototype.hasOwnProperty.call(n,t)||Reflect.has(n,t))},get({objects:e},t,n){return t=="toJSON"?cu:Reflect.get(e.find(a=>Reflect.has(a,t))||{},t,n)},set({objects:e},t,n,a){const r=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],i=Object.getOwnPropertyDescriptor(r,t);return i?.set&&i?.get?i.set.call(a,n)||!0:Reflect.set(r,t,n)}};function cu(){return Reflect.ownKeys(this).reduce((t,n)=>(t[n]=Reflect.get(this,n),t),{})}function ho(e){let t=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,n=(a,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(a)).forEach(([i,{value:s,enumerable:o}])=>{if(o===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=r===""?i:`${r}.${i}`;typeof s=="object"&&s!==null&&s._x_interceptor?a[i]=s.initialize(e,c,i):t(s)&&s!==a&&!(s instanceof Element)&&n(s,c)})};return n(e)}function go(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(a,r,i){return e(this.initialValue,()=>lu(a,r),s=>dr(a,r,s),r,i)}};return t(n),a=>{if(typeof a=="object"&&a!==null&&a._x_interceptor){let r=n.initialize.bind(n);n.initialize=(i,s,o)=>{let c=a.initialize(i,s,o);return n.initialValue=c,r(i,s,o)}}else n.initialValue=a;return n}}function lu(e,t){return t.split(".").reduce((n,a)=>n[a],e)}function dr(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),dr(e[t[0]],t.slice(1),n)}}var fo={};function ve(e,t){fo[e]=t}function mr(e,t){let n=uu(t);return Object.entries(fo).forEach(([a,r])=>{Object.defineProperty(e,`$${a}`,{get(){return r(t,n)},enumerable:!1})}),e}function uu(e){let[t,n]=xo(e),a={interceptor:go,...t};return Vr(e,n),a}function pu(e,t,n,...a){try{return n(...a)}catch(r){mn(r,e,t)}}function mn(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
${n?'Expression: "'+n+`"
-`:""}`,t),setTimeout(()=>{throw e},0)}var Jn=!0;function bo(e){let t=Jn;Jn=!1;let n=e();return Jn=t,n}function ct(e,t,n={}){let a;return ne(e,t)(r=>a=r,n),a}function ne(...e){return _o(...e)}var _o=yo;function pu(e){_o=e}function yo(e,t){let n={};mr(n,e);let a=[n,...At(e)],r=typeof t=="function"?du(a,t):hu(a,t,e);return uu.bind(null,e,t,r)}function du(e,t){return(n=()=>{},{scope:a={},params:r=[]}={})=>{let i=t.apply(wn([a,...e]),r);sa(n,i)}}var Ma={};function mu(e,t){if(Ma[e])return Ma[e];let n=Object.getPrototypeOf(async function(){}).constructor,a=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let s=new n(["__self","scope"],`with (scope) { __self.result = ${a} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return dn(s,t,e),Promise.resolve()}})();return Ma[e]=i,i}function hu(e,t,n){let a=mu(t,n);return(r=()=>{},{scope:i={},params:s=[]}={})=>{a.result=void 0,a.finished=!1;let o=wn([i,...e]);if(typeof a=="function"){let c=a(a,o).catch(l=>dn(l,n,t));a.finished?(sa(r,a.result,o,s,n),a.result=void 0):c.then(l=>{sa(r,l,o,s,n)}).catch(l=>dn(l,n,t)).finally(()=>a.result=void 0)}}}function sa(e,t,n,a,r){if(Jn&&typeof t=="function"){let i=t.apply(n,a);i instanceof Promise?i.then(s=>sa(e,s,n,a)).catch(s=>dn(s,r,t)):e(i)}else typeof t=="object"&&t instanceof Promise?t.then(i=>e(i)):e(t)}var Jr="x-";function Mt(e=""){return Jr+e}function gu(e){Jr=e}var oa={};function W(e,t){return oa[e]=t,{before(n){if(!oa[n]){console.warn(String.raw`Cannot find directive \`${n}\`. \`${e}\` will use the default order of execution`);return}const a=rt.indexOf(n);rt.splice(a>=0?a:rt.indexOf("DEFAULT"),0,e)}}}function fu(e){return Object.keys(oa).includes(e)}function ei(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let i=Object.entries(e._x_virtualDirectives).map(([o,c])=>({name:o,value:c})),s=vo(i);i=i.map(o=>s.find(c=>c.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),t=t.concat(i)}let a={};return t.map(Eo((i,s)=>a[i]=s)).filter($o).map(yu(a,n)).sort(vu).map(i=>_u(e,i))}function vo(e){return Array.from(e).map(Eo()).filter(t=>!$o(t))}var hr=!1,nn=new Map,wo=Symbol();function bu(e){hr=!0;let t=Symbol();wo=t,nn.set(t,[]);let n=()=>{for(;nn.get(t).length;)nn.get(t).shift()();nn.delete(t)},a=()=>{hr=!1,n()};e(n),a()}function xo(e){let t=[],n=o=>t.push(o),[a,r]=eu(e);return t.push(r),[{Alpine:xn,effect:a,cleanup:n,evaluateLater:ne.bind(ne,e),evaluate:ct.bind(ct,e)},()=>t.forEach(o=>o())]}function _u(e,t){let n=()=>{},a=oa[t.type]||n,[r,i]=xo(e);lo(e,t.original,i);let s=()=>{e._x_ignore||e._x_ignoreSelf||(a.inline&&a.inline(e,t,r),a=a.bind(a,e,t,r),hr?nn.get(wo).push(a):a())};return s.runCleanups=i,s}var ko=(e,t)=>({name:n,value:a})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:a}),Co=e=>e;function Eo(e=()=>{}){return({name:t,value:n})=>{let{name:a,value:r}=Fo.reduce((i,s)=>s(i),{name:t,value:n});return a!==t&&e(a,t),{name:a,value:r}}}var Fo=[];function ti(e){Fo.push(e)}function $o({name:e}){return jo().test(e)}var jo=()=>new RegExp(`^${Jr}([^:^.]+)\\b`);function yu(e,t){return({name:n,value:a})=>{let r=n.match(jo()),i=n.match(/:([a-zA-Z0-9\-_:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],o=t||e[n]||n;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:a,original:o}}}var gr="DEFAULT",rt=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",gr,"teleport"];function vu(e,t){let n=rt.indexOf(e.type)===-1?gr:e.type,a=rt.indexOf(t.type)===-1?gr:t.type;return rt.indexOf(n)-rt.indexOf(a)}function rn(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function dt(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(r=>dt(r,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let a=e.firstElementChild;for(;a;)dt(a,t),a=a.nextElementSibling}function pe(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Di=!1;function wu(){Di&&pe("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Di=!0,document.body||pe("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),rn(document,"alpine:init"),rn(document,"alpine:initializing"),Xr(),tu(t=>Pe(t,dt)),Vr(t=>zt(t)),co((t,n)=>{ei(t,n).forEach(a=>a())});let e=t=>!ka(t.parentElement,!0);Array.from(document.querySelectorAll(To().join(","))).filter(e).forEach(t=>{Pe(t)}),rn(document,"alpine:initialized"),setTimeout(()=>{Eu()})}var ni=[],So=[];function Ao(){return ni.map(e=>e())}function To(){return ni.concat(So).map(e=>e())}function Ro(e){ni.push(e)}function Oo(e){So.push(e)}function ka(e,t=!1){return qt(e,n=>{if((t?To():Ao()).some(r=>n.matches(r)))return!0})}function qt(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return qt(e.parentElement,t)}}function xu(e){return Ao().some(t=>e.matches(t))}var Io=[];function ku(e){Io.push(e)}var Cu=1;function Pe(e,t=dt,n=()=>{}){qt(e,a=>a._x_ignore)||bu(()=>{t(e,(a,r)=>{a._x_marker||(n(a,r),Io.forEach(i=>i(a,r)),ei(a,a.attributes).forEach(i=>i()),a._x_ignore||(a._x_marker=Cu++),a._x_ignore&&r())})})}function zt(e,t=dt){t(e,n=>{nu(n),uo(n),delete n._x_marker})}function Eu(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,n,a])=>{fu(n)||a.some(r=>{if(document.querySelector(r))return pe(`found "${r}", but missing ${t} plugin`),!0})})}var fr=[],ai=!1;function ri(e=()=>{}){return queueMicrotask(()=>{ai||setTimeout(()=>{br()})}),new Promise(t=>{fr.push(()=>{e(),t()})})}function br(){for(ai=!1;fr.length;)fr.shift()()}function Fu(){ai=!0}function ii(e,t){return Array.isArray(t)?Mi(e,t.join(" ")):typeof t=="object"&&t!==null?$u(e,t):typeof t=="function"?ii(e,t()):Mi(e,t)}function Mi(e,t){let n=r=>r.split(" ").filter(i=>!e.classList.contains(i)).filter(Boolean),a=r=>(e.classList.add(...r),()=>{e.classList.remove(...r)});return t=t===!0?t="":t||"",a(n(t))}function $u(e,t){let n=o=>o.split(" ").filter(Boolean),a=Object.entries(t).flatMap(([o,c])=>c?n(o):!1).filter(Boolean),r=Object.entries(t).flatMap(([o,c])=>c?!1:n(o)).filter(Boolean),i=[],s=[];return r.forEach(o=>{e.classList.contains(o)&&(e.classList.remove(o),s.push(o))}),a.forEach(o=>{e.classList.contains(o)||(e.classList.add(o),i.push(o))}),()=>{s.forEach(o=>e.classList.add(o)),i.forEach(o=>e.classList.remove(o))}}function Ca(e,t){return typeof t=="object"&&t!==null?ju(e,t):Su(e,t)}function ju(e,t){let n={};return Object.entries(t).forEach(([a,r])=>{n[a]=e.style[a],a.startsWith("--")||(a=Au(a)),e.style.setProperty(a,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{Ca(e,n)}}function Su(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Au(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}W("transition",(e,{value:t,modifiers:n,expression:a},{evaluate:r})=>{typeof a=="function"&&(a=r(a)),a!==!1&&(!a||typeof a=="boolean"?Ru(e,n,t):Tu(e,a,t))});function Tu(e,t,n){No(e,ii,""),{enter:r=>{e._x_transition.enter.during=r},"enter-start":r=>{e._x_transition.enter.start=r},"enter-end":r=>{e._x_transition.enter.end=r},leave:r=>{e._x_transition.leave.during=r},"leave-start":r=>{e._x_transition.leave.start=r},"leave-end":r=>{e._x_transition.leave.end=r}}[n](t)}function Ru(e,t,n){No(e,Ca);let a=!t.includes("in")&&!t.includes("out")&&!n,r=a||t.includes("in")||["enter"].includes(n),i=a||t.includes("out")||["leave"].includes(n);t.includes("in")&&!a&&(t=t.filter((b,_)=>_<t.indexOf("out"))),t.includes("out")&&!a&&(t=t.filter((b,_)=>_>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),o=s||t.includes("opacity"),c=s||t.includes("scale"),l=o?0:1,u=c?Qt(t,"scale",95)/100:1,p=Qt(t,"delay",0)/1e3,d=Qt(t,"origin","center"),m="opacity, transform",g=Qt(t,"duration",150)/1e3,v=Qt(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${g}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function No(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(a=()=>{},r=()=>{}){yr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},a,r)},out(a=()=>{},r=()=>{}){yr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},a,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,a){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):i():e._x_transition?e._x_transition.in(n):i();return}e._x_hidePromise=e._x_transition?new Promise((s,o)=>{e._x_transition.out(()=>{},()=>s(a)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>o({isFromCancelledTransition:!0}))}):Promise.resolve(a),queueMicrotask(()=>{let s=Lo(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):r(()=>{let o=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(o)]).then(([u])=>u?.());return delete c._x_hidePromise,delete c._x_hideChildren,l};o(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function Lo(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Lo(t)}function yr(e,t,{during:n,start:a,end:r}={},i=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(a).length===0&&Object.keys(r).length===0){i(),s();return}let o,c,l;Ou(e,{start(){o=t(e,a)},during(){c=t(e,n)},before:i,end(){o(),l=t(e,r)},after:s,cleanup(){c(),l()}})}function Ou(e,t){let n,a,r,i=_r(()=>{z(()=>{n=!0,a||t.before(),r||(t.end(),br()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:_r(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},z(()=>{t.start(),t.during()}),Fu(),requestAnimationFrame(()=>{if(n)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),z(()=>{t.before()}),a=!0,requestAnimationFrame(()=>{n||(z(()=>{t.end()}),br(),setTimeout(e._x_transitioning.finish,s+o),r=!0)})})}function Qt(e,t,n){if(e.indexOf(t)===-1)return n;const a=e[e.indexOf(t)+1];if(!a||t==="scale"&&isNaN(a))return n;if(t==="duration"||t==="delay"){let r=a.match(/([0-9]+)ms/);if(r)return r[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[a,e[e.indexOf(t)+2]].join(" "):a}var He=!1;function Ve(e,t=()=>{}){return(...n)=>He?t(...n):e(...n)}function Iu(e){return(...t)=>He&&e(...t)}var Po=[];function Ea(e){Po.push(e)}function Nu(e,t){Po.forEach(n=>n(e,t)),He=!0,Do(()=>{Pe(t,(n,a)=>{a(n,()=>{})})}),He=!1}var vr=!1;function Lu(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),He=!0,vr=!0,Do(()=>{Pu(t)}),He=!1,vr=!1}function Pu(e){let t=!1;Pe(e,(a,r)=>{dt(a,(i,s)=>{if(t&&xu(i))return s();t=!0,r(i,s)})})}function Do(e){let t=gt;Pi((n,a)=>{let r=t(n);return Dt(r),()=>{}}),e(),Pi(t)}function Mo(e,t,n,a=[]){switch(e._x_bindings||(e._x_bindings=Pt({})),e._x_bindings[t]=n,t=a.includes("camel")?Hu(t):t,t){case"value":Du(e,n);break;case"style":qu(e,n);break;case"class":Mu(e,n);break;case"selected":case"checked":zu(e,t,n);break;default:qo(e,t,n);break}}function Du(e,t){if(Uo(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=ea(e.value)===t:e.checked=qi(e.value,t));else if(si(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>qi(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Gu(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function Mu(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ii(e,t)}function qu(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ca(e,t)}function zu(e,t,n){qo(e,t,n),Uu(e,t,n)}function qo(e,t,n){[null,void 0,!1].includes(n)&&Vu(t)?e.removeAttribute(t):(zo(t)&&(n=t),Bu(e,t,n))}function Bu(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function Uu(e,t,n){e[t]!==n&&(e[t]=n)}function Gu(e,t){const n=[].concat(t).map(a=>a+"");Array.from(e.options).forEach(a=>{a.selected=n.includes(a.value)})}function Hu(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function qi(e,t){return e==t}function ea(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Wu=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function zo(e){return Wu.has(e)}function Vu(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Zu(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Bo(e,t,n)}function Yu(e,t,n,a=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let r=e._x_inlineBindings[t];return r.extract=a,bo(()=>ct(e,r.expression))}return Bo(e,t,n)}function Bo(e,t,n){let a=e.getAttribute(t);return a===null?typeof n=="function"?n():n:a===""?!0:zo(t)?!![t,"true"].includes(a):a}function si(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Uo(e){return e.type==="radio"||e.localName==="ui-radio"}function Go(e,t){var n;return function(){var a=this,r=arguments,i=function(){n=null,e.apply(a,r)};clearTimeout(n),n=setTimeout(i,t)}}function Ho(e,t){let n;return function(){let a=this,r=arguments;n||(e.apply(a,r),n=!0,setTimeout(()=>n=!1,t))}}function Wo({get:e,set:t},{get:n,set:a}){let r=!0,i,s=gt(()=>{let o=e(),c=n();if(r)a(qa(o)),r=!1;else{let l=JSON.stringify(o),u=JSON.stringify(c);l!==i?a(qa(o)):l!==u&&t(qa(c))}i=JSON.stringify(e()),JSON.stringify(n())});return()=>{Dt(s)}}function qa(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function Xu(e){(Array.isArray(e)?e:[e]).forEach(n=>n(xn))}var et={},zi=!1;function Ku(e,t){if(zi||(et=Pt(et),zi=!0),t===void 0)return et[e];et[e]=t,ho(et[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&et[e].init()}function Qu(){return et}var Vo={};function Ju(e,t){let n=typeof t!="function"?()=>t:t;return e instanceof Element?Zo(e,n()):(Vo[e]=n,()=>{})}function ep(e){return Object.entries(Vo).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...a)=>n(...a)}})}),e}function Zo(e,t,n){let a=[];for(;a.length;)a.pop()();let r=Object.entries(t).map(([s,o])=>({name:s,value:o})),i=vo(r);return r=r.map(s=>i.find(o=>o.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ei(e,r,n).map(s=>{a.push(s.runCleanups),s()}),()=>{for(;a.length;)a.pop()()}}var Yo={};function tp(e,t){Yo[e]=t}function np(e,t){return Object.entries(Yo).forEach(([n,a])=>{Object.defineProperty(e,n,{get(){return(...r)=>a.bind(t)(...r)},enumerable:!1})}),e}var ap={get reactive(){return Pt},get release(){return Dt},get effect(){return gt},get raw(){return ao},version:"3.14.9",flushAndStopDeferringMutations:iu,dontAutoEvaluateFunctions:bo,disableEffectScheduling:Ql,startObservingMutations:Xr,stopObservingMutations:po,setReactivityEngine:Jl,onAttributeRemoved:lo,onAttributesAdded:co,closestDataStack:At,skipDuringClone:Ve,onlyDuringClone:Iu,addRootSelector:Ro,addInitSelector:Oo,interceptClone:Ea,addScopeToNode:vn,deferMutations:ru,mapAttributes:ti,evaluateLater:ne,interceptInit:ku,setEvaluator:pu,mergeProxies:wn,extractProp:Yu,findClosest:qt,onElRemoved:Vr,closestRoot:ka,destroyTree:zt,interceptor:go,transition:yr,setStyles:Ca,mutateDom:z,directive:W,entangle:Wo,throttle:Ho,debounce:Go,evaluate:ct,initTree:Pe,nextTick:ri,prefixed:Mt,prefix:gu,plugin:Xu,magic:ve,store:Ku,start:wu,clone:Lu,cloneNode:Nu,bound:Zu,$data:mo,watch:ro,walk:dt,data:tp,bind:Ju},xn=ap;function rp(e,t){const n=Object.create(null),a=e.split(",");for(let r=0;r<a.length;r++)n[a[r]]=!0;return r=>!!n[r]}var ip=Object.freeze({}),sp=Object.prototype.hasOwnProperty,Fa=(e,t)=>sp.call(e,t),lt=Array.isArray,sn=e=>Xo(e)==="[object Map]",op=e=>typeof e=="string",oi=e=>typeof e=="symbol",$a=e=>e!==null&&typeof e=="object",cp=Object.prototype.toString,Xo=e=>cp.call(e),Ko=e=>Xo(e).slice(8,-1),ci=e=>op(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,lp=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},up=lp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qo=(e,t)=>e!==t&&(e===e||t===t),wr=new WeakMap,Jt=[],Ee,ut=Symbol("iterate"),xr=Symbol("Map key iterate");function pp(e){return e&&e._isEffect===!0}function dp(e,t=ip){pp(e)&&(e=e.raw);const n=gp(e,t);return t.lazy||n(),n}function mp(e){e.active&&(Jo(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var hp=0;function gp(e,t){const n=function(){if(!n.active)return e();if(!Jt.includes(n)){Jo(n);try{return bp(),Jt.push(n),Ee=n,e()}finally{Jt.pop(),ec(),Ee=Jt[Jt.length-1]}}};return n.id=hp++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function Jo(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Tt=!0,li=[];function fp(){li.push(Tt),Tt=!1}function bp(){li.push(Tt),Tt=!0}function ec(){const e=li.pop();Tt=e===void 0?!0:e}function ye(e,t,n){if(!Tt||Ee===void 0)return;let a=wr.get(e);a||wr.set(e,a=new Map);let r=a.get(n);r||a.set(n,r=new Set),r.has(Ee)||(r.add(Ee),Ee.deps.push(r),Ee.options.onTrack&&Ee.options.onTrack({effect:Ee,target:e,type:t,key:n}))}function We(e,t,n,a,r,i){const s=wr.get(e);if(!s)return;const o=new Set,c=u=>{u&&u.forEach(p=>{(p!==Ee||p.allowRecurse)&&o.add(p)})};if(t==="clear")s.forEach(c);else if(n==="length"&&lt(e))s.forEach((u,p)=>{(p==="length"||p>=a)&&c(u)});else switch(n!==void 0&&c(s.get(n)),t){case"add":lt(e)?ci(n)&&c(s.get("length")):(c(s.get(ut)),sn(e)&&c(s.get(xr)));break;case"delete":lt(e)||(c(s.get(ut)),sn(e)&&c(s.get(xr)));break;case"set":sn(e)&&c(s.get(ut));break}const l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:n,type:t,newValue:a,oldValue:r,oldTarget:i}),u.options.scheduler?u.options.scheduler(u):u()};o.forEach(l)}var _p=rp("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(oi)),yp=nc(),vp=nc(!0),Bi=wp();function wp(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const a=M(this);for(let i=0,s=this.length;i<s;i++)ye(a,"get",i+"");const r=a[t](...n);return r===-1||r===!1?a[t](...n.map(M)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){fp();const a=M(this)[t].apply(this,n);return ec(),a}}),e}function nc(e=!1,t=!1){return function(a,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_raw"&&i===(e?t?Np:sc:t?Ip:ic).get(a))return a;const s=lt(a);if(!e&&s&&Fa(Bi,r))return Reflect.get(Bi,r,i);const o=Reflect.get(a,r,i);return(oi(r)?tc.has(r):_p(r))||(e||ye(a,"get",r),t)?o:kr(o)?!s||!ci(r)?o.value:o:$a(o)?e?oc(o):mi(o):o}}var xp=kp();function kp(e=!1){return function(n,a,r,i){let s=n[a];if(!e&&(r=M(r),s=M(s),!lt(n)&&kr(s)&&!kr(r)))return s.value=r,!0;const o=lt(n)&&ci(a)?Number(a)<n.length:Fa(n,a),c=Reflect.set(n,a,r,i);return n===M(i)&&(o?Qo(r,s)&&We(n,"set",a,r,s):We(n,"add",a,r)),c}}function Cp(e,t){const n=Fa(e,t),a=e[t],r=Reflect.deleteProperty(e,t);return r&&n&&We(e,"delete",t,void 0,a),r}function Ep(e,t){const n=Reflect.has(e,t);return(!oi(t)||!tc.has(t))&&ye(e,"has",t),n}function Fp(e){return ye(e,"iterate",lt(e)?"length":ut),Reflect.ownKeys(e)}var $p={get:yp,set:xp,deleteProperty:Cp,has:Ep,ownKeys:Fp},jp={get:vp,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},ui=e=>$a(e)?mi(e):e,pi=e=>$a(e)?oc(e):e,di=e=>e,ja=e=>Reflect.getPrototypeOf(e);function qn(e,t,n=!1,a=!1){e=e.__v_raw;const r=M(e),i=M(t);t!==i&&!n&&ye(r,"get",t),!n&&ye(r,"get",i);const{has:s}=ja(r),o=a?di:n?pi:ui;if(s.call(r,t))return o(e.get(t));if(s.call(r,i))return o(e.get(i));e!==r&&e.get(t)}function zn(e,t=!1){const n=this.__v_raw,a=M(n),r=M(e);return e!==r&&!t&&ye(a,"has",e),!t&&ye(a,"has",r),e===r?n.has(e):n.has(e)||n.has(r)}function Bn(e,t=!1){return e=e.__v_raw,!t&&ye(M(e),"iterate",ut),Reflect.get(e,"size",e)}function Ui(e){e=M(e);const t=M(this);return ja(t).has.call(t,e)||(t.add(e),We(t,"add",e,e)),this}function Gi(e,t){t=M(t);const n=M(this),{has:a,get:r}=ja(n);let i=a.call(n,e);i?rc(n,a,e):(e=M(e),i=a.call(n,e));const s=r.call(n,e);return n.set(e,t),i?Qo(t,s)&&We(n,"set",e,t,s):We(n,"add",e,t),this}function Hi(e){const t=M(this),{has:n,get:a}=ja(t);let r=n.call(t,e);r?rc(t,n,e):(e=M(e),r=n.call(t,e));const i=a?a.call(t,e):void 0,s=t.delete(e);return r&&We(t,"delete",e,void 0,i),s}function Wi(){const e=M(this),t=e.size!==0,n=sn(e)?new Map(e):new Set(e),a=e.clear();return t&&We(e,"clear",void 0,void 0,n),a}function Un(e,t){return function(a,r){const i=this,s=i.__v_raw,o=M(s),c=t?di:e?pi:ui;return!e&&ye(o,"iterate",ut),s.forEach((l,u)=>a.call(r,c(l),c(u),i))}}function Gn(e,t,n){return function(...a){const r=this.__v_raw,i=M(r),s=sn(i),o=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=r[e](...a),u=n?di:t?pi:ui;return!t&&ye(i,"iterate",c?xr:ut),{next(){const{value:p,done:d}=l.next();return d?{value:p,done:d}:{value:o?[u(p[0]),u(p[1])]:u(p),done:d}},[Symbol.iterator](){return this}}}}function ze(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${up(e)} operation ${n}failed: target is readonly.`,M(this))}return e==="delete"?!1:this}}function Sp(){const e={get(i){return qn(this,i)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!1)},t={get(i){return qn(this,i,!1,!0)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!0)},n={get(i){return qn(this,i,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!1)},a={get(i){return qn(this,i,!0,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gn(i,!1,!1),n[i]=Gn(i,!0,!1),t[i]=Gn(i,!1,!0),a[i]=Gn(i,!0,!0)}),[e,n,t,a]}var[Ap,Tp]=Sp();function ac(e,t){const n=e?Tp:Ap;return(a,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?a:Reflect.get(Fa(n,r)&&r in a?n:a,r,i)}var Rp={get:ac(!1)},Op={get:ac(!0)};function rc(e,t,n){const a=M(n);if(a!==n&&t.call(e,a)){const r=Ko(e);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ic=new WeakMap,Ip=new WeakMap,sc=new WeakMap,Np=new WeakMap;function Lp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pp(e){return e.__v_skip||!Object.isExtensible(e)?0:Lp(Ko(e))}function mi(e){return e&&e.__v_isReadonly?e:cc(e,!1,$p,Rp,ic)}function oc(e){return cc(e,!0,jp,Op,sc)}function cc(e,t,n,a,r){if(!$a(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const s=Pp(e);if(s===0)return e;const o=new Proxy(e,s===2?a:n);return r.set(e,o),o}function M(e){return e&&M(e.__v_raw)||e}function kr(e){return!!(e&&e.__v_isRef===!0)}ve("nextTick",()=>ri);ve("dispatch",e=>rn.bind(rn,e));ve("watch",(e,{evaluateLater:t,cleanup:n})=>(a,r)=>{let i=t(a),o=ro(()=>{let c;return i(l=>c=l),c},r);n(o)});ve("store",Qu);ve("data",e=>mo(e));ve("root",e=>ka(e));ve("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=wn(Dp(e))),e._x_refs_proxy));function Dp(e){let t=[];return qt(e,n=>{n._x_refs&&t.push(n._x_refs)}),t}var za={};function lc(e){return za[e]||(za[e]=0),++za[e]}function Mp(e,t){return qt(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function qp(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=lc(t))}ve("id",(e,{cleanup:t})=>(n,a=null)=>{let r=`${n}${a?`-${a}`:""}`;return zp(e,r,t,()=>{let i=Mp(e,n),s=i?i._x_ids[n]:lc(n);return a?`${n}-${s}-${a}`:`${n}-${s}`})});Ea((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function zp(e,t,n,a){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let r=a();return e._x_id[t]=r,n(()=>{delete e._x_id[t]}),r}ve("el",e=>e);uc("Focus","focus","focus");uc("Persist","persist","persist");function uc(e,t,n){ve(t,a=>pe(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}W("modelable",(e,{expression:t},{effect:n,evaluateLater:a,cleanup:r})=>{let i=a(t),s=()=>{let u;return i(p=>u=p),u},o=a(`${t} = __placeholder`),c=u=>o(()=>{},{scope:{__placeholder:u}}),l=s();c(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,p=e._x_model.set,d=Wo({get(){return u()},set(m){p(m)}},{get(){return s()},set(m){c(m)}});r(d)})});W("teleport",(e,{modifiers:t,expression:n},{cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-teleport can only be used on a <template> tag",e);let r=Vi(n),i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,c=>{c.stopPropagation(),e.dispatchEvent(new c.constructor(c.type,c))})}),vn(i,{},e);let s=(o,c,l)=>{l.includes("prepend")?c.parentNode.insertBefore(o,c):l.includes("append")?c.parentNode.insertBefore(o,c.nextSibling):c.appendChild(o)};z(()=>{s(i,r,t),Ve(()=>{Pe(i)})()}),e._x_teleportPutBack=()=>{let o=Vi(n);z(()=>{s(e._x_teleport,o,t)})},a(()=>z(()=>{i.remove(),zt(i)}))});var Bp=document.createElement("div");function Vi(e){let t=Ve(()=>document.querySelector(e),()=>Bp)();return t||pe(`Cannot find x-teleport element for selector: "${e}"`),t}var pc=()=>{};pc.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};W("ignore",pc);W("effect",Ve((e,{expression:t},{effect:n})=>{n(ne(e,t))}));function Cr(e,t,n,a){let r=e,i=c=>a(c),s={},o=(c,l)=>u=>l(c,u);if(n.includes("dot")&&(t=Up(t)),n.includes("camel")&&(t=Gp(t)),n.includes("passive")&&(s.passive=!0),n.includes("capture")&&(s.capture=!0),n.includes("window")&&(r=window),n.includes("document")&&(r=document),n.includes("debounce")){let c=n[n.indexOf("debounce")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Go(i,l)}if(n.includes("throttle")){let c=n[n.indexOf("throttle")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Ho(i,l)}return n.includes("prevent")&&(i=o(i,(c,l)=>{l.preventDefault(),c(l)})),n.includes("stop")&&(i=o(i,(c,l)=>{l.stopPropagation(),c(l)})),n.includes("once")&&(i=o(i,(c,l)=>{c(l),r.removeEventListener(t,i,s)})),(n.includes("away")||n.includes("outside"))&&(r=document,i=o(i,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),n.includes("self")&&(i=o(i,(c,l)=>{l.target===e&&c(l)})),(Wp(t)||dc(t))&&(i=o(i,(c,l)=>{Vp(l,n)||c(l)})),r.addEventListener(t,i,s),()=>{r.removeEventListener(t,i,s)}}function Up(e){return e.replace(/-/g,".")}function Gp(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function ca(e){return!Array.isArray(e)&&!isNaN(e)}function Hp(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Wp(e){return["keydown","keyup"].includes(e)}function dc(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Vp(e,t){let n=t.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(i));if(n.includes("debounce")){let i=n.indexOf("debounce");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let i=n.indexOf("throttle");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&Zi(e.key).includes(n[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>n.includes(i));return n=n.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===r.length&&(dc(e.type)||Zi(e.key).includes(n[0])))}function Zi(e){if(!e)return[];e=Hp(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}W("model",(e,{modifiers:t,expression:n},{effect:a,cleanup:r})=>{let i=e;t.includes("parent")&&(i=e.parentNode);let s=ne(i,n),o;typeof n=="string"?o=ne(i,`${n} = __placeholder`):typeof n=="function"&&typeof n()=="string"?o=ne(i,`${n()} = __placeholder`):o=()=>{};let c=()=>{let d;return s(m=>d=m),Yi(d)?d.get():d},l=d=>{let m;s(g=>m=g),Yi(m)?m.set(d):o(()=>{},{scope:{__placeholder:d}})};typeof n=="string"&&e.type==="radio"&&z(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});var u=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let p=He?()=>{}:Cr(e,u,t,d=>{l(Ba(e,t,d,c()))});if(t.includes("fill")&&([void 0,null,""].includes(c())||si(e)&&Array.isArray(c())||e.tagName.toLowerCase()==="select"&&e.multiple)&&l(Ba(e,t,{target:e},c())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=p,r(()=>e._x_removeModelListeners.default()),e.form){let d=Cr(e.form,"reset",[],m=>{ri(()=>e._x_model&&e._x_model.set(Ba(e,t,{target:e},c())))});r(()=>d())}e._x_model={get(){return c()},set(d){l(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof n=="string"&&n.match(/\./)&&(d=""),window.fromModel=!0,z(()=>Mo(e,"value",d)),delete window.fromModel},a(()=>{let d=c();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function Ba(e,t,n,a){return z(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(si(e))if(Array.isArray(a)){let r=null;return t.includes("number")?r=Ua(n.target.value):t.includes("boolean")?r=ea(n.target.value):r=n.target.value,n.target.checked?a.includes(r)?a:a.concat([r]):a.filter(i=>!Zp(i,r))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return Ua(i)}):t.includes("boolean")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return ea(i)}):Array.from(n.target.selectedOptions).map(r=>r.value||r.text);{let r;return Uo(e)?n.target.checked?r=n.target.value:r=a:r=n.target.value,t.includes("number")?Ua(r):t.includes("boolean")?ea(r):t.includes("trim")?r.trim():r}}})}function Ua(e){let t=e?parseFloat(e):null;return Yp(t)?t:e}function Zp(e,t){return e==t}function Yp(e){return!Array.isArray(e)&&!isNaN(e)}function Yi(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}W("cloak",e=>queueMicrotask(()=>z(()=>e.removeAttribute(Mt("cloak")))));Oo(()=>`[${Mt("init")}]`);W("init",Ve((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));W("text",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.textContent=i})})})});W("html",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Pe(e),delete e._x_ignoreSelf})})})});ti(ko(":",Co(Mt("bind:"))));var mc=(e,{value:t,modifiers:n,expression:a,original:r},{effect:i,cleanup:s})=>{if(!t){let c={};ep(c),ne(e,a)(u=>{Zo(e,u,r)},{scope:c});return}if(t==="key")return Xp(e,a);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=ne(e,a);i(()=>o(c=>{c===void 0&&typeof a=="string"&&a.match(/\./)&&(c=""),z(()=>Mo(e,t,c,n))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};mc.inline=(e,{value:t,modifiers:n,expression:a})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:a,extract:!1})};W("bind",mc);function Xp(e,t){e._x_keyExpression=t}Ro(()=>`[${Mt("data")}]`);W("data",(e,{expression:t},{cleanup:n})=>{if(Kp(e))return;t=t===""?"{}":t;let a={};mr(a,e);let r={};np(r,a);let i=ct(e,t,{scope:r});(i===void 0||i===!0)&&(i={}),mr(i,e);let s=Pt(i);ho(s);let o=vn(e,s);s.init&&ct(e,s.init),n(()=>{s.destroy&&ct(e,s.destroy),o()})});Ea((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function Kp(e){return He?vr?!0:e.hasAttribute("data-has-alpine-state"):!1}W("show",(e,{modifiers:t,expression:n},{effect:a})=>{let r=ne(e,n);e._x_doHide||(e._x_doHide=()=>{z(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{z(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},o=()=>setTimeout(s),c=_r(p=>p?s():i(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,i):p?o():i()}),l,u=!0;a(()=>r(p=>{!u&&p===l||(t.includes("immediate")&&(p?o():i()),c(p),l=p,u=!1)}))});W("for",(e,{expression:t},{effect:n,cleanup:a})=>{let r=Jp(t),i=ne(e,r.items),s=ne(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},n(()=>Qp(e,r,i,s)),a(()=>{Object.values(e._x_lookup).forEach(o=>z(()=>{zt(o),o.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function Qp(e,t,n,a){let r=s=>typeof s=="object"&&!Array.isArray(s),i=e;n(s=>{ed(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let o=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(r(s))s=Object.entries(s).map(([f,b])=>{let _=Xi(t,b,f,s);a(w=>{u.includes(w)&&pe("Duplicate key on x-for",e),u.push(w)},{scope:{index:f,..._}}),l.push(_)});else for(let f=0;f<s.length;f++){let b=Xi(t,s[f],f,s);a(_=>{u.includes(_)&&pe("Duplicate key on x-for",e),u.push(_)},{scope:{index:f,...b}}),l.push(b)}let p=[],d=[],m=[],g=[];for(let f=0;f<c.length;f++){let b=c[f];u.indexOf(b)===-1&&m.push(b)}c=c.filter(f=>!m.includes(f));let v="template";for(let f=0;f<u.length;f++){let b=u[f],_=c.indexOf(b);if(_===-1)c.splice(f,0,b),p.push([v,f]);else if(_!==f){let w=c.splice(f,1)[0],h=c.splice(_-1,1)[0];c.splice(f,0,h),c.splice(_,0,w),d.push([w,h])}else g.push(b);v=b}for(let f=0;f<m.length;f++){let b=m[f];b in o&&(z(()=>{zt(o[b]),o[b].remove()}),delete o[b])}for(let f=0;f<d.length;f++){let[b,_]=d[f],w=o[b],h=o[_],C=document.createElement("div");z(()=>{h||pe('x-for ":key" is undefined or invalid',i,_,o),h.after(C),w.after(h),h._x_currentIfEl&&h.after(h._x_currentIfEl),C.before(w),w._x_currentIfEl&&w.after(w._x_currentIfEl),C.remove()}),h._x_refreshXForScope(l[u.indexOf(_)])}for(let f=0;f<p.length;f++){let[b,_]=p[f],w=b==="template"?i:o[b];w._x_currentIfEl&&(w=w._x_currentIfEl);let h=l[_],C=u[_],k=document.importNode(i.content,!0).firstElementChild,$=Pt(h);vn(k,$,i),k._x_refreshXForScope=T=>{Object.entries(T).forEach(([N,I])=>{$[N]=I})},z(()=>{w.after(k),Ve(()=>Pe(k))()}),typeof C=="object"&&pe("x-for key cannot be an object, it must be a string or an integer",i),o[C]=k}for(let f=0;f<g.length;f++)o[g[f]]._x_refreshXForScope(l[u.indexOf(g[f])]);i._x_prevKeys=u})}function Jp(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,a=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=e.match(a);if(!r)return;let i={};i.items=r[2].trim();let s=r[1].replace(n,"").trim(),o=s.match(t);return o?(i.item=s.replace(t,"").trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=s,i}function Xi(e,t,n,a){let r={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,o)=>{r[s]=t[o]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{r[s]=t[s]}):r[e.item]=t,e.index&&(r[e.index]=n),e.collection&&(r[e.collection]=a),r}function ed(e){return!Array.isArray(e)&&!isNaN(e)}function hc(){}hc.inline=(e,{expression:t},{cleanup:n})=>{let a=ka(e);a._x_refs||(a._x_refs={}),a._x_refs[t]=e,n(()=>delete a._x_refs[t])};W("ref",hc);W("if",(e,{expression:t},{effect:n,cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-if can only be used on a <template> tag",e);let r=ne(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return vn(o,{},e),z(()=>{e.after(o),Ve(()=>Pe(o))()}),e._x_currentIfEl=o,e._x_undoIf=()=>{z(()=>{zt(o),o.remove()}),delete e._x_currentIfEl},o},s=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>r(o=>{o?i():s()})),a(()=>e._x_undoIf&&e._x_undoIf())});W("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(r=>qp(e,r))});Ea((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});ti(ko("@",Co(Mt("on:"))));W("on",Ve((e,{value:t,modifiers:n,expression:a},{cleanup:r})=>{let i=a?ne(e,a):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=Cr(e,t,n,o=>{i(()=>{},{scope:{$event:o},params:[o]})});r(()=>s())}));Sa("Collapse","collapse","collapse");Sa("Intersect","intersect","intersect");Sa("Focus","trap","focus");Sa("Mask","mask","mask");function Sa(e,t,n){W(t,a=>pe(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}xn.setEvaluator(yo);xn.setReactivityEngine({reactive:mi,effect:dp,release:mp,raw:M});var td=xn,gc=td,ae="top",he="bottom",ge="right",re="left",hi="auto",kn=[ae,he,ge,re],Rt="start",mn="end",nd="clippingParents",fc="viewport",en="popper",ad="reference",Ki=kn.reduce(function(e,t){return e.concat([t+"-"+Rt,t+"-"+mn])},[]),bc=[].concat(kn,[hi]).reduce(function(e,t){return e.concat([t,t+"-"+Rt,t+"-"+mn])},[]),rd="beforeRead",id="read",sd="afterRead",od="beforeMain",cd="main",ld="afterMain",ud="beforeWrite",pd="write",dd="afterWrite",md=[rd,id,sd,od,cd,ld,ud,pd,dd];function je(e){return e?(e.nodeName||"").toLowerCase():null}function oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mt(e){var t=oe(e).Element;return e instanceof t||e instanceof Element}function me(e){var t=oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function gi(e){if(typeof ShadowRoot>"u")return!1;var t=oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hd(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!me(i)||!je(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(s){var o=r[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function gd(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},s=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),o=s.reduce(function(c,l){return c[l]="",c},{});!me(r)||!je(r)||(Object.assign(r.style,o),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const _c={name:"applyStyles",enabled:!0,phase:"write",fn:hd,effect:gd,requires:["computeStyles"]};function $e(e){return e.split("-")[0]}var pt=Math.max,la=Math.min,Ot=Math.round;function Er(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yc(){return!/^((?!chrome|android).)*safari/i.test(Er())}function It(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),r=1,i=1;t&&me(e)&&(r=e.offsetWidth>0&&Ot(a.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ot(a.height)/e.offsetHeight||1);var s=mt(e)?oe(e):window,o=s.visualViewport,c=!yc()&&n,l=(a.left+(c&&o?o.offsetLeft:0))/r,u=(a.top+(c&&o?o.offsetTop:0))/i,p=a.width/r,d=a.height/i;return{width:p,height:d,top:u,right:l+p,bottom:u+d,left:l,x:l,y:u}}function fi(e){var t=It(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function vc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&gi(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function De(e){return oe(e).getComputedStyle(e)}function fd(e){return["table","td","th"].indexOf(je(e))>=0}function Ze(e){return((mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return je(e)==="html"?e:e.assignedSlot||e.parentNode||(gi(e)?e.host:null)||Ze(e)}function Qi(e){return!me(e)||De(e).position==="fixed"?null:e.offsetParent}function bd(e){var t=/firefox/i.test(Er()),n=/Trident/i.test(Er());if(n&&me(e)){var a=De(e);if(a.position==="fixed")return null}var r=Aa(e);for(gi(r)&&(r=r.host);me(r)&&["html","body"].indexOf(je(r))<0;){var i=De(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Cn(e){for(var t=oe(e),n=Qi(e);n&&fd(n)&&De(n).position==="static";)n=Qi(n);return n&&(je(n)==="html"||je(n)==="body"&&De(n).position==="static")?t:n||bd(e)||t}function bi(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function on(e,t,n){return pt(e,la(t,n))}function _d(e,t,n){var a=on(e,t,n);return a>n?n:a}function wc(){return{top:0,right:0,bottom:0,left:0}}function xc(e){return Object.assign({},wc(),e)}function kc(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var yd=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,xc(typeof t!="number"?t:kc(t,kn))};function vd(e){var t,n=e.state,a=e.name,r=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=$e(n.placement),c=bi(o),l=[re,ge].indexOf(o)>=0,u=l?"height":"width";if(!(!i||!s)){var p=yd(r.padding,n),d=fi(i),m=c==="y"?ae:re,g=c==="y"?he:ge,v=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],f=s[c]-n.rects.reference[c],b=Cn(i),_=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,w=v/2-f/2,h=p[m],C=_-d[u]-p[g],k=_/2-d[u]/2+w,$=on(h,k,C),T=c;n.modifiersData[a]=(t={},t[T]=$,t.centerOffset=$-k,t)}}function wd(e){var t=e.state,n=e.options,a=n.element,r=a===void 0?"[data-popper-arrow]":a;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||vc(t.elements.popper,r)&&(t.elements.arrow=r))}const xd={name:"arrow",enabled:!0,phase:"main",fn:vd,effect:wd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nt(e){return e.split("-")[1]}var kd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Cd(e,t){var n=e.x,a=e.y,r=t.devicePixelRatio||1;return{x:Ot(n*r)/r||0,y:Ot(a*r)/r||0}}function Ji(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.variation,s=e.offsets,o=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,g=s.y,v=g===void 0?0:g,f=typeof u=="function"?u({x:m,y:v}):{x:m,y:v};m=f.x,v=f.y;var b=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),w=re,h=ae,C=window;if(l){var k=Cn(n),$="clientHeight",T="clientWidth";if(k===oe(n)&&(k=Ze(n),De(k).position!=="static"&&o==="absolute"&&($="scrollHeight",T="scrollWidth")),k=k,r===ae||(r===re||r===ge)&&i===mn){h=he;var N=p&&k===C&&C.visualViewport?C.visualViewport.height:k[$];v-=N-a.height,v*=c?1:-1}if(r===re||(r===ae||r===he)&&i===mn){w=ge;var I=p&&k===C&&C.visualViewport?C.visualViewport.width:k[T];m-=I-a.width,m*=c?1:-1}}var D=Object.assign({position:o},l&&kd),R=u===!0?Cd({x:m,y:v},oe(n)):{x:m,y:v};if(m=R.x,v=R.y,c){var L;return Object.assign({},D,(L={},L[h]=_?"0":"",L[w]=b?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",L))}return Object.assign({},D,(t={},t[h]=_?v+"px":"",t[w]=b?m+"px":"",t.transform="",t))}function Ed(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,c=o===void 0?!0:o,l={placement:$e(t.placement),variation:Nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ji(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ji(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Fd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ed,data:{}};var Hn={passive:!0};function $d(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,s=a.resize,o=s===void 0?!0:s,c=oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Hn)}),o&&c.addEventListener("resize",n.update,Hn),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Hn)}),o&&c.removeEventListener("resize",n.update,Hn)}}const jd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$d,data:{}};var Sd={left:"right",right:"left",bottom:"top",top:"bottom"};function ta(e){return e.replace(/left|right|bottom|top/g,function(t){return Sd[t]})}var Ad={start:"end",end:"start"};function es(e){return e.replace(/start|end/g,function(t){return Ad[t]})}function _i(e){var t=oe(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function yi(e){return It(Ze(e)).left+_i(e).scrollLeft}function Td(e,t){var n=oe(e),a=Ze(e),r=n.visualViewport,i=a.clientWidth,s=a.clientHeight,o=0,c=0;if(r){i=r.width,s=r.height;var l=yc();(l||!l&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:o+yi(e),y:c}}function Rd(e){var t,n=Ze(e),a=_i(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=pt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=pt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-a.scrollLeft+yi(e),c=-a.scrollTop;return De(r||n).direction==="rtl"&&(o+=pt(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:o,y:c}}function vi(e){var t=De(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function Cc(e){return["html","body","#document"].indexOf(je(e))>=0?e.ownerDocument.body:me(e)&&vi(e)?e:Cc(Aa(e))}function cn(e,t){var n;t===void 0&&(t=[]);var a=Cc(e),r=a===((n=e.ownerDocument)==null?void 0:n.body),i=oe(a),s=r?[i].concat(i.visualViewport||[],vi(a)?a:[]):a,o=t.concat(s);return r?o:o.concat(cn(Aa(s)))}function Fr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Od(e,t){var n=It(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ts(e,t,n){return t===fc?Fr(Td(e,n)):mt(t)?Od(t,n):Fr(Rd(Ze(e)))}function Id(e){var t=cn(Aa(e)),n=["absolute","fixed"].indexOf(De(e).position)>=0,a=n&&me(e)?Cn(e):e;return mt(a)?t.filter(function(r){return mt(r)&&vc(r,a)&&je(r)!=="body"}):[]}function Nd(e,t,n,a){var r=t==="clippingParents"?Id(e):[].concat(t),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(c,l){var u=ts(e,l,a);return c.top=pt(u.top,c.top),c.right=la(u.right,c.right),c.bottom=la(u.bottom,c.bottom),c.left=pt(u.left,c.left),c},ts(e,s,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Ec(e){var t=e.reference,n=e.element,a=e.placement,r=a?$e(a):null,i=a?Nt(a):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,c;switch(r){case ae:c={x:s,y:t.y-n.height};break;case he:c={x:s,y:t.y+t.height};break;case ge:c={x:t.x+t.width,y:o};break;case re:c={x:t.x-n.width,y:o};break;default:c={x:t.x,y:t.y}}var l=r?bi(r):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case Rt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case mn:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function hn(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.strategy,s=i===void 0?e.strategy:i,o=n.boundary,c=o===void 0?nd:o,l=n.rootBoundary,u=l===void 0?fc:l,p=n.elementContext,d=p===void 0?en:p,m=n.altBoundary,g=m===void 0?!1:m,v=n.padding,f=v===void 0?0:v,b=xc(typeof f!="number"?f:kc(f,kn)),_=d===en?ad:en,w=e.rects.popper,h=e.elements[g?_:d],C=Nd(mt(h)?h:h.contextElement||Ze(e.elements.popper),c,u,s),k=It(e.elements.reference),$=Ec({reference:k,element:w,placement:r}),T=Fr(Object.assign({},w,$)),N=d===en?T:k,I={top:C.top-N.top+b.top,bottom:N.bottom-C.bottom+b.bottom,left:C.left-N.left+b.left,right:N.right-C.right+b.right},D=e.modifiersData.offset;if(d===en&&D){var R=D[r];Object.keys(I).forEach(function(L){var q=[ge,he].indexOf(L)>=0?1:-1,U=[ae,he].indexOf(L)>=0?"y":"x";I[L]+=R[U]*q})}return I}function Ld(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?bc:c,u=Nt(a),p=u?o?Ki:Ki.filter(function(g){return Nt(g)===u}):kn,d=p.filter(function(g){return l.indexOf(g)>=0});d.length===0&&(d=p);var m=d.reduce(function(g,v){return g[v]=hn(e,{placement:v,boundary:r,rootBoundary:i,padding:s})[$e(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Pd(e){if($e(e)===hi)return[];var t=ta(e);return[es(e),t,es(t)]}function Dd(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!0:s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,v=n.allowedAutoPlacements,f=t.options.placement,b=$e(f),_=b===f,w=c||(_||!g?[ta(f)]:Pd(f)),h=[f].concat(w).reduce(function(Se,fe){return Se.concat($e(fe)===hi?Ld(t,{placement:fe,boundary:u,rootBoundary:p,padding:l,flipVariations:g,allowedAutoPlacements:v}):fe)},[]),C=t.rects.reference,k=t.rects.popper,$=new Map,T=!0,N=h[0],I=0;I<h.length;I++){var D=h[I],R=$e(D),L=Nt(D)===Rt,q=[ae,he].indexOf(R)>=0,U=q?"width":"height",G=hn(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),Q=q?L?ge:re:L?he:ae;C[U]>k[U]&&(Q=ta(Q));var K=ta(Q),we=[];if(i&&we.push(G[R]<=0),o&&we.push(G[Q]<=0,G[K]<=0),we.every(function(Se){return Se})){N=D,T=!1;break}$.set(D,we)}if(T)for(var xe=g?3:1,Ye=function(fe){var Ae=h.find(function(bt){var Te=$.get(bt);if(Te)return Te.slice(0,fe).every(function(_t){return _t})});if(Ae)return N=Ae,"break"},ke=xe;ke>0;ke--){var Xe=Ye(ke);if(Xe==="break")break}t.placement!==N&&(t.modifiersData[a]._skip=!0,t.placement=N,t.reset=!0)}}const Md={name:"flip",enabled:!0,phase:"main",fn:Dd,requiresIfExists:["offset"],data:{_skip:!1}};function ns(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function as(e){return[ae,ge,he,re].some(function(t){return e[t]>=0})}function qd(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=hn(t,{elementContext:"reference"}),o=hn(t,{altBoundary:!0}),c=ns(s,a),l=ns(o,r,i),u=as(c),p=as(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const zd={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qd};function Bd(e,t,n){var a=$e(e),r=[re,ae].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*r,[re,ge].indexOf(a)>=0?{x:o,y:s}:{x:s,y:o}}function Ud(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,s=bc.reduce(function(u,p){return u[p]=Bd(p,t.rects,i),u},{}),o=s[t.placement],c=o.x,l=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[a]=s}const Gd={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ud};function Hd(e){var t=e.state,n=e.name;t.modifiersData[n]=Ec({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Wd={name:"popperOffsets",enabled:!0,phase:"read",fn:Hd,data:{}};function Vd(e){return e==="x"?"y":"x"}function Zd(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!1:s,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,g=n.tetherOffset,v=g===void 0?0:g,f=hn(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:u}),b=$e(t.placement),_=Nt(t.placement),w=!_,h=bi(b),C=Vd(h),k=t.modifiersData.popperOffsets,$=t.rects.reference,T=t.rects.popper,N=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,I=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(k){if(i){var L,q=h==="y"?ae:re,U=h==="y"?he:ge,G=h==="y"?"height":"width",Q=k[h],K=Q+f[q],we=Q-f[U],xe=m?-T[G]/2:0,Ye=_===Rt?$[G]:T[G],ke=_===Rt?-T[G]:-$[G],Xe=t.elements.arrow,Se=m&&Xe?fi(Xe):{width:0,height:0},fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wc(),Ae=fe[q],bt=fe[U],Te=on(0,$[G],Se[G]),_t=w?$[G]/2-xe-Te-Ae-I.mainAxis:Ye-Te-Ae-I.mainAxis,Me=w?-$[G]/2+xe+Te+bt+I.mainAxis:ke+Te+bt+I.mainAxis,yt=t.elements.arrow&&Cn(t.elements.arrow),Sn=yt?h==="y"?yt.clientTop||0:yt.clientLeft||0:0,Wt=(L=D?.[h])!=null?L:0,An=Q+_t-Wt-Sn,Tn=Q+Me-Wt,Vt=on(m?la(K,An):K,Q,m?pt(we,Tn):we);k[h]=Vt,R[h]=Vt-Q}if(o){var Zt,Rn=h==="x"?ae:re,On=h==="x"?he:ge,Re=k[C],qe=C==="y"?"height":"width",Yt=Re+f[Rn],Ke=Re-f[On],Xt=[ae,re].indexOf(b)!==-1,In=(Zt=D?.[C])!=null?Zt:0,Nn=Xt?Yt:Re-$[qe]-T[qe]-In+I.altAxis,Ln=Xt?Re+$[qe]+T[qe]-In-I.altAxis:Ke,Pn=m&&Xt?_d(Nn,Re,Ln):on(m?Nn:Yt,Re,m?Ln:Ke);k[C]=Pn,R[C]=Pn-Re}t.modifiersData[a]=R}}const Yd={name:"preventOverflow",enabled:!0,phase:"main",fn:Zd,requiresIfExists:["offset"]};function Xd(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Kd(e){return e===oe(e)||!me(e)?_i(e):Xd(e)}function Qd(e){var t=e.getBoundingClientRect(),n=Ot(t.width)/e.offsetWidth||1,a=Ot(t.height)/e.offsetHeight||1;return n!==1||a!==1}function Jd(e,t,n){n===void 0&&(n=!1);var a=me(t),r=me(t)&&Qd(t),i=Ze(t),s=It(e,r,n),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&((je(t)!=="body"||vi(i))&&(o=Kd(t)),me(t)?(c=It(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=yi(i))),{x:s.left+o.scrollLeft-c.x,y:s.top+o.scrollTop-c.y,width:s.width,height:s.height}}function em(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var c=t.get(o);c&&r(c)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function tm(e){var t=em(e);return md.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function nm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function am(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign({},r,a,{options:Object.assign({},r.options,a.options),data:Object.assign({},r.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var rs={placement:"bottom",modifiers:[],strategy:"absolute"};function is(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function rm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?rs:r;return function(o,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},rs,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},p=[],d=!1,m={state:u,setOptions:function(b){var _=typeof b=="function"?b(u.options):b;v(),u.options=Object.assign({},i,u.options,_),u.scrollParents={reference:mt(o)?cn(o):o.contextElement?cn(o.contextElement):[],popper:cn(c)};var w=tm(am([].concat(a,u.options.modifiers)));return u.orderedModifiers=w.filter(function(h){return h.enabled}),g(),m.update()},forceUpdate:function(){if(!d){var b=u.elements,_=b.reference,w=b.popper;if(is(_,w)){u.rects={reference:Jd(_,Cn(w),u.options.strategy==="fixed"),popper:fi(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var h=0;h<u.orderedModifiers.length;h++){if(u.reset===!0){u.reset=!1,h=-1;continue}var C=u.orderedModifiers[h],k=C.fn,$=C.options,T=$===void 0?{}:$,N=C.name;typeof k=="function"&&(u=k({state:u,options:T,name:N,instance:m})||u)}}}},update:nm(function(){return new Promise(function(f){m.forceUpdate(),f(u)})}),destroy:function(){v(),d=!0}};if(!is(o,c))return m;m.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)});function g(){u.orderedModifiers.forEach(function(f){var b=f.name,_=f.options,w=_===void 0?{}:_,h=f.effect;if(typeof h=="function"){var C=h({state:u,name:b,instance:m,options:w}),k=function(){};p.push(C||k)}})}function v(){p.forEach(function(f){return f()}),p=[]}return m}}var im=[jd,Wd,Fd,_c,Gd,Md,Yd,xd,zd],sm=rm({defaultModifiers:im}),om="tippy-box",Fc="tippy-content",cm="tippy-backdrop",$c="tippy-arrow",jc="tippy-svg-arrow",tt={passive:!0,capture:!0},Sc=function(){return document.body};function Ga(e,t,n){if(Array.isArray(e)){var a=e[t];return a??(Array.isArray(n)?n[t]:n)}return e}function wi(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Ac(e,t){return typeof e=="function"?e.apply(void 0,t):e}function ss(e,t){if(t===0)return e;var n;return function(a){clearTimeout(n),n=setTimeout(function(){e(a)},t)}}function lm(e){return e.split(/\s+/).filter(Boolean)}function Ct(e){return[].concat(e)}function os(e,t){e.indexOf(t)===-1&&e.push(t)}function um(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function pm(e){return e.split("-")[0]}function ua(e){return[].slice.call(e)}function cs(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ln(){return document.createElement("div")}function Ta(e){return["Element","Fragment"].some(function(t){return wi(e,t)})}function dm(e){return wi(e,"NodeList")}function mm(e){return wi(e,"MouseEvent")}function hm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function gm(e){return Ta(e)?[e]:dm(e)?ua(e):Array.isArray(e)?e:ua(document.querySelectorAll(e))}function Ha(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function ls(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function fm(e){var t,n=Ct(e),a=n[0];return a!=null&&(t=a.ownerDocument)!=null&&t.body?a.ownerDocument:document}function bm(e,t){var n=t.clientX,a=t.clientY;return e.every(function(r){var i=r.popperRect,s=r.popperState,o=r.props,c=o.interactiveBorder,l=pm(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=l==="bottom"?u.top.y:0,d=l==="top"?u.bottom.y:0,m=l==="right"?u.left.x:0,g=l==="left"?u.right.x:0,v=i.top-a+p>c,f=a-i.bottom-d>c,b=i.left-n+m>c,_=n-i.right-g>c;return v||f||b||_})}function Wa(e,t,n){var a=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){e[a](r,n)})}function us(e,t){for(var n=t;n;){var a;if(e.contains(n))return!0;n=n.getRootNode==null||(a=n.getRootNode())==null?void 0:a.host}return!1}var Fe={isTouch:!1},ps=0;function _m(){Fe.isTouch||(Fe.isTouch=!0,window.performance&&document.addEventListener("mousemove",Tc))}function Tc(){var e=performance.now();e-ps<20&&(Fe.isTouch=!1,document.removeEventListener("mousemove",Tc)),ps=e}function ym(){var e=document.activeElement;if(hm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function vm(){document.addEventListener("touchstart",_m,tt),window.addEventListener("blur",ym)}var wm=typeof window<"u"&&typeof document<"u",xm=wm?!!window.msCrypto:!1,km={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Cm={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_e=Object.assign({appendTo:Sc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},km,Cm),Em=Object.keys(_e),Fm=function(t){var n=Object.keys(t);n.forEach(function(a){_e[a]=t[a]})};function Rc(e){var t=e.plugins||[],n=t.reduce(function(a,r){var i=r.name,s=r.defaultValue;if(i){var o;a[i]=e[i]!==void 0?e[i]:(o=_e[i])!=null?o:s}return a},{});return Object.assign({},e,n)}function $m(e,t){var n=t?Object.keys(Rc(Object.assign({},_e,{plugins:t}))):Em,a=n.reduce(function(r,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return r;if(i==="content")r[i]=s;else try{r[i]=JSON.parse(s)}catch{r[i]=s}return r},{});return a}function ds(e,t){var n=Object.assign({},t,{content:Ac(t.content,[e])},t.ignoreAttributes?{}:$m(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var jm=function(){return"innerHTML"};function $r(e,t){e[jm()]=t}function ms(e){var t=ln();return e===!0?t.className=$c:(t.className=jc,Ta(e)?t.appendChild(e):$r(t,e)),t}function hs(e,t){Ta(t.content)?($r(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$r(e,t.content):e.textContent=t.content)}function jr(e){var t=e.firstElementChild,n=ua(t.children);return{box:t,content:n.find(function(a){return a.classList.contains(Fc)}),arrow:n.find(function(a){return a.classList.contains($c)||a.classList.contains(jc)}),backdrop:n.find(function(a){return a.classList.contains(cm)})}}function Oc(e){var t=ln(),n=ln();n.className=om,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var a=ln();a.className=Fc,a.setAttribute("data-state","hidden"),hs(a,e.props),t.appendChild(n),n.appendChild(a),r(e.props,e.props);function r(i,s){var o=jr(t),c=o.box,l=o.content,u=o.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&hs(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(ms(s.arrow))):c.appendChild(ms(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:r}}Oc.$$tippy=!0;var Sm=1,Wn=[],Va=[];function Am(e,t){var n=ds(e,Object.assign({},_e,Rc(cs(t)))),a,r,i,s=!1,o=!1,c=!1,l=!1,u,p,d,m=[],g=ss(An,n.interactiveDebounce),v,f=Sm++,b=null,_=um(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:f,reference:e,popper:ln(),popperInstance:b,props:n,state:w,plugins:_,clearDelayTimeouts:Nn,setProps:Ln,setContent:Pn,show:zl,hide:Bl,hideWithInteractivity:Ul,enable:Xt,disable:In,unmount:Gl,destroy:Hl};if(!n.render)return h;var C=n.render(h),k=C.popper,$=C.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+h.id,h.popper=k,e._tippy=h,k._tippy=h;var T=_.map(function(y){return y.fn(h)}),N=e.hasAttribute("aria-expanded");return yt(),xe(),Q(),K("onCreate",[h]),n.showOnCreate&&Yt(),k.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",g)}),h;function I(){var y=h.props.touch;return Array.isArray(y)?y:[y,0]}function D(){return I()[0]==="hold"}function R(){var y;return!!((y=h.props.render)!=null&&y.$$tippy)}function L(){return v||e}function q(){var y=L().parentNode;return y?fm(y):document}function U(){return jr(k)}function G(y){return h.state.isMounted&&!h.state.isVisible||Fe.isTouch||u&&u.type==="focus"?0:Ga(h.props.delay,y?0:1,_e.delay)}function Q(y){y===void 0&&(y=!1),k.style.pointerEvents=h.props.interactive&&!y?"":"none",k.style.zIndex=""+h.props.zIndex}function K(y,E,F){if(F===void 0&&(F=!0),T.forEach(function(A){A[y]&&A[y].apply(A,E)}),F){var O;(O=h.props)[y].apply(O,E)}}function we(){var y=h.props.aria;if(y.content){var E="aria-"+y.content,F=k.id,O=Ct(h.props.triggerTarget||e);O.forEach(function(A){var te=A.getAttribute(E);if(h.state.isVisible)A.setAttribute(E,te?te+" "+F:F);else{var ce=te&&te.replace(F,"").trim();ce?A.setAttribute(E,ce):A.removeAttribute(E)}})}}function xe(){if(!(N||!h.props.aria.expanded)){var y=Ct(h.props.triggerTarget||e);y.forEach(function(E){h.props.interactive?E.setAttribute("aria-expanded",h.state.isVisible&&E===L()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ye(){q().removeEventListener("mousemove",g),Wn=Wn.filter(function(y){return y!==g})}function ke(y){if(!(Fe.isTouch&&(c||y.type==="mousedown"))){var E=y.composedPath&&y.composedPath()[0]||y.target;if(!(h.props.interactive&&us(k,E))){if(Ct(h.props.triggerTarget||e).some(function(F){return us(F,E)})){if(Fe.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else K("onClickOutside",[h,y]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),o=!0,setTimeout(function(){o=!1}),h.state.isMounted||Ae())}}}function Xe(){c=!0}function Se(){c=!1}function fe(){var y=q();y.addEventListener("mousedown",ke,!0),y.addEventListener("touchend",ke,tt),y.addEventListener("touchstart",Se,tt),y.addEventListener("touchmove",Xe,tt)}function Ae(){var y=q();y.removeEventListener("mousedown",ke,!0),y.removeEventListener("touchend",ke,tt),y.removeEventListener("touchstart",Se,tt),y.removeEventListener("touchmove",Xe,tt)}function bt(y,E){_t(y,function(){!h.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&E()})}function Te(y,E){_t(y,E)}function _t(y,E){var F=U().box;function O(A){A.target===F&&(Wa(F,"remove",O),E())}if(y===0)return E();Wa(F,"remove",p),Wa(F,"add",O),p=O}function Me(y,E,F){F===void 0&&(F=!1);var O=Ct(h.props.triggerTarget||e);O.forEach(function(A){A.addEventListener(y,E,F),m.push({node:A,eventType:y,handler:E,options:F})})}function yt(){D()&&(Me("touchstart",Wt,{passive:!0}),Me("touchend",Tn,{passive:!0})),lm(h.props.trigger).forEach(function(y){if(y!=="manual")switch(Me(y,Wt),y){case"mouseenter":Me("mouseleave",Tn);break;case"focus":Me(xm?"focusout":"blur",Vt);break;case"focusin":Me("focusout",Vt);break}})}function Sn(){m.forEach(function(y){var E=y.node,F=y.eventType,O=y.handler,A=y.options;E.removeEventListener(F,O,A)}),m=[]}function Wt(y){var E,F=!1;if(!(!h.state.isEnabled||Zt(y)||o)){var O=((E=u)==null?void 0:E.type)==="focus";u=y,v=y.currentTarget,xe(),!h.state.isVisible&&mm(y)&&Wn.forEach(function(A){return A(y)}),y.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?F=!0:Yt(y),y.type==="click"&&(s=!F),F&&!O&&Ke(y)}}function An(y){var E=y.target,F=L().contains(E)||k.contains(E);if(!(y.type==="mousemove"&&F)){var O=qe().concat(k).map(function(A){var te,ce=A._tippy,vt=(te=ce.popperInstance)==null?void 0:te.state;return vt?{popperRect:A.getBoundingClientRect(),popperState:vt,props:n}:null}).filter(Boolean);bm(O,y)&&(Ye(),Ke(y))}}function Tn(y){var E=Zt(y)||h.props.trigger.indexOf("click")>=0&&s;if(!E){if(h.props.interactive){h.hideWithInteractivity(y);return}Ke(y)}}function Vt(y){h.props.trigger.indexOf("focusin")<0&&y.target!==L()||h.props.interactive&&y.relatedTarget&&k.contains(y.relatedTarget)||Ke(y)}function Zt(y){return Fe.isTouch?D()!==y.type.indexOf("touch")>=0:!1}function Rn(){On();var y=h.props,E=y.popperOptions,F=y.placement,O=y.offset,A=y.getReferenceClientRect,te=y.moveTransition,ce=R()?jr(k).arrow:null,vt=A?{getBoundingClientRect:A,contextElement:A.contextElement||L()}:e,Li={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Dn){var wt=Dn.state;if(R()){var Wl=U(),Da=Wl.box;["placement","reference-hidden","escaped"].forEach(function(Mn){Mn==="placement"?Da.setAttribute("data-placement",wt.placement):wt.attributes.popper["data-popper-"+Mn]?Da.setAttribute("data-"+Mn,""):Da.removeAttribute("data-"+Mn)}),wt.attributes.popper={}}}},Qe=[{name:"offset",options:{offset:O}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},Li];R()&&ce&&Qe.push({name:"arrow",options:{element:ce,padding:3}}),Qe.push.apply(Qe,E?.modifiers||[]),h.popperInstance=sm(vt,k,Object.assign({},E,{placement:F,onFirstUpdate:d,modifiers:Qe}))}function On(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function Re(){var y=h.props.appendTo,E,F=L();h.props.interactive&&y===Sc||y==="parent"?E=F.parentNode:E=Ac(y,[F]),E.contains(k)||E.appendChild(k),h.state.isMounted=!0,Rn()}function qe(){return ua(k.querySelectorAll("[data-tippy-root]"))}function Yt(y){h.clearDelayTimeouts(),y&&K("onTrigger",[h,y]),fe();var E=G(!0),F=I(),O=F[0],A=F[1];Fe.isTouch&&O==="hold"&&A&&(E=A),E?a=setTimeout(function(){h.show()},E):h.show()}function Ke(y){if(h.clearDelayTimeouts(),K("onUntrigger",[h,y]),!h.state.isVisible){Ae();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(y.type)>=0&&s)){var E=G(!1);E?r=setTimeout(function(){h.state.isVisible&&h.hide()},E):i=requestAnimationFrame(function(){h.hide()})}}function Xt(){h.state.isEnabled=!0}function In(){h.hide(),h.state.isEnabled=!1}function Nn(){clearTimeout(a),clearTimeout(r),cancelAnimationFrame(i)}function Ln(y){if(!h.state.isDestroyed){K("onBeforeUpdate",[h,y]),Sn();var E=h.props,F=ds(e,Object.assign({},E,cs(y),{ignoreAttributes:!0}));h.props=F,yt(),E.interactiveDebounce!==F.interactiveDebounce&&(Ye(),g=ss(An,F.interactiveDebounce)),E.triggerTarget&&!F.triggerTarget?Ct(E.triggerTarget).forEach(function(O){O.removeAttribute("aria-expanded")}):F.triggerTarget&&e.removeAttribute("aria-expanded"),xe(),Q(),$&&$(E,F),h.popperInstance&&(Rn(),qe().forEach(function(O){requestAnimationFrame(O._tippy.popperInstance.forceUpdate)})),K("onAfterUpdate",[h,y])}}function Pn(y){h.setProps({content:y})}function zl(){var y=h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Fe.isTouch&&!h.props.touch,A=Ga(h.props.duration,0,_e.duration);if(!(y||E||F||O)&&!L().hasAttribute("disabled")&&(K("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,R()&&(k.style.visibility="visible"),Q(),fe(),h.state.isMounted||(k.style.transition="none"),R()){var te=U(),ce=te.box,vt=te.content;Ha([ce,vt],0)}d=function(){var Qe;if(!(!h.state.isVisible||l)){if(l=!0,k.offsetHeight,k.style.transition=h.props.moveTransition,R()&&h.props.animation){var Pa=U(),Dn=Pa.box,wt=Pa.content;Ha([Dn,wt],A),ls([Dn,wt],"visible")}we(),xe(),os(Va,h),(Qe=h.popperInstance)==null||Qe.forceUpdate(),K("onMount",[h]),h.props.animation&&R()&&Te(A,function(){h.state.isShown=!0,K("onShown",[h])})}},Re()}}function Bl(){var y=!h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Ga(h.props.duration,1,_e.duration);if(!(y||E||F)&&(K("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,l=!1,s=!1,R()&&(k.style.visibility="hidden"),Ye(),Ae(),Q(!0),R()){var A=U(),te=A.box,ce=A.content;h.props.animation&&(Ha([te,ce],O),ls([te,ce],"hidden"))}we(),xe(),h.props.animation?R()&&bt(O,h.unmount):h.unmount()}}function Ul(y){q().addEventListener("mousemove",g),os(Wn,g),g(y)}function Gl(){h.state.isVisible&&h.hide(),h.state.isMounted&&(On(),qe().forEach(function(y){y._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Va=Va.filter(function(y){return y!==h}),h.state.isMounted=!1,K("onHidden",[h]))}function Hl(){h.state.isDestroyed||(h.clearDelayTimeouts(),h.unmount(),Sn(),delete e._tippy,h.state.isDestroyed=!0,K("onDestroy",[h]))}}function En(e,t){t===void 0&&(t={});var n=_e.plugins.concat(t.plugins||[]);vm();var a=Object.assign({},t,{plugins:n}),r=gm(e),i=r.reduce(function(s,o){var c=o&&Am(o,a);return c&&s.push(c),s},[]);return Ta(e)?i[0]:i}En.defaultProps=_e;En.setDefaultProps=Fm;En.currentInput=Fe;Object.assign({},_c,{effect:function(t){var n=t.state,a={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,a.popper),n.styles=a,n.elements.arrow&&Object.assign(n.elements.arrow.style,a.arrow)}});En.setDefaultProps({render:Oc});let Y=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Tm(e){return xi(e)}function xi(e){return Array.isArray(e)?Rm(e):e instanceof RegExp?e:typeof e=="object"?Om(e):e}function Rm(e){let t=[];for(let n=0,a=e.length;n<a;n++)t[n]=xi(e[n]);return t}function Om(e){let t={};for(let n in e)t[n]=xi(e[n]);return t}function Ic(e,...t){return t.forEach(n=>{for(let a in n)e[a]=n[a]}),e}function Nc(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Nc(e.substring(0,e.length-1)):e.substr(~t+1)}var Za=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Vn=class{static hasCaptures(e){return e===null?!1:(Za.lastIndex=0,Za.test(e))}static replaceCaptures(e,t,n){return e.replace(Za,(a,r,i,s)=>{let o=n[parseInt(r||i,10)];if(o){let c=t.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(s){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Lc(e,t){return e<t?-1:e>t?1:0}function Pc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,a=t.length;if(n===a){for(let r=0;r<n;r++){let i=Lc(e[r],t[r]);if(i!==0)return i}return 0}return n-a}function gs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Dc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Mc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},pa=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Lm(e),t)}static createFromParsedTheme(e,t){return Dm(e,t)}_cachedMatchRoot=new Mc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,a=this._cachedMatchRoot.get(t).find(r=>Im(e.parent,r.parentScopes));return a?new qc(a.fontStyle,a.foreground,a.background):null}},Ya=class na{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const a of n)t=new na(t,a);return t}static from(...t){let n=null;for(let a=0;a<t.length;a++)n=new na(n,t[a]);return n}push(t){return new na(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push(a.scopeName),a=a.parent;return a===t?n.reverse():void 0}};function Im(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let a=t[n],r=!1;if(a===">"){if(n===t.length-1)return!1;a=t[++n],r=!0}for(;e&&!Nm(e.scopeName,a);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Nm(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Lm(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],a=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let o;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(s.scope)?o=s.scope:o=[""];let c=-1;if(typeof s.settings.fontStyle=="string"){c=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof s.settings.foreground=="string"&&gs(s.settings.foreground)&&(l=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&gs(s.settings.background)&&(u=s.settings.background);for(let p=0,d=o.length;p<d;p++){let g=o[p].trim().split(" "),v=g[g.length-1],f=null;g.length>1&&(f=g.slice(0,g.length-1),f.reverse()),n[a++]=new Pm(v,f,r,c,l,u)}}return n}var Pm=class{constructor(e,t,n,a,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},ee=(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))(ee||{});function Dm(e,t){e.sort((c,l)=>{let u=Lc(c.scope,l.scope);return u!==0||(u=Pc(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new Mm(t),s=new qc(n,i.getId(a),i.getId(r)),o=new zm(new Sr(0,null,-1,0,0),[]);for(let c=0,l=e.length;c<l;c++){let u=e[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pa(i,s,o)}var Mm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},qm=Object.freeze([]),Sr=class zc{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,a,r,i){this.scopeDepth=t,this.parentScopes=n||qm,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new zc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let a=0,r=t.length;a<r;a++)n[a]=t[a].clone();return n}acceptOverwrite(t,n,a,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},zm=class Ar{constructor(t,n=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let a=0,r=0;for(;t.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),r,i;if(a===-1?(r=t,i=""):(r=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ar._cmpBySpecificity),n}insert(t,n,a,r,i,s){if(n===""){this._doInsertHere(t,a,r,i,s);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Ar(this._mainRule.clone(),Sr.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,a,r,i,s)}_doInsertHere(t,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(t,a,r,i);return}for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let c=this._rulesWithParentScopes[s];if(Pc(c.parentScopes,n)===0){c.acceptOverwrite(t,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Sr(t,n,a,r,i))}},Lt=class le{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=le.getLanguageId(t),a=le.getTokenType(t),r=le.getFontStyle(t),i=le.getForeground(t),s=le.getBackground(t);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>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,a,r,i,s,o){let c=le.getLanguageId(t),l=le.getTokenType(t),u=le.containsBalancedBrackets(t)?1:0,p=le.getFontStyle(t),d=le.getForeground(t),m=le.getBackground(t);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(p=i),s!==0&&(d=s),o!==0&&(m=o),(c<<0|l<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function da(e,t){const n=[],a=Bm(e);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=s();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=o();return r===")"&&(r=a.next()),c}if(fs(r)){const c=[];do c.push(r),r=a.next();while(fs(r));return l=>t(c,l)}return null}function s(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(p=>p(u))}function o(){const c=[];let l=s();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=s()}return u=>c.some(p=>p(u))}}function fs(e){return!!e&&!!e.match(/[\w\.:]+/)}function Bm(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const a=n[0];return n=t.exec(e),a}}}function Bc(e){typeof e.dispose=="function"&&e.dispose()}var gn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Um=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Gm=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))}},Hm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new gn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Gm;for(const n of e)Wm(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof gn){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 Wm(e,t,n,a){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof gn?aa({baseGrammar:i,selfGrammar:r},a):Tr(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const s=n.injections(e.scopeName);if(s)for(const o of s)a.add(new gn(o))}function Tr(e,t,n){if(t.repository&&t.repository[e]){const a=t.repository[e];ma([a],t,n)}}function aa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ma(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ma(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ma(e,t,n){for(const a of e){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?Ic({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ma(a.patterns,{...t,repository:r},n);const i=a.include;if(!i)continue;const s=Uc(i);switch(s.kind){case 0:aa({...t,selfGrammar:t.baseGrammar},n);break;case 1:aa(t,n);break;case 2:Tr(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const o=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(o){const c={baseGrammar:t.baseGrammar,selfGrammar:o,repository:r};s.kind===4?Tr(s.ruleName,c,n):aa(c,n)}else s.kind===4?n.add(new Um(s.scopeName,s.ruleName)):n.add(new gn(s.scopeName));break}}}var Vm=class{kind=0},Zm=class{kind=1},Ym=class{constructor(e){this.ruleName=e}kind=2},Xm=class{constructor(e){this.scopeName=e}kind=3},Km=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uc(e){if(e==="$base")return new Vm;if(e==="$self")return new Zm;const t=e.indexOf("#");if(t===-1)return new Xm(e);if(t===0)return new Ym(e.substring(1));{const n=e.substring(0,t),a=e.substring(t+1);return new Km(n,a)}}var Qm=/\\(\d+)/,bs=/\\(\d+)/g,Jm=-1,Gc=-2;var Fn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,a){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Vn.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Vn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nc(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:Vn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Vn.replaceCaptures(this._contentName,e,t)}},eh=class extends Fn{retokenizeCapturedWithRuleId;constructor(e,t,n,a,r){super(e,t,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,a){throw new Error("Not supported!")}},th=class extends Fn{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,null),this._match=new fn(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_s=class extends Fn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rr=class extends Fn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r,i,s,o,c,l){super(e,t,n,a),this._begin=new fn(r,this.id),this.beginCaptures=i,this._end=new fn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bn;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}},ha=class extends Fn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,a,r,i,s,o,c){super(e,t,n,a),this._begin=new fn(r,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new fn(s,Gc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bn;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,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new bn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Hc=class J{static createCaptureRule(t,n,a,r,i){return t.registerRule(s=>new eh(n,s,a,r,i))}static getCompiledRuleId(t,n,a){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new th(t.$vscodeTextmateLocation,t.id,t.name,t.match,J._compileCaptures(t.captures,n,a));if(typeof t.begin>"u"){t.repository&&(a=Ic({},a,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new _s(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,J._compilePatterns(i,n,a))}return t.while?new ha(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.while,J._compileCaptures(t.whileCaptures||t.captures,n,a),J._compilePatterns(t.patterns,n,a)):new Rr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.end,J._compileCaptures(t.endCaptures||t.captures,n,a),t.applyEndPatternLast,J._compilePatterns(t.patterns,n,a))}),t.id}static _compileCaptures(t,n,a){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);o>i&&(i=o)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);let c=0;t[s].patterns&&(c=J.getCompiledRuleId(t[s],n,a)),r[o]=J.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,c)}}return r}static _compilePatterns(t,n,a){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i];let c=-1;if(o.include){const l=Uc(o.include);switch(l.kind){case 0:case 1:c=J.getCompiledRuleId(a[o.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=J.getCompiledRuleId(u,n,a));break;case 3:case 4:const p=l.scopeName,d=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(p,a);if(m)if(d){let g=m.repository[d];g&&(c=J.getCompiledRuleId(g,n,m.repository))}else c=J.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else c=J.getCompiledRuleId(o,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof _s||l instanceof Rr||l instanceof ha)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},fn=class Wc{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const a=t.length;let r=0,i=[],s=!1;for(let o=0;o<a;o++)if(t.charAt(o)==="\\"&&o+1<a){const l=t.charAt(o+1);l==="z"?(i.push(t.substring(r,o)),i.push("$(?!\\n)(?<!\\n)"),r=o+2):(l==="A"||l==="G")&&(s=!0),o++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Qm.test(this.source):this.hasBackReferences=!1}clone(){return new Wc(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>t.substring(r.start,r.end));return bs.lastIndex=0,this.source.replace(bs,(r,i)=>Dc(a[parseInt(i,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=[],a=[],r=[],i,s,o,c;for(i=0,s=this.source.length;i<s;i++)o=this.source.charAt(i),t[i]=o,n[i]=o,a[i]=o,r[i]=o,o==="\\"&&i+1<s&&(c=this.source.charAt(i+1),c==="A"?(t[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):c==="G"?(t[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(t[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},bn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ys(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 a=this._items.map(r=>r.resolveAnchors(t,n));return new ys(e,a,this._items.map(r=>r.ruleId))}},ys=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<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
-`)}findNextMatchSync(e,t,n){const a=this.scanner.findNextMatchSync(e,t,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},Xa=class{constructor(e,t){this.languageId=e,this.tokenType=t}},nh=class Or{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Xa(t,8),this._embeddedLanguagesMatcher=new ah(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Or._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Xa(0,0);_getBasicScopeAttributes=new Mc(t=>{const n=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new Xa(n,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Or.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/},ah=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,a])=>Dc(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])}},vs=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Vc(e,t,n,a,r,i,s,o){const c=t.content.length;let l=!1,u=-1;if(s){const m=rh(e,t,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!l;){if(o!==0&&Date.now()-p>o)return new vs(r,!0);d()}return new vs(r,!1);function d(){const m=ih(e,t,n,a,r,u);if(!m){i.produce(r,c),l=!0;return}const g=m.captureIndices,v=m.matchedRuleId,f=g&&g.length>0?g[0].end>a:!1;if(v===Jm){const b=r.getRule(e);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),an(e,t,n,r,i,b.endCaptures,g),i.produce(r,g[0].end);const _=r;if(r=r.parent,u=_.getAnchorPos(),!f&&_.getEnterPos()===a){r=_,i.produce(r,c),l=!0;return}}else{const b=e.getRule(v);i.produce(r,g[0].start);const _=r,w=b.getName(t.content,g),h=r.contentNameScopesList.pushAttributed(w,e);if(r=r.push(v,a,u,g[0].end===c,null,h,h),b instanceof Rr){const C=b;an(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(b instanceof ha){const C=b;an(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(an(e,t,n,r,i,b.captures,g),i.produce(r,g[0].end),r=r.pop(),!f){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function rh(e,t,n,a,r,i){let s=r.beginRuleCapturedEOL?0:-1;const o=[];for(let c=r;c;c=c.pop()){const l=c.getRule(e);l instanceof ha&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:u}=ch(c.rule,e,c.stack.endRule,n,a===s),p=l.findNextMatchSync(t,a,u);if(p){if(p.ruleId!==Gc){r=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(c.stack,p.captureIndices[0].start),an(e,t,n,c.stack,i,c.rule.whileCaptures,p.captureIndices),i.produce(c.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>a&&(a=p.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:s,isFirstLine:n}}function ih(e,t,n,a,r,i){const s=sh(e,t,n,a,r,i),o=e.getInjections();if(o.length===0)return s;const c=oh(o,e,t,n,a,r,i);if(!c)return s;if(!s)return c;const l=s.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:s}function sh(e,t,n,a,r,i){const s=r.getRule(e),{ruleScanner:o,findOptions:c}=Zc(s,e,r.endRule,n,a===i),l=o.findNextMatchSync(t,a,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function oh(e,t,n,a,r,i,s){let o=Number.MAX_VALUE,c=null,l,u=0;const p=i.contentNameScopesList.getScopeNames();for(let d=0,m=e.length;d<m;d++){const g=e[d];if(!g.matcher(p))continue;const v=t.getRule(g.ruleId),{ruleScanner:f,findOptions:b}=Zc(v,t,null,a,r===s),_=f.findNextMatchSync(n,r,b);if(!_)continue;const w=_.captureIndices[0].start;if(!(w>=o)&&(o=w,c=_.captureIndices,l=_.ruleId,u=g.priority,o===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Zc(e,t,n,a,r){return{ruleScanner:e.compileAG(t,n,a,r),findOptions:0}}function ch(e,t,n,a,r){return{ruleScanner:e.compileWhileAG(t,n,a,r),findOptions:0}}function an(e,t,n,a,r,i,s){if(i.length===0)return;const o=t.content,c=Math.min(i.length,s.length),l=[],u=s[0].end;for(let p=0;p<c;p++){const d=i[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),d.retokenizeCapturedWithRuleId){const v=d.getName(o,s),f=a.contentNameScopesList.pushAttributed(v,e),b=d.getContentName(o,s),_=f.pushAttributed(b,e),w=a.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,f,_),h=e.createOnigString(o.substring(0,m.end));Vc(e,h,n&&m.start===0,m.start,w,r,!1,0),Bc(h);continue}const g=d.getName(o,s);if(g!==null){const f=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,e);l.push(new lh(f,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var lh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function uh(e,t,n,a,r,i,s,o){return new dh(e,t,n,a,r,i,s,o)}function ws(e,t,n,a,r){const i=da(t,ga),s=Hc.getCompiledRuleId(n,a,r.repository);for(const o of i)e.push({debugSelector:t,matcher:o.matcher,ruleId:s,grammar:r,priority:o.priority})}function ga(e,t){if(t.length<e.length)return!1;let n=0;return e.every(a=>{for(let r=n;r<t.length;r++)if(ph(t[r],a))return n=r+1,!0;return!1})}function ph(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var dh=class{constructor(e,t,n,a,r,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new nh(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=xs(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=da(c,ga);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_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:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,a=e.lookup(n);if(a){const r=a.injections;if(r)for(let s in r)ws(t,s,r[s],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const o=this.getExternalGrammar(s);if(o){const c=o.injectionSelector;c&&ws(t,c,o,this,o)}})}return t.sort((r,i)=>r.priority-i.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]=xs(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const a=this._tokenize(e,t,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,n=0){const a=this._tokenize(e,t,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,n,a){this._rootId===-1&&(this._rootId=Hc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Ir.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Lt.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=un.createRootAndLookUpScopeName(d,p,this):m=un.createRoot("unknown",p),t=new Ir(null,this._rootId,-1,-1,!1,null,m,m)}else r=!1,t.reset();e=e+`
-`;const i=this.createOnigString(e),s=i.content.length,o=new hh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Vc(this,i,r,0,t,o,!0,a);return Bc(i),{lineLength:s,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function xs(e,t){return e=Tm(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 un=class Ce{constructor(t,n,a){this.parent=t,this.scopePath=n,this.tokenAttributes=a}static fromExtension(t,n){let a=t,r=t?.scopePath??null;for(const i of n)r=Ya.push(r,i.scopeNames),a=new Ce(a,r,i.encodedTokenAttributes);return a}static createRoot(t,n){return new Ce(null,new Ya(null,t),n)}static createRootAndLookUpScopeName(t,n,a){const r=a.getMetadataForScope(t),i=new Ya(null,t),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(n,r,s);return new Ce(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ce.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,a){let r=-1,i=0,s=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,s=a.backgroundId),Lt.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ce._pushAttributed(this,t,n);const a=t.split(/ /g);let r=this;for(const i of a)r=Ce._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,a){const r=a.getMetadataForScope(n),i=t.scopePath.push(n),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(t.tokenAttributes,r,s);return new Ce(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?n.reverse():void 0}},Ir=class nt{constructor(t,n,a,r,i,s,o,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new nt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:nt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?un.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(){nt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,a,r,i,s,o){return new nt(this,t,n,a,r,i,s,o)}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 nt(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 a=un.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new nt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,un.fromExtension(a,n.contentNameScopesList))}},mh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):da(n,ga).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>da(n,ga).map(a=>a.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}},hh=class{constructor(e,t,n,a){this.balancedBracketSelectors=a,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 a=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(a=Lt.set(a,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=Lt.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},gh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,a,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,uh(e,i,t,n,a,r,this,this._onigLib))}return this._grammars.get(e)}},fh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new gh(pa.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(pa.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,a){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,n,a){return this._loadGrammar(t,n,a.embeddedLanguages,a.tokenTypes,new mh(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,a,r,i){const s=new Hm(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(o=>this._loadSingleGrammar(o.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(t,n=[],a=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,a,r)}_grammarForScopeName(t,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,a,r,i)}},Nr=Ir.NULL;const bh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class $n{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}$n.prototype.normal={};$n.prototype.property={};$n.prototype.space=void 0;function Yc(e,t){const n={},a={};for(const r of e)Object.assign(n,r.property),Object.assign(a,r.normal);return new $n(n,a,t)}function Lr(e){return e.toLowerCase()}class ie{constructor(t,n){this.attribute=n,this.property=t}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let _h=0;const S=ft(),H=ft(),Pr=ft(),x=ft(),P=ft(),jt=ft(),se=ft();function ft(){return 2**++_h}const Dr=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:H,commaOrSpaceSeparated:se,commaSeparated:jt,number:x,overloadedBoolean:Pr,spaceSeparated:P},Symbol.toStringTag,{value:"Module"})),Ka=Object.keys(Dr);class ki extends ie{constructor(t,n,a,r){let i=-1;if(super(t,n),ks(this,"space",r),typeof a=="number")for(;++i<Ka.length;){const s=Ka[i];ks(this,Ka[i],(a&Dr[s])===Dr[s])}}}ki.prototype.defined=!0;function ks(e,t,n){n&&(e[t]=n)}function Bt(e){const t={},n={};for(const[a,r]of Object.entries(e.properties)){const i=new ki(a,e.transform(e.attributes||{},a),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),t[a]=i,n[Lr(a)]=a,n[Lr(i.attribute)]=a}return new $n(t,n,e.space)}const Xc=Bt({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:H,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:P,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:x,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:P,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:H,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function Qc(e,t){return Kc(e,t.toLowerCase())}const yh=Bt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jt,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:P,autoFocus:S,autoPlay:S,blocking:P,capture:null,charSet:null,checked:S,cite:null,className:P,cols:x,colSpan:null,content:null,contentEditable:H,controls:S,controlsList:P,coords:x|jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Pr,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:P,height:x,hidden:Pr,high:x,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:P,itemRef:P,itemScope:S,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S,optimum:x,pattern:null,ping:P,placeholder:null,playsInline:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:P,required:S,reversed:S,rows:x,rowSpan:x,sandbox:P,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:H,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:Qc}),vh=Bt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:se,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jt,g2:jt,glyphName:jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:se,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:se,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:se,rev:se,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:se,requiredFeatures:se,requiredFonts:se,requiredFormats:se,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:se,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:se,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:se,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kc}),Jc=Bt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),el=Bt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qc}),tl=Bt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wh=/[A-Z]/g,Cs=/-[a-z]/g,xh=/^data[-\w.:]+$/i;function kh(e,t){const n=Lr(t);let a=t,r=ie;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xh.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Cs,Eh);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Cs.test(i)){let s=i.replace(wh,Ch);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=ki}return new r(a,t)}function Ch(e){return"-"+e.toLowerCase()}function Eh(e){return e.charAt(1).toUpperCase()}const Fh=Yc([Xc,yh,Jc,el,tl],"html"),nl=Yc([Xc,vh,Jc,el,tl],"svg"),Es={}.hasOwnProperty;function $h(e,t){const n=t||{};function a(r,...i){let s=a.invalid;const o=a.handlers;if(r&&Es.call(r,e)){const c=String(r[e]);s=Es.call(o,c)?o[c]:a.unknown}if(s)return s.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const jh=/["&'<>`]/g,Sh=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ah=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Th=/[|\\{}()[\]^$+*?.]/g,Fs=new WeakMap;function Rh(e,t){if(e=e.replace(t.subset?Oh(t.subset):jh,a),t.subset||t.escapeOnly)return e;return e.replace(Sh,n).replace(Ah,a);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function a(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function Oh(e){let t=Fs.get(e);return t||(t=Ih(e),Fs.set(e,t)),t}function Ih(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Th,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Nh=/[\dA-Fa-f]/;function Lh(e,t,n){const a="&#x"+e.toString(16).toUpperCase();return n&&t&&!Nh.test(String.fromCharCode(t))?a:a+";"}const Ph=/\d/;function Dh(e,t,n){const a="&#"+String(e);return n&&t&&!Ph.test(String.fromCharCode(t))?a:a+";"}const Mh=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Qa={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},qh=["cent","copy","divide","gt","lt","not","para","times"],al={}.hasOwnProperty,Mr={};let Zn;for(Zn in Qa)al.call(Qa,Zn)&&(Mr[Qa[Zn]]=Zn);const zh=/[^\dA-Za-z]/;function Bh(e,t,n,a){const r=String.fromCharCode(e);if(al.call(Mr,r)){const i=Mr[r],s="&"+i;return n&&Mh.includes(i)&&!qh.includes(i)&&(!a||t&&t!==61&&zh.test(String.fromCharCode(t)))?s:s+";"}return""}function Uh(e,t,n){let a=Lh(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Bh(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Dh(e,t,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function St(e,t){return Rh(e,Object.assign({format:Uh},t))}const Gh=/^>|^->|<!--|-->|--!>|<!-$/g,Hh=[">"],Wh=["<",">"];function Vh(e,t,n,a){return a.settings.bogusComments?"<?"+St(e.value,Object.assign({},a.settings.characterReferences,{subset:Hh}))+">":"<!--"+e.value.replace(Gh,r)+"-->";function r(i){return St(i,Object.assign({},a.settings.characterReferences,{subset:Wh}))}}function Zh(e,t,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function $s(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(t);for(;r!==-1;)a++,r=n.indexOf(t,r+t.length);return a}function Yh(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Xh(e){return e.join(" ").trim()}const Kh=/[ \t\n\f\r]/g;function Ci(e){return typeof e=="object"?e.type==="text"?js(e.value):!1:js(e)}function js(e){return e.replace(Kh,"")===""}const Z=il(1),rl=il(-1),Qh=[];function il(e){return t;function t(n,a,r){const i=n?n.children:Qh;let s=(a||0)+e,o=i[s];if(!r)for(;o&&Ci(o);)s+=e,o=i[s];return o}}const Jh={}.hasOwnProperty;function sl(e){return t;function t(n,a,r){return Jh.call(e,n.tagName)&&e[n.tagName](n,a,r)}}const Ei=sl({body:tg,caption:Ja,colgroup:Ja,dd:ig,dt:rg,head:Ja,html:eg,li:ag,optgroup:sg,option:og,p:ng,rp:Ss,rt:Ss,tbody:lg,td:As,tfoot:ug,th:As,thead:cg,tr:pg});function Ja(e,t,n){const a=Z(n,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&Ci(a.value.charAt(0)))}function eg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function tg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ng(e,t,n){const a=Z(n,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 ag(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="li"}function rg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function ig(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Ss(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function sg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function og(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function cg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function lg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function ug(e,t,n){return!Z(n,t)}function pg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="tr"}function As(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const dg=sl({body:gg,colgroup:fg,head:hg,html:mg,tbody:bg});function mg(e){const t=Z(e,-1);return!t||t.type!=="comment"}function hg(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const n=e.children[0];return!n||n.type==="element"}function gg(e){const t=Z(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ci(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fg(e,t,n){const a=rl(n,t),r=Z(e,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function bg(e,t,n){const a=rl(n,t),r=Z(e,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Yn={name:[[`
+`:""}`,t),setTimeout(()=>{throw e},0)}var Jn=!0;function bo(e){let t=Jn;Jn=!1;let n=e();return Jn=t,n}function ct(e,t,n={}){let a;return ne(e,t)(r=>a=r,n),a}function ne(...e){return _o(...e)}var _o=yo;function du(e){_o=e}function yo(e,t){let n={};mr(n,e);let a=[n,...At(e)],r=typeof t=="function"?mu(a,t):gu(a,t,e);return pu.bind(null,e,t,r)}function mu(e,t){return(n=()=>{},{scope:a={},params:r=[]}={})=>{let i=t.apply(xn([a,...e]),r);sa(n,i)}}var Ma={};function hu(e,t){if(Ma[e])return Ma[e];let n=Object.getPrototypeOf(async function(){}).constructor,a=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let s=new n(["__self","scope"],`with (scope) { __self.result = ${a} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return mn(s,t,e),Promise.resolve()}})();return Ma[e]=i,i}function gu(e,t,n){let a=hu(t,n);return(r=()=>{},{scope:i={},params:s=[]}={})=>{a.result=void 0,a.finished=!1;let o=xn([i,...e]);if(typeof a=="function"){let c=a(a,o).catch(l=>mn(l,n,t));a.finished?(sa(r,a.result,o,s,n),a.result=void 0):c.then(l=>{sa(r,l,o,s,n)}).catch(l=>mn(l,n,t)).finally(()=>a.result=void 0)}}}function sa(e,t,n,a,r){if(Jn&&typeof t=="function"){let i=t.apply(n,a);i instanceof Promise?i.then(s=>sa(e,s,n,a)).catch(s=>mn(s,r,t)):e(i)}else typeof t=="object"&&t instanceof Promise?t.then(i=>e(i)):e(t)}var Jr="x-";function Mt(e=""){return Jr+e}function fu(e){Jr=e}var oa={};function W(e,t){return oa[e]=t,{before(n){if(!oa[n]){console.warn(String.raw`Cannot find directive \`${n}\`. \`${e}\` will use the default order of execution`);return}const a=rt.indexOf(n);rt.splice(a>=0?a:rt.indexOf("DEFAULT"),0,e)}}}function bu(e){return Object.keys(oa).includes(e)}function ei(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let i=Object.entries(e._x_virtualDirectives).map(([o,c])=>({name:o,value:c})),s=vo(i);i=i.map(o=>s.find(c=>c.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),t=t.concat(i)}let a={};return t.map(Eo((i,s)=>a[i]=s)).filter($o).map(vu(a,n)).sort(wu).map(i=>yu(e,i))}function vo(e){return Array.from(e).map(Eo()).filter(t=>!$o(t))}var hr=!1,an=new Map,wo=Symbol();function _u(e){hr=!0;let t=Symbol();wo=t,an.set(t,[]);let n=()=>{for(;an.get(t).length;)an.get(t).shift()();an.delete(t)},a=()=>{hr=!1,n()};e(n),a()}function xo(e){let t=[],n=o=>t.push(o),[a,r]=tu(e);return t.push(r),[{Alpine:kn,effect:a,cleanup:n,evaluateLater:ne.bind(ne,e),evaluate:ct.bind(ct,e)},()=>t.forEach(o=>o())]}function yu(e,t){let n=()=>{},a=oa[t.type]||n,[r,i]=xo(e);lo(e,t.original,i);let s=()=>{e._x_ignore||e._x_ignoreSelf||(a.inline&&a.inline(e,t,r),a=a.bind(a,e,t,r),hr?an.get(wo).push(a):a())};return s.runCleanups=i,s}var ko=(e,t)=>({name:n,value:a})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:a}),Co=e=>e;function Eo(e=()=>{}){return({name:t,value:n})=>{let{name:a,value:r}=Fo.reduce((i,s)=>s(i),{name:t,value:n});return a!==t&&e(a,t),{name:a,value:r}}}var Fo=[];function ti(e){Fo.push(e)}function $o({name:e}){return jo().test(e)}var jo=()=>new RegExp(`^${Jr}([^:^.]+)\\b`);function vu(e,t){return({name:n,value:a})=>{let r=n.match(jo()),i=n.match(/:([a-zA-Z0-9\-_:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],o=t||e[n]||n;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:a,original:o}}}var gr="DEFAULT",rt=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",gr,"teleport"];function wu(e,t){let n=rt.indexOf(e.type)===-1?gr:e.type,a=rt.indexOf(t.type)===-1?gr:t.type;return rt.indexOf(n)-rt.indexOf(a)}function sn(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function dt(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(r=>dt(r,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let a=e.firstElementChild;for(;a;)dt(a,t),a=a.nextElementSibling}function pe(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Di=!1;function xu(){Di&&pe("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Di=!0,document.body||pe("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),sn(document,"alpine:init"),sn(document,"alpine:initializing"),Xr(),nu(t=>Pe(t,dt)),Vr(t=>zt(t)),co((t,n)=>{ei(t,n).forEach(a=>a())});let e=t=>!ka(t.parentElement,!0);Array.from(document.querySelectorAll(To().join(","))).filter(e).forEach(t=>{Pe(t)}),sn(document,"alpine:initialized"),setTimeout(()=>{Fu()})}var ni=[],So=[];function Ao(){return ni.map(e=>e())}function To(){return ni.concat(So).map(e=>e())}function Ro(e){ni.push(e)}function Oo(e){So.push(e)}function ka(e,t=!1){return qt(e,n=>{if((t?To():Ao()).some(r=>n.matches(r)))return!0})}function qt(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return qt(e.parentElement,t)}}function ku(e){return Ao().some(t=>e.matches(t))}var Io=[];function Cu(e){Io.push(e)}var Eu=1;function Pe(e,t=dt,n=()=>{}){qt(e,a=>a._x_ignore)||_u(()=>{t(e,(a,r)=>{a._x_marker||(n(a,r),Io.forEach(i=>i(a,r)),ei(a,a.attributes).forEach(i=>i()),a._x_ignore||(a._x_marker=Eu++),a._x_ignore&&r())})})}function zt(e,t=dt){t(e,n=>{au(n),uo(n),delete n._x_marker})}function Fu(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,n,a])=>{bu(n)||a.some(r=>{if(document.querySelector(r))return pe(`found "${r}", but missing ${t} plugin`),!0})})}var fr=[],ai=!1;function ri(e=()=>{}){return queueMicrotask(()=>{ai||setTimeout(()=>{br()})}),new Promise(t=>{fr.push(()=>{e(),t()})})}function br(){for(ai=!1;fr.length;)fr.shift()()}function $u(){ai=!0}function ii(e,t){return Array.isArray(t)?Mi(e,t.join(" ")):typeof t=="object"&&t!==null?ju(e,t):typeof t=="function"?ii(e,t()):Mi(e,t)}function Mi(e,t){let n=r=>r.split(" ").filter(i=>!e.classList.contains(i)).filter(Boolean),a=r=>(e.classList.add(...r),()=>{e.classList.remove(...r)});return t=t===!0?t="":t||"",a(n(t))}function ju(e,t){let n=o=>o.split(" ").filter(Boolean),a=Object.entries(t).flatMap(([o,c])=>c?n(o):!1).filter(Boolean),r=Object.entries(t).flatMap(([o,c])=>c?!1:n(o)).filter(Boolean),i=[],s=[];return r.forEach(o=>{e.classList.contains(o)&&(e.classList.remove(o),s.push(o))}),a.forEach(o=>{e.classList.contains(o)||(e.classList.add(o),i.push(o))}),()=>{s.forEach(o=>e.classList.add(o)),i.forEach(o=>e.classList.remove(o))}}function Ca(e,t){return typeof t=="object"&&t!==null?Su(e,t):Au(e,t)}function Su(e,t){let n={};return Object.entries(t).forEach(([a,r])=>{n[a]=e.style[a],a.startsWith("--")||(a=Tu(a)),e.style.setProperty(a,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{Ca(e,n)}}function Au(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Tu(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}W("transition",(e,{value:t,modifiers:n,expression:a},{evaluate:r})=>{typeof a=="function"&&(a=r(a)),a!==!1&&(!a||typeof a=="boolean"?Ou(e,n,t):Ru(e,a,t))});function Ru(e,t,n){No(e,ii,""),{enter:r=>{e._x_transition.enter.during=r},"enter-start":r=>{e._x_transition.enter.start=r},"enter-end":r=>{e._x_transition.enter.end=r},leave:r=>{e._x_transition.leave.during=r},"leave-start":r=>{e._x_transition.leave.start=r},"leave-end":r=>{e._x_transition.leave.end=r}}[n](t)}function Ou(e,t,n){No(e,Ca);let a=!t.includes("in")&&!t.includes("out")&&!n,r=a||t.includes("in")||["enter"].includes(n),i=a||t.includes("out")||["leave"].includes(n);t.includes("in")&&!a&&(t=t.filter((b,_)=>_<t.indexOf("out"))),t.includes("out")&&!a&&(t=t.filter((b,_)=>_>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),o=s||t.includes("opacity"),c=s||t.includes("scale"),l=o?0:1,u=c?Jt(t,"scale",95)/100:1,p=Jt(t,"delay",0)/1e3,d=Jt(t,"origin","center"),m="opacity, transform",g=Jt(t,"duration",150)/1e3,v=Jt(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${g}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${p}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function No(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(a=()=>{},r=()=>{}){yr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},a,r)},out(a=()=>{},r=()=>{}){yr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},a,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,a){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):i():e._x_transition?e._x_transition.in(n):i();return}e._x_hidePromise=e._x_transition?new Promise((s,o)=>{e._x_transition.out(()=>{},()=>s(a)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>o({isFromCancelledTransition:!0}))}):Promise.resolve(a),queueMicrotask(()=>{let s=Lo(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):r(()=>{let o=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(o)]).then(([u])=>u?.());return delete c._x_hidePromise,delete c._x_hideChildren,l};o(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function Lo(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Lo(t)}function yr(e,t,{during:n,start:a,end:r}={},i=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(a).length===0&&Object.keys(r).length===0){i(),s();return}let o,c,l;Iu(e,{start(){o=t(e,a)},during(){c=t(e,n)},before:i,end(){o(),l=t(e,r)},after:s,cleanup(){c(),l()}})}function Iu(e,t){let n,a,r,i=_r(()=>{z(()=>{n=!0,a||t.before(),r||(t.end(),br()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:_r(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},z(()=>{t.start(),t.during()}),$u(),requestAnimationFrame(()=>{if(n)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),z(()=>{t.before()}),a=!0,requestAnimationFrame(()=>{n||(z(()=>{t.end()}),br(),setTimeout(e._x_transitioning.finish,s+o),r=!0)})})}function Jt(e,t,n){if(e.indexOf(t)===-1)return n;const a=e[e.indexOf(t)+1];if(!a||t==="scale"&&isNaN(a))return n;if(t==="duration"||t==="delay"){let r=a.match(/([0-9]+)ms/);if(r)return r[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[a,e[e.indexOf(t)+2]].join(" "):a}var He=!1;function Ve(e,t=()=>{}){return(...n)=>He?t(...n):e(...n)}function Nu(e){return(...t)=>He&&e(...t)}var Po=[];function Ea(e){Po.push(e)}function Lu(e,t){Po.forEach(n=>n(e,t)),He=!0,Do(()=>{Pe(t,(n,a)=>{a(n,()=>{})})}),He=!1}var vr=!1;function Pu(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),He=!0,vr=!0,Do(()=>{Du(t)}),He=!1,vr=!1}function Du(e){let t=!1;Pe(e,(a,r)=>{dt(a,(i,s)=>{if(t&&ku(i))return s();t=!0,r(i,s)})})}function Do(e){let t=gt;Pi((n,a)=>{let r=t(n);return Dt(r),()=>{}}),e(),Pi(t)}function Mo(e,t,n,a=[]){switch(e._x_bindings||(e._x_bindings=Pt({})),e._x_bindings[t]=n,t=a.includes("camel")?Wu(t):t,t){case"value":Mu(e,n);break;case"style":zu(e,n);break;case"class":qu(e,n);break;case"selected":case"checked":Bu(e,t,n);break;default:qo(e,t,n);break}}function Mu(e,t){if(Uo(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=ea(e.value)===t:e.checked=qi(e.value,t));else if(si(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>qi(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Hu(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function qu(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ii(e,t)}function zu(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ca(e,t)}function Bu(e,t,n){qo(e,t,n),Gu(e,t,n)}function qo(e,t,n){[null,void 0,!1].includes(n)&&Zu(t)?e.removeAttribute(t):(zo(t)&&(n=t),Uu(e,t,n))}function Uu(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function Gu(e,t,n){e[t]!==n&&(e[t]=n)}function Hu(e,t){const n=[].concat(t).map(a=>a+"");Array.from(e.options).forEach(a=>{a.selected=n.includes(a.value)})}function Wu(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function qi(e,t){return e==t}function ea(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Vu=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function zo(e){return Vu.has(e)}function Zu(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Yu(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Bo(e,t,n)}function Xu(e,t,n,a=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let r=e._x_inlineBindings[t];return r.extract=a,bo(()=>ct(e,r.expression))}return Bo(e,t,n)}function Bo(e,t,n){let a=e.getAttribute(t);return a===null?typeof n=="function"?n():n:a===""?!0:zo(t)?!![t,"true"].includes(a):a}function si(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Uo(e){return e.type==="radio"||e.localName==="ui-radio"}function Go(e,t){var n;return function(){var a=this,r=arguments,i=function(){n=null,e.apply(a,r)};clearTimeout(n),n=setTimeout(i,t)}}function Ho(e,t){let n;return function(){let a=this,r=arguments;n||(e.apply(a,r),n=!0,setTimeout(()=>n=!1,t))}}function Wo({get:e,set:t},{get:n,set:a}){let r=!0,i,s=gt(()=>{let o=e(),c=n();if(r)a(qa(o)),r=!1;else{let l=JSON.stringify(o),u=JSON.stringify(c);l!==i?a(qa(o)):l!==u&&t(qa(c))}i=JSON.stringify(e()),JSON.stringify(n())});return()=>{Dt(s)}}function qa(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function Ku(e){(Array.isArray(e)?e:[e]).forEach(n=>n(kn))}var et={},zi=!1;function Qu(e,t){if(zi||(et=Pt(et),zi=!0),t===void 0)return et[e];et[e]=t,ho(et[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&et[e].init()}function Ju(){return et}var Vo={};function ep(e,t){let n=typeof t!="function"?()=>t:t;return e instanceof Element?Zo(e,n()):(Vo[e]=n,()=>{})}function tp(e){return Object.entries(Vo).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...a)=>n(...a)}})}),e}function Zo(e,t,n){let a=[];for(;a.length;)a.pop()();let r=Object.entries(t).map(([s,o])=>({name:s,value:o})),i=vo(r);return r=r.map(s=>i.find(o=>o.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ei(e,r,n).map(s=>{a.push(s.runCleanups),s()}),()=>{for(;a.length;)a.pop()()}}var Yo={};function np(e,t){Yo[e]=t}function ap(e,t){return Object.entries(Yo).forEach(([n,a])=>{Object.defineProperty(e,n,{get(){return(...r)=>a.bind(t)(...r)},enumerable:!1})}),e}var rp={get reactive(){return Pt},get release(){return Dt},get effect(){return gt},get raw(){return ao},version:"3.14.9",flushAndStopDeferringMutations:su,dontAutoEvaluateFunctions:bo,disableEffectScheduling:Jl,startObservingMutations:Xr,stopObservingMutations:po,setReactivityEngine:eu,onAttributeRemoved:lo,onAttributesAdded:co,closestDataStack:At,skipDuringClone:Ve,onlyDuringClone:Nu,addRootSelector:Ro,addInitSelector:Oo,interceptClone:Ea,addScopeToNode:wn,deferMutations:iu,mapAttributes:ti,evaluateLater:ne,interceptInit:Cu,setEvaluator:du,mergeProxies:xn,extractProp:Xu,findClosest:qt,onElRemoved:Vr,closestRoot:ka,destroyTree:zt,interceptor:go,transition:yr,setStyles:Ca,mutateDom:z,directive:W,entangle:Wo,throttle:Ho,debounce:Go,evaluate:ct,initTree:Pe,nextTick:ri,prefixed:Mt,prefix:fu,plugin:Ku,magic:ve,store:Qu,start:xu,clone:Pu,cloneNode:Lu,bound:Yu,$data:mo,watch:ro,walk:dt,data:np,bind:ep},kn=rp;function ip(e,t){const n=Object.create(null),a=e.split(",");for(let r=0;r<a.length;r++)n[a[r]]=!0;return r=>!!n[r]}var sp=Object.freeze({}),op=Object.prototype.hasOwnProperty,Fa=(e,t)=>op.call(e,t),lt=Array.isArray,on=e=>Xo(e)==="[object Map]",cp=e=>typeof e=="string",oi=e=>typeof e=="symbol",$a=e=>e!==null&&typeof e=="object",lp=Object.prototype.toString,Xo=e=>lp.call(e),Ko=e=>Xo(e).slice(8,-1),ci=e=>cp(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,up=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},pp=up(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qo=(e,t)=>e!==t&&(e===e||t===t),wr=new WeakMap,en=[],Ee,ut=Symbol("iterate"),xr=Symbol("Map key iterate");function dp(e){return e&&e._isEffect===!0}function mp(e,t=sp){dp(e)&&(e=e.raw);const n=fp(e,t);return t.lazy||n(),n}function hp(e){e.active&&(Jo(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var gp=0;function fp(e,t){const n=function(){if(!n.active)return e();if(!en.includes(n)){Jo(n);try{return _p(),en.push(n),Ee=n,e()}finally{en.pop(),ec(),Ee=en[en.length-1]}}};return n.id=gp++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function Jo(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Tt=!0,li=[];function bp(){li.push(Tt),Tt=!1}function _p(){li.push(Tt),Tt=!0}function ec(){const e=li.pop();Tt=e===void 0?!0:e}function ye(e,t,n){if(!Tt||Ee===void 0)return;let a=wr.get(e);a||wr.set(e,a=new Map);let r=a.get(n);r||a.set(n,r=new Set),r.has(Ee)||(r.add(Ee),Ee.deps.push(r),Ee.options.onTrack&&Ee.options.onTrack({effect:Ee,target:e,type:t,key:n}))}function We(e,t,n,a,r,i){const s=wr.get(e);if(!s)return;const o=new Set,c=u=>{u&&u.forEach(p=>{(p!==Ee||p.allowRecurse)&&o.add(p)})};if(t==="clear")s.forEach(c);else if(n==="length"&&lt(e))s.forEach((u,p)=>{(p==="length"||p>=a)&&c(u)});else switch(n!==void 0&&c(s.get(n)),t){case"add":lt(e)?ci(n)&&c(s.get("length")):(c(s.get(ut)),on(e)&&c(s.get(xr)));break;case"delete":lt(e)||(c(s.get(ut)),on(e)&&c(s.get(xr)));break;case"set":on(e)&&c(s.get(ut));break}const l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:n,type:t,newValue:a,oldValue:r,oldTarget:i}),u.options.scheduler?u.options.scheduler(u):u()};o.forEach(l)}var yp=ip("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(oi)),vp=nc(),wp=nc(!0),Bi=xp();function xp(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const a=M(this);for(let i=0,s=this.length;i<s;i++)ye(a,"get",i+"");const r=a[t](...n);return r===-1||r===!1?a[t](...n.map(M)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){bp();const a=M(this)[t].apply(this,n);return ec(),a}}),e}function nc(e=!1,t=!1){return function(a,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_raw"&&i===(e?t?Lp:sc:t?Np:ic).get(a))return a;const s=lt(a);if(!e&&s&&Fa(Bi,r))return Reflect.get(Bi,r,i);const o=Reflect.get(a,r,i);return(oi(r)?tc.has(r):yp(r))||(e||ye(a,"get",r),t)?o:kr(o)?!s||!ci(r)?o.value:o:$a(o)?e?oc(o):mi(o):o}}var kp=Cp();function Cp(e=!1){return function(n,a,r,i){let s=n[a];if(!e&&(r=M(r),s=M(s),!lt(n)&&kr(s)&&!kr(r)))return s.value=r,!0;const o=lt(n)&&ci(a)?Number(a)<n.length:Fa(n,a),c=Reflect.set(n,a,r,i);return n===M(i)&&(o?Qo(r,s)&&We(n,"set",a,r,s):We(n,"add",a,r)),c}}function Ep(e,t){const n=Fa(e,t),a=e[t],r=Reflect.deleteProperty(e,t);return r&&n&&We(e,"delete",t,void 0,a),r}function Fp(e,t){const n=Reflect.has(e,t);return(!oi(t)||!tc.has(t))&&ye(e,"has",t),n}function $p(e){return ye(e,"iterate",lt(e)?"length":ut),Reflect.ownKeys(e)}var jp={get:vp,set:kp,deleteProperty:Ep,has:Fp,ownKeys:$p},Sp={get:wp,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},ui=e=>$a(e)?mi(e):e,pi=e=>$a(e)?oc(e):e,di=e=>e,ja=e=>Reflect.getPrototypeOf(e);function qn(e,t,n=!1,a=!1){e=e.__v_raw;const r=M(e),i=M(t);t!==i&&!n&&ye(r,"get",t),!n&&ye(r,"get",i);const{has:s}=ja(r),o=a?di:n?pi:ui;if(s.call(r,t))return o(e.get(t));if(s.call(r,i))return o(e.get(i));e!==r&&e.get(t)}function zn(e,t=!1){const n=this.__v_raw,a=M(n),r=M(e);return e!==r&&!t&&ye(a,"has",e),!t&&ye(a,"has",r),e===r?n.has(e):n.has(e)||n.has(r)}function Bn(e,t=!1){return e=e.__v_raw,!t&&ye(M(e),"iterate",ut),Reflect.get(e,"size",e)}function Ui(e){e=M(e);const t=M(this);return ja(t).has.call(t,e)||(t.add(e),We(t,"add",e,e)),this}function Gi(e,t){t=M(t);const n=M(this),{has:a,get:r}=ja(n);let i=a.call(n,e);i?rc(n,a,e):(e=M(e),i=a.call(n,e));const s=r.call(n,e);return n.set(e,t),i?Qo(t,s)&&We(n,"set",e,t,s):We(n,"add",e,t),this}function Hi(e){const t=M(this),{has:n,get:a}=ja(t);let r=n.call(t,e);r?rc(t,n,e):(e=M(e),r=n.call(t,e));const i=a?a.call(t,e):void 0,s=t.delete(e);return r&&We(t,"delete",e,void 0,i),s}function Wi(){const e=M(this),t=e.size!==0,n=on(e)?new Map(e):new Set(e),a=e.clear();return t&&We(e,"clear",void 0,void 0,n),a}function Un(e,t){return function(a,r){const i=this,s=i.__v_raw,o=M(s),c=t?di:e?pi:ui;return!e&&ye(o,"iterate",ut),s.forEach((l,u)=>a.call(r,c(l),c(u),i))}}function Gn(e,t,n){return function(...a){const r=this.__v_raw,i=M(r),s=on(i),o=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=r[e](...a),u=n?di:t?pi:ui;return!t&&ye(i,"iterate",c?xr:ut),{next(){const{value:p,done:d}=l.next();return d?{value:p,done:d}:{value:o?[u(p[0]),u(p[1])]:u(p),done:d}},[Symbol.iterator](){return this}}}}function ze(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${pp(e)} operation ${n}failed: target is readonly.`,M(this))}return e==="delete"?!1:this}}function Ap(){const e={get(i){return qn(this,i)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!1)},t={get(i){return qn(this,i,!1,!0)},get size(){return Bn(this)},has:zn,add:Ui,set:Gi,delete:Hi,clear:Wi,forEach:Un(!1,!0)},n={get(i){return qn(this,i,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!1)},a={get(i){return qn(this,i,!0,!0)},get size(){return Bn(this,!0)},has(i){return zn.call(this,i,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:Un(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gn(i,!1,!1),n[i]=Gn(i,!0,!1),t[i]=Gn(i,!1,!0),a[i]=Gn(i,!0,!0)}),[e,n,t,a]}var[Tp,Rp]=Ap();function ac(e,t){const n=e?Rp:Tp;return(a,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?a:Reflect.get(Fa(n,r)&&r in a?n:a,r,i)}var Op={get:ac(!1)},Ip={get:ac(!0)};function rc(e,t,n){const a=M(n);if(a!==n&&t.call(e,a)){const r=Ko(e);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ic=new WeakMap,Np=new WeakMap,sc=new WeakMap,Lp=new WeakMap;function Pp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dp(e){return e.__v_skip||!Object.isExtensible(e)?0:Pp(Ko(e))}function mi(e){return e&&e.__v_isReadonly?e:cc(e,!1,jp,Op,ic)}function oc(e){return cc(e,!0,Sp,Ip,sc)}function cc(e,t,n,a,r){if(!$a(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const s=Dp(e);if(s===0)return e;const o=new Proxy(e,s===2?a:n);return r.set(e,o),o}function M(e){return e&&M(e.__v_raw)||e}function kr(e){return!!(e&&e.__v_isRef===!0)}ve("nextTick",()=>ri);ve("dispatch",e=>sn.bind(sn,e));ve("watch",(e,{evaluateLater:t,cleanup:n})=>(a,r)=>{let i=t(a),o=ro(()=>{let c;return i(l=>c=l),c},r);n(o)});ve("store",Ju);ve("data",e=>mo(e));ve("root",e=>ka(e));ve("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=xn(Mp(e))),e._x_refs_proxy));function Mp(e){let t=[];return qt(e,n=>{n._x_refs&&t.push(n._x_refs)}),t}var za={};function lc(e){return za[e]||(za[e]=0),++za[e]}function qp(e,t){return qt(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function zp(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=lc(t))}ve("id",(e,{cleanup:t})=>(n,a=null)=>{let r=`${n}${a?`-${a}`:""}`;return Bp(e,r,t,()=>{let i=qp(e,n),s=i?i._x_ids[n]:lc(n);return a?`${n}-${s}-${a}`:`${n}-${s}`})});Ea((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function Bp(e,t,n,a){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let r=a();return e._x_id[t]=r,n(()=>{delete e._x_id[t]}),r}ve("el",e=>e);uc("Focus","focus","focus");uc("Persist","persist","persist");function uc(e,t,n){ve(t,a=>pe(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}W("modelable",(e,{expression:t},{effect:n,evaluateLater:a,cleanup:r})=>{let i=a(t),s=()=>{let u;return i(p=>u=p),u},o=a(`${t} = __placeholder`),c=u=>o(()=>{},{scope:{__placeholder:u}}),l=s();c(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,p=e._x_model.set,d=Wo({get(){return u()},set(m){p(m)}},{get(){return s()},set(m){c(m)}});r(d)})});W("teleport",(e,{modifiers:t,expression:n},{cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-teleport can only be used on a <template> tag",e);let r=Vi(n),i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,c=>{c.stopPropagation(),e.dispatchEvent(new c.constructor(c.type,c))})}),wn(i,{},e);let s=(o,c,l)=>{l.includes("prepend")?c.parentNode.insertBefore(o,c):l.includes("append")?c.parentNode.insertBefore(o,c.nextSibling):c.appendChild(o)};z(()=>{s(i,r,t),Ve(()=>{Pe(i)})()}),e._x_teleportPutBack=()=>{let o=Vi(n);z(()=>{s(e._x_teleport,o,t)})},a(()=>z(()=>{i.remove(),zt(i)}))});var Up=document.createElement("div");function Vi(e){let t=Ve(()=>document.querySelector(e),()=>Up)();return t||pe(`Cannot find x-teleport element for selector: "${e}"`),t}var pc=()=>{};pc.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};W("ignore",pc);W("effect",Ve((e,{expression:t},{effect:n})=>{n(ne(e,t))}));function Cr(e,t,n,a){let r=e,i=c=>a(c),s={},o=(c,l)=>u=>l(c,u);if(n.includes("dot")&&(t=Gp(t)),n.includes("camel")&&(t=Hp(t)),n.includes("passive")&&(s.passive=!0),n.includes("capture")&&(s.capture=!0),n.includes("window")&&(r=window),n.includes("document")&&(r=document),n.includes("debounce")){let c=n[n.indexOf("debounce")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Go(i,l)}if(n.includes("throttle")){let c=n[n.indexOf("throttle")+1]||"invalid-wait",l=ca(c.split("ms")[0])?Number(c.split("ms")[0]):250;i=Ho(i,l)}return n.includes("prevent")&&(i=o(i,(c,l)=>{l.preventDefault(),c(l)})),n.includes("stop")&&(i=o(i,(c,l)=>{l.stopPropagation(),c(l)})),n.includes("once")&&(i=o(i,(c,l)=>{c(l),r.removeEventListener(t,i,s)})),(n.includes("away")||n.includes("outside"))&&(r=document,i=o(i,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),n.includes("self")&&(i=o(i,(c,l)=>{l.target===e&&c(l)})),(Vp(t)||dc(t))&&(i=o(i,(c,l)=>{Zp(l,n)||c(l)})),r.addEventListener(t,i,s),()=>{r.removeEventListener(t,i,s)}}function Gp(e){return e.replace(/-/g,".")}function Hp(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function ca(e){return!Array.isArray(e)&&!isNaN(e)}function Wp(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Vp(e){return["keydown","keyup"].includes(e)}function dc(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Zp(e,t){let n=t.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(i));if(n.includes("debounce")){let i=n.indexOf("debounce");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let i=n.indexOf("throttle");n.splice(i,ca((n[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&Zi(e.key).includes(n[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>n.includes(i));return n=n.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===r.length&&(dc(e.type)||Zi(e.key).includes(n[0])))}function Zi(e){if(!e)return[];e=Wp(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}W("model",(e,{modifiers:t,expression:n},{effect:a,cleanup:r})=>{let i=e;t.includes("parent")&&(i=e.parentNode);let s=ne(i,n),o;typeof n=="string"?o=ne(i,`${n} = __placeholder`):typeof n=="function"&&typeof n()=="string"?o=ne(i,`${n()} = __placeholder`):o=()=>{};let c=()=>{let d;return s(m=>d=m),Yi(d)?d.get():d},l=d=>{let m;s(g=>m=g),Yi(m)?m.set(d):o(()=>{},{scope:{__placeholder:d}})};typeof n=="string"&&e.type==="radio"&&z(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});var u=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let p=He?()=>{}:Cr(e,u,t,d=>{l(Ba(e,t,d,c()))});if(t.includes("fill")&&([void 0,null,""].includes(c())||si(e)&&Array.isArray(c())||e.tagName.toLowerCase()==="select"&&e.multiple)&&l(Ba(e,t,{target:e},c())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=p,r(()=>e._x_removeModelListeners.default()),e.form){let d=Cr(e.form,"reset",[],m=>{ri(()=>e._x_model&&e._x_model.set(Ba(e,t,{target:e},c())))});r(()=>d())}e._x_model={get(){return c()},set(d){l(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof n=="string"&&n.match(/\./)&&(d=""),window.fromModel=!0,z(()=>Mo(e,"value",d)),delete window.fromModel},a(()=>{let d=c();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function Ba(e,t,n,a){return z(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(si(e))if(Array.isArray(a)){let r=null;return t.includes("number")?r=Ua(n.target.value):t.includes("boolean")?r=ea(n.target.value):r=n.target.value,n.target.checked?a.includes(r)?a:a.concat([r]):a.filter(i=>!Yp(i,r))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return Ua(i)}):t.includes("boolean")?Array.from(n.target.selectedOptions).map(r=>{let i=r.value||r.text;return ea(i)}):Array.from(n.target.selectedOptions).map(r=>r.value||r.text);{let r;return Uo(e)?n.target.checked?r=n.target.value:r=a:r=n.target.value,t.includes("number")?Ua(r):t.includes("boolean")?ea(r):t.includes("trim")?r.trim():r}}})}function Ua(e){let t=e?parseFloat(e):null;return Xp(t)?t:e}function Yp(e,t){return e==t}function Xp(e){return!Array.isArray(e)&&!isNaN(e)}function Yi(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}W("cloak",e=>queueMicrotask(()=>z(()=>e.removeAttribute(Mt("cloak")))));Oo(()=>`[${Mt("init")}]`);W("init",Ve((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));W("text",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.textContent=i})})})});W("html",(e,{expression:t},{effect:n,evaluateLater:a})=>{let r=a(t);n(()=>{r(i=>{z(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Pe(e),delete e._x_ignoreSelf})})})});ti(ko(":",Co(Mt("bind:"))));var mc=(e,{value:t,modifiers:n,expression:a,original:r},{effect:i,cleanup:s})=>{if(!t){let c={};tp(c),ne(e,a)(u=>{Zo(e,u,r)},{scope:c});return}if(t==="key")return Kp(e,a);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=ne(e,a);i(()=>o(c=>{c===void 0&&typeof a=="string"&&a.match(/\./)&&(c=""),z(()=>Mo(e,t,c,n))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};mc.inline=(e,{value:t,modifiers:n,expression:a})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:a,extract:!1})};W("bind",mc);function Kp(e,t){e._x_keyExpression=t}Ro(()=>`[${Mt("data")}]`);W("data",(e,{expression:t},{cleanup:n})=>{if(Qp(e))return;t=t===""?"{}":t;let a={};mr(a,e);let r={};ap(r,a);let i=ct(e,t,{scope:r});(i===void 0||i===!0)&&(i={}),mr(i,e);let s=Pt(i);ho(s);let o=wn(e,s);s.init&&ct(e,s.init),n(()=>{s.destroy&&ct(e,s.destroy),o()})});Ea((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function Qp(e){return He?vr?!0:e.hasAttribute("data-has-alpine-state"):!1}W("show",(e,{modifiers:t,expression:n},{effect:a})=>{let r=ne(e,n);e._x_doHide||(e._x_doHide=()=>{z(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{z(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},o=()=>setTimeout(s),c=_r(p=>p?s():i(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,i):p?o():i()}),l,u=!0;a(()=>r(p=>{!u&&p===l||(t.includes("immediate")&&(p?o():i()),c(p),l=p,u=!1)}))});W("for",(e,{expression:t},{effect:n,cleanup:a})=>{let r=ed(t),i=ne(e,r.items),s=ne(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},n(()=>Jp(e,r,i,s)),a(()=>{Object.values(e._x_lookup).forEach(o=>z(()=>{zt(o),o.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function Jp(e,t,n,a){let r=s=>typeof s=="object"&&!Array.isArray(s),i=e;n(s=>{td(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let o=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(r(s))s=Object.entries(s).map(([f,b])=>{let _=Xi(t,b,f,s);a(w=>{u.includes(w)&&pe("Duplicate key on x-for",e),u.push(w)},{scope:{index:f,..._}}),l.push(_)});else for(let f=0;f<s.length;f++){let b=Xi(t,s[f],f,s);a(_=>{u.includes(_)&&pe("Duplicate key on x-for",e),u.push(_)},{scope:{index:f,...b}}),l.push(b)}let p=[],d=[],m=[],g=[];for(let f=0;f<c.length;f++){let b=c[f];u.indexOf(b)===-1&&m.push(b)}c=c.filter(f=>!m.includes(f));let v="template";for(let f=0;f<u.length;f++){let b=u[f],_=c.indexOf(b);if(_===-1)c.splice(f,0,b),p.push([v,f]);else if(_!==f){let w=c.splice(f,1)[0],h=c.splice(_-1,1)[0];c.splice(f,0,h),c.splice(_,0,w),d.push([w,h])}else g.push(b);v=b}for(let f=0;f<m.length;f++){let b=m[f];b in o&&(z(()=>{zt(o[b]),o[b].remove()}),delete o[b])}for(let f=0;f<d.length;f++){let[b,_]=d[f],w=o[b],h=o[_],C=document.createElement("div");z(()=>{h||pe('x-for ":key" is undefined or invalid',i,_,o),h.after(C),w.after(h),h._x_currentIfEl&&h.after(h._x_currentIfEl),C.before(w),w._x_currentIfEl&&w.after(w._x_currentIfEl),C.remove()}),h._x_refreshXForScope(l[u.indexOf(_)])}for(let f=0;f<p.length;f++){let[b,_]=p[f],w=b==="template"?i:o[b];w._x_currentIfEl&&(w=w._x_currentIfEl);let h=l[_],C=u[_],k=document.importNode(i.content,!0).firstElementChild,$=Pt(h);wn(k,$,i),k._x_refreshXForScope=T=>{Object.entries(T).forEach(([N,I])=>{$[N]=I})},z(()=>{w.after(k),Ve(()=>Pe(k))()}),typeof C=="object"&&pe("x-for key cannot be an object, it must be a string or an integer",i),o[C]=k}for(let f=0;f<g.length;f++)o[g[f]]._x_refreshXForScope(l[u.indexOf(g[f])]);i._x_prevKeys=u})}function ed(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,a=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=e.match(a);if(!r)return;let i={};i.items=r[2].trim();let s=r[1].replace(n,"").trim(),o=s.match(t);return o?(i.item=s.replace(t,"").trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=s,i}function Xi(e,t,n,a){let r={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,o)=>{r[s]=t[o]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{r[s]=t[s]}):r[e.item]=t,e.index&&(r[e.index]=n),e.collection&&(r[e.collection]=a),r}function td(e){return!Array.isArray(e)&&!isNaN(e)}function hc(){}hc.inline=(e,{expression:t},{cleanup:n})=>{let a=ka(e);a._x_refs||(a._x_refs={}),a._x_refs[t]=e,n(()=>delete a._x_refs[t])};W("ref",hc);W("if",(e,{expression:t},{effect:n,cleanup:a})=>{e.tagName.toLowerCase()!=="template"&&pe("x-if can only be used on a <template> tag",e);let r=ne(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return wn(o,{},e),z(()=>{e.after(o),Ve(()=>Pe(o))()}),e._x_currentIfEl=o,e._x_undoIf=()=>{z(()=>{zt(o),o.remove()}),delete e._x_currentIfEl},o},s=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>r(o=>{o?i():s()})),a(()=>e._x_undoIf&&e._x_undoIf())});W("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(r=>zp(e,r))});Ea((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});ti(ko("@",Co(Mt("on:"))));W("on",Ve((e,{value:t,modifiers:n,expression:a},{cleanup:r})=>{let i=a?ne(e,a):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=Cr(e,t,n,o=>{i(()=>{},{scope:{$event:o},params:[o]})});r(()=>s())}));Sa("Collapse","collapse","collapse");Sa("Intersect","intersect","intersect");Sa("Focus","trap","focus");Sa("Mask","mask","mask");function Sa(e,t,n){W(t,a=>pe(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,a))}kn.setEvaluator(yo);kn.setReactivityEngine({reactive:mi,effect:mp,release:hp,raw:M});var nd=kn,gc=nd,ae="top",he="bottom",ge="right",re="left",hi="auto",Cn=[ae,he,ge,re],Rt="start",hn="end",ad="clippingParents",fc="viewport",tn="popper",rd="reference",Ki=Cn.reduce(function(e,t){return e.concat([t+"-"+Rt,t+"-"+hn])},[]),bc=[].concat(Cn,[hi]).reduce(function(e,t){return e.concat([t,t+"-"+Rt,t+"-"+hn])},[]),id="beforeRead",sd="read",od="afterRead",cd="beforeMain",ld="main",ud="afterMain",pd="beforeWrite",dd="write",md="afterWrite",hd=[id,sd,od,cd,ld,ud,pd,dd,md];function je(e){return e?(e.nodeName||"").toLowerCase():null}function oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mt(e){var t=oe(e).Element;return e instanceof t||e instanceof Element}function me(e){var t=oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function gi(e){if(typeof ShadowRoot>"u")return!1;var t=oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function gd(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!me(i)||!je(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(s){var o=r[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function fd(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},s=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),o=s.reduce(function(c,l){return c[l]="",c},{});!me(r)||!je(r)||(Object.assign(r.style,o),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const _c={name:"applyStyles",enabled:!0,phase:"write",fn:gd,effect:fd,requires:["computeStyles"]};function $e(e){return e.split("-")[0]}var pt=Math.max,la=Math.min,Ot=Math.round;function Er(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yc(){return!/^((?!chrome|android).)*safari/i.test(Er())}function It(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),r=1,i=1;t&&me(e)&&(r=e.offsetWidth>0&&Ot(a.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ot(a.height)/e.offsetHeight||1);var s=mt(e)?oe(e):window,o=s.visualViewport,c=!yc()&&n,l=(a.left+(c&&o?o.offsetLeft:0))/r,u=(a.top+(c&&o?o.offsetTop:0))/i,p=a.width/r,d=a.height/i;return{width:p,height:d,top:u,right:l+p,bottom:u+d,left:l,x:l,y:u}}function fi(e){var t=It(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function vc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&gi(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function De(e){return oe(e).getComputedStyle(e)}function bd(e){return["table","td","th"].indexOf(je(e))>=0}function Ze(e){return((mt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return je(e)==="html"?e:e.assignedSlot||e.parentNode||(gi(e)?e.host:null)||Ze(e)}function Qi(e){return!me(e)||De(e).position==="fixed"?null:e.offsetParent}function _d(e){var t=/firefox/i.test(Er()),n=/Trident/i.test(Er());if(n&&me(e)){var a=De(e);if(a.position==="fixed")return null}var r=Aa(e);for(gi(r)&&(r=r.host);me(r)&&["html","body"].indexOf(je(r))<0;){var i=De(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function En(e){for(var t=oe(e),n=Qi(e);n&&bd(n)&&De(n).position==="static";)n=Qi(n);return n&&(je(n)==="html"||je(n)==="body"&&De(n).position==="static")?t:n||_d(e)||t}function bi(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cn(e,t,n){return pt(e,la(t,n))}function yd(e,t,n){var a=cn(e,t,n);return a>n?n:a}function wc(){return{top:0,right:0,bottom:0,left:0}}function xc(e){return Object.assign({},wc(),e)}function kc(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var vd=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,xc(typeof t!="number"?t:kc(t,Cn))};function wd(e){var t,n=e.state,a=e.name,r=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=$e(n.placement),c=bi(o),l=[re,ge].indexOf(o)>=0,u=l?"height":"width";if(!(!i||!s)){var p=vd(r.padding,n),d=fi(i),m=c==="y"?ae:re,g=c==="y"?he:ge,v=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],f=s[c]-n.rects.reference[c],b=En(i),_=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,w=v/2-f/2,h=p[m],C=_-d[u]-p[g],k=_/2-d[u]/2+w,$=cn(h,k,C),T=c;n.modifiersData[a]=(t={},t[T]=$,t.centerOffset=$-k,t)}}function xd(e){var t=e.state,n=e.options,a=n.element,r=a===void 0?"[data-popper-arrow]":a;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||vc(t.elements.popper,r)&&(t.elements.arrow=r))}const kd={name:"arrow",enabled:!0,phase:"main",fn:wd,effect:xd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nt(e){return e.split("-")[1]}var Cd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ed(e,t){var n=e.x,a=e.y,r=t.devicePixelRatio||1;return{x:Ot(n*r)/r||0,y:Ot(a*r)/r||0}}function Ji(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.variation,s=e.offsets,o=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,g=s.y,v=g===void 0?0:g,f=typeof u=="function"?u({x:m,y:v}):{x:m,y:v};m=f.x,v=f.y;var b=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),w=re,h=ae,C=window;if(l){var k=En(n),$="clientHeight",T="clientWidth";if(k===oe(n)&&(k=Ze(n),De(k).position!=="static"&&o==="absolute"&&($="scrollHeight",T="scrollWidth")),k=k,r===ae||(r===re||r===ge)&&i===hn){h=he;var N=p&&k===C&&C.visualViewport?C.visualViewport.height:k[$];v-=N-a.height,v*=c?1:-1}if(r===re||(r===ae||r===he)&&i===hn){w=ge;var I=p&&k===C&&C.visualViewport?C.visualViewport.width:k[T];m-=I-a.width,m*=c?1:-1}}var D=Object.assign({position:o},l&&Cd),R=u===!0?Ed({x:m,y:v},oe(n)):{x:m,y:v};if(m=R.x,v=R.y,c){var L;return Object.assign({},D,(L={},L[h]=_?"0":"",L[w]=b?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",L))}return Object.assign({},D,(t={},t[h]=_?v+"px":"",t[w]=b?m+"px":"",t.transform="",t))}function Fd(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,c=o===void 0?!0:o,l={placement:$e(t.placement),variation:Nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ji(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ji(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const $d={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fd,data:{}};var Hn={passive:!0};function jd(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,s=a.resize,o=s===void 0?!0:s,c=oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Hn)}),o&&c.addEventListener("resize",n.update,Hn),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Hn)}),o&&c.removeEventListener("resize",n.update,Hn)}}const Sd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jd,data:{}};var Ad={left:"right",right:"left",bottom:"top",top:"bottom"};function ta(e){return e.replace(/left|right|bottom|top/g,function(t){return Ad[t]})}var Td={start:"end",end:"start"};function es(e){return e.replace(/start|end/g,function(t){return Td[t]})}function _i(e){var t=oe(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function yi(e){return It(Ze(e)).left+_i(e).scrollLeft}function Rd(e,t){var n=oe(e),a=Ze(e),r=n.visualViewport,i=a.clientWidth,s=a.clientHeight,o=0,c=0;if(r){i=r.width,s=r.height;var l=yc();(l||!l&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:o+yi(e),y:c}}function Od(e){var t,n=Ze(e),a=_i(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=pt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=pt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-a.scrollLeft+yi(e),c=-a.scrollTop;return De(r||n).direction==="rtl"&&(o+=pt(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:o,y:c}}function vi(e){var t=De(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function Cc(e){return["html","body","#document"].indexOf(je(e))>=0?e.ownerDocument.body:me(e)&&vi(e)?e:Cc(Aa(e))}function ln(e,t){var n;t===void 0&&(t=[]);var a=Cc(e),r=a===((n=e.ownerDocument)==null?void 0:n.body),i=oe(a),s=r?[i].concat(i.visualViewport||[],vi(a)?a:[]):a,o=t.concat(s);return r?o:o.concat(ln(Aa(s)))}function Fr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Id(e,t){var n=It(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ts(e,t,n){return t===fc?Fr(Rd(e,n)):mt(t)?Id(t,n):Fr(Od(Ze(e)))}function Nd(e){var t=ln(Aa(e)),n=["absolute","fixed"].indexOf(De(e).position)>=0,a=n&&me(e)?En(e):e;return mt(a)?t.filter(function(r){return mt(r)&&vc(r,a)&&je(r)!=="body"}):[]}function Ld(e,t,n,a){var r=t==="clippingParents"?Nd(e):[].concat(t),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(c,l){var u=ts(e,l,a);return c.top=pt(u.top,c.top),c.right=la(u.right,c.right),c.bottom=la(u.bottom,c.bottom),c.left=pt(u.left,c.left),c},ts(e,s,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Ec(e){var t=e.reference,n=e.element,a=e.placement,r=a?$e(a):null,i=a?Nt(a):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,c;switch(r){case ae:c={x:s,y:t.y-n.height};break;case he:c={x:s,y:t.y+t.height};break;case ge:c={x:t.x+t.width,y:o};break;case re:c={x:t.x-n.width,y:o};break;default:c={x:t.x,y:t.y}}var l=r?bi(r):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case Rt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case hn:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function gn(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.strategy,s=i===void 0?e.strategy:i,o=n.boundary,c=o===void 0?ad:o,l=n.rootBoundary,u=l===void 0?fc:l,p=n.elementContext,d=p===void 0?tn:p,m=n.altBoundary,g=m===void 0?!1:m,v=n.padding,f=v===void 0?0:v,b=xc(typeof f!="number"?f:kc(f,Cn)),_=d===tn?rd:tn,w=e.rects.popper,h=e.elements[g?_:d],C=Ld(mt(h)?h:h.contextElement||Ze(e.elements.popper),c,u,s),k=It(e.elements.reference),$=Ec({reference:k,element:w,placement:r}),T=Fr(Object.assign({},w,$)),N=d===tn?T:k,I={top:C.top-N.top+b.top,bottom:N.bottom-C.bottom+b.bottom,left:C.left-N.left+b.left,right:N.right-C.right+b.right},D=e.modifiersData.offset;if(d===tn&&D){var R=D[r];Object.keys(I).forEach(function(L){var q=[ge,he].indexOf(L)>=0?1:-1,U=[ae,he].indexOf(L)>=0?"y":"x";I[L]+=R[U]*q})}return I}function Pd(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?bc:c,u=Nt(a),p=u?o?Ki:Ki.filter(function(g){return Nt(g)===u}):Cn,d=p.filter(function(g){return l.indexOf(g)>=0});d.length===0&&(d=p);var m=d.reduce(function(g,v){return g[v]=gn(e,{placement:v,boundary:r,rootBoundary:i,padding:s})[$e(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Dd(e){if($e(e)===hi)return[];var t=ta(e);return[es(e),t,es(t)]}function Md(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!0:s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,v=n.allowedAutoPlacements,f=t.options.placement,b=$e(f),_=b===f,w=c||(_||!g?[ta(f)]:Dd(f)),h=[f].concat(w).reduce(function(Se,fe){return Se.concat($e(fe)===hi?Pd(t,{placement:fe,boundary:u,rootBoundary:p,padding:l,flipVariations:g,allowedAutoPlacements:v}):fe)},[]),C=t.rects.reference,k=t.rects.popper,$=new Map,T=!0,N=h[0],I=0;I<h.length;I++){var D=h[I],R=$e(D),L=Nt(D)===Rt,q=[ae,he].indexOf(R)>=0,U=q?"width":"height",G=gn(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),Q=q?L?ge:re:L?he:ae;C[U]>k[U]&&(Q=ta(Q));var K=ta(Q),we=[];if(i&&we.push(G[R]<=0),o&&we.push(G[Q]<=0,G[K]<=0),we.every(function(Se){return Se})){N=D,T=!1;break}$.set(D,we)}if(T)for(var xe=g?3:1,Ye=function(fe){var Ae=h.find(function(bt){var Te=$.get(bt);if(Te)return Te.slice(0,fe).every(function(_t){return _t})});if(Ae)return N=Ae,"break"},ke=xe;ke>0;ke--){var Xe=Ye(ke);if(Xe==="break")break}t.placement!==N&&(t.modifiersData[a]._skip=!0,t.placement=N,t.reset=!0)}}const qd={name:"flip",enabled:!0,phase:"main",fn:Md,requiresIfExists:["offset"],data:{_skip:!1}};function ns(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function as(e){return[ae,ge,he,re].some(function(t){return e[t]>=0})}function zd(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=gn(t,{elementContext:"reference"}),o=gn(t,{altBoundary:!0}),c=ns(s,a),l=ns(o,r,i),u=as(c),p=as(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Bd={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zd};function Ud(e,t,n){var a=$e(e),r=[re,ae].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*r,[re,ge].indexOf(a)>=0?{x:o,y:s}:{x:s,y:o}}function Gd(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,s=bc.reduce(function(u,p){return u[p]=Ud(p,t.rects,i),u},{}),o=s[t.placement],c=o.x,l=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[a]=s}const Hd={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gd};function Wd(e){var t=e.state,n=e.name;t.modifiersData[n]=Ec({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Vd={name:"popperOffsets",enabled:!0,phase:"read",fn:Wd,data:{}};function Zd(e){return e==="x"?"y":"x"}function Yd(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,s=n.altAxis,o=s===void 0?!1:s,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,g=n.tetherOffset,v=g===void 0?0:g,f=gn(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:u}),b=$e(t.placement),_=Nt(t.placement),w=!_,h=bi(b),C=Zd(h),k=t.modifiersData.popperOffsets,$=t.rects.reference,T=t.rects.popper,N=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,I=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(k){if(i){var L,q=h==="y"?ae:re,U=h==="y"?he:ge,G=h==="y"?"height":"width",Q=k[h],K=Q+f[q],we=Q-f[U],xe=m?-T[G]/2:0,Ye=_===Rt?$[G]:T[G],ke=_===Rt?-T[G]:-$[G],Xe=t.elements.arrow,Se=m&&Xe?fi(Xe):{width:0,height:0},fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wc(),Ae=fe[q],bt=fe[U],Te=cn(0,$[G],Se[G]),_t=w?$[G]/2-xe-Te-Ae-I.mainAxis:Ye-Te-Ae-I.mainAxis,Me=w?-$[G]/2+xe+Te+bt+I.mainAxis:ke+Te+bt+I.mainAxis,yt=t.elements.arrow&&En(t.elements.arrow),Sn=yt?h==="y"?yt.clientTop||0:yt.clientLeft||0:0,Vt=(L=D?.[h])!=null?L:0,An=Q+_t-Vt-Sn,Tn=Q+Me-Vt,Zt=cn(m?la(K,An):K,Q,m?pt(we,Tn):we);k[h]=Zt,R[h]=Zt-Q}if(o){var Yt,Rn=h==="x"?ae:re,On=h==="x"?he:ge,Re=k[C],qe=C==="y"?"height":"width",Xt=Re+f[Rn],Ke=Re-f[On],Kt=[ae,re].indexOf(b)!==-1,In=(Yt=D?.[C])!=null?Yt:0,Nn=Kt?Xt:Re-$[qe]-T[qe]-In+I.altAxis,Ln=Kt?Re+$[qe]+T[qe]-In-I.altAxis:Ke,Pn=m&&Kt?yd(Nn,Re,Ln):cn(m?Nn:Xt,Re,m?Ln:Ke);k[C]=Pn,R[C]=Pn-Re}t.modifiersData[a]=R}}const Xd={name:"preventOverflow",enabled:!0,phase:"main",fn:Yd,requiresIfExists:["offset"]};function Kd(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Qd(e){return e===oe(e)||!me(e)?_i(e):Kd(e)}function Jd(e){var t=e.getBoundingClientRect(),n=Ot(t.width)/e.offsetWidth||1,a=Ot(t.height)/e.offsetHeight||1;return n!==1||a!==1}function em(e,t,n){n===void 0&&(n=!1);var a=me(t),r=me(t)&&Jd(t),i=Ze(t),s=It(e,r,n),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&((je(t)!=="body"||vi(i))&&(o=Qd(t)),me(t)?(c=It(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=yi(i))),{x:s.left+o.scrollLeft-c.x,y:s.top+o.scrollTop-c.y,width:s.width,height:s.height}}function tm(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var c=t.get(o);c&&r(c)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function nm(e){var t=tm(e);return hd.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function am(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function rm(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign({},r,a,{options:Object.assign({},r.options,a.options),data:Object.assign({},r.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var rs={placement:"bottom",modifiers:[],strategy:"absolute"};function is(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function im(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?rs:r;return function(o,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},rs,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},p=[],d=!1,m={state:u,setOptions:function(b){var _=typeof b=="function"?b(u.options):b;v(),u.options=Object.assign({},i,u.options,_),u.scrollParents={reference:mt(o)?ln(o):o.contextElement?ln(o.contextElement):[],popper:ln(c)};var w=nm(rm([].concat(a,u.options.modifiers)));return u.orderedModifiers=w.filter(function(h){return h.enabled}),g(),m.update()},forceUpdate:function(){if(!d){var b=u.elements,_=b.reference,w=b.popper;if(is(_,w)){u.rects={reference:em(_,En(w),u.options.strategy==="fixed"),popper:fi(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var h=0;h<u.orderedModifiers.length;h++){if(u.reset===!0){u.reset=!1,h=-1;continue}var C=u.orderedModifiers[h],k=C.fn,$=C.options,T=$===void 0?{}:$,N=C.name;typeof k=="function"&&(u=k({state:u,options:T,name:N,instance:m})||u)}}}},update:am(function(){return new Promise(function(f){m.forceUpdate(),f(u)})}),destroy:function(){v(),d=!0}};if(!is(o,c))return m;m.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)});function g(){u.orderedModifiers.forEach(function(f){var b=f.name,_=f.options,w=_===void 0?{}:_,h=f.effect;if(typeof h=="function"){var C=h({state:u,name:b,instance:m,options:w}),k=function(){};p.push(C||k)}})}function v(){p.forEach(function(f){return f()}),p=[]}return m}}var sm=[Sd,Vd,$d,_c,Hd,qd,Xd,kd,Bd],om=im({defaultModifiers:sm}),cm="tippy-box",Fc="tippy-content",lm="tippy-backdrop",$c="tippy-arrow",jc="tippy-svg-arrow",tt={passive:!0,capture:!0},Sc=function(){return document.body};function Ga(e,t,n){if(Array.isArray(e)){var a=e[t];return a??(Array.isArray(n)?n[t]:n)}return e}function wi(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Ac(e,t){return typeof e=="function"?e.apply(void 0,t):e}function ss(e,t){if(t===0)return e;var n;return function(a){clearTimeout(n),n=setTimeout(function(){e(a)},t)}}function um(e){return e.split(/\s+/).filter(Boolean)}function Ct(e){return[].concat(e)}function os(e,t){e.indexOf(t)===-1&&e.push(t)}function pm(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function dm(e){return e.split("-")[0]}function ua(e){return[].slice.call(e)}function cs(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function un(){return document.createElement("div")}function Ta(e){return["Element","Fragment"].some(function(t){return wi(e,t)})}function mm(e){return wi(e,"NodeList")}function hm(e){return wi(e,"MouseEvent")}function gm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function fm(e){return Ta(e)?[e]:mm(e)?ua(e):Array.isArray(e)?e:ua(document.querySelectorAll(e))}function Ha(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function ls(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function bm(e){var t,n=Ct(e),a=n[0];return a!=null&&(t=a.ownerDocument)!=null&&t.body?a.ownerDocument:document}function _m(e,t){var n=t.clientX,a=t.clientY;return e.every(function(r){var i=r.popperRect,s=r.popperState,o=r.props,c=o.interactiveBorder,l=dm(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=l==="bottom"?u.top.y:0,d=l==="top"?u.bottom.y:0,m=l==="right"?u.left.x:0,g=l==="left"?u.right.x:0,v=i.top-a+p>c,f=a-i.bottom-d>c,b=i.left-n+m>c,_=n-i.right-g>c;return v||f||b||_})}function Wa(e,t,n){var a=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){e[a](r,n)})}function us(e,t){for(var n=t;n;){var a;if(e.contains(n))return!0;n=n.getRootNode==null||(a=n.getRootNode())==null?void 0:a.host}return!1}var Fe={isTouch:!1},ps=0;function ym(){Fe.isTouch||(Fe.isTouch=!0,window.performance&&document.addEventListener("mousemove",Tc))}function Tc(){var e=performance.now();e-ps<20&&(Fe.isTouch=!1,document.removeEventListener("mousemove",Tc)),ps=e}function vm(){var e=document.activeElement;if(gm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function wm(){document.addEventListener("touchstart",ym,tt),window.addEventListener("blur",vm)}var xm=typeof window<"u"&&typeof document<"u",km=xm?!!window.msCrypto:!1,Cm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Em={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_e=Object.assign({appendTo:Sc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Cm,Em),Fm=Object.keys(_e),$m=function(t){var n=Object.keys(t);n.forEach(function(a){_e[a]=t[a]})};function Rc(e){var t=e.plugins||[],n=t.reduce(function(a,r){var i=r.name,s=r.defaultValue;if(i){var o;a[i]=e[i]!==void 0?e[i]:(o=_e[i])!=null?o:s}return a},{});return Object.assign({},e,n)}function jm(e,t){var n=t?Object.keys(Rc(Object.assign({},_e,{plugins:t}))):Fm,a=n.reduce(function(r,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return r;if(i==="content")r[i]=s;else try{r[i]=JSON.parse(s)}catch{r[i]=s}return r},{});return a}function ds(e,t){var n=Object.assign({},t,{content:Ac(t.content,[e])},t.ignoreAttributes?{}:jm(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var Sm=function(){return"innerHTML"};function $r(e,t){e[Sm()]=t}function ms(e){var t=un();return e===!0?t.className=$c:(t.className=jc,Ta(e)?t.appendChild(e):$r(t,e)),t}function hs(e,t){Ta(t.content)?($r(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$r(e,t.content):e.textContent=t.content)}function jr(e){var t=e.firstElementChild,n=ua(t.children);return{box:t,content:n.find(function(a){return a.classList.contains(Fc)}),arrow:n.find(function(a){return a.classList.contains($c)||a.classList.contains(jc)}),backdrop:n.find(function(a){return a.classList.contains(lm)})}}function Oc(e){var t=un(),n=un();n.className=cm,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var a=un();a.className=Fc,a.setAttribute("data-state","hidden"),hs(a,e.props),t.appendChild(n),n.appendChild(a),r(e.props,e.props);function r(i,s){var o=jr(t),c=o.box,l=o.content,u=o.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&hs(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(ms(s.arrow))):c.appendChild(ms(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:r}}Oc.$$tippy=!0;var Am=1,Wn=[],Va=[];function Tm(e,t){var n=ds(e,Object.assign({},_e,Rc(cs(t)))),a,r,i,s=!1,o=!1,c=!1,l=!1,u,p,d,m=[],g=ss(An,n.interactiveDebounce),v,f=Am++,b=null,_=pm(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:f,reference:e,popper:un(),popperInstance:b,props:n,state:w,plugins:_,clearDelayTimeouts:Nn,setProps:Ln,setContent:Pn,show:Bl,hide:Ul,hideWithInteractivity:Gl,enable:Kt,disable:In,unmount:Hl,destroy:Wl};if(!n.render)return h;var C=n.render(h),k=C.popper,$=C.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+h.id,h.popper=k,e._tippy=h,k._tippy=h;var T=_.map(function(y){return y.fn(h)}),N=e.hasAttribute("aria-expanded");return yt(),xe(),Q(),K("onCreate",[h]),n.showOnCreate&&Xt(),k.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",g)}),h;function I(){var y=h.props.touch;return Array.isArray(y)?y:[y,0]}function D(){return I()[0]==="hold"}function R(){var y;return!!((y=h.props.render)!=null&&y.$$tippy)}function L(){return v||e}function q(){var y=L().parentNode;return y?bm(y):document}function U(){return jr(k)}function G(y){return h.state.isMounted&&!h.state.isVisible||Fe.isTouch||u&&u.type==="focus"?0:Ga(h.props.delay,y?0:1,_e.delay)}function Q(y){y===void 0&&(y=!1),k.style.pointerEvents=h.props.interactive&&!y?"":"none",k.style.zIndex=""+h.props.zIndex}function K(y,E,F){if(F===void 0&&(F=!0),T.forEach(function(A){A[y]&&A[y].apply(A,E)}),F){var O;(O=h.props)[y].apply(O,E)}}function we(){var y=h.props.aria;if(y.content){var E="aria-"+y.content,F=k.id,O=Ct(h.props.triggerTarget||e);O.forEach(function(A){var te=A.getAttribute(E);if(h.state.isVisible)A.setAttribute(E,te?te+" "+F:F);else{var ce=te&&te.replace(F,"").trim();ce?A.setAttribute(E,ce):A.removeAttribute(E)}})}}function xe(){if(!(N||!h.props.aria.expanded)){var y=Ct(h.props.triggerTarget||e);y.forEach(function(E){h.props.interactive?E.setAttribute("aria-expanded",h.state.isVisible&&E===L()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ye(){q().removeEventListener("mousemove",g),Wn=Wn.filter(function(y){return y!==g})}function ke(y){if(!(Fe.isTouch&&(c||y.type==="mousedown"))){var E=y.composedPath&&y.composedPath()[0]||y.target;if(!(h.props.interactive&&us(k,E))){if(Ct(h.props.triggerTarget||e).some(function(F){return us(F,E)})){if(Fe.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else K("onClickOutside",[h,y]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),o=!0,setTimeout(function(){o=!1}),h.state.isMounted||Ae())}}}function Xe(){c=!0}function Se(){c=!1}function fe(){var y=q();y.addEventListener("mousedown",ke,!0),y.addEventListener("touchend",ke,tt),y.addEventListener("touchstart",Se,tt),y.addEventListener("touchmove",Xe,tt)}function Ae(){var y=q();y.removeEventListener("mousedown",ke,!0),y.removeEventListener("touchend",ke,tt),y.removeEventListener("touchstart",Se,tt),y.removeEventListener("touchmove",Xe,tt)}function bt(y,E){_t(y,function(){!h.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&E()})}function Te(y,E){_t(y,E)}function _t(y,E){var F=U().box;function O(A){A.target===F&&(Wa(F,"remove",O),E())}if(y===0)return E();Wa(F,"remove",p),Wa(F,"add",O),p=O}function Me(y,E,F){F===void 0&&(F=!1);var O=Ct(h.props.triggerTarget||e);O.forEach(function(A){A.addEventListener(y,E,F),m.push({node:A,eventType:y,handler:E,options:F})})}function yt(){D()&&(Me("touchstart",Vt,{passive:!0}),Me("touchend",Tn,{passive:!0})),um(h.props.trigger).forEach(function(y){if(y!=="manual")switch(Me(y,Vt),y){case"mouseenter":Me("mouseleave",Tn);break;case"focus":Me(km?"focusout":"blur",Zt);break;case"focusin":Me("focusout",Zt);break}})}function Sn(){m.forEach(function(y){var E=y.node,F=y.eventType,O=y.handler,A=y.options;E.removeEventListener(F,O,A)}),m=[]}function Vt(y){var E,F=!1;if(!(!h.state.isEnabled||Yt(y)||o)){var O=((E=u)==null?void 0:E.type)==="focus";u=y,v=y.currentTarget,xe(),!h.state.isVisible&&hm(y)&&Wn.forEach(function(A){return A(y)}),y.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?F=!0:Xt(y),y.type==="click"&&(s=!F),F&&!O&&Ke(y)}}function An(y){var E=y.target,F=L().contains(E)||k.contains(E);if(!(y.type==="mousemove"&&F)){var O=qe().concat(k).map(function(A){var te,ce=A._tippy,vt=(te=ce.popperInstance)==null?void 0:te.state;return vt?{popperRect:A.getBoundingClientRect(),popperState:vt,props:n}:null}).filter(Boolean);_m(O,y)&&(Ye(),Ke(y))}}function Tn(y){var E=Yt(y)||h.props.trigger.indexOf("click")>=0&&s;if(!E){if(h.props.interactive){h.hideWithInteractivity(y);return}Ke(y)}}function Zt(y){h.props.trigger.indexOf("focusin")<0&&y.target!==L()||h.props.interactive&&y.relatedTarget&&k.contains(y.relatedTarget)||Ke(y)}function Yt(y){return Fe.isTouch?D()!==y.type.indexOf("touch")>=0:!1}function Rn(){On();var y=h.props,E=y.popperOptions,F=y.placement,O=y.offset,A=y.getReferenceClientRect,te=y.moveTransition,ce=R()?jr(k).arrow:null,vt=A?{getBoundingClientRect:A,contextElement:A.contextElement||L()}:e,Li={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Dn){var wt=Dn.state;if(R()){var Vl=U(),Da=Vl.box;["placement","reference-hidden","escaped"].forEach(function(Mn){Mn==="placement"?Da.setAttribute("data-placement",wt.placement):wt.attributes.popper["data-popper-"+Mn]?Da.setAttribute("data-"+Mn,""):Da.removeAttribute("data-"+Mn)}),wt.attributes.popper={}}}},Qe=[{name:"offset",options:{offset:O}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},Li];R()&&ce&&Qe.push({name:"arrow",options:{element:ce,padding:3}}),Qe.push.apply(Qe,E?.modifiers||[]),h.popperInstance=om(vt,k,Object.assign({},E,{placement:F,onFirstUpdate:d,modifiers:Qe}))}function On(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function Re(){var y=h.props.appendTo,E,F=L();h.props.interactive&&y===Sc||y==="parent"?E=F.parentNode:E=Ac(y,[F]),E.contains(k)||E.appendChild(k),h.state.isMounted=!0,Rn()}function qe(){return ua(k.querySelectorAll("[data-tippy-root]"))}function Xt(y){h.clearDelayTimeouts(),y&&K("onTrigger",[h,y]),fe();var E=G(!0),F=I(),O=F[0],A=F[1];Fe.isTouch&&O==="hold"&&A&&(E=A),E?a=setTimeout(function(){h.show()},E):h.show()}function Ke(y){if(h.clearDelayTimeouts(),K("onUntrigger",[h,y]),!h.state.isVisible){Ae();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(y.type)>=0&&s)){var E=G(!1);E?r=setTimeout(function(){h.state.isVisible&&h.hide()},E):i=requestAnimationFrame(function(){h.hide()})}}function Kt(){h.state.isEnabled=!0}function In(){h.hide(),h.state.isEnabled=!1}function Nn(){clearTimeout(a),clearTimeout(r),cancelAnimationFrame(i)}function Ln(y){if(!h.state.isDestroyed){K("onBeforeUpdate",[h,y]),Sn();var E=h.props,F=ds(e,Object.assign({},E,cs(y),{ignoreAttributes:!0}));h.props=F,yt(),E.interactiveDebounce!==F.interactiveDebounce&&(Ye(),g=ss(An,F.interactiveDebounce)),E.triggerTarget&&!F.triggerTarget?Ct(E.triggerTarget).forEach(function(O){O.removeAttribute("aria-expanded")}):F.triggerTarget&&e.removeAttribute("aria-expanded"),xe(),Q(),$&&$(E,F),h.popperInstance&&(Rn(),qe().forEach(function(O){requestAnimationFrame(O._tippy.popperInstance.forceUpdate)})),K("onAfterUpdate",[h,y])}}function Pn(y){h.setProps({content:y})}function Bl(){var y=h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Fe.isTouch&&!h.props.touch,A=Ga(h.props.duration,0,_e.duration);if(!(y||E||F||O)&&!L().hasAttribute("disabled")&&(K("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,R()&&(k.style.visibility="visible"),Q(),fe(),h.state.isMounted||(k.style.transition="none"),R()){var te=U(),ce=te.box,vt=te.content;Ha([ce,vt],0)}d=function(){var Qe;if(!(!h.state.isVisible||l)){if(l=!0,k.offsetHeight,k.style.transition=h.props.moveTransition,R()&&h.props.animation){var Pa=U(),Dn=Pa.box,wt=Pa.content;Ha([Dn,wt],A),ls([Dn,wt],"visible")}we(),xe(),os(Va,h),(Qe=h.popperInstance)==null||Qe.forceUpdate(),K("onMount",[h]),h.props.animation&&R()&&Te(A,function(){h.state.isShown=!0,K("onShown",[h])})}},Re()}}function Ul(){var y=!h.state.isVisible,E=h.state.isDestroyed,F=!h.state.isEnabled,O=Ga(h.props.duration,1,_e.duration);if(!(y||E||F)&&(K("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,l=!1,s=!1,R()&&(k.style.visibility="hidden"),Ye(),Ae(),Q(!0),R()){var A=U(),te=A.box,ce=A.content;h.props.animation&&(Ha([te,ce],O),ls([te,ce],"hidden"))}we(),xe(),h.props.animation?R()&&bt(O,h.unmount):h.unmount()}}function Gl(y){q().addEventListener("mousemove",g),os(Wn,g),g(y)}function Hl(){h.state.isVisible&&h.hide(),h.state.isMounted&&(On(),qe().forEach(function(y){y._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Va=Va.filter(function(y){return y!==h}),h.state.isMounted=!1,K("onHidden",[h]))}function Wl(){h.state.isDestroyed||(h.clearDelayTimeouts(),h.unmount(),Sn(),delete e._tippy,h.state.isDestroyed=!0,K("onDestroy",[h]))}}function Bt(e,t){t===void 0&&(t={});var n=_e.plugins.concat(t.plugins||[]);wm();var a=Object.assign({},t,{plugins:n}),r=fm(e),i=r.reduce(function(s,o){var c=o&&Tm(o,a);return c&&s.push(c),s},[]);return Ta(e)?i[0]:i}Bt.defaultProps=_e;Bt.setDefaultProps=$m;Bt.currentInput=Fe;Object.assign({},_c,{effect:function(t){var n=t.state,a={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,a.popper),n.styles=a,n.elements.arrow&&Object.assign(n.elements.arrow.style,a.arrow)}});Bt.setDefaultProps({render:Oc});let Y=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Rm(e){return xi(e)}function xi(e){return Array.isArray(e)?Om(e):e instanceof RegExp?e:typeof e=="object"?Im(e):e}function Om(e){let t=[];for(let n=0,a=e.length;n<a;n++)t[n]=xi(e[n]);return t}function Im(e){let t={};for(let n in e)t[n]=xi(e[n]);return t}function Ic(e,...t){return t.forEach(n=>{for(let a in n)e[a]=n[a]}),e}function Nc(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Nc(e.substring(0,e.length-1)):e.substr(~t+1)}var Za=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Vn=class{static hasCaptures(e){return e===null?!1:(Za.lastIndex=0,Za.test(e))}static replaceCaptures(e,t,n){return e.replace(Za,(a,r,i,s)=>{let o=n[parseInt(r||i,10)];if(o){let c=t.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(s){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Lc(e,t){return e<t?-1:e>t?1:0}function Pc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,a=t.length;if(n===a){for(let r=0;r<n;r++){let i=Lc(e[r],t[r]);if(i!==0)return i}return 0}return n-a}function gs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Dc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Mc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},pa=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Pm(e),t)}static createFromParsedTheme(e,t){return Mm(e,t)}_cachedMatchRoot=new Mc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,a=this._cachedMatchRoot.get(t).find(r=>Nm(e.parent,r.parentScopes));return a?new qc(a.fontStyle,a.foreground,a.background):null}},Ya=class na{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const a of n)t=new na(t,a);return t}static from(...t){let n=null;for(let a=0;a<t.length;a++)n=new na(n,t[a]);return n}push(t){return new na(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push(a.scopeName),a=a.parent;return a===t?n.reverse():void 0}};function Nm(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let a=t[n],r=!1;if(a===">"){if(n===t.length-1)return!1;a=t[++n],r=!0}for(;e&&!Lm(e.scopeName,a);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lm(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Pm(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],a=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let o;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(s.scope)?o=s.scope:o=[""];let c=-1;if(typeof s.settings.fontStyle=="string"){c=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof s.settings.foreground=="string"&&gs(s.settings.foreground)&&(l=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&gs(s.settings.background)&&(u=s.settings.background);for(let p=0,d=o.length;p<d;p++){let g=o[p].trim().split(" "),v=g[g.length-1],f=null;g.length>1&&(f=g.slice(0,g.length-1),f.reverse()),n[a++]=new Dm(v,f,r,c,l,u)}}return n}var Dm=class{constructor(e,t,n,a,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},ee=(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))(ee||{});function Mm(e,t){e.sort((c,l)=>{let u=Lc(c.scope,l.scope);return u!==0||(u=Pc(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new qm(t),s=new qc(n,i.getId(a),i.getId(r)),o=new Bm(new Sr(0,null,-1,0,0),[]);for(let c=0,l=e.length;c<l;c++){let u=e[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pa(i,s,o)}var qm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},zm=Object.freeze([]),Sr=class zc{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,a,r,i){this.scopeDepth=t,this.parentScopes=n||zm,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new zc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let a=0,r=t.length;a<r;a++)n[a]=t[a].clone();return n}acceptOverwrite(t,n,a,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},Bm=class Ar{constructor(t,n=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let a=0,r=0;for(;t.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),r,i;if(a===-1?(r=t,i=""):(r=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ar._cmpBySpecificity),n}insert(t,n,a,r,i,s){if(n===""){this._doInsertHere(t,a,r,i,s);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Ar(this._mainRule.clone(),Sr.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,a,r,i,s)}_doInsertHere(t,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(t,a,r,i);return}for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let c=this._rulesWithParentScopes[s];if(Pc(c.parentScopes,n)===0){c.acceptOverwrite(t,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Sr(t,n,a,r,i))}},Lt=class le{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=le.getLanguageId(t),a=le.getTokenType(t),r=le.getFontStyle(t),i=le.getForeground(t),s=le.getBackground(t);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>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,a,r,i,s,o){let c=le.getLanguageId(t),l=le.getTokenType(t),u=le.containsBalancedBrackets(t)?1:0,p=le.getFontStyle(t),d=le.getForeground(t),m=le.getBackground(t);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(p=i),s!==0&&(d=s),o!==0&&(m=o),(c<<0|l<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function da(e,t){const n=[],a=Um(e);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=s();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=o();return r===")"&&(r=a.next()),c}if(fs(r)){const c=[];do c.push(r),r=a.next();while(fs(r));return l=>t(c,l)}return null}function s(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(p=>p(u))}function o(){const c=[];let l=s();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=s()}return u=>c.some(p=>p(u))}}function fs(e){return!!e&&!!e.match(/[\w\.:]+/)}function Um(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const a=n[0];return n=t.exec(e),a}}}function Bc(e){typeof e.dispose=="function"&&e.dispose()}var fn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Gm=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Hm=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))}},Wm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Hm;for(const n of e)Vm(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof fn){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 Vm(e,t,n,a){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof fn?aa({baseGrammar:i,selfGrammar:r},a):Tr(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const s=n.injections(e.scopeName);if(s)for(const o of s)a.add(new fn(o))}function Tr(e,t,n){if(t.repository&&t.repository[e]){const a=t.repository[e];ma([a],t,n)}}function aa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ma(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ma(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ma(e,t,n){for(const a of e){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?Ic({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ma(a.patterns,{...t,repository:r},n);const i=a.include;if(!i)continue;const s=Uc(i);switch(s.kind){case 0:aa({...t,selfGrammar:t.baseGrammar},n);break;case 1:aa(t,n);break;case 2:Tr(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const o=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(o){const c={baseGrammar:t.baseGrammar,selfGrammar:o,repository:r};s.kind===4?Tr(s.ruleName,c,n):aa(c,n)}else s.kind===4?n.add(new Gm(s.scopeName,s.ruleName)):n.add(new fn(s.scopeName));break}}}var Zm=class{kind=0},Ym=class{kind=1},Xm=class{constructor(e){this.ruleName=e}kind=2},Km=class{constructor(e){this.scopeName=e}kind=3},Qm=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uc(e){if(e==="$base")return new Zm;if(e==="$self")return new Ym;const t=e.indexOf("#");if(t===-1)return new Km(e);if(t===0)return new Xm(e.substring(1));{const n=e.substring(0,t),a=e.substring(t+1);return new Qm(n,a)}}var Jm=/\\(\d+)/,bs=/\\(\d+)/g,eh=-1,Gc=-2;var Fn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,a){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Vn.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Vn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nc(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:Vn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Vn.replaceCaptures(this._contentName,e,t)}},th=class extends Fn{retokenizeCapturedWithRuleId;constructor(e,t,n,a,r){super(e,t,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,a){throw new Error("Not supported!")}},nh=class extends Fn{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,null),this._match=new bn(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _n,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_s=class extends Fn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r){super(e,t,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _n,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rr=class extends Fn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,a,r,i,s,o,c,l){super(e,t,n,a),this._begin=new bn(r,this.id),this.beginCaptures=i,this._end=new bn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _n;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}},ha=class extends Fn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,a,r,i,s,o,c){super(e,t,n,a),this._begin=new bn(r,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new bn(s,Gc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _n;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,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new _n,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Hc=class J{static createCaptureRule(t,n,a,r,i){return t.registerRule(s=>new th(n,s,a,r,i))}static getCompiledRuleId(t,n,a){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new nh(t.$vscodeTextmateLocation,t.id,t.name,t.match,J._compileCaptures(t.captures,n,a));if(typeof t.begin>"u"){t.repository&&(a=Ic({},a,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new _s(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,J._compilePatterns(i,n,a))}return t.while?new ha(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.while,J._compileCaptures(t.whileCaptures||t.captures,n,a),J._compilePatterns(t.patterns,n,a)):new Rr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,J._compileCaptures(t.beginCaptures||t.captures,n,a),t.end,J._compileCaptures(t.endCaptures||t.captures,n,a),t.applyEndPatternLast,J._compilePatterns(t.patterns,n,a))}),t.id}static _compileCaptures(t,n,a){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);o>i&&(i=o)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const o=parseInt(s,10);let c=0;t[s].patterns&&(c=J.getCompiledRuleId(t[s],n,a)),r[o]=J.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,c)}}return r}static _compilePatterns(t,n,a){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i];let c=-1;if(o.include){const l=Uc(o.include);switch(l.kind){case 0:case 1:c=J.getCompiledRuleId(a[o.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=J.getCompiledRuleId(u,n,a));break;case 3:case 4:const p=l.scopeName,d=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(p,a);if(m)if(d){let g=m.repository[d];g&&(c=J.getCompiledRuleId(g,n,m.repository))}else c=J.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else c=J.getCompiledRuleId(o,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof _s||l instanceof Rr||l instanceof ha)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},bn=class Wc{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const a=t.length;let r=0,i=[],s=!1;for(let o=0;o<a;o++)if(t.charAt(o)==="\\"&&o+1<a){const l=t.charAt(o+1);l==="z"?(i.push(t.substring(r,o)),i.push("$(?!\\n)(?<!\\n)"),r=o+2):(l==="A"||l==="G")&&(s=!0),o++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Jm.test(this.source):this.hasBackReferences=!1}clone(){return new Wc(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>t.substring(r.start,r.end));return bs.lastIndex=0,this.source.replace(bs,(r,i)=>Dc(a[parseInt(i,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=[],a=[],r=[],i,s,o,c;for(i=0,s=this.source.length;i<s;i++)o=this.source.charAt(i),t[i]=o,n[i]=o,a[i]=o,r[i]=o,o==="\\"&&i+1<s&&(c=this.source.charAt(i+1),c==="A"?(t[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):c==="G"?(t[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(t[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},_n=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ys(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 a=this._items.map(r=>r.resolveAnchors(t,n));return new ys(e,a,this._items.map(r=>r.ruleId))}},ys=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<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
+`)}findNextMatchSync(e,t,n){const a=this.scanner.findNextMatchSync(e,t,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},Xa=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ah=class Or{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Xa(t,8),this._embeddedLanguagesMatcher=new rh(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Or._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Xa(0,0);_getBasicScopeAttributes=new Mc(t=>{const n=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new Xa(n,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Or.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/},rh=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,a])=>Dc(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])}},vs=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Vc(e,t,n,a,r,i,s,o){const c=t.content.length;let l=!1,u=-1;if(s){const m=ih(e,t,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!l;){if(o!==0&&Date.now()-p>o)return new vs(r,!0);d()}return new vs(r,!1);function d(){const m=sh(e,t,n,a,r,u);if(!m){i.produce(r,c),l=!0;return}const g=m.captureIndices,v=m.matchedRuleId,f=g&&g.length>0?g[0].end>a:!1;if(v===eh){const b=r.getRule(e);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),rn(e,t,n,r,i,b.endCaptures,g),i.produce(r,g[0].end);const _=r;if(r=r.parent,u=_.getAnchorPos(),!f&&_.getEnterPos()===a){r=_,i.produce(r,c),l=!0;return}}else{const b=e.getRule(v);i.produce(r,g[0].start);const _=r,w=b.getName(t.content,g),h=r.contentNameScopesList.pushAttributed(w,e);if(r=r.push(v,a,u,g[0].end===c,null,h,h),b instanceof Rr){const C=b;rn(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(b instanceof ha){const C=b;rn(e,t,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const k=C.getContentName(t.content,g),$=h.pushAttributed(k,e);if(r=r.withContentNameScopesList($),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(t.content,g))),!f&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(rn(e,t,n,r,i,b.captures,g),i.produce(r,g[0].end),r=r.pop(),!f){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function ih(e,t,n,a,r,i){let s=r.beginRuleCapturedEOL?0:-1;const o=[];for(let c=r;c;c=c.pop()){const l=c.getRule(e);l instanceof ha&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:u}=lh(c.rule,e,c.stack.endRule,n,a===s),p=l.findNextMatchSync(t,a,u);if(p){if(p.ruleId!==Gc){r=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(c.stack,p.captureIndices[0].start),rn(e,t,n,c.stack,i,c.rule.whileCaptures,p.captureIndices),i.produce(c.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>a&&(a=p.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:s,isFirstLine:n}}function sh(e,t,n,a,r,i){const s=oh(e,t,n,a,r,i),o=e.getInjections();if(o.length===0)return s;const c=ch(o,e,t,n,a,r,i);if(!c)return s;if(!s)return c;const l=s.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:s}function oh(e,t,n,a,r,i){const s=r.getRule(e),{ruleScanner:o,findOptions:c}=Zc(s,e,r.endRule,n,a===i),l=o.findNextMatchSync(t,a,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function ch(e,t,n,a,r,i,s){let o=Number.MAX_VALUE,c=null,l,u=0;const p=i.contentNameScopesList.getScopeNames();for(let d=0,m=e.length;d<m;d++){const g=e[d];if(!g.matcher(p))continue;const v=t.getRule(g.ruleId),{ruleScanner:f,findOptions:b}=Zc(v,t,null,a,r===s),_=f.findNextMatchSync(n,r,b);if(!_)continue;const w=_.captureIndices[0].start;if(!(w>=o)&&(o=w,c=_.captureIndices,l=_.ruleId,u=g.priority,o===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Zc(e,t,n,a,r){return{ruleScanner:e.compileAG(t,n,a,r),findOptions:0}}function lh(e,t,n,a,r){return{ruleScanner:e.compileWhileAG(t,n,a,r),findOptions:0}}function rn(e,t,n,a,r,i,s){if(i.length===0)return;const o=t.content,c=Math.min(i.length,s.length),l=[],u=s[0].end;for(let p=0;p<c;p++){const d=i[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),d.retokenizeCapturedWithRuleId){const v=d.getName(o,s),f=a.contentNameScopesList.pushAttributed(v,e),b=d.getContentName(o,s),_=f.pushAttributed(b,e),w=a.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,f,_),h=e.createOnigString(o.substring(0,m.end));Vc(e,h,n&&m.start===0,m.start,w,r,!1,0),Bc(h);continue}const g=d.getName(o,s);if(g!==null){const f=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,e);l.push(new uh(f,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var uh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ph(e,t,n,a,r,i,s,o){return new mh(e,t,n,a,r,i,s,o)}function ws(e,t,n,a,r){const i=da(t,ga),s=Hc.getCompiledRuleId(n,a,r.repository);for(const o of i)e.push({debugSelector:t,matcher:o.matcher,ruleId:s,grammar:r,priority:o.priority})}function ga(e,t){if(t.length<e.length)return!1;let n=0;return e.every(a=>{for(let r=n;r<t.length;r++)if(dh(t[r],a))return n=r+1,!0;return!1})}function dh(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var mh=class{constructor(e,t,n,a,r,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new ah(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=xs(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=da(c,ga);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_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:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,a=e.lookup(n);if(a){const r=a.injections;if(r)for(let s in r)ws(t,s,r[s],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const o=this.getExternalGrammar(s);if(o){const c=o.injectionSelector;c&&ws(t,c,o,this,o)}})}return t.sort((r,i)=>r.priority-i.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]=xs(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const a=this._tokenize(e,t,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,n=0){const a=this._tokenize(e,t,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,n,a){this._rootId===-1&&(this._rootId=Hc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Ir.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Lt.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=pn.createRootAndLookUpScopeName(d,p,this):m=pn.createRoot("unknown",p),t=new Ir(null,this._rootId,-1,-1,!1,null,m,m)}else r=!1,t.reset();e=e+`
+`;const i=this.createOnigString(e),s=i.content.length,o=new gh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Vc(this,i,r,0,t,o,!0,a);return Bc(i),{lineLength:s,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function xs(e,t){return e=Rm(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 pn=class Ce{constructor(t,n,a){this.parent=t,this.scopePath=n,this.tokenAttributes=a}static fromExtension(t,n){let a=t,r=t?.scopePath??null;for(const i of n)r=Ya.push(r,i.scopeNames),a=new Ce(a,r,i.encodedTokenAttributes);return a}static createRoot(t,n){return new Ce(null,new Ya(null,t),n)}static createRootAndLookUpScopeName(t,n,a){const r=a.getMetadataForScope(t),i=new Ya(null,t),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(n,r,s);return new Ce(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ce.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,a){let r=-1,i=0,s=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,s=a.backgroundId),Lt.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ce._pushAttributed(this,t,n);const a=t.split(/ /g);let r=this;for(const i of a)r=Ce._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,a){const r=a.getMetadataForScope(n),i=t.scopePath.push(n),s=a.themeProvider.themeMatch(i),o=Ce.mergeAttributes(t.tokenAttributes,r,s);return new Ce(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let a=this;for(;a&&a!==t;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?n.reverse():void 0}},Ir=class nt{constructor(t,n,a,r,i,s,o,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new nt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:nt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?pn.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(){nt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,a,r,i,s,o){return new nt(this,t,n,a,r,i,s,o)}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 nt(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 a=pn.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new nt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,pn.fromExtension(a,n.contentNameScopesList))}},hh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):da(n,ga).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>da(n,ga).map(a=>a.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}},gh=class{constructor(e,t,n,a){this.balancedBracketSelectors=a,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 a=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(a=Lt.set(a,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=Lt.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},fh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,a,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,ph(e,i,t,n,a,r,this,this._onigLib))}return this._grammars.get(e)}},bh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new fh(pa.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(pa.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,a){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,n,a){return this._loadGrammar(t,n,a.embeddedLanguages,a.tokenTypes,new hh(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,a,r,i){const s=new Wm(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(o=>this._loadSingleGrammar(o.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(t,n=[],a=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,a,r)}_grammarForScopeName(t,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,a,r,i)}},Nr=Ir.NULL;const _h=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class $n{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}$n.prototype.normal={};$n.prototype.property={};$n.prototype.space=void 0;function Yc(e,t){const n={},a={};for(const r of e)Object.assign(n,r.property),Object.assign(a,r.normal);return new $n(n,a,t)}function Lr(e){return e.toLowerCase()}class ie{constructor(t,n){this.attribute=n,this.property=t}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let yh=0;const S=ft(),H=ft(),Pr=ft(),x=ft(),P=ft(),jt=ft(),se=ft();function ft(){return 2**++yh}const Dr=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:H,commaOrSpaceSeparated:se,commaSeparated:jt,number:x,overloadedBoolean:Pr,spaceSeparated:P},Symbol.toStringTag,{value:"Module"})),Ka=Object.keys(Dr);class ki extends ie{constructor(t,n,a,r){let i=-1;if(super(t,n),ks(this,"space",r),typeof a=="number")for(;++i<Ka.length;){const s=Ka[i];ks(this,Ka[i],(a&Dr[s])===Dr[s])}}}ki.prototype.defined=!0;function ks(e,t,n){n&&(e[t]=n)}function Ut(e){const t={},n={};for(const[a,r]of Object.entries(e.properties)){const i=new ki(a,e.transform(e.attributes||{},a),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),t[a]=i,n[Lr(a)]=a,n[Lr(i.attribute)]=a}return new $n(t,n,e.space)}const Xc=Ut({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:H,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:P,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:x,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:P,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:H,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function Qc(e,t){return Kc(e,t.toLowerCase())}const vh=Ut({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jt,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:P,autoFocus:S,autoPlay:S,blocking:P,capture:null,charSet:null,checked:S,cite:null,className:P,cols:x,colSpan:null,content:null,contentEditable:H,controls:S,controlsList:P,coords:x|jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Pr,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:P,height:x,hidden:Pr,high:x,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:P,itemRef:P,itemScope:S,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S,optimum:x,pattern:null,ping:P,placeholder:null,playsInline:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:P,required:S,reversed:S,rows:x,rowSpan:x,sandbox:P,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:H,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:Qc}),wh=Ut({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:se,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jt,g2:jt,glyphName:jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:se,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:se,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:se,rev:se,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:se,requiredFeatures:se,requiredFonts:se,requiredFormats:se,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:se,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:se,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:se,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kc}),Jc=Ut({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),el=Ut({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qc}),tl=Ut({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xh=/[A-Z]/g,Cs=/-[a-z]/g,kh=/^data[-\w.:]+$/i;function Ch(e,t){const n=Lr(t);let a=t,r=ie;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kh.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Cs,Fh);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Cs.test(i)){let s=i.replace(xh,Eh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=ki}return new r(a,t)}function Eh(e){return"-"+e.toLowerCase()}function Fh(e){return e.charAt(1).toUpperCase()}const $h=Yc([Xc,vh,Jc,el,tl],"html"),nl=Yc([Xc,wh,Jc,el,tl],"svg"),Es={}.hasOwnProperty;function jh(e,t){const n=t||{};function a(r,...i){let s=a.invalid;const o=a.handlers;if(r&&Es.call(r,e)){const c=String(r[e]);s=Es.call(o,c)?o[c]:a.unknown}if(s)return s.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const Sh=/["&'<>`]/g,Ah=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Th=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Rh=/[|\\{}()[\]^$+*?.]/g,Fs=new WeakMap;function Oh(e,t){if(e=e.replace(t.subset?Ih(t.subset):Sh,a),t.subset||t.escapeOnly)return e;return e.replace(Ah,n).replace(Th,a);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function a(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function Ih(e){let t=Fs.get(e);return t||(t=Nh(e),Fs.set(e,t)),t}function Nh(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Rh,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Lh=/[\dA-Fa-f]/;function Ph(e,t,n){const a="&#x"+e.toString(16).toUpperCase();return n&&t&&!Lh.test(String.fromCharCode(t))?a:a+";"}const Dh=/\d/;function Mh(e,t,n){const a="&#"+String(e);return n&&t&&!Dh.test(String.fromCharCode(t))?a:a+";"}const qh=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Qa={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zh=["cent","copy","divide","gt","lt","not","para","times"],al={}.hasOwnProperty,Mr={};let Zn;for(Zn in Qa)al.call(Qa,Zn)&&(Mr[Qa[Zn]]=Zn);const Bh=/[^\dA-Za-z]/;function Uh(e,t,n,a){const r=String.fromCharCode(e);if(al.call(Mr,r)){const i=Mr[r],s="&"+i;return n&&qh.includes(i)&&!zh.includes(i)&&(!a||t&&t!==61&&Bh.test(String.fromCharCode(t)))?s:s+";"}return""}function Gh(e,t,n){let a=Ph(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Uh(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Mh(e,t,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function St(e,t){return Oh(e,Object.assign({format:Gh},t))}const Hh=/^>|^->|<!--|-->|--!>|<!-$/g,Wh=[">"],Vh=["<",">"];function Zh(e,t,n,a){return a.settings.bogusComments?"<?"+St(e.value,Object.assign({},a.settings.characterReferences,{subset:Wh}))+">":"<!--"+e.value.replace(Hh,r)+"-->";function r(i){return St(i,Object.assign({},a.settings.characterReferences,{subset:Vh}))}}function Yh(e,t,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function $s(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(t);for(;r!==-1;)a++,r=n.indexOf(t,r+t.length);return a}function Xh(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Kh(e){return e.join(" ").trim()}const Qh=/[ \t\n\f\r]/g;function Ci(e){return typeof e=="object"?e.type==="text"?js(e.value):!1:js(e)}function js(e){return e.replace(Qh,"")===""}const Z=il(1),rl=il(-1),Jh=[];function il(e){return t;function t(n,a,r){const i=n?n.children:Jh;let s=(a||0)+e,o=i[s];if(!r)for(;o&&Ci(o);)s+=e,o=i[s];return o}}const eg={}.hasOwnProperty;function sl(e){return t;function t(n,a,r){return eg.call(e,n.tagName)&&e[n.tagName](n,a,r)}}const Ei=sl({body:ng,caption:Ja,colgroup:Ja,dd:sg,dt:ig,head:Ja,html:tg,li:rg,optgroup:og,option:cg,p:ag,rp:Ss,rt:Ss,tbody:ug,td:As,tfoot:pg,th:As,thead:lg,tr:dg});function Ja(e,t,n){const a=Z(n,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&Ci(a.value.charAt(0)))}function tg(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ng(e,t,n){const a=Z(n,t);return!a||a.type!=="comment"}function ag(e,t,n){const a=Z(n,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 rg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="li"}function ig(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function sg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Ss(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function og(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function cg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function lg(e,t,n){const a=Z(n,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function ug(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function pg(e,t,n){return!Z(n,t)}function dg(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&a.tagName==="tr"}function As(e,t,n){const a=Z(n,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const mg=sl({body:fg,colgroup:bg,head:gg,html:hg,tbody:_g});function hg(e){const t=Z(e,-1);return!t||t.type!=="comment"}function gg(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const n=e.children[0];return!n||n.type==="element"}function fg(e){const t=Z(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ci(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function bg(e,t,n){const a=rl(n,t),r=Z(e,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function _g(e,t,n){const a=rl(n,t),r=Z(e,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Ei(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Yn={name:[[`
\f\r &/=>`.split(""),`
\f\r "&'/=>\``.split("")],[`\0
\f\r "&'/<=>`.split(""),`\0
@@ -12,8 +12,8 @@ ${n?'Expression: "'+n+`"
\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 _g(e,t,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let s=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const o=[];let c;r.space==="html"&&e.tagName==="svg"&&(a.schema=nl);const l=yg(a,e.properties),u=a.all(r.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=r,u&&(s=!1),(l||!i||!dg(e,t,n))&&(o.push("<",e.tagName,l?" "+l:""),s&&(r.space==="svg"||a.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!a.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!Ei(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function yg(e,t){const n=[];let a=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=vg(e,r,t[r]);i&&n.push(i)}}for(;++a<n.length;){const i=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function vg(e,t,n){const a=kh(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=St(a.attribute,Object.assign({},e.settings.characterReferences,{subset:Yn.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?Yh:Xh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(o=St(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yn.unquoted[r][i]}))),o!==n&&(e.settings.quoteSmart&&$s(n,s)>$s(n,e.alternative)&&(s=e.alternative),o=s+St(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Yn.single:Yn.double)[r][i],attribute:!0}))+s),c+(o&&"="+o))}const wg=["<","&"];function ol(e,t,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:St(e.value,Object.assign({},a.settings.characterReferences,{subset:wg}))}function xg(e,t,n,a){return a.settings.allowDangerousHtml?e.value:ol(e,t,n,a)}function kg(e,t,n,a){return a.all(e)}const Cg=$h("type",{invalid:Eg,unknown:Fg,handlers:{comment:Vh,doctype:Zh,element:_g,raw:xg,root:kg,text:ol}});function Eg(e){throw new Error("Expected node, not `"+e+"`")}function Fg(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const $g={},jg={},Sg=[];function Ag(e,t){const n=t||$g,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:Tg,all:Rg,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||bh,characterReferences:n.characterReferences||jg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nl:Fh,quote:a,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Tg(e,t,n){return Cg(e,t,n,this)}function Rg(e){const t=[],n=e&&e.children||Sg;let a=-1;for(;++a<n.length;)t[a]=this.one(n[a],a,e);return t.join("")}function fa(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function Ge(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Og(e){return Array.isArray(e)?e:[e]}async function cl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Fi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ig(e){return e==="ansi"||Fi(e)}function $i(e){return e==="none"}function Ng(e){return $i(e)}function ll(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 a of n)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function Ra(e,t=!1){const n=e.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function Lg(e){const t=Ra(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const o of t){if(i<o.length)break;i-=o.length,s++}return{line:s,character:i}}function a(r,i){let s=0;for(let o=0;o<r;o++)s+=t[o].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:a}}const ji="light-dark()",Pg=["color","background-color"];function Dg(e,t){let n=0;const a=[];for(const r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a}function Mg(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((a,r)=>a-r);return n.length?e.map(a=>a.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,o)=>s-o);return i.length?Dg(r,i):r})):e}function qg(e,t,n,a,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>ba(e.variants[u])),o=new Set(s.flatMap(u=>Object.keys(u))),c={},l=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of o){const m=u[d]||"inherit";if(p===0&&a&&Pg.includes(d))if(a===ji&&s.length>1){const g=t.findIndex(_=>_==="light"),v=t.findIndex(_=>_==="dark");if(g===-1||v===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=s[g][d]||"inherit",b=s[v][d]||"inherit";c[d]=`light-dark(${f}, ${b})`,r==="css-vars"&&(c[l(p,d)]=m)}else c[d]=m;else r==="css-vars"&&(c[l(p,d)]=m)}}),i.htmlStyle=c,i}function ba(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ee.Italic&&(t["font-style"]="italic"),e.fontStyle&ee.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ee.Underline&&n.push("underline"),e.fontStyle&ee.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function qr(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const ul=new WeakMap;function Oa(e,t){ul.set(e,t)}function _n(e){return ul.get(e)}class Ut{_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 Ut(Object.fromEntries(Og(n).map(a=>[a,Nr])),t)}constructor(...t){if(t.length===2){const[n,a]=t;this.lang=a,this._stacks=n}else{const[n,a,r]=t;this.lang=a,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return zg(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function zg(e){const t=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&a(r.parent)}return a(e),t}function Bg(e,t){if(!(e instanceof Ut))throw new Y("Invalid grammar state");return e.getInternalStack(t)}function Ug(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Y(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const o=r.lines[s.line];if(o===void 0)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let c=s.character;if(c<0&&(c=o.length+c),c<0||c>o.length)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${o.length}`);return{...s,character:c,offset:r.posToIndex(s.line,c)}}};const r=Lg(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:a(s.start),end:a(s.end)}));Gg(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return Mg(n,r)},code(n){if(!this.options.decorations?.length)return;const a=t(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new Y(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,p,d,m){const g=r[u];let v="",f=-1,b=-1;if(p===0&&(f=0),d===0&&(b=0),d===Number.POSITIVE_INFINITY&&(b=g.children.length),f===-1||b===-1)for(let w=0;w<g.children.length;w++)v+=pl(g.children[w]),f===-1&&v.length===p&&(f=w+1),b===-1&&v.length===d&&(b=w+1);if(f===-1)throw new Y(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(b===-1)throw new Y(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=g.children.slice(f,b);if(!m.alwaysWrap&&_.length===g.children.length)o(g,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")o(_[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:_};o(w,m,"wrapper"),g.children.splice(f,_.length,w)}}function s(u,p){r[u]=o(r[u],p,"line")}function o(u,p,d){const m=p.properties||{},g=p.transform||(v=>v);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&ll(u,p.properties.class),u=g(u,d)||u,u}const c=[],l=a.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of l){const{start:p,end:d}=u;if(p.line===d.line)i(p.line,p.character,d.character,u);else if(p.line<d.line){i(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)c.unshift(()=>s(m,u));i(d.line,0,d.character,u)}}c.forEach(u=>u())}}}function Gg(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Y(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=t+1;a<e.length;a++){const r=e[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,o=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||o||c){if(i&&s||o&&c||o&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Y(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function pl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(pl).join(""):""}const Hg=[Ug()];function _a(e){const t=Wg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Hg]}function Wg(e){const t=[],n=[],a=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:t,post:n,normal:a}}var it=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],er={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Vg(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const a=e.indexOf("m",n);if(a!==-1)return{sequence:e.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:e.length}}function Ts(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Zg(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)er[a]&&t.push({type:"setDecoration",value:er[a]});else if(a<=29){const r=er[a-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:it[a-30]}});else if(a===38){const r=Ts(e);r&&t.push({type:"setForegroundColor",value:r})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-40]}});else if(a===48){const r=Ts(e);r&&t.push({type:"setBackgroundColor",value:r})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:it[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-100+8]}})}return t}function Yg(){let e=null,t=null,n=new Set;return{parse(a){const r=[];let i=0;do{const s=Vg(a,i),o=s.sequence?a.substring(i,s.startPosition):a.substring(i);if(o.length>0&&r.push({value:o,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const c=Zg(s.sequence);for(const l of c)l.type==="resetAll"?(e=null,t=null,n.clear()):l.type==="resetForegroundColor"?e=null:l.type==="resetBackgroundColor"?t=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?e=l.value:l.type==="setBackgroundColor"?t=l.value:l.type==="setDecoration"&&n.add(l.value)}i=s.position}while(i<a.length);return r}}}var Xg={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Kg(e=Xg){function t(o){return e[o]}function n(o){return`#${o.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<it.length;l++)a.push(t(it[l]));let o=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)a.push(n([o[l],o[u],o[p]]));let c=8;for(let l=0;l<24;l++,c+=10)a.push(n([c,c,c]));return a}function i(o){return r()[o]}function s(o){switch(o.type){case"named":return t(o.name);case"rgb":return n(o.rgb);case"table":return i(o.index)}}return{value:s}}function Qg(e,t,n){const a=fa(e,n),r=Ra(t),i=Kg(Object.fromEntries(it.map(o=>[o,e.colors?.[`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`]]))),s=Yg();return r.map(o=>s.parse(o[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):e.bg,u=c.foreground?i.value(c.foreground):e.fg):(l=c.foreground?i.value(c.foreground):e.fg,u=c.background?i.value(c.background):void 0),l=Ge(l,a),u=Ge(u,a),c.decorations.has("dim")&&(l=Jg(l));let p=ee.None;return c.decorations.has("bold")&&(p|=ee.Bold),c.decorations.has("italic")&&(p|=ee.Italic),c.decorations.has("underline")&&(p|=ee.Underline),c.decorations.has("strikethrough")&&(p|=ee.Strikethrough),{content:c.value,offset:o[1],color:l,bgColor:u,fontStyle:p}}))}function Jg(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const a=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${a}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(a=>`${a}${a}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Si(e,t,n={}){const{lang:a="text",theme:r=e.getLoadedThemes()[0]}=n;if(Fi(a)||$i(r))return Ra(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:i,colorMap:s}=e.setTheme(r);if(a==="ansi")return Qg(i,t,n);const o=e.getLanguage(a);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Y(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Y(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return tf(t,o,i,s,n)}function ef(...e){if(e.length===2)return _n(e[1]);const[t,n,a={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=a;if(Fi(r)||$i(i))throw new Y("Plain language does not have grammar state");if(r==="ansi")throw new Y("ANSI language does not have grammar state");const{theme:s,colorMap:o}=t.setTheme(i),c=t.getLanguage(r);return new Ut(ya(n,c,s,o,a).stateStack,c.name,s.name)}function tf(e,t,n,a,r){const i=ya(e,t,n,a,r),s=new Ut(ya(e,t,n,a,r).stateStack,t.name,n.name);return Oa(i.tokens,s),i.tokens}function ya(e,t,n,a,r){const i=fa(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=r,c=Ra(e);let l=r.grammarState?Bg(r.grammarState,n.name)??Nr:r.grammarContextCode!=null?ya(r.grammarContextCode,t,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Nr,u=[];const p=[];for(let d=0,m=c.length;d<m;d++){const[g,v]=c[d];if(g===""){u=[],p.push([]);continue}if(s>0&&g.length>=s){u=[],p.push([{content:g,offset:v,color:"",fontStyle:0}]);continue}let f,b,_;r.includeExplanation&&(f=t.tokenizeLine(g,l,o),b=f.tokens,_=0);const w=t.tokenizeLine2(g,l,o),h=w.tokens.length/2;for(let C=0;C<h;C++){const k=w.tokens[2*C],$=C+1<h?w.tokens[2*C+2]:g.length;if(k===$)continue;const T=w.tokens[2*C+1],N=Ge(a[Lt.getForeground(T)],i),I=Lt.getFontStyle(T),D={content:g.substring(k,$),offset:v+k,color:N,fontStyle:I};if(r.includeExplanation){const R=[];if(r.includeExplanation!=="scopeName")for(const q of n.settings){let U;switch(typeof q.scope){case"string":U=q.scope.split(/,/).map(G=>G.trim());break;case"object":U=q.scope;break;default:continue}R.push({settings:q,selectors:U.map(G=>G.split(/ /))})}D.explanation=[];let L=0;for(;k+L<$;){const q=b[_],U=g.substring(q.startIndex,q.endIndex);L+=U.length,D.explanation.push({content:U,scopes:r.includeExplanation==="scopeName"?nf(q.scopes):af(R,q.scopes)}),_+=1}}u.push(D)}p.push(u),u=[],l=w.ruleStack}return{tokens:p,stateStack:l}}function nf(e){return e.map(t=>({scopeName:t}))}function af(e,t){const n=[];for(let a=0,r=t.length;a<r;a++){const i=t[a];n[a]={scopeName:i,themeMatches:sf(e,i,t.slice(0,a))}}return n}function Rs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function rf(e,t,n){if(!Rs(e[e.length-1],t))return!1;let a=e.length-2,r=n.length-1;for(;a>=0&&r>=0;)Rs(e[a],n[r])&&(a-=1),r-=1;return a===-1}function sf(e,t,n){const a=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(rf(s,t,n)){a.push(i);break}return a}function dl(e,t,n){const a=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),r=a.map(c=>{const l=Si(e,t,{...n,theme:c.theme}),u=_n(l),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:l,state:u,theme:p}}),i=of(...r.map(c=>c.tokens)),s=i[0].map((c,l)=>c.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((m,g)=>{const{content:v,explanation:f,offset:b,..._}=m[l][p];d.variants[a[g].color]=_}),d})),o=r[0].state?new Ut(Object.fromEntries(r.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),r[0].state.lang):void 0;return o&&Oa(s,o),s}function of(...e){const t=e.map(()=>[]),n=e.length;for(let a=0;a<e[0].length;a++){const r=e.map(c=>c[a]),i=t.map(()=>[]);t.forEach((c,l)=>c.push(i[l]));const s=r.map(()=>0),o=r.map(c=>c[0]);for(;o.every(c=>c);){const c=Math.min(...o.map(l=>l.content.length));for(let l=0;l<n;l++){const u=o[l];u.content.length===c?(i[l].push(u),s[l]+=1,o[l]=r[l][s[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),o[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return t}function va(e,t,n){let a,r,i,s,o,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,_)=>b.color===l?-1:_.color===l?1:0);if(d.length===0)throw new Y("`themes` option must not be empty");const m=dl(e,t,n);if(c=_n(m),l&&ji!==l&&!d.find(b=>b.color===l))throw new Y(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=d.map(b=>e.getTheme(b.theme)),v=d.map(b=>b.color);i=m.map(b=>b.map(_=>qg(_,v,u,l,p))),c&&Oa(i,c);const f=d.map(b=>fa(b.theme,n));r=Os(d,g,f,u,l,"fg",p),a=Os(d,g,f,u,l,"bg",p),s=`shiki-themes ${g.map(b=>b.name).join(" ")}`,o=l?void 0:[r,a].join(";")}else if("theme"in n){const l=fa(n.theme,n);i=Si(e,t,n);const u=e.getTheme(n.theme);a=Ge(u.bg,l),r=Ge(u.fg,l),s=u.name,c=_n(i)}else throw new Y("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:s,rootStyle:o,grammarState:c}}function Os(e,t,n,a,r,i,s){return e.map((o,c)=>{const l=Ge(t[c][i],n[c])||"inherit",u=`${a+o.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===ji&&e.length>1){const p=e.findIndex(v=>v.color==="light"),d=e.findIndex(v=>v.color==="dark");if(p===-1||d===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=Ge(t[p][i],n[p])||"inherit",g=Ge(t[d][i],n[d])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return s==="css-vars"?u:null}).filter(o=>!!o).join(";")}function wa(e,t,n,a={meta:{},options:n,codeToHast:(r,i)=>wa(e,r,i),codeToTokens:(r,i)=>va(e,r,i)}){let r=t;for(const g of _a(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:s,bg:o,themeName:c,rootStyle:l,grammarState:u}=va(e,r,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?i=lf(i):p==="never"&&(i=uf(i)),d&&(i=pf(i));const m={...a,get source(){return r}};for(const g of _a(n))i=g.tokens?.call(m,i)||i;return cf(i,{...n,fg:s,bg:o,themeName:c,rootStyle:l},m,u)}function cf(e,t,n,a=_n(e)){const r=_a(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:c="0"}=t;let l={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([g])=>!g.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:i};const p=[],d={...n,structure:o,addClassToHast:ll,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return l},get code(){return u},get lines(){return p}};if(e.forEach((g,v)=>{v&&(o==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
-`}));let f={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of g){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const h=qr(_.htmlStyle||ba(_));h&&(w.properties.style=h);for(const C of r)w=C?.span?.call(d,w,v+1,b,f,_)||w;o==="inline"?s.children.push(w):o==="classic"&&f.children.push(w),b+=_.content.length}if(o==="classic"){for(const _ of r)f=_?.line?.call(d,f,v+1)||f;p.push(f),i.push(f)}}),o==="classic"){for(const g of r)u=g?.code?.call(d,u)||u;l.children.push(u);for(const g of r)l=g?.pre?.call(d,l)||l;s.children.push(l)}let m=s;for(const g of r)m=g?.root?.call(d,m)||m;return a&&Oa(m,a),m}function lf(e){return e.map(t=>{const n=[];let a="",r=0;return t.forEach((i,s)=>{const c=!(i.fontStyle&&(i.fontStyle&ee.Underline||i.fontStyle&ee.Strikethrough));c&&i.content.match(/^\s+$/)&&t[s+1]?(r||(r=i.offset),a+=i.content):a?(c?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=0,a=""):n.push(i)}),n})}function uf(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,s]=a;if(!r&&!s)return n;const o=[{...n,offset:n.offset+r.length,content:i}];return r&&o.unshift({content:r,offset:n.offset}),s&&o.push({content:s,offset:n.offset+r.length+i.length}),o}))}function pf(e){return e.map(t=>{const n=[];for(const a of t){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=qr(r.htmlStyle||ba(r)),s=qr(a.htmlStyle||ba(a)),o=r.fontStyle&&(r.fontStyle&ee.Underline||r.fontStyle&ee.Strikethrough),c=a.fontStyle&&(a.fontStyle&ee.Underline||a.fontStyle&ee.Strikethrough);!o&&!c&&i===s?r.content+=a.content:n.push({...a})}return n})}const df=Ag;function mf(e,t,n){const a={meta:{},options:n,codeToHast:(i,s)=>wa(e,i,s),codeToTokens:(i,s)=>va(e,i,s)};let r=df(wa(e,t,n,a));for(const i of _a(n))r=i.postprocess?.call(a,r,n)||r;return r}const Is={light:"#333333",dark:"#bbbbbb"},Ns={light:"#fffffe",dark:"#1e1e1e"},Ls="__shiki_resolved";function Ai(e){if(e?.[Ls])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:a}=t;if(!n||!a){const o=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;o?.settings?.foreground&&(a=o.settings.foreground),o?.settings?.background&&(n=o.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),a||(a=t.type==="light"?Is.light:Is.dark),n||(n=t.type==="light"?Ns.light:Ns.dark),t.fg=a,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 r=0;const i=new Map;function s(o){if(i.has(o))return i.get(o);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?s(o):(i.set(o,c),c)}t.settings=t.settings.map(o=>{const c=o.settings?.foreground&&!o.settings.foreground.startsWith("#"),l=o.settings?.background&&!o.settings.background.startsWith("#");if(!c&&!l)return o;const u={...o,settings:{...o.settings}};if(c){const p=s(o.settings.foreground);t.colorReplacements[p]=o.settings.foreground,u.settings.foreground=p}if(l){const p=s(o.settings.background);t.colorReplacements[p]=o.settings.background,u.settings.background=p}return u});for(const o of Object.keys(t.colors||{}))if((o==="editor.foreground"||o==="editor.background"||o.startsWith("terminal.ansi"))&&!t.colors[o]?.startsWith("#")){const c=s(t.colors[o]);t.colorReplacements[c]=t.colors[o],t.colors[o]=c}return Object.defineProperty(t,Ls,{enumerable:!1,writable:!1,value:!0}),t}async function hf(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ig(t)).map(async t=>await cl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function gf(e){return(await Promise.all(e.map(async n=>Ng(n)?null:Ai(await cl(n))))).filter(n=>!!n)}class $t extends Error{constructor(t){super(t),this.name="ShikiError"}}class ff extends fh{constructor(t,n,a,r={}){super(t),this._resolver=t,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=Ai(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=pa.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new $t(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const a={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,a);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,s])=>s&&s.embeddedLangs?.some(o=>a.map(([c])=>c).includes(o))).filter(i=>!a.includes(i));throw new $t(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class bf{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:a=>t.createScanner(a),createOnigString:a=>t.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let tn=0;function _f(e){tn+=1,e.warnings!==!1&&tn>=10&&tn%10===0&&console.warn(`[Shiki] ${tn} 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 $t("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Ai),r=new bf(e.engine,n),i=new ff(r,a,n,e.langAlias);let s;function o(_){f();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new $t(`Language \`${_}\` not found, you may need to load it first`);return w}function c(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};f();const w=i.getTheme(_);if(!w)throw new $t(`Theme \`${_}\` not found, you may need to load it first`);return w}function l(_){f();const w=c(_);s!==_&&(i.setTheme(w),s=_);const h=i.getColorMap();return{theme:w,colorMap:h}}function u(){return f(),i.getLoadedThemes()}function p(){return f(),i.getLoadedLanguages()}function d(..._){f(),i.loadLanguages(_.flat(1))}async function m(..._){return d(await hf(_))}function g(..._){f();for(const w of _.flat(1))i.loadTheme(w)}async function v(..._){return f(),g(await gf(_))}function f(){if(t)throw new $t("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),tn-=1)}return{setTheme:l,getTheme:c,getLanguage:o,getLoadedThemes:u,getLoadedLanguages:p,loadLanguage:m,loadLanguageSync:d,loadTheme:v,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}function yf(e){const t=_f(e);return{getLastGrammarState:(...n)=>ef(t,...n),codeToTokensBase:(n,a)=>Si(t,n,a),codeToTokensWithThemes:(n,a)=>dl(t,n,a),codeToTokens:(n,a)=>va(t,n,a),codeToHast:(n,a)=>wa(t,n,a),codeToHtml:(n,a)=>mf(t,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Gt(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function vf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Ti=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),X=String.raw;function Ht(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ml=X`\[\^?`,hl=`c.? | C(?:-.?)?|${X`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${X`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${X`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${X`o\{[^\}]*\}?`}|${X`\d{1,3}`}`,Ri=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Xn=new RegExp(X`
+\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yg(e,t,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let s=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const o=[];let c;r.space==="html"&&e.tagName==="svg"&&(a.schema=nl);const l=vg(a,e.properties),u=a.all(r.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=r,u&&(s=!1),(l||!i||!mg(e,t,n))&&(o.push("<",e.tagName,l?" "+l:""),s&&(r.space==="svg"||a.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!a.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!Ei(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function vg(e,t){const n=[];let a=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=wg(e,r,t[r]);i&&n.push(i)}}for(;++a<n.length;){const i=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function wg(e,t,n){const a=Ch(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=St(a.attribute,Object.assign({},e.settings.characterReferences,{subset:Yn.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?Xh:Kh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(o=St(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yn.unquoted[r][i]}))),o!==n&&(e.settings.quoteSmart&&$s(n,s)>$s(n,e.alternative)&&(s=e.alternative),o=s+St(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Yn.single:Yn.double)[r][i],attribute:!0}))+s),c+(o&&"="+o))}const xg=["<","&"];function ol(e,t,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:St(e.value,Object.assign({},a.settings.characterReferences,{subset:xg}))}function kg(e,t,n,a){return a.settings.allowDangerousHtml?e.value:ol(e,t,n,a)}function Cg(e,t,n,a){return a.all(e)}const Eg=jh("type",{invalid:Fg,unknown:$g,handlers:{comment:Zh,doctype:Yh,element:yg,raw:kg,root:Cg,text:ol}});function Fg(e){throw new Error("Expected node, not `"+e+"`")}function $g(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const jg={},Sg={},Ag=[];function Tg(e,t){const n=t||jg,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:Rg,all:Og,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||_h,characterReferences:n.characterReferences||Sg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nl:$h,quote:a,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Rg(e,t,n){return Eg(e,t,n,this)}function Og(e){const t=[],n=e&&e.children||Ag;let a=-1;for(;++a<n.length;)t[a]=this.one(n[a],a,e);return t.join("")}function fa(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function Ge(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ig(e){return Array.isArray(e)?e:[e]}async function cl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Fi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ng(e){return e==="ansi"||Fi(e)}function $i(e){return e==="none"}function Lg(e){return $i(e)}function ll(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 a of n)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function Ra(e,t=!1){const n=e.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function Pg(e){const t=Ra(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const o of t){if(i<o.length)break;i-=o.length,s++}return{line:s,character:i}}function a(r,i){let s=0;for(let o=0;o<r;o++)s+=t[o].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:a}}const ji="light-dark()",Dg=["color","background-color"];function Mg(e,t){let n=0;const a=[];for(const r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a}function qg(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((a,r)=>a-r);return n.length?e.map(a=>a.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,o)=>s-o);return i.length?Mg(r,i):r})):e}function zg(e,t,n,a,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>ba(e.variants[u])),o=new Set(s.flatMap(u=>Object.keys(u))),c={},l=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of o){const m=u[d]||"inherit";if(p===0&&a&&Dg.includes(d))if(a===ji&&s.length>1){const g=t.findIndex(_=>_==="light"),v=t.findIndex(_=>_==="dark");if(g===-1||v===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=s[g][d]||"inherit",b=s[v][d]||"inherit";c[d]=`light-dark(${f}, ${b})`,r==="css-vars"&&(c[l(p,d)]=m)}else c[d]=m;else r==="css-vars"&&(c[l(p,d)]=m)}}),i.htmlStyle=c,i}function ba(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ee.Italic&&(t["font-style"]="italic"),e.fontStyle&ee.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ee.Underline&&n.push("underline"),e.fontStyle&ee.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function qr(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const ul=new WeakMap;function Oa(e,t){ul.set(e,t)}function yn(e){return ul.get(e)}class Gt{_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 Gt(Object.fromEntries(Ig(n).map(a=>[a,Nr])),t)}constructor(...t){if(t.length===2){const[n,a]=t;this.lang=a,this._stacks=n}else{const[n,a,r]=t;this.lang=a,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Bg(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Bg(e){const t=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&a(r.parent)}return a(e),t}function Ug(e,t){if(!(e instanceof Gt))throw new Y("Invalid grammar state");return e.getInternalStack(t)}function Gg(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Y(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const o=r.lines[s.line];if(o===void 0)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let c=s.character;if(c<0&&(c=o.length+c),c<0||c>o.length)throw new Y(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${o.length}`);return{...s,character:c,offset:r.posToIndex(s.line,c)}}};const r=Pg(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:a(s.start),end:a(s.end)}));Hg(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return qg(n,r)},code(n){if(!this.options.decorations?.length)return;const a=t(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new Y(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,p,d,m){const g=r[u];let v="",f=-1,b=-1;if(p===0&&(f=0),d===0&&(b=0),d===Number.POSITIVE_INFINITY&&(b=g.children.length),f===-1||b===-1)for(let w=0;w<g.children.length;w++)v+=pl(g.children[w]),f===-1&&v.length===p&&(f=w+1),b===-1&&v.length===d&&(b=w+1);if(f===-1)throw new Y(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(b===-1)throw new Y(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=g.children.slice(f,b);if(!m.alwaysWrap&&_.length===g.children.length)o(g,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")o(_[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:_};o(w,m,"wrapper"),g.children.splice(f,_.length,w)}}function s(u,p){r[u]=o(r[u],p,"line")}function o(u,p,d){const m=p.properties||{},g=p.transform||(v=>v);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&ll(u,p.properties.class),u=g(u,d)||u,u}const c=[],l=a.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of l){const{start:p,end:d}=u;if(p.line===d.line)i(p.line,p.character,d.character,u);else if(p.line<d.line){i(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)c.unshift(()=>s(m,u));i(d.line,0,d.character,u)}}c.forEach(u=>u())}}}function Hg(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Y(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=t+1;a<e.length;a++){const r=e[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,o=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||o||c){if(i&&s||o&&c||o&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Y(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function pl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(pl).join(""):""}const Wg=[Gg()];function _a(e){const t=Vg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Wg]}function Vg(e){const t=[],n=[],a=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:t,post:n,normal:a}}var it=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],er={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Zg(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const a=e.indexOf("m",n);if(a!==-1)return{sequence:e.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:e.length}}function Ts(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Yg(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)er[a]&&t.push({type:"setDecoration",value:er[a]});else if(a<=29){const r=er[a-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:it[a-30]}});else if(a===38){const r=Ts(e);r&&t.push({type:"setForegroundColor",value:r})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-40]}});else if(a===48){const r=Ts(e);r&&t.push({type:"setBackgroundColor",value:r})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:it[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:it[a-100+8]}})}return t}function Xg(){let e=null,t=null,n=new Set;return{parse(a){const r=[];let i=0;do{const s=Zg(a,i),o=s.sequence?a.substring(i,s.startPosition):a.substring(i);if(o.length>0&&r.push({value:o,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const c=Yg(s.sequence);for(const l of c)l.type==="resetAll"?(e=null,t=null,n.clear()):l.type==="resetForegroundColor"?e=null:l.type==="resetBackgroundColor"?t=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?e=l.value:l.type==="setBackgroundColor"?t=l.value:l.type==="setDecoration"&&n.add(l.value)}i=s.position}while(i<a.length);return r}}}var Kg={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Qg(e=Kg){function t(o){return e[o]}function n(o){return`#${o.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<it.length;l++)a.push(t(it[l]));let o=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)a.push(n([o[l],o[u],o[p]]));let c=8;for(let l=0;l<24;l++,c+=10)a.push(n([c,c,c]));return a}function i(o){return r()[o]}function s(o){switch(o.type){case"named":return t(o.name);case"rgb":return n(o.rgb);case"table":return i(o.index)}}return{value:s}}function Jg(e,t,n){const a=fa(e,n),r=Ra(t),i=Qg(Object.fromEntries(it.map(o=>[o,e.colors?.[`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`]]))),s=Xg();return r.map(o=>s.parse(o[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):e.bg,u=c.foreground?i.value(c.foreground):e.fg):(l=c.foreground?i.value(c.foreground):e.fg,u=c.background?i.value(c.background):void 0),l=Ge(l,a),u=Ge(u,a),c.decorations.has("dim")&&(l=ef(l));let p=ee.None;return c.decorations.has("bold")&&(p|=ee.Bold),c.decorations.has("italic")&&(p|=ee.Italic),c.decorations.has("underline")&&(p|=ee.Underline),c.decorations.has("strikethrough")&&(p|=ee.Strikethrough),{content:c.value,offset:o[1],color:l,bgColor:u,fontStyle:p}}))}function ef(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const a=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${a}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(a=>`${a}${a}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Si(e,t,n={}){const{lang:a="text",theme:r=e.getLoadedThemes()[0]}=n;if(Fi(a)||$i(r))return Ra(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:i,colorMap:s}=e.setTheme(r);if(a==="ansi")return Jg(i,t,n);const o=e.getLanguage(a);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Y(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Y(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return nf(t,o,i,s,n)}function tf(...e){if(e.length===2)return yn(e[1]);const[t,n,a={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=a;if(Fi(r)||$i(i))throw new Y("Plain language does not have grammar state");if(r==="ansi")throw new Y("ANSI language does not have grammar state");const{theme:s,colorMap:o}=t.setTheme(i),c=t.getLanguage(r);return new Gt(ya(n,c,s,o,a).stateStack,c.name,s.name)}function nf(e,t,n,a,r){const i=ya(e,t,n,a,r),s=new Gt(ya(e,t,n,a,r).stateStack,t.name,n.name);return Oa(i.tokens,s),i.tokens}function ya(e,t,n,a,r){const i=fa(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=r,c=Ra(e);let l=r.grammarState?Ug(r.grammarState,n.name)??Nr:r.grammarContextCode!=null?ya(r.grammarContextCode,t,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Nr,u=[];const p=[];for(let d=0,m=c.length;d<m;d++){const[g,v]=c[d];if(g===""){u=[],p.push([]);continue}if(s>0&&g.length>=s){u=[],p.push([{content:g,offset:v,color:"",fontStyle:0}]);continue}let f,b,_;r.includeExplanation&&(f=t.tokenizeLine(g,l,o),b=f.tokens,_=0);const w=t.tokenizeLine2(g,l,o),h=w.tokens.length/2;for(let C=0;C<h;C++){const k=w.tokens[2*C],$=C+1<h?w.tokens[2*C+2]:g.length;if(k===$)continue;const T=w.tokens[2*C+1],N=Ge(a[Lt.getForeground(T)],i),I=Lt.getFontStyle(T),D={content:g.substring(k,$),offset:v+k,color:N,fontStyle:I};if(r.includeExplanation){const R=[];if(r.includeExplanation!=="scopeName")for(const q of n.settings){let U;switch(typeof q.scope){case"string":U=q.scope.split(/,/).map(G=>G.trim());break;case"object":U=q.scope;break;default:continue}R.push({settings:q,selectors:U.map(G=>G.split(/ /))})}D.explanation=[];let L=0;for(;k+L<$;){const q=b[_],U=g.substring(q.startIndex,q.endIndex);L+=U.length,D.explanation.push({content:U,scopes:r.includeExplanation==="scopeName"?af(q.scopes):rf(R,q.scopes)}),_+=1}}u.push(D)}p.push(u),u=[],l=w.ruleStack}return{tokens:p,stateStack:l}}function af(e){return e.map(t=>({scopeName:t}))}function rf(e,t){const n=[];for(let a=0,r=t.length;a<r;a++){const i=t[a];n[a]={scopeName:i,themeMatches:of(e,i,t.slice(0,a))}}return n}function Rs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function sf(e,t,n){if(!Rs(e[e.length-1],t))return!1;let a=e.length-2,r=n.length-1;for(;a>=0&&r>=0;)Rs(e[a],n[r])&&(a-=1),r-=1;return a===-1}function of(e,t,n){const a=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(sf(s,t,n)){a.push(i);break}return a}function dl(e,t,n){const a=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),r=a.map(c=>{const l=Si(e,t,{...n,theme:c.theme}),u=yn(l),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:l,state:u,theme:p}}),i=cf(...r.map(c=>c.tokens)),s=i[0].map((c,l)=>c.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((m,g)=>{const{content:v,explanation:f,offset:b,..._}=m[l][p];d.variants[a[g].color]=_}),d})),o=r[0].state?new Gt(Object.fromEntries(r.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),r[0].state.lang):void 0;return o&&Oa(s,o),s}function cf(...e){const t=e.map(()=>[]),n=e.length;for(let a=0;a<e[0].length;a++){const r=e.map(c=>c[a]),i=t.map(()=>[]);t.forEach((c,l)=>c.push(i[l]));const s=r.map(()=>0),o=r.map(c=>c[0]);for(;o.every(c=>c);){const c=Math.min(...o.map(l=>l.content.length));for(let l=0;l<n;l++){const u=o[l];u.content.length===c?(i[l].push(u),s[l]+=1,o[l]=r[l][s[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),o[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return t}function va(e,t,n){let a,r,i,s,o,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,_)=>b.color===l?-1:_.color===l?1:0);if(d.length===0)throw new Y("`themes` option must not be empty");const m=dl(e,t,n);if(c=yn(m),l&&ji!==l&&!d.find(b=>b.color===l))throw new Y(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=d.map(b=>e.getTheme(b.theme)),v=d.map(b=>b.color);i=m.map(b=>b.map(_=>zg(_,v,u,l,p))),c&&Oa(i,c);const f=d.map(b=>fa(b.theme,n));r=Os(d,g,f,u,l,"fg",p),a=Os(d,g,f,u,l,"bg",p),s=`shiki-themes ${g.map(b=>b.name).join(" ")}`,o=l?void 0:[r,a].join(";")}else if("theme"in n){const l=fa(n.theme,n);i=Si(e,t,n);const u=e.getTheme(n.theme);a=Ge(u.bg,l),r=Ge(u.fg,l),s=u.name,c=yn(i)}else throw new Y("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:s,rootStyle:o,grammarState:c}}function Os(e,t,n,a,r,i,s){return e.map((o,c)=>{const l=Ge(t[c][i],n[c])||"inherit",u=`${a+o.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===ji&&e.length>1){const p=e.findIndex(v=>v.color==="light"),d=e.findIndex(v=>v.color==="dark");if(p===-1||d===-1)throw new Y('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=Ge(t[p][i],n[p])||"inherit",g=Ge(t[d][i],n[d])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return s==="css-vars"?u:null}).filter(o=>!!o).join(";")}function wa(e,t,n,a={meta:{},options:n,codeToHast:(r,i)=>wa(e,r,i),codeToTokens:(r,i)=>va(e,r,i)}){let r=t;for(const g of _a(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:s,bg:o,themeName:c,rootStyle:l,grammarState:u}=va(e,r,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?i=uf(i):p==="never"&&(i=pf(i)),d&&(i=df(i));const m={...a,get source(){return r}};for(const g of _a(n))i=g.tokens?.call(m,i)||i;return lf(i,{...n,fg:s,bg:o,themeName:c,rootStyle:l},m,u)}function lf(e,t,n,a=yn(e)){const r=_a(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:c="0"}=t;let l={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([g])=>!g.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:i};const p=[],d={...n,structure:o,addClassToHast:ll,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return l},get code(){return u},get lines(){return p}};if(e.forEach((g,v)=>{v&&(o==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
+`}));let f={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of g){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const h=qr(_.htmlStyle||ba(_));h&&(w.properties.style=h);for(const C of r)w=C?.span?.call(d,w,v+1,b,f,_)||w;o==="inline"?s.children.push(w):o==="classic"&&f.children.push(w),b+=_.content.length}if(o==="classic"){for(const _ of r)f=_?.line?.call(d,f,v+1)||f;p.push(f),i.push(f)}}),o==="classic"){for(const g of r)u=g?.code?.call(d,u)||u;l.children.push(u);for(const g of r)l=g?.pre?.call(d,l)||l;s.children.push(l)}let m=s;for(const g of r)m=g?.root?.call(d,m)||m;return a&&Oa(m,a),m}function uf(e){return e.map(t=>{const n=[];let a="",r=0;return t.forEach((i,s)=>{const c=!(i.fontStyle&&(i.fontStyle&ee.Underline||i.fontStyle&ee.Strikethrough));c&&i.content.match(/^\s+$/)&&t[s+1]?(r||(r=i.offset),a+=i.content):a?(c?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=0,a=""):n.push(i)}),n})}function pf(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,s]=a;if(!r&&!s)return n;const o=[{...n,offset:n.offset+r.length,content:i}];return r&&o.unshift({content:r,offset:n.offset}),s&&o.push({content:s,offset:n.offset+r.length+i.length}),o}))}function df(e){return e.map(t=>{const n=[];for(const a of t){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=qr(r.htmlStyle||ba(r)),s=qr(a.htmlStyle||ba(a)),o=r.fontStyle&&(r.fontStyle&ee.Underline||r.fontStyle&ee.Strikethrough),c=a.fontStyle&&(a.fontStyle&ee.Underline||a.fontStyle&ee.Strikethrough);!o&&!c&&i===s?r.content+=a.content:n.push({...a})}return n})}const mf=Tg;function hf(e,t,n){const a={meta:{},options:n,codeToHast:(i,s)=>wa(e,i,s),codeToTokens:(i,s)=>va(e,i,s)};let r=mf(wa(e,t,n,a));for(const i of _a(n))r=i.postprocess?.call(a,r,n)||r;return r}const Is={light:"#333333",dark:"#bbbbbb"},Ns={light:"#fffffe",dark:"#1e1e1e"},Ls="__shiki_resolved";function Ai(e){if(e?.[Ls])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:a}=t;if(!n||!a){const o=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;o?.settings?.foreground&&(a=o.settings.foreground),o?.settings?.background&&(n=o.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),a||(a=t.type==="light"?Is.light:Is.dark),n||(n=t.type==="light"?Ns.light:Ns.dark),t.fg=a,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 r=0;const i=new Map;function s(o){if(i.has(o))return i.get(o);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?s(o):(i.set(o,c),c)}t.settings=t.settings.map(o=>{const c=o.settings?.foreground&&!o.settings.foreground.startsWith("#"),l=o.settings?.background&&!o.settings.background.startsWith("#");if(!c&&!l)return o;const u={...o,settings:{...o.settings}};if(c){const p=s(o.settings.foreground);t.colorReplacements[p]=o.settings.foreground,u.settings.foreground=p}if(l){const p=s(o.settings.background);t.colorReplacements[p]=o.settings.background,u.settings.background=p}return u});for(const o of Object.keys(t.colors||{}))if((o==="editor.foreground"||o==="editor.background"||o.startsWith("terminal.ansi"))&&!t.colors[o]?.startsWith("#")){const c=s(t.colors[o]);t.colorReplacements[c]=t.colors[o],t.colors[o]=c}return Object.defineProperty(t,Ls,{enumerable:!1,writable:!1,value:!0}),t}async function gf(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ng(t)).map(async t=>await cl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function ff(e){return(await Promise.all(e.map(async n=>Lg(n)?null:Ai(await cl(n))))).filter(n=>!!n)}class $t extends Error{constructor(t){super(t),this.name="ShikiError"}}class bf extends bh{constructor(t,n,a,r={}){super(t),this._resolver=t,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=Ai(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=pa.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){if(this._alias[t]){const n=new Set([t]);for(;this._alias[t];){if(t=this._alias[t],n.has(t))throw new $t(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const a={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,a);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,s])=>s&&s.embeddedLangs?.some(o=>a.map(([c])=>c).includes(o))).filter(i=>!a.includes(i));throw new $t(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){if(this._langMap.set(t.name,t),this._langGraph.set(t.name,t),t.embeddedLangs)for(const n of t.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class _f{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:a=>t.createScanner(a),createOnigString:a=>t.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let nn=0;function yf(e){nn+=1,e.warnings!==!1&&nn>=10&&nn%10===0&&console.warn(`[Shiki] ${nn} 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 $t("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Ai),r=new _f(e.engine,n),i=new bf(r,a,n,e.langAlias);let s;function o(_){f();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new $t(`Language \`${_}\` not found, you may need to load it first`);return w}function c(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};f();const w=i.getTheme(_);if(!w)throw new $t(`Theme \`${_}\` not found, you may need to load it first`);return w}function l(_){f();const w=c(_);s!==_&&(i.setTheme(w),s=_);const h=i.getColorMap();return{theme:w,colorMap:h}}function u(){return f(),i.getLoadedThemes()}function p(){return f(),i.getLoadedLanguages()}function d(..._){f(),i.loadLanguages(_.flat(1))}async function m(..._){return d(await gf(_))}function g(..._){f();for(const w of _.flat(1))i.loadTheme(w)}async function v(..._){return f(),g(await ff(_))}function f(){if(t)throw new $t("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),nn-=1)}return{setTheme:l,getTheme:c,getLanguage:o,getLoadedThemes:u,getLoadedLanguages:p,loadLanguage:m,loadLanguageSync:d,loadTheme:v,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}function vf(e){const t=yf(e);return{getLastGrammarState:(...n)=>tf(t,...n),codeToTokensBase:(n,a)=>Si(t,n,a),codeToTokensWithThemes:(n,a)=>dl(t,n,a),codeToTokens:(n,a)=>va(t,n,a),codeToHast:(n,a)=>wa(t,n,a),codeToHtml:(n,a)=>hf(t,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ht(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function wf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Ti=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),X=String.raw;function Wt(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ml=X`\[\^?`,hl=`c.? | C(?:-.?)?|${X`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${X`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${X`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${X`o\{[^\}]*\}?`}|${X`\d{1,3}`}`,Ri=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Xn=new RegExp(X`
\\ (?:
${hl}
| [gk]<[^>]*>?
@@ -44,8 +44,8 @@ ${n?'Expression: "'+n+`"
| ${ml}
| &&
| .
-`.replace(/\s+/g,""),"gsu");function wf(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 a=qf(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(p){r.push(p)},replaceCurrentModX(p){r[r.length-1]=p},singleline:n.rules.singleline};let s=[],o;for(Xn.lastIndex=0;o=Xn.exec(e);){const p=xf(i,e,o[0],Xn.lastIndex);p.tokens?s.push(...p.tokens):p.token&&s.push(p.token),p.lastIndex!==void 0&&(Xn.lastIndex=p.lastIndex)}const c=[];let l=0;s.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++l:p.raw==="("&&c.push(p)}),l||c.forEach((p,d)=>{p.kind="capturing",p.number=d+1});const u=l||c.length;return{tokens:s.map(p=>p.type==="EscapedNumber"?Bf(p,u):p).flat(),flags:a}}function xf(e,t,n,a){const[r,i]=n;if(n==="["||n==="[^"){const s=kf(t,n,a);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Ps(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Of(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fl(n)}}if(i==="K")return{token:bl("keep",n)};if(i==="N"||i==="R")return{token:st("newline",n,{negate:i==="N"})};if(i==="O")return{token:st("any",n)};if(i==="X")return{token:st("text_segment",n)};const s=gl(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(i==="*")return{token:Pf(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Lf(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Et("group",n)};if(n==="(?>")return{token:Et("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Et(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Et("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Et("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:Af(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
-`,a);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=a,{lastIndex:s.exec(t)?s.lastIndex:a}}}if(n===".")return{token:st("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":X`\A`,$:X`\Z`}[n]:n;return{token:Ps(s,n)}}return n==="|"?{token:Ef(n)}:Ri.test(n)?{tokens:Uf(n)}:{token:Ne(Gt(n),n)}}function kf(e,t,n){const a=[Ds(t[1]==="^",t)];let r=1,i;for(tr.lastIndex=n;i=tr.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")r++,a.push(Ds(s[1]==="^",s));else if(s==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Ne(93,s));else if(r--,a.push(Ff(s)),!r)break}else{const o=Cf(s);Array.isArray(o)?a.push(...o):a.push(o)}}return{tokens:a,lastIndex:tr.lastIndex||e.length}}function Cf(e){if(e[0]==="\\")return gl(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ti.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return st("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?$f(e):e==="&&"?jf(e):Ne(Gt(e),e)}function gl(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Nf(e);if("dDhHsSwW".includes(n))return Df(e);if(e.startsWith(X`\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 Mf(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const a=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(s=>{const o=[...i.encode(s)].map(c=>`\\x${c.toString(16)}`).join("");return Ne(Gt(s),o)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ne(zf(e),e);if(Ms.has(n))return Ne(Ms.get(n),e);if(/\d/.test(n))return Sf(t,e);if(e==="\\")throw new Error(X`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ne(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ef(e){return{type:"Alternator",raw:e}}function Ps(e,t){return{type:"Assertion",kind:e,raw:t}}function fl(e){return{type:"Backreference",raw:e}}function Ne(e,t){return{type:"Character",value:e,raw:t}}function Ff(e){return{type:"CharacterClassClose",raw:e}}function $f(e){return{type:"CharacterClassHyphen",raw:e}}function jf(e){return{type:"CharacterClassIntersector",raw:e}}function Ds(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function st(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function bl(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ht(n.flags),raw:t}}function Sf(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Af(e){return{type:"GroupClose",raw:e}}function Et(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Tf(e,t,n,a){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:a}}function Rf(e,t,n,a){return{type:"Quantifier",kind:e,min:t,max:n,raw:a}}function Of(e){return{type:"Subroutine",raw:e}}const If=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Ms=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Nf(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 Ne(Gt(t.toUpperCase())-64,e)}function Lf(e,t){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;a??="";const r=(t.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=zs(n),s=zs(a),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),bl("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,Et("group",e,{...(i||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function Pf(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:a,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,o,c]=i,l=If.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 o=="number"||!/^(?:[<>!=]=|[<>])$/.test(o))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return Tf(l,a??null,r?.split(",")??null,e)}function qs(e){let t=null,n,a;if(e[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||i&&+i>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(t="possessive",[n,a]=[a,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,a=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Rf(t,n,a,e)}function Df(e){const t=e[1].toLowerCase();return st({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Mf(e){const{p:t,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return st("property",e,{value:a,negate:t==="P"&&!n||t==="p"&&!!n})}function zs(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 qf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const a=e[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return t}function zf(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Bf(e,t){const{raw:n,inCharClass:a}=e,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[fl(n)];const i=[],s=r.match(/^[0-7]+|\d/g);for(let o=0;o<s.length;o++){const c=s[o];let l;if(o===0&&c!=="8"&&c!=="9"){if(l=parseInt(c,8),l>127)throw new Error(X`Octal encoded byte above 177 unsupported "${n}"`)}else l=Gt(c);i.push(Ne(l,(o===0?"\\":"")+c))}return i}function Uf(e){const t=[],n=new RegExp(Ri,"gy");let a;for(;a=n.exec(e);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:s,max:o}=i.groups;if(+s>+o&&r.endsWith("?")){n.lastIndex--,t.push(qs(r.slice(0,-1)));continue}}}t.push(qs(r))}return t}function _l(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(a=>t[a]===n[a])}function Gf(e){return Hf.has(e.type)}const Hf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function yl(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},a=wf(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(d,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=d,i.nextIndex++,g.type){case"Alternator":return ht();case"Assertion":return Wf(g);case"Backreference":return Vf(g,i);case"Character":return Ia(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return Zf(g,i,m);case"CharacterClassOpen":return Yf(g,i,m);case"CharacterSet":return Xf(g,i);case"Directive":return nb(g.kind,{flags:g.flags});case"GroupOpen":return Kf(g,i,m);case"NamedCallout":return rb(g.kind,g.tag,g.arguments);case"Quantifier":return Qf(g,i);case"Subroutine":return Jf(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=sb(ab(a.flags));let o=s.body[0];for(;i.nextIndex<a.tokens.length;){const d=r(o,{});d.type==="Alternative"?(s.body.push(d),o=d):o.body.push(d)}const{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:p}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of p)if(typeof d=="number"){if(d>c.length)throw new Error("Subroutine uses a group number that's not defined");d&&(c[d-1].isSubroutined=!0)}else if(u.has(d)){if(u.get(d).length>1)throw new Error(X`Subroutine uses a duplicate group name "\g<${d}>"`);u.get(d)[0].isSubroutined=!0}else throw new Error(X`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Wf({kind:e}){return zr(Ht({"^":"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===X`\B`||e===X`\Y`})}function Vf({raw:e},t){const n=/^\\k[<']/.test(e),a=n?e.slice(3,-1):e.slice(1),r=(i,s=!1)=>{const o=t.capturingGroups.length;let c=!1;if(i>o)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Br(s?o+1-i:i,{orphan:c})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${e}"`);return Br(a)}return r(+a)}function Zf(e,t,n){const{tokens:a,walk:r}=t,i=t.parent,s=i.body.at(-1),o=a[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&o&&o.type!=="CharacterClassOpen"&&o.type!=="CharacterClassClose"&&o.type!=="CharacterClassIntersector"){const c=r(i,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&c.type==="Character")return i.body.pop(),tb(s,c);throw new Error("Invalid character class range")}return Ia(Gt("-"))}function Yf({negate:e},t,n){const{tokens:a,walk:r}=t,i=a[t.nextIndex],s=[ra()];let o=Gs(i);for(;o.type!=="CharacterClassClose";){if(o.type==="CharacterClassIntersector")s.push(ra()),t.nextIndex++;else{const l=s.at(-1);l.body.push(r(l,n))}o=Gs(a[t.nextIndex],i)}const c=ra({negate:e});return s.length===1?c.body=s[0].body:(c.kind="intersection",c.body=s.map(l=>l.body.length===1?l.body[0]:l)),t.nextIndex++,c}function Xf({kind:e,negate:t,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s}=a;if(e==="property"){const o=Na(n);if(Ti.has(o)&&!s?.has(o))e="posix",n=o;else return Ft(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s})}return e==="posix"?ib(n,{negate:t}):Ur(e,{negate:t})}function Kf(e,t,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:s,walk:o}=t,c=ob(e),l=c.type==="AbsenceFunction",u=Us(c),p=u&&c.negate;if(c.type==="CapturingGroup"&&(r.push(c),c.name&&vf(i,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Hs(a[t.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")c.body.push(ht()),t.nextIndex++;else{const m=c.body.at(-1),g=o(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(m.body.push(g),(u||n.isInLookbehind)&&!s){const v="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(Bs(g)||g.type==="CapturingGroup")throw new Error(v)}else if(Bs(g)||Us(g)&&g.negate)throw new Error(v)}}d=Hs(a[t.nextIndex])}return t.nextIndex++,c}function Qf({kind:e,min:t,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!Gf(i))throw new Error("Quantifier requires a repeatable token");const s=wl(e,t,n,i);return r.body.pop(),s}function Jf({raw:e},t){const{capturingGroups:n,subroutines:a}=t;let r=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const o=+i.groups.num,c=n.length;if(t.hasNumberedRef=!0,r={"":o,"+":c+o,"-":c+1-o}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=xl(r);return a.push(s),s}function eb(e,t){return{type:"AbsenceFunction",kind:e,body:jn(t?.body)}}function ht(e){return{type:"Alternative",body:kl(e?.body)}}function zr(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Br(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function vl(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!cb(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:jn(t?.body)}}function Ia(e,t){const n={useLastValid:!1,...t};if(e>1114111){const a=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:e}}function ra(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:kl(e?.body)}}function tb(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ur(e,t){const n=!!t?.negate,a={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(a.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(a.variableLength=!0),a}function nb(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ht(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function ab(e){return{type:"Flags",...e}}function be(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:jn(e?.body)}}function at(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:jn(e?.body)}}function rb(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function ib(e,t){const n=!!t?.negate;if(!Ti.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function wl(e,t,n,a){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:a}}function sb(e,t){return{type:"Regex",body:jn(t?.body),flags:e}}function xl(e){return{type:"Subroutine",ref:e}}function Ft(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let a=n.unicodePropertyMap?.get(Na(e));if(!a){if(n.normalizeUnknownPropertyNames)a=lb(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(X`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:a??e,negate:n.negate}}function ob({flags:e,kind:t,name:n,negate:a,number:r}){switch(t){case"absence_repeater":return eb("repeater");case"atomic":return be({atomic:!0});case"capturing":return vl(r,{name:n});case"group":return be({flags:e});case"lookahead":case"lookbehind":return at({behind:t==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${t}"`)}}function jn(e){if(e===void 0)e=[ht()];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 kl(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 Bs(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Us(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function cb(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function lb(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 Na(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Gs(e,t){return Ht(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Hs(e){return Ht(e,"Unclosed group")}function pn(e,t,n=null){function a(i,s){for(let o=0;o<i.length;o++){const c=r(i[o],s,o,i);o=Math.max(-1,o+c)}}function r(i,s=null,o=null,c=null){let l=0,u=!1;const p={node:i,parent:s,key:o,container:c,root:e,remove(){Kn(c).splice(Math.max(0,xt(o)+l),1),l--,u=!0},removeAllNextSiblings(){return Kn(c).splice(xt(o)+1)},removeAllPrevSiblings(){const b=xt(o)+l;return l-=b,Kn(c).splice(0,Math.max(0,b))},replaceWith(b,_={}){const w=!!_.traverse;c?c[Math.max(0,xt(o)+l)]=b:Ht(s,"Can't replace root node")[o]=b,w&&r(b,s,o,c),u=!0},replaceWithMultiple(b,_={}){const w=!!_.traverse;if(Kn(c).splice(Math.max(0,xt(o)+l),1,...b),l+=b.length-1,w){let h=0;for(let C=0;C<b.length;C++)h+=r(b[C],s,xt(o)+C+h,c)}u=!0},skip(){u=!0}},{type:d}=i,m=t["*"],g=t[d],v=typeof m=="function"?m:m?.enter,f=typeof g=="function"?g:g?.enter;if(v?.(p,n),f?.(p,n),!u)switch(d){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return g?.exit?.(p,n),m?.exit?.(p,n),l}return r(e),e}function Kn(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function xt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const ub=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function pb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function db(e,t,n,a){return e.slice(0,t)+a+e.slice(t+n.length)}const de=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Oi(e,t,n,a){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let s=0,o="";for(const c of e.matchAll(r)){const{0:l,groups:{$skip:u}}=c;if(!u&&(!a||a===de.DEFAULT==!s)){n instanceof Function?o+=n(c,{context:s?de.CHAR_CLASS:de.DEFAULT,negated:i[i.length-1]}):o+=n;continue}l[0]==="["?(s++,i.push(l[1]==="^")):l==="]"&&s&&(s--,i.pop()),o+=l}return o}function Cl(e,t,n,a){Oi(e,t,n,a)}function mb(e,t,n=0,a){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,s;for(;s=r.exec(e);){const{0:o,groups:{$skip:c}}=s;if(!c&&(!a||a===de.DEFAULT==!i))return s;o==="["?i++:o==="]"&&i&&i--,r.lastIndex==s.index&&r.lastIndex++}return null}function Qn(e,t,n){return!!mb(e,t,0,n)}function hb(e,t){const n=/\\?./gsu;n.lastIndex=t;let a=e.length,r=0,i=1,s;for(;s=n.exec(e);){const[o]=s;if(o==="[")r++;else if(r)o==="]"&&r--;else if(o==="(")i++;else if(o===")"&&(i--,!i)){a=s.index;break}}return e.slice(t,a)}const Ws=new RegExp(String.raw`(?<noncapturingStart>${ub})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function gb(e,t){const n=t?.hiddenCaptures??[];let a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",s=[0],o=[];let c=0,l=0,u=NaN,p;do{p=!1;let d=0,m=0,g=!1,v;for(Ws.lastIndex=Number.isNaN(u)?0:u+i.length;v=Ws.exec(e);){const{0:f,index:b,groups:{capturingStart:_,noncapturingStart:w}}=v;if(f==="[")d++;else if(d)f==="]"&&d--;else if(f===r&&!g)u=b,g=!0;else if(g&&w)m++;else if(_)g?m++:(c++,s.push(c+l));else if(f===")"&&g){if(!m){l++;const h=c+l;if(e=`${e.slice(0,u)}${i}${e.slice(u+r.length,b)}))<$$${h}>)${e.slice(b+1)}`,p=!0,o.push(h),pb(n,h),a.size){const C=new Map;a.forEach((k,$)=>{C.set($>=h?$+1:$,k.map(T=>T>=h?T+1:T))}),a=C}break}m--}}}while(p);return n.push(...o),e=Oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const v=+m;if(v>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[v]}`}return`\\${g}`},de.DEFAULT),{pattern:e,captureTransfers:a,hiddenCaptures:n}}const El=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,nr=new RegExp(String.raw`
+`.replace(/\s+/g,""),"gsu");function xf(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 a=zf(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(p){r.push(p)},replaceCurrentModX(p){r[r.length-1]=p},singleline:n.rules.singleline};let s=[],o;for(Xn.lastIndex=0;o=Xn.exec(e);){const p=kf(i,e,o[0],Xn.lastIndex);p.tokens?s.push(...p.tokens):p.token&&s.push(p.token),p.lastIndex!==void 0&&(Xn.lastIndex=p.lastIndex)}const c=[];let l=0;s.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++l:p.raw==="("&&c.push(p)}),l||c.forEach((p,d)=>{p.kind="capturing",p.number=d+1});const u=l||c.length;return{tokens:s.map(p=>p.type==="EscapedNumber"?Uf(p,u):p).flat(),flags:a}}function kf(e,t,n,a){const[r,i]=n;if(n==="["||n==="[^"){const s=Cf(t,n,a);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Ps(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:If(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fl(n)}}if(i==="K")return{token:bl("keep",n)};if(i==="N"||i==="R")return{token:st("newline",n,{negate:i==="N"})};if(i==="O")return{token:st("any",n)};if(i==="X")return{token:st("text_segment",n)};const s=gl(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(i==="*")return{token:Df(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Pf(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Et("group",n)};if(n==="(?>")return{token:Et("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Et(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Et("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Et("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:Tf(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
+`,a);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=a,{lastIndex:s.exec(t)?s.lastIndex:a}}}if(n===".")return{token:st("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":X`\A`,$:X`\Z`}[n]:n;return{token:Ps(s,n)}}return n==="|"?{token:Ff(n)}:Ri.test(n)?{tokens:Gf(n)}:{token:Ne(Ht(n),n)}}function Cf(e,t,n){const a=[Ds(t[1]==="^",t)];let r=1,i;for(tr.lastIndex=n;i=tr.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")r++,a.push(Ds(s[1]==="^",s));else if(s==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Ne(93,s));else if(r--,a.push($f(s)),!r)break}else{const o=Ef(s);Array.isArray(o)?a.push(...o):a.push(o)}}return{tokens:a,lastIndex:tr.lastIndex||e.length}}function Ef(e){if(e[0]==="\\")return gl(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ti.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return st("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?jf(e):e==="&&"?Sf(e):Ne(Ht(e),e)}function gl(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Lf(e);if("dDhHsSwW".includes(n))return Mf(e);if(e.startsWith(X`\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 qf(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const a=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(s=>{const o=[...i.encode(s)].map(c=>`\\x${c.toString(16)}`).join("");return Ne(Ht(s),o)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ne(Bf(e),e);if(Ms.has(n))return Ne(Ms.get(n),e);if(/\d/.test(n))return Af(t,e);if(e==="\\")throw new Error(X`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ne(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ff(e){return{type:"Alternator",raw:e}}function Ps(e,t){return{type:"Assertion",kind:e,raw:t}}function fl(e){return{type:"Backreference",raw:e}}function Ne(e,t){return{type:"Character",value:e,raw:t}}function $f(e){return{type:"CharacterClassClose",raw:e}}function jf(e){return{type:"CharacterClassHyphen",raw:e}}function Sf(e){return{type:"CharacterClassIntersector",raw:e}}function Ds(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function st(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function bl(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Wt(n.flags),raw:t}}function Af(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Tf(e){return{type:"GroupClose",raw:e}}function Et(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Rf(e,t,n,a){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:a}}function Of(e,t,n,a){return{type:"Quantifier",kind:e,min:t,max:n,raw:a}}function If(e){return{type:"Subroutine",raw:e}}const Nf=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Ms=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Lf(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 Ne(Ht(t.toUpperCase())-64,e)}function Pf(e,t){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;a??="";const r=(t.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=zs(n),s=zs(a),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),bl("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,Et("group",e,{...(i||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function Df(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:a,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,o,c]=i,l=Nf.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 o=="number"||!/^(?:[<>!=]=|[<>])$/.test(o))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return Rf(l,a??null,r?.split(",")??null,e)}function qs(e){let t=null,n,a;if(e[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||i&&+i>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(t="possessive",[n,a]=[a,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,a=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Of(t,n,a,e)}function Mf(e){const t=e[1].toLowerCase();return st({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function qf(e){const{p:t,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return st("property",e,{value:a,negate:t==="P"&&!n||t==="p"&&!!n})}function zs(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 zf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const a=e[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return t}function Bf(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Uf(e,t){const{raw:n,inCharClass:a}=e,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[fl(n)];const i=[],s=r.match(/^[0-7]+|\d/g);for(let o=0;o<s.length;o++){const c=s[o];let l;if(o===0&&c!=="8"&&c!=="9"){if(l=parseInt(c,8),l>127)throw new Error(X`Octal encoded byte above 177 unsupported "${n}"`)}else l=Ht(c);i.push(Ne(l,(o===0?"\\":"")+c))}return i}function Gf(e){const t=[],n=new RegExp(Ri,"gy");let a;for(;a=n.exec(e);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:s,max:o}=i.groups;if(+s>+o&&r.endsWith("?")){n.lastIndex--,t.push(qs(r.slice(0,-1)));continue}}}t.push(qs(r))}return t}function _l(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(a=>t[a]===n[a])}function Hf(e){return Wf.has(e.type)}const Wf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function yl(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},a=xf(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(d,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=d,i.nextIndex++,g.type){case"Alternator":return ht();case"Assertion":return Vf(g);case"Backreference":return Zf(g,i);case"Character":return Ia(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return Yf(g,i,m);case"CharacterClassOpen":return Xf(g,i,m);case"CharacterSet":return Kf(g,i);case"Directive":return ab(g.kind,{flags:g.flags});case"GroupOpen":return Qf(g,i,m);case"NamedCallout":return ib(g.kind,g.tag,g.arguments);case"Quantifier":return Jf(g,i);case"Subroutine":return eb(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=ob(rb(a.flags));let o=s.body[0];for(;i.nextIndex<a.tokens.length;){const d=r(o,{});d.type==="Alternative"?(s.body.push(d),o=d):o.body.push(d)}const{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:p}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of p)if(typeof d=="number"){if(d>c.length)throw new Error("Subroutine uses a group number that's not defined");d&&(c[d-1].isSubroutined=!0)}else if(u.has(d)){if(u.get(d).length>1)throw new Error(X`Subroutine uses a duplicate group name "\g<${d}>"`);u.get(d)[0].isSubroutined=!0}else throw new Error(X`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Vf({kind:e}){return zr(Wt({"^":"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===X`\B`||e===X`\Y`})}function Zf({raw:e},t){const n=/^\\k[<']/.test(e),a=n?e.slice(3,-1):e.slice(1),r=(i,s=!1)=>{const o=t.capturingGroups.length;let c=!1;if(i>o)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Br(s?o+1-i:i,{orphan:c})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${e}"`);return Br(a)}return r(+a)}function Yf(e,t,n){const{tokens:a,walk:r}=t,i=t.parent,s=i.body.at(-1),o=a[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&o&&o.type!=="CharacterClassOpen"&&o.type!=="CharacterClassClose"&&o.type!=="CharacterClassIntersector"){const c=r(i,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&c.type==="Character")return i.body.pop(),nb(s,c);throw new Error("Invalid character class range")}return Ia(Ht("-"))}function Xf({negate:e},t,n){const{tokens:a,walk:r}=t,i=a[t.nextIndex],s=[ra()];let o=Gs(i);for(;o.type!=="CharacterClassClose";){if(o.type==="CharacterClassIntersector")s.push(ra()),t.nextIndex++;else{const l=s.at(-1);l.body.push(r(l,n))}o=Gs(a[t.nextIndex],i)}const c=ra({negate:e});return s.length===1?c.body=s[0].body:(c.kind="intersection",c.body=s.map(l=>l.body.length===1?l.body[0]:l)),t.nextIndex++,c}function Kf({kind:e,negate:t,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s}=a;if(e==="property"){const o=Na(n);if(Ti.has(o)&&!s?.has(o))e="posix",n=o;else return Ft(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:s})}return e==="posix"?sb(n,{negate:t}):Ur(e,{negate:t})}function Qf(e,t,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:s,walk:o}=t,c=cb(e),l=c.type==="AbsenceFunction",u=Us(c),p=u&&c.negate;if(c.type==="CapturingGroup"&&(r.push(c),c.name&&wf(i,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Hs(a[t.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")c.body.push(ht()),t.nextIndex++;else{const m=c.body.at(-1),g=o(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(m.body.push(g),(u||n.isInLookbehind)&&!s){const v="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(Bs(g)||g.type==="CapturingGroup")throw new Error(v)}else if(Bs(g)||Us(g)&&g.negate)throw new Error(v)}}d=Hs(a[t.nextIndex])}return t.nextIndex++,c}function Jf({kind:e,min:t,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!Hf(i))throw new Error("Quantifier requires a repeatable token");const s=wl(e,t,n,i);return r.body.pop(),s}function eb({raw:e},t){const{capturingGroups:n,subroutines:a}=t;let r=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const o=+i.groups.num,c=n.length;if(t.hasNumberedRef=!0,r={"":o,"+":c+o,"-":c+1-o}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=xl(r);return a.push(s),s}function tb(e,t){return{type:"AbsenceFunction",kind:e,body:jn(t?.body)}}function ht(e){return{type:"Alternative",body:kl(e?.body)}}function zr(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Br(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function vl(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!lb(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:jn(t?.body)}}function Ia(e,t){const n={useLastValid:!1,...t};if(e>1114111){const a=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:e}}function ra(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:kl(e?.body)}}function nb(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ur(e,t){const n=!!t?.negate,a={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(a.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(a.variableLength=!0),a}function ab(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Wt(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function rb(e){return{type:"Flags",...e}}function be(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:jn(e?.body)}}function at(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:jn(e?.body)}}function ib(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function sb(e,t){const n=!!t?.negate;if(!Ti.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function wl(e,t,n,a){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:a}}function ob(e,t){return{type:"Regex",body:jn(t?.body),flags:e}}function xl(e){return{type:"Subroutine",ref:e}}function Ft(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let a=n.unicodePropertyMap?.get(Na(e));if(!a){if(n.normalizeUnknownPropertyNames)a=ub(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(X`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:a??e,negate:n.negate}}function cb({flags:e,kind:t,name:n,negate:a,number:r}){switch(t){case"absence_repeater":return tb("repeater");case"atomic":return be({atomic:!0});case"capturing":return vl(r,{name:n});case"group":return be({flags:e});case"lookahead":case"lookbehind":return at({behind:t==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${t}"`)}}function jn(e){if(e===void 0)e=[ht()];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 kl(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 Bs(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Us(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function lb(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function ub(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 Na(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Gs(e,t){return Wt(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Hs(e){return Wt(e,"Unclosed group")}function dn(e,t,n=null){function a(i,s){for(let o=0;o<i.length;o++){const c=r(i[o],s,o,i);o=Math.max(-1,o+c)}}function r(i,s=null,o=null,c=null){let l=0,u=!1;const p={node:i,parent:s,key:o,container:c,root:e,remove(){Kn(c).splice(Math.max(0,xt(o)+l),1),l--,u=!0},removeAllNextSiblings(){return Kn(c).splice(xt(o)+1)},removeAllPrevSiblings(){const b=xt(o)+l;return l-=b,Kn(c).splice(0,Math.max(0,b))},replaceWith(b,_={}){const w=!!_.traverse;c?c[Math.max(0,xt(o)+l)]=b:Wt(s,"Can't replace root node")[o]=b,w&&r(b,s,o,c),u=!0},replaceWithMultiple(b,_={}){const w=!!_.traverse;if(Kn(c).splice(Math.max(0,xt(o)+l),1,...b),l+=b.length-1,w){let h=0;for(let C=0;C<b.length;C++)h+=r(b[C],s,xt(o)+C+h,c)}u=!0},skip(){u=!0}},{type:d}=i,m=t["*"],g=t[d],v=typeof m=="function"?m:m?.enter,f=typeof g=="function"?g:g?.enter;if(v?.(p,n),f?.(p,n),!u)switch(d){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return g?.exit?.(p,n),m?.exit?.(p,n),l}return r(e),e}function Kn(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function xt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const pb=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function db(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mb(e,t,n,a){return e.slice(0,t)+a+e.slice(t+n.length)}const de=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Oi(e,t,n,a){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let s=0,o="";for(const c of e.matchAll(r)){const{0:l,groups:{$skip:u}}=c;if(!u&&(!a||a===de.DEFAULT==!s)){n instanceof Function?o+=n(c,{context:s?de.CHAR_CLASS:de.DEFAULT,negated:i[i.length-1]}):o+=n;continue}l[0]==="["?(s++,i.push(l[1]==="^")):l==="]"&&s&&(s--,i.pop()),o+=l}return o}function Cl(e,t,n,a){Oi(e,t,n,a)}function hb(e,t,n=0,a){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,s;for(;s=r.exec(e);){const{0:o,groups:{$skip:c}}=s;if(!c&&(!a||a===de.DEFAULT==!i))return s;o==="["?i++:o==="]"&&i&&i--,r.lastIndex==s.index&&r.lastIndex++}return null}function Qn(e,t,n){return!!hb(e,t,0,n)}function gb(e,t){const n=/\\?./gsu;n.lastIndex=t;let a=e.length,r=0,i=1,s;for(;s=n.exec(e);){const[o]=s;if(o==="[")r++;else if(r)o==="]"&&r--;else if(o==="(")i++;else if(o===")"&&(i--,!i)){a=s.index;break}}return e.slice(t,a)}const Ws=new RegExp(String.raw`(?<noncapturingStart>${pb})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function fb(e,t){const n=t?.hiddenCaptures??[];let a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",s=[0],o=[];let c=0,l=0,u=NaN,p;do{p=!1;let d=0,m=0,g=!1,v;for(Ws.lastIndex=Number.isNaN(u)?0:u+i.length;v=Ws.exec(e);){const{0:f,index:b,groups:{capturingStart:_,noncapturingStart:w}}=v;if(f==="[")d++;else if(d)f==="]"&&d--;else if(f===r&&!g)u=b,g=!0;else if(g&&w)m++;else if(_)g?m++:(c++,s.push(c+l));else if(f===")"&&g){if(!m){l++;const h=c+l;if(e=`${e.slice(0,u)}${i}${e.slice(u+r.length,b)}))<$$${h}>)${e.slice(b+1)}`,p=!0,o.push(h),db(n,h),a.size){const C=new Map;a.forEach((k,$)=>{C.set($>=h?$+1:$,k.map(T=>T>=h?T+1:T))}),a=C}break}m--}}}while(p);return n.push(...o),e=Oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const v=+m;if(v>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[v]}`}return`\\${g}`},de.DEFAULT),{pattern:e,captureTransfers:a,hiddenCaptures:n}}const El=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,nr=new RegExp(String.raw`
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
@@ -60,7 +60,7 @@ ${n?'Expression: "'+n+`"
))?
| (?<qBase>${El})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
| \\?.
-`.replace(/\s+/g,""),"gsu");function fb(e){if(!new RegExp(`${El}\\+`).test(e))return{pattern:e};const t=[];let n=null,a=null,r="",i=0,s;for(nr.lastIndex=0;s=nr.exec(e);){const{0:o,index:c,groups:{qBase:l,qMod:u,invalidQ:p}}=s;if(o==="[")i||(a=c),i++;else if(o==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${o}"`);let d=-1;if(/^\{\d+\}$/.test(l))e=db(e,c+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,m)}(?>${e.slice(m,c)}${l})${e.slice(c+o.length)}`}else e=`${e.slice(0,c-r.length)}(?>${r}${l})${e.slice(c+o.length)}`;d+=4}nr.lastIndex+=d}else o[0]==="("?t.push(c):o===")"&&(n=t.length?t.pop():null);r=o}return{pattern:e}}const ue=String.raw,bb=ue`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Gr=ue`\(\?R=(?<rDepth>[^\)]+)\)|${bb}`,La=ue`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fl=ue`${La}|(?<unnamed>\()(?!\?)`,Je=new RegExp(ue`${La}|${Gr}|\(\?|\\?.`,"gsu"),ar="Cannot use multiple overlapping recursions";function _b(e,t){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(Gr,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&Qn(e,ue`\(\?\(DEFINE\)`,de.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=Qn(e,ue`\\[1-9]`,de.DEFAULT),o=new Map,c=[];let l=!1,u=0,p=0,d;for(Je.lastIndex=0;d=Je.exec(e);){const{0:m,groups:{captureName:g,rDepth:v,gRNameOrNum:f,gRDepth:b}}=d;if(m==="[")u++;else if(u)m==="]"&&u--;else if(v){if(Vs(v),l)throw new Error(ar);if(s)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,d.index),w=e.slice(Je.lastIndex);if(Qn(w,Gr,de.DEFAULT))throw new Error(ar);const h=+v-1;e=Zs(_,w,h,!1,n,i,p),r=Xs(r,_,h,i.length,0,p);break}else if(f){Vs(b);let _=!1;for(const R of c)if(R.name===f||R.num===+f){if(_=!0,R.hasRecursedWithin)throw new Error(ar);break}if(!_)throw new Error(ue`Recursive \g cannot be used outside the referenced group "${a==="external"?f:ue`\g<${f}&R=${b}>`}"`);const w=o.get(f),h=hb(e,w);if(s&&Qn(h,ue`${La}|\((?!\?)`,de.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(w,d.index),k=h.slice(C.length+m.length),$=i.length,T=+b-1,N=Zs(C,k,T,!0,n,i,p);r=Xs(r,C,T,i.length-$,$,p);const I=e.slice(0,w),D=e.slice(w+h.length);e=`${I}${N}${D}`,Je.lastIndex+=N.length-m.length-C.length-k.length,c.forEach(R=>R.hasRecursedWithin=!0),l=!0}else if(g)p++,o.set(String(p),Je.lastIndex),o.set(g,Je.lastIndex),c.push({num:p,name:g});else if(m[0]==="("){const _=m==="(";_&&(p++,o.set(String(p),Je.lastIndex)),c.push(_?{num:p}:{})}else m===")"&&c.pop()}return n.push(...i),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function Vs(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 Zs(e,t,n,a,r,i,s){const o=new Set;a&&Cl(e+t,La,({groups:{captureName:l}})=>{o.add(l)},de.DEFAULT);const c=[n,a?o:null,r,i,s];return`${e}${Ys(`(?:${e}`,"forward",...c)}(?:)${Ys(`${t})`,"backward",...c)}${t}`}function Ys(e,t,n,a,r,i,s){const c=u=>t==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const p=c(u);l+=Oi(e,ue`${Fl}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:m,unnamed:g,backref:v}})=>{if(v&&a&&!a.has(v))return d;const f=`_$${p}`;if(g||m){const b=s+i.length+1;return i.push(b),yb(r,b),g?d:`(?<${m}${f}>`}return ue`\k<${v}${f}>`},de.DEFAULT)}return l}function yb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xs(e,t,n,a,r,i){if(e.size&&a){let s=0;Cl(t,Fl,()=>s++,de.DEFAULT);const o=i-s+r,c=new Map;return e.forEach((l,u)=>{const p=(a-s*n)/n,d=s*n,m=u>o+s?u+a:u,g=[];for(const v of l)if(v<=o)g.push(v);else if(v>o+s+p)g.push(v+a);else if(v<=o+s)for(let f=0;f<=n;f++)g.push(v+s*f);else for(let f=0;f<=n;f++)g.push(v+d+p*f);c.set(m,g)}),c}return e}var V=String.fromCodePoint,j=String.raw,Le={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("","v")}catch{return!1}return!0})()};Le.bugFlagVLiteralHyphenIsRange=Le.unicodeSets?(()=>{try{new RegExp(j`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Le.bugNestedClassIgnoresNegation=Le.unicodeSets&&new RegExp("[[^a]]","v").test("a");function xa(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function yn(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Hr(e,t){return Ks[e]>=Ks[t]}function vb(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Ks={ES2025:2025,ES2024:2024,ES2018:2018},wb={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $l(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!wb[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=Le.flagGroups?"ES2025":Le.unicodeSets?"ES2024":"ES2018"),t}var xb="[ -\r ]",kb=new Set([V(304),V(305)]),Oe=j`[\p{L}\p{M}\p{N}\p{Pc}]`;function jl(e){if(kb.has(e))return[e];const t=new Set,n=e.toLowerCase(),a=n.toUpperCase(),r=Fb.get(n),i=Cb.get(n),s=Eb.get(n);return[...a].length===1&&t.add(a),s&&t.add(s),r&&t.add(r),t.add(n),i&&t.add(i),[...t]}var Ii=new Map(`C Other
+`.replace(/\s+/g,""),"gsu");function bb(e){if(!new RegExp(`${El}\\+`).test(e))return{pattern:e};const t=[];let n=null,a=null,r="",i=0,s;for(nr.lastIndex=0;s=nr.exec(e);){const{0:o,index:c,groups:{qBase:l,qMod:u,invalidQ:p}}=s;if(o==="[")i||(a=c),i++;else if(o==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${o}"`);let d=-1;if(/^\{\d+\}$/.test(l))e=mb(e,c+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,m)}(?>${e.slice(m,c)}${l})${e.slice(c+o.length)}`}else e=`${e.slice(0,c-r.length)}(?>${r}${l})${e.slice(c+o.length)}`;d+=4}nr.lastIndex+=d}else o[0]==="("?t.push(c):o===")"&&(n=t.length?t.pop():null);r=o}return{pattern:e}}const ue=String.raw,_b=ue`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Gr=ue`\(\?R=(?<rDepth>[^\)]+)\)|${_b}`,La=ue`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fl=ue`${La}|(?<unnamed>\()(?!\?)`,Je=new RegExp(ue`${La}|${Gr}|\(\?|\\?.`,"gsu"),ar="Cannot use multiple overlapping recursions";function yb(e,t){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(Gr,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&Qn(e,ue`\(\?\(DEFINE\)`,de.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=Qn(e,ue`\\[1-9]`,de.DEFAULT),o=new Map,c=[];let l=!1,u=0,p=0,d;for(Je.lastIndex=0;d=Je.exec(e);){const{0:m,groups:{captureName:g,rDepth:v,gRNameOrNum:f,gRDepth:b}}=d;if(m==="[")u++;else if(u)m==="]"&&u--;else if(v){if(Vs(v),l)throw new Error(ar);if(s)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,d.index),w=e.slice(Je.lastIndex);if(Qn(w,Gr,de.DEFAULT))throw new Error(ar);const h=+v-1;e=Zs(_,w,h,!1,n,i,p),r=Xs(r,_,h,i.length,0,p);break}else if(f){Vs(b);let _=!1;for(const R of c)if(R.name===f||R.num===+f){if(_=!0,R.hasRecursedWithin)throw new Error(ar);break}if(!_)throw new Error(ue`Recursive \g cannot be used outside the referenced group "${a==="external"?f:ue`\g<${f}&R=${b}>`}"`);const w=o.get(f),h=gb(e,w);if(s&&Qn(h,ue`${La}|\((?!\?)`,de.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(w,d.index),k=h.slice(C.length+m.length),$=i.length,T=+b-1,N=Zs(C,k,T,!0,n,i,p);r=Xs(r,C,T,i.length-$,$,p);const I=e.slice(0,w),D=e.slice(w+h.length);e=`${I}${N}${D}`,Je.lastIndex+=N.length-m.length-C.length-k.length,c.forEach(R=>R.hasRecursedWithin=!0),l=!0}else if(g)p++,o.set(String(p),Je.lastIndex),o.set(g,Je.lastIndex),c.push({num:p,name:g});else if(m[0]==="("){const _=m==="(";_&&(p++,o.set(String(p),Je.lastIndex)),c.push(_?{num:p}:{})}else m===")"&&c.pop()}return n.push(...i),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function Vs(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 Zs(e,t,n,a,r,i,s){const o=new Set;a&&Cl(e+t,La,({groups:{captureName:l}})=>{o.add(l)},de.DEFAULT);const c=[n,a?o:null,r,i,s];return`${e}${Ys(`(?:${e}`,"forward",...c)}(?:)${Ys(`${t})`,"backward",...c)}${t}`}function Ys(e,t,n,a,r,i,s){const c=u=>t==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const p=c(u);l+=Oi(e,ue`${Fl}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:m,unnamed:g,backref:v}})=>{if(v&&a&&!a.has(v))return d;const f=`_$${p}`;if(g||m){const b=s+i.length+1;return i.push(b),vb(r,b),g?d:`(?<${m}${f}>`}return ue`\k<${v}${f}>`},de.DEFAULT)}return l}function vb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xs(e,t,n,a,r,i){if(e.size&&a){let s=0;Cl(t,Fl,()=>s++,de.DEFAULT);const o=i-s+r,c=new Map;return e.forEach((l,u)=>{const p=(a-s*n)/n,d=s*n,m=u>o+s?u+a:u,g=[];for(const v of l)if(v<=o)g.push(v);else if(v>o+s+p)g.push(v+a);else if(v<=o+s)for(let f=0;f<=n;f++)g.push(v+s*f);else for(let f=0;f<=n;f++)g.push(v+d+p*f);c.set(m,g)}),c}return e}var V=String.fromCodePoint,j=String.raw,Le={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("","v")}catch{return!1}return!0})()};Le.bugFlagVLiteralHyphenIsRange=Le.unicodeSets?(()=>{try{new RegExp(j`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Le.bugNestedClassIgnoresNegation=Le.unicodeSets&&new RegExp("[[^a]]","v").test("a");function xa(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function vn(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Hr(e,t){return Ks[e]>=Ks[t]}function wb(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Ks={ES2025:2025,ES2024:2024,ES2018:2018},xb={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $l(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!xb[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=Le.flagGroups?"ES2025":Le.unicodeSets?"ES2024":"ES2018"),t}var kb="[ -\r ]",Cb=new Set([V(304),V(305)]),Oe=j`[\p{L}\p{M}\p{N}\p{Pc}]`;function jl(e){if(Cb.has(e))return[e];const t=new Set,n=e.toLowerCase(),a=n.toUpperCase(),r=$b.get(n),i=Eb.get(n),s=Fb.get(n);return[...a].length===1&&t.add(a),s&&t.add(s),r&&t.add(r),t.add(n),i&&t.add(i),[...t]}var Ii=new Map(`C Other
Cc Control cntrl
Cf Format
Cn Unassigned
@@ -150,7 +150,7 @@ Uppercase Upper
Variation_Selector VS
White_Space space
XID_Continue XIDC
-XID_Start XIDS`.split(/\s/).map(e=>[Na(e),e])),Cb=new Map([["s",V(383)],[V(383),"s"]]),Eb=new Map([[V(223),V(7838)],[V(107),V(8490)],[V(229),V(8491)],[V(969),V(8486)]]),Fb=new Map([Be(453),Be(456),Be(459),Be(498),...rr(8072,8079),...rr(8088,8095),...rr(8104,8111),Be(8124),Be(8140),Be(8188)]),$b=new Map([["alnum",j`[\p{Alpha}\p{Nd}]`],["alpha",j`\p{Alpha}`],["ascii",j`\p{ASCII}`],["blank",j`[\p{Zs}\t]`],["cntrl",j`\p{Cc}`],["digit",j`\p{Nd}`],["graph",j`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",j`\p{Lower}`],["print",j`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",j`[\p{P}\p{S}]`],["space",j`\p{space}`],["upper",j`\p{Upper}`],["word",j`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",j`\p{AHex}`]]);function jb(e,t){const n=[];for(let a=e;a<=t;a++)n.push(a);return n}function Be(e){const t=V(e);return[t.toLowerCase(),t]}function rr(e,t){return jb(e,t).map(n=>Be(n))}var Sl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Sb(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Al(e);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Hr(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};pn(e,Ab,a);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};pn(e,Tb,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return pn(e,Rb,s),e._originMap=i.groupOriginByCopy,e._strategy=a.strategy,e}var Ab={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:a,kind:r}=e;if(r==="repeater"){const i=be();i.body[0].body.push(at({negate:!0,body:a}),Ft("Any"));const s=be();s.body[0].body.push(wl("greedy",0,1/0,i)),n(B(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:a}){const r=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];yn(a,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Rl(t.get(e));if(n){const a=be({flags:n});a.body[0].body=e.body,e.body=[B(a,e)]}}}},Assertion({node:e,parent:t,key:n,container:a,root:r,remove:i,replaceWith:s},o){const{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:p,supportedGNodes:d,wordIsAscii:m}=o;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(c==="line_end")s(B(at({body:[ht({body:[zr("string_end")]}),ht({body:[Ia(10)]})]}),t));else if(c==="line_start")s(B(Ie(j`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(d.has(e))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&Db(g))s(B(at({negate:!0}),t));else{if(p)throw new Error(j`Uses "\G" in a way that requires a subclass`);s(Ue(zr("string_start"),t)),o.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")s(B(Ie(j`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${Oe})(?!${Oe})|(?<!${Oe})(?=${Oe}))`,v=`(?:(?<=${Oe})(?=${Oe})|(?<!${Oe})(?!${Oe}))`;s(B(Ie(l?v:g),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!sr(n)&&(n=ir(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:a}=e;a&&!sr(a)&&(a=ir(a,t),e.name=a),n.set(e.number,e),a&&n.set(a,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const a=ra({body:[e]});n(B(a,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){const{kind:c,negate:l,value:u}=e;if(i&&(c==="digit"||u==="digit")){n(Ue(Ur("digit",{negate:l}),t));return}if(s&&(c==="space"||u==="space")){n(B(or(Ie(xb),l),t));return}if(o&&(c==="word"||u==="word")){n(Ue(Ur("word",{negate:l}),t));return}if(c==="any")n(Ue(Ft("Any"),t));else if(c==="digit")n(Ue(Ft("Nd",{negate:l}),t));else if(c!=="dot")if(c==="text_segment"){if(a==="strict")throw new Error(j`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=j`\p{RI}{2}|${p}(?:\u200D${p})*`;n(B(Ie(j`(?>\r\n|${r?j`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(Ue(Ft("AHex",{negate:l}),t));else if(c==="newline")n(B(Ie(l?`[^
+XID_Start XIDS`.split(/\s/).map(e=>[Na(e),e])),Eb=new Map([["s",V(383)],[V(383),"s"]]),Fb=new Map([[V(223),V(7838)],[V(107),V(8490)],[V(229),V(8491)],[V(969),V(8486)]]),$b=new Map([Be(453),Be(456),Be(459),Be(498),...rr(8072,8079),...rr(8088,8095),...rr(8104,8111),Be(8124),Be(8140),Be(8188)]),jb=new Map([["alnum",j`[\p{Alpha}\p{Nd}]`],["alpha",j`\p{Alpha}`],["ascii",j`\p{ASCII}`],["blank",j`[\p{Zs}\t]`],["cntrl",j`\p{Cc}`],["digit",j`\p{Nd}`],["graph",j`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",j`\p{Lower}`],["print",j`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",j`[\p{P}\p{S}]`],["space",j`\p{space}`],["upper",j`\p{Upper}`],["word",j`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",j`\p{AHex}`]]);function Sb(e,t){const n=[];for(let a=e;a<=t;a++)n.push(a);return n}function Be(e){const t=V(e);return[t.toLowerCase(),t]}function rr(e,t){return Sb(e,t).map(n=>Be(n))}var Sl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Ab(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Al(e);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Hr(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};dn(e,Tb,a);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};dn(e,Rb,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return dn(e,Ob,s),e._originMap=i.groupOriginByCopy,e._strategy=a.strategy,e}var Tb={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:a,kind:r}=e;if(r==="repeater"){const i=be();i.body[0].body.push(at({negate:!0,body:a}),Ft("Any"));const s=be();s.body[0].body.push(wl("greedy",0,1/0,i)),n(B(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:a}){const r=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];vn(a,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Rl(t.get(e));if(n){const a=be({flags:n});a.body[0].body=e.body,e.body=[B(a,e)]}}}},Assertion({node:e,parent:t,key:n,container:a,root:r,remove:i,replaceWith:s},o){const{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:p,supportedGNodes:d,wordIsAscii:m}=o;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(c==="line_end")s(B(at({body:[ht({body:[zr("string_end")]}),ht({body:[Ia(10)]})]}),t));else if(c==="line_start")s(B(Ie(j`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(d.has(e))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&Mb(g))s(B(at({negate:!0}),t));else{if(p)throw new Error(j`Uses "\G" in a way that requires a subclass`);s(Ue(zr("string_start"),t)),o.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")s(B(Ie(j`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${Oe})(?!${Oe})|(?<!${Oe})(?=${Oe}))`,v=`(?:(?<=${Oe})(?=${Oe})|(?<!${Oe})(?!${Oe}))`;s(B(Ie(l?v:g),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!sr(n)&&(n=ir(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:a}=e;a&&!sr(a)&&(a=ir(a,t),e.name=a),n.set(e.number,e),a&&n.set(a,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const a=ra({body:[e]});n(B(a,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){const{kind:c,negate:l,value:u}=e;if(i&&(c==="digit"||u==="digit")){n(Ue(Ur("digit",{negate:l}),t));return}if(s&&(c==="space"||u==="space")){n(B(or(Ie(kb),l),t));return}if(o&&(c==="word"||u==="word")){n(Ue(Ur("word",{negate:l}),t));return}if(c==="any")n(Ue(Ft("Any"),t));else if(c==="digit")n(Ue(Ft("Nd",{negate:l}),t));else if(c!=="dot")if(c==="text_segment"){if(a==="strict")throw new Error(j`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=j`\p{RI}{2}|${p}(?:\u200D${p})*`;n(B(Ie(j`(?>\r\n|${r?j`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n(Ue(Ft("AHex",{negate:l}),t));else if(c==="newline")n(B(Ie(l?`[^
]`:`(?>\r
?|[
-\v\f

References