@tianshu-ai/tianshu 0.4.16 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BVBpGdXr.js","assets/rolldown-runtime-QTnfLwEv.js","assets/html-C8UlPnhE.js","assets/javascript-CUt1pgmJ.js","assets/css-DJp_X0uY.js","assets/angular-ts-BfdufMKP.js","assets/scss-DdSxiZKl.js","assets/astro-JKRPP03v.js","assets/json-qhed-kSA.js","assets/typescript-DOu2WMV5.js","assets/postcss-BXeXVLqQ.js","assets/tsx-5Eka4NBX.js","assets/blade-DA8yMPsw.js","assets/html-derivative-CY6NRz-J.js","assets/xml-DIqSwXR3.js","assets/java-CGc3VwQr.js","assets/sql-DNssxck8.js","assets/c-Wt1voDr2.js","assets/coffee-CThvmt4R.js","assets/cpp-C5WNSHb9.js","assets/regexp-Omp9DhTb.js","assets/glsl-Dv5r7kPw.js","assets/graphql-CcFwQwm0.js","assets/jsx-CY6oMTks.js","assets/haml-Bg4I2hiD.js","assets/handlebars-DnwbnL5R.js","assets/yaml-rwi0_p6S.js","assets/http-CoW620Fi.js","assets/shellscript-CLZ0U2zV.js","assets/hurl-CSSETujw.js","assets/csv-Dx-8-gkx.js","assets/jinja-CD-Z-FLd.js","assets/jison-imPNup1l.js","assets/julia-CjffhBEM.js","assets/python-gzcpVVnB.js","assets/r-Dzep-lPg.js","assets/marko-DvhNOisQ.js","assets/less-DVTAwKKz.js","assets/mdc-CazklSAj.js","assets/markdown-BYOwaDjH.js","assets/php-CBqsN0ai.js","assets/pug-C5hz5LQ7.js","assets/svelte-DOdLCIlh.js","assets/ts-tags-Ca73dJJY.js","assets/vue-Bfx0ffIq.js","assets/vue-html-BeluIYX0.js","assets/vue-vine-DGUAbOCX.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c}from"./index-59lIgMis.js";var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,p=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e},h=(e,t,n)=>(m(e,t,`default`),n&&m(n,t,`default`)),g=e({createOnigurumaEngine:()=>Se,getDefaultWasmLoader:()=>xe,loadWasm:()=>he,setDefaultWasmLoader:()=>be}),_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ee(){return 2147483648}function te(){return typeof performance<`u`?performance.now():Date.now()}var ne=(e,t)=>e+(t-e%t)%t;async function re(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=ee();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,ne(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:te,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ie=Object.defineProperty,ae=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ae(e,typeof t==`symbol`?t:t+``,n),y=null;function oe(e){throw new _(e.UTF8ToString(e.getLastOnigError()))}var se=class e{constructor(t){v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16Value`),v(this,`utf8Value`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},b=class e{constructor(t){if(v(this,`id`,++e.LAST_ID),v(this,`_onigBinding`),v(this,`content`),v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`),v(this,`ptr`),!y)throw new _(`Must invoke loadWasm first.`);this._onigBinding=y,this.content=t;let n=new se(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=y.omalloc(1e4),e._sharedPtrInUse=!0,y.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(y)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};v(b,`LAST_ID`,0),v(b,`_sharedPtr`,0),v(b,`_sharedPtrInUse`,!1);var ce=b,le=class{constructor(e){if(v(this,`_onigBinding`),v(this,`_ptr`),!y)throw new _(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new se(e[r]);t[r]=i.createString(y),n[r]=i.utf8Length}let r=y.omalloc(4*e.length);y.HEAPU32.set(t,r/4);let i=y.omalloc(4*e.length);y.HEAPU32.set(n,i/4);let a=y.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)y.ofree(t[n]);y.ofree(i),y.ofree(r),a===0&&oe(y),this._onigBinding=y,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new ce(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function ue(e){return typeof e.instantiator==`function`}function de(e){return typeof e.default==`function`}function fe(e){return e.data!==void 0}function pe(e){return typeof Response<`u`&&e instanceof Response}function me(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var x;function he(e){if(x)return x;async function t(){y=await re(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ue(n)?n=await n.instantiator(t):de(n)?n=await n.default(t):(fe(n)&&(n=n.data),pe(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await _e(n)(t):await ve(n)(t):me(n)||n instanceof WebAssembly.Module?n=await ge(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ge(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return x=t(),x}function ge(e){return t=>WebAssembly.instantiate(e,t)}function _e(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ve(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var ye;function be(e){ye=e}function xe(){return ye}async function Se(e){return e&&await he(e),{createScanner(e){return new le(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ce(e)}}}var Ce=p({});h(Ce,g);var we=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>n(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>n(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>n(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>n(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>n(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>n(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>n(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>n(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>n(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>n(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>n(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>n(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>n(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>n(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>n(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>n(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>n(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>n(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>n(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>n(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>n(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>n(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>n(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>n(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>n(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>n(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>n(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>n(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>n(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>n(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>n(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>n(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>n(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>n(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>n(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>n(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>n(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>n(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>n(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>n(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>n(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>n(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>n(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>n(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>n(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>n(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>n(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>n(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>n(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>n(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>n(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>n(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),S=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Te(e){return Ee(e)}function Ee(e){return Array.isArray(e)?De(e):e instanceof RegExp?e:typeof e==`object`?Oe(e):e}function De(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ee(e[n]);return t}function Oe(e){let t={};for(let n in e)t[n]=Ee(e[n]);return t}function ke(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ae(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ae(e.substring(0,e.length-1)):e.substr(~t+1)}var je=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,C=class{static hasCaptures(e){return e===null?!1:(je.lastIndex=0,je.test(e))}static replaceCaptures(e,t,n){return e.replace(je,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Me(e,t){return e<t?-1:+(e>t)}function Ne(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Me(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Pe(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 Fe(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ie=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},w=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ve(e),t)}static createFromParsedTheme(e,t){return Ue(e,t)}_cachedMatchRoot=new Ie(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Re(e.parent,t.parentScopes));return n?new Be(n.fontStyle,n.foreground,n.background):null}},Le=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Re(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!ze(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ze(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Be=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ve(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Pe(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Pe(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new He(l,u,e,o,s,c)}}return n}var He=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},T=(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))(T||{});function Ue(e,t){e.sort((e,t)=>{let n=Me(e.scope,t.scope);return n!==0||(n=Ne(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new We(t),o=new Be(n,a.getId(r),a.getId(i)),s=new qe(new Ke(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new w(a,o,s)}var We=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 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)}},Ge=Object.freeze([]),Ke=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ge,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},qe=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ke.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Ne(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ke(e,t,n,r,i))}},E=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ye(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Je(e){return e}function Ye(e){return e}function D(e,t){let n=[],r=Ze(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xe(i)){let e=[];do e.push(i),i=r.next();while(Xe(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xe(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ze(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qe(e){typeof e.dispose==`function`&&e.dispose()}var O=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},$e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},et=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},tt=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new O(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new et;for(let n of e)nt(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof O){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function nt(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof O?k({baseGrammar:a,selfGrammar:i},r):rt(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new O(e))}function rt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];A([r],t,n)}}function k(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&A(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&A(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function A(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ke({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&A(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lt(i);switch(a.kind){case 0:k({...t,selfGrammar:t.baseGrammar},n);break;case 1:k(t,n);break;case 2:rt(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?rt(a.ruleName,i,n):k(i,n)}else a.kind===4?n.add(new $e(a.scopeName,a.ruleName)):n.add(new O(a.scopeName));break}}}var it=class{kind=0},at=class{kind=1},ot=class{constructor(e){this.ruleName=e}kind=2},st=class{constructor(e){this.scopeName=e}kind=3},ct=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lt(e){if(e===`$base`)return new it;if(e===`$self`)return new at;let t=e.indexOf(`#`);return t===-1?new st(e):t===0?new ot(e.substring(1)):new ct(e.substring(0,t),e.substring(t+1))}var ut=/\\(\d+)/,dt=/\\(\d+)/g,ft=-1,pt=-2;function mt(e){return e}function ht(e){return e}var j=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=C.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=C.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ae(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:C.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:C.replaceCaptures(this._contentName,e,t)}},gt=class extends j{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},_t=class extends j{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new N(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vt=class extends j{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yt=class extends j{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this._end=new N(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).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}},M=class extends j{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new N(o,pt),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(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},bt=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gt(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _t(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ke({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new vt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new M(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new yt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lt(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof vt||e instanceof yt||e instanceof M)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},N=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=ut.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dt.lastIndex=0,this.source.replace(dt,(e,t)=>Fe(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},P=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(),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(e=>e.source);this._cached=new xt(e,t,this._items.map(e=>e.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){return new xt(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xt=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(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
2
|
+
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c}from"./index-D1d31QOE.js";var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,p=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e},h=(e,t,n)=>(m(e,t,`default`),n&&m(n,t,`default`)),g=e({createOnigurumaEngine:()=>Se,getDefaultWasmLoader:()=>xe,loadWasm:()=>he,setDefaultWasmLoader:()=>be}),_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ee(){return 2147483648}function te(){return typeof performance<`u`?performance.now():Date.now()}var ne=(e,t)=>e+(t-e%t)%t;async function re(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=ee();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,ne(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:te,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ie=Object.defineProperty,ae=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ae(e,typeof t==`symbol`?t:t+``,n),y=null;function oe(e){throw new _(e.UTF8ToString(e.getLastOnigError()))}var se=class e{constructor(t){v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16Value`),v(this,`utf8Value`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},b=class e{constructor(t){if(v(this,`id`,++e.LAST_ID),v(this,`_onigBinding`),v(this,`content`),v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`),v(this,`ptr`),!y)throw new _(`Must invoke loadWasm first.`);this._onigBinding=y,this.content=t;let n=new se(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=y.omalloc(1e4),e._sharedPtrInUse=!0,y.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(y)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};v(b,`LAST_ID`,0),v(b,`_sharedPtr`,0),v(b,`_sharedPtrInUse`,!1);var ce=b,le=class{constructor(e){if(v(this,`_onigBinding`),v(this,`_ptr`),!y)throw new _(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new se(e[r]);t[r]=i.createString(y),n[r]=i.utf8Length}let r=y.omalloc(4*e.length);y.HEAPU32.set(t,r/4);let i=y.omalloc(4*e.length);y.HEAPU32.set(n,i/4);let a=y.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)y.ofree(t[n]);y.ofree(i),y.ofree(r),a===0&&oe(y),this._onigBinding=y,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new ce(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function ue(e){return typeof e.instantiator==`function`}function de(e){return typeof e.default==`function`}function fe(e){return e.data!==void 0}function pe(e){return typeof Response<`u`&&e instanceof Response}function me(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var x;function he(e){if(x)return x;async function t(){y=await re(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ue(n)?n=await n.instantiator(t):de(n)?n=await n.default(t):(fe(n)&&(n=n.data),pe(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await _e(n)(t):await ve(n)(t):me(n)||n instanceof WebAssembly.Module?n=await ge(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ge(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return x=t(),x}function ge(e){return t=>WebAssembly.instantiate(e,t)}function _e(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ve(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var ye;function be(e){ye=e}function xe(){return ye}async function Se(e){return e&&await he(e),{createScanner(e){return new le(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ce(e)}}}var Ce=p({});h(Ce,g);var we=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>n(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>n(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>n(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>n(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>n(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>n(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>n(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>n(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>n(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>n(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>n(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>n(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>n(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>n(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>n(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>n(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>n(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>n(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>n(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>n(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>n(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>n(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>n(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>n(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>n(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>n(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>n(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>n(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>n(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>n(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>n(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>n(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>n(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>n(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>n(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>n(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>n(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>n(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>n(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>n(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>n(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>n(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>n(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>n(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>n(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>n(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>n(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>n(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>n(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>n(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>n(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>n(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),S=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Te(e){return Ee(e)}function Ee(e){return Array.isArray(e)?De(e):e instanceof RegExp?e:typeof e==`object`?Oe(e):e}function De(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ee(e[n]);return t}function Oe(e){let t={};for(let n in e)t[n]=Ee(e[n]);return t}function ke(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ae(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ae(e.substring(0,e.length-1)):e.substr(~t+1)}var je=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,C=class{static hasCaptures(e){return e===null?!1:(je.lastIndex=0,je.test(e))}static replaceCaptures(e,t,n){return e.replace(je,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Me(e,t){return e<t?-1:+(e>t)}function Ne(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Me(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Pe(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 Fe(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ie=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},w=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ve(e),t)}static createFromParsedTheme(e,t){return Ue(e,t)}_cachedMatchRoot=new Ie(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Re(e.parent,t.parentScopes));return n?new Be(n.fontStyle,n.foreground,n.background):null}},Le=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Re(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!ze(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ze(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Be=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ve(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Pe(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Pe(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new He(l,u,e,o,s,c)}}return n}var He=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},T=(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))(T||{});function Ue(e,t){e.sort((e,t)=>{let n=Me(e.scope,t.scope);return n!==0||(n=Ne(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new We(t),o=new Be(n,a.getId(r),a.getId(i)),s=new qe(new Ke(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new w(a,o,s)}var We=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 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)}},Ge=Object.freeze([]),Ke=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ge,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},qe=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ke.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Ne(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ke(e,t,n,r,i))}},E=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ye(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Je(e){return e}function Ye(e){return e}function D(e,t){let n=[],r=Ze(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xe(i)){let e=[];do e.push(i),i=r.next();while(Xe(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xe(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ze(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qe(e){typeof e.dispose==`function`&&e.dispose()}var O=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},$e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},et=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},tt=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new O(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new et;for(let n of e)nt(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof O){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function nt(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof O?k({baseGrammar:a,selfGrammar:i},r):rt(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new O(e))}function rt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];A([r],t,n)}}function k(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&A(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&A(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function A(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ke({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&A(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lt(i);switch(a.kind){case 0:k({...t,selfGrammar:t.baseGrammar},n);break;case 1:k(t,n);break;case 2:rt(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?rt(a.ruleName,i,n):k(i,n)}else a.kind===4?n.add(new $e(a.scopeName,a.ruleName)):n.add(new O(a.scopeName));break}}}var it=class{kind=0},at=class{kind=1},ot=class{constructor(e){this.ruleName=e}kind=2},st=class{constructor(e){this.scopeName=e}kind=3},ct=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lt(e){if(e===`$base`)return new it;if(e===`$self`)return new at;let t=e.indexOf(`#`);return t===-1?new st(e):t===0?new ot(e.substring(1)):new ct(e.substring(0,t),e.substring(t+1))}var ut=/\\(\d+)/,dt=/\\(\d+)/g,ft=-1,pt=-2;function mt(e){return e}function ht(e){return e}var j=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=C.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=C.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ae(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:C.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:C.replaceCaptures(this._contentName,e,t)}},gt=class extends j{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},_t=class extends j{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new N(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vt=class extends j{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yt=class extends j{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this._end=new N(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).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}},M=class extends j{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new N(o,pt),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(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},bt=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gt(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _t(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ke({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new vt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new M(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new yt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lt(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof vt||e instanceof yt||e instanceof M)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},N=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=ut.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dt.lastIndex=0,this.source.replace(dt,(e,t)=>Fe(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},P=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(),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(e=>e.source);this._cached=new xt(e,t,this._items.map(e=>e.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){return new xt(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xt=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(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
3
3
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},St=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ct=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new St(e,8),this._embeddedLanguagesMatcher=new wt(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new St(0,0);_getBasicScopeAttributes=new Ie(e=>new St(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.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 Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},wt=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Fe(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Tt=!1,Et=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Dt(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ot(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Et(i,!0);f()}return new Et(i,!1);function f(){let o=kt(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===ft){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),F(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof yt){let r=o;F(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof M){let r=o;F(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(F(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ot(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof M&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Nt(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==pt){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),F(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function kt(e,t,n,r,i,a){let o=At(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=jt(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function At(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Mt(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function jt(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Mt(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Mt(e,t,n,r,i){return Tt?{ruleScanner:e.compile(t,n),findOptions:Pt(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Nt(e,t,n,r,i){return Tt?{ruleScanner:e.compileWhile(t,n),findOptions:Pt(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Pt(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function F(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Dt(e,p,n&&d.start===0,d.start,f,i,!1,0),Qe(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Ft(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ft=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function It(e,t,n,r,i,a,o,s){return new zt(e,t,n,r,i,a,o,s)}function Lt(e,t,n,r,i){let a=D(t,I),o=bt.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function I(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Rt(t[r],e))return n=r+1,!0;return!1})}function Rt(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var zt=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ct(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Bt(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=D(e,I);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let 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(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Lt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Lt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(mt(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[ht(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Bt(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=bt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Vt.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=E.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?L.createRootAndLookUpScopeName(a,r,this):L.createRoot(`unknown`,r),t=new Vt(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
4
4
|
`;let a=this.createOnigString(e),o=a.content.length,s=new Ut(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Dt(this,a,i,0,t,s,!0,r);return Qe(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Bt(e,t){return e=Te(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 L=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Le.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Le(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Le(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),E.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Vt=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?L.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:ht(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){let r=L.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,mt(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,L.fromExtension(r,n.contentNameScopesList))}},Ht=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):D(e,I).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>D(e,I).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Ut=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=E.set(n,0,Je(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=E.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let 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);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Wt=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let 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,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,It(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Gt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Wt(w.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(w.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ht(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new tt(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Kt=Vt.NULL;function R(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function z(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function qt(e){return Array.isArray(e)?e:[e]}async function Jt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function B(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Yt(e){return e===`ansi`||B(e)}function V(e){return e===`none`}function Xt(e){return V(e)}var Zt=/(\r?\n)/g;function H(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Zt),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Qt={light:`#333333`,dark:`#bbbbbb`},$t={light:`#fffffe`,dark:`#1e1e1e`},en=`__shiki_resolved`;function tn(e){if(e?.[en])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Qt.light:Qt.dark,n||=t.type===`light`?$t.light:$t.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,en,{enumerable:!1,writable:!1,value:!0}),t}async function nn(e){return[...new Set((await Promise.all(e.filter(e=>!Yt(e)).map(async e=>await Jt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function rn(e){return(await Promise.all(e.map(async e=>Xt(e)?null:tn(await Jt(e))))).filter(e=>!!e)}function an(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new S(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var on=class extends Gt{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tn(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=w.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=an(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new S(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},sn=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},U=0;function cn(e){U+=1,e.warnings!==!1&&U>=10&&U%10==0&&console.warn(`[Shiki] ${U} 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 S("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tn),i=new on(new sn(e.engine,n),r,n,e.langAlias),a;function o(t){return an(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new S(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new S(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await nn(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await rn(e))}function g(){if(t)throw new S(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--U)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function ln(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([rn(e.themes||[]),nn(e.langs||[]),e.engine]);return cn({...e,themes:t,langs:n,engine:r})}var un=new WeakMap;function W(e,t){un.set(e,t)}function G(e){return un.get(e)}var K=class e{_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 e(Object.fromEntries(qt(n).map(e=>[e,Kt])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return dn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function dn(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function fn(e,t){if(!(e instanceof K))throw new S(`Invalid grammar state`);return e.getInternalStack(t)}var pn=/,/,mn=/ /;function hn(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(B(e.resolveLangAlias(n.lang||`text`))||V(r))return H(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return _n(t,o,i,a,n)}function gn(...e){if(e.length===2)return G(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(B(i)||V(a))throw new S(`Plain language does not have grammar state`);if(i===`ansi`)throw new S(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new K(vn(n,c,o,s,r).stateStack,c.name,o.name)}function _n(e,t,n,r,i){let a=vn(e,t,n,r,i),o=new K(a.stateStack,t.name,n.name);return W(a.tokens,o),a.tokens}function vn(e,t,n,r,i){let a=R(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=H(e),l=i.grammarState?fn(i.grammarState,n.name)??Kt:i.grammarContextCode==null?Kt:vn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),ee=_.tokens.length/2;for(let e=0;e<ee;e++){let t=_.tokens[2*e],o=e+1<ee?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=z(r[E.getForeground(s)],a),l=E.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(pn).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(mn))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?yn(t.scopes):bn(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function yn(e){return e.map(e=>({scopeName:e}))}function bn(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Cn(e,i,t.slice(0,r))}}return n}function xn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Sn(e,t,n){if(!xn(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)xn(e[r],n[i])&&--r,--i;return r===-1}function Cn(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Sn(e,t,n)){r.push(a);break}return r}function wn(e,t,n,r=hn){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:G(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Tn(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new K(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&W(s,c),s}function Tn(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var En=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Dn={}.hasOwnProperty;function On(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Dn.call(t,e)){let n=String(t[e]);i=Dn.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var kn=/["&'<>`]/g,An=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,jn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Mn=/[|\\{}()[\]^$+*?.]/g,Nn=new WeakMap;function Pn(e,t){if(e=e.replace(t.subset?Fn(t.subset):kn,r),t.subset||t.escapeOnly)return e;return e.replace(An,n).replace(jn,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Fn(e){let t=Nn.get(e);return t||(t=In(e),Nn.set(e,t)),t}function In(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Mn,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Ln=/[\dA-Fa-f]/;function Rn(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Ln.test(String.fromCharCode(t))?r:r+`;`}var zn=/\d/;function Bn(e,t,n){let r=`&#`+String(e);return n&&t&&!zn.test(String.fromCharCode(t))?r:r+`;`}var Vn=`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`.split(`.`),Hn={nbsp:`\xA0`,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:`€`},Un=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Wn={}.hasOwnProperty,Gn={},q;for(q in Hn)Wn.call(Hn,q)&&(Gn[Hn[q]]=q);var Kn=/[^\dA-Za-z]/;function qn(e,t,n,r){let i=String.fromCharCode(e);if(Wn.call(Gn,i)){let e=Gn[i],a=`&`+e;return n&&Vn.includes(e)&&!Un.includes(e)&&(!r||t&&t!==61&&Kn.test(String.fromCharCode(t)))?a:a+`;`}return``}function Jn(e,t,n){let r=Rn(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=qn(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Bn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function J(e,t){return Pn(e,Object.assign({format:Jn},t))}var Yn=/^>|^->|<!--|-->|--!>|<!-$/g,Xn=[`>`],Zn=[`<`,`>`];function Qn(e,t,n,r){return r.settings.bogusComments?`<?`+J(e.value,Object.assign({},r.settings.characterReferences,{subset:Xn}))+`>`:`<!--`+e.value.replace(Yn,i)+`-->`;function i(e){return J(e,Object.assign({},r.settings.characterReferences,{subset:Zn}))}}function $n(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var Y=nr(1),er=nr(-1),tr=[];function nr(e){return t;function t(t,n,r){let i=t?t.children:tr,o=(n||0)+e,s=i[o];if(!r)for(;s&&a(s);)o+=e,s=i[o];return s}}var rr={}.hasOwnProperty;function ir(e){return t;function t(t,n,r){return rr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ar=ir({body:cr,caption:or,colgroup:or,dd:fr,dt:dr,head:or,html:sr,li:ur,optgroup:mr,option:hr,p:lr,rp:pr,rt:pr,tbody:_r,td:br,tfoot:vr,th:br,thead:gr,tr:yr});function or(e,t,n){let r=Y(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&a(r.value.charAt(0)))}function sr(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function cr(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function lr(e,t,n){let r=Y(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function ur(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`li`}function dr(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function fr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function pr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function mr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function hr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function gr(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function _r(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function vr(e,t,n){return!Y(n,t)}function yr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function br(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var xr=ir({body:wr,colgroup:Tr,head:Cr,html:Sr,tbody:Er});function Sr(e){let t=Y(e,-1);return!t||t.type!==`comment`}function Cr(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function wr(e){let t=Y(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&a(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Tr(e,t,n){let r=er(n,t),i=Y(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ar(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Er(e,t,n){let r=er(n,t),i=Y(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ar(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var X={name:[[`
|
|
5
5
|
\f\r &/=>`.split(``),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-web-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-web-DZNCKlBl.js","assets/rolldown-runtime-QTnfLwEv.js","assets/papaparse.min-BQRX_pWo.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,r as t,t as n}from"./rolldown-runtime-QTnfLwEv.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},k={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=k,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){e.memoizedState!==null&&pe(_e,e);var t=me.current,n=Yd(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),ap._currentValue=ce)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -40,7 +40,7 @@ Minimum version required to store current data is: `+c+`.
|
|
|
40
40
|
|
|
41
41
|
`);if(e.startsWith(`worker:`)){let r=e.slice(7),i=r.indexOf(`:`),a=i===-1?r:r.slice(0,i),o=i===-1?void 0:r.slice(i+1),s=t.workerViews[a],c=n.workerEdits[a];if(!s||!c)return``;if(o===`soul`)return c.soul;if(o===`override:executionBias`){let e=s.blocks.find(e=>e.overrideKey===`executionBias`);return c.executionBias===null?e?.defaultText??e?.text??``:c.executionBias}return o===`tools`||o===`skills`?``:s.blocks.map(e=>e.kind===`worker-soul`?c.soul:e.overrideKey===`executionBias`&&c.executionBias!==null?c.executionBias:e.text).filter(e=>e&&e.trim().length>0).join(`
|
|
42
42
|
|
|
43
|
-
`)}return``}function hR(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null),u=(0,d.useCallback)(async()=>{l(null);try{let e=await PL(`/solutions`);t(e.solutions),r(t=>t??e.solutions[0]?.slug??null)}catch(e){l(e instanceof Error?e.message:String(e))}},[]),f=(0,d.useCallback)(async e=>{s(!0),l(null);try{a((await PL(`/solutions/${encodeURIComponent(e)}`)).solution)}catch(e){l(e instanceof Error?e.message:String(e)),a(null)}finally{s(!1)}},[]);(0,d.useEffect)(()=>{u()},[u]),(0,d.useEffect)(()=>{n&&f(n)},[n,f]);let p=(0,d.useCallback)(async()=>{let e=window.prompt(`New solution slug (lowercase, digits, - or _):`,``);if(e){l(null);try{let t=window.prompt(`Display name:`,e)||e;await PL(`/solutions/extract`,{method:`POST`,body:JSON.stringify({slug:e,name:t})}),await u(),r(e)}catch(e){l(e instanceof Error?e.message:String(e))}}},[u]),m=(0,d.useCallback)(async e=>{if(window.confirm(`Delete solution "${e}"? This cannot be undone.`))try{await PL(`/solutions/${encodeURIComponent(e)}`,{method:`DELETE`}),r(null),a(null),await u()}catch(e){l(e instanceof Error?e.message:String(e))}},[u]);return(0,J.jsxs)(`div`,{className:`flex min-h-[70vh] flex-col gap-3`,children:[c?(0,J.jsxs)(`div`,{className:`rounded-md border border-danger-fg/40 bg-danger-fg/5 p-3 text-sm text-danger-fg`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,J.jsx)(SM,{className:`size-4`}),`Solution error`]}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-xs opacity-80`,children:c})]}):null,o?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,J.jsx)(q,{className:`size-4 animate-spin`}),` Loading solution…`]}):i?(0,J.jsx)(gR,{summaries:e,selectedSlug:n,onSelectSlug:r,onExtract:p,onRefresh:()=>void u(),detail:i,onDelete:m,onSaved:async()=>{await u(),n&&await f(n)}},i.spec.slug):(0,J.jsxs)(`div`,{className:`text-sm text-fg-muted`,children:[`No solution selected.`,` `,(0,J.jsx)(`button`,{type:`button`,onClick:()=>void p(),className:`underline`,children:`Extract one`}),` `,`from reality.`]})]})}function gR({summaries:e,selectedSlug:t,onSelectSlug:n,onExtract:r,onRefresh:i,detail:a,onDelete:o,onSaved:s}){let{spec:c,isCurrent:l}=a,u=zL(a,s,i),[f,p]=(0,d.useState)(`plugins`),[m,h]=(0,d.useState)(()=>new Set([`main`,`workers`]));(0,d.useEffect)(()=>{p(`plugins`),h(new Set([`main`,`workers`]))},[c.slug]);let g=(0,d.useMemo)(()=>WL(a),[a]),_=(0,d.useCallback)(e=>{g.has(e)&&h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[g]),v=u.diff?.entries.length??null,{Modal:y}=mF();return(0,J.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-lg border border-border-subtle bg-bg-base`,children:[u.activatePending?(0,J.jsx)(y,{isOpen:!0,title:`Activate solution`,size:`sm`,allowMaximize:!1,onClose:u.cancelActivate,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 p-1 text-sm text-fg-default`,children:[(0,J.jsxs)(`p`,{className:`text-fg-default`,children:[`Make `,(0,J.jsx)(`strong`,{children:c.name}),` the live solution? Its main-agent config, workers and plugin enable-set are written into the running system; the agent picks them up on its next turn. Any previously-active solution is superseded.`]}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:u.cancelActivate,className:`rounded border border-border-subtle bg-bg-elevated px-3 py-1.5 text-xs font-medium text-fg-default hover:bg-bg-raised`,children:`Cancel`}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.confirmActivate(),className:`inline-flex items-center gap-1 rounded bg-success-fg px-3 py-1.5 text-xs font-semibold text-bg-base hover:opacity-90`,children:[(0,J.jsx)(oE,{className:`size-3.5`}),` Activate`]})]})]})}):null,u.notice?(0,J.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2 text-xs ${u.notice.kind===`success`?`bg-success-fg/10 text-success-fg`:`bg-danger-fg/10 text-danger-fg`}`,children:[(0,J.jsx)(`span`,{className:`flex-1`,children:u.notice.text}),(0,J.jsx)(`button`,{type:`button`,onClick:u.clearNotice,className:`rounded px-1 hover:bg-bg-raised`,"aria-label":`Dismiss`,children:`✕`})]}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border-subtle bg-bg-elevated px-3 py-2`,children:[(0,J.jsx)(hy,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`select`,{value:t??``,onChange:e=>n(e.target.value),className:`rounded-md border border-border-subtle bg-bg-raised px-2 py-1 text-xs`,children:(e??[]).map(e=>(0,J.jsxs)(`option`,{value:e.slug,children:[e.isCurrent?`● `:e.isActive?`🚀 `:`📦 `,e.name,e.isCurrent?` (live mirror)`:e.isActive?` (active)`:``]},e.slug))}),l?(0,J.jsx)(`span`,{className:`rounded bg-info-fg/10 px-1.5 py-0.5 text-[10px] text-info-fg`,children:`live mirror · read-only`}):a.isActive?(0,J.jsx)(`span`,{className:`rounded bg-success-fg/15 px-1.5 py-0.5 text-[10px] font-medium text-success-fg`,children:`🚀 active (live)`}):null,v===null?null:v>0?(0,J.jsxs)(`span`,{className:`text-[11px] text-warning-fg`,children:[`⚠ differs from reality (`,v,` change`,v===1?``:`s`,`)`]}):(0,J.jsx)(`span`,{className:`text-[11px] text-success-fg`,children:`✓ matches reality`}),(0,J.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`rounded p-1 hover:bg-bg-raised`,title:`Refresh solutions`,children:(0,J.jsx)(GT,{className:`size-3.5`})}),(0,J.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 rounded border border-border-subtle px-2 py-1 text-xs hover:bg-bg-raised`,title:`Extract current reality into a new named solution`,children:[(0,J.jsx)(Gw,{className:`size-3.5`}),` Extract`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.runDiff(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded border border-border-subtle px-2 py-1 text-xs hover:bg-bg-raised disabled:opacity-50`,children:[(0,J.jsx)(zg,{className:`size-3.5`}),` Diff`]}),l?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.save(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded bg-fg-default px-2 py-1 text-xs font-medium text-bg-base hover:opacity-90 disabled:opacity-50`,children:[(0,J.jsx)(PE,{className:`size-3.5`}),` Save`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>u.requestActivate(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs font-semibold disabled:opacity-50 ${a.isActive?`border-success-fg bg-success-fg/25 text-success-fg`:`border-success-fg bg-success-fg/15 text-success-fg hover:bg-success-fg/25`}`,title:`Make this the live solution: write its config into the running system + mark it active. Takes effect on the next agent turn.`,children:[(0,J.jsx)(oE,{className:`size-3.5`}),` `,a.isActive?`Re-activate`:`Activate`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>o(c.slug),className:`inline-flex items-center gap-1 rounded border border-danger-fg/40 px-2 py-1 text-xs text-danger-fg hover:bg-danger-fg/5`,children:[(0,J.jsx)(pM,{className:`size-3.5`}),` Delete`]})]})]})]}),(0,J.jsxs)(`div`,{className:`grid min-h-0 grid-cols-1 md:grid-cols-[260px_1fr_300px]`,children:[(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto border-b border-border-subtle bg-bg-elevated md:border-b-0 md:border-r`,children:(0,J.jsx)(GL,{detail:a,edits:u,expanded:m,onToggleExpand:_,selected:f,onSelect:p})}),(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto bg-bg-base p-4 md:p-5`,children:(0,J.jsx)(YL,{selected:f,detail:a,edits:u,onSelect:p})}),(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto border-t border-border-subtle bg-bg-elevated md:border-l md:border-t-0`,children:(0,J.jsx)(dR,{selected:f,detail:a,edits:u})})]})]})}var _R=`/api/p/workforce-studio`;async function vR(){let e=await fetch(`${_R}/snapshot`,{credentials:`include`}),t=await e.json();if(!t.ok||!t.snapshot)throw Error(t.error||`HTTP ${e.status}`);return t.snapshot}function yR(){let e=document.createElement(`a`);e.href=`${_R}/snapshot/zip`,e.rel=`noopener`,e.click()}function bR(e){let[t,n]=(0,d.useState)(`reality`);return(0,J.jsxs)(`div`,{className:`flex h-full w-full flex-col gap-4 overflow-y-auto p-6`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border-subtle pb-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Workforce Studio`}),(0,J.jsxs)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:[`Design and inspect the agent system. The`,` `,(0,J.jsx)(`strong`,{children:`Solution`}),` view is your declarative design; the `,(0,J.jsx)(`strong`,{children:`Reality`}),` view is what's running right now.`]})]}),(0,J.jsx)(xR,{value:t,onChange:n})]}),t===`reality`?(0,J.jsx)(SR,{}):(0,J.jsx)(hR,{})]})}function xR({value:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex overflow-hidden rounded-md border border-border-subtle text-sm`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`solution`),className:e===`solution`?`bg-fg-default px-4 py-1.5 font-medium text-bg-base`:`bg-bg-base px-4 py-1.5 hover:bg-bg-raised`,children:`Solution`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`reality`),className:e===`reality`?`bg-fg-default px-4 py-1.5 font-medium text-bg-base`:`bg-bg-base px-4 py-1.5 hover:bg-bg-raised`,children:`Reality`})]})}function SR(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(!0),[i,a]=(0,d.useState)(null),o=(0,d.useCallback)(async()=>{r(!0),a(null);try{t(await vR())}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(!1)}},[]);return(0,d.useEffect)(()=>{o()},[o]),(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(CR,{snapshot:e,loading:n,onRefresh:()=>void o()}),i?(0,J.jsxs)(`div`,{className:`rounded-md border border-danger-fg/40 bg-danger-fg/5 p-4 text-sm text-danger-fg`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,J.jsx)(SM,{className:`size-4`}),`Failed to load snapshot`]}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-xs opacity-80`,children:i})]}):null,e?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(OR,{plugins:e.plugins}),(0,J.jsx)(AR,{main:e.main}),(0,J.jsx)(FR,{workers:e.workers})]}):n?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,J.jsx)(q,{className:`size-4 animate-spin`}),` Loading snapshot…`]}):null]})}function CR({snapshot:e,loading:t,onRefresh:n}){return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,J.jsx)(`div`,{children:e?(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-fg-muted`,children:[(0,J.jsxs)(wR,{children:[`tenant `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.tenantId})]}),(0,J.jsxs)(wR,{children:[`user `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.userId})]}),(0,J.jsxs)(wR,{children:[`v`,e.tianshuVersion]}),(0,J.jsxs)(wR,{children:[e.plugins.length,` plugins ·`,` `,e.main.tools.length,` tools ·`,` `,e.main.skills.length,` skills ·`,` `,e.workers.length,` workers`]})]}):null}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:n,disabled:t,className:`inline-flex items-center gap-1 rounded-md border border-border-subtle bg-bg-elevated px-3 py-1.5 text-sm hover:bg-bg-raised disabled:opacity-50`,children:[t?(0,J.jsx)(q,{className:`size-4 animate-spin`}):(0,J.jsx)(GT,{className:`size-4`}),`Refresh`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:yR,disabled:!e,className:`inline-flex items-center gap-1 rounded-md bg-fg-default px-3 py-1.5 text-sm font-medium text-bg-base hover:opacity-90 disabled:opacity-50`,children:[(0,J.jsx)(gp,{className:`size-4`}),`Download bundle`]})]})]})}function wR({children:e}){return(0,J.jsx)(`span`,{className:`rounded-md border border-border-subtle bg-bg-elevated px-2 py-0.5`,children:e})}function TR({origin:e}){let{label:t,className:n}=ER(e);return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,title:DR(e),children:t})}function ER(e){return e===`core`?{label:`core`,className:`bg-info-fg/10 text-info-fg`}:e===`builtin-plugin`?{label:`built-in`,className:`bg-success-fg/10 text-success-fg`}:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}function DR(e){return e===`core`?`Provided by the host (no plugin involved).`:e===`builtin-plugin`?`From a plugin shipped with this Tianshu install.`:`From a plugin installed per-tenant.`}function OR({plugins:e}){return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(SC,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Plugins`}),(0,J.jsxs)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:[e.length,` in this solution`]}),(0,J.jsx)(`span`,{className:`ml-1 text-[10px] text-fg-muted`,title:`Every plugin currently activated for this tenant. Tools, skills and prompt fragments come from these.`,children:`(active = contributing to the agent right now)`})]}),e.length===0?(0,J.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:`No plugins discovered for this tenant.`}):(0,J.jsx)(`ul`,{className:`divide-y divide-border-subtle`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`px-4 py-2 text-xs`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.displayName}),(0,J.jsx)(`code`,{className:`text-fg-muted`,children:e.id}),(0,J.jsxs)(`span`,{className:`text-fg-muted`,children:[`v`,e.version]}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(kR,{state:e.state,failureReason:e.failureReason}),(0,J.jsxs)(`span`,{className:`ml-auto text-fg-muted`,children:[(0,J.jsx)(OP,{className:`mr-1 inline size-3`}),e.toolCount,(0,J.jsx)(gs,{className:`ml-2 mr-1 inline size-3`}),e.skillCount]})]}),e.description?(0,J.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-muted`,children:e.description}):null]},e.id))})]})}function kR({state:e,failureReason:t}){return e===`active`?null:(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${e===`failed`?`bg-danger-fg/10 text-danger-fg`:`bg-fg-muted/10`}`,title:t??void 0,children:e})}function AR({main:e}){let[t,n]=(0,d.useState)(`develop`);return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(Es,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Main agent`}),(0,J.jsxs)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:[e.brandName,` · default model`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.defaultModelId??`—`})]}),(0,J.jsx)(jR,{value:t,onChange:n})]}),t===`develop`?(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,J.jsx)(MR,{blocks:e.blocks}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,J.jsx)(RR,{title:`Tools (${e.tools.length})`,initiallyOpen:!1,icon:(0,J.jsx)(OP,{className:`size-4`}),children:(0,J.jsx)(zR,{tools:e.tools})}),(0,J.jsx)(RR,{title:`Skills (${e.skills.length})`,initiallyOpen:!1,icon:(0,J.jsx)(gs,{className:`size-4`}),children:(0,J.jsx)(BR,{skills:e.skills})})]})]}):(0,J.jsxs)(`div`,{className:`p-4`,children:[(0,J.jsxs)(`div`,{className:`mb-2 text-xs text-fg-muted`,children:[`Rendered prompt the model would receive on its next turn (`,VR(e.systemPrompt.length),`).`]}),(0,J.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-md border border-border-subtle bg-bg-base p-3 font-mono text-[11px] leading-snug`,children:e.systemPrompt})]})]})}function jR({value:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`ml-auto inline-flex overflow-hidden rounded-md border border-border-subtle text-xs`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`develop`),className:e===`develop`?`bg-fg-default px-3 py-1 text-bg-base`:`bg-bg-base px-3 py-1 hover:bg-bg-raised`,children:`Blocks`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`rendered`),className:e===`rendered`?`bg-fg-default px-3 py-1 text-bg-base`:`bg-bg-base px-3 py-1 hover:bg-bg-raised`,children:`Rendered`})]})}function MR({blocks:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`No prompt blocks reported.`}):(0,J.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,t)=>(0,J.jsx)(NR,{block:e,index:t+1},`${e.kind}-${t}`))})}function NR({block:e,index:t}){let[n,r]=(0,d.useState)(!1);return(0,J.jsxs)(`li`,{className:`rounded-md border bg-bg-base ${e.editable?`border-border-subtle`:`border-border-subtle/60 border-dashed`}`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full flex-wrap items-center gap-2 px-3 py-2 text-left text-xs`,children:[n?(0,J.jsx)(Al,{className:`size-3.5 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-3.5 text-fg-muted`}),(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-muted`,children:[`#`,t]}),(0,J.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,J.jsx)(PR,{origin:e.origin}),(0,J.jsx)(`span`,{className:e.editable?`rounded bg-success-fg/10 px-1.5 py-0.5 text-[10px] font-medium text-success-fg`:`rounded bg-fg-muted/15 px-1.5 py-0.5 text-[10px] font-medium`,title:e.editable?`You can edit the underlying source.`:`Managed by the host or a plugin — not editable.`,children:e.editable?`editable`:`read-only`}),(0,J.jsx)(`span`,{className:`ml-auto text-[10px] text-fg-muted`,children:e.source})]}),n?(0,J.jsxs)(`div`,{className:`border-t border-border-subtle px-3 py-2`,children:[e.note?(0,J.jsx)(`div`,{className:`mb-2 text-[11px] text-fg-muted`,children:e.note}):null,(0,J.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-elevated p-2 font-mono text-[11px] leading-snug`,children:e.text})]}):null]})}function PR({origin:e}){let{label:t,className:n}={core:{label:`core`,className:`bg-info-fg/10 text-info-fg`},"builtin-plugin":{label:`built-in`,className:`bg-success-fg/10 text-success-fg`},"tenant-plugin":{label:`tenant plugin`,className:`bg-warning-fg/10 text-warning-fg`},host:{label:`host`,className:`bg-info-fg/10 text-info-fg`},workspace:{label:`workspace`,className:`bg-warning-fg/10 text-warning-fg`},tenant:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}[e];return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,children:t})}function FR({workers:e}){let[t,n]=(0,d.useState)(null),r=(0,d.useMemo)(()=>[...e].sort((e,t)=>e.slug.localeCompare(t.slug)),[e]);return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(yN,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Workers`}),(0,J.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:r.length})]}),r.length===0?(0,J.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:`No worker agents configured yet.`}):(0,J.jsx)(`ul`,{className:`divide-y divide-border-subtle`,children:r.map(e=>(0,J.jsx)(IR,{worker:e,open:t===e.slug,onToggle:()=>n(t=>t===e.slug?null:e.slug)},e.slug))})]})}function IR({worker:e,open:t,onToggle:n}){return(0,J.jsxs)(`li`,{className:`px-4 py-3`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full items-center gap-2 text-left`,children:[t?(0,J.jsx)(Al,{className:`size-4 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsx)(`code`,{className:`text-xs text-fg-muted`,children:e.slug}),(0,J.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`· `,e.kind]}),(0,J.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-muted`,children:[e.modelId?(0,J.jsx)(`code`,{className:`font-mono`,children:e.modelId}):(0,J.jsx)(`span`,{children:`default model`}),(0,J.jsx)(`span`,{className:e.enabled?`rounded bg-success-fg/10 px-1.5 py-0.5 text-success-fg`:`rounded bg-fg-muted/10 px-1.5 py-0.5`,children:e.enabled?`enabled`:`disabled`}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1.5 py-0.5`,children:e.source})]})]}),t?(0,J.jsx)(LR,{worker:e}):null]})}function LR({worker:e}){let[t,n]=(0,d.useState)(`develop`);return(0,J.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 pl-6`,children:[(0,J.jsxs)(`div`,{className:`flex items-center text-xs`,children:[(0,J.jsx)(`span`,{className:`text-fg-muted`,children:`System prompt`}),(0,J.jsx)(jR,{value:t,onChange:n})]}),t===`develop`?(0,J.jsx)(MR,{blocks:e.blocks}):(0,J.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border-subtle bg-bg-base p-3 font-mono text-[11px] leading-snug`,children:e.systemPrompt.trim()||`<empty>`}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(RR,{title:`Tools (${e.tools.length})`,initiallyOpen:!1,icon:(0,J.jsx)(OP,{className:`size-4`}),children:(0,J.jsx)(zR,{tools:e.tools})}),(0,J.jsx)(RR,{title:`Skills (${e.skills.length})`,initiallyOpen:!1,icon:(0,J.jsx)(gs,{className:`size-4`}),children:(0,J.jsx)(BR,{skills:e.skills})})]})]})}function RR({title:e,icon:t,initiallyOpen:n,children:r}){let[i,a]=(0,d.useState)(n);return(0,J.jsxs)(`div`,{className:`rounded-md border border-border-subtle bg-bg-base`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-medium`,children:[i?(0,J.jsx)(Al,{className:`size-3.5 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-3.5 text-fg-muted`}),t,(0,J.jsx)(`span`,{children:e})]}),i?(0,J.jsx)(`div`,{className:`border-t border-border-subtle p-2`,children:r}):null]})}function zR({tools:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`None`}):(0,J.jsx)(`ul`,{className:`max-h-72 space-y-1 overflow-auto text-xs`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`rounded border border-border-subtle bg-bg-elevated px-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px]`,children:e.name}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1 text-[10px]`,children:e.pluginId}),e.since?(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-muted`,children:[`since `,e.since]}):null]}),e.description?(0,J.jsx)(`div`,{className:`mt-0.5 text-[11px] text-fg-muted`,children:e.description}):null]},e.name))})}function BR({skills:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`None`}):(0,J.jsx)(`ul`,{className:`max-h-72 space-y-1 overflow-auto text-xs`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`rounded border border-border-subtle bg-bg-elevated px-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px]`,children:e.name}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1 text-[10px]`,children:e.pluginId}),e.scope?(0,J.jsxs)(`span`,{className:`rounded bg-info-fg/10 px-1 text-[10px] text-info-fg`,children:[e.scope,`-only`]}):null,(0,J.jsx)(`span`,{className:`ml-auto text-[10px] text-fg-muted`,children:VR(e.body.length)})]}),e.description?(0,J.jsx)(`div`,{className:`mt-0.5 text-[11px] text-fg-muted`,children:e.description}):null]},`${e.pluginId}/${e.name}`))})}function VR(e){if(e<1024)return`${e} B`;let t=e/1024;return t<100?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}var HR={components:{WorkforceStudioPage:bR}};HR.components;var UR=Object.assign({"../../../../plugins/files/manifest.json":XP,"../../../../plugins/microsandbox/manifest.json":ZP,"../../../../plugins/openshell/manifest.json":QP,"../../../../plugins/web-search/manifest.json":$P,"../../../../plugins/wechat/manifest.json":eF,"../../../../plugins/workboard/manifest.json":tF,"../../../../plugins/workforce-studio/manifest.json":nF}),WR=Object.assign({"../../../../plugins/files/dist/client.js":UF,"../../../../plugins/microsandbox/dist/client.js":uI,"../../../../plugins/wechat/dist/client.js":qI,"../../../../plugins/workboard/dist/client.js":ML,"../../../../plugins/workforce-studio/dist/client.js":HR}),GR=(()=>{let e={},t=/\/plugins\/([^/]+)\/manifest\.json$/,n=/\/plugins\/([^/]+)\/dist\/client\.js$/,r=new Map;for(let[e,t]of Object.entries(WR)){let i=n.exec(e);i&&r.set(i[1],t)}for(let[n,i]of Object.entries(UR)){let a=t.exec(n);if(!a)continue;let o=a[1],s=i?.client?.entry;if(!s)continue;let c=r.get(o);c&&(e[s]=c)}return e})();function KR(e,t){if(!e)return null;let n=GR[e];return n?n.components[t]??null:null}function qR({anchor:e,fallback:t}){let n=fr(e=>e.plugins);if(!n)return null;let r=[];for(let t of n){if(t.state!==`active`)continue;let n=t.contributes.sidebarSections??[];for(let i of n){if((i.after??``)!==e)continue;let n=t.clientEntry,a=KR(n,i.component);a&&r.push({pluginId:t.id,contribId:i.id,Component:a,order:i.order??100})}}if(r.sort((e,t)=>e.order-t.order),r.length===0)return(0,J.jsx)(J.Fragment,{children:t??null});let i={tenantId:``,userId:``,plugin:{id:``,version:``,displayName:``},isCollapsed:!1,onToggleCollapse:()=>{}};return(0,J.jsx)(J.Fragment,{children:r.map(({pluginId:e,contribId:t,Component:n})=>(0,J.jsx)(n,{...i,plugin:{id:e,version:``,displayName:e}},`${e}.${t}`))})}var JR=`tianshu.theme`;function YR(){try{let e=localStorage.getItem(JR);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function XR(e){try{localStorage.setItem(JR,e)}catch{}}function ZR(){return typeof window>`u`||!window.matchMedia?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}function QR(e){return e===`system`?ZR()?`dark`:`light`:e}var $R=tr((e,t)=>{let n=YR();return{mode:n,resolved:QR(n),setMode:n=>{XR(n),e({mode:n,resolved:QR(n)}),ez(t().resolved)}}});function ez(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function tz(){if(ez($R.getState().resolved),typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let{mode:t}=$R.getState();if(t!==`system`)return;let n=e.matches?`dark`:`light`;$R.setState({resolved:n}),ez(n)};e.addEventListener?e.addEventListener(`change`,t):e.addListener(t)}var nz=[{value:`light`,label:`Light`,Icon:IA},{value:`dark`,label:`Dark`,Icon:pS},{value:`system`,label:`System`,Icon:fS}];function rz({compact:e=!1,className:t=``}){let n=$R(e=>e.mode),r=$R(e=>e.setMode);return(0,J.jsx)(`div`,{className:`inline-flex rounded-md border p-0.5 text-[11px] ${t}`,style:{background:`var(--color-bg-elevated)`,borderColor:`var(--color-border-default)`,color:`var(--color-fg-muted)`},role:`group`,"aria-label":`Theme`,children:nz.map(({value:t,label:i,Icon:a})=>{let o=n===t;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(t),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors`,style:o?{background:`var(--color-accent)`,color:`var(--color-fg-on-accent)`}:void 0,title:i,"aria-pressed":o,children:[(0,J.jsx)(a,{size:12}),!e&&(0,J.jsx)(`span`,{children:i})]},t)})})}var iz=[`en`,`zh`],az={en:`English`,zh:`中文`},oz=`tianshu.locale`,sz={en:{"auth.signOut":`Sign out`,"admin.title":`Settings`,"lang.label":`Language`,"user.role.member":`member`,"user.role.admin":`admin`,"user.role.dev":`dev`,"user.theme":`Theme`},zh:{"auth.signOut":`退出登录`,"admin.title":`设置`,"lang.label":`语言`,"user.role.member":`成员`,"user.role.admin":`管理员`,"user.role.dev":`开发者`,"user.theme":`主题`}},cz=uz(),lz=new Set;function uz(){try{let e=window.localStorage.getItem(oz);if(e===`en`||e===`zh`)return e}catch{}return typeof navigator<`u`&&(navigator.language||``).toLowerCase().startsWith(`zh`)?`zh`:`en`}function dz(){return cz}function fz(){return iz}function pz(e){if(e!==cz){cz=e;try{window.localStorage.setItem(oz,e)}catch{}for(let e of lz)e()}}function mz(e){return lz.add(e),()=>lz.delete(e)}function hz(e){return sz[cz][e]??sz.en[e]??e}function gz(){return(0,d.useSyncExternalStore)(mz,dz,dz)}function _z(){return gz(),hz}function vz(){let e=A(e=>e.me)?.config.branding?.name??`Tianshu`;return(0,J.jsxs)(`aside`,{className:`flex h-full w-64 flex-shrink-0 flex-col border-r border-border-subtle bg-bg-elevated`,children:[(0,J.jsx)(`div`,{className:`flex h-12 items-center border-b border-border-subtle px-4`,children:(0,J.jsx)(`span`,{className:`text-lg font-semibold text-fg-default`,children:e})}),(0,J.jsxs)(`div`,{className:`space-y-1 px-2 pt-2`,children:[(0,J.jsxs)(`div`,{className:`flex cursor-pointer items-center gap-2 rounded-lg bg-bg-raised px-3 py-2 text-fg-default`,children:[(0,J.jsx)(Es,{size:14,className:`flex-shrink-0 text-link`}),(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:e})]}),(0,J.jsx)(`div`,{"data-testid":`sidebar-workers-anchor`,children:(0,J.jsx)(qR,{anchor:`workers`})})]}),(0,J.jsx)(`div`,{className:`mx-3 my-2 border-b border-border-subtle/50`}),(0,J.jsxs)(`nav`,{className:`flex-1 space-y-0.5 overflow-y-auto px-2`,children:[(0,J.jsx)(`div`,{className:`px-1 pb-1 pt-2 text-[10px] uppercase tracking-wider text-fg-fainter`,children:`Channels`}),(0,J.jsx)(bz,{}),(0,J.jsx)(qR,{anchor:`channels`}),(0,J.jsx)(`p`,{className:`px-2 pt-2 text-[10px] leading-relaxed text-fg-fainter`,children:`Sessions are managed by the agent, not the user (ADR-0001 §5).`})]}),(0,J.jsx)(yz,{})]})}function yz(){let e=A(e=>e.me),t=_z(),n=gz(),r=fz(),i=e?.userId??`…`,a=i.slice(0,1).toUpperCase(),o=`${t(e?.devTenant?`user.role.dev`:`user.role.member`)} · ${e?.tenantId??``}`,[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),f=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if(!s)return;let e=e=>{f.current&&(f.current.contains(e.target)||(c(!1),u(!1)))},t=e=>{e.key===`Escape`&&(c(!1),u(!1))};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[s]),(0,J.jsxs)(`div`,{className:`relative border-t border-border-subtle`,ref:f,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-haspopup":`menu`,"aria-expanded":s,title:i,className:`flex w-full items-center gap-2 px-3 py-2 hover:bg-bg-raised/60 transition-colors`,children:[(0,J.jsx)(`div`,{className:`flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-[10px] font-semibold text-white`,children:a}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,J.jsx)(`div`,{className:`truncate text-[11px] text-fg-muted`,children:i}),(0,J.jsx)(`div`,{className:`truncate text-[10px] text-fg-fainter`,children:o})]}),(0,J.jsx)(Al,{size:12,className:`text-fg-faint transition-transform ${s?`rotate-180`:``}`})]}),s&&(0,J.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full left-2 right-2 z-50 mb-1 rounded-md border border-border-default bg-bg-elevated py-1 text-[12px] shadow-xl`,children:[(0,J.jsxs)(`div`,{className:`border-b border-border-subtle px-3 py-2`,children:[(0,J.jsx)(`div`,{className:`truncate text-fg-default`,children:i}),(0,J.jsx)(`div`,{className:`truncate text-[10px] text-fg-fainter`,children:o})]}),(0,J.jsxs)(Mn,{to:`admin`,role:`menuitem`,onClick:()=>c(!1),className:`flex items-center gap-2 px-3 py-1.5 text-fg-default hover:bg-bg-raised`,children:[(0,J.jsx)(DD,{size:14,className:`text-fg-faint`}),(0,J.jsx)(`span`,{children:t(`admin.title`)})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>u(e=>!e),className:`flex w-full items-center gap-2 px-3 py-1.5 text-fg-default hover:bg-bg-raised`,children:[(0,J.jsx)(t_,{size:14,className:`text-fg-faint`}),(0,J.jsx)(`span`,{className:`flex-1 text-left`,children:t(`lang.label`)}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-faint`,children:az[n]}),(0,J.jsx)(Pl,{size:12,className:`text-fg-faint transition-transform ${l?`rotate-90`:``}`})]}),l&&(0,J.jsx)(`ul`,{role:`menu`,className:`border-y border-border-subtle bg-bg-base/60`,children:r.map(e=>{let t=e===n;return(0,J.jsxs)(`li`,{role:`menuitemradio`,"aria-checked":t,tabIndex:0,onClick:()=>{pz(e),u(!1)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),pz(e),u(!1))},className:`flex cursor-pointer items-center gap-2 py-1.5 pl-9 pr-3 outline-none ${t?`text-link`:`text-fg-muted hover:bg-bg-raised`}`,children:[(0,J.jsx)(`span`,{className:`flex-1`,children:az[e]}),t&&(0,J.jsx)(xl,{size:13,className:`text-link`})]},e)})}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-[12px] text-fg-muted`,children:[(0,J.jsx)(`span`,{children:t(`user.theme`)}),(0,J.jsx)(rz,{compact:!0})]})]})]})}function bz(){let e=A(e=>e.viewingSessionId),t=A(e=>e.selectSession),n=e===null;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(null),className:`flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors ${n?`bg-bg-hover text-fg-default border border-border-default`:`text-fg-muted hover:bg-bg-hover hover:text-fg-default border border-transparent`}`,children:[(0,J.jsx)(F_,{size:12,className:`flex-shrink-0`}),(0,J.jsx)(`span`,{className:`flex-1 truncate text-xs`,children:`webchat`}),n&&(0,J.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider text-fg-faint`,children:`active`})]})}function xz(e){let t=[];for(let n of e){if(n.state!==`active`)continue;let e=n.contributes.attachmentRenderers??[];for(let r of e)t.push({...r,pluginId:n.id,pluginVersion:n.version,pluginDisplayName:n.displayName,clientEntry:n.clientEntry})}return t.sort((e,t)=>{let n=e.order??100,r=t.order??100;if(n!==r)return n-r;let i=`${e.pluginId}.${e.id}`,a=`${t.pluginId}.${t.id}`;return i<a?-1:+(i>a)}),t}function Sz(e,t){let n=Cz(t).toLowerCase(),r=e.toLowerCase();if(r===`*/*`)return!0;let i=r.indexOf(`/`);if(i<=0)return!1;let a=r.slice(0,i),o=r.slice(i+1),s=n.indexOf(`/`);if(s<=0)return!1;let c=n.slice(0,s),l=n.slice(s+1);return a===c?o===`*`||o===l:!1}function Cz(e){let t=e.indexOf(`;`);return(t<0?e:e.slice(0,t)).trim()}function wz(e,t){for(let n of e)if(Sz(n.mimePattern,t))return n;return null}var Tz=1024,Ez=Tz*1024;function Dz(e){return e==null?``:e<Tz?`${e} B`:e<Ez?`${(e/Tz).toFixed(1)} KB`:`${(e/Ez).toFixed(1)} MB`}function Oz(e){return`/api/p/files/raw?path=${encodeURIComponent(e)}`}function kz(e){return{path:e.path,mimeType:e.mimeType,name:e.name,size:e.size}}function Az({attachments:e,align:t}){let n=A(e=>e.me),r=fr(e=>e.plugins);if(!e||e.length===0)return null;let i=r?xz(r):[],a=e.slice(0,8);return(0,J.jsx)(`div`,{className:`mt-1.5 flex max-w-full flex-wrap gap-1.5 ${t===`end`?`justify-end`:`justify-start`}`,children:a.map(e=>{let r=wz(i,e.mimeType);if(r&&n){let i=KR(r.clientEntry,r.component);if(i)return(0,J.jsx)(i,{tenantId:n.tenantId,userId:n.userId,plugin:{id:r.pluginId,version:r.pluginVersion,displayName:r.pluginDisplayName},attachment:kz(e),align:t,rawUrl:Oz},e.path)}return(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-elevated/60 px-2 py-1 text-xs text-fg-default`,title:e.path,children:[(0,J.jsx)(nh,{size:12,className:`text-fg-muted`}),(0,J.jsx)(`span`,{className:`max-w-[12rem] truncate`,children:e.name??e.path}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-faint`,children:Dz(e.size)})]},e.path)})})}function jz({m:e}){let t=e.role===`user`,{MarkdownBlock:n}=mF(),r=$R(e=>e.resolved===`dark`)?` prose-invert`:``,i=!t&&e.resolvedBlocks&&e.resolvedBlocks.length>0?e.resolvedBlocks:null,a=e.text.length>0,o=e.resolvedToolCalls??[],s=!t&&!a&&o.length===0&&!i;return(0,J.jsx)(`div`,{className:t?`flex justify-end`:`flex justify-start`,children:(0,J.jsxs)(`div`,{className:`flex max-w-[85%] flex-col ${t?`items-end`:`items-start`}`,children:[(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-fg-faint`,children:[t?(0,J.jsx)(vN,{size:11}):(0,J.jsx)(Es,{size:11,className:`text-link`}),(0,J.jsx)(`span`,{children:t?`you`:`tianshu`})]}),i?(0,J.jsx)(`div`,{className:`flex flex-col gap-1.5 ${t?`items-end`:`items-start`}`,children:i.map((e,i)=>Mz(e,i,t,n,r))}):(0,J.jsxs)(J.Fragment,{children:[a?(0,J.jsx)(`div`,{className:`prose${r} prose-sm max-w-none rounded-lg border px-3.5 py-2.5 text-[14px] leading-relaxed `+(t?`border-brand-400/30 bg-brand-500/10 text-fg-default`:`border-border-subtle bg-bg-elevated/60 text-fg-default`),children:(0,J.jsx)(n,{noProse:!0,children:e.text})}):s?(0,J.jsx)(`div`,{className:`rounded-lg border border-border-subtle bg-bg-elevated/60 px-3.5 py-2.5`,children:(0,J.jsx)(Bz,{})}):null,o.length>0&&(0,J.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-1 ${t?`items-end`:`items-start`}`,children:o.map(e=>(0,J.jsx)(Iz,{call:e},e.id))})]}),t&&e.attachments&&e.attachments.length>0&&(0,J.jsx)(Az,{attachments:e.attachments,align:`end`}),!t&&(e.meta||e.createdAt)&&(0,J.jsx)(Nz,{meta:e.meta,createdAt:e.createdAt,align:`start`})]})})}function Mz(e,t,n,r,i){return e.kind===`text`?e.text.length===0?null:(0,J.jsx)(`div`,{className:`prose${i} prose-sm max-w-none rounded-lg border px-3.5 py-2.5 text-[14px] leading-relaxed `+(n?`border-brand-400/30 bg-brand-500/10 text-fg-default`:`border-border-subtle bg-bg-elevated/60 text-fg-default`),children:(0,J.jsx)(r,{noProse:!0,children:e.text})},`t${t}`):(0,J.jsx)(Iz,{call:e},`c${t}-${e.id}`)}function Nz({meta:e,createdAt:t,align:n}){let r=[];if(t&&r.push(Pz(t)),e?.model&&r.push(e.model),e?.usage){let{input:t,output:n,totalTokens:i}=e.usage;if(r.push(`↓${Fz(t)} ↑${Fz(n)}`),e.contextWindow&&e.contextWindow>0){let t=Math.round(i/e.contextWindow*100);r.push(`${t}% ctx`)}}return r.length===0?null:(0,J.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-[10px] text-fg-fainter ${n===`end`?`justify-end`:`justify-start`}`,children:r.map((e,t)=>(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t>0&&(0,J.jsx)(`span`,{className:`text-fg-fainter`,children:`·`}),e]},t))})}function Pz(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,`0`)}:${t.getMinutes().toString().padStart(2,`0`)}`}function Fz(e){return e>=1e6?(e/1e6).toFixed(1)+`m`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}function Iz({call:e}){let[t,n]=(0,d.useState)(!1),r=!e.result,i=!!e.result&&!e.result.ok,a=e.result;return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>!r&&n(e=>!e),className:`flex select-none items-center gap-1.5 py-0.5 text-xs transition-colors `+(r?`cursor-default text-fg-faint`:`cursor-pointer text-fg-faint hover:text-fg-muted`),children:[r?(0,J.jsx)(q,{size:11,className:`animate-spin text-warning`}):i?(0,J.jsx)(Mu,{size:11,className:`text-rose-400/70`}):(0,J.jsx)(Ql,{size:11,className:`text-emerald-500/60`}),(0,J.jsx)(`code`,{className:`font-mono text-[12px] text-link`,children:e.name}),(0,J.jsx)(`span`,{className:`font-mono text-[11px] text-fg-fainter`,children:Lz(e.arguments)}),r?(0,J.jsx)(`span`,{className:`text-[11px] text-fg-fainter`,children:`running…`}):t?(0,J.jsx)(Al,{size:11,className:`text-fg-fainter`}):(0,J.jsx)(Pl,{size:11,className:`text-fg-fainter`})]}),t&&a&&(0,J.jsx)(`pre`,{className:`mt-1 max-h-64 max-w-2xl overflow-auto whitespace-pre-wrap break-all rounded-md border px-3 py-2 text-[11px] `+(i?`border-rose-700/40 bg-rose-950/30 text-danger`:`border-border-subtle/60 bg-bg-elevated/60 text-fg-muted`),children:zz(a.text,4e3)})]})}function Lz(e){let t=Object.keys(e);return t.length===0?`()`:t.slice(0,3).map(t=>`${t}=${Rz(e[t])}`).join(` `)}function Rz(e){return typeof e==`string`?e.length>40?`"${e.slice(0,37)}…"`:`"${e}"`:typeof e==`number`||typeof e==`boolean`||e==null?String(e):JSON.stringify(e).slice(0,40)}function zz(e,t){return e.length<=t?e:e.slice(0,t-1)+`
|
|
43
|
+
`)}return``}function hR(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null),u=(0,d.useCallback)(async()=>{l(null);try{let e=await PL(`/solutions`);t(e.solutions),r(t=>t??e.solutions[0]?.slug??null)}catch(e){l(e instanceof Error?e.message:String(e))}},[]),f=(0,d.useCallback)(async e=>{s(!0),l(null);try{a((await PL(`/solutions/${encodeURIComponent(e)}`)).solution)}catch(e){l(e instanceof Error?e.message:String(e)),a(null)}finally{s(!1)}},[]);(0,d.useEffect)(()=>{u()},[u]),(0,d.useEffect)(()=>{n&&f(n)},[n,f]);let p=(0,d.useCallback)(async()=>{let e=window.prompt(`New solution slug (lowercase, digits, - or _):`,``);if(e){l(null);try{let t=window.prompt(`Display name:`,e)||e;await PL(`/solutions/extract`,{method:`POST`,body:JSON.stringify({slug:e,name:t})}),await u(),r(e)}catch(e){l(e instanceof Error?e.message:String(e))}}},[u]),m=(0,d.useCallback)(async e=>{if(window.confirm(`Delete solution "${e}"? This cannot be undone.`))try{await PL(`/solutions/${encodeURIComponent(e)}`,{method:`DELETE`}),r(null),a(null),await u()}catch(e){l(e instanceof Error?e.message:String(e))}},[u]);return(0,J.jsxs)(`div`,{className:`flex min-h-[70vh] flex-col gap-3`,children:[c?(0,J.jsxs)(`div`,{className:`rounded-md border border-danger-fg/40 bg-danger-fg/5 p-3 text-sm text-danger-fg`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,J.jsx)(SM,{className:`size-4`}),`Solution error`]}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-xs opacity-80`,children:c})]}):null,o?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,J.jsx)(q,{className:`size-4 animate-spin`}),` Loading solution…`]}):i?(0,J.jsx)(gR,{summaries:e,selectedSlug:n,onSelectSlug:r,onExtract:p,onRefresh:()=>void u(),detail:i,onDelete:m,onSaved:async()=>{await u(),n&&await f(n)}},i.spec.slug):(0,J.jsxs)(`div`,{className:`text-sm text-fg-muted`,children:[`No solution selected.`,` `,(0,J.jsx)(`button`,{type:`button`,onClick:()=>void p(),className:`underline`,children:`Extract one`}),` `,`from reality.`]})]})}function gR({summaries:e,selectedSlug:t,onSelectSlug:n,onExtract:r,onRefresh:i,detail:a,onDelete:o,onSaved:s}){let{spec:c,isCurrent:l}=a,u=zL(a,s,i),[f,p]=(0,d.useState)(`plugins`),[m,h]=(0,d.useState)(()=>new Set([`main`,`workers`]));(0,d.useEffect)(()=>{p(`plugins`),h(new Set([`main`,`workers`]))},[c.slug]);let g=(0,d.useMemo)(()=>WL(a),[a]),_=(0,d.useCallback)(e=>{g.has(e)&&h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[g]),v=u.diff?.entries.length??null,{Modal:y}=mF();return(0,J.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-lg border border-border-subtle bg-bg-base`,children:[u.activatePending?(0,J.jsx)(y,{isOpen:!0,title:`Activate solution`,size:`sm`,allowMaximize:!1,onClose:u.cancelActivate,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 p-1 text-sm text-fg-default`,children:[(0,J.jsxs)(`p`,{className:`text-fg-default`,children:[`Make `,(0,J.jsx)(`strong`,{children:c.name}),` the live solution? Its main-agent config, workers and plugin enable-set are written into the running system; the agent picks them up on its next turn. Any previously-active solution is superseded.`]}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:u.cancelActivate,className:`rounded border border-border-subtle bg-bg-elevated px-3 py-1.5 text-xs font-medium text-fg-default hover:bg-bg-raised`,children:`Cancel`}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.confirmActivate(),className:`inline-flex items-center gap-1 rounded bg-success-fg px-3 py-1.5 text-xs font-semibold text-bg-base hover:opacity-90`,children:[(0,J.jsx)(oE,{className:`size-3.5`}),` Activate`]})]})]})}):null,u.notice?(0,J.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2 text-xs ${u.notice.kind===`success`?`bg-success-fg/10 text-success-fg`:`bg-danger-fg/10 text-danger-fg`}`,children:[(0,J.jsx)(`span`,{className:`flex-1`,children:u.notice.text}),(0,J.jsx)(`button`,{type:`button`,onClick:u.clearNotice,className:`rounded px-1 hover:bg-bg-raised`,"aria-label":`Dismiss`,children:`✕`})]}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border-subtle bg-bg-elevated px-3 py-2`,children:[(0,J.jsx)(hy,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`select`,{value:t??``,onChange:e=>n(e.target.value),className:`rounded-md border border-border-subtle bg-bg-raised px-2 py-1 text-xs`,children:(e??[]).map(e=>(0,J.jsxs)(`option`,{value:e.slug,children:[e.isCurrent?`● `:e.isActive?`🚀 `:`📦 `,e.name,e.isCurrent?` (live mirror)`:e.isActive?` (active)`:``]},e.slug))}),l?(0,J.jsx)(`span`,{className:`rounded bg-info-fg/10 px-1.5 py-0.5 text-[10px] text-info-fg`,children:`live mirror · read-only`}):a.isActive?(0,J.jsx)(`span`,{className:`rounded bg-success-fg/15 px-1.5 py-0.5 text-[10px] font-medium text-success-fg`,children:`🚀 active (live)`}):null,v===null?null:v>0?(0,J.jsxs)(`span`,{className:`text-[11px] text-warning-fg`,children:[`⚠ differs from reality (`,v,` change`,v===1?``:`s`,`)`]}):(0,J.jsx)(`span`,{className:`text-[11px] text-success-fg`,children:`✓ matches reality`}),(0,J.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`rounded p-1 hover:bg-bg-raised`,title:`Refresh solutions`,children:(0,J.jsx)(GT,{className:`size-3.5`})}),(0,J.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 rounded border border-border-subtle px-2 py-1 text-xs hover:bg-bg-raised`,title:`Extract current reality into a new named solution`,children:[(0,J.jsx)(Gw,{className:`size-3.5`}),` Extract`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.runDiff(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded border border-border-subtle px-2 py-1 text-xs hover:bg-bg-raised disabled:opacity-50`,children:[(0,J.jsx)(zg,{className:`size-3.5`}),` Diff`]}),l?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void u.save(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded bg-fg-default px-2 py-1 text-xs font-medium text-bg-base hover:opacity-90 disabled:opacity-50`,children:[(0,J.jsx)(PE,{className:`size-3.5`}),` Save`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>u.requestActivate(),disabled:u.busy,className:`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs font-semibold disabled:opacity-50 ${a.isActive?`border-success-fg bg-success-fg/25 text-success-fg`:`border-success-fg bg-success-fg/15 text-success-fg hover:bg-success-fg/25`}`,title:`Make this the live solution: write its config into the running system + mark it active. Takes effect on the next agent turn.`,children:[(0,J.jsx)(oE,{className:`size-3.5`}),` `,a.isActive?`Re-activate`:`Activate`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>o(c.slug),className:`inline-flex items-center gap-1 rounded border border-danger-fg/40 px-2 py-1 text-xs text-danger-fg hover:bg-danger-fg/5`,children:[(0,J.jsx)(pM,{className:`size-3.5`}),` Delete`]})]})]})]}),(0,J.jsxs)(`div`,{className:`grid min-h-0 grid-cols-1 md:grid-cols-[260px_1fr_300px]`,children:[(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto border-b border-border-subtle bg-bg-elevated md:border-b-0 md:border-r`,children:(0,J.jsx)(GL,{detail:a,edits:u,expanded:m,onToggleExpand:_,selected:f,onSelect:p})}),(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto bg-bg-base p-4 md:p-5`,children:(0,J.jsx)(YL,{selected:f,detail:a,edits:u,onSelect:p})}),(0,J.jsx)(`div`,{className:`max-h-[72vh] overflow-y-auto border-t border-border-subtle bg-bg-elevated md:border-l md:border-t-0`,children:(0,J.jsx)(dR,{selected:f,detail:a,edits:u})})]})]})}var _R=`/api/p/workforce-studio`;async function vR(){let e=await fetch(`${_R}/snapshot`,{credentials:`include`}),t=await e.json();if(!t.ok||!t.snapshot)throw Error(t.error||`HTTP ${e.status}`);return t.snapshot}function yR(){let e=document.createElement(`a`);e.href=`${_R}/snapshot/zip`,e.rel=`noopener`,e.click()}function bR(e){let[t,n]=(0,d.useState)(`reality`);return(0,J.jsxs)(`div`,{className:`flex h-full w-full flex-col gap-4 overflow-y-auto p-6`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border-subtle pb-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Workforce Studio`}),(0,J.jsxs)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:[`Design and inspect the agent system. The`,` `,(0,J.jsx)(`strong`,{children:`Solution`}),` view is your declarative design; the `,(0,J.jsx)(`strong`,{children:`Reality`}),` view is what's running right now.`]})]}),(0,J.jsx)(xR,{value:t,onChange:n})]}),t===`reality`?(0,J.jsx)(SR,{}):(0,J.jsx)(hR,{})]})}function xR({value:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex overflow-hidden rounded-md border border-border-subtle text-sm`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`solution`),className:e===`solution`?`bg-fg-default px-4 py-1.5 font-medium text-bg-base`:`bg-bg-base px-4 py-1.5 hover:bg-bg-raised`,children:`Solution`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`reality`),className:e===`reality`?`bg-fg-default px-4 py-1.5 font-medium text-bg-base`:`bg-bg-base px-4 py-1.5 hover:bg-bg-raised`,children:`Reality`})]})}function SR(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(!0),[i,a]=(0,d.useState)(null),o=(0,d.useCallback)(async()=>{r(!0),a(null);try{t(await vR())}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(!1)}},[]);return(0,d.useEffect)(()=>{o()},[o]),(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(CR,{snapshot:e,loading:n,onRefresh:()=>void o()}),i?(0,J.jsxs)(`div`,{className:`rounded-md border border-danger-fg/40 bg-danger-fg/5 p-4 text-sm text-danger-fg`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,J.jsx)(SM,{className:`size-4`}),`Failed to load snapshot`]}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-xs opacity-80`,children:i})]}):null,e?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(OR,{plugins:e.plugins}),(0,J.jsx)(AR,{main:e.main}),(0,J.jsx)(FR,{workers:e.workers})]}):n?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,J.jsx)(q,{className:`size-4 animate-spin`}),` Loading snapshot…`]}):null]})}function CR({snapshot:e,loading:t,onRefresh:n}){return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,J.jsx)(`div`,{children:e?(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-fg-muted`,children:[(0,J.jsxs)(wR,{children:[`tenant `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.tenantId})]}),(0,J.jsxs)(wR,{children:[`user `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.userId})]}),(0,J.jsxs)(wR,{children:[`v`,e.tianshuVersion]}),(0,J.jsxs)(wR,{children:[e.plugins.length,` plugins ·`,` `,e.main.tools.length,` tools ·`,` `,e.main.skills.length,` skills ·`,` `,e.workers.length,` workers`]})]}):null}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:n,disabled:t,className:`inline-flex items-center gap-1 rounded-md border border-border-subtle bg-bg-elevated px-3 py-1.5 text-sm hover:bg-bg-raised disabled:opacity-50`,children:[t?(0,J.jsx)(q,{className:`size-4 animate-spin`}):(0,J.jsx)(GT,{className:`size-4`}),`Refresh`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:yR,disabled:!e,className:`inline-flex items-center gap-1 rounded-md bg-fg-default px-3 py-1.5 text-sm font-medium text-bg-base hover:opacity-90 disabled:opacity-50`,children:[(0,J.jsx)(gp,{className:`size-4`}),`Download bundle`]})]})]})}function wR({children:e}){return(0,J.jsx)(`span`,{className:`rounded-md border border-border-subtle bg-bg-elevated px-2 py-0.5`,children:e})}function TR({origin:e}){let{label:t,className:n}=ER(e);return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,title:DR(e),children:t})}function ER(e){return e===`core`?{label:`core`,className:`bg-info-fg/10 text-info-fg`}:e===`builtin-plugin`?{label:`built-in`,className:`bg-success-fg/10 text-success-fg`}:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}function DR(e){return e===`core`?`Provided by the host (no plugin involved).`:e===`builtin-plugin`?`From a plugin shipped with this Tianshu install.`:`From a plugin installed per-tenant.`}function OR({plugins:e}){return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(SC,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Plugins`}),(0,J.jsxs)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:[e.length,` in this solution`]}),(0,J.jsx)(`span`,{className:`ml-1 text-[10px] text-fg-muted`,title:`Every plugin currently activated for this tenant. Tools, skills and prompt fragments come from these.`,children:`(active = contributing to the agent right now)`})]}),e.length===0?(0,J.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:`No plugins discovered for this tenant.`}):(0,J.jsx)(`ul`,{className:`divide-y divide-border-subtle`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`px-4 py-2 text-xs`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.displayName}),(0,J.jsx)(`code`,{className:`text-fg-muted`,children:e.id}),(0,J.jsxs)(`span`,{className:`text-fg-muted`,children:[`v`,e.version]}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(kR,{state:e.state,failureReason:e.failureReason}),(0,J.jsxs)(`span`,{className:`ml-auto text-fg-muted`,children:[(0,J.jsx)(OP,{className:`mr-1 inline size-3`}),e.toolCount,(0,J.jsx)(gs,{className:`ml-2 mr-1 inline size-3`}),e.skillCount]})]}),e.description?(0,J.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-muted`,children:e.description}):null]},e.id))})]})}function kR({state:e,failureReason:t}){return e===`active`?null:(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${e===`failed`?`bg-danger-fg/10 text-danger-fg`:`bg-fg-muted/10`}`,title:t??void 0,children:e})}function AR({main:e}){let[t,n]=(0,d.useState)(`develop`);return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(Es,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Main agent`}),(0,J.jsxs)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:[e.brandName,` · default model`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:e.defaultModelId??`—`})]}),(0,J.jsx)(jR,{value:t,onChange:n})]}),t===`develop`?(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,J.jsx)(MR,{blocks:e.blocks}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,J.jsx)(RR,{title:`Tools (${e.tools.length})`,initiallyOpen:!1,icon:(0,J.jsx)(OP,{className:`size-4`}),children:(0,J.jsx)(zR,{tools:e.tools})}),(0,J.jsx)(RR,{title:`Skills (${e.skills.length})`,initiallyOpen:!1,icon:(0,J.jsx)(gs,{className:`size-4`}),children:(0,J.jsx)(BR,{skills:e.skills})})]})]}):(0,J.jsxs)(`div`,{className:`p-4`,children:[(0,J.jsxs)(`div`,{className:`mb-2 text-xs text-fg-muted`,children:[`Rendered prompt the model would receive on its next turn (`,VR(e.systemPrompt.length),`).`]}),(0,J.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-md border border-border-subtle bg-bg-base p-3 font-mono text-[11px] leading-snug`,children:e.systemPrompt})]})]})}function jR({value:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`ml-auto inline-flex overflow-hidden rounded-md border border-border-subtle text-xs`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`develop`),className:e===`develop`?`bg-fg-default px-3 py-1 text-bg-base`:`bg-bg-base px-3 py-1 hover:bg-bg-raised`,children:`Blocks`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(`rendered`),className:e===`rendered`?`bg-fg-default px-3 py-1 text-bg-base`:`bg-bg-base px-3 py-1 hover:bg-bg-raised`,children:`Rendered`})]})}function MR({blocks:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`No prompt blocks reported.`}):(0,J.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,t)=>(0,J.jsx)(NR,{block:e,index:t+1},`${e.kind}-${t}`))})}function NR({block:e,index:t}){let[n,r]=(0,d.useState)(!1);return(0,J.jsxs)(`li`,{className:`rounded-md border bg-bg-base ${e.editable?`border-border-subtle`:`border-border-subtle/60 border-dashed`}`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full flex-wrap items-center gap-2 px-3 py-2 text-left text-xs`,children:[n?(0,J.jsx)(Al,{className:`size-3.5 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-3.5 text-fg-muted`}),(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-muted`,children:[`#`,t]}),(0,J.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,J.jsx)(PR,{origin:e.origin}),(0,J.jsx)(`span`,{className:e.editable?`rounded bg-success-fg/10 px-1.5 py-0.5 text-[10px] font-medium text-success-fg`:`rounded bg-fg-muted/15 px-1.5 py-0.5 text-[10px] font-medium`,title:e.editable?`You can edit the underlying source.`:`Managed by the host or a plugin — not editable.`,children:e.editable?`editable`:`read-only`}),(0,J.jsx)(`span`,{className:`ml-auto text-[10px] text-fg-muted`,children:e.source})]}),n?(0,J.jsxs)(`div`,{className:`border-t border-border-subtle px-3 py-2`,children:[e.note?(0,J.jsx)(`div`,{className:`mb-2 text-[11px] text-fg-muted`,children:e.note}):null,(0,J.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-elevated p-2 font-mono text-[11px] leading-snug`,children:e.text})]}):null]})}function PR({origin:e}){let{label:t,className:n}={core:{label:`core`,className:`bg-info-fg/10 text-info-fg`},"builtin-plugin":{label:`built-in`,className:`bg-success-fg/10 text-success-fg`},"tenant-plugin":{label:`tenant plugin`,className:`bg-warning-fg/10 text-warning-fg`},host:{label:`host`,className:`bg-info-fg/10 text-info-fg`},workspace:{label:`workspace`,className:`bg-warning-fg/10 text-warning-fg`},tenant:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}[e];return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,children:t})}function FR({workers:e}){let[t,n]=(0,d.useState)(null),r=(0,d.useMemo)(()=>[...e].sort((e,t)=>e.slug.localeCompare(t.slug)),[e]);return(0,J.jsxs)(`section`,{className:`rounded-lg border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(yN,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Workers`}),(0,J.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:r.length})]}),r.length===0?(0,J.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:`No worker agents configured yet.`}):(0,J.jsx)(`ul`,{className:`divide-y divide-border-subtle`,children:r.map(e=>(0,J.jsx)(IR,{worker:e,open:t===e.slug,onToggle:()=>n(t=>t===e.slug?null:e.slug)},e.slug))})]})}function IR({worker:e,open:t,onToggle:n}){return(0,J.jsxs)(`li`,{className:`px-4 py-3`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full items-center gap-2 text-left`,children:[t?(0,J.jsx)(Al,{className:`size-4 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-4 text-fg-muted`}),(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsx)(`code`,{className:`text-xs text-fg-muted`,children:e.slug}),(0,J.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`· `,e.kind]}),(0,J.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-muted`,children:[e.modelId?(0,J.jsx)(`code`,{className:`font-mono`,children:e.modelId}):(0,J.jsx)(`span`,{children:`default model`}),(0,J.jsx)(`span`,{className:e.enabled?`rounded bg-success-fg/10 px-1.5 py-0.5 text-success-fg`:`rounded bg-fg-muted/10 px-1.5 py-0.5`,children:e.enabled?`enabled`:`disabled`}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1.5 py-0.5`,children:e.source})]})]}),t?(0,J.jsx)(LR,{worker:e}):null]})}function LR({worker:e}){let[t,n]=(0,d.useState)(`develop`);return(0,J.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 pl-6`,children:[(0,J.jsxs)(`div`,{className:`flex items-center text-xs`,children:[(0,J.jsx)(`span`,{className:`text-fg-muted`,children:`System prompt`}),(0,J.jsx)(jR,{value:t,onChange:n})]}),t===`develop`?(0,J.jsx)(MR,{blocks:e.blocks}):(0,J.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border-subtle bg-bg-base p-3 font-mono text-[11px] leading-snug`,children:e.systemPrompt.trim()||`<empty>`}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(RR,{title:`Tools (${e.tools.length})`,initiallyOpen:!1,icon:(0,J.jsx)(OP,{className:`size-4`}),children:(0,J.jsx)(zR,{tools:e.tools})}),(0,J.jsx)(RR,{title:`Skills (${e.skills.length})`,initiallyOpen:!1,icon:(0,J.jsx)(gs,{className:`size-4`}),children:(0,J.jsx)(BR,{skills:e.skills})})]})]})}function RR({title:e,icon:t,initiallyOpen:n,children:r}){let[i,a]=(0,d.useState)(n);return(0,J.jsxs)(`div`,{className:`rounded-md border border-border-subtle bg-bg-base`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-medium`,children:[i?(0,J.jsx)(Al,{className:`size-3.5 text-fg-muted`}):(0,J.jsx)(Pl,{className:`size-3.5 text-fg-muted`}),t,(0,J.jsx)(`span`,{children:e})]}),i?(0,J.jsx)(`div`,{className:`border-t border-border-subtle p-2`,children:r}):null]})}function zR({tools:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`None`}):(0,J.jsx)(`ul`,{className:`max-h-72 space-y-1 overflow-auto text-xs`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`rounded border border-border-subtle bg-bg-elevated px-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px]`,children:e.name}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1 text-[10px]`,children:e.pluginId}),e.since?(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-muted`,children:[`since `,e.since]}):null]}),e.description?(0,J.jsx)(`div`,{className:`mt-0.5 text-[11px] text-fg-muted`,children:e.description}):null]},e.name))})}function BR({skills:e}){return e.length===0?(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`None`}):(0,J.jsx)(`ul`,{className:`max-h-72 space-y-1 overflow-auto text-xs`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`rounded border border-border-subtle bg-bg-elevated px-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px]`,children:e.name}),(0,J.jsx)(TR,{origin:e.origin}),(0,J.jsx)(`span`,{className:`rounded bg-fg-muted/10 px-1 text-[10px]`,children:e.pluginId}),e.scope?(0,J.jsxs)(`span`,{className:`rounded bg-info-fg/10 px-1 text-[10px] text-info-fg`,children:[e.scope,`-only`]}):null,(0,J.jsx)(`span`,{className:`ml-auto text-[10px] text-fg-muted`,children:VR(e.body.length)})]}),e.description?(0,J.jsx)(`div`,{className:`mt-0.5 text-[11px] text-fg-muted`,children:e.description}):null]},`${e.pluginId}/${e.name}`))})}function VR(e){if(e<1024)return`${e} B`;let t=e/1024;return t<100?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}var HR={components:{WorkforceStudioPage:bR}};HR.components;var UR=Object.assign({"../../../../plugins/files/manifest.json":XP,"../../../../plugins/microsandbox/manifest.json":ZP,"../../../../plugins/openshell/manifest.json":QP,"../../../../plugins/web-search/manifest.json":$P,"../../../../plugins/wechat/manifest.json":eF,"../../../../plugins/workboard/manifest.json":tF,"../../../../plugins/workforce-studio/manifest.json":nF}),WR=Object.assign({"../../../../plugins/files/dist/client.js":UF,"../../../../plugins/microsandbox/dist/client.js":uI,"../../../../plugins/wechat/dist/client.js":qI,"../../../../plugins/workboard/dist/client.js":ML,"../../../../plugins/workforce-studio/dist/client.js":HR}),GR=(()=>{let e={},t=/\/plugins\/([^/]+)\/manifest\.json$/,n=/\/plugins\/([^/]+)\/dist\/client\.js$/,r=new Map;for(let[e,t]of Object.entries(WR)){let i=n.exec(e);i&&r.set(i[1],t)}for(let[n,i]of Object.entries(UR)){let a=t.exec(n);if(!a)continue;let o=a[1],s=i?.client?.entry;if(!s)continue;let c=r.get(o);c&&(e[s]=c)}return e})();function KR(e,t){if(!e)return null;let n=GR[e];return n?n.components[t]??null:null}function qR({anchor:e,fallback:t}){let n=fr(e=>e.plugins);if(!n)return null;let r=[];for(let t of n){if(t.state!==`active`)continue;let n=t.contributes.sidebarSections??[];for(let i of n){if((i.after??``)!==e)continue;let n=t.clientEntry,a=KR(n,i.component);a&&r.push({pluginId:t.id,contribId:i.id,Component:a,order:i.order??100})}}if(r.sort((e,t)=>e.order-t.order),r.length===0)return(0,J.jsx)(J.Fragment,{children:t??null});let i={tenantId:``,userId:``,plugin:{id:``,version:``,displayName:``},isCollapsed:!1,onToggleCollapse:()=>{}};return(0,J.jsx)(J.Fragment,{children:r.map(({pluginId:e,contribId:t,Component:n})=>(0,J.jsx)(n,{...i,plugin:{id:e,version:``,displayName:e}},`${e}.${t}`))})}var JR=`tianshu.theme`;function YR(){try{let e=localStorage.getItem(JR);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function XR(e){try{localStorage.setItem(JR,e)}catch{}}function ZR(){return typeof window>`u`||!window.matchMedia?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}function QR(e){return e===`system`?ZR()?`dark`:`light`:e}var $R=tr((e,t)=>{let n=YR();return{mode:n,resolved:QR(n),setMode:n=>{XR(n),e({mode:n,resolved:QR(n)}),ez(t().resolved)}}});function ez(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function tz(){if(ez($R.getState().resolved),typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let{mode:t}=$R.getState();if(t!==`system`)return;let n=e.matches?`dark`:`light`;$R.setState({resolved:n}),ez(n)};e.addEventListener?e.addEventListener(`change`,t):e.addListener(t)}var nz=[{value:`light`,label:`Light`,Icon:IA},{value:`dark`,label:`Dark`,Icon:pS},{value:`system`,label:`System`,Icon:fS}];function rz({compact:e=!1,className:t=``}){let n=$R(e=>e.mode),r=$R(e=>e.setMode);return(0,J.jsx)(`div`,{className:`inline-flex rounded-md border p-0.5 text-[11px] ${t}`,style:{background:`var(--color-bg-elevated)`,borderColor:`var(--color-border-default)`,color:`var(--color-fg-muted)`},role:`group`,"aria-label":`Theme`,children:nz.map(({value:t,label:i,Icon:a})=>{let o=n===t;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(t),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors`,style:o?{background:`var(--color-bg-hover)`,color:`var(--color-fg-default)`,boxShadow:`inset 0 0 0 1px var(--color-border-default)`}:void 0,title:i,"aria-pressed":o,children:[(0,J.jsx)(a,{size:12}),!e&&(0,J.jsx)(`span`,{children:i})]},t)})})}var iz=[`en`,`zh`],az={en:`English`,zh:`中文`},oz=`tianshu.locale`,sz={en:{"auth.signOut":`Sign out`,"admin.title":`Settings`,"lang.label":`Language`,"user.role.member":`member`,"user.role.admin":`admin`,"user.role.dev":`dev`,"user.theme":`Theme`},zh:{"auth.signOut":`退出登录`,"admin.title":`设置`,"lang.label":`语言`,"user.role.member":`成员`,"user.role.admin":`管理员`,"user.role.dev":`开发者`,"user.theme":`主题`}},cz=uz(),lz=new Set;function uz(){try{let e=window.localStorage.getItem(oz);if(e===`en`||e===`zh`)return e}catch{}return typeof navigator<`u`&&(navigator.language||``).toLowerCase().startsWith(`zh`)?`zh`:`en`}function dz(){return cz}function fz(){return iz}function pz(e){if(e!==cz){cz=e;try{window.localStorage.setItem(oz,e)}catch{}for(let e of lz)e()}}function mz(e){return lz.add(e),()=>lz.delete(e)}function hz(e){return sz[cz][e]??sz.en[e]??e}function gz(){return(0,d.useSyncExternalStore)(mz,dz,dz)}function _z(){return gz(),hz}function vz(){let e=A(e=>e.me)?.config.branding?.name??`Tianshu`;return(0,J.jsxs)(`aside`,{className:`flex h-full w-64 flex-shrink-0 flex-col border-r border-border-subtle bg-bg-elevated`,children:[(0,J.jsx)(`div`,{className:`flex h-12 items-center border-b border-border-subtle px-4`,children:(0,J.jsx)(`span`,{className:`text-lg font-semibold text-fg-default`,children:e})}),(0,J.jsxs)(`div`,{className:`space-y-1 px-2 pt-2`,children:[(0,J.jsxs)(`div`,{className:`flex cursor-pointer items-center gap-2 rounded-lg bg-bg-raised px-3 py-2 text-fg-default`,children:[(0,J.jsx)(Es,{size:14,className:`flex-shrink-0 text-link`}),(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:e})]}),(0,J.jsx)(`div`,{"data-testid":`sidebar-workers-anchor`,children:(0,J.jsx)(qR,{anchor:`workers`})})]}),(0,J.jsx)(`div`,{className:`mx-3 my-2 border-b border-border-subtle/50`}),(0,J.jsxs)(`nav`,{className:`flex-1 space-y-0.5 overflow-y-auto px-2`,children:[(0,J.jsx)(`div`,{className:`px-1 pb-1 pt-2 text-[10px] uppercase tracking-wider text-fg-fainter`,children:`Channels`}),(0,J.jsx)(bz,{}),(0,J.jsx)(qR,{anchor:`channels`}),(0,J.jsx)(`p`,{className:`px-2 pt-2 text-[10px] leading-relaxed text-fg-fainter`,children:`Sessions are managed by the agent, not the user (ADR-0001 §5).`})]}),(0,J.jsx)(yz,{})]})}function yz(){let e=A(e=>e.me),t=_z(),n=gz(),r=fz(),i=e?.userId??`…`,a=i.slice(0,1).toUpperCase(),o=`${t(e?.devTenant?`user.role.dev`:`user.role.member`)} · ${e?.tenantId??``}`,[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),f=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if(!s)return;let e=e=>{f.current&&(f.current.contains(e.target)||(c(!1),u(!1)))},t=e=>{e.key===`Escape`&&(c(!1),u(!1))};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[s]),(0,J.jsxs)(`div`,{className:`relative border-t border-border-subtle`,ref:f,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-haspopup":`menu`,"aria-expanded":s,title:i,className:`flex w-full items-center gap-2 px-3 py-2 hover:bg-bg-raised/60 transition-colors`,children:[(0,J.jsx)(`div`,{className:`flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-[10px] font-semibold text-white`,children:a}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,J.jsx)(`div`,{className:`truncate text-[11px] text-fg-muted`,children:i}),(0,J.jsx)(`div`,{className:`truncate text-[10px] text-fg-fainter`,children:o})]}),(0,J.jsx)(Al,{size:12,className:`text-fg-faint transition-transform ${s?`rotate-180`:``}`})]}),s&&(0,J.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full left-2 right-2 z-50 mb-1 rounded-md border border-border-default bg-bg-elevated py-1 text-[12px] shadow-xl`,children:[(0,J.jsxs)(`div`,{className:`border-b border-border-subtle px-3 py-2`,children:[(0,J.jsx)(`div`,{className:`truncate text-fg-default`,children:i}),(0,J.jsx)(`div`,{className:`truncate text-[10px] text-fg-fainter`,children:o})]}),(0,J.jsxs)(Mn,{to:`admin`,role:`menuitem`,onClick:()=>c(!1),className:`flex items-center gap-2 px-3 py-1.5 text-fg-default hover:bg-bg-raised`,children:[(0,J.jsx)(DD,{size:14,className:`text-fg-faint`}),(0,J.jsx)(`span`,{children:t(`admin.title`)})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>u(e=>!e),className:`flex w-full items-center gap-2 px-3 py-1.5 text-fg-default hover:bg-bg-raised`,children:[(0,J.jsx)(t_,{size:14,className:`text-fg-faint`}),(0,J.jsx)(`span`,{className:`flex-1 text-left`,children:t(`lang.label`)}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-faint`,children:az[n]}),(0,J.jsx)(Pl,{size:12,className:`text-fg-faint transition-transform ${l?`rotate-90`:``}`})]}),l&&(0,J.jsx)(`ul`,{role:`menu`,className:`border-y border-border-subtle bg-bg-base/60`,children:r.map(e=>{let t=e===n;return(0,J.jsxs)(`li`,{role:`menuitemradio`,"aria-checked":t,tabIndex:0,onClick:()=>{pz(e),u(!1)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),pz(e),u(!1))},className:`flex cursor-pointer items-center gap-2 py-1.5 pl-9 pr-3 outline-none ${t?`text-link`:`text-fg-muted hover:bg-bg-raised`}`,children:[(0,J.jsx)(`span`,{className:`flex-1`,children:az[e]}),t&&(0,J.jsx)(xl,{size:13,className:`text-link`})]},e)})}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-[12px] text-fg-muted`,children:[(0,J.jsx)(`span`,{children:t(`user.theme`)}),(0,J.jsx)(rz,{compact:!0})]})]})]})}function bz(){let e=A(e=>e.viewingSessionId),t=A(e=>e.selectSession),n=e===null;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(null),className:`flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors ${n?`bg-bg-hover text-fg-default border border-border-default`:`text-fg-muted hover:bg-bg-hover hover:text-fg-default border border-transparent`}`,children:[(0,J.jsx)(F_,{size:12,className:`flex-shrink-0`}),(0,J.jsx)(`span`,{className:`flex-1 truncate text-xs`,children:`webchat`}),n&&(0,J.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider text-fg-faint`,children:`active`})]})}function xz(e){let t=[];for(let n of e){if(n.state!==`active`)continue;let e=n.contributes.attachmentRenderers??[];for(let r of e)t.push({...r,pluginId:n.id,pluginVersion:n.version,pluginDisplayName:n.displayName,clientEntry:n.clientEntry})}return t.sort((e,t)=>{let n=e.order??100,r=t.order??100;if(n!==r)return n-r;let i=`${e.pluginId}.${e.id}`,a=`${t.pluginId}.${t.id}`;return i<a?-1:+(i>a)}),t}function Sz(e,t){let n=Cz(t).toLowerCase(),r=e.toLowerCase();if(r===`*/*`)return!0;let i=r.indexOf(`/`);if(i<=0)return!1;let a=r.slice(0,i),o=r.slice(i+1),s=n.indexOf(`/`);if(s<=0)return!1;let c=n.slice(0,s),l=n.slice(s+1);return a===c?o===`*`||o===l:!1}function Cz(e){let t=e.indexOf(`;`);return(t<0?e:e.slice(0,t)).trim()}function wz(e,t){for(let n of e)if(Sz(n.mimePattern,t))return n;return null}var Tz=1024,Ez=Tz*1024;function Dz(e){return e==null?``:e<Tz?`${e} B`:e<Ez?`${(e/Tz).toFixed(1)} KB`:`${(e/Ez).toFixed(1)} MB`}function Oz(e){return`/api/p/files/raw?path=${encodeURIComponent(e)}`}function kz(e){return{path:e.path,mimeType:e.mimeType,name:e.name,size:e.size}}function Az({attachments:e,align:t}){let n=A(e=>e.me),r=fr(e=>e.plugins);if(!e||e.length===0)return null;let i=r?xz(r):[],a=e.slice(0,8);return(0,J.jsx)(`div`,{className:`mt-1.5 flex max-w-full flex-wrap gap-1.5 ${t===`end`?`justify-end`:`justify-start`}`,children:a.map(e=>{let r=wz(i,e.mimeType);if(r&&n){let i=KR(r.clientEntry,r.component);if(i)return(0,J.jsx)(i,{tenantId:n.tenantId,userId:n.userId,plugin:{id:r.pluginId,version:r.pluginVersion,displayName:r.pluginDisplayName},attachment:kz(e),align:t,rawUrl:Oz},e.path)}return(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-elevated/60 px-2 py-1 text-xs text-fg-default`,title:e.path,children:[(0,J.jsx)(nh,{size:12,className:`text-fg-muted`}),(0,J.jsx)(`span`,{className:`max-w-[12rem] truncate`,children:e.name??e.path}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-faint`,children:Dz(e.size)})]},e.path)})})}function jz({m:e}){let t=e.role===`user`,{MarkdownBlock:n}=mF(),r=$R(e=>e.resolved===`dark`)?` prose-invert`:``,i=!t&&e.resolvedBlocks&&e.resolvedBlocks.length>0?e.resolvedBlocks:null,a=e.text.length>0,o=e.resolvedToolCalls??[],s=!t&&!a&&o.length===0&&!i;return(0,J.jsx)(`div`,{className:t?`flex justify-end`:`flex justify-start`,children:(0,J.jsxs)(`div`,{className:`flex max-w-[85%] flex-col ${t?`items-end`:`items-start`}`,children:[(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-fg-faint`,children:[t?(0,J.jsx)(vN,{size:11}):(0,J.jsx)(Es,{size:11,className:`text-link`}),(0,J.jsx)(`span`,{children:t?`you`:`tianshu`})]}),i?(0,J.jsx)(`div`,{className:`flex flex-col gap-1.5 ${t?`items-end`:`items-start`}`,children:i.map((e,i)=>Mz(e,i,t,n,r))}):(0,J.jsxs)(J.Fragment,{children:[a?(0,J.jsx)(`div`,{className:`prose${r} prose-sm max-w-none rounded-lg border px-3.5 py-2.5 text-[14px] leading-relaxed `+(t?`border-brand-400/30 bg-brand-500/10 text-fg-default`:`border-border-subtle bg-bg-elevated/60 text-fg-default`),children:(0,J.jsx)(n,{noProse:!0,children:e.text})}):s?(0,J.jsx)(`div`,{className:`rounded-lg border border-border-subtle bg-bg-elevated/60 px-3.5 py-2.5`,children:(0,J.jsx)(Bz,{})}):null,o.length>0&&(0,J.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-1 ${t?`items-end`:`items-start`}`,children:o.map(e=>(0,J.jsx)(Iz,{call:e},e.id))})]}),t&&e.attachments&&e.attachments.length>0&&(0,J.jsx)(Az,{attachments:e.attachments,align:`end`}),!t&&(e.meta||e.createdAt)&&(0,J.jsx)(Nz,{meta:e.meta,createdAt:e.createdAt,align:`start`})]})})}function Mz(e,t,n,r,i){return e.kind===`text`?e.text.length===0?null:(0,J.jsx)(`div`,{className:`prose${i} prose-sm max-w-none rounded-lg border px-3.5 py-2.5 text-[14px] leading-relaxed `+(n?`border-brand-400/30 bg-brand-500/10 text-fg-default`:`border-border-subtle bg-bg-elevated/60 text-fg-default`),children:(0,J.jsx)(r,{noProse:!0,children:e.text})},`t${t}`):(0,J.jsx)(Iz,{call:e},`c${t}-${e.id}`)}function Nz({meta:e,createdAt:t,align:n}){let r=[];if(t&&r.push(Pz(t)),e?.model&&r.push(e.model),e?.usage){let{input:t,output:n,totalTokens:i}=e.usage;if(r.push(`↓${Fz(t)} ↑${Fz(n)}`),e.contextWindow&&e.contextWindow>0){let t=Math.round(i/e.contextWindow*100);r.push(`${t}% ctx`)}}return r.length===0?null:(0,J.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-[10px] text-fg-fainter ${n===`end`?`justify-end`:`justify-start`}`,children:r.map((e,t)=>(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t>0&&(0,J.jsx)(`span`,{className:`text-fg-fainter`,children:`·`}),e]},t))})}function Pz(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,`0`)}:${t.getMinutes().toString().padStart(2,`0`)}`}function Fz(e){return e>=1e6?(e/1e6).toFixed(1)+`m`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}function Iz({call:e}){let[t,n]=(0,d.useState)(!1),r=!e.result,i=!!e.result&&!e.result.ok,a=e.result;return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>!r&&n(e=>!e),className:`flex select-none items-center gap-1.5 py-0.5 text-xs transition-colors `+(r?`cursor-default text-fg-faint`:`cursor-pointer text-fg-faint hover:text-fg-muted`),children:[r?(0,J.jsx)(q,{size:11,className:`animate-spin text-warning`}):i?(0,J.jsx)(Mu,{size:11,className:`text-rose-400/70`}):(0,J.jsx)(Ql,{size:11,className:`text-emerald-500/60`}),(0,J.jsx)(`code`,{className:`font-mono text-[12px] text-link`,children:e.name}),(0,J.jsx)(`span`,{className:`font-mono text-[11px] text-fg-fainter`,children:Lz(e.arguments)}),r?(0,J.jsx)(`span`,{className:`text-[11px] text-fg-fainter`,children:`running…`}):t?(0,J.jsx)(Al,{size:11,className:`text-fg-fainter`}):(0,J.jsx)(Pl,{size:11,className:`text-fg-fainter`})]}),t&&a&&(0,J.jsx)(`pre`,{className:`mt-1 max-h-64 max-w-2xl overflow-auto whitespace-pre-wrap break-all rounded-md border px-3 py-2 text-[11px] `+(i?`border-rose-700/40 bg-rose-950/30 text-danger`:`border-border-subtle/60 bg-bg-elevated/60 text-fg-muted`),children:zz(a.text,4e3)})]})}function Lz(e){let t=Object.keys(e);return t.length===0?`()`:t.slice(0,3).map(t=>`${t}=${Rz(e[t])}`).join(` `)}function Rz(e){return typeof e==`string`?e.length>40?`"${e.slice(0,37)}…"`:`"${e}"`:typeof e==`number`||typeof e==`boolean`||e==null?String(e):JSON.stringify(e).slice(0,40)}function zz(e,t){return e.length<=t?e:e.slice(0,t-1)+`
|
|
44
44
|
…(truncated)`}function Bz(){return(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":`assistant is typing`,children:[(0,J.jsx)(Vz,{delay:`0ms`}),(0,J.jsx)(Vz,{delay:`150ms`}),(0,J.jsx)(Vz,{delay:`300ms`})]})}function Vz({delay:e}){return(0,J.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-fg-fainter`,style:{animation:`tianshuTypingDot 1.2s ease-in-out infinite`,animationDelay:e}})}function Hz(e){let t=new Map;for(let n of e)n.role===`tool`&&n.toolResult&&t.set(n.toolResult.callId,n.toolResult);let n=[];for(let r of e){if(r.role===`tool`)continue;if(r.role===`assistant`&&(r.toolCalls&&r.toolCalls.length>0||r.blocks&&r.blocks.length>0)){let e=(r.toolCalls??[]).map(e=>({...e,result:t.get(e.id)})),i=r.blocks?.map(e=>e.kind===`toolCall`?{...e,result:t.get(e.id)}:e),{toolCalls:a,toolResult:o,blocks:s,...c}=r;n.push({...c,resolvedToolCalls:e.length>0?e:void 0,resolvedBlocks:i});continue}let{toolCalls:e,toolResult:i,blocks:a,...o}=r;n.push(o)}return n}function Uz(e){return`att-${e.toString(36)}-${Math.random().toString(36).slice(2,6)}`}var Wz=tr((e,t)=>({attachments:[],transforms:[],_nextId:1,addAttachment:n=>{let r=t()._nextId,i=Uz(r);return e(e=>({_nextId:e._nextId+1,attachments:[...e.attachments,{...n,id:i}]})),i},updateAttachment:(t,n)=>e(e=>{let r=e.attachments.findIndex(e=>e.id===t);if(r<0)return{};let i=e.attachments.slice();return i[r]={...i[r],...n},{attachments:i}}),removeAttachment:t=>e(e=>({attachments:e.attachments.filter(e=>e.id!==t)})),registerDraftTransform:t=>(e(e=>e.transforms.includes(t)?{}:{transforms:[...e.transforms,t]}),()=>{e(e=>({transforms:e.transforms.filter(e=>e!==t)}))}),clearAll:()=>e({attachments:[]}),hasPending:()=>t().attachments.some(e=>e.status===`uploading`),applyTransforms:async e=>{let{transforms:n,attachments:r}=t();if(n.length===0)return e;let i=r.filter(e=>e.status===`ready`),a=e;for(let e of n)a=await e(a,i);return a}}));function Gz(){let e=Wz.getState();return{get attachments(){return Wz.getState().attachments},addAttachment:e.addAttachment,updateAttachment:e.updateAttachment,removeAttachment:e.removeAttachment,registerDraftTransform:e.registerDraftTransform}}function Kz({value:e,onChange:t}={}){let n=A(e=>e.models),r=A(e=>e.preferredModel),i=A(e=>e.setPreferredModel),a=A(e=>e.me?.defaultModel?.id??null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)({top:0,right:0}),u=(0,d.useRef)(null),p=(0,d.useRef)(null),m=(0,d.useCallback)(()=>{if(!u.current)return;let e=u.current.getBoundingClientRect();l({top:e.top,right:window.innerWidth-e.right})},[]);if((0,d.useEffect)(()=>{if(!o)return;m();let e=e=>{let t=e.target;u.current?.contains(t)||p.current?.contains(t)||s(!1)},t=()=>m();return document.addEventListener(`mousedown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`resize`,t)}},[o,m]),n.length===0)return null;let h=e=>!!e&&n.some(t=>t.id===e),g=h(e)?e:h(r)?r:h(a)?a:n[0].id,_=n.find(e=>e.id===g)?.name??g.split(`/`).pop()??`Model`,v=[];for(let e of n){let t=e.group??`Other`,n=v.find(e=>e.label===t);n||(n={label:t,items:[]},v.push(n)),n.items.push(e)}let y=e=>{if(s(!1),e!==g){if(t){t(e);return}i(e)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{ref:u,type:`button`,onClick:()=>s(e=>!e),className:`inline-flex items-center gap-1 rounded-full bg-bg-hover/60 py-1 pl-2.5 pr-2 text-xs font-medium text-fg-muted transition-colors hover:bg-bg-hover`,title:g,children:[(0,J.jsx)(`span`,{className:`max-w-[160px] truncate`,children:_}),(0,J.jsx)(Al,{size:12,className:`text-fg-muted transition-transform ${o?`rotate-180`:``}`})]}),o&&(0,f.createPortal)((0,J.jsx)(`div`,{ref:p,className:`fixed z-[9999] max-h-80 w-64 overflow-y-auto rounded-xl border border-border-default bg-bg-raised py-1 shadow-2xl`,style:{bottom:`calc(100vh - ${c.top}px + 8px)`,right:`${c.right}px`},children:v.map(e=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`px-3 pb-1 pt-2.5 text-[10px] font-semibold uppercase tracking-wider text-fg-faint`,children:e.label}),e.items.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>y(e.id),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors `+(e.id===g?`bg-bg-hover/60 text-fg-default`:`text-fg-muted hover:bg-bg-hover/40`),title:e.id,children:[(0,J.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),e.reasoning&&(0,J.jsx)(`span`,{className:`shrink-0 rounded bg-amber-500/15 px-1 py-px text-[9px] text-warning`,children:`reasoning`}),e.id===g&&(0,J.jsx)(xl,{size:14,className:`shrink-0 text-link`})]},e.id))]},e.label))}),document.body)]})}function qz(){let e=A(e=>e.me),t=fr(e=>e.plugins);if(!e||!t)return null;let n=[];for(let e of t){if(e.state!==`active`)continue;let t=e.contributes.composerActions??[];for(let r of t)n.push({...r,pluginId:e.id,pluginVersion:e.version,pluginDisplayName:e.displayName,clientEntry:e.clientEntry})}if(n.sort((e,t)=>(e.order??100)-(t.order??100)),n.length===0)return null;let r=Gz();return(0,J.jsx)(J.Fragment,{children:n.map(t=>{let n=KR(t.clientEntry,t.component);return n?(0,J.jsx)(n,{tenantId:e.tenantId,userId:e.userId,plugin:{id:t.pluginId,version:t.pluginVersion,displayName:t.pluginDisplayName},composer:r},`${t.pluginId}.${t.id}`):null})})}var Jz=1024,Yz=Jz*1024;function Xz(e){return e<Jz?`${e} B`:e<Yz?`${(e/Jz).toFixed(1)} KB`:`${(e/Yz).toFixed(1)} MB`}function Zz(){let e=Wz(e=>e.attachments),t=Wz(e=>e.removeAttachment);return e.length===0?null:(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2 pb-1`,children:e.map(e=>{let n=e.status===`uploading`,r=e.status===`error`;return(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs `+(r?`border-rose-700/60 bg-rose-950/40 text-danger`:`border-border-default bg-bg-raised text-fg-default`),title:r?e.error??`upload failed`:e.path??e.name,"aria-label":`attachment ${e.name}`,children:[n?(0,J.jsx)(q,{size:12,className:`animate-spin text-brand-400`}):r?(0,J.jsx)(SM,{size:12,className:`text-danger`}):(0,J.jsx)(nh,{size:12,className:`text-fg-muted`}),(0,J.jsx)(`span`,{className:`max-w-[12rem] truncate`,children:e.name}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-faint`,children:Xz(e.size)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),className:`ml-0.5 rounded p-0.5 text-fg-faint hover:bg-bg-hover hover:text-fg-default`,"aria-label":`remove attachment`,children:(0,J.jsx)(AP,{size:11})})]},e.id)})})}function Qz(){let e=A(e=>e.isStreaming),t=A(e=>e.sendPrompt),n=A(e=>e.abort),r=Wz(e=>e.attachments.length),i=Wz(e=>e.hasPending()),a=Wz(e=>e.applyTransforms),o=Wz(e=>e.clearAll),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(!1),f=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=f.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`)},[s]);let p=e?!0:l||i?!1:s.trim().length>0||r>0,m=async()=>{if(e){n();return}if(l||i)return;let d=s.trimEnd();if(!(!d&&r===0)){u(!0);try{let e=await a(d),n=Wz.getState().attachments.filter(e=>e.status===`ready`&&!!e.path).map(e=>({path:e.path,mimeType:e.mimeType??`application/octet-stream`,name:e.name,size:e.size}));(e.trim().length>0||n.length>0)&&t(e,n.length>0?n:void 0),c(``),o()}finally{u(!1)}}};return(0,J.jsx)(`div`,{className:`border-t border-border-subtle bg-bg-base px-4 py-3`,children:(0,J.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-2 rounded-2xl border border-border-subtle bg-bg-elevated p-3 focus-within:border-border-default`,children:[(0,J.jsx)(Zz,{}),(0,J.jsx)(`textarea`,{ref:f,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),m())},rows:1,placeholder:`Message Tianshu — Enter to send, Shift+Enter for newline`,className:`resize-none bg-transparent text-[14px] leading-relaxed text-fg-default placeholder:text-fg-faint focus:outline-none`}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,J.jsx)(qz,{})}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(Kz,{}),e?(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg p-1.5 text-danger transition-colors hover:bg-bg-hover hover:text-danger`,title:`Stop`,children:(0,J.jsx)(rA,{size:18})}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:!p,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-bg-hover hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-30`,title:i?`Waiting for uploads to finish…`:`Send`,"aria-label":`Send`,children:(0,J.jsx)(dD,{size:18})})]})]})]})})}function $z({open:e,onClose:t}){let n=fr(e=>e.plugins),r=fr(e=>e.setPlugins),i=fr(e=>e.load),a=fr(e=>e.refresh),o=fr(e=>e.refreshing),[s,c]=(0,d.useState)(`installed`),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{e&&i()},[e,i]),(0,d.useEffect)(()=>{if(!e||s!==`catalog`||l!==null)return;let t=!1;return p(null),or.pluginCatalog().then(e=>{t||u(e)}).catch(e=>{t||p(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,s,l]),(0,d.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),!e)return null;async function v(e){let t=e.state!==`active`;h(e.id),p(null);try{r((await or.setPluginEnabled(e.id,t)).plugins)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(null)}}async function y(){_(!0),p(null);try{u(await or.refreshPluginCatalog())}catch(e){p(e instanceof Error?e.message:String(e))}finally{_(!1)}}let b=new Set((n??[]).map(e=>e.id));return(0,J.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`plugin-manager-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm`,onClick:t,children:(0,J.jsxs)(`div`,{className:`flex max-h-[80vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-border-default bg-bg-elevated shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-subtle px-5 py-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(sT,{size:16,className:`text-brand-400`}),(0,J.jsx)(`h2`,{id:`plugin-manager-title`,className:`text-sm font-semibold text-fg-default`,children:`Plugin Manager`})]}),(0,J.jsx)(`button`,{type:`button`,onClick:t,className:`btn-ghost p-1.5`,"aria-label":`Close`,children:(0,J.jsx)(AP,{size:16})})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border-subtle px-3 pt-2`,children:[(0,J.jsxs)(eB,{active:s===`installed`,onClick:()=>c(`installed`),children:[`Installed`,n&&(0,J.jsx)(`span`,{className:`ml-1.5 rounded bg-bg-raised px-1.5 py-0.5 text-[9px] text-fg-muted`,children:n.length})]}),(0,J.jsxs)(eB,{active:s===`catalog`,onClick:()=>c(`catalog`),children:[`Catalog`,l&&(0,J.jsx)(`span`,{className:`ml-1.5 rounded bg-bg-raised px-1.5 py-0.5 text-[9px] text-fg-muted`,children:l.entries.length})]}),(0,J.jsx)(`div`,{className:`flex-1`}),s===`installed`&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void a(),disabled:o,className:`btn-ghost flex items-center gap-1.5 px-2 py-1 text-[11px] text-fg-muted`,title:`Re-discover plugins on disk (after a manual install or git pull)`,children:[(0,J.jsx)(GT,{size:12,className:o?`animate-spin`:``}),`Refresh`]}),s===`catalog`&&l&&(0,J.jsxs)(`button`,{type:`button`,onClick:y,disabled:g,className:`btn-ghost flex items-center gap-1.5 px-2 py-1 text-[11px] text-fg-muted`,title:`Re-fetch the catalog from the registry`,children:[(0,J.jsx)(GT,{size:12,className:g?`animate-spin`:``}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4`,children:[f&&(0,J.jsx)(`div`,{className:`mb-3 rounded-md border border-rose-700/50 bg-rose-950/40 px-3 py-2 text-xs text-danger`,children:f}),s===`installed`?(0,J.jsx)(tB,{plugins:n,pendingId:m,onToggle:v}):(0,J.jsx)(rB,{catalog:l,installedIds:b})]}),(0,J.jsx)(`div`,{className:`border-t border-border-subtle px-5 py-3 text-[11px] leading-relaxed text-fg-faint`,children:s===`installed`?(0,J.jsxs)(J.Fragment,{children:[`Changes persist to`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 text-fg-muted`,children:`<tenant>/config.json`}),` `,`and take effect immediately for new requests.`]}):(0,J.jsxs)(J.Fragment,{children:[`Catalog hosted at`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 text-fg-muted`,children:`tianshu-ai/plugin-registry`}),`. Install button lands in P2.`]})})]})})}function eB({active:e,onClick:t,children:n}){return(0,J.jsx)(`button`,{type:`button`,onClick:t,className:[`flex items-center rounded-t-md border-b-2 px-3 py-2 text-xs font-medium`,e?`border-brand-500 text-fg-default`:`border-transparent text-fg-faint hover:text-fg-muted`].join(` `),children:n})}function tB({plugins:e,pendingId:t,onToggle:n}){return e===null?(0,J.jsxs)(`div`,{className:`flex items-center justify-center py-10 text-sm text-fg-faint`,children:[(0,J.jsx)(q,{size:14,className:`mr-2 animate-spin`}),`Loading…`]}):e.length===0?(0,J.jsxs)(`div`,{className:`py-10 text-center text-sm text-fg-faint`,children:[`No plugins discovered for this tenant.`,(0,J.jsxs)(`p`,{className:`mt-2 text-xs text-fg-fainter`,children:[`Builtin plugins ship under`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 text-fg-muted`,children:`packages/server/builtinConfig/plugins/`}),`. Tenant plugins live at`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 text-fg-muted`,children:`<tenant>/_tenant/config/plugins/`}),`. Browse the Catalog tab to find more.`]})]}):(0,J.jsx)(`ul`,{className:`space-y-2`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`flex items-start justify-between gap-3 rounded-lg border border-border-subtle bg-bg-elevated/50 p-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-fg-default`,children:e.displayName}),(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 py-0.5 text-[10px] text-fg-muted`,children:e.id}),(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-fainter`,children:[`v`,e.version]}),(0,J.jsx)(aB,{source:e.source}),(0,J.jsx)(oB,{state:e.state})]}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.description}),(0,J.jsx)(nB,{entry:e}),e.failedReason&&(0,J.jsxs)(`div`,{className:`mt-1 flex items-start gap-1 text-[11px] text-danger`,children:[(0,J.jsx)(SM,{size:11,className:`mt-px flex-shrink-0`}),(0,J.jsx)(`span`,{className:`break-all`,children:e.failedReason})]})]}),(0,J.jsx)(sB,{active:e.state===`active`,pending:t===e.id,disabled:e.state===`failed`||e.state===`client-bundle-missing`,onClick:()=>n(e)})]},e.id))})}function nB({entry:e}){let{provided:t,requires:n,missing:r}=e.capabilities;return t.length===0&&n.length===0&&r.length===0?null:(0,J.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5 text-[10px]`,children:[t.map(e=>(0,J.jsxs)(`span`,{className:`rounded bg-emerald-900/40 px-1.5 py-0.5 text-success`,title:`This plugin provides ${e}`,children:[`provides `,e]},`p-${e}`)),n.filter(e=>!r.includes(e)).map(e=>(0,J.jsxs)(`span`,{className:`rounded bg-sky-900/40 px-1.5 py-0.5 text-sky-300`,title:`This plugin requires ${e} (satisfied)`,children:[`requires `,e]},`r-${e}`)),r.map(e=>(0,J.jsxs)(`span`,{className:`rounded bg-rose-900/40 px-1.5 py-0.5 text-danger`,title:`This plugin requires ${e}, but no provider is enabled`,children:[`missing `,e]},`m-${e}`))]})}function rB({catalog:e,installedIds:t}){return e===null?(0,J.jsxs)(`div`,{className:`flex items-center justify-center py-10 text-sm text-fg-faint`,children:[(0,J.jsx)(q,{size:14,className:`mr-2 animate-spin`}),`Fetching catalog…`]}):e.entries.length===0?(0,J.jsxs)(`div`,{className:`py-10 text-center text-sm text-fg-faint`,children:[`Catalog is empty.`,(0,J.jsxs)(`p`,{className:`mt-2 text-xs text-fg-fainter`,children:[`The registry is at`,` `,(0,J.jsx)(`a`,{href:`https://github.com/tianshu-ai/plugin-registry`,target:`_blank`,rel:`noreferrer`,className:`text-brand-400 hover:underline`,children:`tianshu-ai/plugin-registry`}),`. Submit a PR to add your plugin.`]})]}):(0,J.jsxs)(J.Fragment,{children:[e.entriesDropped>0&&(0,J.jsxs)(`div`,{className:`mb-3 rounded-md border border-amber-700/50 bg-amber-950/40 px-3 py-2 text-[11px] text-warning`,children:[e.entriesDropped,` catalog`,` `,e.entriesDropped===1?`entry was`:`entries were`,` dropped because`,` `,e.entriesDropped===1?`it failed`:`they failed`,` schema validation.`]}),(0,J.jsx)(`ul`,{className:`space-y-2`,children:e.entries.map(e=>(0,J.jsx)(iB,{entry:e,alreadyInstalled:t.has(e.id)},e.id))})]})}function iB({entry:e,alreadyInstalled:t}){return(0,J.jsxs)(`li`,{className:`flex items-start justify-between gap-3 rounded-lg border border-border-subtle bg-bg-elevated/50 p-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-fg-default`,children:e.displayName}),(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1 py-0.5 text-[10px] text-fg-muted`,children:e.id}),(0,J.jsxs)(`span`,{className:`text-[10px] text-fg-fainter`,children:[`v`,e.latestVersion]}),e.verified&&(0,J.jsxs)(`span`,{className:`flex items-center gap-1 rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] uppercase text-success`,children:[(0,J.jsx)(DD,{size:10}),` verified`]}),(0,J.jsxs)(`a`,{href:e.repository,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[10px] text-fg-faint hover:text-brand-400`,children:[e.author,` `,(0,J.jsx)(Kp,{size:9})]})]}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.description}),e.tags.length>0&&(0,J.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.tags.map(e=>(0,J.jsx)(`span`,{className:`rounded bg-bg-raised px-1.5 py-px text-[9px] text-fg-faint`,children:e},e))})]}),(0,J.jsx)(`button`,{type:`button`,disabled:!0,title:`Install lands in P2`,className:`flex-shrink-0 cursor-not-allowed rounded-md bg-bg-raised px-3 py-1.5 text-[11px] font-medium text-fg-faint`,children:t?`Installed`:`Install`})]})}function aB({source:e}){return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase ${e===`builtin`?`bg-bg-raised text-fg-muted`:`bg-violet-900/50 text-violet-300`}`,children:e})}function oB({state:e}){switch(e){case`active`:return(0,J.jsxs)(`span`,{className:`flex items-center gap-1 rounded bg-emerald-900/50 px-1.5 py-0.5 text-[9px] uppercase text-success`,children:[(0,J.jsx)(Ql,{size:10}),` active`]});case`disabled`:return(0,J.jsxs)(`span`,{className:`flex items-center gap-1 rounded bg-bg-raised px-1.5 py-0.5 text-[9px] uppercase text-fg-muted`,children:[(0,J.jsx)(tw,{size:10}),` disabled`]});case`failed`:return(0,J.jsxs)(`span`,{className:`flex items-center gap-1 rounded bg-rose-900/50 px-1.5 py-0.5 text-[9px] uppercase text-danger`,children:[(0,J.jsx)(SM,{size:10}),` failed`]});case`client-bundle-missing`:return(0,J.jsx)(`span`,{className:`rounded bg-amber-900/50 px-1.5 py-0.5 text-[9px] uppercase text-warning`,children:`no client bundle`})}}function sB({active:e,pending:t,disabled:n,onClick:r}){return(0,J.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:t||n,onClick:r,className:[`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer items-center rounded-full transition-colors`,e?`bg-brand-600`:`bg-bg-hover`,(t||n)&&`cursor-not-allowed opacity-50`].filter(Boolean).join(` `),title:n?`Plugin cannot be enabled in its current state`:e?`Click to disable`:`Click to enable`,children:[(0,J.jsx)(`span`,{className:[`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform`,e?`translate-x-5`:`translate-x-1`].join(` `)}),t&&(0,J.jsx)(q,{size:10,className:`absolute -right-4 top-1/2 -translate-y-1/2 animate-spin text-fg-muted`})]})}var cB={Bot:Es,Calendar:Ec,FileText:qm,FolderOpen:Jh,Globe:t_,Kanban:Uv,MessageSquare:Fx,Search:oD,Terminal:hj,Wrench:OP};function lB(){let e=fr(e=>e.plugins),t=fr(e=>e.openPanel),n=fr(e=>e.setOpenPanel);if(t!==null||!e)return null;let r=[];for(let t of e){if(t.state!==`active`)continue;let e=t.contributes.topBarButtons??[];for(let n of e)r.push({...n,pluginId:t.id})}return r.sort((e,t)=>(e.order??100)-(t.order??100)),r.length===0?null:(0,J.jsx)(J.Fragment,{children:r.map(e=>{let t=`${e.pluginId}.${e.id}`,r=e.opensPanel?e.opensPanel.includes(`.`)?e.opensPanel:`${e.pluginId}.${e.opensPanel}`:null,i=cB[e.icon]??sT;return(0,J.jsx)(`button`,{type:`button`,title:e.tooltip??e.pluginId,"aria-label":e.tooltip??e.pluginId,onClick:()=>{r&&n(r)},className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-bg-raised hover:text-fg-default`,children:(0,J.jsx)(i,{size:16})},t)})})}function uB(){let e=A(e=>e.messages),t=A(e=>e.me),n=A(e=>e.viewingSessionId),r=A(e=>e.sidebarOpen),i=A(e=>e.toggleSidebar);A(e=>e.isStreaming);let a=A(e=>e.streamError),o=A(e=>e.clearStreamError),s=A(e=>e.compactNotice),c=A(e=>e.clearCompactNotice),l=A(e=>e.hasMoreHistory),u=A(e=>e.loadingMore),f=A(e=>e.loadEarlier),p=(0,d.useRef)(null),m=(0,d.useRef)(null);(0,d.useEffect)(()=>{let t=e.length>0?e[e.length-1].id:null;t&&t!==m.current&&p.current?.scrollIntoView({behavior:`smooth`}),m.current=t},[e]);let[h,g]=(0,d.useState)(!1),_=t?.config.branding,v=_?.name??`Tianshu`,y=_?.emoji??`⭐`,b=e.length===0;return(0,J.jsxs)(`main`,{className:`flex h-full min-w-0 flex-1 flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex h-12 items-center justify-between border-b border-border-subtle bg-bg-elevated/50 px-4 backdrop-blur`,children:[(0,J.jsxs)(`div`,{className:`flex items-center`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-bg-raised hover:text-fg-default`,title:r?`Hide sidebar`:`Show sidebar`,children:r?(0,J.jsx)(NC,{size:18}):(0,J.jsx)(FC,{size:18})}),(0,J.jsx)(`h1`,{className:`ml-3 text-sm font-medium text-fg-muted`,children:`main`}),(0,J.jsxs)(`span`,{className:`ml-3 text-[11px] text-fg-faint`,children:[`tenant `,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:t?.tenantId??`…`}),` · user`,` `,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:t?.userId??`…`})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(lB,{}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>g(!0),className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-bg-raised hover:text-fg-default`,title:`Plugin Manager`,"aria-label":`Open Plugin Manager`,children:(0,J.jsx)(sT,{size:16})})]})]}),(0,J.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-6`,children:b?(0,J.jsx)(dB,{brandName:v,brandEmoji:y,tenantId:t?.tenantId??`default`}):(0,J.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-4`,children:[l&&(0,J.jsx)(`button`,{type:`button`,onClick:f,disabled:u,className:`w-full rounded-lg bg-bg-raised/50 py-2 text-xs text-fg-faint hover:text-fg-muted disabled:cursor-default disabled:opacity-60`,children:u?`Loading…`:`Load earlier messages`}),Hz(e).map((e,t)=>(0,J.jsx)(`div`,{className:t===0?``:`mt-4`,children:(0,J.jsx)(jz,{m:e})},e.id)),a&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-rose-700/50 bg-rose-950/40 px-3 py-2 text-sm text-danger`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:a}),(0,J.jsx)(`button`,{type:`button`,onClick:o,className:`ml-3 text-[11px] uppercase tracking-wider text-rose-300/80 hover:text-white`,children:`dismiss`})]}),s&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-amber-700/40 bg-amber-950/30 px-3 py-2 text-sm text-amber-200`,children:[(0,J.jsxs)(`span`,{className:`truncate`,children:[`📌 Conversation history compacted (`,s.reason===`auto`?`auto`:`manual`,`):`,` `,s.summarisedCount,` earlier messages summarised,`,` `,s.keptCount,` kept verbatim.`]}),(0,J.jsx)(`button`,{type:`button`,onClick:c,className:`ml-3 text-[11px] uppercase tracking-wider text-amber-300/80 hover:text-white`,children:`dismiss`})]}),(0,J.jsx)(`div`,{ref:p})]})}),n===null?(0,J.jsx)(Qz,{}):(0,J.jsx)(fB,{sessionId:n}),(0,J.jsx)($z,{open:h,onClose:()=>g(!1)})]})}function dB({brandName:e,brandEmoji:t,tenantId:n}){return(0,J.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center text-center`,children:[(0,J.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-brand-600/20`,children:(0,J.jsx)(`span`,{className:`text-2xl`,children:t})}),(0,J.jsxs)(`h2`,{className:`mb-2 text-xl font-semibold text-fg-default`,children:[`Welcome to `,e]}),(0,J.jsxs)(`p`,{className:`max-w-md text-sm text-fg-faint`,children:[`An open AI agent platform with a sidecar browser. Day 0: messages persist per-tenant in`,` `,(0,J.jsxs)(`code`,{className:`mx-0.5 rounded bg-bg-raised px-1 py-0.5 text-xs text-fg-muted`,children:[`~/.tianshu/tenants/`,n,`/db.sqlite`]}),`. Tools, workspace files, browser, and worker dispatch arrive in later PRs.`]})]})}function fB({sessionId:e}){let[t,n]=(0,d.useState)(null);return(0,d.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await fetch(`/api/channel-sessions/${encodeURIComponent(e)}/binding`,{credentials:`include`});if(!r.ok)return;let i=await r.json();if(t)return;n(i.binding??null)}catch{}})(),()=>{t=!0}},[e]),(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1 border-t border-border-subtle bg-bg-elevated px-4 py-2.5`,children:[t&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-fg-faint`,children:[(0,J.jsx)(`span`,{children:`Model:`}),(0,J.jsx)(Kz,{value:t.modelId,onChange:async e=>{if(t){n({...t,modelId:e});try{await fetch(`/api/channel-bindings/${encodeURIComponent(t.id)}/model`,{method:`PATCH`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modelId:e})})}catch{}}}})]}),(0,J.jsx)(`span`,{className:`text-[10.5px] text-fg-fainter`,children:`Read-only · messages flow in from the channel`})]})}function pB(){let e=fr(e=>e.plugins),t=fr(e=>e.openPanel),n=fr(e=>e.setOpenPanel);if(!e)return null;let r=[];for(let t of e){if(t.state!==`active`)continue;let e=t.contributes.topBarButtons??[];for(let n of e){let e=n.opensPanel?n.opensPanel.includes(`.`)?n.opensPanel:`${t.id}.${n.opensPanel}`:null;r.push({...n,pluginId:t.id,panelId:e})}}return r.sort((e,t)=>(e.order??100)-(t.order??100)),(0,J.jsxs)(`div`,{className:`flex h-12 items-center gap-1 border-b border-border-subtle bg-bg-base/40 px-2`,children:[(0,J.jsx)(`div`,{className:`flex flex-1 items-center gap-0.5 overflow-x-auto`,children:r.map(e=>{let r=cB[e.icon]??sT,i=e.panelId!==null&&e.panelId===t,a=e.tooltip??e.pluginId;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{e.panelId&&n(i?null:e.panelId)},title:a,"aria-label":a,"aria-pressed":i,className:[`group relative flex shrink-0 items-center gap-1.5 rounded-md text-xs transition-all`,i?`bg-bg-hover/70 px-2.5 py-1 font-medium text-fg-default`:`px-2 py-1 text-fg-faint hover:bg-bg-raised/60 hover:text-fg-default`].join(` `),children:[(0,J.jsx)(r,{size:14}),i?(0,J.jsx)(`span`,{children:a}):(0,J.jsx)(`span`,{className:`sr-only`,children:a})]},`${e.pluginId}.${e.id}`)})}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>n(null),title:`Close panel`,"aria-label":`Close panel`,className:`ml-1 rounded-md p-1 text-fg-faint hover:bg-bg-raised/60 hover:text-fg-muted`,children:(0,J.jsx)(AP,{size:16})})]})}var mB=`tianshu:rightPanelWidth`,hB=384,gB=280,_B=900;function vB(){try{let e=localStorage.getItem(mB),t=e?parseFloat(e):NaN;return Number.isFinite(t)?Math.min(Math.max(t,gB),_B):hB}catch{return hB}}function yB(){let e=A(e=>e.me),t=fr(e=>e.openPanel),n=fr(e=>e.plugins),[r,i]=(0,d.useState)(()=>vB()),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),c=(0,d.useCallback)(e=>{try{localStorage.setItem(mB,String(e))}catch{}},[]),l=(0,d.useCallback)(e=>{e.preventDefault(),s.current={startX:e.clientX,startWidth:r},o(!0);let t=r,n=0,a=e=>{if(!s.current)return;let r=s.current.startX-e.clientX;t=Math.min(Math.max(s.current.startWidth+r,gB),_B),n||=requestAnimationFrame(()=>{n=0,i(t)})},l=()=>{window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,l),n&&cancelAnimationFrame(n),window.getSelection?.()?.removeAllRanges(),s.current=null,o(!1),c(t)};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,l)},[r,c]),u=(0,d.useCallback)(()=>{i(hB),c(hB)},[c]),f=fr(e=>e.setOpenPanel);if((0,d.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&f(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,f]),!t||!n)return null;let p=t.indexOf(`.`);if(p<0)return null;let m=t.slice(0,p),h=t.slice(p+1),g=n.find(e=>e.id===m);if(!g||g.state!==`active`)return null;let _=g.contributes.rightPanels?.find(e=>e.id===h);if(!_)return null;let v=KR(g.clientEntry,_.component);if(!v)return null;let y={tenantId:e?.tenantId??``,userId:e?.userId??``,plugin:{id:g.id,version:g.version,displayName:g.displayName}};return(0,J.jsxs)(`aside`,{className:`relative flex h-full flex-shrink-0 flex-col border-l border-border-subtle bg-bg-base`,style:{width:r},children:[(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize right panel`,title:`Drag to resize (double-click to reset)`,onMouseDown:l,onDoubleClick:u,className:[`group absolute -left-[3px] top-0 bottom-0 z-10 flex w-[6px] cursor-col-resize items-center justify-center`,a?`bg-blue-500/20`:`hover:bg-blue-500/10`].join(` `),children:(0,J.jsx)(`span`,{"aria-hidden":!0,className:[`h-full w-px`,a?`bg-blue-400`:`bg-transparent group-hover:bg-blue-400/60`].join(` `)})}),(0,J.jsx)(pB,{}),(0,J.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[a&&(0,J.jsx)(`div`,{className:`absolute inset-0 z-10`}),(0,J.jsx)(v,{...y})]})]})}function bB(){let e=A(e=>e.init),t=A(e=>e.sidebarOpen),n=A(e=>e.meError),r=fr(e=>e.load);return(0,d.useEffect)(()=>{e(),r()},[e,r]),(0,J.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-bg-base text-fg-default`,children:[t&&(0,J.jsx)(vz,{}),(0,J.jsx)(uB,{}),(0,J.jsx)(yB,{}),n&&(0,J.jsxs)(`div`,{className:`fixed right-4 top-4 max-w-sm rounded-md border border-rose-700/50 bg-rose-950/90 px-3 py-2 text-sm text-danger shadow-lg`,children:[(0,J.jsx)(`strong`,{className:`mr-1`,children:`/api/me failed:`}),n]})]})}var xB=`tianshu_identity`,SB=/^\/tenants\/([A-Za-z0-9._-]{1,64})\/users\/([A-Za-z0-9._-]{1,64})(\/.*)?$/,CB=`default`;function wB(e){let t=e.match(SB);return t?{tenantId:t[1],userId:t[2],rest:t[3]||`/`}:null}function TB(){if(typeof document>`u`)return null;for(let e of document.cookie.split(/;\s*/)){let t=e.indexOf(`=`);if(t<=0||e.slice(0,t).trim()!==xB)continue;let n=decodeURIComponent(e.slice(t+1).trim()),r=n.indexOf(`/`);if(!(r<=0||r===n.length-1))return{tenantId:n.slice(0,r),userId:n.slice(r+1)}}return null}function EB(e,t){let n=encodeURIComponent(`${e}/${t}`);document.cookie=`${xB}=${n};Path=/;Max-Age=${720*3600};SameSite=Lax`}function DB(){document.cookie=`${xB}=;Path=/;Max-Age=0;SameSite=Lax`}function OB(e,t){if(SB.test(e))return e;let n=t??TB(),r=n?.tenantId??`default`,i=n?.userId??`dev`,a=e.startsWith(`/`)?e:`/${e}`;return`/tenants/${r}/users/${i}${a===`/`?``:a}`}function kB(){if(typeof window>`u`)return;let e=new URLSearchParams(window.location.search);if(e.has(`reset-identity`)){DB(),e.delete(`reset-identity`);let t=e.toString()?`?${e.toString()}`:``;window.location.replace(`/`+t+window.location.hash);return}let t=(e.get(`tenant`)??``).trim(),n=(e.get(`user`)??``).trim();if(t||n){let r=TB(),i=t||r?.tenantId||`default`,a=n||r?.userId||`dev`;if(!jB(i)||!jB(a)){console.warn(`[tianshu] ignoring invalid identity from URL: tenant=${i} user=${a}`);return}EB(i,a),e.delete(`tenant`),e.delete(`user`);let o=`/tenants/${i}/users/${a}${AB(window.location.pathname)}${e.toString()?`?${e.toString()}`:``}${window.location.hash}`;window.location.replace(o);return}let r=wB(window.location.pathname);if(r){let e=TB();(e?.tenantId!==r.tenantId||e?.userId!==r.userId)&&EB(r.tenantId,r.userId);return}let i=TB();if(i){let e=`/tenants/${i.tenantId}/users/${i.userId}${window.location.pathname}${window.location.search}${window.location.hash}`;window.location.replace(e);return}EB(CB,`dev`),window.location.replace(`/tenants/${CB}/users/dev${window.location.pathname}${window.location.search}${window.location.hash}`)}function AB(e){let t=e.match(SB);return t?t[3]||`/`:e||`/`}function jB(e){return/^[A-Za-z0-9._-]+$/.test(e)&&e.length<=64}function MB(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(null),c=(0,d.useCallback)(async()=>{a(!0),r(null);try{let e=await fetch(`/api/mcp/servers`,{credentials:`include`});if(!e.ok){let t=await e.text().catch(()=>``);throw Error(`HTTP ${e.status}: ${t.slice(0,200)}`)}t((await e.json()).servers??[])}catch(e){r(e instanceof Error?e.message:String(e))}finally{a(!1)}},[]);(0,d.useEffect)(()=>{c()},[c]);let l=(0,d.useMemo)(()=>{let t=[{source:`plugin`,items:[]},{source:`user`,items:[]}];for(let n of e??[])t.find(e=>e.source===n.source)?.items.push(n);return t},[e]);return(0,J.jsxs)(`div`,{className:`mx-auto max-w-5xl p-6`,children:[(0,J.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold text-fg-default`,children:[(0,J.jsx)(gD,{size:18,className:`text-brand-400`}),`MCP Servers`]}),(0,J.jsx)(`p`,{className:`mt-1 text-[12px] text-fg-faint`,children:`Model Context Protocol servers visible to this agent. Plugin-contributed servers come from active plugins (read-only here — toggle the plugin to enable/disable). User-configured servers are managed directly below.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-shrink-0 items-center gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:c,disabled:i,className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-border-default px-3 py-1.5 text-[12px] text-fg-muted hover:bg-bg-raised/50 disabled:opacity-50`,children:[(0,J.jsx)(GT,{size:12,className:i?`animate-spin`:void 0}),`Refresh`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>s(`new`),className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md bg-brand-600 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-brand-500`,children:[(0,J.jsx)(Gw,{size:12}),`Add server`]})]})]}),n&&(0,J.jsxs)(`div`,{className:`mb-4 flex items-start gap-2 rounded-md border border-rose-700/50 bg-rose-950/40 px-3 py-2 text-[12px] text-danger`,children:[(0,J.jsx)(SM,{size:14,className:`mt-px flex-shrink-0`}),(0,J.jsx)(`span`,{className:`break-all`,children:n})]}),e&&(0,J.jsx)(`div`,{className:`space-y-6`,children:l.map(e=>(0,J.jsx)(NB,{source:e.source,items:e.items,onEdit:e=>s(e),onChanged:c,onError:r},e.source))}),o&&(0,J.jsx)(IB,{mode:o===`new`?`create`:`edit`,initial:o===`new`?null:o,onClose:()=>s(null),onSaved:async()=>{s(null),await c()},onError:r})]})}function NB({source:e,items:t,onEdit:n,onChanged:r,onError:i}){return(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`div`,{className:`mb-2 flex items-end justify-between`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-[13px] font-semibold uppercase tracking-wide text-fg-muted`,children:e===`plugin`?`From plugins`:`User-configured`}),(0,J.jsx)(`p`,{className:`text-[11px] text-fg-faint`,children:e===`plugin`?`Read-only — managed by the contributing plugin.`:`Add MCP servers (HTTP) to expand the agent's tool surface.`})]})}),t.length===0?(0,J.jsx)(PB,{source:e}):(0,J.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,J.jsx)(FB,{server:e,onEdit:n,onChanged:r,onError:i},`${e.source}.${e.sourceId}.${e.id}`))})]})}function PB({source:e}){return e===`plugin`?(0,J.jsx)(`div`,{className:`rounded-md border border-dashed border-border-subtle px-4 py-6 text-center text-[12px] text-fg-faint`,children:`No plugin currently contributes an MCP server.`}):(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-border-subtle px-4 py-6 text-center text-[12px] text-fg-faint`,children:[`No user-configured MCP servers. Click `,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:`Add server`}),` `,`to point the agent at one (e.g. an MCP server you run locally or remotely).`]})}function FB({server:e,onEdit:t,onChanged:n,onError:r}){let[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),c=e.snapshot,l=c?.tools??[],u=c?.lastError,f=c?.endpoint,p=(0,d.useMemo)(()=>{if(!c?.lastRefreshAt)return null;let e=Math.round((Date.now()-c.lastRefreshAt)/1e3);if(e<60)return`${e}s ago`;let t=Math.round(e/60);return t<60?`${t}m ago`:`${Math.round(t/60)}h ago`},[c?.lastRefreshAt]),m=e.enabled&&!u&&l.length>0,h=e.source===`user`,g=(0,d.useCallback)(async()=>{s(!0);try{let t=await fetch(`/api/mcp/servers/${encodeURIComponent(e.id)}/refresh`,{method:`POST`,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);await n()}catch(e){r(e instanceof Error?e.message:String(e))}finally{s(!1)}},[e.id,n,r]),_=(0,d.useCallback)(async()=>{if(!(!h||!e.userEntry)){s(!0);try{let t=await fetch(`/api/mcp/servers/${encodeURIComponent(e.id)}`,{method:`PATCH`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:!e.enabled})});if(!t.ok)throw Error(`HTTP ${t.status}`);await n()}catch(e){r(e instanceof Error?e.message:String(e))}finally{s(!1)}}},[h,e.userEntry,e.id,e.enabled,n,r]),v=(0,d.useCallback)(async()=>{if(h&&confirm(`Remove MCP server "${e.displayName}"?`)){s(!0);try{let t=await fetch(`/api/mcp/servers/${encodeURIComponent(e.id)}`,{method:`DELETE`,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);await n()}catch(e){r(e instanceof Error?e.message:String(e))}finally{s(!1)}}},[h,e.displayName,e.id,n,r]);return(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border-subtle bg-bg-elevated/60`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-border-subtle px-4 py-3`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`-my-1 -ml-1 mr-2 rounded p-1 text-fg-faint hover:bg-bg-raised/60 hover:text-fg-muted`,"aria-label":i?`Collapse`:`Expand`,children:i?(0,J.jsx)(Al,{size:14}):(0,J.jsx)(Pl,{size:14})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.enabled?m?(0,J.jsx)(Ql,{size:14,className:`text-success`}):(0,J.jsx)(Mu,{size:14,className:`text-danger`}):(0,J.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-fg-fainter`,title:`disabled`}),(0,J.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg-default`,children:e.displayName}),(0,J.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 text-[10px] ${h?`bg-blue-950 text-link`:`bg-bg-raised text-fg-muted`}`,children:h?`user`:`plugin: ${e.sourceId}`})]}),(0,J.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-fg-faint`,children:[(0,J.jsxs)(`span`,{children:[`id `,(0,J.jsx)(`code`,{className:`text-fg-muted`,children:e.id})]}),f&&(0,J.jsxs)(`span`,{children:[`endpoint `,(0,J.jsx)(`code`,{className:`text-fg-muted`,children:f})]}),c?.prefix&&c.prefix!==``&&(0,J.jsxs)(`span`,{children:[`prefix `,(0,J.jsx)(`code`,{className:`text-fg-muted`,children:c.prefix})]}),p&&(0,J.jsxs)(`span`,{children:[`refreshed `,p]}),!e.enabled&&(0,J.jsx)(`span`,{className:`text-fg-faint`,children:`(disabled)`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-shrink-0 items-center gap-1.5`,children:[(0,J.jsxs)(`span`,{className:`rounded-md border border-border-default bg-bg-base px-2 py-1 text-[11px] text-fg-muted`,children:[e.toolCount,` tools`]}),(0,J.jsx)(`button`,{type:`button`,onClick:g,disabled:o,title:`Refresh`,className:`rounded p-1.5 text-fg-muted hover:bg-bg-raised/60 hover:text-fg-default disabled:opacity-50`,children:(0,J.jsx)(GT,{size:12,className:o?`animate-spin`:void 0})}),h&&e.userEntry&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(e.userEntry),disabled:o,title:`Edit`,className:`rounded p-1.5 text-fg-muted hover:bg-bg-raised/60 hover:text-fg-default disabled:opacity-50`,children:(0,J.jsx)(fw,{size:12})}),(0,J.jsx)(`button`,{type:`button`,onClick:_,disabled:o,className:`rounded-md border border-border-default px-2 py-1 text-[11px] text-fg-muted hover:bg-bg-raised/50 disabled:opacity-50`,children:e.enabled?`Disable`:`Enable`}),(0,J.jsx)(`button`,{type:`button`,onClick:v,disabled:o,title:`Delete`,className:`rounded p-1.5 text-danger hover:bg-rose-950/40 disabled:opacity-50`,children:(0,J.jsx)(pM,{size:12})})]})]})]}),u&&(0,J.jsxs)(`div`,{className:`border-b border-border-subtle bg-rose-950/30 px-4 py-2 text-[11px] text-danger`,children:[(0,J.jsx)(SM,{size:12,className:`mr-1 inline-block`}),u]}),i&&(l.length===0?(0,J.jsx)(`div`,{className:`px-4 py-6 text-center text-[12px] text-fg-faint`,children:f?`Server is reachable but advertised no tools.`:e.enabled?e.source===`plugin`?`Upstream not reachable yet. Plugin MCP servers usually live inside a sandbox that boots on first agent action — try running an exec/browser tool, or click Refresh after the sandbox starts.`:`Endpoint unreachable. Click Refresh to re-probe.`:`Server is disabled.`}):(0,J.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,J.jsx)(`thead`,{className:`border-b border-border-subtle text-left text-[11px] uppercase tracking-wide text-fg-faint`,children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tool name`}),(0,J.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Upstream`}),(0,J.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`})]})}),(0,J.jsx)(`tbody`,{children:l.map(e=>(0,J.jsxs)(`tr`,{className:`border-b border-border-subtle last:border-b-0`,children:[(0,J.jsx)(`td`,{className:`px-4 py-2 align-top font-mono text-[11.5px] text-fg-default`,children:e.toolName}),(0,J.jsx)(`td`,{className:`px-4 py-2 align-top font-mono text-[11.5px] text-fg-faint`,children:e.upstream.name}),(0,J.jsx)(`td`,{className:`px-4 py-2 align-top text-fg-muted`,children:e.upstream.description??`—`})]},e.toolName))})]}))]})}function IB({mode:e,initial:t,onClose:n,onSaved:r,onError:i}){let[a,o]=(0,d.useState)(t?.id??``),[s,c]=(0,d.useState)(t?.displayName??``),[l,u]=(0,d.useState)(t?.url??``),[f,p]=(0,d.useState)(t?.prefix??``),[m,h]=(0,d.useState)(t?.upstreamHost??``),[g,_]=(0,d.useState)(t?.enabled??!0),[v,y]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),S=async n=>{if(n.preventDefault(),x(null),!/^[a-z0-9][a-z0-9-]{0,30}$/.test(a)){x(`id must be 1-31 chars: lowercase letters, digits, dashes`);return}y(!0);try{let n={id:a,url:l,enabled:g};s&&(n.displayName=s),f!==t?.prefix&&(n.prefix=f),m&&(n.upstreamHost=m);let i=e===`create`?`/api/mcp/servers`:`/api/mcp/servers/${encodeURIComponent(a)}`,o=await fetch(i,{method:e===`create`?`POST`:`PATCH`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.message??`HTTP ${o.status}`)}await r()}catch(e){i(e instanceof Error?e.message:String(e))}finally{y(!1)}},{Modal:C}=mF();return(0,J.jsx)(C,{isOpen:!0,onClose:n,size:`sm`,title:e===`create`?`Add MCP server`:`Edit ${t?.displayName??a}`,children:(0,J.jsxs)(`form`,{onSubmit:S,className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-5`,children:[(0,J.jsx)(LB,{label:`ID`,hint:`Lowercase letters / digits / dashes; used in URLs and tool prefixes.`,children:(0,J.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:e===`edit`,placeholder:`my-mcp`,className:`w-full rounded-md border border-border-default bg-bg-base px-2 py-1.5 text-[13px] text-fg-default outline-none focus:border-brand-500 disabled:opacity-60`,required:!0})}),(0,J.jsx)(LB,{label:`Display name`,hint:`Optional; defaults to id.`,children:(0,J.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`My MCP server`,className:`w-full rounded-md border border-border-default bg-bg-base px-2 py-1.5 text-[13px] text-fg-default outline-none focus:border-brand-500`})}),(0,J.jsx)(LB,{label:`URL`,hint:`Streamable HTTP MCP endpoint (must include path, e.g. /mcp).`,children:(0,J.jsx)(`input`,{type:`url`,value:l,onChange:e=>u(e.target.value),placeholder:`https://example.com/mcp`,className:`w-full rounded-md border border-border-default bg-bg-base px-2 py-1.5 text-[13px] text-fg-default outline-none focus:border-brand-500`,required:!0})}),(0,J.jsx)(LB,{label:`Tool prefix`,hint:`Prepended to every reflected tool name. Default: "<id>_". Pass empty to disable.`,children:(0,J.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`${a}_`,className:`w-full rounded-md border border-border-default bg-bg-base px-2 py-1.5 text-[13px] text-fg-default outline-none focus:border-brand-500`})}),(0,J.jsx)(LB,{label:`Upstream Host header`,hint:`Optional. Pin the request Host header (most MCP servers validate it; useful behind port-forwards).`,children:(0,J.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`localhost:3200`,className:`w-full rounded-md border border-border-default bg-bg-base px-2 py-1.5 text-[13px] text-fg-default outline-none focus:border-brand-500`})}),(0,J.jsxs)(`label`,{className:`flex items-center gap-2 text-[12px] text-fg-muted`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>_(e.target.checked),className:`rounded border-border-default bg-bg-base`}),`Enabled`]}),b&&(0,J.jsx)(`div`,{className:`rounded-md border border-rose-700/50 bg-rose-950/40 px-3 py-2 text-[11px] text-danger`,children:b}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md border border-border-default px-3 py-1.5 text-[12px] text-fg-muted hover:bg-bg-raised/50`,children:`Cancel`}),(0,J.jsx)(`button`,{type:`submit`,disabled:v,className:`rounded-md bg-brand-600 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-brand-500 disabled:opacity-50`,children:v?`Saving…`:e===`create`?`Add server`:`Save`})]})]})})}function LB({label:e,hint:t,children:n}){return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`mb-1 block text-[11px] font-medium text-fg-muted`,children:e}),n,t&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] text-fg-faint`,children:t})]})}function RB({pluginId:e,className:t}){let n=fr(t=>(t.plugins??[]).find(t=>t.id===e)??null);return!n||!n.configSchema||(n.configSchema.fields?.length??0)===0?null:(0,J.jsx)(`div`,{className:t,children:(0,J.jsx)(zB,{plugin:n})})}function zB({plugin:e}){let t=fr(e=>e.setPlugins),n=e.configSchema?.fields??[],[r,i]=(0,d.useState)(()=>GB(n,e.config)),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null);(0,d.useEffect)(()=>{i(GB(n,e.config)),u(null)},[e.id,e.version,e.config]);let f=!JB(r,GB(n,e.config));async function p(){o(!0),c(null);try{let n=qB(r);t((await or.setPluginConfig(e.id,n)).plugins),u(Date.now())}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}function m(){i(GB(n,e.config)),c(null),u(null)}return n.length===0?(0,J.jsx)(`p`,{className:`text-[12px] text-fg-faint`,children:`This plugin has no user-editable configuration.`}):(0,J.jsxs)(`div`,{className:`space-y-5`,children:[(0,J.jsx)(`div`,{className:`space-y-5`,children:HB(n).map((e,t)=>{if(e.kind===`field`)return(0,J.jsx)(WB,{field:e.field,value:r[e.field.key],onChange:t=>i(n=>({...n,[e.field.key]:t}))},`f:${t}:${e.field.key}`);let[n,...a]=e.fields,o=n&&n.kind===`boolean`?{field:n,value:r[n.key]===!0,onChange:e=>i(t=>({...t,[n.key]:e}))}:null,s=o?a:e.fields;return(0,J.jsx)(UB,{group:e.group,headerToggle:o,children:s.map(e=>(0,J.jsx)(WB,{field:e,value:r[e.key],onChange:t=>i(n=>({...n,[e.key]:t}))},e.key))},`g:${e.group.id}`)})}),s&&(0,J.jsx)(`div`,{className:`rounded-md border border-rose-700/50 bg-rose-950/40 px-3 py-2 text-[12px] text-danger`,children:s}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border-subtle pt-3`,children:[l&&!f&&(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-success`,children:[(0,J.jsx)(Ql,{size:12}),` Saved`]}),(0,J.jsx)(`button`,{type:`button`,onClick:m,disabled:!f||a,className:`ml-auto inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-border-default px-3 py-1.5 text-[12px] text-fg-muted hover:bg-bg-raised/50 disabled:cursor-not-allowed disabled:opacity-50`,children:`Reset`}),(0,J.jsx)(`button`,{type:`button`,onClick:p,disabled:!f||a,className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md bg-brand-600 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-brand-500 disabled:cursor-not-allowed disabled:opacity-50`,children:a?(0,J.jsx)(q,{className:`inline h-3 w-3 animate-spin`}):`Save`})]})]})}var BB=`w-full rounded-md border border-border-default bg-bg-elevated px-3 py-1.5 text-[12px] text-fg-default outline-none placeholder:text-fg-fainter focus:border-brand-500`;function VB({active:e,onClick:t,ariaLabel:n}){return(0,J.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,onClick:t,className:[`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer items-center rounded-full transition-colors`,e?`bg-brand-600`:`bg-bg-hover`].join(` `),children:(0,J.jsx)(`span`,{className:[`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform`,e?`translate-x-5`:`translate-x-1`].join(` `)})})}function HB(e){let t=[],n=new Map;for(let r of e){let e=r.group;if(!e){t.push({kind:`field`,field:r});continue}let i=n.get(e.id);i===void 0?(n.set(e.id,t.length),t.push({kind:`group`,group:e,fields:[r]})):t[i].fields.push(r)}return t}function UB({group:e,headerToggle:t,children:n}){let r=!n||Array.isArray(n)&&n.every(e=>e==null||e===!1);return(0,J.jsxs)(`section`,{className:`rounded-md border border-border-subtle bg-bg-elevated/30 p-4`,children:[(0,J.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[e.badge&&(0,J.jsx)(`span`,{className:`rounded border border-border-default bg-bg-raised/60 px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wide text-fg-muted`,children:e.badge}),(0,J.jsx)(`h3`,{className:`text-[13px] font-semibold text-fg-default`,children:e.label}),t&&(0,J.jsx)(VB,{active:t.value,onClick:()=>t.onChange(!t.value),ariaLabel:t.field.label})]}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-fg-faint`,children:e.description}),!r&&(0,J.jsx)(`div`,{className:`mt-3 space-y-4`,children:n})]})}function WB({field:e,value:t,onChange:n}){if(e.kind===`boolean`){let r=t===!0;return(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3 text-[12px]`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`font-medium text-fg-default`,children:e.label}),e.description&&(0,J.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-relaxed text-fg-faint`,children:e.description})]}),(0,J.jsx)(VB,{active:r,onClick:()=>n(!r),ariaLabel:e.label})]})}if(e.kind===`number`){let r=typeof t==`number`?t:typeof t==`string`&&t.trim()!==``?Number(t):e.default??0;return(0,J.jsxs)(`div`,{className:`text-[12px]`,children:[(0,J.jsx)(`label`,{className:`mb-1 block font-medium text-fg-default`,children:e.label}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`input`,{type:`number`,value:Number.isFinite(r)?r:0,min:e.min,max:e.max,step:e.step,onChange:e=>n(Number(e.target.value)),className:`${BB} w-40`}),e.unit&&(0,J.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:e.unit})]}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-fg-faint`,children:e.description})]})}if(e.kind===`select`){let r=typeof t==`string`?t:e.default??e.options[0]?.value??``;return(0,J.jsxs)(`div`,{className:`text-[12px]`,children:[(0,J.jsx)(`label`,{className:`mb-1 block font-medium text-fg-default`,children:e.label}),(0,J.jsx)(`select`,{value:r,onChange:e=>n(e.target.value),className:BB,children:e.options.map(e=>(0,J.jsx)(`option`,{value:e.value,children:e.label},e.value))}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-fg-faint`,children:e.description})]})}if(e.kind===`secret`){let r=typeof t==`object`&&!!t&&t.__secret===!0&&t.set===!0,i=typeof t==`string`?t:``;return(0,J.jsxs)(`div`,{className:`text-[12px]`,children:[(0,J.jsxs)(`label`,{className:`mb-1 block font-medium text-fg-default`,children:[e.label,r?(0,J.jsx)(`span`,{className:`ml-2 rounded bg-emerald-700/40 px-1.5 py-0.5 text-[10px] uppercase text-success`,children:`set`}):null]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`input`,{type:`password`,value:i,placeholder:r?`••• stored — type a new value to replace, or click Clear`:e.placeholder??``,autoComplete:`new-password`,spellCheck:!1,onChange:e=>n(e.target.value),className:BB}),r&&i===``&&(0,J.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border-default bg-bg-elevated px-2 py-1 text-[11px] text-fg-muted hover:border-rose-700 hover:text-danger`,onClick:()=>n({__secret:!0,clear:!0}),children:`Clear`})]}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-fg-faint`,children:e.description})]})}let r=typeof t==`string`?t:e.default??``;return(0,J.jsxs)(`div`,{className:`text-[12px]`,children:[(0,J.jsx)(`label`,{className:`mb-1 block font-medium text-fg-default`,children:e.label}),e.multiline?(0,J.jsx)(`textarea`,{value:r,rows:3,placeholder:e.placeholder,onChange:e=>n(e.target.value),className:`${BB} resize-y`}):(0,J.jsx)(`input`,{type:`text`,value:r,placeholder:e.placeholder,onChange:e=>n(e.target.value),className:BB}),e.description&&(0,J.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-fg-faint`,children:e.description})]})}function GB(e,t){let n={};for(let r of e){let e=KB(t,r.key);if(e!==void 0){n[r.key]=e;continue}r.kind===`boolean`?n[r.key]=r.default??!1:r.kind===`number`?n[r.key]=r.default??0:r.kind===`secret`?n[r.key]=``:r.kind===`select`?n[r.key]=r.default??r.options[0]?.value??``:n[r.key]=r.default??``}return n}function KB(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function qB(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.split(`.`),i=t;for(let t=0;t<e.length-1;t++){let n=e[t];(typeof i[n]!=`object`||i[n]===null||Array.isArray(i[n]))&&(i[n]={}),i=i[n]}i[e[e.length-1]]=r}return t}function JB(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}var YB=[{pluginId:`core`,pluginDisplayName:`Tianshu`,pageId:`mcp`,displayName:`MCP Servers`,icon:`Server`,kind:`core`,component:`McpServersPage`,coreComponent:MB,group:`Agent`,order:10,clientEntry:null}],XB=`Plugins`;function ZB(e){let t=[...YB];if(e)for(let n of e){if(n.state!==`active`)continue;let e=n.contributes.adminPages??[];for(let r of e)t.push({pluginId:n.id,pluginDisplayName:n.displayName,pageId:r.id,displayName:r.displayName,icon:r.icon,kind:`plugin`,component:r.component,group:XB,order:r.order??100,clientEntry:n.clientEntry});let r=!!n.configSchema&&(n.configSchema?.fields?.length??0)>0,i=e.length>0,a=e.some(e=>e.id===`settings`);r&&!i&&!a&&t.push({pluginId:n.id,pluginDisplayName:n.displayName,pageId:`settings`,displayName:n.displayName,icon:`Settings`,kind:`core`,component:`PluginConfigSettingsPage`,coreComponent:(e=>(0,J.jsx)(aV,{...e,pluginId:n.id})),group:XB,order:90,clientEntry:null})}return t.sort((e,t)=>{let n=e.group??``,r=t.group??``;return n===r?e.order===t.order?e.displayName.localeCompare(t.displayName):e.order-t.order:n===``?-1:r===``?1:n.localeCompare(r)}),t}function QB(){let e=A(e=>e.me),t=A(e=>e.init),n=fr(e=>e.plugins),r=fr(e=>e.load);(0,d.useEffect)(()=>{t(),r()},[t,r]);let i=(0,d.useMemo)(()=>ZB(n),[n]);return(0,J.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-bg-base text-fg-default`,children:[(0,J.jsx)($B,{pages:i,userLabel:e?.userId??null}),(0,J.jsx)(`main`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,J.jsxs)(Ht,{children:[(0,J.jsx)(Bt,{index:!0,element:i.length>0?(0,J.jsx)(zt,{to:OB(`/admin/${i[0].pluginId}/${i[0].pageId}`),replace:!0}):(0,J.jsx)(nV,{})}),(0,J.jsx)(Bt,{path:`:pluginId/:pageId`,element:(0,J.jsx)(tV,{pages:i})}),(0,J.jsx)(Bt,{path:`*`,element:(0,J.jsx)(zt,{to:``,replace:!0})})]})})]})}function $B({pages:e,userLabel:t}){let n=_z()(`admin.title`),r=[];for(let t of e){let e=r[r.length-1],n=t.group??null;e&&e.group===n?e.pages.push(t):r.push({group:n,pages:[t]})}return(0,J.jsxs)(`aside`,{className:`flex w-56 flex-shrink-0 flex-col border-r border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex h-14 items-center gap-2 border-b border-border-subtle px-4`,children:[(0,J.jsx)(DD,{size:16,className:`text-link`}),(0,J.jsx)(`span`,{className:`text-sm font-semibold text-fg-default`,children:n})]}),(0,J.jsxs)(`nav`,{className:`flex-1 space-y-3 overflow-y-auto p-2`,children:[r.length===0&&(0,J.jsxs)(`p`,{className:`px-3 py-2 text-[11px] leading-relaxed text-fg-faint`,children:[`No admin pages contributed yet. Enable a plugin that ships `,(0,J.jsx)(`code`,{children:`contributes.adminPages`}),` to see entries here.`]}),r.map((e,t)=>(0,J.jsxs)(`div`,{children:[e.group&&(0,J.jsx)(`div`,{className:`px-3 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wide text-fg-faint`,children:e.group}),(0,J.jsx)(`div`,{className:`space-y-0.5`,children:e.pages.map(e=>(0,J.jsx)(eV,{page:e},`${e.pluginId}.${e.pageId}`))})]},t))]}),(0,J.jsx)(`div`,{className:`border-t border-border-subtle p-2`,children:(0,J.jsxs)(Nn,{to:`..`,className:`flex items-center gap-2 rounded-md px-3 py-2 text-xs text-fg-faint hover:bg-bg-raised/50 hover:text-fg-muted`,end:!0,children:[(0,J.jsx)(Wi,{size:12}),`Back to chat`]})}),t&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border-subtle px-3 py-2`,children:[(0,J.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-[10px] font-semibold text-white`,children:t.slice(0,1).toUpperCase()}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`truncate text-[11px] text-fg-muted`,children:t}),(0,J.jsx)(`div`,{className:`text-[10px] text-fg-fainter`,children:`admin`})]})]})]})}function eV({page:e}){let t=iV(e.icon);return(0,J.jsxs)(Nn,{to:OB(`/admin/${e.pluginId}/${e.pageId}`),className:({isActive:e})=>`flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors ${e?`bg-bg-raised text-fg-default`:`text-fg-muted hover:bg-bg-raised/50 hover:text-fg-default`}`,children:[t&&(0,J.jsx)(t,{size:14,className:`flex-shrink-0`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.displayName})]})}function tV({pages:e}){let t=ht(),n=pt(),r=A(e=>e.me),i=e.find(e=>e.pluginId===t.pluginId&&e.pageId===t.pageId);if((0,d.useEffect)(()=>{!i&&e.length>0&&n(OB(`/admin`),{replace:!0})},[i,e,n]),!i)return(0,J.jsx)(nV,{});let a=i.kind===`core`?i.coreComponent??null:KR(i.clientEntry,i.component);return a?(0,J.jsx)(a,{tenantId:r?.tenantId??``,userId:r?.userId??``,pageId:i.pageId,plugin:{id:i.pluginId,version:``,displayName:i.pluginDisplayName}}):(0,J.jsx)(rV,{title:`Component "${i.component}" not found`,message:`Plugin ${i.pluginId}'s client bundle does not export ${i.component}. Did you forget to add it to PluginClientExports.components?`})}function nV(){return(0,J.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col items-center justify-center px-6 py-24 text-center text-fg-muted`,children:[(0,J.jsx)(vD,{size:32,className:`mb-3 text-fg-fainter`}),(0,J.jsx)(`h2`,{className:`mb-2 text-base font-semibold text-fg-default`,children:`Nothing to manage yet`}),(0,J.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-faint`,children:`The admin shell is empty until a plugin contributes an admin page. Open the Plugin Manager from the chat shell to enable a plugin that ships one (e.g. MicroSandbox).`})]})}function rV({title:e,message:t}){return(0,J.jsx)(`div`,{className:`mx-auto max-w-2xl px-6 py-12`,children:(0,J.jsxs)(`div`,{className:`rounded-md border border-rose-700/50 bg-rose-950/40 p-4 text-sm text-danger`,children:[(0,J.jsx)(`strong`,{className:`mb-1 block`,children:e}),(0,J.jsx)(`p`,{className:`leading-relaxed text-danger`,children:t})]})})}function iV(e){return e?YP[e]??null:null}function aV({pluginId:e}){let t=fr(e=>e.plugins)?.find(t=>t.id===e);return(0,J.jsxs)(`div`,{className:`mx-auto max-w-5xl p-6`,children:[(0,J.jsxs)(`div`,{className:`mb-6`,children:[(0,J.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold text-fg-default`,children:[(0,J.jsx)(vD,{size:18,className:`text-brand-400`}),t?t.displayName:e]}),t?.description&&(0,J.jsx)(`p`,{className:`mt-1 max-w-3xl text-[12px] text-fg-faint`,children:t.description})]}),t?(0,J.jsxs)(`section`,{children:[(0,J.jsxs)(`div`,{className:`mb-2`,children:[(0,J.jsx)(`h2`,{className:`text-[13px] font-semibold uppercase tracking-wide text-fg-muted`,children:`Configuration`}),(0,J.jsx)(`p`,{className:`text-[11px] text-fg-faint`,children:`Saving re-activates the plugin so changes take effect on the next request.`})]}),(0,J.jsx)(`div`,{className:`rounded-md border border-border-subtle bg-bg-elevated/30 p-4`,children:(0,J.jsx)(zB,{plugin:t})})]}):(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-border-subtle px-4 py-6 text-center text-[12px] text-fg-faint`,children:[`Plugin `,(0,J.jsx)(`code`,{children:e}),` is not active.`]})]})}var oV=5e5;function sV(e){return e.startsWith(`text/`)||e.startsWith(`application/json`)?`text`:e.startsWith(`image/`)?`image`:e===`application/pdf`?`pdf`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:`binary`}function cV(e){switch(e.toLowerCase().match(/\.[a-z0-9]+$/)?.[0]??``){case`.png`:return`image/png`;case`.jpg`:case`.jpeg`:return`image/jpeg`;case`.gif`:return`image/gif`;case`.webp`:return`image/webp`;case`.svg`:return`image/svg+xml`;case`.pdf`:return`application/pdf`;case`.mp4`:return`video/mp4`;case`.webm`:return`video/webm`;case`.mp3`:return`audio/mpeg`;case`.wav`:return`audio/wav`;case`.ogg`:return`audio/ogg`;case`.json`:return`application/json; charset=utf-8`;case`.md`:return`text/markdown; charset=utf-8`;case`.html`:return`text/html; charset=utf-8`;case`.css`:return`text/css; charset=utf-8`;case`.js`:case`.jsx`:case`.ts`:case`.tsx`:return`text/javascript; charset=utf-8`;case`.csv`:return`text/csv; charset=utf-8`;case``:return`application/octet-stream`;default:return`text/plain; charset=utf-8`}}function lV(e){let t=e.replace(/^workspace:\/\/+/,`/`),n=t.split(`/`).filter(Boolean);return n[n.length-1]??t}function uV(e){let t=e.replace(/^workspace:\/\/+/,`/`);return`/api/p/files/raw?path=${encodeURIComponent(t)}`}function dV(){let{Modal:e,DocumentViewer:t}=mF(),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)({kind:`loading`});(0,d.useEffect)(()=>{let e=e=>{let t=e.detail;t?.path&&r({path:t.path})};return window.addEventListener(`tianshu:files:open`,e),()=>window.removeEventListener(`tianshu:files:open`,e)},[]),(0,d.useEffect)(()=>{if(!n)return;a({kind:`loading`});let e=new AbortController,t=n.path.replace(/^workspace:\/\/+/,`/`);return(async()=>{try{let n=await fetch(`/api/p/files/read?path=${encodeURIComponent(t)}`,{credentials:`include`,signal:e.signal});if(n.status===404){a({kind:`error`,message:`File not found.`});return}if(n.status===413){a({kind:`binary`,mime:`application/octet-stream`,size:(await n.json()).size??0});return}if(!n.ok){a({kind:`error`,message:`read failed: HTTP ${n.status}`});return}let r=await n.json(),i=r.size??0;if(!r.binary){let e=cV(t);a({kind:`text`,content:r.content??``,truncated:!!r.truncated,size:i,mime:e});return}let o=cV(t),s=sV(o);if(s===`image`||s===`pdf`||s===`video`||s===`audio`){a({kind:s,mime:o});return}a({kind:`binary`,mime:o,size:i})}catch(e){if(e.name===`AbortError`)return;a({kind:`error`,message:e instanceof Error?e.message:String(e)})}})(),()=>e.abort()},[n]);let o=(0,d.useCallback)(()=>r(null),[]);if((0,d.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&o()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,o]),!n)return null;let s=lV(n.path),c=n.path.replace(/^workspace:\/\/+/,`/`),l=uV(c);return(0,J.jsx)(e,{isOpen:!0,onClose:o,size:`xl`,title:s,className:`bg-bg-elevated`,headerActions:(0,J.jsx)(`a`,{href:l,download:s,className:`btn-ghost p-1.5`,title:`Download`,"aria-label":`Download`,children:(0,J.jsx)(gp,{size:16})}),children:(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-1.5 text-[10px] text-fg-faint`,children:[(0,J.jsx)(nh,{size:12,className:`shrink-0 text-fg-faint`}),(0,J.jsx)(`span`,{className:`truncate font-mono`,title:c,children:c})]}),(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-bg-base`,children:[i.kind===`text`&&i.truncated&&(0,J.jsxs)(`div`,{className:`mx-3 mt-3 rounded border border-amber-900/40 bg-amber-950/30 px-2 py-1 text-[11px] text-amber-200`,children:[`Truncated at `,oV.toLocaleString(),` bytes — use the Download button to fetch the full file.`]}),i.kind===`error`?(0,J.jsx)(`div`,{className:`m-3 rounded border border-red-900/50 bg-red-950/40 px-3 py-2 text-[12px] text-red-300`,children:i.message}):(0,J.jsx)(t,{content:i.kind===`text`?i.content:null,filename:s,mimeType:i.kind===`loading`?void 0:i.mime,binary:i.kind===`binary`,loading:i.kind===`loading`,sizeBytes:i.kind===`text`||i.kind===`binary`?i.size:void 0,rawUrl:l})]})]})})}function fV(){return(0,J.jsxs)(An,{children:[(0,J.jsxs)(Ht,{children:[(0,J.jsxs)(Bt,{path:`/tenants/:tenantId/users/:userId`,children:[(0,J.jsx)(Bt,{index:!0,element:(0,J.jsx)(bB,{})}),(0,J.jsx)(Bt,{path:`admin/*`,element:(0,J.jsx)(QB,{})}),(0,J.jsx)(Bt,{path:`*`,element:(0,J.jsx)(zt,{to:``,replace:!0})})]}),(0,J.jsx)(Bt,{path:`*`,element:(0,J.jsx)(zt,{to:OB(`/`),replace:!0})})]}),(0,J.jsx)(dV,{})]})}var pV={sm:`max-w-md max-h-[85vh]`,md:`max-w-2xl max-h-[85vh]`,lg:`max-w-3xl h-[85vh]`,xl:`max-w-5xl h-[85vh]`},mV=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function hV({isOpen:e,onClose:t,title:n,size:r=`md`,className:i=``,hideHeader:a=!1,headerActions:o,allowMaximize:s=!0,children:c}){let[l,u]=(0,d.useState)(!1);(0,d.useEffect)(()=>{e||u(!1)},[e]);let p=(0,d.useRef)(null),m=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]),(0,d.useEffect)(()=>{if(!e)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let n=e=>{e.key===`Escape`&&(e.stopPropagation(),t())};window.addEventListener(`keydown`,n);let r=window.setTimeout(()=>{let e=p.current;e&&e.querySelector(mV)?.focus()},0);return()=>{window.removeEventListener(`keydown`,n),window.clearTimeout(r);let e=m.current;e&&document.body.contains(e)&&e.focus()}},[e,t]);function h(e){if(e.key!==`Tab`)return;let t=p.current;if(!t)return;let n=Array.from(t.querySelectorAll(mV)).filter(e=>!e.hasAttribute(`inert`));if(n.length===0)return;let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(i.focus(),e.preventDefault()):document.activeElement===i&&(r.focus(),e.preventDefault())}function g(e){e.target===e.currentTarget&&t()}return e?(0,f.createPortal)((0,J.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-[color:var(--color-bg-overlay)] p-4 backdrop-blur-sm`,onMouseDown:g,role:`dialog`,"aria-modal":`true`,"aria-label":n,children:(0,J.jsxs)(`div`,{ref:p,className:`flex flex-col overflow-hidden border border-border-default bg-bg-elevated shadow-2xl ${l?`h-screen w-screen rounded-none`:`w-full rounded-xl ${pV[r]}`} ${i}`,onKeyDown:h,children:[!a&&(0,J.jsxs)(`div`,{onDoubleClick:e=>{s&&(e.target.closest(`button, a`)||u(e=>!e))},className:`flex items-center gap-2 border-b border-border-subtle px-4 py-2.5`,children:[(0,J.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg-default`,children:n}),o&&(0,J.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:o}),s&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`btn-ghost shrink-0 p-1.5`,"aria-label":l?`Restore`:`Maximize`,title:l?`Restore`:`Maximize`,children:l?(0,J.jsx)(qx,{size:16}):(0,J.jsx)(Qb,{size:16})}),(0,J.jsx)(`button`,{type:`button`,onClick:t,className:`btn-ghost shrink-0 p-1.5`,"aria-label":`Close`,children:(0,J.jsx)(AP,{size:16})})]}),(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:c})]})}),document.body):null}function gV(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _V=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yV={};function bV(e,t){return((t||yV).jsx?vV:_V).test(e)}var xV=/[ \t\n\f\r]/g;function SV(e){return typeof e==`object`?e.type===`text`?CV(e.value):!1:CV(e)}function CV(e){return e.replace(xV,``)===``}var wV=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};wV.prototype.normal={},wV.prototype.property={},wV.prototype.space=void 0;function TV(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new wV(n,r,t)}function EV(e){return e.toLowerCase()}var DV=class{constructor(e,t){this.attribute=t,this.property=e}};DV.prototype.attribute=``,DV.prototype.booleanish=!1,DV.prototype.boolean=!1,DV.prototype.commaOrSpaceSeparated=!1,DV.prototype.commaSeparated=!1,DV.prototype.defined=!1,DV.prototype.mustUseProperty=!1,DV.prototype.number=!1,DV.prototype.overloadedBoolean=!1,DV.prototype.property=``,DV.prototype.spaceSeparated=!1,DV.prototype.space=void 0;var OV=e({boolean:()=>Y,booleanish:()=>AV,commaOrSpaceSeparated:()=>PV,commaSeparated:()=>NV,number:()=>X,overloadedBoolean:()=>jV,spaceSeparated:()=>MV}),kV=0,Y=FV(),AV=FV(),jV=FV(),X=FV(),MV=FV(),NV=FV(),PV=FV();function FV(){return 2**++kV}var IV=Object.keys(OV),LV=class extends DV{constructor(e,t,n,r){let i=-1;if(super(e,t),RV(this,`space`,r),typeof n==`number`)for(;++i<IV.length;){let e=IV[i];RV(this,IV[i],(n&OV[e])===OV[e])}}};LV.prototype.defined=!0;function RV(e,t,n){n&&(e[t]=n)}function zV(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new LV(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[EV(r)]=r,n[EV(a.attribute)]=r}return new wV(t,n,e.space)}var BV=zV({properties:{ariaActiveDescendant:null,ariaAtomic:AV,ariaAutoComplete:null,ariaBusy:AV,ariaChecked:AV,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:MV,ariaCurrent:null,ariaDescribedBy:MV,ariaDetails:null,ariaDisabled:AV,ariaDropEffect:MV,ariaErrorMessage:null,ariaExpanded:AV,ariaFlowTo:MV,ariaGrabbed:AV,ariaHasPopup:null,ariaHidden:AV,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:MV,ariaLevel:X,ariaLive:null,ariaModal:AV,ariaMultiLine:AV,ariaMultiSelectable:AV,ariaOrientation:null,ariaOwns:MV,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:AV,ariaReadOnly:AV,ariaRelevant:null,ariaRequired:AV,ariaRoleDescription:MV,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:AV,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 VV(e,t){return t in e?e[t]:t}function HV(e,t){return VV(e,t.toLowerCase())}var UV=zV({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:NV,acceptCharset:MV,accessKey:MV,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alpha:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:MV,autoFocus:Y,autoPlay:Y,blocking:MV,capture:null,charSet:null,checked:Y,cite:null,className:MV,closedBy:null,colorSpace:null,cols:X,colSpan:X,command:null,commandFor:null,content:null,contentEditable:AV,controls:Y,controlsList:MV,coords:X|NV,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:jV,draggable:AV,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:MV,height:X,hidden:jV,high:X,href:null,hrefLang:null,htmlFor:MV,httpEquiv:MV,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:MV,itemRef:MV,itemScope:Y,itemType:MV,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,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:Y,optimum:X,pattern:null,ping:MV,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:MV,required:Y,reversed:Y,rows:X,rowSpan:X,sandbox:MV,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootCustomElementRegistry:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shadowRootSerializable:Y,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:AV,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:Y,useMap:null,value:AV,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:MV,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:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:AV,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Y,disablePictureInPicture:Y,disableRemotePlayback:Y,exportParts:NV,part:MV,prefix:null,property:null,results:X,security:null,unselectable:null},space:`html`,transform:HV}),WV=zV({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`,maskType:`mask-type`,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:PV,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:MV,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:Y,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:NV,g2:NV,glyphName:NV,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:PV,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,maskType: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:MV,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:PV,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:PV,rev:PV,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:PV,requiredFeatures:PV,requiredFonts:PV,requiredFormats:PV,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:PV,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:PV,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:PV,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:VV}),GV=zV({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()}}),KV=zV({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:HV}),qV=zV({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),JV={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},YV=/[A-Z]/g,XV=/-[a-z]/g,ZV=/^data[-\w.:]+$/i;function QV(e,t){let n=EV(t),r=t,i=DV;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ZV.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(XV,eH);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!XV.test(e)){let n=e.replace(YV,$V);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=LV}return new i(r,t)}function $V(e){return`-`+e.toLowerCase()}function eH(e){return e.charAt(1).toUpperCase()}var tH=TV([BV,UV,GV,KV,qV],`html`),nH=TV([BV,WV,GV,KV,qV],`svg`);function rH(e){return e.join(` `).trim()}var iH=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`/`,d=`*`,f=``;function p(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,p=1;function h(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
45
45
|
`);p=~n?e.length-n:p+e.length}function g(){var e={line:l,column:p};return function(t){return t.position=new _(e),b(),t}}function _(e){this.start=e,this.end={line:l,column:p},this.source=t.source}_.prototype.content=e;function v(n){var r=Error(t.source+`:`+l+`:`+p+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=p,r.source=e,!t.silent)throw r}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(i)}function x(e){var t;for(e||=[];t=S();)t!==!1&&e.push(t);return e}function S(){var t=g();if(!(u!=e.charAt(0)||d!=e.charAt(1))){for(var n=2;f!=e.charAt(n)&&(d!=e.charAt(n)||u!=e.charAt(n+1));)++n;if(n+=2,f===e.charAt(n-1))return v(`End of comment missing`);var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:`comment`,comment:r})}}function C(){var e=g(),t=y(a);if(t){if(S(),!y(o))return v(`property missing ':'`);var r=y(s),i=e({type:`declaration`,property:m(t[0].replace(n,f)),value:r?m(r[0].replace(n,f)):f});return y(c),i}}function w(){var e=[];x(e);for(var t;t=C();)t!==!1&&(e.push(t),x(e));return e}return b(),w()}function m(e){return e?e.replace(l,f):f}t.exports=p})),aH=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(iH());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),oH=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),sH=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(aH()),r=oH();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),cH=uH(`end`),lH=uH(`start`);function uH(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function dH(e){let t=lH(e),n=cH(e);if(t&&n)return{start:t,end:n}}function fH(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?mH(e.position):`start`in e||`end`in e?mH(e):`line`in e||`column`in e?pH(e):``}function pH(e){return hH(e&&e.line)+`:`+hH(e&&e.column)}function mH(e){return pH(e&&e.start)+`-`+pH(e&&e.end)}function hH(e){return e&&typeof e==`number`?e:1}var gH=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=fH(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};gH.prototype.file=``,gH.prototype.name=``,gH.prototype.reason=``,gH.prototype.message=``,gH.prototype.stack=``,gH.prototype.column=void 0,gH.prototype.line=void 0,gH.prototype.ancestors=void 0,gH.prototype.cause=void 0,gH.prototype.fatal=void 0,gH.prototype.place=void 0,gH.prototype.ruleId=void 0,gH.prototype.source=void 0;var _H=t(sH(),1),vH={}.hasOwnProperty,yH=new Map,bH=/[A-Z]/g,xH=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),SH=new Set([`td`,`th`]);function CH(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=PH(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=NH(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?nH:tH,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wH(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wH(e,t,n){if(t.type===`element`)return TH(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return EH(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return OH(e,t,n);if(t.type===`mdxjsEsm`)return DH(e,t);if(t.type===`root`)return kH(e,t,n);if(t.type===`text`)return AH(e,t)}function TH(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=nH,e.schema=i),e.ancestors.push(t);let a=BH(e,t.tagName,!1),o=FH(e,t),s=LH(e,t);return xH.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!SV(e):!0})),jH(e,o,a,t),MH(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function EH(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}VH(e,t.position)}function DH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);VH(e,t.position)}function OH(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=nH,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:BH(e,t.name,!0),o=IH(e,t),s=LH(e,t);return jH(e,o,a,t),MH(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function kH(e,t,n){let r={};return MH(r,LH(e,t)),e.create(t,e.Fragment,r,n)}function AH(e,t){return t.value}function jH(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function MH(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function NH(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function PH(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=lH(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function FH(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&vH.call(t.properties,i)){let a=RH(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&SH.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function IH(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else VH(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else VH(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function LH(e,t){let n=[],r=-1,i=e.passKeys?new Map:yH;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=wH(e,a,o);s!==void 0&&n.push(s)}return n}function RH(e,t,n){let r=QV(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?gV(n):rH(n)),r.property===`style`){let t=typeof n==`object`?n:zH(e,String(n));return e.stylePropertyNameCase===`css`&&(t=HH(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?JV[r.property]||r.property:r.attribute,n]}}function zH(e,t){try{return(0,_H.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new gH("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function BH(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=bV(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=bV(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return vH.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);VH(e)}function VH(e,t){let n=new gH("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function HH(e){let t={},n;for(n in e)vH.call(e,n)&&(t[UH(n)]=e[n]);return t}function UH(e){let t=e.replace(bH,WH);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function WH(e){return`-`+e.toLowerCase()}var GH={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},KH={};function qH(e,t){let n=t||KH;return JH(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function JH(e,t,n){if(XH(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return YH(e.children,t,n)}return Array.isArray(e)?YH(e,t,n):``}function YH(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=JH(e[i],t,n);return r.join(``)}function XH(e){return!!(e&&typeof e==`object`)}function ZH(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function QH(e,t){return e.length>0?(ZH(e,e.length,0,t),e):t}var $H={}.hasOwnProperty;function eU(e){let t={},n=-1;for(;++n<e.length;)tU(t,e[n]);return t}function tU(e,t){let n;for(n in t){let r=($H.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){$H.call(r,a)||(r[a]=[]);let e=i[a];nU(r[a],Array.isArray(e)?e:e?[e]:[])}}}function nU(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);ZH(e,0,0,r)}var rU=pU(/[A-Za-z]/),iU=pU(/[\dA-Za-z]/),aU=pU(/[#-'*+\--9=?A-Z^-~]/);function oU(e){return e!==null&&(e<32||e===127)}var sU=pU(/\d/),cU=pU(/[\dA-Fa-f]/),lU=pU(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function uU(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var dU=pU(/\p{P}|\p{S}/u),fU=pU(/\s/);function pU(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function $(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var mU={tokenize:hU};function hU(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var gU={tokenize:vU},_U={tokenize:yU};function vU(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return ZH(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_U,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_U,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;ZH(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yU(e,t,n){return $(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function bU(e){if(e===null||uU(e)||fU(e))return 1;if(dU(e))return 2}function xU(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var SU={name:`attention`,resolveAll:CU,tokenize:wU};function CU(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};TU(d,-c),TU(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=QH(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=QH(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=QH(l,xU(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=QH(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=QH(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,ZH(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function wU(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=bU(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=bU(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function TU(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var EU={name:`autolink`,tokenize:DU};function DU(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return rU(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||iU(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||iU(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||oU(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):aU(t)?(e.consume(t),l):n(t)}function u(e){return iU(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||iU(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var OU={partial:!0,tokenize:kU};function kU(e,t,n){return r;function r(t){return Q(t)?$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}var AU={continuation:{tokenize:MU},exit:NU,name:`blockQuote`,tokenize:jU};function jU(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function MU(e,t,n){let r=this;return i;function i(t){return Q(t)?$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(AU,t,n)(r)}}function NU(e){e.exit(`blockQuote`)}var PU={name:`characterEscape`,tokenize:FU};function FU(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return lU(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var IU=document.createElement(`i`);function LU(e){let t=`&`+e+`;`;IU.innerHTML=t;let n=IU.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var RU={name:`characterReference`,tokenize:zU};function zU(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=iU,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=cU,u):(e.enter(`characterReferenceValue`),a=7,o=sU,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===iU&&!LU(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var BU={partial:!0,tokenize:UU},VU={concrete:!0,name:`codeFenced`,tokenize:HU};function HU(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(BU,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Q(t)?$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(BU,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Q(t)?$(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function UU(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var WU={name:`codeIndented`,tokenize:KU},GU={partial:!0,tokenize:qU};function KU(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Z(t)?e.attempt(GU,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function qU(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Z(e)?i(e):n(e)}}var JU={name:`codeText`,previous:XU,resolve:YU,tokenize:ZU};function YU(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function XU(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ZU(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var QU=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&$U(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),$U(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),$U(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);$U(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);$U(this.left,t.reverse())}}};function $U(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eW(e){let t={},n=-1,r,i,a,o,s,c,l,u=new QU(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,tW(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return ZH(e,0,1/0,u.slice(0)),!l}function tW(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var nW={resolve:iW,tokenize:aW},rW={partial:!0,tokenize:oW};function iW(e){return eW(e),e}function aW(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Z(t)?e.check(rW,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function oW(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,a,`linePrefix`)}function a(i){if(i===null||Z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function sW(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||oU(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||uU(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||oU(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function cW(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function lW(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function uW(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}function dW(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var fW={name:`definition`,tokenize:mW},pW={partial:!0,tokenize:hW};function mW(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return cW.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=dW(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return uU(t)?uW(e,l)(t):l(t)}function l(t){return sW(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(pW,d,d)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function hW(e,t,n){return r;function r(t){return uU(t)?uW(e,i)(t):n(t)}function i(t){return lW(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}var gW={name:`hardBreakEscape`,tokenize:_W};function _W(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var vW={name:`headingAtx`,resolve:yW,tokenize:bW};function yW(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},ZH(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function bW(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||uU(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):Q(n)?$(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||uU(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var xW=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),SW=[`pre`,`script`,`style`,`textarea`],CW={concrete:!0,name:`htmlFlow`,resolveTo:EW,tokenize:DW},wW={partial:!0,tokenize:kW},TW={partial:!0,tokenize:OW};function EW(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function DW(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:O):rU(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):rU(a)?(e.consume(a),i=4,r.interrupt?t:O):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:O):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return rU(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||uU(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&SW.includes(l)?(i=1,r.interrupt?t(s):D(s)):xW.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||iU(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||rU(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||iU(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||uU(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Z(t)?D(t):Q(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),ae):t===62&&i===4?(e.consume(t),k):t===63&&i===3?(e.consume(t),O):t===93&&i===5?(e.consume(t),se):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(wW,ce,te)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(TW,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||Z(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),O):D(t)}function ae(t){return t===47?(e.consume(t),o=``,oe):D(t)}function oe(t){if(t===62){let n=o.toLowerCase();return SW.includes(n)?(e.consume(t),k):D(t)}return rU(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):D(t)}function se(t){return t===93?(e.consume(t),O):D(t)}function O(t){return t===62?(e.consume(t),k):t===45&&i===2?(e.consume(t),O):D(t)}function k(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),k)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function OW(e,t,n){let r=this;return i;function i(t){return Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function kW(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(OU,t,n)}}var AW={name:`htmlText`,tokenize:jW};function jW(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):rU(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):rU(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Z(t)?(o=d,ae(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Z(t)?(o=h,ae(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):Z(t)?(o=v,ae(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,ae(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return rU(t)?(e.consume(t),S):n(t)}function S(t){return t===45||iU(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,ae(t)):Q(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||iU(t)?(e.consume(t),w):t===47||t===62||uU(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||rU(t)?(e.consume(t),E):Z(t)?(o=T,ae(t)):Q(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||iU(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Z(t)?(o=ee,ae(t)):Q(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Z(t)?(o=D,ae(t)):Q(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):Z(t)?(o=te,ae(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||uU(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||uU(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ae(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return Q(t)?$(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}var MW={name:`labelEnd`,resolveAll:IW,resolveTo:LW,tokenize:RW},NW={tokenize:zW},PW={tokenize:BW},FW={tokenize:VW};function IW(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&ZH(e,0,e.length,n),e}function LW(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=QH(s,e.slice(a+1,a+r+3)),s=QH(s,[[`enter`,u,t]]),s=QH(s,xU(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=QH(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=QH(s,e.slice(o+1)),s=QH(s,[[`exit`,c,t]]),ZH(e,a,e.length,s),e}function RW(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(dW(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(NW,u,o?u:d)(t):t===91?e.attempt(PW,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(FW,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function zW(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return uU(t)?uW(e,a)(t):a(t)}function a(t){return t===41?u(t):sW(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return uU(t)?uW(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?lW(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return uU(t)?uW(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function BW(e,t,n){let r=this;return i;function i(t){return cW.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(dW(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function VW(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var HW={name:`labelStartImage`,resolveAll:MW.resolveAll,tokenize:UW};function UW(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var WW={name:`labelStartLink`,resolveAll:MW.resolveAll,tokenize:GW};function GW(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var KW={name:`lineEnding`,tokenize:qW};function qW(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}}var JW={name:`thematicBreak`,tokenize:YW};function YW(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?$(e,s,`whitespace`)(t):s(t))}}var XW={continuation:{tokenize:eG},exit:nG,name:`list`,tokenize:$W},ZW={partial:!0,tokenize:rG},QW={partial:!0,tokenize:tG};function $W(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:sU(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(JW,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return sU(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(OU,r.interrupt?n:u,e.attempt(ZW,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function eG(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(OU,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(QW,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(XW,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function tG(e,t,n){let r=this;return $(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function nG(e){e.exit(this.containerState.type)}function rG(e,t,n){let r=this;return $(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var iG={name:`setextUnderline`,resolveTo:aG,tokenize:oG};function aG(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function oG(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Q(t)?$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var sG={tokenize:cG};function cG(e){let t=this,n=e.attempt(OU,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nW,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var lG={resolveAll:pG()},uG=fG(`string`),dG=fG(`text`);function fG(e){return{resolveAll:pG(e===`text`?mG:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function pG(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function mG(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var hG=e({attentionMarkers:()=>CG,contentInitial:()=>_G,disable:()=>wG,document:()=>gG,flow:()=>yG,flowInitial:()=>vG,insideSpan:()=>SG,string:()=>bG,text:()=>xG}),gG={42:XW,43:XW,45:XW,48:XW,49:XW,50:XW,51:XW,52:XW,53:XW,54:XW,55:XW,56:XW,57:XW,62:AU},_G={91:fW},vG={[-2]:WU,[-1]:WU,32:WU},yG={35:vW,42:JW,45:[iG,JW],60:CW,61:iG,95:JW,96:VU,126:VU},bG={38:RU,92:PU},xG={[-5]:KW,[-4]:KW,[-3]:KW,33:HW,38:RU,42:SU,60:[EU,AW],91:WW,92:[gW,PU],93:MW,95:SU,96:JU},SG={null:[SU,lG]},CG={null:[42,95]},wG={null:[]};function TG(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=QH(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=xU(a,l.events,l),l.events):[]}function f(e,t){return DG(p(e),t)}function p(e){return EG(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&ZH(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function EG(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function DG(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
46
46
|
`;break;case-3:o=`\r
|
|
@@ -69,7 +69,7 @@ Minimum version required to store current data is: `+c+`.
|
|
|
69
69
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
70
70
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=iY(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}uY.peek=dY;function uY(e){return e.value||``}function dY(){return`<`}fY.peek=pY;function fY(e,t,n,r){let i=tY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function pY(){return`!`}mY.peek=hY;function mY(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hY(){return`!`}gY.peek=_Y;function gY(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function _Y(){return"`"}function vY(e,t){let n=qH(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yY.peek=bY;function yY(e,t,n,r){let i=tY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(vY(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function bY(e,t,n){return vY(e,n)?`<`:`[`}xY.peek=SY;function xY(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function SY(){return`[`}function CY(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wY(e){let t=CY(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function TY(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function EY(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DY(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?TY(n):CY(n),s=e.ordered?o===`.`?`)`:`.`:wY(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),EY(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function OY(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kY(e,t,n,r){let i=OY(n),a=n.bulletCurrent||CY(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function AY(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var jY=oK([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function MY(e,t,n,r){return(e.children.some(function(e){return jY(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function NY(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}PY.peek=FY;function PY(e,t,n,r){let i=NY(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=aY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=iY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=aY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+iY(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function FY(e,t,n){return n.options.strong||`*`}function IY(e,t,n,r){return n.safe(e.value,r)}function LY(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function RY(e,t,n){let r=(EY(n)+(n.options.ruleSpaces?` `:``)).repeat(LY(n));return n.options.ruleSpaces?r.slice(0,-1):r}var zY={blockquote:GJ,break:YJ,code:$J,definition:nY,emphasis:oY,hardBreak:YJ,heading:lY,html:uY,image:fY,imageReference:mY,inlineCode:gY,link:yY,linkReference:xY,list:DY,listItem:kY,paragraph:AY,root:MY,strong:PY,text:IY,thematicBreak:RY};function BY(){return{enter:{table:VY,tableData:GY,tableHeader:GY,tableRow:UY},exit:{codeText:KY,table:HY,tableData:WY,tableHeader:WY,tableRow:WY}}}function VY(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function HY(e){this.exit(e),this.data.inTable=void 0}function UY(e){this.enter({type:`tableRow`,children:[]},e)}function WY(e){this.exit(e)}function GY(e){this.enter({type:`tableCell`,children:[]},e)}function KY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qY));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qY(e,t){return t===`|`?t:e}function JY(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
71
71
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
72
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return HJ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=zY.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function YY(){return{exit:{taskListCheckValueChecked:ZY,taskListCheckValueUnchecked:ZY,paragraph:QY}}}function XY(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$Y}}}function ZY(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function QY(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $Y(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=zY.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function eX(){return[oJ(),AJ(),FJ(),BY(),YY()]}function tX(e){return{extensions:[sJ(),jJ(e),IJ(),JY(e),XY()]}}var nX={tokenize:gX,partial:!0},rX={tokenize:_X,partial:!0},iX={tokenize:vX,partial:!0},aX={tokenize:yX,partial:!0},oX={tokenize:bX,partial:!0},sX={name:`wwwAutolink`,tokenize:mX,previous:xX},cX={name:`protocolAutolink`,tokenize:hX,previous:SX},lX={name:`emailAutolink`,tokenize:pX,previous:CX},uX={};function dX(){return{text:uX}}for(var fX=48;fX<123;)uX[fX]=lX,fX++,fX===58?fX=65:fX===91&&(fX=97);uX[43]=lX,uX[45]=lX,uX[46]=lX,uX[95]=lX,uX[72]=[lX,cX],uX[104]=[lX,cX],uX[87]=[lX,sX],uX[119]=[lX,sX];function pX(e,t,n){let r=this,i,a;return o;function o(t){return!wX(t)||!CX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wX(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oX,u,l)(t):t===45||t===95||iU(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rU(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mX(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nX,e.attempt(rX,e.attempt(iX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hX(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SX.call(r,r.previous)&&!TX(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rU(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||oU(t)||uU(t)||fU(t)||dU(t)?n(t):e.attempt(rX,e.attempt(iX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gX(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _X(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aX,c,s)(t):t===null||uU(t)||fU(t)||t!==45&&dU(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vX(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aX,t,a)(o):o===null||uU(o)||fU(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yX(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||uU(o)||fU(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||uU(e)||fU(e)?t(e):r(e)}function a(e){return rU(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rU(t)?(e.consume(t),o):n(t)}}function bX(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iU(e)?n(e):t(e)}}function xX(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||uU(e)}function SX(e){return!rU(e)}function CX(e){return!(e===47||wX(e))}function wX(e){return e===43||e===45||e===46||e===95||iU(e)}function TX(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EX={tokenize:PX,partial:!0};function DX(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jX,continuation:{tokenize:MX},exit:NX}},text:{91:{name:`gfmFootnoteCall`,tokenize:AX},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OX,resolveTo:kX}}}}function OX(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=dW(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kX(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||uU(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(dW(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return uU(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||uU(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=dW(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return uU(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MX(e,t,n){return e.check(OU,t,e.attempt(EX,t,n))}function NX(e){e.exit(`gfmFootnoteDefinition`)}function PX(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FX(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&ZH(o,o.length,0,xU(s,e.slice(r+1,n),t)),ZH(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),ZH(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bU(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bU(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IX=class{constructor(){this.map=[]}add(e,t,n){LX(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function LX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function RX(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zX(){return{flow:{null:{name:`table`,tokenize:BX,resolveAll:VX}}}}function BX(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||uU(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||uU(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VX(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IX;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UX(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HX(f,t,o,i,n,d)):(o[0]=o[1],d=HX(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UX(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RX(t.events,n))}return e}function HX(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WX(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WX(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WX(t.events,n[2]),a=WX(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WX(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UX(e,t,n,r,i){let a=[],o=WX(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WX(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GX={name:`tasklistCheck`,tokenize:qX};function KX(){return{text:{91:GX}}}function qX(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return uU(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Q(r)?e.check({tokenize:JX},t,n)(r):n(r)}}function JX(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YX(e){return eU([dX(),DX(),FX(e),zX(),KX()])}var XX={};function ZX(e){let t=this,n=e||XX,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YX(n)),a.push(eX()),o.push(tX(n))}function QX(e){if(!e||e.startsWith(`data:`)||/^https?:\/\//i.test(e))return e;let t=e.match(/^workspace:\/\/\/(.*)$/);if(t||=e.match(/^workspace:\/\/(.*)$/),!t)return e;let n=t[1]??``,r=n.startsWith(`/`)?n:`/`+n;return`/api/p/files/raw?path=${encodeURIComponent(r)}`}function $X(e){return e&&QX(e)}function eZ(e){let{src:t,alt:n,...r}=e;return(0,J.jsx)(`img`,{src:t,alt:n??``,loading:`lazy`,className:`my-2 max-h-96 max-w-full rounded-lg border border-border-default/50`,...r})}var tZ={img:eZ},nZ=`prose prose-sm max-w-none text-[14px] leading-relaxed`;function rZ({children:e,className:t=``,noProse:n=!1}){let r=`${nZ}${$R(e=>e.resolved===`dark`)?` prose-invert`:``}`;return(0,J.jsx)(`div`,{className:n?t:`${r} ${t}`.trim(),children:(0,J.jsx)(qq,{remarkPlugins:[ZX],urlTransform:$X,components:tZ,children:e})})}var iZ=null;async function aZ(){return iZ||=(async()=>{let{createHighlighter:e}=await _(async()=>{let{createHighlighter:e}=await import(`./bundle-web-Bo_W1T9y.js`);return{createHighlighter:e}},__vite__mapDeps([0,1]));return await e({themes:[`github-dark`,`github-light`],langs:[`plaintext`]})})(),iZ}var oZ={sh:`bash`,bash:`bash`,zsh:`bash`,h:`c`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,kt:`kotlin`,yml:`yaml`,htm:`html`,conf:`ini`},sZ=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rb.php.go.rs.java.kt.swift.scala.c.cpp.cc.cxx.h.hpp.cs.m.mm.sh.bash.zsh.fish.ps1.json.yaml.yml.toml.ini.conf.xml.css.scss.sass.less.html.htm.sql.graphql.proto.lua.perl.pl.dockerfile.makefile`.split(`.`));function cZ(e){let t=e.toLowerCase();if(t===`dockerfile`||t.endsWith(`/dockerfile`))return`docker`;if(t===`makefile`||t.endsWith(`/makefile`))return`makefile`;let n=t.lastIndexOf(`.`);if(n<0)return null;let r=t.slice(n+1);return sZ.has(r)?oZ[r]??r:null}function lZ({code:e,lang:t,className:n=``}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(!1),o=$R(e=>e.resolved===`light`?`github-light`:`github-dark`);(0,d.useEffect)(()=>(a.current=!1,(async()=>{try{let n=await aZ();n.getLoadedLanguages().includes(t)||await n.loadLanguage(t);let r=n.codeToHtml(e,{lang:t,theme:o});a.current||i(r)}catch(e){console.warn(`[CodeBlock] highlight failed (${t}): ${e instanceof Error?e.message:String(e)}`)}})(),()=>{a.current=!0}),[e,t,o]);let s=(0,d.useMemo)(()=>{if(e.length===0)return 1;let t=e.split(`
|
|
72
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return HJ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=zY.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function YY(){return{exit:{taskListCheckValueChecked:ZY,taskListCheckValueUnchecked:ZY,paragraph:QY}}}function XY(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$Y}}}function ZY(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function QY(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $Y(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=zY.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function eX(){return[oJ(),AJ(),FJ(),BY(),YY()]}function tX(e){return{extensions:[sJ(),jJ(e),IJ(),JY(e),XY()]}}var nX={tokenize:gX,partial:!0},rX={tokenize:_X,partial:!0},iX={tokenize:vX,partial:!0},aX={tokenize:yX,partial:!0},oX={tokenize:bX,partial:!0},sX={name:`wwwAutolink`,tokenize:mX,previous:xX},cX={name:`protocolAutolink`,tokenize:hX,previous:SX},lX={name:`emailAutolink`,tokenize:pX,previous:CX},uX={};function dX(){return{text:uX}}for(var fX=48;fX<123;)uX[fX]=lX,fX++,fX===58?fX=65:fX===91&&(fX=97);uX[43]=lX,uX[45]=lX,uX[46]=lX,uX[95]=lX,uX[72]=[lX,cX],uX[104]=[lX,cX],uX[87]=[lX,sX],uX[119]=[lX,sX];function pX(e,t,n){let r=this,i,a;return o;function o(t){return!wX(t)||!CX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wX(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oX,u,l)(t):t===45||t===95||iU(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rU(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mX(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nX,e.attempt(rX,e.attempt(iX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hX(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SX.call(r,r.previous)&&!TX(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rU(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||oU(t)||uU(t)||fU(t)||dU(t)?n(t):e.attempt(rX,e.attempt(iX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gX(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _X(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aX,c,s)(t):t===null||uU(t)||fU(t)||t!==45&&dU(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vX(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aX,t,a)(o):o===null||uU(o)||fU(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yX(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||uU(o)||fU(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||uU(e)||fU(e)?t(e):r(e)}function a(e){return rU(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rU(t)?(e.consume(t),o):n(t)}}function bX(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iU(e)?n(e):t(e)}}function xX(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||uU(e)}function SX(e){return!rU(e)}function CX(e){return!(e===47||wX(e))}function wX(e){return e===43||e===45||e===46||e===95||iU(e)}function TX(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EX={tokenize:PX,partial:!0};function DX(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jX,continuation:{tokenize:MX},exit:NX}},text:{91:{name:`gfmFootnoteCall`,tokenize:AX},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OX,resolveTo:kX}}}}function OX(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=dW(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kX(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||uU(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(dW(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return uU(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||uU(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=dW(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return uU(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MX(e,t,n){return e.check(OU,t,e.attempt(EX,t,n))}function NX(e){e.exit(`gfmFootnoteDefinition`)}function PX(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FX(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&ZH(o,o.length,0,xU(s,e.slice(r+1,n),t)),ZH(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),ZH(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bU(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bU(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IX=class{constructor(){this.map=[]}add(e,t,n){LX(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function LX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function RX(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zX(){return{flow:{null:{name:`table`,tokenize:BX,resolveAll:VX}}}}function BX(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||uU(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||uU(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VX(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IX;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UX(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HX(f,t,o,i,n,d)):(o[0]=o[1],d=HX(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UX(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RX(t.events,n))}return e}function HX(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WX(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WX(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WX(t.events,n[2]),a=WX(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WX(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UX(e,t,n,r,i){let a=[],o=WX(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WX(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GX={name:`tasklistCheck`,tokenize:qX};function KX(){return{text:{91:GX}}}function qX(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return uU(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Q(r)?e.check({tokenize:JX},t,n)(r):n(r)}}function JX(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YX(e){return eU([dX(),DX(),FX(e),zX(),KX()])}var XX={};function ZX(e){let t=this,n=e||XX,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YX(n)),a.push(eX()),o.push(tX(n))}function QX(e){if(!e||e.startsWith(`data:`)||/^https?:\/\//i.test(e))return e;let t=e.match(/^workspace:\/\/\/(.*)$/);if(t||=e.match(/^workspace:\/\/(.*)$/),!t)return e;let n=t[1]??``,r=n.startsWith(`/`)?n:`/`+n;return`/api/p/files/raw?path=${encodeURIComponent(r)}`}function $X(e){return e&&QX(e)}function eZ(e){let{src:t,alt:n,...r}=e;return(0,J.jsx)(`img`,{src:t,alt:n??``,loading:`lazy`,className:`my-2 max-h-96 max-w-full rounded-lg border border-border-default/50`,...r})}var tZ={img:eZ},nZ=`prose prose-sm max-w-none text-[14px] leading-relaxed`;function rZ({children:e,className:t=``,noProse:n=!1}){let r=`${nZ}${$R(e=>e.resolved===`dark`)?` prose-invert`:``}`;return(0,J.jsx)(`div`,{className:n?t:`${r} ${t}`.trim(),children:(0,J.jsx)(qq,{remarkPlugins:[ZX],urlTransform:$X,components:tZ,children:e})})}var iZ=null;async function aZ(){return iZ||=(async()=>{let{createHighlighter:e}=await _(async()=>{let{createHighlighter:e}=await import(`./bundle-web-DZNCKlBl.js`);return{createHighlighter:e}},__vite__mapDeps([0,1]));return await e({themes:[`github-dark`,`github-light`],langs:[`plaintext`]})})(),iZ}var oZ={sh:`bash`,bash:`bash`,zsh:`bash`,h:`c`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,kt:`kotlin`,yml:`yaml`,htm:`html`,conf:`ini`},sZ=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rb.php.go.rs.java.kt.swift.scala.c.cpp.cc.cxx.h.hpp.cs.m.mm.sh.bash.zsh.fish.ps1.json.yaml.yml.toml.ini.conf.xml.css.scss.sass.less.html.htm.sql.graphql.proto.lua.perl.pl.dockerfile.makefile`.split(`.`));function cZ(e){let t=e.toLowerCase();if(t===`dockerfile`||t.endsWith(`/dockerfile`))return`docker`;if(t===`makefile`||t.endsWith(`/makefile`))return`makefile`;let n=t.lastIndexOf(`.`);if(n<0)return null;let r=t.slice(n+1);return sZ.has(r)?oZ[r]??r:null}function lZ({code:e,lang:t,className:n=``}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(!1),o=$R(e=>e.resolved===`light`?`github-light`:`github-dark`);(0,d.useEffect)(()=>(a.current=!1,(async()=>{try{let n=await aZ();n.getLoadedLanguages().includes(t)||await n.loadLanguage(t);let r=n.codeToHtml(e,{lang:t,theme:o});a.current||i(r)}catch(e){console.warn(`[CodeBlock] highlight failed (${t}): ${e instanceof Error?e.message:String(e)}`)}})(),()=>{a.current=!0}),[e,t,o]);let s=(0,d.useMemo)(()=>{if(e.length===0)return 1;let t=e.split(`
|
|
73
73
|
`).length;return Math.max(1,e.endsWith(`
|
|
74
74
|
`)?t-1:t)},[e]);return(0,J.jsxs)(`div`,{className:`group relative ${n}`,children:[(0,J.jsx)(uZ,{text:e}),(0,J.jsxs)(`div`,{className:`flex`,children:[(0,J.jsx)(`pre`,{"aria-hidden":!0,className:`select-none border-r border-border-subtle bg-bg-base px-3 py-3 text-right font-mono text-[12px] leading-[1.6] text-fg-fainter`,children:Array.from({length:s},(e,t)=>t+1).join(`
|
|
75
75
|
`)}),(0,J.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto`,children:r?(0,J.jsx)(`div`,{className:`shiki-host font-mono text-[12px] leading-[1.6]`,dangerouslySetInnerHTML:{__html:r}}):(0,J.jsx)(`pre`,{className:`whitespace-pre px-3 py-3 font-mono text-[12px] leading-[1.6] text-fg-default`,children:e})})]})]})}function uZ({text:e}){let[t,n]=(0,d.useState)(!1);return(0,J.jsx)(`button`,{type:`button`,className:`absolute right-2 top-2 z-10 rounded-md border border-border-subtle/80 bg-bg-elevated/80 p-1.5 text-fg-muted opacity-0 backdrop-blur transition-opacity hover:bg-bg-raised group-hover:opacity-100`,title:t?`Copied`:`Copy`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)}).catch(()=>{})},children:t?(0,J.jsx)(xl,{size:14}):(0,J.jsx)(df,{size:14})})}function dZ({html:e,className:t=``,initialMode:n=`render`}){let[r,i]=(0,d.useState)(n);return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${t}`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-1 border-b border-border-subtle bg-bg-base/50 px-3 py-1.5`,children:(0,J.jsx)(fZ,{mode:r,onChange:i})}),r===`render`?(0,J.jsx)(`iframe`,{srcDoc:e,sandbox:`allow-scripts allow-popups allow-forms allow-modals`,className:`min-h-0 w-full flex-1 border-0 bg-white`,title:`HTML preview`},e.slice(0,64)+e.length):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,J.jsx)(lZ,{code:e,lang:`html`})})]})}function fZ({mode:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex rounded-md border border-border-subtle bg-bg-elevated/60 p-0.5 text-[11px] text-fg-muted`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`render`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`render`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`Live preview`,children:[(0,J.jsx)(Xp,{size:12}),(0,J.jsx)(`span`,{children:`Render`})]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`source`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`source`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`View source`,children:[(0,J.jsx)(Ld,{size:12}),(0,J.jsx)(`span`,{children:`Source`})]})]})}function pZ({src:e,title:t=`PDF preview`,className:n=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col ${n}`,children:(0,J.jsx)(`iframe`,{src:e,title:t,className:`h-full w-full border-0 bg-white`})})}function mZ({src:e,className:t=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-black ${t}`,children:(0,J.jsx)(`video`,{src:e,controls:!0,className:`max-h-full max-w-full`,children:(0,J.jsx)(`track`,{kind:`captions`})})})}function hZ({src:e,className:t=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-bg-base p-6 ${t}`,children:(0,J.jsx)(`audio`,{src:e,controls:!0,className:`w-full max-w-2xl`,children:(0,J.jsx)(`track`,{kind:`captions`})})})}var gZ=`.svg`;function _Z({src:e,filename:t,svgSource:n,className:r=``}){let i=!!t&&t.toLowerCase().endsWith(gZ),[a,o]=(0,d.useState)(`render`);return!i||!n?(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-bg-base ${r}`,children:(0,J.jsx)(`img`,{src:e,alt:t??`image`,className:`max-h-full max-w-full object-contain`})}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${r}`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-1 border-b border-border-subtle bg-bg-base/50 px-3 py-1.5`,children:(0,J.jsx)(vZ,{mode:a,onChange:o})}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:a===`render`?(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center bg-bg-base`,children:(0,J.jsx)(`img`,{src:e,alt:t??`image`,className:`max-h-full max-w-full object-contain`})}):(0,J.jsx)(lZ,{code:n,lang:`xml`})})]})}function vZ({mode:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex rounded-md border border-border-subtle bg-bg-elevated/60 p-0.5 text-[11px] text-fg-muted`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`render`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`render`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`Render`,children:[(0,J.jsx)(Xp,{size:12}),(0,J.jsx)(`span`,{children:`Render`})]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`source`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`source`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`View source`,children:[(0,J.jsx)(Ld,{size:12}),(0,J.jsx)(`span`,{children:`Source`})]})]})}var yZ=1e3;function bZ({content:e,delimiter:n=`,`,className:r=``}){let[i,a]=(0,d.useState)(null);(0,d.useEffect)(()=>{let r=!1;return(async()=>{try{let i=(await _(async()=>{let{default:e}=await import(`./papaparse.min-BQRX_pWo.js`).then(e=>t(e.default,1));return{default:e}},__vite__mapDeps([2,1]))).default.parse(e,{delimiter:n,skipEmptyLines:!0});if(r)return;let o=i.data;if(o.length===0){a({headers:[],rows:[],totalRows:0});return}let s=o[0];a({headers:s,rows:o.slice(1,1001),totalRows:o.length-1,error:i.errors[0]?.message})}catch(e){r||a({headers:[],rows:[],totalRows:0,error:e instanceof Error?e.message:String(e)})}})(),()=>{r=!0}},[e,n]);let o=(0,d.useMemo)(()=>{if(!i)return[];let e=i.headers.length;return i.rows.map(t=>{if(t.length>=e)return t;let n=t.slice();for(;n.length<e;)n.push(``);return n})},[i]);if(!i)return(0,J.jsx)(`div`,{className:`p-4 text-sm text-fg-faint ${r}`,children:`Parsing table…`});if(i.error&&i.rows.length===0)return(0,J.jsxs)(`div`,{className:`p-4 text-sm text-danger ${r}`,children:[`Failed to parse table: `,i.error]});if(i.headers.length===0&&i.rows.length===0)return(0,J.jsx)(`div`,{className:`p-4 text-sm text-fg-faint ${r}`,children:`No rows.`});let s=i.totalRows>yZ;return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${r}`,children:[s&&(0,J.jsxs)(`div`,{className:`mx-3 mt-3 rounded border border-amber-900/40 bg-amber-950/30 px-2 py-1 text-[11px] text-amber-200`,children:[`Showing first `,yZ.toLocaleString(),` of`,` `,i.totalRows.toLocaleString(),` data rows. Download the file to inspect the rest.`]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,J.jsxs)(`table`,{className:`border-collapse text-[12px]`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsx)(`tr`,{className:`bg-bg-elevated text-fg-muted`,children:i.headers.map((e,t)=>(0,J.jsx)(`th`,{className:`sticky top-0 z-10 border-b border-border-default bg-bg-elevated px-2 py-1.5 text-left font-medium`,children:e||`Col ${t+1}`},t))})}),(0,J.jsx)(`tbody`,{children:o.map((e,t)=>(0,J.jsx)(`tr`,{className:`border-b border-border-subtle hover:bg-bg-elevated/40`,children:e.map((e,t)=>(0,J.jsx)(`td`,{className:`max-w-[28rem] truncate border-r border-border-subtle px-2 py-1 text-fg-muted`,title:e,children:e},t))},t))})]})})]})}var xZ=new Set([`md`,`markdown`]),SZ=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`]),CZ=new Set([`mp4`,`webm`,`ogv`,`mov`,`m4v`,`mkv`]),wZ=new Set([`mp3`,`wav`,`ogg`,`flac`,`m4a`,`aac`,`opus`]);function TZ(e){if(!e)return``;let t=e.lastIndexOf(`.`);return t<0?``:e.slice(t+1).toLowerCase()}function EZ(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function DZ({content:e,mimeType:t,filename:n,binary:r,loading:i,error:a,sizeBytes:o,rawUrl:s,className:c=``}){if(i)return(0,J.jsx)(`div`,{className:`flex h-32 items-center justify-center ${c}`,children:(0,J.jsx)(q,{size:20,className:`animate-spin text-fg-faint`})});if(a)return(0,J.jsx)(`div`,{className:`p-6 text-center text-sm text-danger ${c}`,children:a});let l=TZ(n),u=t&&t.startsWith(`image/`)||SZ.has(l),d=l===`pdf`||t===`application/pdf`,f=t&&t.startsWith(`video/`)||CZ.has(l),p=t&&t.startsWith(`audio/`)||wZ.has(l);if((u||d||f||p)&&s){if(u)return(0,J.jsx)(_Z,{src:s,filename:n,svgSource:(l===`svg`||t===`image/svg+xml`)&&e?e:void 0,className:c});if(d)return(0,J.jsx)(pZ,{src:s,title:n,className:c});if(f)return(0,J.jsx)(mZ,{src:s,className:c});if(p)return(0,J.jsx)(hZ,{src:s,className:c})}if(new Set([`doc`,`docx`,`dot`,`dotx`,`xls`,`xlsx`,`xlsm`,`xlsb`,`ppt`,`pptx`,`pps`,`ppsx`,`odt`,`ods`,`odp`,`odg`,`rtf`]).has(l))return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-8 text-center ${c}`,children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:`Office preview is coming soon`}),(0,J.jsxs)(`div`,{className:`max-w-md text-[12px] leading-relaxed text-fg-faint`,children:[`In-browser rendering for`,` `,(0,J.jsxs)(`code`,{className:`font-mono text-fg-muted`,children:[`.`,l]}),` files needs a server-side LibreOffice pass that hasn't shipped yet. Use the`,` `,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:`Download`}),` button above to open this file in your local Office / LibreOffice / Pages.`]}),o!=null&&(0,J.jsx)(`div`,{className:`text-[11px] text-fg-fainter`,children:EZ(o)})]});if(r&&!u)return(0,J.jsxs)(`div`,{className:`p-6 text-center text-sm text-fg-faint ${c}`,children:[`Binary file`,o==null?``:` (${EZ(o)})`,`. No preview available.`]});if(e==null)return(0,J.jsx)(`div`,{className:`p-6 text-center text-sm text-fg-faint ${c}`,children:`No content.`});if(l===`csv`||t===`text/csv`)return(0,J.jsx)(bZ,{content:e,delimiter:`,`,className:c});if(l===`tsv`||t===`text/tab-separated-values`)return(0,J.jsx)(bZ,{content:e,delimiter:`\\t`,className:c});if(xZ.has(l)||t===`text/markdown`||t===`text/x-markdown`)return(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4 ${c}`,children:(0,J.jsx)(rZ,{children:e})});if(l===`html`||l===`htm`)return(0,J.jsx)(dZ,{html:e,className:c});let m=n?cZ(n):null;return m?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto ${c}`,children:(0,J.jsx)(lZ,{code:e,lang:m})}):(0,J.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-all p-4 font-mono text-xs text-fg-default ${c}`,children:e})}kB(),tz(),aF(Gz),lF(RB),pF({Modal:hV,MarkdownBlock:rZ,DocumentViewer:DZ}),gF(()=>({mode:$R(e=>e.mode),resolved:$R(e=>e.resolved),setMode:$R(e=>e.setMode)})),vF(()=>({viewingSessionId:A(e=>e.viewingSessionId),setViewingSession:A(e=>e.selectSession)})),xF({subscribe:(e,t)=>sr.on(e,t)??(()=>{})}),globalThis.__tianshuPluginSdkOpenFile__||sF({open:e=>{let t=e.replace(/^workspace:\/\/+/,`/`),n=`/api/p/files/raw?path=${encodeURIComponent(t)}`;window.open(n,`_blank`,`noopener`)}});var OZ=document.getElementById(`root`);if(!OZ)throw Error(`#root not found`);p.createRoot(OZ).render((0,J.jsx)(d.StrictMode,{children:(0,J.jsx)(fV,{})}));export{QV as a,_ as c,nH as i,rH as n,SV as o,tH as r,gV as s,Qq as t};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Tianshu — AI agent platform</title>
|
|
7
7
|
<meta name="description" content="An open AI agent platform with a sidecar browser. Built in public." />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-D1d31QOE.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-BWBwAfvE.css">
|
|
11
11
|
</head>
|