@usine/server 0.4.0 → 0.4.1-next.241.gf648872
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/dist/web/assets/CompositeItem-DL5QWzlf.js +1 -0
- package/dist/web/assets/ToolbarRootContext-aq6udDVh.js +1 -0
- package/dist/web/assets/X.es-ClvLjC9g.js +1 -0
- package/dist/web/assets/_agent-DtbWtI4O.js +1 -0
- package/dist/web/assets/_loop-CPLcEe-u.js +1 -0
- package/dist/web/assets/_name-B-JwwOOx.js +1 -0
- package/dist/web/assets/_name-BHymV4y2.js +1 -0
- package/dist/web/assets/_name-DHT3Z3pi.js +1 -0
- package/dist/web/assets/_name-DOdPCzeN.js +1 -0
- package/dist/web/assets/_name-LDfdPJ04.js +6 -0
- package/dist/web/assets/_number-CXWY3_sQ.js +1 -0
- package/dist/web/assets/_number-DHT3Z3pi.js +1 -0
- package/dist/web/assets/_number-DdcjkCP5.js +1 -0
- package/dist/web/assets/_run-ChuAgP8W.js +8 -0
- package/dist/web/assets/_run-DHT3Z3pi.js +1 -0
- package/dist/web/assets/_worker-ve1pwBJ6.js +1 -0
- package/dist/web/assets/action-Bma79eWY.js +1 -0
- package/dist/web/assets/agents-BXym4S3E.js +1 -0
- package/dist/web/assets/agents-WFIojkKz.js +1 -0
- package/dist/web/assets/boot-screen-Su4MyrBh.js +1 -0
- package/dist/web/assets/button-4rhhIcK8.js +1 -0
- package/dist/web/assets/collapsible-CTA-Hwrn.js +1 -0
- package/dist/web/assets/{core-wi-Hu_JV.js → core-S_rVxu-b.js} +1 -1
- package/dist/web/assets/drawer-Dw6v2BLr.js +1 -0
- package/dist/web/assets/dropdown-menu-B5_S4hH-.js +1 -0
- package/dist/web/assets/edit-and-retry-CzObi4mf.js +1 -0
- package/dist/web/assets/empty-B9bymfss.js +1 -0
- package/dist/web/assets/error-alert-NXb1Z8Xz.js +1 -0
- package/dist/web/assets/{file-error-SjG2jLJ9.js → file-error-C2s0qbxi.js} +1 -1
- package/dist/web/assets/fill-cell-CjksmixH.js +1 -0
- package/dist/web/assets/heading-Bp50m3v1.js +1 -0
- package/dist/web/assets/index-CPkHl5O3.js +10 -0
- package/dist/web/assets/index-jplYOAsa.css +2 -0
- package/dist/web/assets/label-badge-DIiohsEI.js +1 -0
- package/dist/web/assets/link-C7GfYrMt.js +1 -0
- package/dist/web/assets/list-wEAoFt_l.js +1 -0
- package/dist/web/assets/loops-xOfOUTbc.js +1 -0
- package/dist/web/assets/{markdown-BnyfnuCL.js → markdown-BNebzGGH.js} +3 -3
- package/dist/web/assets/matchContext-D_B3XAQH.js +2 -0
- package/dist/web/assets/model-DXxFqTtA.js +1 -0
- package/dist/web/assets/moves-D_bvNew_.js +1 -0
- package/dist/web/assets/not-found-CTNKT4RI.js +1 -0
- package/dist/web/assets/outcome-o7LagK-q.js +5 -0
- package/dist/web/assets/overview-BdUgx_pE.js +1 -0
- package/dist/web/assets/page-BuzrT_cg.js +1 -0
- package/dist/web/assets/project-not-found-CutZoVCI.js +1 -0
- package/dist/web/assets/pull-request-marks-BLxcb-0V.js +1 -0
- package/dist/web/assets/queries-BnlycW8v.js +1 -0
- package/dist/web/assets/queries-BwtMk72-.js +1 -0
- package/dist/web/assets/reload-yp-6_O8x.js +1 -0
- package/dist/web/assets/repositories-MlGwURyP.js +1 -0
- package/dist/web/assets/route-Boaf6qM7.js +1 -0
- package/dist/web/assets/route-BxsfSGun.js +1 -0
- package/dist/web/assets/{routes-BLy5TGH_.js → routes-D25foI3P.js} +19 -19
- package/dist/web/assets/routes-DHT3Z3pi.js +1 -0
- package/dist/web/assets/run-again-BwF1g66X.js +1 -0
- package/dist/web/assets/section-B0ipDPYr.js +1 -0
- package/dist/web/assets/section-BhUxD7-H.js +1 -0
- package/dist/web/assets/section-BwxXJ9H0.js +1 -0
- package/dist/web/assets/settings-DQka4c7B.js +1 -0
- package/dist/web/assets/slots-n0NbUO7Z.js +1 -0
- package/dist/web/assets/status-badge-CLPsMXtK.js +1 -0
- package/dist/web/assets/strings-C9Xdiz_K.js +1 -0
- package/dist/web/assets/strings-qxNeGv33.js +301 -0
- package/dist/web/assets/table-hbKjhjeL.js +1 -0
- package/dist/web/assets/tasks-B51Y5ks_.js +1 -0
- package/dist/web/assets/tasks-DHT3Z3pi.js +1 -0
- package/dist/web/assets/usage-Bu-ewmBl.js +1 -0
- package/dist/web/assets/use-now-vNgLntlV.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-CeE46geY.js +1 -0
- package/dist/web/assets/useNavigate-AT5VkfZa.js +1 -0
- package/dist/web/assets/usePositioner-B7VCT5LN.js +1 -0
- package/dist/web/assets/useRouter-Hur3RN7j.js +1 -0
- package/dist/web/assets/useTimeout-BC05Ghyu.js +1 -0
- package/dist/web/assets/with-selector-Dwf291_Q.js +1 -0
- package/dist/web/assets/workers-BeOqCiLJ.js +1 -0
- package/dist/web/index.html +20 -15
- package/package.json +9 -9
- package/dist/web/assets/CompositeItem-DU6IyNMY.js +0 -1
- package/dist/web/assets/ToolbarRootContext-Cytu6o2e.js +0 -1
- package/dist/web/assets/X.es-B7iqdxa_.js +0 -1
- package/dist/web/assets/_agent-BVKD5odk.js +0 -1
- package/dist/web/assets/_loop-BFLzamuo.js +0 -1
- package/dist/web/assets/_name-Bh4AQ9sR.js +0 -6
- package/dist/web/assets/_name-CMVsmWzq.js +0 -1
- package/dist/web/assets/_name-DCkgEma_.js +0 -1
- package/dist/web/assets/_name-Ds_pWi15.js +0 -1
- package/dist/web/assets/_number-B9aYwvcQ.js +0 -1
- package/dist/web/assets/_run-BZWt47QS.js +0 -8
- package/dist/web/assets/_worker-Dgfufm5p.js +0 -1
- package/dist/web/assets/action-rCd1FeAz.js +0 -1
- package/dist/web/assets/agents-Drbg6qpH.js +0 -1
- package/dist/web/assets/agents-_6-dEjrY.js +0 -1
- package/dist/web/assets/button-DVWXde__.js +0 -1
- package/dist/web/assets/collapsible-IOhZV1qg.js +0 -1
- package/dist/web/assets/drawer-BiqnR_8i.js +0 -1
- package/dist/web/assets/dropdown-menu-C9D1kRkO.js +0 -1
- package/dist/web/assets/edit-and-retry-BgOR6mvP.js +0 -1
- package/dist/web/assets/error-alert-9tKpTE3v.js +0 -1
- package/dist/web/assets/fill-cell-ClM88KFD.js +0 -1
- package/dist/web/assets/heading-lX1a1LNN.js +0 -1
- package/dist/web/assets/index-BymNZU1Q.js +0 -10
- package/dist/web/assets/index-Dyjfp3ET.css +0 -2
- package/dist/web/assets/label-badge-aIGT1Bry.js +0 -1
- package/dist/web/assets/list-v8WJp2Eq.js +0 -1
- package/dist/web/assets/loops-BFoFf_og.js +0 -1
- package/dist/web/assets/mark-CC3RwMy_.js +0 -1
- package/dist/web/assets/matchContext-BquevSJS.js +0 -2
- package/dist/web/assets/model-BerBT6R0.js +0 -1
- package/dist/web/assets/moves-Dg9sshX5.js +0 -1
- package/dist/web/assets/overview-C_tFKGZ8.js +0 -1
- package/dist/web/assets/page-DWnGi6wA.js +0 -301
- package/dist/web/assets/project-not-found-CodaBVdu.js +0 -1
- package/dist/web/assets/pull-request-marks-DE00nqGW.js +0 -1
- package/dist/web/assets/queries-B1SHA_r4.js +0 -1
- package/dist/web/assets/reload-Dsl0zjJ7.js +0 -1
- package/dist/web/assets/repositories-BdxmD192.js +0 -1
- package/dist/web/assets/route-B_gphTYG.js +0 -1
- package/dist/web/assets/route-Cc7dKnn5.js +0 -1
- package/dist/web/assets/run-again-BTKagSXR.js +0 -1
- package/dist/web/assets/section-B3pWIIBa.js +0 -1
- package/dist/web/assets/section-CD-MB5r3.js +0 -1
- package/dist/web/assets/section-Id99HktI.js +0 -1
- package/dist/web/assets/settings-YrDysQXW.js +0 -1
- package/dist/web/assets/slots-BraHmbNr.js +0 -1
- package/dist/web/assets/status-badge-DnvNo1tG.js +0 -1
- package/dist/web/assets/strings-CW2XaR5f.js +0 -1
- package/dist/web/assets/table-BjyI4fVI.js +0 -1
- package/dist/web/assets/tasks-DCL8kLmD.js +0 -1
- package/dist/web/assets/transcript-sxRJzx6t.js +0 -5
- package/dist/web/assets/usage-CLQJdX9-.js +0 -1
- package/dist/web/assets/use-now-0P8TUXeg.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-CQ83Wy-r.js +0 -1
- package/dist/web/assets/useNavigate-BW1WdocJ.js +0 -1
- package/dist/web/assets/usePositioner-rNCxnHO-.js +0 -1
- package/dist/web/assets/useTimeout-_TcdZXP6.js +0 -1
- package/dist/web/assets/with-selector-DoElmmtd.js +0 -1
- package/dist/web/assets/workers-BH5CBOR3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o}from"./markdown-BnyfnuCL.js";var s={}.hasOwnProperty;function c(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&s.call(t,e)){let n=String(t[e]);i=s.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 l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e!==null&&(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(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 v(e,t){return e<t?-1:+(e>t)}function ee(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=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(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 ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=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}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(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=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=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||this.parent!==null&&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 ae(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&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(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}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(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 le(l,u,e,o,s,c)}}return n}var le=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}},b=(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))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(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 de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(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 y(a,o,s)}var de=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)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,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)}},me=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(),pe.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(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 pe(e,t,n,r,i))}}},x=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)}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=ge(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 he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(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(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(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 _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(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 ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=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))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){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 Ce(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 C?w({baseGrammar:a,selfGrammar:i},r):we(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 C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];T([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&T(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&T(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function T(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&T(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ae(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(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?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName))}}}var Te=class{kind=0},Ee=class{kind=1},De=class{constructor(e){this.ruleName=e}kind=2},Oe=class{constructor(e){this.scopeName=e}kind=3},ke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ae(e){if(e===`$base`)return new Te;if(e===`$self`)return new Ee;let t=e.indexOf(`#`);return t===-1?new Oe(e):t===0?new De(e.substring(1)):new ke(e.substring(0,t),e.substring(t+1))}var je=/\\(\d+)/,Me=/\\(\d+)/g,Ne=-1,Pe=-2;function Fe(e){return e}function Ie(e){return e}var E=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(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:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Le=class extends E{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!`)}},Re=class extends E{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new D(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 O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ze=class extends E{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 O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends E{_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 D(i,this.id),this.beginCaptures=a,this._end=new D(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 O;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}},Ve=class extends E{_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 D(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new D(o,Pe),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 O;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 O,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},He=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Le(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ze(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ve(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 Be(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=Ae(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)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ze||e instanceof Be||e instanceof Ve)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},D=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._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&je.test(this.source)}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 Me.lastIndex=0,this.source.replace(Me,(e,t)=>ne(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}},O=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 Ue(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 Ue(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ue=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(`
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o}from"./markdown-BNebzGGH.js";var s={}.hasOwnProperty;function c(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&s.call(t,e)){let n=String(t[e]);i=s.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 l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e!==null&&(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(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 v(e,t){return e<t?-1:+(e>t)}function ee(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=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(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 ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=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}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(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=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=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||this.parent!==null&&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 ae(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&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(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}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(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 le(l,u,e,o,s,c)}}return n}var le=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}},b=(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))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(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 de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(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 y(a,o,s)}var de=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)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,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)}},me=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(),pe.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(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 pe(e,t,n,r,i))}}},x=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)}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=ge(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 he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(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(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(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 _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(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 ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=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))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){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 Ce(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 C?w({baseGrammar:a,selfGrammar:i},r):we(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 C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];T([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&T(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&T(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function T(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&T(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ae(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(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?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName))}}}var Te=class{kind=0},Ee=class{kind=1},De=class{constructor(e){this.ruleName=e}kind=2},Oe=class{constructor(e){this.scopeName=e}kind=3},ke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ae(e){if(e===`$base`)return new Te;if(e===`$self`)return new Ee;let t=e.indexOf(`#`);return t===-1?new Oe(e):t===0?new De(e.substring(1)):new ke(e.substring(0,t),e.substring(t+1))}var je=/\\(\d+)/,Me=/\\(\d+)/g,Ne=-1,Pe=-2;function Fe(e){return e}function Ie(e){return e}var E=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(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:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Le=class extends E{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!`)}},Re=class extends E{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new D(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 O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ze=class extends E{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 O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends E{_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 D(i,this.id),this.beginCaptures=a,this._end=new D(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 O;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}},Ve=class extends E{_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 D(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new D(o,Pe),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 O;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 O,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},He=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Le(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ze(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ve(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 Be(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=Ae(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)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ze||e instanceof Be||e instanceof Ve)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},D=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._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&je.test(this.source)}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 Me.lastIndex=0,this.source.replace(Me,(e,t)=>ne(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}},O=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 Ue(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 Ue(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ue=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
2
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},We=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ge=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new We(e,8),this._embeddedLanguagesMatcher=new Ke(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 We(0,0);_getBasicScopeAttributes=new re(e=>new We(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/},Ke=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])=>ne(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 qe=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Je(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ye(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 qe(i,!0);f()}return new qe(i,!1);function f(){let o=Xe(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===Ne){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),k(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 Be){let r=o;k(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 Ve){let r=o;k(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(k(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 Ye(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 Ve&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=et(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Pe){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),k(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 Xe(e,t,n,r,i,a){let o=Ze(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Qe(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 Ze(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=$e(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 Qe(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}=$e(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 $e(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function et(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function k(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));Je(e,p,n&&d.start===0,d.start,f,i,!1,0),ye(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 tt(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var tt=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function nt(e,t,n,r,i,a,o,s){return new at(e,t,n,r,i,a,o,s)}function rt(e,t,n,r,i){let a=S(t,A),o=He.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 A(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(it(t[r],e))return n=r+1,!0;return!1})}function it(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 at=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ge(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ot(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=S(e,A);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)rt(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&&rt(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(Fe(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ie(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]=ot(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=He.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===st.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=x.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?j.createRootAndLookUpScopeName(a,r,this):j.createRoot(`unknown`,r),t=new st(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
3
3
|
`;let a=this.createOnigString(e),o=a.content.length,s=new lt(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Je(this,a,i,0,t,s,!0,r);return ye(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ot(e,t){return e=u(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 j=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=ie.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ie(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ie(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}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(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),x.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),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}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}},st=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&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?j.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(1)}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:Ie(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=j.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Fe(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,j.fromExtension(r,n.contentNameScopesList))}},ct=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):S(e,A).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>S(e,A).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}},lt=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=x.set(n,0,he(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=x.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}},ut=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,nt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ut(y.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(y.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 ct(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Se(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)}},ft=st.NULL;function M(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 N(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pt(e){return Array.isArray(e)?e:[e]}async function mt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function P(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function ht(e){return e===`ansi`||P(e)}function F(e){return e===`none`}function gt(e){return F(e)}var _t=/(\r?\n)/g;function I(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(_t),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 vt={light:`#333333`,dark:`#bbbbbb`},yt={light:`#fffffe`,dark:`#1e1e1e`},bt=`__shiki_resolved`;function L(e){if(e?.[bt])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`?vt.light:vt.dark,n||=t.type===`light`?yt.light:yt.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,bt,{enumerable:!1,writable:!1,value:!0}),t}async function xt(e){return[...new Set((await Promise.all(e.filter(e=>!ht(e)).map(async e=>await mt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function St(e){return(await Promise.all(e.map(async e=>gt(e)?null:L(await mt(e))))).filter(e=>!!e)}function Ct(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 l(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wt=class extends dt{_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=L(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=y.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ct(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._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),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 l(`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))}},Tt=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).includes(e.scopeName)||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}},R=0;function z(e){R+=1,e.warnings!==!1&&R>=10&&R%10==0&&console.warn(`[Shiki] ${R} 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 l("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(L),i=new wt(new Tt(e.engine,n),r,n,e.langAlias),a;function o(t){return Ct(t,e.langAlias)}function s(e){_();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new l(`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`};_();let t=i.getTheme(e);if(!t)throw new l(`Theme \`${e}\` not found, you may need to load it first`);return t}function u(e){_();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function d(){return _(),i.getLoadedThemes()}function f(){return _(),i.getLoadedLanguages()}function p(...e){_(),i.loadLanguages(e.flat(1))}async function m(...e){return p(await xt(e))}function h(...e){_();for(let t of e.flat(1))i.loadTheme(t)}async function g(...e){return _(),h(await St(e))}function _(){if(t)throw new l(`Shiki instance has been disposed`)}function v(){t||(t=!0,i.dispose(),--R)}return{setTheme:u,getTheme:c,getLanguage:s,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:p,loadTheme:g,loadThemeSync:h,dispose:v,[Symbol.dispose]:v}}var Et=z;async function Dt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([St(e.themes||[]),xt(e.langs||[]),e.engine]);return z({...e,themes:t,langs:n,engine:r})}var Ot=Dt,kt=new WeakMap;function B(e,t){kt.set(e,t)}function V(e){return kt.get(e)}var H=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(pt(n).map(e=>[e,ft])),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 At(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function At(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 jt(e,t){if(!(e instanceof H))throw new l(`Invalid grammar state`);return e.getInternalStack(t)}var Mt=/,/,Nt=/ /;function Pt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(P(e.resolveLangAlias(n.lang||`text`))||F(r))return I(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 l(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new l(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return It(t,o,i,a,n)}function Ft(...e){if(e.length===2)return V(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(P(i)||F(a))throw new l(`Plain language does not have grammar state`);if(i===`ansi`)throw new l(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new H(Lt(n,c,o,s,r).stateStack,c.name,o.name)}function It(e,t,n,r,i){let a=Lt(e,t,n,r,i),o=new H(a.stateStack,t.name,n.name);return B(a.tokens,o),a.tokens}function Lt(e,t,n,r,i){let a=M(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=I(e),u=i.grammarState?jt(i.grammarState,n.name)??ft:i.grammarContextCode==null?ft:Lt(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=N(r[x.getForeground(s)],a),u=x.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=x.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Mt).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Nt))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Rt(t.scopes):zt(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Rt(e){return e.map(e=>({scopeName:e}))}function zt(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ht(e,i,t.slice(0,r))}}return n}function Bt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Vt(e,t,n){if(!Bt(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Bt(e[r],n[i])&&--r,--i;return r===-1}function Ht(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Vt(e,t,n)){r.push(a);break}return r}function U(e,t,n,r=Pt){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:V(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ut(...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 H(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&B(s,c),s}function Ut(...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 Wt=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Gt=/["&'<>`]/g,Kt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qt=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jt=/[|\\{}()[\]^$+*?.]/g,Yt=new WeakMap;function Xt(e,t){return e=e.replace(t.subset?Zt(t.subset):Gt,r),t.subset||t.escapeOnly?e:e.replace(Kt,n).replace(qt,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 Zt(e){let t=Yt.get(e);return t||(t=Qt(e),Yt.set(e,t)),t}function Qt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Jt,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var $t=/[\dA-Fa-f]/;function en(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!$t.test(String.fromCharCode(t))?r:r+`;`}var tn=/\d/;function nn(e,t,n){let r=`&#`+String(e);return n&&t&&!tn.test(String.fromCharCode(t))?r:r+`;`}var rn=`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(`.`),an={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:`€`},on=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sn={}.hasOwnProperty,cn={},W;for(W in an)sn.call(an,W)&&(cn[an[W]]=W);var ln=/[^\dA-Za-z]/;function un(e,t,n,r){let i=String.fromCharCode(e);if(sn.call(cn,i)){let e=cn[i],a=`&`+e;return n&&rn.includes(e)&&!on.includes(e)&&(!r||t&&t!==61&&ln.test(String.fromCharCode(t)))?a:a+`;`}return``}function dn(e,t,n){let r=en(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=un(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=nn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function G(e,t){return Xt(e,Object.assign({format:dn},t))}var fn=/^>|^->|<!--|-->|--!>|<!-$/g,pn=[`>`],mn=[`<`,`>`];function hn(e,t,n,r){return r.settings.bogusComments?`<?`+G(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))+`>`:`<!--`+e.value.replace(fn,i)+`-->`;function i(e){return G(e,Object.assign({},r.settings.characterReferences,{subset:mn}))}}function gn(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var K=yn(1),_n=yn(-1),vn=[];function yn(e){return t;function t(t,n,r){let i=t?t.children:vn,a=(n||0)+e,s=i[a];if(!r)for(;s&&o(s);)a+=e,s=i[a];return s}}var bn={}.hasOwnProperty;function xn(e){return t;function t(t,n,r){return bn.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Sn=xn({body:Tn,caption:Cn,colgroup:Cn,dd:kn,dt:On,head:Cn,html:wn,li:Dn,optgroup:jn,option:Mn,p:En,rp:An,rt:An,tbody:Pn,td:Ln,tfoot:Fn,th:Ln,thead:Nn,tr:In});function Cn(e,t,n){let r=K(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&o(r.value.charAt(0)))}function wn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function Tn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function En(e,t,n){let r=K(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 Dn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function On(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function kn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function An(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function jn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Mn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Nn(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Pn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fn(e,t,n){return!K(n,t)}function In(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ln(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rn=xn({body:Vn,colgroup:Hn,head:Bn,html:zn,tbody:Un});function zn(e){let t=K(e,-1);return!t||t.type!==`comment`}function Bn(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 Vn(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&o(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Hn(e,t,n){let r=_n(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Un(e,t,n){let r=_n(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var q={name:[[`
|
|
4
4
|
\f\r &/=>`.split(``),`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,k as i}from"./page-BuzrT_cg.js";import{c as a,t as o}from"./error-alert-NXb1Z8Xz.js";import{vn as s}from"./queries-BwtMk72-.js";import{T as c,n as l,p as u,r as d}from"./overview-BdUgx_pE.js";import{t as f}from"./link-C7GfYrMt.js";import{n as p,t as m}from"./edit-and-retry-CzObi4mf.js";import{c as h,d as g,f as _,p as v,r as y,s as b,t as x}from"./outcome-o7LagK-q.js";import{D as S,W as C,n as w}from"./button-4rhhIcK8.js";import{Gt as T,Lt as E,Wt as D,f as O,qt as k,r as A}from"./strings-qxNeGv33.js";import{H as j,J as M,N,U as P,W as F,X as I,Y as L,Z as R,q as z}from"./index-CPkHl5O3.js";import{t as B}from"./use-now-vNgLntlV.js";var V=n(e(),1),H=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z`}))]]),U=V.forwardRef((e,t)=>V.createElement(C,{ref:t,...e,weights:H}));U.displayName=`ArrowsOutSimpleIcon`;var W=t(),G=({detail:e})=>{let t=(0,V.useMemo)(()=>y(g(e.transcript,e.run.attempts,e.sessionState),e.run.attempts,e.transcript),[e.transcript,e.sessionState,e.run.attempts]),n=[...t.chapters].reverse().find(({live:e})=>e),r=t.chapters.flatMap(({rows:e})=>e).reverse().find(e=>e._tag===`Message`);return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[n===void 0?(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Attempt starting`}):(0,W.jsx)(h,{chapter:n}),r?._tag===`Message`&&(0,W.jsxs)(`section`,{"aria-label":`Latest message`,className:`space-y-1`,children:[(0,W.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:r.speaker.name}),(0,W.jsx)(`time`,{dateTime:r.receivedAt,title:O(r.receivedAt),className:`font-mono tabular-nums text-muted-foreground`,children:A(r.receivedAt)})]}),(0,W.jsx)(`p`,{className:`line-clamp-6 text-md wrap-anywhere`,children:b(r.text)}),r.queued!==null&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u(r.queued)})]})]})},K=e=>{let t=e.attempts.at(-1),n=t?.salvage??null;return e.state===`Succeeded`?k({_tag:`Succeeded`,message:E(e.resultMessage)}):e.state===`Canceled`?k({_tag:`Canceled`,salvage:n}):e.state===`Failed`&&t?.outcome?._tag===`Failed`?k({_tag:`Failed`,failure:t.outcome.failure,salvage:n}):T()},q=({machine:e})=>{let t=B(15e3);return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:c(e,t)})},J=({detail:e})=>{let t=e.run;switch(t.state){case`Pending`:return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Opened, not scheduled yet`});case`Waiting`:return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Waiting for approval`});case`Queued`:return e.machine?.state===`creating`?(0,W.jsx)(q,{machine:e.machine}):(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Approved, waiting for a free worker`});case`Running`:return(0,W.jsx)(G,{detail:e});case`Succeeded`:case`Failed`:case`Canceled`:return D(K(t),{onNone:()=>(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt started`}),onSome:e=>(0,W.jsx)(x,{end:e,outOfMemory:t.attempts.at(-1)?.outOfMemory??null})})}},Y=({runId:e,open:t,close:n})=>{let{data:c}=r(l()),u=i(),h=s({...a(u,e),enabled:t}),[g,y]=(0,V.useState)(null),b=N(),x=h.data?.run;return(0,W.jsx)(z,{open:t,onOpenChange:e=>{e||n()},children:(0,W.jsxs)(M,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-md`,children:[(0,W.jsx)(I,{className:`shrink-0 gap-3 border-b px-5 pt-5 pb-4 pr-20`,children:x===void 0||h.data===void 0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(R,{children:`Loading…`}),(0,W.jsx)(L,{children:`Loading run…`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(v,{detail:h.data,overview:c,placement:`drawer`,shared:t,as:R,actions:(0,W.jsx)(_,{detail:h.data,onEdit:y,openRun:b})}),(0,W.jsxs)(L,{className:`sr-only`,children:[`Run `,x.id,` of `,x.loop,` on `,x.repository]})]})}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[h.isError&&(0,W.jsx)(o,{message:h.error.message}),x!==void 0&&g!==null&&p(x,g)&&(0,W.jsx)(m,{run:x,intent:g,close:()=>y(null),openRun:b},`${x.id}:${g}`),h.data!==void 0&&(0,W.jsx)(J,{detail:h.data}),x!==void 0&&(0,W.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...d(x.repository),run:x.id},search:{},viewTransition:!0,className:w({variant:`outline`}),children:`Open run page`})]}),x!==void 0&&(0,W.jsxs)(j,{children:[(0,W.jsx)(F,{render:(0,W.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...d(x.repository),run:x.id},search:{},viewTransition:!0,"aria-label":`Open run page`,className:S(w({variant:`ghost`,size:`icon-sm`}),`absolute top-4 right-11`)}),children:(0,W.jsx)(U,{"aria-hidden":`true`})}),(0,W.jsx)(P,{side:`bottom`,children:`Open run page`})]})]})})};export{Y as RunDrawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{A as r,Bt as i,D as a,Dt as o,E as s,Et as c,F as l,Ft as u,G as d,Gt as f,H as p,Ht as m,I as h,It as g,J as _,K as v,Kt as y,L as b,Mt as x,N as S,Nt as C,O as w,Pt as T,Q as E,Qt as D,R as ee,Rt as O,St as te,T as k,U as ne,V as A,W as j,X as re,Xt as M,Y as ie,Z as N,Zt as P,_n as ae,_t as oe,an as F,d as I,dn as L,fn as R,gn as z,gt as B,hn as V,ht as H,in as U,it as se,j as ce,jt as le,k as W,ln as G,m as K,mt as q,nt as ue,on as de,ot as fe,p as pe,pn as me,q as he,rn as J,rt as ge,sn as _e,st as ve,un as ye,ut as be,vt as xe,w as Se,xt as Ce,y as we,yt as Te,zt as Ee}from"./queries-BwtMk72-.js";import{a as De,d as Oe,n as ke,o as Ae}from"./useTimeout-BC05Ghyu.js";import{A as Y,D as je,F as Me,H as Ne,L as Pe,M as Fe,N as Ie,P as Le,R as Re,V as ze,W as Be,h as Ve,i as He,k as X,m as Ue,o as We,r as Z,v as Ge,y as Ke}from"./button-4rhhIcK8.js";import{a as qe,c as Je,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,t as et}from"./usePositioner-B7VCT5LN.js";import{i as tt,n as nt,o as rt,r as it,t as at}from"./useAnchoredPopupScrollLock-CeE46geY.js";import{ot}from"./index-CPkHl5O3.js";import{t as st}from"./ToolbarRootContext-aq6udDVh.js";import{n as ct,r as lt,t as ut}from"./CompositeItem-DL5QWzlf.js";var Q=n(e(),1),dt=new Map([[`bold`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),ft=Q.forwardRef((e,t)=>Q.createElement(Be,{ref:t,...e,weights:dt}));ft.displayName=`DotsThreeIcon`;var pt=Q.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Le(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function mt(e){return me&&e.movementX===0&&e.movementY===0}function ht(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gt(e,t){return ht(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _t(e,t,n){return ht(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vt(e,t,n){return ht(t,n?e===U:e===F,e===J)}function yt(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:ht(t,n?e===F:e===U,e===de)}function bt(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:l=!1,loopFocus:d=!1,nested:p=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:w=`vertical`,triggerOrientation:T=w,parentOrientation:E,id:D,resetOnPointerLeave:ee=!0,externalTree:te,nestedReturnFocusRef:k,grid:ne}=t,A=ne!=null,j=e.useState(`open`),M=e.useState(`floatingElement`),N=e.useState(`domReferenceElement`),P=e.context.dataRef,oe=m(M),F=f(N),I=ve(oe),L=ie(),R=re(te),z=Q.useRef(_),B=Q.useRef(s??-1),V=Q.useRef(null),H=Q.useRef(!0),U=Y(e=>{a(B.current===-1?null:B.current,e)}),ce=Q.useRef(!!M),W=Q.useRef(j),K=Q.useRef(!1),ue=Q.useRef(!1),de=Q.useRef(null),fe=ve(S),pe=ve(j),me=ve(s),he=ve(ee),J=Oe(),ge=Oe(),be=Y(()=>{J.cancel();function e(e){g||(de.current=se(e,{sync:K.current,preventScroll:!0}))}let t=n.current[B.current],r=ue.current;t&&e(t),(K.current?e=>e():e=>J.request(e))(()=>{let i=n.current[B.current]||t;i&&(t||e(i),ke&&(r||!H.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});X(()=>{P.current.orientation=w},[P,w]),X(()=>{j||(V.current=null),(!j||_!==`auto`)&&(z.current=_)},[j,_]),X(()=>{o&&(j&&M?(B.current=s??-1,z.current&&s!=null&&(ue.current=!0,U())):ce.current&&(B.current=-1,U()))},[o,j,M,s,U]),X(()=>{if(o){if(!j)K.current=!1;else if(M){if(r==null){if(K.current=!1,me.current!=null)return;if(ce.current&&(B.current=-1,be()),(!W.current||!ce.current)&&z.current&&(V.current!=null||z.current===!0&&V.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ge.request(e):queueMicrotask)(t),e+=1):(B.current=V.current==null||_t(V.current,T,h)||p?x(n):le(n),V.current=null,U())};t()}}else u(n.current,r)||(B.current=r,be(),ue.current=!1)}}},[o,j,M,r,me,p,n,T,h,U,be,ge]),X(()=>{if(!o||M||!R||g||!ce.current)return;let e=R.nodesRef.current,t=e.find(e=>e.id===L)?.context?.elements.floating,n=_e(ae(N??t??null)),r=e.some(e=>e.context&&G(e.context.elements.floating,n));t&&!r&&H.current&&t.focus({preventScroll:!0})},[o,M,N,R,L,g]),X(()=>{W.current=j,ce.current=!!M});let Se=r!=null,Ce=Y(e=>{if(!pe.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(B.current!==t||r!==t)&&(B.current=t,U(e))}),we=Y(()=>E??R?.nodesRef.current.find(e=>e.id===L)?.context?.dataRef?.current.orientation),Te=Y(()=>x(n,fe.current)),De=Y(t=>{if(H.current=!1,K.current=!0,t.which===229||!pe.current&&t.currentTarget===I.current)return;if(p&&yt(t.key,w,h,A)){gt(t.key,we())||i(t),e.setOpen(!1,c(xe,t.nativeEvent));let n=k?.current??N;Ge(n)&&n.focus();return}r!=null&&r!==B.current&&!u(n.current,r)&&(B.current=r);let a=B.current,o=x(n,S),s=le(n,S);if(F||(t.key===`Home`&&(i(t),B.current=o,U(t)),t.key===`End`&&(i(t),B.current=s,U(t))),ne!=null){let e=ne(t,B.current,n,w,d,h,S,o,s);if(e!=null&&e!==B.current&&(B.current=e,U(t)),w===`both`)return}if(gt(t.key,w)){i(t);let e=_e(t.currentTarget.ownerDocument);if(j&&!g&&G(t.currentTarget,e)&&!n.current.some(t=>t!=null&&G(t,e))){B.current=_t(t.key,w,h)?o:s,U(t),r===B.current&&be();return}let{index:c,wrapped:u}=C(n.current,a,{decrement:!_t(t.key,w,h),loopFocus:d,allowEscape:l,disabledIndices:S,minIndex:o,maxIndex:s});u&&(K.current=!1),B.current=c,U(t)}}),ke=Q.useMemo(()=>({onFocus(e){K.current=!0,Ce(e)},onClick({currentTarget:e}){g||e.focus({preventScroll:!0})},onMouseMove(e){mt(e)||(K.current=!0,ue.current=!1,v&&Ce(e))},onPointerLeave(e){if(!pe.current||!H.current||e.pointerType===`touch`)return;K.current=!0;let t=e.relatedTarget;if(v&&!n.current.includes(t)&&he.current&&(de.current?.(),de.current=null,B.current=-1,U(e),!g)){let e=I.current,t=_e(ae(e));e&&G(e,t)&&e.focus({preventScroll:!0})}}}),[Ce,pe,I,v,n,U,he,g]),Ae=Q.useMemo(()=>g&&j&&Se&&{"aria-activedescendant":`${D}-${r}`},[g,j,Se,D,r]),je=Q.useMemo(()=>({...F?{}:Ae,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&j&&!g){let n=ye(t.nativeEvent);if(n&&!G(I.current,n))return;i(t);let r=c(q,t.nativeEvent);e.setOpen(!1,r);let a=k?.current??N;!r.isCanceled&&Ge(a)&&a.focus()}else De(t)},onPointerMove(e){mt(e)||(H.current=!0)}}),[Ae,De,I,F,e,j,g,N,k]),Me=Q.useMemo(()=>{function t(t){e.setOpen(!0,c(xe,t.nativeEvent,t.currentTarget))}function n(e){_===`auto`&&O(e.nativeEvent)&&(z.current=!g)}function r(e){z.current=_,_===`auto`&&Ee(e.nativeEvent)&&(z.current=!0)}return{onKeyDown(n){let r=e.select(`open`);H.current=!1;let a=n.key.startsWith(`Arrow`),o=vt(n.key,we(),h),s=gt(n.key,r?w:T),c=(p?o:s)||n.key===`Enter`||n.key.trim()===``;if(g&&r&&(!p||y(n.currentTarget)))return De(n);if(r||b||!a){if(c){let e=gt(n.key,we());V.current=p&&e?null:n.key}p?o&&(i(n),r?(B.current=Te(),U(n),g&&I.current?.focus()):t(n)):s&&(me.current!=null&&(B.current=me.current),i(n),!r&&b?t(n):De(n),r&&U(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!g&&(B.current=-1,U(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[De,_,Te,p,U,e,b,w,T,we,h,me,g,I]),Ne=Q.useMemo(()=>({...Ae,...Me}),[Ae,Me]);return Q.useMemo(()=>o?{reference:Ne,floating:je,item:ke,trigger:Me}:{},[o,Ne,je,Me,ke])}function xt(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=Y(c),p=e.useState(`open`),m=ke(),h=Q.useRef(``),_=Q.useRef(d??a??-1),v=Q.useRef(null),y=Y(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!T(n)||n?.matches(`:disabled`)?!1:s==null||!g(Pe,e,s)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let y=n.current;if(h.current.length>0&&e.key===` `&&(i(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&l(y,h.current)===-1&&e.key!==` `&&f?.(!1),y==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(i(e),f?.(!0));let b=h.current===``;b&&(_.current=d??a??-1),y.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,_.current=v.current),h.current+=e.key,m.start(u,()=>{h.current=``,_.current=v.current,f?.(!1)});let x=((b?d??a??-1:_.current)??0)+1,S=l(y,h.current,x);S===-1?e.key!==` `&&(h.current=``,f?.(!1)):(o?.(S,e),v.current=S)}),b=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);G(r,n)||G(i,n)||(m.clear(),h.current=``,_.current=v.current,f?.(!1))});X(()=>{(p||d===null)&&(m.clear(),v.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let x=Q.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Q.useMemo(()=>l?{reference:x,floating:x}:{},[l,x])}var $=t(),St=Q.createContext(void 0);function Ct(e){let t=Q.useContext(St);if(t===void 0&&!e)throw Error(Fe(33));return t}var wt=Q.createContext(void 0);function Tt(e){let t=Q.useContext(wt);if(t===void 0&&!e)throw Error(Fe(36));return t}var Et=Q.createContext(void 0);function Dt(e=!0){let t=Q.useContext(Et);if(t===void 0&&!e)throw Error(Fe(25));return t}var Ot=Q.createContext(null);function kt(e=`root`){let t=Q.useContext(Ot),n=Q.useContext(wt);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var At={visible:!0,ref:null};function jt(){return At}function Mt(e,t,n=`root`){let r=kt(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??jt)({label:e.label,children:e.children,render:e.render}),a=ze(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Nt(e){e.preventDefault()}function Pt(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Tt(),u=Dt(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Nt:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:B})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!V&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&He(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Ft={type:`regular-item`};function It(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Q.useRef(null),{getButtonProps:d,buttonRef:f}=Z({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Pt({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Q.useCallback(e=>Me(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=ze(u,f);return Q.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Lt=Q.createContext(void 0),Rt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Q.useState(void 0),c=Le(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,$.jsx)(Lt.Provider,{value:s,children:c})}),zt=Q.forwardRef(function(e,t){let n=kt()?.Group??Rt;return(0,$.jsx)(n,{...e,ref:t})}),Bt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Tt(),f=lt({guess:!0,label:a}),p=z(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=It({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Ft});return Le(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Vt=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Bt,{...e,ref:n.ref}):null}),Ht=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:o=!1,style:s,...c}=e,{store:l}=Tt(),u=Q.useRef(null),d=lt({guess:!0,label:a}),f=z(i),p=l.useState(`isActive`,d.index),m=l.useState(`floatingNodeId`),h=l.useState(`itemProps`),g=l.context.typingRef,{getButtonProps:_,buttonRef:v}=Z({native:!1,composite:!0}),y=Pt({closeOnClick:o,highlighted:p,id:f,nodeId:m,store:l,typingRef:g,itemRef:u,itemMetadata:Ft});function b(e){return Me(y,e,_)}return Le(`a`,e,{state:{highlighted:p},props:[h,c,b],ref:[u,v,t,d.ref]})}),Ut=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Ht,{...e,ref:n.ref}):null}),Wt=Q.createContext(void 0);function Gt(){return Q.useContext(Wt)}function Kt(e,t){let n=Ie(e.render);if(Q.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function qt(e,t,n){let r=Kt(e,t),i=r===t?void 0:r;return[r,Q.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Jt(e,t,n){let r=Ie(e.render),i=Q.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Yt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...l}=e,{store:u,defaultFloatingId:f,setRenderedFloatingId:p,virtualFocus:m,orientation:h}=Tt(),g=Gt(),{side:_,align:v}=Ct(),y=st(!0)!=null,b=u.useState(`open`),x=u.useState(`transitionStatus`),S=u.useState(`popupProps`),C=u.useState(`mounted`),w=u.useState(`instantType`),T=u.useState(`activeTriggerElement`),E=u.useState(`parent`),D=u.useState(`lastOpenChangeReason`),ee=u.useState(`rootId`),O=u.useState(`floatingRootContext`),te=u.useState(`floatingTreeRoot`),k=u.useState(`closeDelay`),ne=u.useState(`hoverEnabled`),A=u.useState(`disabled`),j=u.useState(`openMethod`),re=u.useState(`activeTriggerId`),ie=u.useState(`listElement`),[N,P]=qt(e,f,p),ae=Jt(e,T,re),oe=E.type===`menu`?g:void 0,F=E.type===`context-menu`,I=s??E.type!==`menu`;s===void 0&&ie&&E.type!==`menu`&&(I=()=>u.state.activeIndex===null&&ie),De({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){u.setOpen(!1,c(e.reason,e.domEvent))}return te.events.on(`close`,e),()=>{te.events.off(`close`,e)}},[te.events,u]),Qe(O,{enabled:ne&&!A&&!F&&E.type!==`menubar`,closeDelay:k});let L=u.useStateSetter(`popupElement`),{parentVirtualFocusRef:R,handleFocus:z}=(Q.useContext(Ot)?.useParentHandoff??Zt)(u,E,b,m),B={transitionStatus:x,side:_,align:v,open:b,nested:E.type===`menu`,instant:w},V=Le(`div`,e,{state:B,ref:[t,u.context.popupRef,L,P],stateAttributesMapping:M,props:[S,{id:N,...ie?{role:`presentation`}:{role:`menu`,"aria-orientation":h===`horizontal`?`horizontal`:void 0,"aria-labelledby":ae},onKeyDown(e){oe?.onPopupKeyDown?.(e),y&&we.has(e.key)&&e.stopPropagation()},onFocus:z},Ze(x),l,{"data-rootownerid":ee}]}),H=E.type===void 0||F;(T||E.type===`menubar`&&D!==`outside-press`)&&(H=!0);let U=oe?.getReturnElement??R;return(0,$.jsx)(d,{context:O,openInteractionType:j,modal:F,disabled:!C,returnFocus:a??U??H,explicitReturnFocus:a===void 0&&U?!1:void 0,initialFocus:I,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:te,previousFocusableElement:T,nextFocusableElement:E.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:V})}),Xt={parentVirtualFocusRef:void 0,handleFocus:void 0};function Zt(){return Xt}var Qt=Q.forwardRef(function(e,t){let n=kt()?.Popup??Yt;return(0,$.jsx)(n,{...e,ref:t})}),$t=Q.createContext(void 0);function en(){let e=Q.useContext($t);if(e===void 0)throw Error(Fe(32));return e}var tn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Tt();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,$.jsx)($t.Provider,{value:n,children:(0,$.jsx)(E,{ref:t,...r,portalOwnerRole:o})})}),nn=Q.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=ue,style:_,...y}=e,{store:b,virtualFocus:x,syncHighlightedItem:S}=Tt(),C=en(),w=Dt(!0),T=b.useState(`parent`),E=b.useState(`floatingRootContext`),D=b.useState(`floatingTreeRoot`),ee=b.useState(`mounted`),O=b.useState(`open`),k=b.useState(`modal`),ne=b.useState(`openMethod`),A=b.useState(`activeTriggerElement`),j=b.useState(`transitionStatus`),re=b.useState(`positionerElement`),M=b.useState(`instantType`),ie=b.useState(`adaptiveOrigin`),N=b.useState(`lastOpenChangeReason`),P=b.useState(`floatingNodeId`),ae=b.useState(`floatingParentNodeId`),oe=E.useState(`domReferenceElement`),F=n,I=l,L=u,R=s,z=g;T.type===`context-menu`&&(F=n??T.context?.anchor,R??=`start`,!o&&R!==`center`&&(L=e.alignOffset??2,I=e.sideOffset??-5));let B=o,V=R;T.type===`menu`?(B??=`inline-end`,V??=`start`,z=e.collisionAvoidance??ge):T.type===`menubar`&&(B??=T.context.orientation===`vertical`?`inline-end`:`bottom`,V??=`start`);let H=T.type===`context-menu`,U=$e({anchor:F,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:ee,side:B,sideOffset:I,align:V,alignOffset:L,arrowPadding:H?0:p,collisionBoundary:d,collisionPadding:f,sticky:m,nodeId:P,keepMounted:C,disableAnchorTracking:h,collisionAvoidance:z,shift:H?{crossAxis:!(`side`in z&&z.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:ie,lazyFlip:x?`placement`:!1});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&b.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,c(te)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[b,D.events,P]),Q.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,c(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,b]);let se=ke();Q.useEffect(()=>{O||se.clear()},[O,se]),Q.useEffect(()=>{function e(e){if(O&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=b.select(`closeDelay`);e>0?se.isStarted()||se.start(e,()=>{b.setOpen(!1,c(te))}):b.setOpen(!1,c(te))}else se.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,O,A,b,se]),Q.useEffect(()=>{let e={open:O,nodeId:P,parentNodeId:ae,reason:b.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,O,b,P,ae]),nt({store:b,domReference:oe,positionerElement:re,open:O});let ce={open:O,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:T.type===`menu`,instant:M},le=T.type===`menubar`&&T.context.modal;at(O&&(le||k&&N!==`trigger-hover`),ne===`touch`,re,A);let W=et(e,ce,{styles:U.positionerStyles,transitionStatus:j,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!ee,inert:!O}),G=ee&&T.type!==`menu`&&(T.type!==`menubar`&&k&&N!==`trigger-hover`||T.type===`menubar`&&T.context.modal),q=null;return T.type===`menubar`?q=T.context.contentElement:T.type===void 0&&(q=A),(0,$.jsxs)(St.Provider,{value:U,children:[G&&(0,$.jsx)(pe,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:K(!O),cutout:q}),(0,$.jsx)(v,{id:P,children:(0,$.jsx)(ct,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:W})})]})}),rn=Q.createContext(null);function an(e){let t=Q.useContext(rn);if(t===null&&!e)throw Error(Fe(5));return t}function on(e){return e==null?Te:e.type.startsWith(`key`)?oe:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Ce:Te}var sn={...k,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=k.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>me&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!k.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},cn=class extends s{constructor(e,t,n=!1){let r=new W,i=un(r,t,n,e);super(i,ln(r),sn),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function ln(e){return{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Q.createRef(),beforeTriggerFocusGuardRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function un(e,t,n=!1,r){return{...Se(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Re,inputProps:Re,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new N,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Re,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var dn=Q.createContext(null);function fn(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function pn(e,t){return e===`list-navigation`||fn(e,t)}var mn=a(function(e){let{children:t,open:n,onOpenChange:i,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:u=!1,disabled:d=!1,modal:f,loopFocus:p=!0,orientation:m=`vertical`,actionsRef:g,closeParentOnEsc:v=!1,handle:y,triggerId:x,defaultTriggerId:C=null,highlightItemOnHover:w=!0,isSubmenu:T=!1,virtualFocus:E=!1,virtualFocusRef:D,allowEscape:O=!0,resetOnPointerLeave:te=!0}=e,k=Dt(!0),A=Tt(!0),re=an(!0),M=A?.store,N=A?.virtualFocus??!1,P=Q.useMemo(()=>T&&M?{type:`menu`,store:M}:re?{type:`menubar`,context:re}:k&&!M?{type:`context-menu`,context:k}:{type:void 0},[k,M,re,T]),ae=z(),F=z(),[L,R]=Q.useState(void 0),B=(L??F)||void 0,V=ie(),U=P.type===`menu`?P.store:void 0,se=(n??u)&&U?.state.transitionStatus===`starting`,le=Ne(()=>se?U?.state.instantType:void 0).current,W=Ne(()=>{let e=new cn({open:u,openProp:n,activeTriggerId:C,triggerIdProp:x,parent:P,disabled:d,highlightItemOnHover:w,modal:P.type===void 0?f:void 0,rootId:ae,instantType:le},B,V!=null);return e.context.virtualFocusRef=D,e}).current;W.useControlledProp(`openProp`,n),W.useControlledProp(`triggerIdProp`,x),W.useContextCallback(`onOpenChangeComplete`,a);let G=W.useState(`floatingTreeRoot`),K=_(G),q=W.useState(`open`),ue=W.useState(`activeTriggerElement`),de=W.useState(`positionerElement`),fe=W.useState(`hoverEnabled`),pe=W.useState(`disabled`),me=W.useState(`lastOpenChangeReason`),J=W.useState(`parent`),ge=W.useState(`activeIndex`),_e=W.useState(`keyboardOpen`),ve=W.useState(`payload`),ye=W.useState(`floatingParentNodeId`),be=Q.useRef(null),xe=Q.useRef(J.type!==`context-menu`),Se=ke(),Ce=Q.useRef(!0),we=ke(),Ee=ye!=null,{openMethod:De,triggerProps:Oe}=tt(q);W.useSyncedValues({disabled:d,highlightItemOnHover:w,modal:J.type===void 0?f:void 0,openMethod:De,rootId:ae}),h(W);let{forceUnmount:je,transitionStatus:Fe}=b(q,W,()=>{W.set(`allowMouseEnter`,!1)},se),Ie=Ae(W.context.popupRef);Q.useEffect(()=>{if(le===void 0)return;let e=()=>{W.state.instantType===le&&W.set(`instantType`,void 0)};if(!q){e();return}if(Fe!==void 0)return;if(W.context.popupRef.current==null){e();return}let t=new AbortController;return Ie(e,t.signal),()=>{t.abort()}},[le,q,Fe,Ie,W]),X(()=>{k&&!A?W.update({parent:{type:`context-menu`,context:k},floatingNodeId:K,floatingParentNodeId:V}):(A||!W.select(`activeTriggerElement`))&&W.update({floatingNodeId:K,floatingParentNodeId:V})},[k,A,K,V,ue,W]),Q.useEffect(()=>{q||(be.current=null),J.type===`context-menu`&&(q?Se.start(500,()=>{xe.current=!0}):(Se.clear(),xe.current=!1))},[Se,q,J.type]),X(()=>{!q&&!fe&&W.set(`hoverEnabled`,!0)},[q,fe,W]);let Le=Y((e,t)=>{let n=t.reason;if(!e&&!W.select(`open`)||q===e&&t.trigger===ue&&me===n)return;let r=S(t);if(!e&&t.trigger==null&&(t.trigger=ue??void 0),i?.(e,t),t.isCanceled)return;W.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!Ce.current)return;e&&n===`trigger-focus`?(Ce.current=!1,we.start(300,()=>{Ce.current=!0})):(Ce.current=!0,we.clear());let o=!e&&(n===`escape-key`||n==null);be.current=t.event;let s=l(W.state,e,t.trigger,r());s.openChangeReason=n,s.keyboardOpen=e&&pn(n,a),s.instantType=J.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:fn(n,a)?`click`:o?`dismiss`:void 0,W.update(s)}),ze=ne({popupStore:W,floatingRootContext:W.state.floatingRootContext,floatingId:B,nested:V!=null,onOpenChange:Le}),Be=ze.context.events;X(()=>{let e=({open:e,eventDetails:t})=>Le(e,t);return Be.on(`setOpen`,e),()=>{Be?.off(`setOpen`,e)}},[Be,Le]),X(()=>W.subscribeToParentMenu(),[W]);let Ve=Q.useCallback(()=>{W.setOpen(!1,c(H))},[W]);Q.useImperativeHandle(g,()=>({unmount:je,close:Ve}),[je,Ve]);let He;J.type===`context-menu`&&(He=J.context),Q.useImperativeHandle(He?.positionerRef,()=>de,[de]),Q.useImperativeHandle(He?.actionsRef,()=>({setOpen:Le}),[Le]);let Ue=j(ze,{enabled:!pe,bubbles:{escapeKey:v&&J.type===`menu`},outsidePress(){return J.type!==`context-menu`||be.current?.type===`contextmenu`||xe.current},externalTree:Ee?G:void 0}),We=I(),Z=bt(ze,{enabled:!pe,listRef:W.context.itemDomElements,activeIndex:ge,virtual:E,nested:J.type===`menubar`||!E&&J.type!==void 0,parentOrientation:J.type===`menubar`?J.context.orientation:void 0,loopFocus:p,focusItemOnOpen:E?_e:void 0,allowEscape:E&&p&&O,orientation:m,triggerOrientation:E?`vertical`:m,rtl:We===`rtl`,disabledIndices:Pe,onNavigate(e,t){W.setActiveIndex(e,on(t),t?.nativeEvent)},openOnArrowKeyDown:J.type!==`context-menu`&&!(E&&T),externalTree:!E&&Ee?G:void 0,nestedReturnFocusRef:U?.context.virtualFocusRef,focusItemOnHover:w,resetOnPointerLeave:te}),Ge=Q.useCallback(e=>{W.context.typingRef.current=e},[W]),Ke=xt(ze,{enabled:!pe&&!E,listRef:W.context.itemLabels,elementsRef:W.context.itemDomElements,activeIndex:ge,resetMs:500,onMatch:(e,t)=>{q&&e!==ge&&W.setActiveIndex(e,oe,t.nativeEvent)},onTyping:Ge}),qe=Y(s),Je=Q.useRef(-1),Ye=Y(()=>{let e=W.state.activeIndex,t=e===null?void 0:W.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Je.current===n&&W.context.reportedItem===t)return;Je.current=n,W.context.reportedItem=t,E&&W.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=W.context;W.context.highlightReason=Te,W.context.highlightEvent=void 0,s&&qe(t,o(r,i,{label:t===void 0?void 0:W.context.itemLabels.current[n]??void 0}))});X(()=>{Ye()},[ge,Ye]);let Xe=Q.useMemo(()=>{if(!E)return Z.reference;if(!Z.trigger)return Re;let{onFocus:e,...t}=Z.trigger;return t},[E,Z.reference,Z.trigger]);W.useSyncedValue(`inputProps`,E?Z.reference??Re:Re);let Ze=Q.useMemo(()=>{let e=Me(Ke.reference,Xe,Ue.reference,{onMouseMove(){W.set(`allowMouseEnter`,!0)}},Oe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=q,e},[W,Ke.reference,Xe,Ue.reference,Oe,q]),Qe=Q.useMemo(()=>{let e=Me(Z.trigger,Ue.trigger,Oe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Z.trigger,Ue.trigger,Oe]);Ne(()=>(W.update({inactiveTriggerProps:Qe}),null));let $e=Q.useMemo(()=>Me(r,{onMouseMove(){W.set(`allowMouseEnter`,!0),J.type===`menu`&&W.set(`hoverEnabled`,!1)},onClick(){W.select(`hoverEnabled`)&&W.set(`hoverEnabled`,!1)},onKeyDown(e){let t=W.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ke.floating,Z.floating,Ue.floating),[J.type,W,Ke.floating,Z.floating,Ue.floating]),et=Z.item??Re;ee(W,{floatingRootContext:ze,activeTriggerProps:Ze,inactiveTriggerProps:Qe,popupProps:$e,itemProps:et});let nt=Q.useMemo(()=>({store:W,parent:P,orientation:m,loopFocus:p,allowEscape:O,defaultFloatingId:F,setRenderedFloatingId:R,virtualFocus:E,parentVirtualFocus:N,syncHighlightedItem:Ye}),[W,P,m,p,O,F,E,N,Ye]),rt=typeof t==`function`?t({payload:ve}):t,it=(0,$.jsxs)(wt.Provider,{value:nt,children:[y&&(0,$.jsx)(ce,{handle:y,store:W}),rt]});return(J.type===void 0||J.type===`context-menu`)&&(it=(0,$.jsx)(he,{externalTree:G,children:it})),it});function hn(e){let t=Q.useContext(dn);if(t===null)return(0,$.jsx)(mn,{...e});let n=t.Root;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}var gn={};function _n(e){Tt();let t=Q.useContext(dn);if(t!==null){let n=t.SubmenuRoot;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}return(0,$.jsx)(Wt.Provider,{value:gn,children:(0,$.jsx)(mn,{...e,isSubmenu:!0})})}var vn=5;function yn(e,t){let n=bn(t);return e.clientX>=n.left-vn&&e.clientX<=n.right+vn&&e.clientY>=n.top-vn&&e.clientY<=n.bottom+vn}function bn(e){let t=e.getBoundingClientRect(),n=Ve(e);if(L)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function xn(e){if(Ge(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ke(e))return xn(Ue(e))}function Sn(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,ae(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Re,[t,n,r])}var Cn=w(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Tt(!0),h=Xe(d)??m?.store;if(!h)throw Error(Fe(85));let g=z(s),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),S=Q.useRef(null),C=Tn(),w=We(!0),T=re(),E=Q.useMemo(()=>T??new N,[T]),D=_(E),ee=ie(),{registerTrigger:O,isMountedByThisTrigger:te}=A(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:D,floatingParentNodeId:ee,keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,ne=h.useState(`disabled`),j=a||ne||k&&C.context.disabled,{getButtonProps:M,buttonRef:oe}=Z({disabled:j,native:o});Q.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let F=Q.useRef(null),I=ke(),L=Y(e=>{if(!F.current)return;I.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;G(F.current,t)||G(h.select(`positionerElement`),t)||t===F.current||(t==null||xn(t)!==h.select(`rootId`))&&(yn(e,F.current)||E.events.emit(`close`,{domEvent:e,reason:be}))});Q.useEffect(()=>{let e=ae(F.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[b,L,h]);let R=k&&C.context.hasSubmenuOpen,B=qe(y,{enabled:(c??R)&&!j&&(!k||R&&!te),handleClose:Ye({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),V=wn(b,h.select(`lastOpenChangeReason`)),H=rt(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&V}),U=Je(y,{enabled:!j&&R}),se=Sn({open:b,enabled:k,mouseDownAction:`open`}),ce=Q.useMemo(()=>Me(U.reference,H.reference),[U.reference,H.reference]),le=h.useState(`triggerProps`,te),W=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:K,handleFocusTargetFocus:q}=it(h,S),ue={disabled:j,open:b},de=[F,t,oe,O,S],pe=[ce,B??Re,le,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(I.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),ae(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},W,k?{role:`menuitem`}:{},se,p,M],me=Le(`button`,e,{enabled:!k,stateAttributesMapping:P,state:ue,ref:de,props:pe});return k?(0,$.jsx)(ut,{tag:`button`,render:n,className:r,style:i,state:ue,refs:de,props:pe,stateAttributesMapping:P}):b?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(fe,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:K},`${g}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:me},g),(0,$.jsx)(fe,{ref:h.context.triggerFocusTargetRef,onFocus:q},`${g}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:me},g)});function wn(e,t){let n=ke(),[r,i]=Q.useState(!1);return X(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Tn(){let e=an(!0);return Q.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var En={"aria-expanded":void 0},Dn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:l=!0,delay:u=100,closeDelay:d=0,disabled:f=!1,...m}=e,h=Tt(!0);if(h?.parent.type!==`menu`)throw Error(Fe(37));let g=Ct(),_=Gt(),{store:v,parentVirtualFocus:y}=h,b=h.parent.store,x=lt({guess:!0,label:a}),S=z(o),C=v.useState(`open`),w=Q.useRef(!1),T=v.useState(`positionerElement`),E=v.useState(`floatingRootContext`),ee=v.useState(`floatingTreeRoot`),O=v.useState(`triggerPopupId`,S),te=p(S,v),k=Y(e=>{te(e);let t=v.select(`activeTriggerElement`);e!==null&&v.select(`open`)&&(t===e||v.select(`activeTriggerId`)==null)&&v.update({activeTriggerId:S??null,activeTriggerElement:e,closeDelay:d})}),ne=Q.useRef(null),A=Q.useCallback(e=>{ne.current=e,v.set(`activeTriggerElement`,e)},[v]);X(()=>(k(ne.current),()=>k(null)),[k,S,v]),X(()=>{if(!C||!T)return;function e(e){ye(e)===v.context.beforeContentFocusGuardRef.current&&(w.current=e.relatedTarget===ne.current)}return T.addEventListener(`focusout`,e,!0),()=>{w.current=!1,T.removeEventListener(`focusout`,e,!0)}},[C,T,v]),v.useSyncedValue(`closeDelay`,d);let j=v.useState(`disabled`),re=b.useState(`disabled`),M=f||j||re,ie=b.useState(`itemProps`),N=b.useState(`isActive`,x.index),P=Q.useMemo(()=>({type:`submenu-trigger`,setActive(e){b.select(`highlightItemOnHover`)&&b.setActiveIndex(x.index,Ce,e)}}),[b,x.index]),{getItemProps:ae,itemRef:oe}=It({closeOnClick:!1,disabled:M,highlighted:N,id:S,store:v,typingRef:b.context.typingRef,nativeButton:s,itemMetadata:P,nodeId:g?.context.nodeId}),F=v.useState(`hoverEnabled`),I=qe(E,{enabled:F&&l&&!M,handleClose:Ye({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:d},shouldOpen:u>0?()=>b.select(`allowMouseEnter`):void 0,triggerElementRef:ne,externalTree:ee,isClosing:()=>v.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),L=rt(E,{enabled:!M,event:`mousedown`,toggle:!0,ignoreMouse:l,stickIfOpen:l}).reference??Re,B=v.useState(`triggerProps`,!0);delete B.id;let V={disabled:M,highlighted:N,open:C},H=v.useState(`openMethod`),U=v.useState(`lastOpenChangeReason`)===`list-navigation`||H===`keyboard`,se=C&&U&&R,ce=_?.onTriggerKeyDown?{onKeyDown:_.onTriggerKeyDown}:void 0;return Le(`div`,e,{state:V,stateAttributesMapping:D,props:[L,I,B,ce,ie,se?En:void 0,{"aria-controls":O,tabIndex:y||!(C||N)?-1:0,onFocus(e){v.select(`open`)&&w.current&&(w.current=!1,v.setOpen(!1,c(q,e.nativeEvent)))},onBlur(){N&&b.setActiveIndex(null,Te)}},m,ae],ref:[t,x.ref,oe,k,A]})}),On=Q.forwardRef(function(e,t){let n=Mt(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Me(n.props,e):e;return(0,$.jsx)(Dn,{...r,ref:n.ref})});function kn({...e}){return(0,$.jsx)(hn,{"data-slot":`dropdown-menu`,...e})}function An({...e}){return(0,$.jsx)(Cn,{"data-slot":`dropdown-menu-trigger`,...e})}function jn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(tn,{children:(0,$.jsx)(nn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(Qt,{"data-slot":`dropdown-menu-content`,className:je(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-sm text-popover-foreground shadow-raised ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Mn({...e}){return(0,$.jsx)(zt,{"data-slot":`dropdown-menu-group`,...e})}function Nn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(Vt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:je(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/15 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Pn({className:e,inset:t,...n}){return(0,$.jsx)(Ut,{"data-slot":`dropdown-menu-link-item`,"data-inset":t,className:je(`relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...n})}function Fn({...e}){return(0,$.jsx)(_n,{"data-slot":`dropdown-menu-sub`,...e})}function In({className:e,inset:t,children:n,...r}){return(0,$.jsxs)(On,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:je(`flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,$.jsx)(ot,{className:`ml-auto`})]})}function Ln({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,$.jsx)(jn,{"data-slot":`dropdown-menu-sub-content`,className:je(`w-auto min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-raised ring-1 ring-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function Rn({className:e,...t}){return(0,$.jsx)(pt,{"data-slot":`dropdown-menu-separator`,className:je(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Pn as a,Ln as c,ft as d,Nn as i,In as l,jn as n,Rn as o,Mn as r,Fn as s,kn as t,An as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{k as r}from"./page-BuzrT_cg.js";import{d as i,o as a,t as o}from"./error-alert-NXb1Z8Xz.js";import{vn as s}from"./queries-BwtMk72-.js";import{n as c}from"./overview-BdUgx_pE.js";import{D as l,W as u,t as d}from"./button-4rhhIcK8.js";import{D as f,U as p,V as m,v as h}from"./strings-qxNeGv33.js";import{t as g}from"./queries-BnlycW8v.js";import{M as _}from"./index-CPkHl5O3.js";var v=n(e(),1),y=new Map([[`bold`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),v.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),b=v.forwardRef((e,t)=>v.createElement(u,{ref:t,...e,weights:y}));b.displayName=`CaretDownIcon`;var x=t();function S({className:e,...t}){return(0,x.jsx)(`textarea`,{"data-slot":`textarea`,className:l(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-card px-2 py-2 text-sm caret-primary transition-[color,border-color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring/70 focus-visible:ring-2 focus-visible:ring-ring/25 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/25`,e),...t})}function C({className:e,...t}){return(0,x.jsx)(`label`,{"data-slot":`label`,className:l(`flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function w({className:e,size:t=`default`,...n}){return(0,x.jsxs)(`div`,{className:l(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,x.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`h-7 w-full min-w-0 appearance-none rounded-md border border-input bg-input/20 py-0.5 pr-6 pl-2 text-xs/relaxed transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-[size=sm]:h-6 data-[size=sm]:text-xs dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,...n}),(0,x.jsx)(b,{className:`pointer-events-none absolute top-1/2 right-1.5 size-3.5 -translate-y-1/2 text-muted-foreground select-none group-data-[size=sm]/native-select:size-3 group-data-[size=sm]/native-select:-translate-y-[calc(--spacing(1.25))]`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function T({className:e,...t}){return(0,x.jsx)(`option`,{"data-slot":`native-select-option`,className:l(`bg-[Canvas] text-[CanvasText]`,e),...t})}var E={retry:{title:`Edit and retry`,note:`Uses the selected agent's current definition, even if you keep the same name. Later attempts use this task and agent until you edit them again.`,submit:`Save and retry`},runAgain:{title:`Edit and run again`,note:`Opens a new run on this item with this task and agent. This run is unchanged.`,submit:`Save and run again`}},D=(e,t)=>t===`retry`?e.canRetry:e.canRunAgain,O=(e,t)=>{let n=r();return i({mutationFn:t=>h(n=>n.editAndRetry({params:{runId:e.id},payload:t})),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:a(e.id)}),n.invalidateQueries({queryKey:c().queryKey})]),t()}})},k=({run:e,intent:t,close:n,openRun:r,className:i})=>{let[a,c]=(0,v.useState)(e.task),[u,h]=(0,v.useState)(e.agent),y=(0,v.useId)(),b=E[t],D=s(g()),k=O(e,n),A=_(),j=t===`retry`?k:A,M=a.trim().length>0&&D.data?.some(e=>e===u)===!0,N=()=>{let n=new f({task:m.make(a),agent:p.make(u)});t===`retry`?k.mutate(n):A.mutate({runId:e.id,amendment:n},{onSuccess:e=>{e._tag===`Claimed`&&r(e.runId)}})};return(0,x.jsxs)(`form`,{"aria-label":b.title,className:l(`space-y-3`,i),onSubmit:e=>{e.preventDefault(),!j.isPending&&M&&N()},children:[(0,x.jsx)(`h3`,{className:`text-md font-semibold`,children:b.title}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b.note}),(0,x.jsx)(C,{htmlFor:`${y}-task`,children:`Task`}),(0,x.jsx)(S,{id:`${y}-task`,value:a,onChange:e=>c(e.target.value),rows:7,disabled:j.isPending}),(0,x.jsx)(C,{htmlFor:`${y}-agent`,children:`Agent`}),(0,x.jsxs)(w,{id:`${y}-agent`,value:u,onChange:e=>h(e.target.value),disabled:j.isPending||D.isPending,children:[!D.data?.includes(e.agent)&&(0,x.jsxs)(T,{value:e.agent,disabled:!0,children:[e.agent,` · unavailable`]}),D.data?.map(e=>(0,x.jsx)(T,{value:e,children:e},e))]}),(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(d,{type:`submit`,size:`sm`,disabled:j.isPending||!M,children:b.submit}),(0,x.jsx)(d,{type:`button`,size:`sm`,variant:`ghost`,disabled:j.isPending,onClick:n,children:`Close editor`})]}),A.data?._tag===`CycleBlocked`&&(0,x.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),D.isError&&(0,x.jsx)(o,{message:D.error.message}),j.isError&&(0,x.jsx)(o,{message:j.error.message})]})};export{b as a,S as i,D as n,C as r,k as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,E as n}from"./button-4rhhIcK8.js";var r=e();function i({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty`,className:t(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...n})}function a({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-header`,className:t(`flex max-w-sm flex-col items-center gap-1`,e),...n})}var o=n(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function s({className:e,variant:n=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":n,className:t(o({variant:n,className:e})),...i})}function c({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-title`,className:t(`font-heading text-sm font-medium tracking-tight`,e),...n})}function l({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-description`,className:t(`text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...n})}function u({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-content`,className:t(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance`,e),...n})}export{s as a,a as i,u as n,c as o,l as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{E as r,T as i,f as a,g as o,k as s,l as c,m as l,u,x as d}from"./page-BuzrT_cg.js";import{k as f}from"./overview-BdUgx_pE.js";import{D as p,E as m,U as h}from"./button-4rhhIcK8.js";import{N as g,O as _,j as v,jt as y,v as b}from"./strings-qxNeGv33.js";var x=class extends c{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||S(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=u({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),a.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function S(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var C=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&o(t.mutationKey)!==o(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??S();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){a.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},w=n(e(),1);function T(e,t){let n=s(t),[i]=w.useState(()=>new C(n,e));w.useEffect(()=>{i.setOptions(e)},[i,e]);let o=w.useSyncExternalStore(w.useCallback(e=>i.subscribe(a.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=w.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(d)},[i]);if(o.error&&r(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}var E=(e,t)=>{let n=new Map(e.map(e=>[e.sequence,e]));for(let e of t)n.has(e.sequence)||n.set(e.sequence,e);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},D=(e,t,n)=>[...e.filter(({attemptId:e})=>e!==t),...n].sort((e,t)=>e.before-t.before),O=(e,t,n)=>new _({...e,transcript:E(e.transcript,t.transcript),earlierTranscript:D(e.earlierTranscript,n.attemptId,t.earlierTranscript)}),k=e=>{let t=new Map;for(let n of e){if(n.payload._tag!==`SessionEvent`)continue;let e=n.payload.event;e._tag===`PoolRateLimitsUpdated`&&t.set(e.pool,{pool:e.pool,windows:y([e.rateLimits.primary,e.rateLimits.secondary])})}return[...t.values()]},A=async(e,t)=>{let n=await t(e);if(e._tag===`ColdTranscriptRequest`)return n;let r=n.transcript;for(;!n.run.canCancel;){let e=n.transcript.at(-1);if(e===void 0)break;n=await t(new g({after:e.sequence})),r=E(r,n.transcript)}return new _({...n,transcript:r})},j=[`run`],M=e=>[...j,e],N=(e,t)=>{let n=M(t);return f({queryKey:n,queryFn:async()=>{let r=e.getQueryData(n)?.transcript.at(-1)?.sequence,i=await A(r===void 0?new v:new g({after:r}),e=>b(n=>n.detail({params:{runId:t},query:e}))),a=e.getQueryData(n);return r===void 0||a===void 0?i:new _({...i,transcript:E(a.transcript,i.transcript),earlierTranscript:a.earlierTranscript})},staleTime:1e3,structuralSharing:!1,refetchInterval:e=>e.state.data?.run.canCancel===!0&&1e3})},P=t(),F=m(`group/alert relative grid w-full gap-0.5 rounded-lg border px-3 py-2.5 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/25 bg-destructive/8 text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function I({className:e,variant:t,...n}){return(0,P.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:p(F({variant:t}),e),...n})}function L({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`alert-title`,className:p(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function R({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`alert-description`,className:p(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function z({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`alert-action`,className:p(`absolute top-1.5 right-2`,e),...t})}var B=({title:e,message:t,className:n})=>(0,P.jsxs)(I,{variant:`destructive`,className:p(`wrap-anywhere`,n),children:[(0,P.jsx)(h,{weight:`fill`}),e!==void 0&&(0,P.jsx)(L,{children:e}),(0,P.jsx)(R,{children:t})]});export{L as a,N as c,T as d,x as f,R as i,O as l,I as n,M as o,z as r,j as s,B as t,k as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{Bt as t}from"./strings-qxNeGv33.js";var n=e(),r={read:`Could not read the file`,yaml:`Frontmatter is not valid YAML`,frontmatter:`Frontmatter block missing or not closed`,schema:`Invalid file name or field value`,expression:`Invalid expression`,reference:`Unknown agent, repository, or tag`},i=({error:e,consequence:i})=>{let a=t(e.expression);return(0,n.jsxs)(`div`,{className:`flex max-w-[72ch] flex-col gap-3`,children:[(0,n.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 wrap-anywhere`,children:[(0,n.jsx)(`p`,{className:`font-medium text-destructive`,children:r[e.stage]}),(0,n.jsx)(`p`,{children:e.message}),a!==void 0&&(0,n.jsx)(`code`,{className:`mt-1 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:a})]}),(0,n.jsxs)(`p`,{className:`text-muted-foreground`,children:[i,` Fix `,(0,n.jsx)(`code`,{className:`font-mono text-xs`,children:e.file}),`, then reload the configuration.`]})]})};export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";import{r as n}from"./table-hbKjhjeL.js";var r=e(),i=({className:e,...i})=>(0,r.jsx)(n,{className:t(`w-full max-w-0`,e),...i});export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{n as t}from"./queries-BwtMk72-.js";import{D as n}from"./button-4rhhIcK8.js";import{Wt as r}from"./strings-qxNeGv33.js";var i=e(),a=({item:e,title:a,variant:o,linked:s=!0,as:c=o===`page`?`h1`:`span`,className:l,style:u})=>(0,i.jsxs)(c,{className:n(o===`page`?`text-xl font-semibold wrap-anywhere`:`block truncate text-sm font-medium`,l),...u===void 0?{}:{style:u},...o===`row`?{title:a}:{},children:[r(e,{onNone:()=>null,onSome:e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{item:e,size:o===`page`?`title`:`inline`,linked:s}),` `]})}),a]});export{a as t};
|