spec-cat 0.1.17 → 0.1.19
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DXUrKiH5.js → BKqdCRS3.js} +1 -1
- package/.output/public/_nuxt/{r3GpywQg.js → BPUj2ZlG.js} +1 -1
- package/.output/public/_nuxt/{Cpte3S5v.js → BSpavnZb.js} +1 -1
- package/.output/public/_nuxt/{CiZPHQLr.js → BXrSICHP.js} +1 -1
- package/.output/public/_nuxt/{CmL7VX9U.js → Bd9QEY7i.js} +1 -1
- package/.output/public/_nuxt/CjNO96lG.js +150 -0
- package/.output/public/_nuxt/DCKNA2uA.js +1 -0
- package/.output/public/_nuxt/{DTk7fwKA.js → DOeQwJs-.js} +1 -1
- package/.output/public/_nuxt/Dr-08407.js +4 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/05f9bdd9-cbd5-4598-8bd6-021886dcba7c.json +1 -0
- package/.output/public/_nuxt/iB03pWcQ.js +1 -0
- package/.output/server/chunks/_/aiProviderRegistry.mjs +2 -1
- package/.output/server/chunks/_/aiProviderRegistry.mjs.map +1 -1
- package/.output/server/chunks/_/aiProviderSelection.mjs +1 -1
- package/.output/server/chunks/_/claude.mjs +1 -1
- package/.output/server/chunks/_/claudeProvider.mjs +44 -34
- package/.output/server/chunks/_/claudeProvider.mjs.map +1 -1
- package/.output/server/chunks/_/claudeService.mjs +1 -1
- package/.output/server/chunks/_/codexProvider.mjs +179 -5
- package/.output/server/chunks/_/codexProvider.mjs.map +1 -1
- package/.output/server/chunks/_/conversationStore.mjs +190 -0
- package/.output/server/chunks/_/conversationStore.mjs.map +1 -0
- package/.output/server/chunks/_/geminiProvider.mjs +298 -0
- package/.output/server/chunks/_/geminiProvider.mjs.map +1 -0
- package/.output/server/chunks/_/git.mjs +40 -5
- package/.output/server/chunks/_/git.mjs.map +1 -1
- package/.output/server/chunks/_/providerProcessError.mjs.map +1 -1
- package/.output/server/chunks/_/uiAdapter.mjs +407 -0
- package/.output/server/chunks/_/uiAdapter.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +701 -701
- package/.output/server/chunks/routes/_ws.mjs +59 -302
- package/.output/server/chunks/routes/_ws.mjs.map +1 -1
- package/.output/server/chunks/routes/api/chat/worktree.post.mjs +40 -9
- package/.output/server/chunks/routes/api/chat/worktree.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs +5 -6
- package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/archives/_archiveId/restore.post.mjs +5 -6
- package/.output/server/chunks/routes/api/conversations/archives/_archiveId/restore.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/archives/_archiveId_.delete.mjs +5 -5
- package/.output/server/chunks/routes/api/conversations/archives/_archiveId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/archives.get.mjs +3 -3
- package/.output/server/chunks/routes/api/conversations/archives.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/update.post.mjs +7 -21
- package/.output/server/chunks/routes/api/conversations/update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations.get.mjs +3 -3
- package/.output/server/chunks/routes/api/conversations.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations.post.mjs +4 -3
- package/.output/server/chunks/routes/api/conversations.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/git/branches.get.mjs +84 -32
- package/.output/server/chunks/routes/api/git/branches.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/git/checkout.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/cherry-pick.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/clean.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/commit/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/git/diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/fetch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/file-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/graph.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/log.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/merge-base.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/merge.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/pull.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/push.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/rebase.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/remote.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/git/remote.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/remote.put.mjs +1 -1
- package/.output/server/chunks/routes/api/git/remotes.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/reset.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/revert.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/show.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash-apply.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash-branch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash-drop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash-pop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/stash.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/state.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/git/tag/_name_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/git/tag-push.post.mjs +1 -1
- package/.output/server/chunks/routes/api/git/tag.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/git/tag.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings.post.mjs +1 -1
- package/.output/server/chunks/routes/api/skills/_skillId/prompt.post.mjs +1 -1
- package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/specs/search.get.mjs +1 -1
- package/.output/server/chunks/routes/api/specs/status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/specs/traceability/_featureId_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/worktrees/_name/switch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/worktrees/_name_.delete.mjs +1 -1
- package/.output/server/chunks/routes/git-watcher-ws.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +4 -2
- package/.output/public/_nuxt/C3AK77_3.js +0 -1
- package/.output/public/_nuxt/D2BKG08b.js +0 -4
- package/.output/public/_nuxt/Dm7OZTkE.js +0 -1
- package/.output/public/_nuxt/DmlsgRMZ.js +0 -150
- package/.output/public/_nuxt/builds/meta/75b286be-1ad8-452b-8f27-37b1e34fc4fa.json +0 -1
- package/.output/server/chunks/_/chat.mjs +0 -15
- package/.output/server/chunks/_/chat.mjs.map +0 -1
package/.output/nitro.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DxNHbxmM.js","./CnnebwVN.js","./wDzz0qaB.js","./DPfMkruS.js","./Cl0AqbOI.js","./2EtD6e53.js","./Cn7AkR1O.js","./BGJmEYvX.js","./CylS5w8V.js","./Cp-IABpG.js","./DxSwrfjg.js","./BPQ3VLAy.js","./CXtECtnM.js","./COt5Ahok.js","./5X7smno1.js","./DGP4VlC8.js","./BLtJtn59.js","./CquLrc37.js","./DVxCFoDh.js","./CO1LY3CK.js","./B6aJPvgy.js","./BYV0-3_D.js","./CxbxFI8M.js","./Bp3cYrEr.js","./CDVJQ6XC.js","./DZxFcAj9.js","./BIGW1oBm.js","./fKv21gyL.js","./Yzrsuije.js","./DZu-aV2c.js","./CpOuai2O.js","./CeZK1NFH.js","./CGscLIrv.js","./Bhrxn6JZ.js","./CmIQRyeF.js","./C9oPPf7i.js","./g9-lgVsj.js","./CnsnAmq5.js","./Buea-lGh.js","./CuPHTKiy.js","./Cvjx9yec.js","./B7c-h3xW.js","./BxgE0vQu.js","./BTifaqeh.js","./CenWIFCC.js","./DkwncUOv.js","./C5YyOfLZ.js","./CxGSJlkm.js","./D97Zzqfu.js","./CSXwinHm.js","./YqXBG_HV.js","./BR5kRUq4.js","./CLZrNe3w.js","./m17aaUwq.js","./CufHLc7y.js","./CYsAdtH9.js","./fuZLfV_i.js","./DWrx1Km3.js","./CzTSHFRz.js","./CXZktZb0.js","./Br6cN0cg.js","./W9tJ9s81.js","./Dspwwk_N.js","./DMwsHuHA.js","./CQ8jqdy-.js","./mjskCLCv.js","./83L43bj1.js","./B1dDrJ26.js","./TsXTqZ29.js","./Dph4kLrZ.js","./DhmSosst.js","./BzTr9Aqm.js","./DJjDtW9f.js","./BLmx8bSh.js","./BVQ-GDCI.js","./DsumFeuD.js","./COcwbKMJ.js","./DQwYQDb2.js","./D1j8_8rp.js","./CG8Ifv2g.js","./BqTXFGrv.js","./D3lLCCz7.js","./Cq5zzVJU.js","./Dzze3sRP.js","./BRZ36xJF.js","./BsS91CYL.js","./DM8c43g1.js","./BH7IYjvW.js","./DYoxhk2S.js","./CZhp0h8q.js","./CxLEBnE3.js","./Cm3UrAx6.js","./RNghxpo_.js","./DEthMvLe.js","./DqQDbK_p.js","./CW8IKDeL.js","./BEDo0Tqx.js","./yv6CvBhz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a1 as c}from"./D2BKG08b.js";let R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function fi(t){return Xt(t)}function Xt(t){return Array.isArray(t)?gi(t):t instanceof RegExp?t:typeof t=="object"?_i(t):t}function gi(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Xt(t[r]);return e}function _i(t){let e={};for(let r in t)e[r]=Xt(t[r]);return e}function Zr(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function en(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?en(t.substring(0,t.length-1)):t.substr(~e+1)}var ft=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ge=class{static hasCaptures(t){return t===null?!1:(ft.lastIndex=0,ft.test(t))}static replaceCaptures(t,e,r){return t.replace(ft,(n,i,o,a)=>{let l=r[parseInt(i||o,10)];if(l){let s=e.substring(l.start,l.end);for(;s[0]===".";)s=s.substring(1);switch(a){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return n})}};function tn(t,e){return t<e?-1:t>e?1:0}function rn(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let o=tn(t[i],e[i]);if(o!==0)return o}return 0}return r-n}function pr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function nn(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var on=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Qe=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}static createFromRawTheme(t,e){return this.createFromParsedTheme(bi(t),e)}static createFromParsedTheme(t,e){return vi(t,e)}_cachedMatchRoot=new on(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>yi(t.parent,i.parentScopes));return n?new an(n.fontStyle,n.foreground,n.background):null}},gt=class ze{constructor(e,r){this.parent=e,this.scopeName=r}static push(e,r){for(const n of r)e=new ze(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new ze(r,e[n]);return r}push(e){return new ze(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function yi(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!Ei(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Ei(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var an=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}};function bi(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!a.settings)continue;let l;if(typeof a.scope=="string"){let m=a.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(a.scope)?l=a.scope:l=[""];let s=-1;if(typeof a.settings.fontStyle=="string"){s=0;let m=a.settings.fontStyle.split(" ");for(let d=0,h=m.length;d<h;d++)switch(m[d]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof a.settings.foreground=="string"&&pr(a.settings.foreground)&&(u=a.settings.foreground);let p=null;typeof a.settings.background=="string"&&pr(a.settings.background)&&(p=a.settings.background);for(let m=0,d=l.length;m<d;m++){let f=l[m].trim().split(" "),E=f[f.length-1],b=null;f.length>1&&(b=f.slice(0,f.length-1),b.reverse()),r[n++]=new wi(E,b,i,s,u,p)}}return r}var wi=class{constructor(t,e,r,n,i,o){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=o}},V=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(V||{});function vi(t,e){t.sort((s,u)=>{let p=tn(s.scope,u.scope);return p!==0||(p=rn(s.parentScopes,u.parentScopes),p!==0)?p:s.index-u.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let s=t.shift();s.fontStyle!==-1&&(r=s.fontStyle),s.foreground!==null&&(n=s.foreground),s.background!==null&&(i=s.background)}let o=new Ci(e),a=new an(r,o.getId(n),o.getId(i)),l=new ki(new Tt(0,null,-1,0,0),[]);for(let s=0,u=t.length;s<u;s++){let p=t[s];l.insert(0,p.scope,p.parentScopes,p.fontStyle,o.getId(p.foreground),o.getId(p.background))}return new Qe(o,a,l)}var Ci=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Ai=Object.freeze([]),Tt=class sn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,o){this.scopeDepth=e,this.parentScopes=r||Ai,this.fontStyle=n,this.foreground=i,this.background=o}clone(){return new sn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},ki=class Pt{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const o=r.parentScopes[i].length-e.parentScopes[n].length;if(o!==0)return o;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,o;if(n===-1?(i=e,o=""):(i=e.substring(0,n),o=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Pt._cmpBySpecificity),r}insert(e,r,n,i,o,a){if(r===""){this._doInsertHere(e,n,i,o,a);return}let l=r.indexOf("."),s,u;l===-1?(s=r,u=""):(s=r.substring(0,l),u=r.substring(l+1));let p;this._children.hasOwnProperty(s)?p=this._children[s]:(p=new Pt(this._mainRule.clone(),Tt.cloneArr(this._rulesWithParentScopes)),this._children[s]=p),p.insert(e+1,u,n,i,o,a)}_doInsertHere(e,r,n,i,o){if(r===null){this._mainRule.acceptOverwrite(e,n,i,o);return}for(let a=0,l=this._rulesWithParentScopes.length;a<l;a++){let s=this._rulesWithParentScopes[a];if(rn(s.parentScopes,r)===0){s.acceptOverwrite(e,n,i,o);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Tt(e,r,n,i,o))}},ye=class U{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=U.getLanguageId(e),n=U.getTokenType(e),i=U.getFontStyle(e),o=U.getForeground(e),a=U.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:o,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,o,a,l){let s=U.getLanguageId(e),u=U.getTokenType(e),p=U.containsBalancedBrackets(e)?1:0,m=U.getFontStyle(e),d=U.getForeground(e),h=U.getBackground(e);return r!==0&&(s=r),n!==8&&(u=n),i!==null&&(p=i?1:0),o!==-1&&(m=o),a!==0&&(d=a),l!==0&&(h=l),(s<<0|u<<8|p<<10|m<<11|d<<15|h<<24)>>>0}};function Je(t,e){const r=[],n=Si(t);let i=n.next();for(;i!==null;){let s=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let u=a();if(r.push({matcher:u,priority:s}),i!==",")break;i=n.next()}return r;function o(){if(i==="-"){i=n.next();const s=o();return u=>!!s&&!s(u)}if(i==="("){i=n.next();const s=l();return i===")"&&(i=n.next()),s}if(mr(i)){const s=[];do s.push(i),i=n.next();while(mr(i));return u=>e(s,u)}return null}function a(){const s=[];let u=o();for(;u;)s.push(u),u=o();return p=>s.every(m=>m(p))}function l(){const s=[];let u=a();for(;u&&(s.push(u),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");u=a()}return p=>s.some(m=>m(p))}}function mr(t){return!!t&&!!t.match(/[\w\.:]+/)}function Si(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function ln(t){typeof t.dispose=="function"&&t.dispose()}var Ie=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Li=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ii=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Ri=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ie(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Ii;for(const r of t)Ti(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ie){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Ti(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=r.lookup(e);t instanceof Ie?qe({baseGrammar:o,selfGrammar:i},n):Ot(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},n);const a=r.injections(t.scopeName);if(a)for(const l of a)n.add(new Ie(l))}function Ot(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];Ye([n],e,r)}}function qe(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ye(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ye(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ye(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?Zr({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&Ye(n.patterns,{...e,repository:i},r);const o=n.include;if(!o)continue;const a=un(o);switch(a.kind){case 0:qe({...e,selfGrammar:e.baseGrammar},r);break;case 1:qe(e,r);break;case 2:Ot(a.ruleName,{...e,repository:i},r);break;case 3:case 4:const l=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const s={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};a.kind===4?Ot(a.ruleName,s,r):qe(s,r)}else a.kind===4?r.add(new Li(a.scopeName,a.ruleName)):r.add(new Ie(a.scopeName));break}}}var Pi=class{kind=0},Oi=class{kind=1},xi=class{constructor(t){this.ruleName=t}kind=2},Di=class{constructor(t){this.scopeName=t}kind=3},Ni=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function un(t){if(t==="$base")return new Pi;if(t==="$self")return new Oi;const e=t.indexOf("#");if(e===-1)return new Di(t);if(e===0)return new xi(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new Ni(r,n)}}var $i=/\\(\d+)/,dr=/\\(\d+)/g,Vi=-1,cn=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Ge.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Ge.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${en(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Ge.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ge.replaceCaptures(this._contentName,t,e)}},Mi=class extends Ne{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Gi=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new Re(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Te,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hr=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Te,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,o,a,l,s,u){super(t,e,r,n),this._begin=new Re(i,this.id),this.beginCaptures=o,this._end=new Re(a||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Te;for(const r of this.patterns)t.getRule(r).collectPatterns(t,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,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ze=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,o,a,l,s){super(t,e,r,n),this._begin=new Re(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new Re(a,cn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Te;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Te,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},pn=class ${static createCaptureRule(e,r,n,i,o){return e.registerRule(a=>new Mi(r,a,n,i,o))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Gi(e.$vscodeTextmateLocation,e.id,e.name,e.match,$._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=Zr({},n,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new hr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,$._compilePatterns(o,r,n))}return e.while?new Ze(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,$._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,$._compileCaptures(e.whileCaptures||e.captures,r,n),$._compilePatterns(e.patterns,r,n)):new xt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,$._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,$._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,$._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let o=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);l>o&&(o=l)}for(let a=0;a<=o;a++)i[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);let s=0;e[a].patterns&&(s=$.getCompiledRuleId(e[a],r,n)),i[l]=$.createCaptureRule(r,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,s)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let o=0,a=e.length;o<a;o++){const l=e[o];let s=-1;if(l.include){const u=un(l.include);switch(u.kind){case 0:case 1:s=$.getCompiledRuleId(n[l.include],r,n);break;case 2:let p=n[u.ruleName];p&&(s=$.getCompiledRuleId(p,r,n));break;case 3:case 4:const m=u.scopeName,d=u.kind===4?u.ruleName:null,h=r.getExternalGrammar(m,n);if(h)if(d){let f=h.repository[d];f&&(s=$.getCompiledRuleId(f,r,h.repository))}else s=$.getCompiledRuleId(h.repository.$self,r,h.repository);break}}else s=$.getCompiledRuleId(l,r,n);if(s!==-1){const u=r.getRule(s);let p=!1;if((u instanceof hr||u instanceof xt||u instanceof Ze)&&u.hasMissingPatterns&&u.patterns.length===0&&(p=!0),p)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},Re=class mn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,o=[],a=!1;for(let l=0;l<n;l++)if(e.charAt(l)==="\\"&&l+1<n){const u=e.charAt(l+1);u==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(a=!0),l++}this.hasAnchor=a,i===0?this.source=e:(o.push(e.substring(i,n)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=$i.test(this.source):this.hasBackReferences=!1}clone(){return new mn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return dr.lastIndex=0,this.source.replace(dr,(i,o)=>nn(n[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],o,a,l,s;for(o=0,a=this.source.length;o<a;o++)l=this.source.charAt(o),e[o]=l,r[o]=l,n[o]=l,i[o]=l,l==="\\"&&o+1<a&&(s=this.source.charAt(o+1),s==="A"?(e[o+1]="",r[o+1]="",n[o+1]="A",i[o+1]="A"):s==="G"?(e[o+1]="",r[o+1]="G",n[o+1]="",i[o+1]="G"):(e[o+1]=s,r[o+1]=s,n[o+1]=s,i[o+1]=s),o++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Te=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new fr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new fr(t,n,this._items.map(i=>i.ruleId))}},fr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
import{a1 as c}from"./Dr-08407.js";let R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function fi(t){return Xt(t)}function Xt(t){return Array.isArray(t)?gi(t):t instanceof RegExp?t:typeof t=="object"?_i(t):t}function gi(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Xt(t[r]);return e}function _i(t){let e={};for(let r in t)e[r]=Xt(t[r]);return e}function Zr(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function en(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?en(t.substring(0,t.length-1)):t.substr(~e+1)}var ft=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ge=class{static hasCaptures(t){return t===null?!1:(ft.lastIndex=0,ft.test(t))}static replaceCaptures(t,e,r){return t.replace(ft,(n,i,o,a)=>{let l=r[parseInt(i||o,10)];if(l){let s=e.substring(l.start,l.end);for(;s[0]===".";)s=s.substring(1);switch(a){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return n})}};function tn(t,e){return t<e?-1:t>e?1:0}function rn(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let o=tn(t[i],e[i]);if(o!==0)return o}return 0}return r-n}function pr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function nn(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var on=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Qe=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}static createFromRawTheme(t,e){return this.createFromParsedTheme(bi(t),e)}static createFromParsedTheme(t,e){return vi(t,e)}_cachedMatchRoot=new on(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>yi(t.parent,i.parentScopes));return n?new an(n.fontStyle,n.foreground,n.background):null}},gt=class ze{constructor(e,r){this.parent=e,this.scopeName=r}static push(e,r){for(const n of r)e=new ze(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new ze(r,e[n]);return r}push(e){return new ze(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function yi(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!Ei(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Ei(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var an=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}};function bi(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!a.settings)continue;let l;if(typeof a.scope=="string"){let m=a.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(a.scope)?l=a.scope:l=[""];let s=-1;if(typeof a.settings.fontStyle=="string"){s=0;let m=a.settings.fontStyle.split(" ");for(let d=0,h=m.length;d<h;d++)switch(m[d]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof a.settings.foreground=="string"&&pr(a.settings.foreground)&&(u=a.settings.foreground);let p=null;typeof a.settings.background=="string"&&pr(a.settings.background)&&(p=a.settings.background);for(let m=0,d=l.length;m<d;m++){let f=l[m].trim().split(" "),E=f[f.length-1],b=null;f.length>1&&(b=f.slice(0,f.length-1),b.reverse()),r[n++]=new wi(E,b,i,s,u,p)}}return r}var wi=class{constructor(t,e,r,n,i,o){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=o}},V=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(V||{});function vi(t,e){t.sort((s,u)=>{let p=tn(s.scope,u.scope);return p!==0||(p=rn(s.parentScopes,u.parentScopes),p!==0)?p:s.index-u.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let s=t.shift();s.fontStyle!==-1&&(r=s.fontStyle),s.foreground!==null&&(n=s.foreground),s.background!==null&&(i=s.background)}let o=new Ci(e),a=new an(r,o.getId(n),o.getId(i)),l=new ki(new Tt(0,null,-1,0,0),[]);for(let s=0,u=t.length;s<u;s++){let p=t[s];l.insert(0,p.scope,p.parentScopes,p.fontStyle,o.getId(p.foreground),o.getId(p.background))}return new Qe(o,a,l)}var Ci=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Ai=Object.freeze([]),Tt=class sn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,o){this.scopeDepth=e,this.parentScopes=r||Ai,this.fontStyle=n,this.foreground=i,this.background=o}clone(){return new sn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},ki=class Pt{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const o=r.parentScopes[i].length-e.parentScopes[n].length;if(o!==0)return o;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,o;if(n===-1?(i=e,o=""):(i=e.substring(0,n),o=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Pt._cmpBySpecificity),r}insert(e,r,n,i,o,a){if(r===""){this._doInsertHere(e,n,i,o,a);return}let l=r.indexOf("."),s,u;l===-1?(s=r,u=""):(s=r.substring(0,l),u=r.substring(l+1));let p;this._children.hasOwnProperty(s)?p=this._children[s]:(p=new Pt(this._mainRule.clone(),Tt.cloneArr(this._rulesWithParentScopes)),this._children[s]=p),p.insert(e+1,u,n,i,o,a)}_doInsertHere(e,r,n,i,o){if(r===null){this._mainRule.acceptOverwrite(e,n,i,o);return}for(let a=0,l=this._rulesWithParentScopes.length;a<l;a++){let s=this._rulesWithParentScopes[a];if(rn(s.parentScopes,r)===0){s.acceptOverwrite(e,n,i,o);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Tt(e,r,n,i,o))}},ye=class U{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=U.getLanguageId(e),n=U.getTokenType(e),i=U.getFontStyle(e),o=U.getForeground(e),a=U.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:o,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,o,a,l){let s=U.getLanguageId(e),u=U.getTokenType(e),p=U.containsBalancedBrackets(e)?1:0,m=U.getFontStyle(e),d=U.getForeground(e),h=U.getBackground(e);return r!==0&&(s=r),n!==8&&(u=n),i!==null&&(p=i?1:0),o!==-1&&(m=o),a!==0&&(d=a),l!==0&&(h=l),(s<<0|u<<8|p<<10|m<<11|d<<15|h<<24)>>>0}};function Je(t,e){const r=[],n=Si(t);let i=n.next();for(;i!==null;){let s=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let u=a();if(r.push({matcher:u,priority:s}),i!==",")break;i=n.next()}return r;function o(){if(i==="-"){i=n.next();const s=o();return u=>!!s&&!s(u)}if(i==="("){i=n.next();const s=l();return i===")"&&(i=n.next()),s}if(mr(i)){const s=[];do s.push(i),i=n.next();while(mr(i));return u=>e(s,u)}return null}function a(){const s=[];let u=o();for(;u;)s.push(u),u=o();return p=>s.every(m=>m(p))}function l(){const s=[];let u=a();for(;u&&(s.push(u),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");u=a()}return p=>s.some(m=>m(p))}}function mr(t){return!!t&&!!t.match(/[\w\.:]+/)}function Si(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function ln(t){typeof t.dispose=="function"&&t.dispose()}var Ie=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Li=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ii=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Ri=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ie(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Ii;for(const r of t)Ti(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ie){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Ti(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=r.lookup(e);t instanceof Ie?qe({baseGrammar:o,selfGrammar:i},n):Ot(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},n);const a=r.injections(t.scopeName);if(a)for(const l of a)n.add(new Ie(l))}function Ot(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];Ye([n],e,r)}}function qe(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ye(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ye(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ye(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?Zr({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&Ye(n.patterns,{...e,repository:i},r);const o=n.include;if(!o)continue;const a=un(o);switch(a.kind){case 0:qe({...e,selfGrammar:e.baseGrammar},r);break;case 1:qe(e,r);break;case 2:Ot(a.ruleName,{...e,repository:i},r);break;case 3:case 4:const l=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const s={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};a.kind===4?Ot(a.ruleName,s,r):qe(s,r)}else a.kind===4?r.add(new Li(a.scopeName,a.ruleName)):r.add(new Ie(a.scopeName));break}}}var Pi=class{kind=0},Oi=class{kind=1},xi=class{constructor(t){this.ruleName=t}kind=2},Di=class{constructor(t){this.scopeName=t}kind=3},Ni=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function un(t){if(t==="$base")return new Pi;if(t==="$self")return new Oi;const e=t.indexOf("#");if(e===-1)return new Di(t);if(e===0)return new xi(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new Ni(r,n)}}var $i=/\\(\d+)/,dr=/\\(\d+)/g,Vi=-1,cn=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Ge.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Ge.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${en(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Ge.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ge.replaceCaptures(this._contentName,t,e)}},Mi=class extends Ne{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Gi=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new Re(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Te,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hr=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Te,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,o,a,l,s,u){super(t,e,r,n),this._begin=new Re(i,this.id),this.beginCaptures=o,this._end=new Re(a||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Te;for(const r of this.patterns)t.getRule(r).collectPatterns(t,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,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ze=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,o,a,l,s){super(t,e,r,n),this._begin=new Re(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new Re(a,cn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Te;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Te,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},pn=class ${static createCaptureRule(e,r,n,i,o){return e.registerRule(a=>new Mi(r,a,n,i,o))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Gi(e.$vscodeTextmateLocation,e.id,e.name,e.match,$._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=Zr({},n,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new hr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,$._compilePatterns(o,r,n))}return e.while?new Ze(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,$._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,$._compileCaptures(e.whileCaptures||e.captures,r,n),$._compilePatterns(e.patterns,r,n)):new xt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,$._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,$._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,$._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let o=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);l>o&&(o=l)}for(let a=0;a<=o;a++)i[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);let s=0;e[a].patterns&&(s=$.getCompiledRuleId(e[a],r,n)),i[l]=$.createCaptureRule(r,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,s)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let o=0,a=e.length;o<a;o++){const l=e[o];let s=-1;if(l.include){const u=un(l.include);switch(u.kind){case 0:case 1:s=$.getCompiledRuleId(n[l.include],r,n);break;case 2:let p=n[u.ruleName];p&&(s=$.getCompiledRuleId(p,r,n));break;case 3:case 4:const m=u.scopeName,d=u.kind===4?u.ruleName:null,h=r.getExternalGrammar(m,n);if(h)if(d){let f=h.repository[d];f&&(s=$.getCompiledRuleId(f,r,h.repository))}else s=$.getCompiledRuleId(h.repository.$self,r,h.repository);break}}else s=$.getCompiledRuleId(l,r,n);if(s!==-1){const u=r.getRule(s);let p=!1;if((u instanceof hr||u instanceof xt||u instanceof Ze)&&u.hasMissingPatterns&&u.patterns.length===0&&(p=!0),p)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},Re=class mn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,o=[],a=!1;for(let l=0;l<n;l++)if(e.charAt(l)==="\\"&&l+1<n){const u=e.charAt(l+1);u==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(a=!0),l++}this.hasAnchor=a,i===0?this.source=e:(o.push(e.substring(i,n)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=$i.test(this.source):this.hasBackReferences=!1}clone(){return new mn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return dr.lastIndex=0,this.source.replace(dr,(i,o)=>nn(n[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],o,a,l,s;for(o=0,a=this.source.length;o<a;o++)l=this.source.charAt(o),e[o]=l,r[o]=l,n[o]=l,i[o]=l,l==="\\"&&o+1<a&&(s=this.source.charAt(o+1),s==="A"?(e[o+1]="",r[o+1]="",n[o+1]="A",i[o+1]="A"):s==="G"?(e[o+1]="",r[o+1]="G",n[o+1]="",i[o+1]="G"):(e[o+1]=s,r[o+1]=s,n[o+1]=s,i[o+1]=s),o++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Te=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new fr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new fr(t,n,this._items.map(i=>i.ruleId))}},fr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
3
3
|
`)}findNextMatchSync(t,e,r){const n=this.scanner.findNextMatchSync(t,e,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},_t=class{constructor(t,e){this.languageId=t,this.tokenType=e}},Bi=class Dt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,r){this._defaultAttributes=new _t(e,8),this._embeddedLanguagesMatcher=new Ui(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Dt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new _t(0,0);_getBasicScopeAttributes=new on(e=>{const r=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new _t(r,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const r=e.match(Dt.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ui=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([r,n])=>nn(r));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},gr=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function dn(t,e,r,n,i,o,a,l){const s=e.content.length;let u=!1,p=-1;if(a){const h=Fi(t,e,r,n,i,o);i=h.stack,n=h.linePos,r=h.isFirstLine,p=h.anchorPosition}const m=Date.now();for(;!u;){if(l!==0&&Date.now()-m>l)return new gr(i,!0);d()}return new gr(i,!1);function d(){const h=ji(t,e,r,n,i,p);if(!h){o.produce(i,s),u=!0;return}const f=h.captureIndices,E=h.matchedRuleId,b=f&&f.length>0?f[0].end>n:!1;if(E===Vi){const g=i.getRule(t);o.produce(i,f[0].start),i=i.withContentNameScopesList(i.nameScopesList),ke(t,e,r,i,o,g.endCaptures,f),o.produce(i,f[0].end);const w=i;if(i=i.parent,p=w.getAnchorPos(),!b&&w.getEnterPos()===n){i=w,o.produce(i,s),u=!0;return}}else{const g=t.getRule(E);o.produce(i,f[0].start);const w=i,_=g.getName(e.content,f),v=i.contentNameScopesList.pushAttributed(_,t);if(i=i.push(E,n,p,f[0].end===s,null,v,v),g instanceof xt){const k=g;ke(t,e,r,i,o,k.beginCaptures,f),o.produce(i,f[0].end),p=f[0].end;const x=k.getContentName(e.content,f),M=v.pushAttributed(x,t);if(i=i.withContentNameScopesList(M),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(e.content,f))),!b&&w.hasSameRuleAs(i)){i=i.pop(),o.produce(i,s),u=!0;return}}else if(g instanceof Ze){const k=g;ke(t,e,r,i,o,k.beginCaptures,f),o.produce(i,f[0].end),p=f[0].end;const x=k.getContentName(e.content,f),M=v.pushAttributed(x,t);if(i=i.withContentNameScopesList(M),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(e.content,f))),!b&&w.hasSameRuleAs(i)){i=i.pop(),o.produce(i,s),u=!0;return}}else if(ke(t,e,r,i,o,g.captures,f),o.produce(i,f[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,s),u=!0;return}}f[0].end>n&&(n=f[0].end,r=!1)}}function Fi(t,e,r,n,i,o){let a=i.beginRuleCapturedEOL?0:-1;const l=[];for(let s=i;s;s=s.pop()){const u=s.getRule(t);u instanceof Ze&&l.push({rule:u,stack:s})}for(let s=l.pop();s;s=l.pop()){const{ruleScanner:u,findOptions:p}=zi(s.rule,t,s.stack.endRule,r,n===a),m=u.findNextMatchSync(e,n,p);if(m){if(m.ruleId!==cn){i=s.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(o.produce(s.stack,m.captureIndices[0].start),ke(t,e,r,s.stack,o,s.rule.whileCaptures,m.captureIndices),o.produce(s.stack,m.captureIndices[0].end),a=m.captureIndices[0].end,m.captureIndices[0].end>n&&(n=m.captureIndices[0].end,r=!1))}else{i=s.stack.pop();break}}return{stack:i,linePos:n,anchorPosition:a,isFirstLine:r}}function ji(t,e,r,n,i,o){const a=Hi(t,e,r,n,i,o),l=t.getInjections();if(l.length===0)return a;const s=Wi(l,t,e,r,n,i,o);if(!s)return a;if(!a)return s;const u=a.captureIndices[0].start,p=s.captureIndices[0].start;return p<u||s.priorityMatch&&p===u?s:a}function Hi(t,e,r,n,i,o){const a=i.getRule(t),{ruleScanner:l,findOptions:s}=hn(a,t,i.endRule,r,n===o),u=l.findNextMatchSync(e,n,s);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function Wi(t,e,r,n,i,o,a){let l=Number.MAX_VALUE,s=null,u,p=0;const m=o.contentNameScopesList.getScopeNames();for(let d=0,h=t.length;d<h;d++){const f=t[d];if(!f.matcher(m))continue;const E=e.getRule(f.ruleId),{ruleScanner:b,findOptions:g}=hn(E,e,null,n,i===a),w=b.findNextMatchSync(r,i,g);if(!w)continue;const _=w.captureIndices[0].start;if(!(_>=l)&&(l=_,s=w.captureIndices,u=w.ruleId,p=f.priority,l===i))break}return s?{priorityMatch:p===-1,captureIndices:s,matchedRuleId:u}:null}function hn(t,e,r,n,i){return{ruleScanner:t.compileAG(e,r,n,i),findOptions:0}}function zi(t,e,r,n,i){return{ruleScanner:t.compileWhileAG(e,r,n,i),findOptions:0}}function ke(t,e,r,n,i,o,a){if(o.length===0)return;const l=e.content,s=Math.min(o.length,a.length),u=[],p=a[0].end;for(let m=0;m<s;m++){const d=o[m];if(d===null)continue;const h=a[m];if(h.length===0)continue;if(h.start>p)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(n,h.start),d.retokenizeCapturedWithRuleId){const E=d.getName(l,a),b=n.contentNameScopesList.pushAttributed(E,t),g=d.getContentName(l,a),w=b.pushAttributed(g,t),_=n.push(d.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,w),v=t.createOnigString(l.substring(0,h.end));dn(t,v,r&&h.start===0,h.start,_,i,!1,0),ln(v);continue}const f=d.getName(l,a);if(f!==null){const b=(u.length>0?u[u.length-1].scopes:n.contentNameScopesList).pushAttributed(f,t);u.push(new qi(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var qi=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Xi(t,e,r,n,i,o,a,l){return new Qi(t,e,r,n,i,o,a,l)}function _r(t,e,r,n,i){const o=Je(e,et),a=pn.getCompiledRuleId(r,n,i.repository);for(const l of o)t.push({debugSelector:e,matcher:l.matcher,ruleId:a,grammar:i,priority:l.priority})}function et(t,e){if(e.length<t.length)return!1;let r=0;return t.every(n=>{for(let i=r;i<e.length;i++)if(Ki(e[i],n))return r=i+1,!0;return!1})}function Ki(t,e){if(!t)return!1;if(t===e)return!0;const r=e.length;return t.length>r&&t.substr(0,r)===e&&t[r]==="."}var Qi=class{constructor(t,e,r,n,i,o,a,l){if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new Bi(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=yr(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const s of Object.keys(i)){const u=Je(s,et);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[s]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],r=this._rootScopeName,n=t.lookup(r);if(n){const i=n.injections;if(i)for(let a in i)_r(e,a,i[a],this,n);const o=this._grammarRepository.injections(r);o&&o.forEach(a=>{const l=this.getExternalGrammar(a);if(l){const s=l.injectionSelector;s&&_r(e,s,l,this,l)}})}return e.sort((i,o)=>i.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,r=t(e);return this._ruleId2desc[e]=r,r}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const r=this._grammarRepository.lookup(t);if(r)return this._includedGrammars[t]=yr(r,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,r=0){const n=this._tokenize(t,e,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,r=0){const n=this._tokenize(t,e,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,r,n){this._rootId===-1&&(this._rootId=pn.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===Nt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=ye.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),d=this.getRule(this._rootId).getName(null,null);let h;d?h=Se.createRootAndLookUpScopeName(d,m,this):h=Se.createRoot("unknown",m),e=new Nt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,e.reset();t=t+`
|
|
4
4
|
`;const o=this.createOnigString(t),a=o.content.length,l=new Yi(r,t,this._tokenTypeMatchers,this.balancedBracketSelectors),s=dn(this,o,i,0,e,l,!0,n);return ln(o),{lineLength:a,lineTokens:l,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function yr(t,e){return t=fi(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Se=class W{constructor(e,r,n){this.parent=e,this.scopePath=r,this.tokenAttributes=n}static fromExtension(e,r){let n=e,i=e?.scopePath??null;for(const o of r)i=gt.push(i,o.scopeNames),n=new W(n,i,o.encodedTokenAttributes);return n}static createRoot(e,r){return new W(null,new gt(null,e),r)}static createRootAndLookUpScopeName(e,r,n){const i=n.getMetadataForScope(e),o=new gt(null,e),a=n.themeProvider.themeMatch(o),l=W.mergeAttributes(r,i,a);return new W(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return W.equals(this,e)}static equals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.scopeName!==r.scopeName||e.tokenAttributes!==r.tokenAttributes)return!1;e=e.parent,r=r.parent}while(!0)}static mergeAttributes(e,r,n){let i=-1,o=0,a=0;return n!==null&&(i=n.fontStyle,o=n.foregroundId,a=n.backgroundId),ye.set(e,r.languageId,r.tokenType,null,i,o,a)}pushAttributed(e,r){if(e===null)return this;if(e.indexOf(" ")===-1)return W._pushAttributed(this,e,r);const n=e.split(/ /g);let i=this;for(const o of n)i=W._pushAttributed(i,o,r);return i}static _pushAttributed(e,r,n){const i=n.getMetadataForScope(r),o=e.scopePath.push(r),a=n.themeProvider.themeMatch(o),l=W.mergeAttributes(e.tokenAttributes,i,a);return new W(e,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?r.reverse():void 0}},Nt=class ie{constructor(e,r,n,i,o,a,l,s){this.parent=e,this.ruleId=r,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=l,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ie(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:ie._equals(this,e)}static _equals(e,r){return e===r?!0:this._structuralEquals(e,r)?Se.equals(e.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.depth!==r.depth||e.ruleId!==r.ruleId||e.endRule!==r.endRule)return!1;e=e.parent,r=r.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){ie._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,r,n,i,o,a,l){return new ie(this,e,r,n,i,o,a,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,r){return this.parent&&(r=this.parent._writeString(e,r)),e[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new ie(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let r=this;for(;r&&r._enterPos===e._enterPos;){if(r.ruleId===e.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,r){const n=Se.fromExtension(e?.nameScopesList??null,r.nameScopesList);return new ie(e,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,Se.fromExtension(n,r.contentNameScopesList))}},Ji=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Je(r,et).map(n=>n.matcher)),this.unbalancedBracketScopes=e.flatMap(r=>Je(r,et).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Yi=class{constructor(t,e,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(n=ye.set(n,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(n=ye.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}const r=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:r}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},Zi=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,r,n,i){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,Xi(t,o,e,r,n,i,this,this._onigLib))}return this._grammars.get(t)}},eo=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Zi(Qe.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,r){this._syncRegistry.setTheme(Qe.createFromRawTheme(e,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,r,n){return this.loadGrammarWithConfiguration(e,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,r,n){return this._loadGrammar(e,r,n.embeddedLanguages,n.tokenTypes,new Ji(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,r,n,i,o){const a=new Ri(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(l=>this._loadSingleGrammar(l.scopeName)),a.processQueue();return this._grammarForScopeName(e,r,n,i,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const r=this._options.loadGrammar(e);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(e,r=[],n=0,i=null){return this._syncRegistry.addGrammar(e,r),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,r=0,n=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(e,r,n,i,o)}},$t=Nt.NULL;const to=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class $e{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}$e.prototype.normal={};$e.prototype.property={};$e.prototype.space=void 0;function fn(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new $e(r,n,e)}function Vt(t){return t.toLowerCase()}class G{constructor(e,r){this.attribute=r,this.property=e}}G.prototype.attribute="";G.prototype.booleanish=!1;G.prototype.boolean=!1;G.prototype.commaOrSpaceSeparated=!1;G.prototype.commaSeparated=!1;G.prototype.defined=!1;G.prototype.mustUseProperty=!1;G.prototype.number=!1;G.prototype.overloadedBoolean=!1;G.prototype.property="";G.prototype.spaceSeparated=!1;G.prototype.space=void 0;let ro=0;const A=ue(),I=ue(),Mt=ue(),y=ue(),S=ue(),ge=ue(),B=ue();function ue(){return 2**++ro}const Gt=Object.freeze(Object.defineProperty({__proto__:null,boolean:A,booleanish:I,commaOrSpaceSeparated:B,commaSeparated:ge,number:y,overloadedBoolean:Mt,spaceSeparated:S},Symbol.toStringTag,{value:"Module"})),yt=Object.keys(Gt);class Kt extends G{constructor(e,r,n,i){let o=-1;if(super(e,r),Er(this,"space",i),typeof n=="number")for(;++o<yt.length;){const a=yt[o];Er(this,yt[o],(n&Gt[a])===Gt[a])}}}Kt.prototype.defined=!0;function Er(t,e,r){r&&(t[e]=r)}function Ee(t){const e={},r={};for(const[n,i]of Object.entries(t.properties)){const o=new Kt(n,t.transform(t.attributes||{},n),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),e[n]=o,r[Vt(n)]=n,r[Vt(o.attribute)]=n}return new $e(e,r,t.space)}const gn=Ee({properties:{ariaActiveDescendant:null,ariaAtomic:I,ariaAutoComplete:null,ariaBusy:I,ariaChecked:I,ariaColCount:y,ariaColIndex:y,ariaColSpan:y,ariaControls:S,ariaCurrent:null,ariaDescribedBy:S,ariaDetails:null,ariaDisabled:I,ariaDropEffect:S,ariaErrorMessage:null,ariaExpanded:I,ariaFlowTo:S,ariaGrabbed:I,ariaHasPopup:null,ariaHidden:I,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:S,ariaLevel:y,ariaLive:null,ariaModal:I,ariaMultiLine:I,ariaMultiSelectable:I,ariaOrientation:null,ariaOwns:S,ariaPlaceholder:null,ariaPosInSet:y,ariaPressed:I,ariaReadOnly:I,ariaRelevant:null,ariaRequired:I,ariaRoleDescription:S,ariaRowCount:y,ariaRowIndex:y,ariaRowSpan:y,ariaSelected:I,ariaSetSize:y,ariaSort:null,ariaValueMax:y,ariaValueMin:y,ariaValueNow:y,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function _n(t,e){return e in t?t[e]:e}function yn(t,e){return _n(t,e.toLowerCase())}const no=Ee({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ge,acceptCharset:S,accessKey:S,action:null,allow:null,allowFullScreen:A,allowPaymentRequest:A,allowUserMedia:A,alt:null,as:null,async:A,autoCapitalize:null,autoComplete:S,autoFocus:A,autoPlay:A,blocking:S,capture:null,charSet:null,checked:A,cite:null,className:S,cols:y,colSpan:null,content:null,contentEditable:I,controls:A,controlsList:S,coords:y|ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:A,defer:A,dir:null,dirName:null,disabled:A,download:Mt,draggable:I,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:A,formTarget:null,headers:S,height:y,hidden:Mt,high:y,href:null,hrefLang:null,htmlFor:S,httpEquiv:S,id:null,imageSizes:null,imageSrcSet:null,inert:A,inputMode:null,integrity:null,is:null,isMap:A,itemId:null,itemProp:S,itemRef:S,itemScope:A,itemType:S,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:A,low:y,manifest:null,max:null,maxLength:y,media:null,method:null,min:null,minLength:y,multiple:A,muted:A,name:null,nonce:null,noModule:A,noValidate:A,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:A,optimum:y,pattern:null,ping:S,placeholder:null,playsInline:A,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:A,referrerPolicy:null,rel:S,required:A,reversed:A,rows:y,rowSpan:y,sandbox:S,scope:null,scoped:A,seamless:A,selected:A,shadowRootClonable:A,shadowRootDelegatesFocus:A,shadowRootMode:null,shape:null,size:y,sizes:null,slot:null,span:y,spellCheck:I,src:null,srcDoc:null,srcLang:null,srcSet:null,start:y,step:null,style:null,tabIndex:y,target:null,title:null,translate:null,type:null,typeMustMatch:A,useMap:null,value:I,width:y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:S,axis:null,background:null,bgColor:null,border:y,borderColor:null,bottomMargin:y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:A,declare:A,event:null,face:null,frame:null,frameBorder:null,hSpace:y,leftMargin:y,link:null,longDesc:null,lowSrc:null,marginHeight:y,marginWidth:y,noResize:A,noHref:A,noShade:A,noWrap:A,object:null,profile:null,prompt:null,rev:null,rightMargin:y,rules:null,scheme:null,scrolling:I,standby:null,summary:null,text:null,topMargin:y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:A,disableRemotePlayback:A,prefix:null,property:null,results:y,security:null,unselectable:null},space:"html",transform:yn}),io=Ee({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:B,accentHeight:y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:y,amplitude:y,arabicForm:null,ascent:y,attributeName:null,attributeType:null,azimuth:y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:y,by:null,calcMode:null,capHeight:y,className:S,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:y,diffuseConstant:y,direction:null,display:null,dur:null,divisor:y,dominantBaseline:null,download:A,dx:null,dy:null,edgeMode:null,editable:null,elevation:y,enableBackground:null,end:null,event:null,exponent:y,externalResourcesRequired:null,fill:null,fillOpacity:y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ge,g2:ge,glyphName:ge,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:y,horizOriginX:y,horizOriginY:y,id:null,ideographic:y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:y,k:y,k1:y,k2:y,k3:y,k4:y,kernelMatrix:B,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:y,overlineThickness:y,paintOrder:null,panose1:null,path:null,pathLength:y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:S,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:y,pointsAtY:y,pointsAtZ:y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:B,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:B,rev:B,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:B,requiredFeatures:B,requiredFonts:B,requiredFormats:B,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:y,specularExponent:y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:y,strikethroughThickness:y,string:null,stroke:null,strokeDashArray:B,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:y,strokeOpacity:y,strokeWidth:null,style:null,surfaceScale:y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:B,tabIndex:y,tableValues:null,target:null,targetX:y,targetY:y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:B,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:y,underlineThickness:y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:y,values:null,vAlphabetic:y,vMathematical:y,vectorEffect:null,vHanging:y,vIdeographic:y,version:null,vertAdvY:y,vertOriginX:y,vertOriginY:y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_n}),En=Ee({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bn=Ee({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yn}),wn=Ee({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),oo=/[A-Z]/g,br=/-[a-z]/g,ao=/^data[-\w.:]+$/i;function so(t,e){const r=Vt(e);let n=e,i=G;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&ao.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(br,uo);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!br.test(o)){let a=o.replace(oo,lo);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Kt}return new i(n,e)}function lo(t){return"-"+t.toLowerCase()}function uo(t){return t.charAt(1).toUpperCase()}const co=fn([gn,no,En,bn,wn],"html"),vn=fn([gn,io,En,bn,wn],"svg"),wr={}.hasOwnProperty;function po(t,e){const r=e||{};function n(i,...o){let a=n.invalid;const l=n.handlers;if(i&&wr.call(i,t)){const s=String(i[t]);a=wr.call(l,s)?l[s]:n.unknown}if(a)return a.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const mo=/["&'<>`]/g,ho=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,go=/[|\\{}()[\]^$+*?.]/g,vr=new WeakMap;function _o(t,e){if(t=t.replace(e.subset?yo(e.subset):mo,n),e.subset||e.escapeOnly)return t;return t.replace(ho,r).replace(fo,n);function r(i,o,a){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(o+2),e)}function n(i,o,a){return e.format(i.charCodeAt(0),a.charCodeAt(o+1),e)}}function yo(t){let e=vr.get(t);return e||(e=Eo(t),vr.set(t,e)),e}function Eo(t){const e=[];let r=-1;for(;++r<t.length;)e.push(t[r].replace(go,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const bo=/[\dA-Fa-f]/;function wo(t,e,r){const n="&#x"+t.toString(16).toUpperCase();return r&&e&&!bo.test(String.fromCharCode(e))?n:n+";"}const vo=/\d/;function Co(t,e,r){const n="&#"+String(t);return r&&e&&!vo.test(String.fromCharCode(e))?n:n+";"}const Ao=["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"],Et={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},ko=["cent","copy","divide","gt","lt","not","para","times"],Cn={}.hasOwnProperty,Bt={};let Be;for(Be in Et)Cn.call(Et,Be)&&(Bt[Et[Be]]=Be);const So=/[^\dA-Za-z]/;function Lo(t,e,r,n){const i=String.fromCharCode(t);if(Cn.call(Bt,i)){const o=Bt[i],a="&"+o;return r&&Ao.includes(o)&&!ko.includes(o)&&(!n||e&&e!==61&&So.test(String.fromCharCode(e)))?a:a+";"}return""}function Io(t,e,r){let n=wo(t,e,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=Lo(t,e,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const o=Co(t,e,r.omitOptionalSemicolons);o.length<n.length&&(n=o)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function _e(t,e){return _o(t,Object.assign({format:Io},e))}const Ro=/^>|^->|<!--|-->|--!>|<!-$/g,To=[">"],Po=["<",">"];function Oo(t,e,r,n){return n.settings.bogusComments?"<?"+_e(t.value,Object.assign({},n.settings.characterReferences,{subset:To}))+">":"<!--"+t.value.replace(Ro,i)+"-->";function i(o){return _e(o,Object.assign({},n.settings.characterReferences,{subset:Po}))}}function xo(t,e,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Cr(t,e){const r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Do(t,e){const r=e||{};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function No(t){return t.join(" ").trim()}const $o=/[ \t\n\f\r]/g;function Qt(t){return typeof t=="object"?t.type==="text"?Ar(t.value):!1:Ar(t)}function Ar(t){return t.replace($o,"")===""}const O=kn(1),An=kn(-1),Vo=[];function kn(t){return e;function e(r,n,i){const o=r?r.children:Vo;let a=(n||0)+t,l=o[a];if(!i)for(;l&&Qt(l);)a+=t,l=o[a];return l}}const Mo={}.hasOwnProperty;function Sn(t){return e;function e(r,n,i){return Mo.call(t,r.tagName)&&t[r.tagName](r,n,i)}}const Jt=Sn({body:Bo,caption:bt,colgroup:bt,dd:Ho,dt:jo,head:bt,html:Go,li:Fo,optgroup:Wo,option:zo,p:Uo,rp:kr,rt:kr,tbody:Xo,td:Sr,tfoot:Ko,th:Sr,thead:qo,tr:Qo});function bt(t,e,r){const n=O(r,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&Qt(n.value.charAt(0)))}function Go(t,e,r){const n=O(r,e);return!n||n.type!=="comment"}function Bo(t,e,r){const n=O(r,e);return!n||n.type!=="comment"}function Uo(t,e,r){const n=O(r,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function Fo(t,e,r){const n=O(r,e);return!n||n.type==="element"&&n.tagName==="li"}function jo(t,e,r){const n=O(r,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function Ho(t,e,r){const n=O(r,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function kr(t,e,r){const n=O(r,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function Wo(t,e,r){const n=O(r,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function zo(t,e,r){const n=O(r,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function qo(t,e,r){const n=O(r,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function Xo(t,e,r){const n=O(r,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function Ko(t,e,r){return!O(r,e)}function Qo(t,e,r){const n=O(r,e);return!n||n.type==="element"&&n.tagName==="tr"}function Sr(t,e,r){const n=O(r,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const Jo=Sn({body:ea,colgroup:ta,head:Zo,html:Yo,tbody:ra});function Yo(t){const e=O(t,-1);return!e||e.type!=="comment"}function Zo(t){const e=new Set;for(const n of t.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const r=t.children[0];return!r||r.type==="element"}function ea(t){const e=O(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Qt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function ta(t,e,r){const n=An(r,e),i=O(t,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&Jt(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ra(t,e,r){const n=An(r,e),i=O(t,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&Jt(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Ue={name:[[`
|
|
5
5
|
\f\r &/=>`.split(""),`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s}from"./DlAUqK2U.js";import{x as i,y as a,z as u,A as e,B as o}from"./
|
|
1
|
+
import{_ as s}from"./DlAUqK2U.js";import{x as i,y as a,z as u,A as e,B as o}from"./Dr-08407.js";const l={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},c={class:"max-w-520px text-center"},d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},status:{type:Number,default:500},statusText:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const r=t;return i({title:`${r.status} - ${r.statusText} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,n)=>(a(),u("div",l,[n[0]||(n[0]=e("div",{class:"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"},null,-1)),e("div",c,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:o(t.status)},null,8,d),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:o(t.description)},null,8,p)])]))}},b=s(f,[["__scopeId","data-v-6dec408c"]]);export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,y as i,z as l,H as w,G as n,B as p,k as B,I as V,J as F,K as N,L as S,T,C as x,M as z,D as j,N as v,A as o,O as u,E as W,P as $,Q as C,R as D,g as k,o as q,S as L,U as P}from"./D2BKG08b.js";import{r as O,a as M,b as R,c as U}from"./CiZPHQLr.js";const A=_({__name:"WorktreeStatusBadge",props:{status:{}},setup(t){const e=t,s=B(()=>({clean:{label:"clean",color:"text-retro-green bg-retro-green/20"},dirty:{label:"dirty",color:"text-retro-yellow bg-retro-yellow/20"},ahead:{label:"ahead",color:"text-retro-cyan bg-retro-cyan/20"},behind:{label:"behind",color:"text-retro-orange bg-retro-orange/20"},diverged:{label:"diverged",color:"text-retro-red bg-retro-red/20"}})[e.status]);return(a,h)=>(i(),l("span",{class:w(["px-1.5 py-0.5 text-[10px] font-mono uppercase rounded",n(s).color])},p(n(s).label),3))}}),E=V("worktree",{state:()=>({worktrees:[],currentBranch:"",mainWorktree:"",workingDirectory:"",loading:!1,error:null}),getters:{activeWorktree:t=>t.worktrees.find(e=>e.isCurrent),featureWorktrees:t=>t.worktrees.filter(e=>!e.isMain),mainWorktreeInfo:t=>t.worktrees.find(e=>e.isMain),hasWorktrees:t=>t.worktrees.length>1,dirtyWorktrees:t=>t.worktrees.filter(e=>e.status==="dirty")},actions:{async initialize(){if(!this.workingDirectory)try{const{cwd:t}=await $fetch("/api/cwd");this.workingDirectory=t}catch(t){console.error("Failed to get working directory:",t),this.workingDirectory=""}},async fetchWorktrees(){await this.initialize(),this.loading=!0,this.error=null;try{const t=await $fetch("/api/worktrees",{query:{workingDirectory:this.workingDirectory}});this.worktrees=t.worktrees,this.currentBranch=t.currentBranch,this.mainWorktree=t.mainWorktree}catch(t){this.error=t instanceof Error?t.message:"Failed to fetch worktrees",console.error("Failed to fetch worktrees:",t)}finally{this.loading=!1}},async createWorktree(t){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch("/api/worktrees",{method:"POST",query:{workingDirectory:this.workingDirectory},body:t});return e.success&&e.worktree?this.worktrees.push(e.worktree):e.error&&(this.error=e.error),e}catch(e){const s=e instanceof Error?e.message:"Failed to create worktree";return this.error=s,{success:!1,error:s}}finally{this.loading=!1}},async deleteWorktree(t,e=!1){await this.initialize(),this.loading=!0,this.error=null;try{const s=await $fetch(`/api/worktrees/${t}`,{method:"DELETE",query:{workingDirectory:this.workingDirectory,deleteBranch:e.toString()}});return s.success?this.worktrees=this.worktrees.filter(a=>a.name!==t):s.error&&(this.error=s.error),s}catch(s){const a=s instanceof Error?s.message:"Failed to delete worktree";return this.error=a,{success:!1,error:a}}finally{this.loading=!1}},async switchWorktree(t){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch(`/api/worktrees/${t}/switch`,{method:"POST",query:{workingDirectory:this.workingDirectory}});return e.success?(this.worktrees=this.worktrees.map(s=>({...s,isCurrent:s.name===t})),this.currentBranch=t):e.error&&(this.error=e.error),e}catch(e){const s=e instanceof Error?e.message:"Failed to switch worktree";return this.error=s,{success:!1,error:s}}finally{this.loading=!1}},clearError(){this.error=null}}}),H={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},I={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},K={key:0,class:"p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},G=["disabled"],J=["disabled"],Q={class:"flex justify-end gap-2 pt-2"},X=["disabled"],Y=["disabled"],Z=_({__name:"WorktreeCreateModal",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=F(t,"modelValue"),s=E(),a=k(""),h=k(""),m=k(!1),f=k(""),b=async()=>{if(!a.value.trim()){f.value="Description is required";return}m.value=!0,f.value="";try{const d=await s.createWorktree({description:a.value.trim(),shortName:h.value.trim()||void 0});d.success?(a.value="",h.value="",e.value=!1):f.value=d.error||"Failed to create worktree"}catch(d){f.value=d instanceof Error?d.message:"Failed to create worktree"}finally{m.value=!1}},c=()=>{e.value=!1,a.value="",h.value="",f.value=""},g=d=>{d.key==="Escape"&&c()};return N(e,d=>{d?document.addEventListener("keydown",g):document.removeEventListener("keydown",g)}),(d,r)=>(i(),S(T,{to:"body"},[x(z,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:j(()=>[e.value?(i(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:v(c,["self"])},[o("div",H,[o("div",I,[r[2]||(r[2]=o("h3",{class:"text-sm font-mono text-retro-text"},"Create Worktree",-1)),o("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",onClick:c},[x(n(O),{class:"h-4 w-4"})])]),o("form",{class:"p-4 space-y-4",onSubmit:v(b,["prevent"])},[n(f)?(i(),l("div",K,p(n(f)),1)):u("",!0),o("div",null,[r[3]||(r[3]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[W(" Feature Description "),o("span",{class:"text-retro-red"},"*")],-1)),$(o("input",{"onUpdate:modelValue":r[0]||(r[0]=y=>C(a)?a.value=y:null),type:"text",placeholder:"e.g., Add user authentication",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:n(m)},null,8,G),[[D,n(a)]]),r[4]||(r[4]=o("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," A brief description of what this feature does ",-1))]),o("div",null,[r[5]||(r[5]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[W(" Short Name "),o("span",{class:"text-retro-subtle"},"(optional)")],-1)),$(o("input",{"onUpdate:modelValue":r[1]||(r[1]=y=>C(h)?h.value=y:null),type:"text",placeholder:"e.g., auth",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:n(m)},null,8,J),[[D,n(h)]]),r[6]||(r[6]=o("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," Override the auto-generated branch name (e.g., 001-auth instead of 001-add-user-authentication) ",-1))]),o("div",Q,[o("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:n(m),onClick:c}," Cancel ",8,X),o("button",{type:"submit",class:"px-3 py-1.5 text-xs font-mono text-retro-black bg-retro-cyan hover:bg-retro-cyan/80 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:n(m)||!n(a).trim()},p(n(m)?"Creating...":"Create"),9,Y)])],32)])])):u("",!0)]),_:1})]))}}),ee={class:"h-full flex flex-col bg-retro-black"},te={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},re={class:"flex items-center gap-2"},oe={key:0,class:"px-4 py-2 bg-retro-red/20 border-b border-retro-red/50"},se={class:"text-xs font-mono text-retro-red"},ne={class:"flex-1 overflow-y-auto p-2 space-y-1"},ae={class:"flex items-start justify-between gap-2"},ie={class:"flex-1 min-w-0"},le={class:"flex items-center gap-2"},ce={key:0,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-yellow/20 text-retro-yellow rounded"},de={key:1,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-cyan/20 text-retro-cyan rounded"},ue={key:0,class:"mt-1 text-xs font-mono text-retro-muted truncate"},pe={class:"text-retro-subtle"},he={class:"mt-1 text-[10px] font-mono text-retro-subtle truncate"},me={class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity"},fe=["onClick"],xe=["onClick"],be={key:0,class:"mt-2 text-[10px] font-mono text-retro-green"},ye={key:0,class:"flex flex-col items-center justify-center py-8 text-center"},ke=_({__name:"WorktreePanel",setup(t){const e=E(),s=k(!1);q(()=>{e.fetchWorktrees()});const a=()=>{e.fetchWorktrees()},h=()=>{s.value=!0},m=async b=>{await e.switchWorktree(b)},f=async b=>{confirm(`Delete worktree "${b}"? This will remove the worktree directory.`)&&await e.deleteWorktree(b,!1)};return(b,c)=>{const g=A,d=Z;return i(),l("div",ee,[o("div",te,[c[1]||(c[1]=o("h2",{class:"text-sm font-mono text-retro-text"},"Worktrees",-1)),o("div",re,[o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Refresh",onClick:a},[x(n(M),{class:w(["h-4 w-4",{"animate-spin":n(e).loading}])},null,8,["class"])]),o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-green hover:bg-retro-panel transition-colors",title:"Create worktree",onClick:h},[x(n(R),{class:"h-4 w-4"})])])]),n(e).error?(i(),l("div",oe,[o("p",se,p(n(e).error),1)])):u("",!0),o("div",ne,[(i(!0),l(L,null,P(n(e).worktrees,r=>(i(),l("div",{key:r.name,class:w(["group p-3 rounded-md border transition-colors",[r.isCurrent?"bg-retro-cyan/10 border-retro-cyan":"bg-retro-panel border-retro-border hover:border-retro-muted"]])},[o("div",ae,[o("div",ie,[o("div",le,[o("span",{class:w(["font-mono text-sm truncate",r.isCurrent?"text-retro-cyan":"text-retro-text"])},p(r.name),3),x(g,{status:r.status},null,8,["status"]),r.isMain?(i(),l("span",ce," main ")):u("",!0),r.isCurrent?(i(),l("span",de," current ")):u("",!0)]),r.lastCommit?(i(),l("div",ue,[o("span",pe,p(r.lastCommit.shortHash),1),c[2]||(c[2]=o("span",{class:"mx-1"},"·",-1)),o("span",null,p(r.lastCommit.message),1)])):u("",!0),o("div",he,p(r.path),1)]),o("div",me,[!r.isCurrent&&!r.isMain?(i(),l("button",{key:0,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-dark transition-colors",title:"Switch to this worktree",onClick:v(y=>m(r.name),["stop"])},[x(n(M),{class:"h-3.5 w-3.5"})],8,fe)):u("",!0),r.isMain?u("",!0):(i(),l("button",{key:1,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-red hover:bg-retro-dark transition-colors",title:"Delete worktree",onClick:v(y=>f(r.name),["stop"])},[x(n(U),{class:"h-3.5 w-3.5"})],8,xe))])]),r.commitCount>0?(i(),l("div",be,p(r.commitCount)+" commit"+p(r.commitCount>1?"s":"")+" ahead ",1)):u("",!0)],2))),128)),!n(e).loading&&n(e).worktrees.length===0?(i(),l("div",ye,[...c[3]||(c[3]=[o("p",{class:"text-sm font-mono text-retro-muted"},"No worktrees found",-1),o("p",{class:"mt-1 text-xs font-mono text-retro-subtle"},"Create a new worktree to start working on a feature",-1)])])):u("",!0)]),x(d,{modelValue:n(s),"onUpdate:modelValue":c[0]||(c[0]=r=>C(s)?s.value=r:null)},null,8,["modelValue"])])}}}),ve=_({__name:"index",setup(t){return(e,s)=>{const a=ke;return i(),S(a)}}});export{ve as default};
|
|
1
|
+
import{d as _,y as i,z as l,H as w,G as n,B as p,k as B,I as V,J as F,K as N,L as S,T,C as x,M as z,D as j,N as v,A as o,O as u,E as W,P as $,Q as C,R as D,g as k,o as q,S as L,U as P}from"./Dr-08407.js";import{r as O,a as M,b as R,c as U}from"./BXrSICHP.js";const A=_({__name:"WorktreeStatusBadge",props:{status:{}},setup(t){const e=t,s=B(()=>({clean:{label:"clean",color:"text-retro-green bg-retro-green/20"},dirty:{label:"dirty",color:"text-retro-yellow bg-retro-yellow/20"},ahead:{label:"ahead",color:"text-retro-cyan bg-retro-cyan/20"},behind:{label:"behind",color:"text-retro-orange bg-retro-orange/20"},diverged:{label:"diverged",color:"text-retro-red bg-retro-red/20"}})[e.status]);return(a,h)=>(i(),l("span",{class:w(["px-1.5 py-0.5 text-[10px] font-mono uppercase rounded",n(s).color])},p(n(s).label),3))}}),E=V("worktree",{state:()=>({worktrees:[],currentBranch:"",mainWorktree:"",workingDirectory:"",loading:!1,error:null}),getters:{activeWorktree:t=>t.worktrees.find(e=>e.isCurrent),featureWorktrees:t=>t.worktrees.filter(e=>!e.isMain),mainWorktreeInfo:t=>t.worktrees.find(e=>e.isMain),hasWorktrees:t=>t.worktrees.length>1,dirtyWorktrees:t=>t.worktrees.filter(e=>e.status==="dirty")},actions:{async initialize(){if(!this.workingDirectory)try{const{cwd:t}=await $fetch("/api/cwd");this.workingDirectory=t}catch(t){console.error("Failed to get working directory:",t),this.workingDirectory=""}},async fetchWorktrees(){await this.initialize(),this.loading=!0,this.error=null;try{const t=await $fetch("/api/worktrees",{query:{workingDirectory:this.workingDirectory}});this.worktrees=t.worktrees,this.currentBranch=t.currentBranch,this.mainWorktree=t.mainWorktree}catch(t){this.error=t instanceof Error?t.message:"Failed to fetch worktrees",console.error("Failed to fetch worktrees:",t)}finally{this.loading=!1}},async createWorktree(t){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch("/api/worktrees",{method:"POST",query:{workingDirectory:this.workingDirectory},body:t});return e.success&&e.worktree?this.worktrees.push(e.worktree):e.error&&(this.error=e.error),e}catch(e){const s=e instanceof Error?e.message:"Failed to create worktree";return this.error=s,{success:!1,error:s}}finally{this.loading=!1}},async deleteWorktree(t,e=!1){await this.initialize(),this.loading=!0,this.error=null;try{const s=await $fetch(`/api/worktrees/${t}`,{method:"DELETE",query:{workingDirectory:this.workingDirectory,deleteBranch:e.toString()}});return s.success?this.worktrees=this.worktrees.filter(a=>a.name!==t):s.error&&(this.error=s.error),s}catch(s){const a=s instanceof Error?s.message:"Failed to delete worktree";return this.error=a,{success:!1,error:a}}finally{this.loading=!1}},async switchWorktree(t){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch(`/api/worktrees/${t}/switch`,{method:"POST",query:{workingDirectory:this.workingDirectory}});return e.success?(this.worktrees=this.worktrees.map(s=>({...s,isCurrent:s.name===t})),this.currentBranch=t):e.error&&(this.error=e.error),e}catch(e){const s=e instanceof Error?e.message:"Failed to switch worktree";return this.error=s,{success:!1,error:s}}finally{this.loading=!1}},clearError(){this.error=null}}}),H={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},I={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},K={key:0,class:"p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},G=["disabled"],J=["disabled"],Q={class:"flex justify-end gap-2 pt-2"},X=["disabled"],Y=["disabled"],Z=_({__name:"WorktreeCreateModal",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=F(t,"modelValue"),s=E(),a=k(""),h=k(""),m=k(!1),f=k(""),b=async()=>{if(!a.value.trim()){f.value="Description is required";return}m.value=!0,f.value="";try{const d=await s.createWorktree({description:a.value.trim(),shortName:h.value.trim()||void 0});d.success?(a.value="",h.value="",e.value=!1):f.value=d.error||"Failed to create worktree"}catch(d){f.value=d instanceof Error?d.message:"Failed to create worktree"}finally{m.value=!1}},c=()=>{e.value=!1,a.value="",h.value="",f.value=""},g=d=>{d.key==="Escape"&&c()};return N(e,d=>{d?document.addEventListener("keydown",g):document.removeEventListener("keydown",g)}),(d,r)=>(i(),S(T,{to:"body"},[x(z,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:j(()=>[e.value?(i(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:v(c,["self"])},[o("div",H,[o("div",I,[r[2]||(r[2]=o("h3",{class:"text-sm font-mono text-retro-text"},"Create Worktree",-1)),o("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",onClick:c},[x(n(O),{class:"h-4 w-4"})])]),o("form",{class:"p-4 space-y-4",onSubmit:v(b,["prevent"])},[n(f)?(i(),l("div",K,p(n(f)),1)):u("",!0),o("div",null,[r[3]||(r[3]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[W(" Feature Description "),o("span",{class:"text-retro-red"},"*")],-1)),$(o("input",{"onUpdate:modelValue":r[0]||(r[0]=y=>C(a)?a.value=y:null),type:"text",placeholder:"e.g., Add user authentication",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:n(m)},null,8,G),[[D,n(a)]]),r[4]||(r[4]=o("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," A brief description of what this feature does ",-1))]),o("div",null,[r[5]||(r[5]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[W(" Short Name "),o("span",{class:"text-retro-subtle"},"(optional)")],-1)),$(o("input",{"onUpdate:modelValue":r[1]||(r[1]=y=>C(h)?h.value=y:null),type:"text",placeholder:"e.g., auth",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:n(m)},null,8,J),[[D,n(h)]]),r[6]||(r[6]=o("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," Override the auto-generated branch name (e.g., 001-auth instead of 001-add-user-authentication) ",-1))]),o("div",Q,[o("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:n(m),onClick:c}," Cancel ",8,X),o("button",{type:"submit",class:"px-3 py-1.5 text-xs font-mono text-retro-black bg-retro-cyan hover:bg-retro-cyan/80 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:n(m)||!n(a).trim()},p(n(m)?"Creating...":"Create"),9,Y)])],32)])])):u("",!0)]),_:1})]))}}),ee={class:"h-full flex flex-col bg-retro-black"},te={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},re={class:"flex items-center gap-2"},oe={key:0,class:"px-4 py-2 bg-retro-red/20 border-b border-retro-red/50"},se={class:"text-xs font-mono text-retro-red"},ne={class:"flex-1 overflow-y-auto p-2 space-y-1"},ae={class:"flex items-start justify-between gap-2"},ie={class:"flex-1 min-w-0"},le={class:"flex items-center gap-2"},ce={key:0,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-yellow/20 text-retro-yellow rounded"},de={key:1,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-cyan/20 text-retro-cyan rounded"},ue={key:0,class:"mt-1 text-xs font-mono text-retro-muted truncate"},pe={class:"text-retro-subtle"},he={class:"mt-1 text-[10px] font-mono text-retro-subtle truncate"},me={class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity"},fe=["onClick"],xe=["onClick"],be={key:0,class:"mt-2 text-[10px] font-mono text-retro-green"},ye={key:0,class:"flex flex-col items-center justify-center py-8 text-center"},ke=_({__name:"WorktreePanel",setup(t){const e=E(),s=k(!1);q(()=>{e.fetchWorktrees()});const a=()=>{e.fetchWorktrees()},h=()=>{s.value=!0},m=async b=>{await e.switchWorktree(b)},f=async b=>{confirm(`Delete worktree "${b}"? This will remove the worktree directory.`)&&await e.deleteWorktree(b,!1)};return(b,c)=>{const g=A,d=Z;return i(),l("div",ee,[o("div",te,[c[1]||(c[1]=o("h2",{class:"text-sm font-mono text-retro-text"},"Worktrees",-1)),o("div",re,[o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Refresh",onClick:a},[x(n(M),{class:w(["h-4 w-4",{"animate-spin":n(e).loading}])},null,8,["class"])]),o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-green hover:bg-retro-panel transition-colors",title:"Create worktree",onClick:h},[x(n(R),{class:"h-4 w-4"})])])]),n(e).error?(i(),l("div",oe,[o("p",se,p(n(e).error),1)])):u("",!0),o("div",ne,[(i(!0),l(L,null,P(n(e).worktrees,r=>(i(),l("div",{key:r.name,class:w(["group p-3 rounded-md border transition-colors",[r.isCurrent?"bg-retro-cyan/10 border-retro-cyan":"bg-retro-panel border-retro-border hover:border-retro-muted"]])},[o("div",ae,[o("div",ie,[o("div",le,[o("span",{class:w(["font-mono text-sm truncate",r.isCurrent?"text-retro-cyan":"text-retro-text"])},p(r.name),3),x(g,{status:r.status},null,8,["status"]),r.isMain?(i(),l("span",ce," main ")):u("",!0),r.isCurrent?(i(),l("span",de," current ")):u("",!0)]),r.lastCommit?(i(),l("div",ue,[o("span",pe,p(r.lastCommit.shortHash),1),c[2]||(c[2]=o("span",{class:"mx-1"},"·",-1)),o("span",null,p(r.lastCommit.message),1)])):u("",!0),o("div",he,p(r.path),1)]),o("div",me,[!r.isCurrent&&!r.isMain?(i(),l("button",{key:0,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-dark transition-colors",title:"Switch to this worktree",onClick:v(y=>m(r.name),["stop"])},[x(n(M),{class:"h-3.5 w-3.5"})],8,fe)):u("",!0),r.isMain?u("",!0):(i(),l("button",{key:1,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-red hover:bg-retro-dark transition-colors",title:"Delete worktree",onClick:v(y=>f(r.name),["stop"])},[x(n(U),{class:"h-3.5 w-3.5"})],8,xe))])]),r.commitCount>0?(i(),l("div",be,p(r.commitCount)+" commit"+p(r.commitCount>1?"s":"")+" ahead ",1)):u("",!0)],2))),128)),!n(e).loading&&n(e).worktrees.length===0?(i(),l("div",ye,[...c[3]||(c[3]=[o("p",{class:"text-sm font-mono text-retro-muted"},"No worktrees found",-1),o("p",{class:"mt-1 text-xs font-mono text-retro-subtle"},"Create a new worktree to start working on a feature",-1)])])):u("",!0)]),x(d,{modelValue:n(s),"onUpdate:modelValue":c[0]||(c[0]=r=>C(s)?s.value=r:null)},null,8,["modelValue"])])}}}),ve=_({__name:"index",setup(t){return(e,s)=>{const a=ke;return i(),S(a)}}});export{ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as e,z as r,A as o}from"./
|
|
1
|
+
import{y as e,z as r,A as o}from"./Dr-08407.js";function i(t,n){return e(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})])}function s(t,n){return e(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}function c(t,n){return e(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})])}function d(t,n){return e(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})])}export{i as a,s as b,c,d as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,ab as C,ac as q,X,ad as Y,K as V,ae as Z,k as P,af as J,ag as Q,g as H,s as N,Z as ee,ah as te,G as ae,ai as se,aj as re,ak as K,I as oe,a0 as ne,d as ie,y as _,z as b,A as g,B as S,O as I,S as L,U as B,H as O,E as le}from"./D2BKG08b.js";const ce={trailing:!0};function de(e,t=25,o={}){if(o={...ce,...o},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let i,r,p=[],s,a;const m=(u,d)=>(s=ue(e,u,d),s.finally(()=>{if(s=null,o.trailing&&a&&!r){const h=m(u,a);return a=null,h}}),s),v=function(...u){return o.trailing&&(a=u),s||new Promise(d=>{const h=!r&&o.leading;clearTimeout(r),r=setTimeout(()=>{r=null;const n=o.leading?i:m(this,u);a=null;for(const c of p)c(n);p=[]},t),h?(i=m(this,u),d(i)):p.push(d)})},l=u=>{u&&(clearTimeout(u),r=null)};return v.isPending=()=>!!r,v.cancel=()=>{l(r),p=[],a=null},v.flush=()=>{if(l(r),!a||s)return;const u=a;return a=null,m(this,u)},v}async function ue(e,t,o){return await e.apply(t,o)}const fe=Symbol.for("nuxt:client-only"),me=e=>e==="defer"||e===!1;function qe(...e){const t=typeof e[e.length-1]=="string"?e.pop():void 0;ye(e[0],e[1])&&e.unshift(t);let[o,i,r={}]=e,p=!1;const s=P(()=>re(o));if(typeof s.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof i!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const a=j();r.server??=!0,r.default??=he,r.getCachedData??=U,r.lazy??=!1,r.immediate??=!0,r.deep??=C.deep,r.dedupe??="cancel",r._functionName,a._asyncData[s.value];function m(){const n={cause:"initial",dedupe:r.dedupe};return a._asyncData[s.value]?._init||(n.cachedData=r.getCachedData(s.value,a,{cause:"initial"}),a._asyncData[s.value]=$(a,s.value,i,r,n.cachedData)),()=>a._asyncData[s.value].execute(n)}const v=m(),l=a._asyncData[s.value];l._deps++;const u=r.server!==!1&&a.payload.serverRendered;{let n=function(y){const f=a._asyncData[y];f?._deps&&(f._deps--,f._deps===0&&f?._off())};const c=J();if(c&&u&&r.immediate&&!c.sp&&(c.sp=[]),c&&!c._nuxtOnBeforeMountCbs){c._nuxtOnBeforeMountCbs=[];const y=c._nuxtOnBeforeMountCbs;q(()=>{y.forEach(f=>{f()}),y.splice(0,y.length)}),X(()=>y.splice(0,y.length))}const x=c&&(c._nuxtClientOnly||Y(fe,!1));u&&a.isHydrating&&(l.error.value||l.data.value!=null)?(l.pending.value=!1,l.status.value=l.error.value?"error":"success"):c&&(!x&&a.payload.serverRendered&&a.isHydrating||r.lazy)&&r.immediate?c._nuxtOnBeforeMountCbs.push(v):r.immediate&&v();const D=Q(),M=V(s,(y,f)=>{if((y||f)&&y!==f){p=!0;const R=a._asyncData[f]?.data.value!==C.value,W=a._asyncDataPromises[f]!==void 0,G={cause:"initial",dedupe:r.dedupe};if(!a._asyncData[y]?._init){let T;f&&R?T=a._asyncData[f].data.value:(T=r.getCachedData(y,a,{cause:"initial"}),G.cachedData=T),a._asyncData[y]=$(a,y,i,r,T)}a._asyncData[y]._deps++,f&&n(f),(r.immediate||R||W)&&a._asyncData[y].execute(G),K(()=>{p=!1})}},{flush:"sync"}),E=r.watch?V(r.watch,()=>{p||(a._asyncData[s.value]?._execute.isPending()&&K(()=>{a._asyncData[s.value]?._execute.flush()}),a._asyncData[s.value]?._execute({cause:"watch",dedupe:r.dedupe}))}):()=>{};D&&Z(()=>{M(),E(),n(s.value)})}const d={data:k(()=>a._asyncData[s.value]?.data),pending:k(()=>a._asyncData[s.value]?.pending),status:k(()=>a._asyncData[s.value]?.status),error:k(()=>a._asyncData[s.value]?.error),refresh:(...n)=>a._asyncData[s.value]?._init?a._asyncData[s.value].execute(...n):m()(),execute:(...n)=>d.refresh(...n),clear:()=>{const n=a._asyncData[s.value];if(n?._abortController)try{n._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{n._abortController=void 0}z(a,s.value)}},h=Promise.resolve(a._asyncDataPromises[s.value]).then(()=>d);return Object.assign(h,d),h}function k(e){return P({get(){return e()?.value},set(t){const o=e();o&&(o.value=t)}})}function ye(e,t){return!(typeof e=="string"||typeof e=="object"&&e!==null||typeof e=="function"&&typeof t=="function")}function z(e,t){t in e.payload.data&&(e.payload.data[t]=void 0),t in e.payload._errors&&(e.payload._errors[t]=C.errorValue),e._asyncData[t]&&(e._asyncData[t].data.value=void 0,e._asyncData[t].error.value=C.errorValue,e._asyncData[t].pending.value=!1,e._asyncData[t].status.value="idle"),t in e._asyncDataPromises&&(e._asyncDataPromises[t]=void 0)}function pe(e,t){const o={};for(const i of t)o[i]=e[i];return o}function $(e,t,o,i,r){e.payload._errors[t]??=C.errorValue;const p=i.getCachedData!==U,s=o,a=i.deep?H:N,m=r!=null,v=e.hook("app:data:refresh",async u=>{(!u||u.includes(t))&&await l.execute({cause:"refresh:hook"})}),l={data:a(m?r:i.default()),pending:N(!m),error:se(e.payload._errors,t),status:N("idle"),execute:(...u)=>{const[d,h=void 0]=u,n=d&&h===void 0&&typeof d=="object"?d:{};if(e._asyncDataPromises[t]&&me(n.dedupe??i.dedupe))return e._asyncDataPromises[t];if(n.cause==="initial"||e.isHydrating){const D="cachedData"in n?n.cachedData:i.getCachedData(t,e,{cause:n.cause??"refresh:manual"});if(D!=null)return e.payload.data[t]=l.data.value=D,l.error.value=C.errorValue,l.status.value="success",Promise.resolve(D)}l.pending.value=!0,l._abortController&&l._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),l._abortController=new AbortController,l.status.value="pending";const c=new AbortController,x=new Promise((D,M)=>{try{const E=n.timeout??i.timeout,y=ge([l._abortController?.signal,n?.signal],c.signal,E);if(y.aborted){const f=y.reason;M(f instanceof Error?f:new DOMException(String(f??"Aborted"),"AbortError"));return}return y.addEventListener("abort",()=>{const f=y.reason;M(f instanceof Error?f:new DOMException(String(f??"Aborted"),"AbortError"))},{once:!0,signal:c.signal}),Promise.resolve(s(e,{signal:y})).then(D,M)}catch(E){M(E)}}).then(async D=>{let M=D;i.transform&&(M=await i.transform(D)),i.pick&&(M=pe(M,i.pick)),e.payload.data[t]=M,l.data.value=M,l.error.value=C.errorValue,l.status.value="success"}).catch(D=>{if(e._asyncDataPromises[t]&&e._asyncDataPromises[t]!==x||l._abortController?.signal.aborted)return e._asyncDataPromises[t];if(typeof DOMException<"u"&&D instanceof DOMException&&D.name==="AbortError")return l.status.value="idle",e._asyncDataPromises[t];l.error.value=te(D),l.data.value=ae(i.default()),l.status.value="error"}).finally(()=>{l.pending.value=!1,c.abort(),delete e._asyncDataPromises[t]});return e._asyncDataPromises[t]=x,e._asyncDataPromises[t]},_execute:de((...u)=>l.execute(...u),0,{leading:!0}),_default:i.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{v(),e._asyncData[t]?._init&&(e._asyncData[t]._init=!1),p||ee(()=>{e._asyncData[t]?._init||(z(e,t),l.execute=()=>Promise.resolve(),l.data.value=C.value)})}};return l}const he=()=>C.value,U=(e,t,o)=>{if(t.isHydrating)return t.payload.data[e];if(o.cause!=="refresh:manual"&&o.cause!=="refresh:hook")return t.static.data[e]};function ge(e,t,o){const i=e.filter(s=>!!s);if(typeof o=="number"&&o>=0){const s=AbortSignal.timeout?.(o);s&&i.push(s)}if(AbortSignal.any)return AbortSignal.any(i);const r=new AbortController;for(const s of i)if(s.aborted){const a=s.reason??new DOMException("Aborted","AbortError");try{r.abort(a)}catch{r.abort()}return r.signal}const p=()=>{const a=i.find(m=>m.aborted)?.reason??new DOMException("Aborted","AbortError");try{r.abort(a)}catch{r.abort()}};for(const s of i)s.addEventListener?.("abort",p,{once:!0,signal:t});return r.signal}const F="claude",w="sonnet",ve=[{value:"sonnet",label:"Sonnet",description:"Balanced performance and cost"},{value:"opus",label:"Opus",description:"Most capable, higher cost"},{value:"haiku",label:"Haiku",description:"Fast and cost-effective"}];function _e(e){if(!e)return{};const t={},o=typeof e.claudeModel=="string"&&ve.some(r=>r.value===e.claudeModel)?e.claudeModel:void 0;typeof e.providerId=="string"?(t.providerId=e.providerId,typeof e.providerModelKey=="string"&&e.providerModelKey.length>0?t.providerModelKey=e.providerModelKey:o?t.providerModelKey=o:t.providerModelKey=w):o&&(t.providerId="claude",t.providerModelKey=o),(e.theme==="dark"||e.theme==="light")&&(t.theme=e.theme);const i=e.permissionMode;return i&&["plan","ask","auto","bypass"].includes(String(i))&&(t.permissionMode=i),typeof e.autoGenerateCommitMessages=="boolean"&&(t.autoGenerateCommitMessages=e.autoGenerateCommitMessages),t}const be=oe("settings",{state:()=>({providerId:F,providerModelKey:w,theme:"dark",permissionMode:"ask",autoGenerateCommitMessages:!1,_hydrated:!1}),getters:{providerSelection:e=>({providerId:e.providerId,modelKey:e.providerModelKey})},actions:{async hydrate(){if(!this._hydrated)try{const e=await $fetch("/api/settings"),t=_e(e);t.providerId!==void 0&&(this.providerId=t.providerId),t.providerModelKey!==void 0&&(this.providerModelKey=t.providerModelKey),t.theme!==void 0&&(this.theme=t.theme),t.permissionMode!==void 0&&(this.permissionMode=t.permissionMode),t.autoGenerateCommitMessages!==void 0&&(this.autoGenerateCommitMessages=t.autoGenerateCommitMessages),this._hydrated=!0}catch(e){console.error("Failed to load settings:",e)}},setTheme(e){this.theme=e,this._saveToServer()},setProviderSelection(e){this.providerId=e.providerId,this.providerModelKey=typeof e.modelKey=="string"&&e.modelKey.length>0?e.modelKey:w,this._saveToServer(!0)},setPermissionMode(e){this.permissionMode=e,this._saveToServer()},setAutoGenerateCommitMessages(e){this.autoGenerateCommitMessages=e,this._saveToServer()},resetToDefaults(){this.providerId=F,this.providerModelKey=w,this.theme="dark",this.permissionMode="ask",this.autoGenerateCommitMessages=!1,this._saveToServer()},_saveToServer(e=!1){const t={providerId:this.providerId,providerModelKey:this.providerModelKey,claudeModel:this.providerId==="claude"?this.providerModelKey:void 0,theme:this.theme,permissionMode:this.permissionMode,autoGenerateCommitMessages:this.autoGenerateCommitMessages};$fetch("/api/settings",{method:"POST",body:t}).then(o=>{if(!e||!o?.settings)return;const i=o.settings.providerId,r=o.settings.providerModelKey;typeof i=="string"&&(this.providerId=i),typeof r=="string"&&r.length>0&&(this.providerModelKey=r)}).catch(o=>{console.error("Failed to save settings:",o)})}}}),Xe=Object.freeze(Object.defineProperty({__proto__:null,useSettingsStore:be},Symbol.toStringTag,{value:"Module"})),A=H([]);function De(){const e=(s,a="info",m=3e3)=>{const v=`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`,l={id:v,message:s,type:a,duration:m};return A.value.push(l),m>0&&setTimeout(()=>{t(v)},m),v},t=s=>{const a=A.value.findIndex(m=>m.id===s);a!==-1&&A.value.splice(a,1)},o=(s,a)=>e(s,"success",a),i=(s,a)=>e(s,"error",a),r=(s,a)=>e(s,"info",a),p=(s,a)=>e(s,"warning",a);return{toasts:ne(A),add:e,remove:t,success:o,error:i,info:r,warning:p}}const Ye=Object.freeze(Object.defineProperty({__proto__:null,useToast:De},Symbol.toStringTag,{value:"Module"}));function Ze(){return`blk-${Date.now()}-${Math.random().toString(36).substring(2,6)}`}function Je(e){return Array.isArray(e.contentBlocks)&&e.contentBlocks.length>0}const Me={plan:"Plan Mode",ask:"Ask Before",auto:"Auto Edit",bypass:"Bypass"},Qe={plan:"The assistant will create a plan before making changes",ask:"The assistant will ask before each action",auto:"The assistant can read and edit files automatically",bypass:"Skip all permission checks (dangerous)"},et=300,tt=600,at=400;function st(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}const rt=2,ot=100,nt=80;function it(){return`conv-${Math.random().toString(36).slice(2,12)}`}function lt(e){const o=e.trim().replace(/\n/g," ");return o.length<=50?o:o.slice(0,50).trim()+"..."}function ct(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.cwd=="string"}function dt(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.sourceConversationId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.archivedAt=="string"&&typeof t.cwd=="string"}const Ce={class:"space-y-3"},Se={key:0,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},xe={key:1,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},Ee={class:"text-xs font-mono text-retro-yellow"},Ie={key:2,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},Pe={key:3,class:"space-y-4"},Te={key:0,class:"text-xs font-mono text-retro-muted"},Oe={key:1,class:"text-xs font-mono text-retro-muted"},ke={class:"flex flex-col gap-2"},Ae={class:"flex flex-col gap-2"},we={class:"flex items-start justify-between gap-3"},Ne={class:"text-sm font-mono text-retro-text"},Le={key:0,class:"text-xs font-mono text-retro-yellow"},Be={key:1,class:"text-xs font-mono text-retro-yellow"},Re={class:"text-xs text-retro-muted leading-tight"},Ge={class:"flex flex-wrap gap-2"},Ve={key:0,class:"text-xs font-mono text-retro-yellow"},Ke={class:"space-y-1.5"},$e=["value","checked","disabled","onChange"],Fe={class:"flex-1 space-y-0.5"},He={class:"flex items-center gap-2"},ze={class:"text-sm font-mono text-retro-text"},Ue={key:0,class:"text-[0.55rem] font-mono uppercase tracking-[0.25em] text-retro-cyan border border-retro-cyan rounded-full px-2 py-0.5"},We={class:"text-xs text-retro-muted leading-tight"},ut=ie({__name:"ProviderSelector",props:{providers:{},selected:{},permissionMode:{},pending:{type:Boolean},errorMessage:{}},emits:["select"],setup(e,{emit:t}){const o=e,i=t,r=[{key:"streaming",label:"Streaming"},{key:"permissions",label:"Permissions"},{key:"resume",label:"Session Resume"},{key:"autoCommit",label:"Auto Commit"}],p=P(()=>o.permissionMode==="ask"||o.permissionMode==="plan"),s=P(()=>Me[o.permissionMode]),a=P(()=>!0);function m(d){const h=!p.value||d.capabilities.permissions,n=!a.value||d.capabilities.streaming;return h&&n}function v(d){return p.value&&!d.capabilities.permissions?`${d.name} cannot be used with ${s.value} because it does not expose permission prompts.`:a.value&&!d.capabilities.streaming?`${d.name} is unavailable because streaming runtime prerequisites are not satisfied.`:null}function l(d,h){m(d)&&i("select",{providerId:d.id,modelKey:h})}function u(d,h){return o.selected.providerId===d&&o.selected.modelKey===h}return(d,h)=>(_(),b("div",Ce,[e.pending?(_(),b("div",Se,[...h[0]||(h[0]=[g("p",{class:"text-xs font-mono text-retro-text"},"Loading providers…",-1)])])):e.errorMessage?(_(),b("div",xe,[g("p",Ee,"Unable to load providers: "+S(e.errorMessage),1)])):e.providers.length===0?(_(),b("div",Ie,[...h[1]||(h[1]=[g("p",{class:"text-xs font-mono text-retro-muted"},"No AI providers are configured on the server. Check with your administrator.",-1)])])):(_(),b("div",Pe,[p.value?(_(),b("p",Te," Permission mode "+S(s.value)+" requires a provider that supports permission prompts. Incompatible providers are disabled. ",1)):I("",!0),a.value?(_(),b("p",Oe," Chat currently requires a provider with streaming support. Providers without streaming are shown for preparation but disabled. ")):I("",!0),(_(!0),b(L,null,B(e.providers,n=>(_(),b("article",{key:n.id,class:O(["rounded border border-retro-border bg-retro-panel p-4 space-y-3 transition",{"border-retro-cyan bg-retro-cyan/5":e.selected.providerId===n.id,"hover:border-retro-muted":e.selected.providerId!==n.id}])},[g("div",ke,[g("div",Ae,[g("div",we,[g("span",Ne,S(n.name),1),p.value&&!n.capabilities.permissions?(_(),b("div",Le," Permissions missing ")):a.value&&!n.capabilities.streaming?(_(),b("div",Be," Streaming missing ")):I("",!0)]),g("p",Re,S(n.description),1),g("div",Ge,[(_(),b(L,null,B(r,c=>g("span",{key:c.key,class:O(["inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[0.6rem] font-mono uppercase tracking-[0.18em]",n.capabilities[c.key]?"border-retro-cyan/70 text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted bg-retro-dark/60"])},[g("span",{class:O(["h-1.5 w-1.5 rounded-full",n.capabilities[c.key]?"bg-retro-cyan":"bg-retro-muted"])},null,2),le(" "+S(c.label),1)],2)),64))])])]),v(n)?(_(),b("p",Ve,S(v(n)),1)):I("",!0),g("div",Ke,[(_(!0),b(L,null,B(n.models,c=>(_(),b("label",{key:c.key,class:O(["flex items-start gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[u(n.id,c.key)?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted",m(n)?"":"opacity-60 cursor-not-allowed"]])},[g("input",{type:"radio",name:"provider-model",value:`${n.id}:${c.key}`,checked:u(n.id,c.key),disabled:!m(n),class:"mt-1 h-3.5 w-3.5 text-retro-cyan accent-retro-cyan",onChange:x=>l(n,c.key)},null,40,$e),g("div",Fe,[g("div",He,[g("span",ze,S(c.label),1),c.default?(_(),b("span",Ue," Default ")):I("",!0)]),g("p",We,S(c.description),1)])],2))),128))])],2))),128))]))]))}});export{w as D,ot as M,at as P,rt as S,nt as W,ut as _,qe as a,De as b,dt as c,et as d,tt as e,it as f,st as g,F as h,ct as i,lt as j,Ze as k,Je as l,Me as m,Qe as n,Ye as o,Xe as s,be as u};
|
|
1
|
+
import{a as j,aa as C,ab as q,X,ac as Y,K as V,ad as Z,k as P,ae as J,af as Q,g as H,s as N,Z as ee,ag as te,G as ae,ah as se,ai as re,aj as K,I as oe,a0 as ne,d as ie,y as _,z as b,A as g,B as S,O as I,S as L,U as B,H as O,E as le}from"./Dr-08407.js";const ce={trailing:!0};function de(e,t=25,o={}){if(o={...ce,...o},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let i,r,p=[],s,a;const m=(u,d)=>(s=ue(e,u,d),s.finally(()=>{if(s=null,o.trailing&&a&&!r){const h=m(u,a);return a=null,h}}),s),v=function(...u){return o.trailing&&(a=u),s||new Promise(d=>{const h=!r&&o.leading;clearTimeout(r),r=setTimeout(()=>{r=null;const n=o.leading?i:m(this,u);a=null;for(const c of p)c(n);p=[]},t),h?(i=m(this,u),d(i)):p.push(d)})},l=u=>{u&&(clearTimeout(u),r=null)};return v.isPending=()=>!!r,v.cancel=()=>{l(r),p=[],a=null},v.flush=()=>{if(l(r),!a||s)return;const u=a;return a=null,m(this,u)},v}async function ue(e,t,o){return await e.apply(t,o)}const fe=Symbol.for("nuxt:client-only"),me=e=>e==="defer"||e===!1;function qe(...e){const t=typeof e[e.length-1]=="string"?e.pop():void 0;ye(e[0],e[1])&&e.unshift(t);let[o,i,r={}]=e,p=!1;const s=P(()=>re(o));if(typeof s.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof i!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const a=j();r.server??=!0,r.default??=he,r.getCachedData??=U,r.lazy??=!1,r.immediate??=!0,r.deep??=C.deep,r.dedupe??="cancel",r._functionName,a._asyncData[s.value];function m(){const n={cause:"initial",dedupe:r.dedupe};return a._asyncData[s.value]?._init||(n.cachedData=r.getCachedData(s.value,a,{cause:"initial"}),a._asyncData[s.value]=$(a,s.value,i,r,n.cachedData)),()=>a._asyncData[s.value].execute(n)}const v=m(),l=a._asyncData[s.value];l._deps++;const u=r.server!==!1&&a.payload.serverRendered;{let n=function(y){const f=a._asyncData[y];f?._deps&&(f._deps--,f._deps===0&&f?._off())};const c=J();if(c&&u&&r.immediate&&!c.sp&&(c.sp=[]),c&&!c._nuxtOnBeforeMountCbs){c._nuxtOnBeforeMountCbs=[];const y=c._nuxtOnBeforeMountCbs;q(()=>{y.forEach(f=>{f()}),y.splice(0,y.length)}),X(()=>y.splice(0,y.length))}const x=c&&(c._nuxtClientOnly||Y(fe,!1));u&&a.isHydrating&&(l.error.value||l.data.value!=null)?(l.pending.value=!1,l.status.value=l.error.value?"error":"success"):c&&(!x&&a.payload.serverRendered&&a.isHydrating||r.lazy)&&r.immediate?c._nuxtOnBeforeMountCbs.push(v):r.immediate&&v();const D=Q(),M=V(s,(y,f)=>{if((y||f)&&y!==f){p=!0;const R=a._asyncData[f]?.data.value!==C.value,W=a._asyncDataPromises[f]!==void 0,G={cause:"initial",dedupe:r.dedupe};if(!a._asyncData[y]?._init){let T;f&&R?T=a._asyncData[f].data.value:(T=r.getCachedData(y,a,{cause:"initial"}),G.cachedData=T),a._asyncData[y]=$(a,y,i,r,T)}a._asyncData[y]._deps++,f&&n(f),(r.immediate||R||W)&&a._asyncData[y].execute(G),K(()=>{p=!1})}},{flush:"sync"}),E=r.watch?V(r.watch,()=>{p||(a._asyncData[s.value]?._execute.isPending()&&K(()=>{a._asyncData[s.value]?._execute.flush()}),a._asyncData[s.value]?._execute({cause:"watch",dedupe:r.dedupe}))}):()=>{};D&&Z(()=>{M(),E(),n(s.value)})}const d={data:k(()=>a._asyncData[s.value]?.data),pending:k(()=>a._asyncData[s.value]?.pending),status:k(()=>a._asyncData[s.value]?.status),error:k(()=>a._asyncData[s.value]?.error),refresh:(...n)=>a._asyncData[s.value]?._init?a._asyncData[s.value].execute(...n):m()(),execute:(...n)=>d.refresh(...n),clear:()=>{const n=a._asyncData[s.value];if(n?._abortController)try{n._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{n._abortController=void 0}z(a,s.value)}},h=Promise.resolve(a._asyncDataPromises[s.value]).then(()=>d);return Object.assign(h,d),h}function k(e){return P({get(){return e()?.value},set(t){const o=e();o&&(o.value=t)}})}function ye(e,t){return!(typeof e=="string"||typeof e=="object"&&e!==null||typeof e=="function"&&typeof t=="function")}function z(e,t){t in e.payload.data&&(e.payload.data[t]=void 0),t in e.payload._errors&&(e.payload._errors[t]=C.errorValue),e._asyncData[t]&&(e._asyncData[t].data.value=void 0,e._asyncData[t].error.value=C.errorValue,e._asyncData[t].pending.value=!1,e._asyncData[t].status.value="idle"),t in e._asyncDataPromises&&(e._asyncDataPromises[t]=void 0)}function pe(e,t){const o={};for(const i of t)o[i]=e[i];return o}function $(e,t,o,i,r){e.payload._errors[t]??=C.errorValue;const p=i.getCachedData!==U,s=o,a=i.deep?H:N,m=r!=null,v=e.hook("app:data:refresh",async u=>{(!u||u.includes(t))&&await l.execute({cause:"refresh:hook"})}),l={data:a(m?r:i.default()),pending:N(!m),error:se(e.payload._errors,t),status:N("idle"),execute:(...u)=>{const[d,h=void 0]=u,n=d&&h===void 0&&typeof d=="object"?d:{};if(e._asyncDataPromises[t]&&me(n.dedupe??i.dedupe))return e._asyncDataPromises[t];if(n.cause==="initial"||e.isHydrating){const D="cachedData"in n?n.cachedData:i.getCachedData(t,e,{cause:n.cause??"refresh:manual"});if(D!=null)return e.payload.data[t]=l.data.value=D,l.error.value=C.errorValue,l.status.value="success",Promise.resolve(D)}l.pending.value=!0,l._abortController&&l._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),l._abortController=new AbortController,l.status.value="pending";const c=new AbortController,x=new Promise((D,M)=>{try{const E=n.timeout??i.timeout,y=ge([l._abortController?.signal,n?.signal],c.signal,E);if(y.aborted){const f=y.reason;M(f instanceof Error?f:new DOMException(String(f??"Aborted"),"AbortError"));return}return y.addEventListener("abort",()=>{const f=y.reason;M(f instanceof Error?f:new DOMException(String(f??"Aborted"),"AbortError"))},{once:!0,signal:c.signal}),Promise.resolve(s(e,{signal:y})).then(D,M)}catch(E){M(E)}}).then(async D=>{let M=D;i.transform&&(M=await i.transform(D)),i.pick&&(M=pe(M,i.pick)),e.payload.data[t]=M,l.data.value=M,l.error.value=C.errorValue,l.status.value="success"}).catch(D=>{if(e._asyncDataPromises[t]&&e._asyncDataPromises[t]!==x||l._abortController?.signal.aborted)return e._asyncDataPromises[t];if(typeof DOMException<"u"&&D instanceof DOMException&&D.name==="AbortError")return l.status.value="idle",e._asyncDataPromises[t];l.error.value=te(D),l.data.value=ae(i.default()),l.status.value="error"}).finally(()=>{l.pending.value=!1,c.abort(),delete e._asyncDataPromises[t]});return e._asyncDataPromises[t]=x,e._asyncDataPromises[t]},_execute:de((...u)=>l.execute(...u),0,{leading:!0}),_default:i.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{v(),e._asyncData[t]?._init&&(e._asyncData[t]._init=!1),p||ee(()=>{e._asyncData[t]?._init||(z(e,t),l.execute=()=>Promise.resolve(),l.data.value=C.value)})}};return l}const he=()=>C.value,U=(e,t,o)=>{if(t.isHydrating)return t.payload.data[e];if(o.cause!=="refresh:manual"&&o.cause!=="refresh:hook")return t.static.data[e]};function ge(e,t,o){const i=e.filter(s=>!!s);if(typeof o=="number"&&o>=0){const s=AbortSignal.timeout?.(o);s&&i.push(s)}if(AbortSignal.any)return AbortSignal.any(i);const r=new AbortController;for(const s of i)if(s.aborted){const a=s.reason??new DOMException("Aborted","AbortError");try{r.abort(a)}catch{r.abort()}return r.signal}const p=()=>{const a=i.find(m=>m.aborted)?.reason??new DOMException("Aborted","AbortError");try{r.abort(a)}catch{r.abort()}};for(const s of i)s.addEventListener?.("abort",p,{once:!0,signal:t});return r.signal}const F="claude",w="sonnet",ve=[{value:"sonnet",label:"Sonnet",description:"Balanced performance and cost"},{value:"opus",label:"Opus",description:"Most capable, higher cost"},{value:"haiku",label:"Haiku",description:"Fast and cost-effective"}];function _e(e){if(!e)return{};const t={},o=typeof e.claudeModel=="string"&&ve.some(r=>r.value===e.claudeModel)?e.claudeModel:void 0;typeof e.providerId=="string"?(t.providerId=e.providerId,typeof e.providerModelKey=="string"&&e.providerModelKey.length>0?t.providerModelKey=e.providerModelKey:o?t.providerModelKey=o:t.providerModelKey=w):o&&(t.providerId="claude",t.providerModelKey=o),(e.theme==="dark"||e.theme==="light")&&(t.theme=e.theme);const i=e.permissionMode;return i&&["plan","ask","auto","bypass"].includes(String(i))&&(t.permissionMode=i),typeof e.autoGenerateCommitMessages=="boolean"&&(t.autoGenerateCommitMessages=e.autoGenerateCommitMessages),t}const be=oe("settings",{state:()=>({providerId:F,providerModelKey:w,theme:"dark",permissionMode:"ask",autoGenerateCommitMessages:!1,_hydrated:!1}),getters:{providerSelection:e=>({providerId:e.providerId,modelKey:e.providerModelKey})},actions:{async hydrate(){if(!this._hydrated)try{const e=await $fetch("/api/settings"),t=_e(e);t.providerId!==void 0&&(this.providerId=t.providerId),t.providerModelKey!==void 0&&(this.providerModelKey=t.providerModelKey),t.theme!==void 0&&(this.theme=t.theme),t.permissionMode!==void 0&&(this.permissionMode=t.permissionMode),t.autoGenerateCommitMessages!==void 0&&(this.autoGenerateCommitMessages=t.autoGenerateCommitMessages),this._hydrated=!0}catch(e){console.error("Failed to load settings:",e)}},setTheme(e){this.theme=e,this._saveToServer()},setProviderSelection(e){this.providerId=e.providerId,this.providerModelKey=typeof e.modelKey=="string"&&e.modelKey.length>0?e.modelKey:w,this._saveToServer(!0)},setPermissionMode(e){this.permissionMode=e,this._saveToServer()},setAutoGenerateCommitMessages(e){this.autoGenerateCommitMessages=e,this._saveToServer()},resetToDefaults(){this.providerId=F,this.providerModelKey=w,this.theme="dark",this.permissionMode="ask",this.autoGenerateCommitMessages=!1,this._saveToServer()},_saveToServer(e=!1){const t={providerId:this.providerId,providerModelKey:this.providerModelKey,claudeModel:this.providerId==="claude"?this.providerModelKey:void 0,theme:this.theme,permissionMode:this.permissionMode,autoGenerateCommitMessages:this.autoGenerateCommitMessages};$fetch("/api/settings",{method:"POST",body:t}).then(o=>{if(!e||!o?.settings)return;const i=o.settings.providerId,r=o.settings.providerModelKey;typeof i=="string"&&(this.providerId=i),typeof r=="string"&&r.length>0&&(this.providerModelKey=r)}).catch(o=>{console.error("Failed to save settings:",o)})}}}),Xe=Object.freeze(Object.defineProperty({__proto__:null,useSettingsStore:be},Symbol.toStringTag,{value:"Module"})),A=H([]);function De(){const e=(s,a="info",m=3e3)=>{const v=`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`,l={id:v,message:s,type:a,duration:m};return A.value.push(l),m>0&&setTimeout(()=>{t(v)},m),v},t=s=>{const a=A.value.findIndex(m=>m.id===s);a!==-1&&A.value.splice(a,1)},o=(s,a)=>e(s,"success",a),i=(s,a)=>e(s,"error",a),r=(s,a)=>e(s,"info",a),p=(s,a)=>e(s,"warning",a);return{toasts:ne(A),add:e,remove:t,success:o,error:i,info:r,warning:p}}const Ye=Object.freeze(Object.defineProperty({__proto__:null,useToast:De},Symbol.toStringTag,{value:"Module"}));function Ze(){return`blk-${Date.now()}-${Math.random().toString(36).substring(2,6)}`}function Je(e){return Array.isArray(e.contentBlocks)&&e.contentBlocks.length>0}const Me={plan:"Plan Mode",ask:"Ask Before",auto:"Auto Edit",bypass:"Bypass"},Qe={plan:"The assistant will create a plan before making changes",ask:"The assistant will ask before each action",auto:"The assistant can read and edit files automatically",bypass:"Skip all permission checks (dangerous)"},et=300,tt=600,at=400;function st(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}const rt=2,ot=100,nt=80;function it(){return`conv-${Math.random().toString(36).slice(2,12)}`}function lt(e){const o=e.trim().replace(/\n/g," ");return o.length<=50?o:o.slice(0,50).trim()+"..."}function ct(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.cwd=="string"}function dt(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.sourceConversationId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.archivedAt=="string"&&typeof t.cwd=="string"}const Ce={class:"space-y-3"},Se={key:0,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},xe={key:1,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},Ee={class:"text-xs font-mono text-retro-yellow"},Ie={key:2,class:"rounded border border-retro-border bg-retro-panel px-4 py-3"},Pe={key:3,class:"space-y-4"},Te={key:0,class:"text-xs font-mono text-retro-muted"},Oe={key:1,class:"text-xs font-mono text-retro-muted"},ke={class:"flex flex-col gap-2"},Ae={class:"flex flex-col gap-2"},we={class:"flex items-start justify-between gap-3"},Ne={class:"text-sm font-mono text-retro-text"},Le={key:0,class:"text-xs font-mono text-retro-yellow"},Be={key:1,class:"text-xs font-mono text-retro-yellow"},Re={class:"text-xs text-retro-muted leading-tight"},Ge={class:"flex flex-wrap gap-2"},Ve={key:0,class:"text-xs font-mono text-retro-yellow"},Ke={class:"space-y-1.5"},$e=["value","checked","disabled","onChange"],Fe={class:"flex-1 space-y-0.5"},He={class:"flex items-center gap-2"},ze={class:"text-sm font-mono text-retro-text"},Ue={key:0,class:"text-[0.55rem] font-mono uppercase tracking-[0.25em] text-retro-cyan border border-retro-cyan rounded-full px-2 py-0.5"},We={class:"text-xs text-retro-muted leading-tight"},ut=ie({__name:"ProviderSelector",props:{providers:{},selected:{},permissionMode:{},pending:{type:Boolean},errorMessage:{}},emits:["select"],setup(e,{emit:t}){const o=e,i=t,r=[{key:"streaming",label:"Streaming"},{key:"permissions",label:"Permissions"},{key:"resume",label:"Session Resume"},{key:"autoCommit",label:"Auto Commit"}],p=P(()=>o.permissionMode==="ask"||o.permissionMode==="plan"),s=P(()=>Me[o.permissionMode]),a=P(()=>!0);function m(d){const h=!p.value||d.capabilities.permissions,n=!a.value||d.capabilities.streaming;return h&&n}function v(d){return p.value&&!d.capabilities.permissions?`${d.name} cannot be used with ${s.value} because it does not expose permission prompts.`:a.value&&!d.capabilities.streaming?`${d.name} is unavailable because streaming runtime prerequisites are not satisfied.`:null}function l(d,h){m(d)&&i("select",{providerId:d.id,modelKey:h})}function u(d,h){return o.selected.providerId===d&&o.selected.modelKey===h}return(d,h)=>(_(),b("div",Ce,[e.pending?(_(),b("div",Se,[...h[0]||(h[0]=[g("p",{class:"text-xs font-mono text-retro-text"},"Loading providers…",-1)])])):e.errorMessage?(_(),b("div",xe,[g("p",Ee,"Unable to load providers: "+S(e.errorMessage),1)])):e.providers.length===0?(_(),b("div",Ie,[...h[1]||(h[1]=[g("p",{class:"text-xs font-mono text-retro-muted"},"No AI providers are configured on the server. Check with your administrator.",-1)])])):(_(),b("div",Pe,[p.value?(_(),b("p",Te," Permission mode "+S(s.value)+" requires a provider that supports permission prompts. Incompatible providers are disabled. ",1)):I("",!0),a.value?(_(),b("p",Oe," Chat currently requires a provider with streaming support. Providers without streaming are shown for preparation but disabled. ")):I("",!0),(_(!0),b(L,null,B(e.providers,n=>(_(),b("article",{key:n.id,class:O(["rounded border border-retro-border bg-retro-panel p-4 space-y-3 transition",{"border-retro-cyan bg-retro-cyan/5":e.selected.providerId===n.id,"hover:border-retro-muted":e.selected.providerId!==n.id}])},[g("div",ke,[g("div",Ae,[g("div",we,[g("span",Ne,S(n.name),1),p.value&&!n.capabilities.permissions?(_(),b("div",Le," Permissions missing ")):a.value&&!n.capabilities.streaming?(_(),b("div",Be," Streaming missing ")):I("",!0)]),g("p",Re,S(n.description),1),g("div",Ge,[(_(),b(L,null,B(r,c=>g("span",{key:c.key,class:O(["inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[0.6rem] font-mono uppercase tracking-[0.18em]",n.capabilities[c.key]?"border-retro-cyan/70 text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted bg-retro-dark/60"])},[g("span",{class:O(["h-1.5 w-1.5 rounded-full",n.capabilities[c.key]?"bg-retro-cyan":"bg-retro-muted"])},null,2),le(" "+S(c.label),1)],2)),64))])])]),v(n)?(_(),b("p",Ve,S(v(n)),1)):I("",!0),g("div",Ke,[(_(!0),b(L,null,B(n.models,c=>(_(),b("label",{key:c.key,class:O(["flex items-start gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[u(n.id,c.key)?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted",m(n)?"":"opacity-60 cursor-not-allowed"]])},[g("input",{type:"radio",name:"provider-model",value:`${n.id}:${c.key}`,checked:u(n.id,c.key),disabled:!m(n),class:"mt-1 h-3.5 w-3.5 text-retro-cyan accent-retro-cyan",onChange:x=>l(n,c.key)},null,40,$e),g("div",Fe,[g("div",He,[g("span",ze,S(c.label),1),c.default?(_(),b("span",Ue," Default ")):I("",!0)]),g("p",We,S(c.description),1)])],2))),128))])],2))),128))]))]))}});export{w as D,ot as M,at as P,rt as S,nt as W,ut as _,qe as a,De as b,dt as c,et as d,tt as e,it as f,st as g,F as h,ct as i,lt as j,Ze as k,Je as l,Me as m,Qe as n,Ye as o,Xe as s,be as u};
|