@usine/server 0.3.0 → 0.4.0
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/LICENSE +661 -21
- package/README.md +22 -4
- package/dist/backend.d.ts +3 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +5 -1
- package/dist/backend.js.map +1 -1
- package/dist/backup.d.ts +3 -3
- package/dist/backup.d.ts.map +1 -1
- package/dist/backup.js +3 -5
- package/dist/backup.js.map +1 -1
- package/dist/cli.d.ts +58 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +216 -17
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +22 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +51 -0
- package/dist/command.js.map +1 -0
- package/dist/detach.d.ts +83 -0
- package/dist/detach.d.ts.map +1 -0
- package/dist/detach.js +320 -0
- package/dist/detach.js.map +1 -0
- package/dist/failure-message.d.ts +7 -1
- package/dist/failure-message.d.ts.map +1 -1
- package/dist/failure-message.js +71 -2
- package/dist/failure-message.js.map +1 -1
- package/dist/http.d.ts +14 -5
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +25 -13
- package/dist/http.js.map +1 -1
- package/dist/instance/environment.d.ts +17 -0
- package/dist/instance/environment.d.ts.map +1 -0
- package/dist/instance/environment.js +51 -0
- package/dist/instance/environment.js.map +1 -0
- package/dist/instance/id.d.ts +17 -0
- package/dist/instance/id.d.ts.map +1 -0
- package/dist/instance/id.js +35 -0
- package/dist/instance/id.js.map +1 -0
- package/dist/{instance-lock.d.ts → instance/lock.d.ts} +9 -5
- package/dist/instance/lock.d.ts.map +1 -0
- package/dist/instance/lock.js +127 -0
- package/dist/instance/lock.js.map +1 -0
- package/dist/instance/manifest.d.ts +52 -0
- package/dist/instance/manifest.d.ts.map +1 -0
- package/dist/instance/manifest.js +131 -0
- package/dist/instance/manifest.js.map +1 -0
- package/dist/instance/operator-api.d.ts +30 -0
- package/dist/instance/operator-api.d.ts.map +1 -0
- package/dist/instance/operator-api.js +47 -0
- package/dist/instance/operator-api.js.map +1 -0
- package/dist/instance/ports.d.ts +23 -0
- package/dist/instance/ports.d.ts.map +1 -0
- package/dist/instance/ports.js +81 -0
- package/dist/instance/ports.js.map +1 -0
- package/dist/instance/record.d.ts +82 -0
- package/dist/instance/record.d.ts.map +1 -0
- package/dist/instance/record.js +116 -0
- package/dist/instance/record.js.map +1 -0
- package/dist/instance/state.d.ts +45 -0
- package/dist/instance/state.d.ts.map +1 -0
- package/dist/instance/state.js +79 -0
- package/dist/instance/state.js.map +1 -0
- package/dist/instance/systemd.d.ts +36 -0
- package/dist/instance/systemd.d.ts.map +1 -0
- package/dist/instance/systemd.js +61 -0
- package/dist/instance/systemd.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +27 -0
- package/dist/logger.js.map +1 -0
- package/dist/main.js +35 -9
- package/dist/main.js.map +1 -1
- package/dist/registry.d.ts +20 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +37 -0
- package/dist/registry.js.map +1 -0
- package/dist/restart.d.ts +19 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/restart.js +105 -0
- package/dist/restart.js.map +1 -0
- package/dist/status.d.ts +12 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +99 -0
- package/dist/status.js.map +1 -0
- package/dist/stop.d.ts +81 -0
- package/dist/stop.d.ts.map +1 -0
- package/dist/stop.js +195 -0
- package/dist/stop.js.map +1 -0
- package/dist/system-sleep.d.ts +9 -0
- package/dist/system-sleep.d.ts.map +1 -0
- package/dist/system-sleep.js +42 -0
- package/dist/system-sleep.js.map +1 -0
- package/dist/tracing.d.ts +22 -0
- package/dist/tracing.d.ts.map +1 -0
- package/dist/tracing.js +61 -0
- package/dist/tracing.js.map +1 -0
- package/dist/up.d.ts +2 -2
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +41 -16
- package/dist/up.js.map +1 -1
- package/dist/upgrade.d.ts +58 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +237 -0
- package/dist/upgrade.js.map +1 -0
- package/dist/web/assets/CompositeItem-DU6IyNMY.js +1 -0
- package/dist/web/assets/ToolbarRootContext-Cytu6o2e.js +1 -0
- package/dist/web/assets/X.es-B7iqdxa_.js +1 -0
- package/dist/web/assets/_agent-BVKD5odk.js +1 -0
- package/dist/web/assets/_loop-BFLzamuo.js +1 -0
- package/dist/web/assets/_name-Bh4AQ9sR.js +6 -0
- package/dist/web/assets/_name-CMVsmWzq.js +1 -0
- package/dist/web/assets/_name-DCkgEma_.js +1 -0
- package/dist/web/assets/_name-Ds_pWi15.js +1 -0
- package/dist/web/assets/_number-B9aYwvcQ.js +1 -0
- package/dist/web/assets/_run-BZWt47QS.js +8 -0
- package/dist/web/assets/_worker-Dgfufm5p.js +1 -0
- package/dist/web/assets/action-rCd1FeAz.js +1 -0
- package/dist/web/assets/agents-Drbg6qpH.js +1 -0
- package/dist/web/assets/agents-_6-dEjrY.js +1 -0
- package/dist/web/assets/button-DVWXde__.js +1 -0
- package/dist/web/assets/collapsible-IOhZV1qg.js +1 -0
- package/dist/web/assets/{core-BUmsKffF.js → core-wi-Hu_JV.js} +1 -1
- package/dist/web/assets/drawer-BiqnR_8i.js +1 -0
- package/dist/web/assets/dropdown-menu-C9D1kRkO.js +1 -0
- package/dist/web/assets/edit-and-retry-BgOR6mvP.js +1 -0
- package/dist/web/assets/error-alert-9tKpTE3v.js +1 -0
- package/dist/web/assets/file-error-SjG2jLJ9.js +1 -0
- package/dist/web/assets/fill-cell-ClM88KFD.js +1 -0
- package/dist/web/assets/heading-lX1a1LNN.js +1 -0
- package/dist/web/assets/index-BymNZU1Q.js +10 -0
- package/dist/web/assets/index-Dyjfp3ET.css +2 -0
- package/dist/web/assets/label-badge-aIGT1Bry.js +1 -0
- package/dist/web/assets/list-v8WJp2Eq.js +1 -0
- package/dist/web/assets/loops-BFoFf_og.js +1 -0
- package/dist/web/assets/mark-CC3RwMy_.js +1 -0
- package/dist/web/assets/{markdown-D07-JkYB.js → markdown-BnyfnuCL.js} +4 -4
- package/dist/web/assets/matchContext-BquevSJS.js +2 -0
- package/dist/web/assets/model-BerBT6R0.js +1 -0
- package/dist/web/assets/moves-Dg9sshX5.js +1 -0
- package/dist/web/assets/overview-C_tFKGZ8.js +1 -0
- package/dist/web/assets/page-DWnGi6wA.js +301 -0
- package/dist/web/assets/project-not-found-CodaBVdu.js +1 -0
- package/dist/web/assets/pull-request-marks-DE00nqGW.js +1 -0
- package/dist/web/assets/queries-B1SHA_r4.js +1 -0
- package/dist/web/assets/reload-Dsl0zjJ7.js +1 -0
- package/dist/web/assets/repositories-BdxmD192.js +1 -0
- package/dist/web/assets/repositories-D4wYJfa_.js +1 -0
- package/dist/web/assets/route-B_gphTYG.js +1 -0
- package/dist/web/assets/route-Cc7dKnn5.js +1 -0
- package/dist/web/assets/routes-BLy5TGH_.js +65 -0
- package/dist/web/assets/run-again-BTKagSXR.js +1 -0
- package/dist/web/assets/section-B3pWIIBa.js +1 -0
- package/dist/web/assets/section-CD-MB5r3.js +1 -0
- package/dist/web/assets/section-Id99HktI.js +1 -0
- package/dist/web/assets/settings-YrDysQXW.js +1 -0
- package/dist/web/assets/slots-BraHmbNr.js +1 -0
- package/dist/web/assets/status-badge-DnvNo1tG.js +1 -0
- package/dist/web/assets/strings-CW2XaR5f.js +1 -0
- package/dist/web/assets/table-BjyI4fVI.js +1 -0
- package/dist/web/assets/tasks-DCL8kLmD.js +1 -0
- package/dist/web/assets/transcript-sxRJzx6t.js +5 -0
- package/dist/web/assets/usage-CLQJdX9-.js +1 -0
- package/dist/web/assets/use-now-0P8TUXeg.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-CQ83Wy-r.js +1 -0
- package/dist/web/assets/useNavigate-BW1WdocJ.js +1 -0
- package/dist/web/assets/usePositioner-rNCxnHO-.js +1 -0
- package/dist/web/assets/useTimeout-_TcdZXP6.js +1 -0
- package/dist/web/assets/with-selector-DoElmmtd.js +1 -0
- package/dist/web/assets/workers-BH5CBOR3.js +1 -0
- package/dist/web/index.html +15 -12
- package/package.json +16 -15
- package/dist/instance-lock.d.ts.map +0 -1
- package/dist/instance-lock.js +0 -58
- package/dist/instance-lock.js.map +0 -1
- package/dist/web/assets/DialogTitle-DrHlwOSg.js +0 -1
- package/dist/web/assets/_agent-cBqm12lE.js +0 -1
- package/dist/web/assets/_loop-kf1h3qkS.js +0 -1
- package/dist/web/assets/_name-CKWcxUh0.js +0 -2
- package/dist/web/assets/_name-DCEDRHnF.js +0 -1
- package/dist/web/assets/_name-sJkGyn7O.js +0 -1
- package/dist/web/assets/_number-DbgcVg1N.js +0 -1
- package/dist/web/assets/_run-DqslP0y6.js +0 -8
- package/dist/web/assets/_worker-CH4UoJT_.js +0 -1
- package/dist/web/assets/action-DYT048Jm.js +0 -1
- package/dist/web/assets/agents-DIZolb0U.js +0 -1
- package/dist/web/assets/agents-DMhSMb9O.js +0 -1
- package/dist/web/assets/button-C4yvcSko.js +0 -2
- package/dist/web/assets/copy-BM1l6IGB.js +0 -1
- package/dist/web/assets/error-alert-BrI00JbQ.js +0 -1
- package/dist/web/assets/file-error-C--_cWuj.js +0 -1
- package/dist/web/assets/index-BljdfRBm.js +0 -10
- package/dist/web/assets/index-YKcAk3No.css +0 -2
- package/dist/web/assets/item-rBBCTV8x.js +0 -1
- package/dist/web/assets/label-badge-ohqvZnY7.js +0 -1
- package/dist/web/assets/loops-CXM3f90o.js +0 -1
- package/dist/web/assets/loops-DWLXyUPN.js +0 -1
- package/dist/web/assets/moves-RiWgdCxQ.js +0 -5
- package/dist/web/assets/operator-copy-DsM7LJx6.js +0 -301
- package/dist/web/assets/outcome-YiIf6xbJ.js +0 -5
- package/dist/web/assets/project-not-found-CQVclgb0.js +0 -1
- package/dist/web/assets/query-DWN8IHdt.js +0 -1
- package/dist/web/assets/repositories-CoTEmYmS.js +0 -1
- package/dist/web/assets/repositories-Cq7zGzNb.js +0 -1
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +0 -1
- package/dist/web/assets/route-CE9U74a9.js +0 -1
- package/dist/web/assets/route-DNH2EwHP.js +0 -1
- package/dist/web/assets/routes-XAUJJqfj.js +0 -1
- package/dist/web/assets/run-again-DxjFCuNu.js +0 -1
- package/dist/web/assets/run-drawer-CyjxH5mf.js +0 -1
- package/dist/web/assets/section-BBnBOk-U.js +0 -1
- package/dist/web/assets/section-Cm-j3zHs.js +0 -1
- package/dist/web/assets/section-DkBCDv4D.js +0 -1
- package/dist/web/assets/settings-iZf872O5.js +0 -1
- package/dist/web/assets/status-badge-CNlyvwWL.js +0 -1
- package/dist/web/assets/table-B6NH8hTW.js +0 -1
- package/dist/web/assets/tasks-DhLW-1gg.js +0 -1
- package/dist/web/assets/usage-DPUTTLGs.js +0 -1
- package/dist/web/assets/use-now-CcFZyFvf.js +0 -1
- package/dist/web/assets/useNavigate-lXd3v3E0.js +0 -1
- package/dist/web/assets/usePositioner-WErrA3Ah.js +0 -1
- package/dist/web/assets/useScrollLock-BOb01sL8.js +0 -1
- package/dist/web/assets/useTriggerFocusGuards-B0FItfLc.js +0 -1
- package/dist/web/assets/utils-BEQKLGgi.js +0 -1
- package/dist/web/assets/with-selector-NsM_5qXG.js +0 -1
- package/dist/web/assets/workers-BgocBXT9.js +0 -1
- package/dist/web/assets/workers-Dw2uHY0Y.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-D07-JkYB.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-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(`
|
|
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{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{Gt as r,Jt as i,Kt as a,Rt as o,Xt as s,m as c,s as l}from"./page-DWnGi6wA.js";import{t as u}from"./error-alert-9tKpTE3v.js";import{D as d,G as f,W as p,n as m}from"./button-DVWXde__.js";import{n as h,t as g}from"./edit-and-retry-BgOR6mvP.js";import{a as _,h as v,l as y,m as b,n as x,p as S,r as C,u as w}from"./transcript-sxRJzx6t.js";import{r as T}from"./strings-CW2XaR5f.js";import{n as E,p as D,r as O}from"./overview-C_tFKGZ8.js";import{$ as k,A,G as j,K as M,Q as N,X as P,Z as F,et as I,q as L}from"./index-BymNZU1Q.js";import{t as R}from"./use-now-0P8TUXeg.js";var z=e(t(),1),B=new Map([[`bold`,z.createElement(z.Fragment,null,z.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`,z.createElement(z.Fragment,null,z.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`}),z.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`,z.createElement(z.Fragment,null,z.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`,z.createElement(z.Fragment,null,z.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`,z.createElement(z.Fragment,null,z.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`,z.createElement(z.Fragment,null,z.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`}))]]),V=z.forwardRef((e,t)=>z.createElement(p,{ref:t,...e,weights:B}));V.displayName=`ArrowsOutSimpleIcon`;var H=n(),U=({detail:e})=>{let t=(0,z.useMemo)(()=>_(S(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,H.jsxs)(`div`,{className:`space-y-4`,children:[n===void 0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Attempt starting`}):(0,H.jsx)(w,{chapter:n}),r?._tag===`Message`&&(0,H.jsxs)(`section`,{"aria-label":`Latest message`,className:`space-y-1`,children:[(0,H.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:r.speaker.name}),(0,H.jsx)(`time`,{dateTime:r.receivedAt,title:c(r.receivedAt),className:`font-mono tabular-nums text-muted-foreground`,children:l(r.receivedAt)})]}),(0,H.jsx)(`p`,{className:`line-clamp-6 text-md wrap-anywhere`,children:y(r.text)}),r.queued!==null&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D(r.queued)})]})]})},W=e=>{let t=e.attempts.at(-1),n=t?.salvage??null;return e.state===`Succeeded`?i({_tag:`Succeeded`,message:o(e.resultMessage)}):e.state===`Canceled`?i({_tag:`Canceled`,salvage:n}):e.state===`Failed`&&t?.outcome?._tag===`Failed`?i({_tag:`Failed`,failure:t.outcome.failure,salvage:n}):a()},G=({machine:e})=>{let t=R(15e3);return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:T(e,t)})},K=({detail:e})=>{let t=e.run;switch(t.state){case`Pending`:return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Opened, not scheduled yet`});case`Waiting`:return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Waiting for approval`});case`Queued`:return e.machine?.state===`creating`?(0,H.jsx)(G,{machine:e.machine}):(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Approved, waiting for a free worker`});case`Running`:return(0,H.jsx)(U,{detail:e});case`Succeeded`:case`Failed`:case`Canceled`:return r(W(t),{onNone:()=>(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt started`}),onSome:e=>(0,H.jsx)(C,{end:e,outOfMemory:t.attempts.at(-1)?.outOfMemory??null})})}},q=({runId:e,open:t,close:n})=>{let{data:r}=s(E()),i=x(e,t),[a,o]=(0,z.useState)(null),c=A(),l=i.data?.run;return(0,H.jsx)(P,{open:t,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(F,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-md`,children:[(0,H.jsx)(k,{className:`shrink-0 gap-3 border-b px-5 pt-5 pb-4 pr-20`,children:l===void 0||i.data===void 0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(I,{children:`Loading…`}),(0,H.jsx)(N,{children:`Loading run…`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(v,{detail:i.data,overview:r,placement:`drawer`,shared:t,as:I,actions:(0,H.jsx)(b,{detail:i.data,onEdit:o,openRun:c})}),(0,H.jsxs)(N,{className:`sr-only`,children:[`Run `,l.id,` of `,l.loop,` on `,l.repository]})]})}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[i.isError&&(0,H.jsx)(u,{message:i.error.message}),l!==void 0&&a!==null&&h(l,a)&&(0,H.jsx)(g,{run:l,intent:a,close:()=>o(null),openRun:c},`${l.id}:${a}`),i.data!==void 0&&(0,H.jsx)(K,{detail:i.data}),l!==void 0&&(0,H.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...O(l.repository),run:l.id},search:{},viewTransition:!0,className:m({variant:`outline`}),children:`Open run page`})]}),l!==void 0&&(0,H.jsxs)(j,{children:[(0,H.jsx)(L,{render:(0,H.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...O(l.repository),run:l.id},search:{},viewTransition:!0,"aria-label":`Open run page`,className:d(m({variant:`ghost`,size:`icon-sm`}),`absolute top-4 right-11`)}),children:(0,H.jsx)(V,{"aria-hidden":`true`})}),(0,H.jsx)(M,{side:`bottom`,children:`Open run page`})]})]})})};export{q as RunDrawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{A as r,At as i,B as a,C as o,D as s,E as c,Et as l,F as u,Ft as d,G as f,Gt as p,H as m,I as h,J as g,K as _,L as v,Lt as y,M as b,Mt as x,Nt as S,O as C,P as w,Pt as ee,Rt as T,T as E,Tt as te,U as D,V as O,Vt as ne,W as k,Wt as re,X as A,Xt as j,Y as ie,Yt as M,Z as N,Zt as P,_t as F,an as I,at as ae,bt as L,cn as R,dn as z,f as oe,fn as B,gn as V,gt as H,hn as U,ht as W,in as G,jt as se,k as ce,ln as K,lt as le,mn as q,mt as ue,nn as de,nt as fe,on as pe,ot as J,p as me,pt as he,q as ge,rn as _e,rt as ve,tt as ye,u as be,un as xe,v as Se,vt as Ce,w as we,xt as Te,zt as Ee}from"./mark-CC3RwMy_.js";import{A as Y,D as De,F as Oe,H as ke,L as Ae,M as X,N as je,P as Me,R as Ne,V as Pe,W as Fe,h as Ie,i as Le,k as Z,m as Re,o as ze,r as Be,v as Ve,y as He}from"./button-DVWXde__.js";import{a as Ue,d as We,n as Ge,o as Ke}from"./useTimeout-_TcdZXP6.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-rNCxnHO-.js";import{i as tt,n as nt,o as rt,r as it,t as at}from"./useAnchoredPopupScrollLock-CQ83Wy-r.js";import{ct as ot}from"./index-BymNZU1Q.js";import{t as st}from"./ToolbarRootContext-Cytu6o2e.js";import{n as ct,r as lt,t as ut}from"./CompositeItem-DU6IyNMY.js";var Q=e(t(),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(Fe,{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 Me(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function mt(e){return B&&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===_e:e===G,e===de)}function yt(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:ht(t,n?e===G:e===_e,e===I)}function bt(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:_=!0,disabledIndices:v=void 0,orientation:b=`vertical`,triggerOrientation:S=b,parentOrientation:C,id:w,resetOnPointerLeave:E=!0,externalTree:D,nestedReturnFocusRef:O,grid:k}=t,A=k!=null,j=e.useState(`open`),M=e.useState(`floatingElement`),N=e.useState(`domReferenceElement`),P=e.context.dataRef,I=ne(M),ae=re(N),L=J(I),z=g(),oe=ie(D),B=Q.useRef(m),H=Q.useRef(s??-1),U=Q.useRef(null),W=Q.useRef(!0),G=Y(e=>{a(H.current===-1?null:H.current,e)}),ce=Q.useRef(!!M),le=Q.useRef(j),q=Q.useRef(!1),ue=Q.useRef(!1),de=Q.useRef(null),fe=J(v),me=J(j),ge=J(s),_e=J(E),ye=We(),be=We(),xe=Y(()=>{ye.cancel();function e(e){f||(de.current=ve(e,{sync:q.current,preventScroll:!0}))}let t=n.current[H.current],r=ue.current;t&&e(t),(q.current?e=>e():e=>ye.request(e))(()=>{let i=n.current[H.current]||t;i&&(t||e(i),Oe&&(r||!W.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Z(()=>{P.current.orientation=b},[P,b]),Z(()=>{j||(U.current=null),(!j||m!==`auto`)&&(B.current=m)},[j,m]),Z(()=>{o&&(j&&M?(H.current=s??-1,B.current&&s!=null&&(ue.current=!0,G())):ce.current&&(H.current=-1,G()))},[o,j,M,s,G]),Z(()=>{if(o){if(!j)q.current=!1;else if(M){if(r==null){if(q.current=!1,ge.current!=null)return;if(ce.current&&(H.current=-1,xe()),(!le.current||!ce.current)&&B.current&&(U.current!=null||B.current===!0&&U.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>be.request(e):queueMicrotask)(t),e+=1):(H.current=U.current==null||_t(U.current,S,d)||u?se(n):i(n),U.current=null,G())};t()}}else ee(n.current,r)||(H.current=r,xe(),ue.current=!1)}}},[o,j,M,r,ge,u,n,S,d,G,xe,be]),Z(()=>{if(!o||M||!oe||f||!ce.current)return;let e=oe.nodesRef.current,t=e.find(e=>e.id===z)?.context?.elements.floating,n=pe(V(N??t??null)),r=e.some(e=>e.context&&R(e.context.elements.floating,n));t&&!r&&W.current&&t.focus({preventScroll:!0})},[o,M,N,oe,z,f]),Z(()=>{le.current=j,ce.current=!!M});let Se=r!=null,Ce=Y(e=>{if(!me.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(H.current!==t||r!==t)&&(H.current=t,G(e))}),we=Y(()=>C??oe?.nodesRef.current.find(e=>e.id===z)?.context?.dataRef?.current.orientation),Te=Y(()=>se(n,fe.current)),De=Y(t=>{if(W.current=!1,q.current=!0,t.which===229||!me.current&&t.currentTarget===L.current)return;if(u&&yt(t.key,b,d,A)){gt(t.key,we())||Ee(t),e.setOpen(!1,te(F,t.nativeEvent));let n=O?.current??N;Ve(n)&&n.focus();return}r!=null&&r!==H.current&&!ee(n.current,r)&&(H.current=r);let a=H.current,o=se(n,v),s=i(n,v);if(ae||(t.key===`Home`&&(Ee(t),H.current=o,G(t)),t.key===`End`&&(Ee(t),H.current=s,G(t))),k!=null){let e=k(t,H.current,n,b,l,d,v,o,s);if(e!=null&&e!==H.current&&(H.current=e,G(t)),b===`both`)return}if(gt(t.key,b)){Ee(t);let e=pe(t.currentTarget.ownerDocument);if(j&&!f&&R(t.currentTarget,e)&&!n.current.some(t=>t!=null&&R(t,e))){H.current=_t(t.key,b,d)?o:s,G(t),r===H.current&&xe();return}let{index:i,wrapped:u}=x(n.current,a,{decrement:!_t(t.key,b,d),loopFocus:l,allowEscape:c,disabledIndices:v,minIndex:o,maxIndex:s});u&&(q.current=!1),H.current=i,G(t)}}),Oe=Q.useMemo(()=>({onFocus(e){q.current=!0,Ce(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){mt(e)||(q.current=!0,ue.current=!1,h&&Ce(e))},onPointerLeave(e){if(!me.current||!W.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(h&&!n.current.includes(t)&&_e.current&&(de.current?.(),de.current=null,H.current=-1,G(e),!f)){let e=L.current,t=pe(V(e));e&&R(e,t)&&e.focus({preventScroll:!0})}}}),[Ce,me,L,h,n,G,_e,f]),ke=Q.useMemo(()=>f&&j&&Se&&{"aria-activedescendant":`${w}-${r}`},[f,j,Se,w,r]),Ae=Q.useMemo(()=>({...ae?{}:ke,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&j&&!f){let n=K(t.nativeEvent);if(n&&!R(L.current,n))return;Ee(t);let r=te(he,t.nativeEvent);e.setOpen(!1,r);let i=O?.current??N;!r.isCanceled&&Ve(i)&&i.focus()}else De(t)},onPointerMove(e){mt(e)||(W.current=!0)}}),[ke,De,L,ae,e,j,f,N,O]),X=Q.useMemo(()=>{function t(t){e.setOpen(!0,te(F,t.nativeEvent,t.currentTarget))}function n(e){m===`auto`&&y(e.nativeEvent)&&(B.current=!f)}function r(e){B.current=m,m===`auto`&&T(e.nativeEvent)&&(B.current=!0)}return{onKeyDown(n){let r=e.select(`open`);W.current=!1;let i=n.key.startsWith(`Arrow`),a=vt(n.key,we(),d),o=gt(n.key,r?b:S),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||p(n.currentTarget)))return De(n);if(r||_||!i){if(s){let e=gt(n.key,we());U.current=u&&e?null:n.key}u?a&&(Ee(n),r?(H.current=Te(),G(n),f&&L.current?.focus()):t(n)):o&&(ge.current!=null&&(H.current=ge.current),Ee(n),!r&&_?t(n):De(n),r&&G(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(H.current=-1,G(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[De,m,Te,u,G,e,_,b,S,we,d,ge,f,L]),je=Q.useMemo(()=>({...ke,...X}),[ke,X]);return Q.useMemo(()=>o?{reference:je,floating:Ae,item:Oe,trigger:X}:{},[o,je,Ae,X,Oe])}function xt(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,f=Y(s),p=e.useState(`open`),m=Ge(),h=Q.useRef(``),g=Q.useRef(u??i??-1),_=Q.useRef(null),v=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!S(n)||n?.matches(`:disabled`)?!1:o==null||!d(Ae,e,o)}function c(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)&&s(n))return n}return-1}let v=n.current;if(h.current.length>0&&e.key===` `&&(Ee(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(v,h.current)===-1&&e.key!==` `&&f?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(Ee(e),f?.(!0));let y=h.current===``;y&&(g.current=u??i??-1),v.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,f?.(!1)});let b=((y?u??i??-1:g.current)??0)+1,x=c(v,h.current,b);x===-1?e.key!==` `&&(h.current=``,f?.(!1)):(a?.(x,e),_.current=x)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);R(r,n)||R(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});Z(()=>{(p||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,u,m,f]);let b=Q.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return Q.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var $=n(),St=Q.createContext(void 0);function Ct(e){let t=Q.useContext(St);if(t===void 0&&!e)throw Error(X(33));return t}var wt=Q.createContext(void 0);function Tt(e){let t=Q.useContext(wt);if(t===void 0&&!e)throw Error(X(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(X(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=Pe(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:W})},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&&!q&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Le(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}=Be({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=>Oe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Pe(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=Me(`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=U(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 Me(`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=U(i),p=l.useState(`isActive`,d.index),m=l.useState(`floatingNodeId`),h=l.useState(`itemProps`),g=l.context.typingRef,{getButtonProps:_,buttonRef:v}=Be({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 Oe(y,e,_)}return Me(`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=je(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=je(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,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Tt(),m=Gt(),{side:h,align:g}=Ct(),_=st(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),ee=l.useState(`lastOpenChangeReason`),T=l.useState(`rootId`),E=l.useState(`floatingRootContext`),D=l.useState(`floatingTreeRoot`),O=l.useState(`closeDelay`),ne=l.useState(`hoverEnabled`),re=l.useState(`disabled`),A=l.useState(`openMethod`),j=l.useState(`activeTriggerId`),ie=l.useState(`listElement`),[N,P]=qt(e,u,d),F=Jt(e,C,j),I=w.type===`menu`?m:void 0,ae=w.type===`context-menu`,L=s??w.type!==`menu`;s===void 0&&ie&&w.type!==`menu`&&(L=()=>l.state.activeIndex===null&&ie),Ue({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){l.setOpen(!1,te(e.reason,e.domEvent))}return D.events.on(`close`,e),()=>{D.events.off(`close`,e)}},[D.events,l]),Qe(E,{enabled:ne&&!re&&!ae&&w.type!==`menubar`,closeDelay:O});let R=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:z,handleFocus:oe}=(Q.useContext(Ot)?.useParentHandoff??Zt)(l,w,v,f),B={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},V=Me(`div`,e,{state:B,ref:[t,l.context.popupRef,R,P],stateAttributesMapping:M,props:[b,{id:N,...ie?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":F},onKeyDown(e){I?.onPopupKeyDown?.(e),_&&Se.has(e.key)&&e.stopPropagation()},onFocus:oe},Ze(y),c,{"data-rootownerid":T}]}),H=w.type===void 0||ae;(C||w.type===`menubar`&&ee!==`outside-press`)&&(H=!0);let U=I?.getReturnElement??z;return(0,$.jsx)(k,{context:E,openInteractionType:A,modal:ae,disabled:!x,returnFocus:a??U??H,explicitReturnFocus:a===void 0&&U?!1:void 0,initialFocus:L,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:D,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.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(X(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)(N,{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:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=ye,style:_,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=Tt(),S=en(),C=Dt(!0),w=y.useState(`parent`),ee=y.useState(`floatingRootContext`),T=y.useState(`floatingTreeRoot`),E=y.useState(`mounted`),D=y.useState(`open`),O=y.useState(`modal`),ne=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),re=y.useState(`transitionStatus`),A=y.useState(`positionerElement`),j=y.useState(`instantType`),ie=y.useState(`adaptiveOrigin`),M=y.useState(`lastOpenChangeReason`),N=y.useState(`floatingNodeId`),P=y.useState(`floatingParentNodeId`),F=ee.useState(`domReferenceElement`),I=n,ae=c,L=l,R=s,z=g;w.type===`context-menu`&&(I=n??w.context?.anchor,R??=`start`,!o&&R!==`center`&&(L=e.alignOffset??2,ae=e.sideOffset??-5));let B=o,V=R;w.type===`menu`?(B??=`inline-end`,V??=`start`,z=e.collisionAvoidance??fe):w.type===`menubar`&&(B??=w.context.orientation===`vertical`?`inline-end`:`bottom`,V??=`start`);let H=w.type===`context-menu`,U=$e({anchor:I,floatingRootContext:ee,positionMethod:C?`fixed`:r,mounted:E,side:B,sideOffset:ae,align:V,alignOffset:L,arrowPadding:H?0:p,collisionBoundary:u,collisionPadding:d,sticky:m,nodeId:N,keepMounted:S,disableAnchorTracking:h,collisionAvoidance:z,shift:H?{crossAxis:!(`side`in z&&z.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:ie,lazyFlip:b?`placement`:!1});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&y.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,te(Te)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[y,T.events,N]),Q.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,te(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,y]);let W=Ge();Q.useEffect(()=>{D||W.clear()},[D,W]),Q.useEffect(()=>{function e(e){if(D&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?W.isStarted()||W.start(e,()=>{y.setOpen(!1,te(Te))}):y.setOpen(!1,te(Te))}else W.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,k,y,W]),Q.useEffect(()=>{let e={open:D,nodeId:N,parentNodeId:P,reason:y.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,y,N,P]),nt({store:y,domReference:F,positionerElement:A,open:D});let G={open:D,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:w.type===`menu`,instant:j},se=w.type===`menubar`&&w.context.modal;at(D&&(se||O&&M!==`trigger-hover`),ne===`touch`,A,k);let ce=et(e,G,{styles:U.positionerStyles,transitionStatus:re,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),K=E&&w.type!==`menu`&&(w.type!==`menubar`&&O&&M!==`trigger-hover`||w.type===`menubar`&&w.context.modal),le=null;return w.type===`menubar`?le=w.context.contentElement:w.type===void 0&&(le=k),(0,$.jsxs)(St.Provider,{value:U,children:[K&&(0,$.jsx)(oe,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:me(!D),cutout:le}),(0,$.jsx)(f,{id:N,children:(0,$.jsx)(ct,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:ce})})]})}),rn=Q.createContext(null);function an(e){let t=Q.useContext(rn);if(t===null&&!e)throw Error(X(5));return t}function on(e){return e==null?Ce:e.type.startsWith(`key`)?H:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?L:Ce}var sn={...we,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=we.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>B&&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`&&!we.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 E{constructor(e,t,n=!1){let r=new C,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{...o(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:Ne,inputProps:Ne,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new A,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ne,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=c(function(e){let{children:t,open:n,onOpenChange:i,onOpenChangeComplete:a,onItemHighlighted:o,defaultOpen:s=!1,disabled:c=!1,modal:d,loopFocus:f=!0,orientation:p=`vertical`,actionsRef:y,closeParentOnEsc:x=!1,handle:S,triggerId:C,defaultTriggerId:ee=null,highlightItemOnHover:T=!0,isSubmenu:E=!1,virtualFocus:O=!1,virtualFocusRef:ne,allowEscape:k=!0,resetOnPointerLeave:re=!0}=e,A=Dt(!0),j=Tt(!0),ie=an(!0),M=j?.store,N=j?.virtualFocus??!1,P=Q.useMemo(()=>E&&M?{type:`menu`,store:M}:ie?{type:`menubar`,context:ie}:A&&!M?{type:`context-menu`,context:A}:{type:void 0},[A,M,ie,E]),F=U(),I=U(),[ae,L]=Q.useState(void 0),R=(ae??I)||void 0,z=g(),oe=P.type===`menu`?P.store:void 0,B=(n??s)&&oe?.state.transitionStatus===`starting`,V=ke(()=>B?oe?.state.instantType:void 0).current,W=ke(()=>{let e=new cn({open:s,openProp:n,activeTriggerId:ee,triggerIdProp:C,parent:P,disabled:c,highlightItemOnHover:T,modal:P.type===void 0?d:void 0,rootId:F,instantType:V},R,z!=null);return e.context.virtualFocusRef=ne,e}).current;W.useControlledProp(`openProp`,n),W.useControlledProp(`triggerIdProp`,C),W.useContextCallback(`onOpenChangeComplete`,a);let G=W.useState(`floatingTreeRoot`),se=ge(G),K=W.useState(`open`),le=W.useState(`activeTriggerElement`),q=W.useState(`positionerElement`),de=W.useState(`hoverEnabled`),fe=W.useState(`disabled`),pe=W.useState(`lastOpenChangeReason`),J=W.useState(`parent`),me=W.useState(`activeIndex`),he=W.useState(`keyboardOpen`),_e=W.useState(`payload`),ve=W.useState(`floatingParentNodeId`),ye=Q.useRef(null),xe=Q.useRef(J.type!==`context-menu`),Se=Ge(),we=Q.useRef(!0),Te=Ge(),Ee=ve!=null,{openMethod:De,triggerProps:X}=tt(K);W.useSyncedValues({disabled:c,highlightItemOnHover:T,modal:J.type===void 0?d:void 0,openMethod:De,rootId:F}),u(W);let{forceUnmount:je,transitionStatus:Me}=h(K,W,()=>{W.set(`allowMouseEnter`,!1)},B),Pe=Ke(W.context.popupRef);Q.useEffect(()=>{if(V===void 0)return;let e=()=>{W.state.instantType===V&&W.set(`instantType`,void 0)};if(!K){e();return}if(Me!==void 0)return;if(W.context.popupRef.current==null){e();return}let t=new AbortController;return Pe(e,t.signal),()=>{t.abort()}},[V,K,Me,Pe,W]),Z(()=>{A&&!j?W.update({parent:{type:`context-menu`,context:A},floatingNodeId:se,floatingParentNodeId:z}):(j||!W.select(`activeTriggerElement`))&&W.update({floatingNodeId:se,floatingParentNodeId:z})},[A,j,se,z,le,W]),Q.useEffect(()=>{K||(ye.current=null),J.type===`context-menu`&&(K?Se.start(500,()=>{xe.current=!0}):(Se.clear(),xe.current=!1))},[Se,K,J.type]),Z(()=>{!K&&!de&&W.set(`hoverEnabled`,!0)},[K,de,W]);let Fe=Y((e,t)=>{let n=t.reason;if(!e&&!W.select(`open`)||K===e&&t.trigger===le&&pe===n)return;let r=b(t);if(!e&&t.trigger==null&&(t.trigger=le??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`&&!we.current)return;e&&n===`trigger-focus`?(we.current=!1,Te.start(300,()=>{we.current=!0})):(we.current=!0,Te.clear());let o=!e&&(n===`escape-key`||n==null);ye.current=t.event;let s=w(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)}),Ie=m({popupStore:W,floatingRootContext:W.state.floatingRootContext,floatingId:R,nested:z!=null,onOpenChange:Fe}),Le=Ie.context.events;Z(()=>{let e=({open:e,eventDetails:t})=>Fe(e,t);return Le.on(`setOpen`,e),()=>{Le?.off(`setOpen`,e)}},[Le,Fe]),Z(()=>W.subscribeToParentMenu(),[W]);let Re=Q.useCallback(()=>{W.setOpen(!1,te(ue))},[W]);Q.useImperativeHandle(y,()=>({unmount:je,close:Re}),[je,Re]);let ze;J.type===`context-menu`&&(ze=J.context),Q.useImperativeHandle(ze?.positionerRef,()=>q,[q]),Q.useImperativeHandle(ze?.actionsRef,()=>({setOpen:Fe}),[Fe]);let Be=D(Ie,{enabled:!fe,bubbles:{escapeKey:x&&J.type===`menu`},outsidePress(){return J.type!==`context-menu`||ye.current?.type===`contextmenu`||xe.current},externalTree:Ee?G:void 0}),Ve=be(),He=bt(Ie,{enabled:!fe,listRef:W.context.itemDomElements,activeIndex:me,virtual:O,nested:J.type===`menubar`||!O&&J.type!==void 0,parentOrientation:J.type===`menubar`?J.context.orientation:void 0,loopFocus:f,focusItemOnOpen:O?he:void 0,allowEscape:O&&f&&k,orientation:p,triggerOrientation:O?`vertical`:p,rtl:Ve===`rtl`,disabledIndices:Ae,onNavigate(e,t){W.setActiveIndex(e,on(t),t?.nativeEvent)},openOnArrowKeyDown:J.type!==`context-menu`&&!(O&&E),externalTree:!O&&Ee?G:void 0,nestedReturnFocusRef:oe?.context.virtualFocusRef,focusItemOnHover:T,resetOnPointerLeave:re}),Ue=Q.useCallback(e=>{W.context.typingRef.current=e},[W]),We=xt(Ie,{enabled:!fe&&!O,listRef:W.context.itemLabels,elementsRef:W.context.itemDomElements,activeIndex:me,resetMs:500,onMatch:(e,t)=>{K&&e!==me&&W.setActiveIndex(e,H,t.nativeEvent)},onTyping:Ue}),qe=Y(o),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,O&&W.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=W.context;W.context.highlightReason=Ce,W.context.highlightEvent=void 0,o&&qe(t,l(r,i,{label:t===void 0?void 0:W.context.itemLabels.current[n]??void 0}))});Z(()=>{Ye()},[me,Ye]);let Xe=Q.useMemo(()=>{if(!O)return He.reference;if(!He.trigger)return Ne;let{onFocus:e,...t}=He.trigger;return t},[O,He.reference,He.trigger]);W.useSyncedValue(`inputProps`,O?He.reference??Ne:Ne);let Ze=Q.useMemo(()=>{let e=Oe(We.reference,Xe,Be.reference,{onMouseMove(){W.set(`allowMouseEnter`,!0)}},X);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=K,e},[W,We.reference,Xe,Be.reference,X,K]),Qe=Q.useMemo(()=>{let e=Oe(He.trigger,Be.trigger,X);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[He.trigger,Be.trigger,X]);ke(()=>(W.update({inactiveTriggerProps:Qe}),null));let $e=Q.useMemo(()=>Oe(ce,{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)}},We.floating,He.floating,Be.floating),[J.type,W,We.floating,He.floating,Be.floating]),et=He.item??Ne;v(W,{floatingRootContext:Ie,activeTriggerProps:Ze,inactiveTriggerProps:Qe,popupProps:$e,itemProps:et});let nt=Q.useMemo(()=>({store:W,parent:P,orientation:p,loopFocus:f,allowEscape:k,defaultFloatingId:I,setRenderedFloatingId:L,virtualFocus:O,parentVirtualFocus:N,syncHighlightedItem:Ye}),[W,P,p,f,k,I,O,N,Ye]),rt=typeof t==`function`?t({payload:_e}):t,it=(0,$.jsxs)(wt.Provider,{value:nt,children:[S&&(0,$.jsx)(r,{handle:S,store:W}),rt]});return(J.type===void 0||J.type===`context-menu`)&&(it=(0,$.jsx)(_,{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=Ie(e);if(xe)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(Ve(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!He(e))return xn(Re(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,V(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Ne,[t,n,r])}var Cn=s(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:d=0,handle:f,payload:p,...m}=e,h=Tt(!0),_=Xe(f)??h?.store;if(!_)throw Error(X(85));let v=U(c),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),C=Q.useRef(null),w=Tn(),ee=ze(!0),T=ie(),E=Q.useMemo(()=>T??new A,[T]),te=ge(E),D=g(),{registerTrigger:O,isMountedByThisTrigger:ne}=a(v,C,_,{payload:p,closeDelay:d,parent:w,floatingTreeRoot:E,floatingNodeId:te,floatingParentNodeId:D,keyboardEventRelay:ee?.relayKeyboardEvent}),k=w.type===`menubar`,re=_.useState(`disabled`),M=o||re||k&&w.context.disabled,{getButtonProps:N,buttonRef:P}=Be({disabled:M,native:s});Q.useEffect(()=>{!x&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,w.type]);let F=Q.useRef(null),I=Ge(),L=Y(e=>{if(!F.current)return;I.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;R(F.current,t)||R(_.select(`positionerElement`),t)||t===F.current||(t==null||xn(t)!==_.select(`rootId`))&&(yn(e,F.current)||E.events.emit(`close`,{domEvent:e,reason:le}))});Q.useEffect(()=>{let e=V(F.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[x,L,_]);let z=k&&w.context.hasSubmenuOpen,oe=qe(b,{enabled:(l??z)&&!M&&(!k||z&&!ne),handleClose:Ye({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:d},triggerElementRef:C,externalTree:E,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),B=wn(x,_.select(`lastOpenChangeReason`)),H=rt(b,{enabled:!M,event:x&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),W=Je(b,{enabled:!M&&z}),G=Sn({open:x,enabled:k,mouseDownAction:`open`}),se=Q.useMemo(()=>Oe(W.reference,H.reference),[W.reference,H.reference]),ce=_.useState(`triggerProps`,ne),K=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:q,handleFocusTargetFocus:ue}=it(_,C),de={disabled:M,open:x},fe=[F,t,P,O,C],pe=[se,oe??Ne,ce,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(I.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),V(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},K,k?{role:`menuitem`}:{},G,m,N],J=Me(`button`,e,{enabled:!k,stateAttributesMapping:j,state:de,ref:fe,props:pe});return k?(0,$.jsx)(ut,{tag:`button`,render:n,className:r,style:i,state:de,refs:fe,props:pe,stateAttributesMapping:j}):x?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(ae,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:q},`${v}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:J},v),(0,$.jsx)(ae,{ref:_.context.triggerFocusTargetRef,onFocus:ue},`${v}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:J},v)});function wn(e,t){let n=Ge(),[r,i]=Q.useState(!1);return Z(()=>{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:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=Tt(!0);if(p?.parent.type!==`menu`)throw Error(X(37));let m=Ct(),h=Gt(),{store:g,parentVirtualFocus:_}=p,v=p.parent.store,y=lt({guess:!0,label:a}),b=U(o),x=g.useState(`open`),S=Q.useRef(!1),C=g.useState(`positionerElement`),w=g.useState(`floatingRootContext`),ee=g.useState(`floatingTreeRoot`),T=g.useState(`triggerPopupId`,b),E=O(b,g),D=Y(e=>{E(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:u})}),ne=Q.useRef(null),k=Q.useCallback(e=>{ne.current=e,g.set(`activeTriggerElement`,e)},[g]);Z(()=>(D(ne.current),()=>D(null)),[D,b,g]),Z(()=>{if(!x||!C)return;function e(e){K(e)===g.context.beforeContentFocusGuardRef.current&&(S.current=e.relatedTarget===ne.current)}return C.addEventListener(`focusout`,e,!0),()=>{S.current=!1,C.removeEventListener(`focusout`,e,!0)}},[x,C,g]),g.useSyncedValue(`closeDelay`,u);let re=g.useState(`disabled`),A=v.useState(`disabled`),j=d||re||A,ie=v.useState(`itemProps`),M=v.useState(`isActive`,y.index),N=Q.useMemo(()=>({type:`submenu-trigger`,setActive(e){v.select(`highlightItemOnHover`)&&v.setActiveIndex(y.index,L,e)}}),[v,y.index]),{getItemProps:F,itemRef:I}=It({closeOnClick:!1,disabled:j,highlighted:M,id:b,store:g,typingRef:v.context.typingRef,nativeButton:s,itemMetadata:N,nodeId:m?.context.nodeId}),ae=g.useState(`hoverEnabled`),R=qe(w,{enabled:ae&&c&&!j,handleClose:Ye({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>v.select(`allowMouseEnter`):void 0,triggerElementRef:ne,externalTree:ee,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),oe=rt(w,{enabled:!j,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??Ne,B=g.useState(`triggerProps`,!0);delete B.id;let V={disabled:j,highlighted:M,open:x},H=g.useState(`openMethod`),W=g.useState(`lastOpenChangeReason`)===`list-navigation`||H===`keyboard`,G=x&&W&&z,se=h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0;return Me(`div`,e,{state:V,stateAttributesMapping:P,props:[oe,R,B,se,ie,G?En:void 0,{"aria-controls":T,tabIndex:_||!(x||M)?-1:0,onFocus(e){g.select(`open`)&&S.current&&(S.current=!1,g.setOpen(!1,te(he,e.nativeEvent)))},onBlur(){M&&v.setActiveIndex(null,Ce)}},f,F],ref:[t,y.ref,I,D,k]})}),On=Q.forwardRef(function(e,t){let n=Mt(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Oe(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:De(`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:De(`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:De(`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:De(`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:De(`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:De(`-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{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{H as r,O as i,W as a,bn as o,y as s}from"./page-DWnGi6wA.js";import{o as c,t as l}from"./error-alert-9tKpTE3v.js";import{_n as u}from"./mark-CC3RwMy_.js";import{D as d,W as f,t as p}from"./button-DVWXde__.js";import"./overview-C_tFKGZ8.js";import{k as m}from"./index-BymNZU1Q.js";var h=e(t(),1),g=new Map([[`bold`,h.createElement(h.Fragment,null,h.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`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),h.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`,h.createElement(h.Fragment,null,h.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`,h.createElement(h.Fragment,null,h.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`,h.createElement(h.Fragment,null,h.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`,h.createElement(h.Fragment,null,h.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`}))]]),_=h.forwardRef((e,t)=>h.createElement(f,{ref:t,...e,weights:g}));_.displayName=`CaretDownIcon`;var v=n();function y({className:e,...t}){return(0,v.jsx)(`textarea`,{"data-slot":`textarea`,className:d(`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 b({className:e,...t}){return(0,v.jsx)(`label`,{"data-slot":`label`,className:d(`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 x({className:e,size:t=`default`,...n}){return(0,v.jsxs)(`div`,{className:d(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,v.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,v.jsx)(_,{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 S({className:e,...t}){return(0,v.jsx)(`option`,{"data-slot":`native-select-option`,className:d(`bg-[Canvas] text-[CanvasText]`,e),...t})}var C={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`}},w=(e,t)=>t===`retry`?e.canRetry:e.canRunAgain,T=(e,t)=>{let n=o();return c({mutationFn:t=>s(n=>n.editAndRetry({params:{runId:e.id},payload:t})),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:[`run`,e.id]}),n.invalidateQueries({queryKey:[`overview`]})]),t()}})},E=({run:e,intent:t,close:n,openRun:o,className:c})=>{let[f,g]=(0,h.useState)(e.task),[_,w]=(0,h.useState)(e.agent),E=(0,h.useId)(),D=C[t],O=u({queryKey:[`agents`],queryFn:()=>s(e=>e.agents())}),k=T(e,n),A=m(),j=t===`retry`?k:A,M=f.trim().length>0&&O.data?.some(e=>e===_)===!0,N=()=>{let n=new i({task:r.make(f),agent:a.make(_)});t===`retry`?k.mutate(n):A.mutate({runId:e.id,amendment:n},{onSuccess:e=>{e._tag===`Claimed`&&o(e.runId)}})};return(0,v.jsxs)(`form`,{"aria-label":D.title,className:d(`space-y-3`,c),onSubmit:e=>{e.preventDefault(),!j.isPending&&M&&N()},children:[(0,v.jsx)(`h3`,{className:`text-md font-semibold`,children:D.title}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D.note}),(0,v.jsx)(b,{htmlFor:`${E}-task`,children:`Task`}),(0,v.jsx)(y,{id:`${E}-task`,value:f,onChange:e=>g(e.target.value),rows:7,disabled:j.isPending}),(0,v.jsx)(b,{htmlFor:`${E}-agent`,children:`Agent`}),(0,v.jsxs)(x,{id:`${E}-agent`,value:_,onChange:e=>w(e.target.value),disabled:j.isPending||O.isPending,children:[!O.data?.includes(e.agent)&&(0,v.jsxs)(S,{value:e.agent,disabled:!0,children:[e.agent,` · unavailable`]}),O.data?.map(e=>(0,v.jsx)(S,{value:e,children:e},e))]}),(0,v.jsxs)(`div`,{className:`flex gap-2`,children:[(0,v.jsx)(p,{type:`submit`,size:`sm`,disabled:j.isPending||!M,children:D.submit}),(0,v.jsx)(p,{type:`button`,size:`sm`,variant:`ghost`,disabled:j.isPending,onClick:n,children:`Close editor`})]}),A.data?._tag===`CycleBlocked`&&(0,v.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),O.isError&&(0,v.jsx)(l,{message:O.error.message}),j.isError&&(0,v.jsx)(l,{message:j.error.message})]})};export{_ as a,y as i,w as n,b as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{_n as r,an as i,bn as a,en as o,fn as s,gn as c,rn as l,sn as u,tn as d}from"./page-DWnGi6wA.js";import{D as f,E as p,U as m}from"./button-DVWXde__.js";var h=class extends o{#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||g(),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=d({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),l.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function g(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var _=class extends i{#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),c(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u(t.mutationKey)!==u(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??g();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){l.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)})})}},v=e(t(),1);function y(e,t){let n=a(t),[i]=v.useState(()=>new _(n,e));v.useEffect(()=>{i.setOptions(e)},[i,e]);let o=v.useSyncExternalStore(v.useCallback(e=>i.subscribe(l.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=v.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(s)},[i]);if(o.error&&r(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}var b=n(),x=p(`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 S({className:e,variant:t,...n}){return(0,b.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:f(x({variant:t}),e),...n})}function C({className:e,...t}){return(0,b.jsx)(`div`,{"data-slot":`alert-title`,className:f(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function w({className:e,...t}){return(0,b.jsx)(`div`,{"data-slot":`alert-description`,className:f(`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 T({className:e,...t}){return(0,b.jsx)(`div`,{"data-slot":`alert-action`,className:f(`absolute top-1.5 right-2`,e),...t})}var E=({title:e,message:t,className:n})=>(0,b.jsxs)(S,{variant:`destructive`,className:f(`wrap-anywhere`,n),children:[(0,b.jsx)(m,{weight:`fill`}),e!==void 0&&(0,b.jsx)(C,{children:e}),(0,b.jsx)(w,{children:t})]});export{C as a,w as i,S as n,y as o,T as r,h as s,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./matchContext-BquevSJS.js";import{Vt as t}from"./page-DWnGi6wA.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{E as e}from"./matchContext-BquevSJS.js";import{D as t}from"./button-DVWXde__.js";import{r as n}from"./table-BjyI4fVI.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{E as e}from"./matchContext-BquevSJS.js";import{Gt as t}from"./page-DWnGi6wA.js";import{t as n}from"./mark-CC3RwMy_.js";import{D as r}from"./button-DVWXde__.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:r(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:[t(e,{onNone:()=>null,onSome:e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n,{item:e,size:o===`page`?`title`:`inline`,linked:s}),` `]})}),a]});export{a as t};
|