@xano/xanoscript-monaco-editor 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +181 -0
- package/dist/.vite/manifest.json +300 -0
- package/dist/assets/_.contribution-BThlLkzn.js +1 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/codicon-MLkmQ__h.ttf +0 -0
- package/dist/assets/dark_modern-0rclP-7t.json +1 -0
- package/dist/assets/dark_vs-BL-mUvcK.json +1 -0
- package/dist/assets/editor-BivTGeL1.js +1 -0
- package/dist/assets/editor.worker-BF3gnKDz.js +28 -0
- package/dist/assets/extensionHost.worker-bYZXB0kM.js +144 -0
- package/dist/assets/fake-DXkbmQ09.html +10 -0
- package/dist/assets/files.contribution._fileEditorFactory-vS4ZLYi1.js +4 -0
- package/dist/assets/hc_black-BX9MT4w9.json +1 -0
- package/dist/assets/hc_light-Bzw0ew6e.json +1 -0
- package/dist/assets/iconv-lite-umd-DQaTktu2.js +11 -0
- package/dist/assets/iconv-lite-umd-DYWd8cEa.js +11 -0
- package/dist/assets/index-51WpeTZl.js +11 -0
- package/dist/assets/index-B0wc3Rza.css +1 -0
- package/dist/assets/index-B132pG6E.js +11 -0
- package/dist/assets/index-BGwiFEyd.js +1 -0
- package/dist/assets/index-BPOe4Pu5.css +1 -0
- package/dist/assets/index-BwfWF2CI.js +1433 -0
- package/dist/assets/index-C25FTAfE.js +15 -0
- package/dist/assets/index-C3pnKX8a.js +1 -0
- package/dist/assets/index-CEhqlLL9.css +1 -0
- package/dist/assets/index-Cg3XqiaZ.html +1284 -0
- package/dist/assets/index-CrbRjSB_.js +1 -0
- package/dist/assets/index-D1zNXs16.css +1 -0
- package/dist/assets/index-DgK2LcnW.js +2 -0
- package/dist/assets/index-VRHnXpb2.js +18 -0
- package/dist/assets/index-no-csp-DMfG5HRS.html +1251 -0
- package/dist/assets/index-yPQeQvu7.js +1 -0
- package/dist/assets/layout.contribution.darwin-gdaUfoJf.js +1 -0
- package/dist/assets/layout.contribution.linux-xMjRz7iy.js +1 -0
- package/dist/assets/layout.contribution.win-DZRWibbm.js +1 -0
- package/dist/assets/light_modern-Bbk8M7yq.json +1 -0
- package/dist/assets/light_vs-DwwM7VRG.json +1 -0
- package/dist/assets/main-D6ceXGB_.js +4 -0
- package/dist/assets/main-DNugpDp4.js +4 -0
- package/dist/assets/main-FP17jmvp.js +1 -0
- package/dist/assets/main-b5eBH2vx.js +1 -0
- package/dist/assets/onig-Du5pRr7Y.wasm +0 -0
- package/dist/assets/service-worker-Ce0epi43.js +371 -0
- package/dist/assets/tokenClassificationRegistry-DcBtqg2t.js +2 -0
- package/dist/assets/views-C4cPu3oQ.css +1 -0
- package/dist/assets/views-hUfpm9tT.js +55 -0
- package/dist/assets/webWorkerExtensionHostIframe-636UTAtK.html +156 -0
- package/dist/assets/workbenchThemeService.service-qBFVnuYD.js +1 -0
- package/dist/assets/worker-BIMDXoFp.js +8 -0
- package/dist/index.html +14 -0
- package/dist/logic-assistant-script.js +21798 -0
- package/dist/logic-assistant-script.js.map +7 -0
- package/dist/worker.js +32433 -0
- package/dist/worker.js.map +7 -0
- package/package.json +46 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{aq as O,ar as _e,N as z,as as nt,at as ot,au as wn,av as xn,aw as vn,ax as Dn,ay as An,az as On,aA as Mn,aB as Pn,aC as Ln,aD as Hn,aE as Fn,aF as Nn,aG as $n,aH as oe,J as Ne,aI as it,aJ as ge,aK as ut,aL as k,aM as H,aN as Bn,aO as ft,ah as j,aP as on,aQ as jn,aR as mt,q as r,aS as gt,aT as pt,x as ne,aU as Ge,aV as Tt,aW as st,aX as Ue,aY as rt,aZ as sn,a_ as St,a$ as Ct,b0 as y,b1 as ee,b2 as Pe,b3 as ue,b4 as Dt,b5 as At,b6 as Gn,b7 as Un,b8 as Kn,b9 as It,E as we,K as Ot,p as yt,ba as zn,ak as rn,D as an,bb as Wn,bc as se,bd as K,be as qn,G as cn,bf as Vn,bg as Mt,bh as at,bi as Jn,bj as Yn,bk as Qn,bl as Ye,bm as Pt,z as Ke,u as ln,bn as Xn,bo as Zn,bp as eo,bq as Lt,d as Et,br as to,bs as no,bt as oo,bu as bt,bv as io,f as kt,g as w,bw as so,bx as ro,h as hn,m as ao,by as co,bz as lo,I as Rt,bA as ho,O as dn,bB as uo,bC as fo,i as mo,bD as go,bE as ct,bF as _t,bG as po,bH as un,Q as To,bI as wt,bJ as So,W as Ae,bK as pe,bL as Te,bM as Co,bN as Io,bO as Se,aj as Ce,bP as Ht,$ as Ft,bQ as fn,bR as Nt,bS as $t,bT as yo,bU as Eo,bV as Bt,bW as bo,j as ko,bX as Ro,bY as xt,bZ as Oe,b_ as _o,a3 as wo,b$ as xo,P as vo,al as Do,c0 as Ao}from"./index-BwfWF2CI.js";import{g as Oo,T as ze,p as jt,S as Gt,a as mn}from"./tokenClassificationRegistry-DcBtqg2t.js";import{I as le}from"./workbenchThemeService.service-qBFVnuYD.js";const Mo="[",Po="]",Le="*",Lo=/\[(.+?)\]/g;var C;(function(i){i.COLOR_THEME="workbench.colorTheme",i.FILE_ICON_THEME="workbench.iconTheme",i.PRODUCT_ICON_THEME="workbench.productIconTheme",i.COLOR_CUSTOMIZATIONS="workbench.colorCustomizations",i.TOKEN_COLOR_CUSTOMIZATIONS="editor.tokenColorCustomizations",i.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS="editor.semanticTokenColorCustomizations",i.PREFERRED_DARK_THEME="workbench.preferredDarkColorTheme",i.PREFERRED_LIGHT_THEME="workbench.preferredLightColorTheme",i.PREFERRED_HC_DARK_THEME="workbench.preferredHighContrastColorTheme",i.PREFERRED_HC_LIGHT_THEME="workbench.preferredHighContrastLightColorTheme",i.DETECT_COLOR_SCHEME="window.autoDetectColorScheme",i.DETECT_HC="window.autoDetectHighContrast",i.SYSTEM_COLOR_THEME="window.systemColorTheme"})(C||(C={}));var P;(function(i){i.COLOR_THEME_DARK="Default Dark Modern",i.COLOR_THEME_LIGHT="Default Light Modern",i.COLOR_THEME_HC_DARK="Default High Contrast",i.COLOR_THEME_HC_LIGHT="Default High Contrast Light",i.COLOR_THEME_DARK_OLD="Default Dark+",i.COLOR_THEME_LIGHT_OLD="Default Light+",i.FILE_ICON_THEME="vs-seti",i.PRODUCT_ICON_THEME="Default"})(P||(P={}));const Ho={"activityBar.activeBorder":"#0078d4","activityBar.background":"#181818","activityBar.border":"#2b2b2b","activityBar.foreground":"#d7d7d7","activityBar.inactiveForeground":"#868686","editorGroup.border":"#ffffff17","editorGroupHeader.tabsBackground":"#181818","editorGroupHeader.tabsBorder":"#2b2b2b","statusBar.background":"#181818","statusBar.border":"#2b2b2b","statusBar.foreground":"#cccccc","statusBar.noFolderBackground":"#1f1f1f","tab.activeBackground":"#1f1f1f","tab.activeBorder":"#1f1f1f","tab.activeBorderTop":"#0078d4","tab.activeForeground":"#ffffff","tab.border":"#2b2b2b","textLink.foreground":"#4daafc","titleBar.activeBackground":"#181818","titleBar.activeForeground":"#cccccc","titleBar.border":"#2b2b2b","titleBar.inactiveBackground":"#1f1f1f","titleBar.inactiveForeground":"#9d9d9d","welcomePage.tileBackground":"#2b2b2b"},Fo={"activityBar.activeBorder":"#005FB8","activityBar.background":"#f8f8f8","activityBar.border":"#e5e5e5","activityBar.foreground":"#1f1f1f","activityBar.inactiveForeground":"#616161","editorGroup.border":"#e5e5e5","editorGroupHeader.tabsBackground":"#f8f8f8","editorGroupHeader.tabsBorder":"#e5e5e5","statusBar.background":"#f8f8f8","statusBar.border":"#e5e5e5","statusBar.foreground":"#3b3b3b","statusBar.noFolderBackground":"#f8f8f8","tab.activeBackground":"#ffffff","tab.activeBorder":"#f8f8f8","tab.activeBorderTop":"#005fb8","tab.activeForeground":"#3b3b3b","tab.border":"#e5e5e5","textLink.foreground":"#005fb8","titleBar.activeBackground":"#f8f8f8","titleBar.activeForeground":"#1e1e1e","titleBar.border":"#E5E5E5","titleBar.inactiveBackground":"#f8f8f8","titleBar.inactiveForeground":"#8b949e","welcomePage.tileBackground":"#f3f3f3"};var G;(function(i){function e(n){return n&&{_extensionId:n.extensionId,_extensionIsBuiltin:n.extensionIsBuiltin,_extensionName:n.extensionName,_extensionPublisher:n.extensionPublisher}}i.toJSONObject=e;function t(n){if(n&&O(n._extensionId)&&_e(n._extensionIsBuiltin)&&O(n._extensionName)&&O(n._extensionPublisher))return{extensionId:n._extensionId,extensionIsBuiltin:n._extensionIsBuiltin,extensionName:n._extensionName,extensionPublisher:n._extensionPublisher}}i.fromJSONObject=t;function o(n,s,a=!1){return{extensionPublisher:n,extensionId:`${n}.${s}`,extensionName:s,extensionIsBuiltin:a}}i.fromName=o})(G||(G={}));const lt={};function M(i,e){let t=lt[i];t||(lt[i]=t=[]),t.push(e)}function gn(i,e){for(const t of i)if(e.textMateRules.push(t),!t.scope){const o=t.settings;if(!o)t.settings={};else for(const n in o){const s=n,a=lt[s];if(a){const l=o[s];if(typeof l=="string"){const c=z.fromHex(l);for(const h of a)e.colors[h]=c}}s!=="foreground"&&s!=="background"&&s!=="fontStyle"&&delete o[s]}}}M("background",nt);M("foreground",ot);M("selection",wn);M("inactiveSelection",xn);M("selectionHighlightColor",vn);M("findMatchHighlight",Dn);M("currentFindMatchHighlight",An);M("hoverHighlight",On);M("wordHighlight","editor.wordHighlightBackground");M("wordHighlightStrong","editor.wordHighlightStrongBackground");M("findRangeHighlight",Mn);M("findMatchHighlight","peekViewResult.matchHighlightBackground");M("referenceHighlight","peekViewEditor.matchHighlightBackground");M("lineHighlight",Pn);M("rangeHighlight",Ln);M("caret",Hn);M("invisibles",Fn);M("guide",Nn);M("activeGuide",$n);const No=["ansiBlack","ansiRed","ansiGreen","ansiYellow","ansiBlue","ansiMagenta","ansiCyan","ansiWhite","ansiBrightBlack","ansiBrightRed","ansiBrightGreen","ansiBrightYellow","ansiBrightBlue","ansiBrightMagenta","ansiBrightCyan","ansiBrightWhite"];for(const i of No)M(i,"terminal."+i);var N;(function(i){i[i.BOM=65279]="BOM",i[i.SPACE=32]="SPACE",i[i.TAB=9]="TAB",i[i.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",i[i.LINE_FEED=10]="LINE_FEED",i[i.SLASH=47]="SLASH",i[i.LESS_THAN=60]="LESS_THAN",i[i.QUESTION_MARK=63]="QUESTION_MARK",i[i.EXCLAMATION_MARK=33]="EXCLAMATION_MARK"})(N||(N={}));var b;(function(i){i[i.ROOT_STATE=0]="ROOT_STATE",i[i.DICT_STATE=1]="DICT_STATE",i[i.ARR_STATE=2]="ARR_STATE"})(b||(b={}));function $o(i){return Bo(i)}function Bo(i,e,t){const o=i.length;let n=0;o>0&&i.charCodeAt(0)===N.BOM&&(n=1);function s(g){n=n+g}function a(g){n=g}function l(){for(;n<o;){const g=i.charCodeAt(n);if(g!==N.SPACE&&g!==N.TAB&&g!==N.CARRIAGE_RETURN&&g!==N.LINE_FEED)break;s(1)}}function c(g){return i.substr(n,g.length)===g?(s(g.length),!0):!1}function h(g){const v=i.indexOf(g,n);a(v!==-1?v+g.length:o)}function d(g){const v=i.indexOf(g,n);if(v!==-1){const D=i.substring(n,v);return a(v+g.length),D}else{const D=i.substr(n);return a(o),D}}let f=b.ROOT_STATE,u=null;const m=[],I=[];let p=null;function T(g,v){m.push(f),I.push(u),f=g,u=v}function R(){if(m.length===0)return S("illegal state stack");f=m.pop(),u=I.pop()}function S(g){throw new Error("Near offset "+n+": "+g+" ~~~"+i.substr(n,50)+"~~~")}const E={enterDict:function(){if(p===null)return S("missing <key>");const g={};u[p]=g,p=null,T(b.DICT_STATE,g)},enterArray:function(){if(p===null)return S("missing <key>");const g=[];u[p]=g,p=null,T(b.ARR_STATE,g)}},A={enterDict:function(){const g={};u.push(g),T(b.DICT_STATE,g)},enterArray:function(){const g=[];u.push(g),T(b.ARR_STATE,g)}};function U(){f===b.DICT_STATE?E.enterDict():f===b.ARR_STATE?A.enterDict():(u={},T(b.DICT_STATE,u))}function F(){if(f===b.DICT_STATE)R();else return f===b.ARR_STATE,S("unexpected </dict>")}function ye(){f===b.DICT_STATE?E.enterArray():f===b.ARR_STATE?A.enterArray():(u=[],T(b.ARR_STATE,u))}function de(){if(f===b.DICT_STATE)return S("unexpected </array>");if(f===b.ARR_STATE)R();else return S("unexpected </array>")}function Ee(g){if(f===b.DICT_STATE){if(p!==null)return S("too many <key>");p=g}else return f===b.ARR_STATE,S("unexpected <key>")}function be(g){if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function J(g){if(isNaN(g))return S("cannot parse float");if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function ke(g){if(isNaN(g))return S("cannot parse integer");if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function Re(g){if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function x(g){if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function _(g){if(f===b.DICT_STATE){if(p===null)return S("missing <key>");u[p]=g,p=null}else f===b.ARR_STATE?u.push(g):u=g}function Y(g){return g.replace(/&#([0-9]+);/g,function(v,D){return String.fromCodePoint(parseInt(D,10))}).replace(/&#x([0-9a-f]+);/g,function(v,D){return String.fromCodePoint(parseInt(D,16))}).replace(/&|<|>|"|'/g,function(v){switch(v){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return v})}function Q(){let g=d(">"),v=!1;return g.charCodeAt(g.length-1)===N.SLASH&&(v=!0,g=g.substring(0,g.length-1)),{name:g.trim(),isClosed:v}}function L(g){if(g.isClosed)return"";const v=d("</");return h(">"),Y(v)}for(;n<o&&(l(),!(n>=o));){const g=i.charCodeAt(n);if(s(1),g!==N.LESS_THAN)return S("expected <");if(n>=o)return S("unexpected end of input");const v=i.charCodeAt(n);if(v===N.QUESTION_MARK){s(1),h("?>");continue}if(v===N.EXCLAMATION_MARK){if(s(1),c("--")){h("-->");continue}h(">");continue}if(v===N.SLASH){if(s(1),l(),c("plist")){h(">");continue}if(c("dict")){h(">"),F();continue}if(c("array")){h(">"),de();continue}return S("unexpected closed tag")}const D=Q();switch(D.name){case"dict":U(),D.isClosed&&F();continue;case"array":ye(),D.isClosed&&de();continue;case"key":Ee(L(D));continue;case"string":be(L(D));continue;case"real":J(parseFloat(L(D)));continue;case"integer":ke(parseInt(L(D),10));continue;case"date":Re(new Date(L(D)));continue;case"data":x(L(D));continue;case"true":L(D),_(!0);continue;case"false":L(D),_(!1);continue}if(!/^plist/.test(D.name))return S("unexpected opened tag "+D.name)}return u}function Ut(i,e,t){const o=jo(i);let n=o.next();for(;n!==null;){let c=0;if(n.length===2&&n.charAt(1)===":"){switch(n.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${n} in scope selector`)}n=o.next()}const h=a();if(h&&t.push({matcher:h,priority:c}),n!==",")break;n=o.next()}function s(){if(n==="-"){n=o.next();const c=s();return c?h=>c(h)<0?0:-1:null}if(n==="("){n=o.next();const c=l();return n===")"&&(n=o.next()),c}if(Kt(n)){const c=[];do c.push(n),n=o.next();while(Kt(n));return h=>e(c,h)}return null}function a(){let c=s();if(!c)return null;const h=[];for(;c;)h.push(c),c=s();return d=>{let f=h[0](d);for(let u=1;f>=0&&u<h.length;u++)f=Math.min(f,h[u](d));return f}}function l(){let c=a();if(!c)return null;const h=[];for(;c&&(h.push(c),n==="|"||n===",");){do n=o.next();while(n==="|"||n===",");c=a()}return d=>{let f=h[0](d);for(let u=1;u<h.length;u++)f=Math.max(f,h[u](d));return f}}}function Kt(i){return!!i&&!!i.match(/[\w\.:]+/)}function jo(i){const e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g;let t=e.exec(i);return{next:()=>{if(!t)return null;const o=t[0];return t=e.exec(i),o}}}const Go=oe.as(on.ColorContribution),$e=Oo(),zt={comments:["comment","punctuation.definition.comment"],strings:["string","meta.embedded.assembly"],keywords:["keyword - keyword.operator","keyword.control","storage","storage.type"],numbers:["constant.numeric"],types:["entity.name.type","entity.name.class","support.type","support.class"],functions:["entity.name.function","support.function"],variables:["variable","entity.name.variable"]},q=class q{constructor(e,t,o){this.themeTokenColors=[],this.customTokenColors=[],this.colorMap={},this.customColorMap={},this.semanticTokenRules=[],this.customSemanticTokenRules=[],this.textMateThemingRules=void 0,this.tokenColorIndex=void 0,this.id=e,this.label=t,this.settingsId=o,this.isLoaded=!1}get semanticHighlighting(){return this.customSemanticHighlighting!==void 0?this.customSemanticHighlighting:this.customSemanticHighlightingDeprecated!==void 0?this.customSemanticHighlightingDeprecated:!!this.themeSemanticHighlighting}get tokenColors(){if(!this.textMateThemingRules){let s=function(a){a.scope&&a.settings&&(a.scope==="token.info-token"&&(n=!0),e.push({scope:a.scope,settings:{foreground:fe(a.settings.foreground),background:fe(a.settings.background),fontStyle:a.settings.fontStyle}}))};const e=[],t=this.getColor(ot)||this.getDefault(ot),o=this.getColor(nt)||this.getDefault(nt);e.push({settings:{foreground:fe(t),background:fe(o)}});let n=!1;this.themeTokenColors.forEach(s),this.customTokenColors.forEach(s),n||Ko[this.type].forEach(s),this.textMateThemingRules=e}return this.textMateThemingRules}getColor(e,t){const o=this.customColorMap[e];if(o instanceof z)return o;if(o===void 0){const n=this.colorMap[e];if(n!==void 0)return n}if(t!==!1)return this.getDefault(e)}getTokenStyle(e,t,o,n=!0,s={}){const a={foreground:void 0,bold:void 0,underline:void 0,strikethrough:void 0,italic:void 0},l={foreground:-1,bold:-1,underline:-1,strikethrough:-1,italic:-1};function c(f,u,m){u.foreground&&l.foreground<=f&&(l.foreground=f,a.foreground=u.foreground,s.foreground=m);for(const I of["bold","underline","strikethrough","italic"]){const p=I,T=u[p];T!==void 0&&l[p]<=f&&(l[p]=f,a[p]=T,s[p]=m)}}function h(f){const u=f.selector.match(e,t,o);u>=0&&c(u,f.style,f)}this.semanticTokenRules.forEach(h),this.customSemanticTokenRules.forEach(h);let d=!1;for(const f in l){const u=f;l[u]===-1?d=!0:l[u]=Number.MAX_VALUE}if(d)for(const f of $e.getTokenStylingDefaultRules()){const u=f.selector.match(e,t,o);if(u>=0){let m;if(f.defaults.scopesToProbe&&(m=this.resolveScopes(f.defaults.scopesToProbe),m&&c(u,m,f.defaults.scopesToProbe)),!m&&n!==!1){const I=f.defaults[this.type];m=this.resolveTokenStyleValue(I),m&&c(u,m,I)}}}return ze.fromData(a)}resolveTokenStyleValue(e){if(e!==void 0){if(typeof e=="string"){const{type:t,modifiers:o,language:n}=jt(e,"");return this.getTokenStyle(t,o,n)}else if(typeof e=="object")return e}}getTokenColorIndex(){if(!this.tokenColorIndex){const e=new qo;this.tokenColors.forEach(t=>{e.add(t.settings.foreground),e.add(t.settings.background)}),this.semanticTokenRules.forEach(t=>e.add(t.style.foreground)),$e.getTokenStylingDefaultRules().forEach(t=>{const o=t.defaults[this.type];o&&typeof o=="object"&&e.add(o.foreground)}),this.customSemanticTokenRules.forEach(t=>e.add(t.style.foreground)),this.tokenColorIndex=e}return this.tokenColorIndex}get tokenColorMap(){return this.getTokenColorIndex().asArray()}getTokenStyleMetadata(e,t,o,n=!0,s={}){const{type:a,language:l}=jt(e,o),c=this.getTokenStyle(a,t,l,n,s);if(c)return{foreground:this.getTokenColorIndex().get(c.foreground),bold:c.bold,underline:c.underline,strikethrough:c.strikethrough,italic:c.italic}}getTokenStylingRuleScope(e){if(this.customSemanticTokenRules.indexOf(e)!==-1)return"setting";if(this.semanticTokenRules.indexOf(e)!==-1)return"theme"}getDefault(e){return Go.resolveDefaultColor(e,this)}resolveScopes(e,t){this.themeTokenScopeMatchers||(this.themeTokenScopeMatchers=this.themeTokenColors.map(Jt)),this.customTokenScopeMatchers||(this.customTokenScopeMatchers=this.customTokenColors.map(Jt));for(const o of e){let d=function(f,u){for(let m=0;m<f.length;m++){const I=f[m](o);if(I>=0){const p=u[m],T=u[m].settings;I>=a&&T.foreground&&(n=T.foreground,a=I,h=p),I>=l&&O(T.fontStyle)&&(s=T.fontStyle,l=I,c=p)}}},n,s,a=-1,l=-1,c,h;if(d(this.themeTokenScopeMatchers,this.themeTokenColors),d(this.customTokenScopeMatchers,this.customTokenColors),n!==void 0||s!==void 0)return t&&(t.foreground=h,t.bold=t.italic=t.underline=t.strikethrough=c,t.scope=o),ze.fromSettings(n,s)}}defines(e){const t=this.customColorMap[e];return t instanceof z?!0:t===void 0&&this.colorMap.hasOwnProperty(e)}setCustomizations(e){this.setCustomColors(e.colorCustomizations),this.setCustomTokenColors(e.tokenColorCustomizations),this.setCustomSemanticTokenColors(e.semanticTokenColorCustomizations)}setCustomColors(e){this.customColorMap={},this.overwriteCustomColors(e);const t=this.getThemeSpecificColors(e);Ne(t)&&this.overwriteCustomColors(t),this.tokenColorIndex=void 0,this.textMateThemingRules=void 0,this.customTokenScopeMatchers=void 0}overwriteCustomColors(e){for(const t in e){const o=e[t];o===it?this.customColorMap[t]=it:typeof o=="string"&&(this.customColorMap[t]=z.fromHex(o))}}setCustomTokenColors(e){this.customTokenColors=[],this.customSemanticHighlightingDeprecated=void 0,this.addCustomTokenColors(e);const t=this.getThemeSpecificColors(e);Ne(t)&&this.addCustomTokenColors(t),this.tokenColorIndex=void 0,this.textMateThemingRules=void 0,this.customTokenScopeMatchers=void 0}setCustomSemanticTokenColors(e){if(this.customSemanticTokenRules=[],this.customSemanticHighlighting=void 0,e){this.customSemanticHighlighting=e.enabled,e.rules&&this.readSemanticTokenRules(e.rules);const t=this.getThemeSpecificColors(e);Ne(t)&&(t.enabled!==void 0&&(this.customSemanticHighlighting=t.enabled),t.rules&&this.readSemanticTokenRules(t.rules))}this.tokenColorIndex=void 0,this.textMateThemingRules=void 0}isThemeScope(e){return e.charAt(0)===Mo&&e.charAt(e.length-1)===Po}isThemeScopeMatch(e){const t=e.charAt(0),o=e.charAt(e.length-1),n=e.slice(0,-1),s=e.slice(1,-1),a=e.slice(1);return e===this.settingsId||this.settingsId.includes(s)&&t===Le&&o===Le||this.settingsId.startsWith(n)&&o===Le||this.settingsId.endsWith(a)&&t===Le}getThemeSpecificColors(e){let t;for(const o in e){const n=e[o];if(this.isThemeScope(o)&&n instanceof Object&&!Array.isArray(n)){const s=o.match(Lo)||[];for(const a of s){const l=a.substring(1,a.length-1);if(this.isThemeScopeMatch(l)){t||(t={});const c=n;for(const h in c){const d=t[h],f=c[h];Array.isArray(d)&&Array.isArray(f)?t[h]=d.concat(f):f&&(t[h]=f)}}}}}return t}readSemanticTokenRules(e){for(const t in e)if(!this.isThemeScope(t))try{const o=Tn(t,e[t]);o&&this.customSemanticTokenRules.push(o)}catch{}}addCustomTokenColors(e){for(const t in zt){const o=t,n=e[o];if(n){const s=typeof n=="string"?{foreground:n}:n,a=zt[o];for(const l of a)this.customTokenColors.push({scope:l,settings:s})}}if(Array.isArray(e.textMateRules))for(const t of e.textMateRules)t.scope&&t.settings&&this.customTokenColors.push(t);e.semanticHighlighting!==void 0&&(this.customSemanticHighlightingDeprecated=e.semanticHighlighting)}ensureLoaded(e){return this.isLoaded?Promise.resolve(void 0):this.load(e)}reload(e){return this.load(e)}load(e){if(!this.location)return Promise.resolve(void 0);this.themeTokenColors=[],this.clearCaches();const t={colors:{},textMateRules:[],semanticTokenRules:[],semanticHighlighting:!1};return pn(e,this.location,t).then(o=>{this.isLoaded=!0,this.semanticTokenRules=t.semanticTokenRules,this.colorMap=t.colors,this.themeTokenColors=t.textMateRules,this.themeSemanticHighlighting=t.semanticHighlighting})}clearCaches(){this.tokenColorIndex=void 0,this.textMateThemingRules=void 0,this.themeTokenScopeMatchers=void 0,this.customTokenScopeMatchers=void 0}toStorage(e){const t={};for(const n in this.colorMap)t[n]=z.Format.CSS.formatHexA(this.colorMap[n],!0);const o=JSON.stringify({id:this.id,label:this.label,settingsId:this.settingsId,themeTokenColors:this.themeTokenColors.map(n=>({settings:n.settings,scope:n.scope})),semanticTokenRules:this.semanticTokenRules.map(Gt.toJSONObject),extensionData:G.toJSONObject(this.extensionData),themeSemanticHighlighting:this.themeSemanticHighlighting,colorMap:t,watch:this.watch});e.store(q.STORAGE_KEY,o,ge.PROFILE,ut.USER)}get themeTypeSelector(){return this.classNames[0]}get classNames(){return this.id.split(" ")}get type(){switch(this.themeTypeSelector){case H.VS:return k.LIGHT;case H.HC_BLACK:return k.HIGH_CONTRAST_DARK;case H.HC_LIGHT:return k.HIGH_CONTRAST_LIGHT;default:return k.DARK}}static createUnloadedThemeForThemeType(e,t){return q.createUnloadedTheme(Bn(e),t)}static createUnloadedTheme(e,t){const o=new q(e,"","__"+e);if(o.isLoaded=!1,o.themeTokenColors=[],o.watch=!1,t)for(const n in t)o.colorMap[n]=z.fromHex(t[n]);return o}static createLoadedEmptyTheme(e,t){const o=new q(e,"",t);return o.isLoaded=!0,o.themeTokenColors=[],o.watch=!1,o}static fromStorageData(e){const t=e.get(q.STORAGE_KEY,ge.PROFILE);if(t)try{const o=JSON.parse(t),n=new q("","","");for(const s in o)switch(s){case"colorMap":{const a=o[s];for(const l in a)n.colorMap[l]=z.fromHex(a[l]);break}case"themeTokenColors":case"id":case"label":case"settingsId":case"watch":case"themeSemanticHighlighting":n[s]=o[s];break;case"semanticTokenRules":{const a=o[s];if(Array.isArray(a))for(const l of a){const c=Gt.fromJSONObject($e,l);c&&n.semanticTokenRules.push(c)}break}case"location":break;case"extensionData":n.extensionData=G.fromJSONObject(o.extensionData);break}return!n.id||!n.settingsId?void 0:n}catch{return}}static fromExtensionTheme(e,t,o){const n=e.uiTheme||"vs-dark",s=Uo(o.extensionId,e.path),a=`${n} ${s}`,l=e.label||ft(e.path),c=e.id||l,h=new q(a,l,c);return h.description=e.description,h.watch=e._watch===!0,h.location=t,h.extensionData=o,h.isLoaded=!1,h}};q.STORAGE_KEY="colorThemeData";let te=q;function Uo(i,e){e.startsWith("./")&&(e=e.substr(2));let t=`${i}-${e}`;return t=t.replace(/[^_a-zA-Z0-9-]/g,"-"),t.charAt(0).match(/[0-9-]/)&&(t="_"+t),t}async function pn(i,e,t){if(jn(e)===".json"){const o=await i.readExtensionResource(e),n=[],s=mt(o,n);if(n.length>0)return Promise.reject(new Error(r(12928,"Problems parsing JSON theme file: {0}",n.map(h=>gt(h.error)).join(", "))));if(pt(s)!=="object")return Promise.reject(new Error(r(12929,"Invalid format for JSON theme file: Object expected.")));if(s.include&&await pn(i,ne(Ge(e),s.include),t),Array.isArray(s.settings))return gn(s.settings,t),null;t.semanticHighlighting=t.semanticHighlighting||s.semanticHighlighting;const a=s.colors;if(a){if(typeof a!="object")return Promise.reject(new Error(r(12930,"Problem parsing color theme file: {0}. Property 'colors' is not of type 'object'.",e.toString())));for(const h in a){const d=a[h];d===it?delete t.colors[h]:typeof d=="string"&&(t.colors[h]=z.fromHex(a[h]))}}const l=s.tokenColors;if(l)if(Array.isArray(l))t.textMateRules.push(...l);else if(typeof l=="string")await Wt(i,ne(Ge(e),l),t);else return Promise.reject(new Error(r(12931,"Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file",e.toString())));const c=s.semanticTokenColors;if(c&&typeof c=="object")for(const h in c)try{const d=Tn(h,c[h]);d&&t.semanticTokenRules.push(d)}catch{return Promise.reject(new Error(r(12932,"Problem parsing color theme file: {0}. Property 'semanticTokenColors' contains a invalid selector",e.toString())))}}else return Wt(i,e,t)}function Wt(i,e,t){return i.readExtensionResource(e).then(o=>{try{const s=$o(o).settings;return Array.isArray(s)?(gn(s,t),Promise.resolve(null)):Promise.reject(new Error(r(12933,"Problem parsing tmTheme file: {0}. 'settings' is not array.")))}catch(n){return Promise.reject(new Error(r(12934,"Problems parsing tmTheme file: {0}",n.message)))}},o=>Promise.reject(new Error(r(12935,"Problems loading tmTheme file {0}: {1}",e.toString(),o.message))))}const Ko={light:[{scope:"token.info-token",settings:{foreground:"#316bcd"}},{scope:"token.warn-token",settings:{foreground:"#cd9731"}},{scope:"token.error-token",settings:{foreground:"#cd3131"}},{scope:"token.debug-token",settings:{foreground:"#800080"}}],dark:[{scope:"token.info-token",settings:{foreground:"#6796e6"}},{scope:"token.warn-token",settings:{foreground:"#cd9731"}},{scope:"token.error-token",settings:{foreground:"#f44747"}},{scope:"token.debug-token",settings:{foreground:"#b267e6"}}],hcLight:[{scope:"token.info-token",settings:{foreground:"#316bcd"}},{scope:"token.warn-token",settings:{foreground:"#cd9731"}},{scope:"token.error-token",settings:{foreground:"#cd3131"}},{scope:"token.debug-token",settings:{foreground:"#800080"}}],hcDark:[{scope:"token.info-token",settings:{foreground:"#6796e6"}},{scope:"token.warn-token",settings:{foreground:"#008000"}},{scope:"token.error-token",settings:{foreground:"#FF0000"}},{scope:"token.debug-token",settings:{foreground:"#b267e6"}}]},qt=i=>-1;function Vt(i,e){if(e.length<i.length)return-1;let t;return i.every(n=>{for(let s=e.length-1;s>=0;s--)if(zo(e[s],n))return t=(s+1)*65536+n.length,!0;return!1})&&t!==void 0?t:-1}function zo(i,e){if(!i)return!1;if(i===e)return!0;const t=e.length;return i.length>t&&i.substr(0,t)===e&&i[t]==="."}function Jt(i){const e=i.scope;if(!e||!i.settings)return qt;const t=[];if(Array.isArray(e))for(const o of e)Ut(o,Vt,t);else Ut(e,Vt,t);return t.length===0?qt:o=>{let n=t[0].matcher(o);for(let s=1;s<t.length;s++)n=Math.max(n,t[s].matcher(o));return n}}function Tn(i,e){const t=$e.parseTokenSelector(i);let o;if(typeof e=="string"?o=ze.fromSettings(e,void 0):Wo(e)&&(o=ze.fromSettings(e.foreground,e.fontStyle,e.bold,e.underline,e.strikethrough,e.italic)),o)return{selector:t,style:o}}function Wo(i){return i&&(O(i.foreground)||O(i.fontStyle)||_e(i.italic)||_e(i.underline)||_e(i.strikethrough)||_e(i.bold))}class qo{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null)}add(e){if(e=fe(e),e===void 0)return 0;let t=this._color2id[e];return t||(t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t)}get(e){if(e=fe(e),e===void 0)return 0;const t=this._color2id[e];return t||(console.log(`Color ${e} not in index.`),0)}asArray(){return this._id2color.slice(0)}}function fe(i){if(!i)return;typeof i!="string"&&(i=z.Format.CSS.formatHexA(i,!0));const e=i.length;if(i.charCodeAt(0)!==j.Hash||e!==4&&e!==5&&e!==7&&e!==9)return;const t=[j.Hash];for(let o=1;o<e;o++){const n=Vo(i.charCodeAt(o));if(!n)return;t.push(n),(e===4||e===5)&&t.push(n)}return t.length===9&&t[7]===j.F&&t[8]===j.F&&(t.length=7),String.fromCharCode(...t)}function Vo(i){return i>=j.Digit0&&i<=j.Digit9||i>=j.A&&i<=j.F?i:i>=j.a&&i<=j.f?i-j.a+j.A:0}const Jo="vscode://schemas/icon-theme",Yo={type:"object",allowComments:!0,allowTrailingCommas:!0,definitions:{folderExpanded:{type:"string",description:r(12949,"The folder icon for expanded folders. The expanded folder icon is optional. If not set, the icon defined for folder will be shown.")},folder:{type:"string",description:r(12950,"The folder icon for collapsed folders, and if folderExpanded is not set, also for expanded folders.")},file:{type:"string",description:r(12951,"The default file icon, shown for all files that don't match any extension, filename or language id.")},rootFolder:{type:"string",description:r(12952,"The folder icon for collapsed root folders, and if rootFolderExpanded is not set, also for expanded root folders.")},rootFolderExpanded:{type:"string",description:r(12953,"The folder icon for expanded root folders. The expanded root folder icon is optional. If not set, the icon defined for root folder will be shown.")},rootFolderNames:{type:"object",description:r(12954,"Associates root folder names to icons. The object key is the root folder name. No patterns or wildcards are allowed. Root folder name matching is case insensitive."),additionalProperties:{type:"string",description:r(12955,"The ID of the icon definition for the association.")}},rootFolderNamesExpanded:{type:"object",description:r(12956,"Associates root folder names to icons for expanded root folders. The object key is the root folder name. No patterns or wildcards are allowed. Root folder name matching is case insensitive."),additionalProperties:{type:"string",description:r(12957,"The ID of the icon definition for the association.")}},folderNames:{type:"object",description:r(12958,"Associates folder names to icons. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive."),additionalProperties:{type:"string",description:r(12955,"The ID of the icon definition for the association.")}},folderNamesExpanded:{type:"object",description:r(12959,"Associates folder names to icons for expanded folders. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive."),additionalProperties:{type:"string",description:r(12960,"The ID of the icon definition for the association.")}},fileExtensions:{type:"object",description:r(12961,"Associates file extensions to icons. The object key is the file extension name. The extension name is the last segment of a file name after the last dot (not including the dot). Extensions are compared case insensitive."),additionalProperties:{type:"string",description:r(12962,"The ID of the icon definition for the association.")}},fileNames:{type:"object",description:r(12963,"Associates file names to icons. The object key is the full file name, but not including any path segments. File name can include dots and a possible file extension. No patterns or wildcards are allowed. File name matching is case insensitive."),additionalProperties:{type:"string",description:r(12964,"The ID of the icon definition for the association.")}},languageIds:{type:"object",description:r(12965,"Associates languages to icons. The object key is the language id as defined in the language contribution point."),additionalProperties:{type:"string",description:r(12966,"The ID of the icon definition for the association.")}},associations:{type:"object",properties:{folderExpanded:{$ref:"#/definitions/folderExpanded"},folder:{$ref:"#/definitions/folder"},file:{$ref:"#/definitions/file"},folderNames:{$ref:"#/definitions/folderNames"},folderNamesExpanded:{$ref:"#/definitions/folderNamesExpanded"},rootFolder:{$ref:"#/definitions/rootFolder"},rootFolderExpanded:{$ref:"#/definitions/rootFolderExpanded"},rootFolderNames:{$ref:"#/definitions/rootFolderNames"},rootFolderNamesExpanded:{$ref:"#/definitions/rootFolderNamesExpanded"},fileExtensions:{$ref:"#/definitions/fileExtensions"},fileNames:{$ref:"#/definitions/fileNames"},languageIds:{$ref:"#/definitions/languageIds"}}}},properties:{fonts:{type:"array",description:r(12967,"Fonts that are used in the icon definitions."),items:{type:"object",properties:{id:{type:"string",description:r(12968,"The ID of the font."),pattern:Ue.source,patternErrorMessage:st},src:{type:"array",description:r(12969,"The location of the font."),items:{type:"object",properties:{path:{type:"string",description:r(12970,"The font path, relative to the current file icon theme file.")},format:{type:"string",description:r(12971,"The format of the font."),enum:["woff","woff2","truetype","opentype","embedded-opentype","svg"]}},required:["path","format"]}},weight:{type:"string",description:r(12972,"The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values."),pattern:Ct.source},style:{type:"string",description:r(12973,"The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values."),pattern:St.source},size:{type:"string",description:r(12974,"The default size of the font. We strongly recommend using a percentage value, for example: 125%."),pattern:rt.source}},required:["id","src"]}},iconDefinitions:{type:"object",description:r(12975,"Description of all icons that can be used when associating files to icons."),additionalProperties:{type:"object",description:r(12976,"An icon definition. The object key is the ID of the definition."),properties:{iconPath:{type:"string",description:r(12977,"When using a SVG or PNG: The path to the image. The path is relative to the icon set file.")},fontCharacter:{type:"string",description:r(12978,"When using a glyph font: The character in the font to use.")},fontColor:{type:"string",format:"color-hex",description:r(12979,"When using a glyph font: The color to use."),pattern:sn.source},fontSize:{type:"string",description:r(12980,"When using a font: The font size in percentage to the text font. If not set, defaults to the size in the font definition."),pattern:rt.source},fontId:{type:"string",description:r(12981,"When using a font: The id of the font. If not set, defaults to the first font definition."),pattern:Ue.source,patternErrorMessage:st}}}},folderExpanded:{$ref:"#/definitions/folderExpanded"},folder:{$ref:"#/definitions/folder"},file:{$ref:"#/definitions/file"},folderNames:{$ref:"#/definitions/folderNames"},folderNamesExpanded:{$ref:"#/definitions/folderNamesExpanded"},rootFolder:{$ref:"#/definitions/rootFolder"},rootFolderExpanded:{$ref:"#/definitions/rootFolderExpanded"},rootFolderNames:{$ref:"#/definitions/rootFolderNames"},rootFolderNamesExpanded:{$ref:"#/definitions/rootFolderNamesExpanded"},fileExtensions:{$ref:"#/definitions/fileExtensions"},fileNames:{$ref:"#/definitions/fileNames"},languageIds:{$ref:"#/definitions/languageIds"},light:{$ref:"#/definitions/associations",description:r(12982,"Optional associations for file icons in light color themes.")},highContrast:{$ref:"#/definitions/associations",description:r(12983,"Optional associations for file icons in high contrast color themes.")},hidesExplorerArrows:{type:"boolean",description:r(12984,"Configures whether the file explorer's arrows should be hidden when this theme is active.")},showLanguageModeIcons:{type:"boolean",description:r(12985,"Configures whether the default language icons should be used if the theme does not define an icon for a language.")}}};function Qo(){oe.as(Tt.JSONContribution).registerSchema(Jo,Yo)}const $=class ${constructor(e,t,o){this.id=e,this.label=t,this.settingsId=o,this.isLoaded=!1,this.hasFileIcons=!1,this.hasFolderIcons=!1,this.hidesExplorerArrows=!1}ensureLoaded(e){return this.isLoaded?Promise.resolve(this.styleSheetContent):this.load(e)}reload(e){return this.load(e)}load(e){return e.load(this)}static fromExtensionTheme(e,t,o){const n=o.extensionId+"-"+e.id,s=e.label||ft(e.path),a=e.id,l=new $(n,s,a);return l.description=e.description,l.location=t,l.extensionData=o,l.watch=e._watch,l.isLoaded=!1,l}static get noIconTheme(){let e=$._noIconTheme;return e||(e=$._noIconTheme=new $("","",null),e.hasFileIcons=!1,e.hasFolderIcons=!1,e.hidesExplorerArrows=!1,e.isLoaded=!0,e.extensionData=void 0,e.watch=!1),e}static createUnloadedTheme(e){const t=new $(e,"","__"+e);return t.isLoaded=!1,t.hasFileIcons=!1,t.hasFolderIcons=!1,t.hidesExplorerArrows=!1,t.extensionData=void 0,t.watch=!1,t}static fromStorageData(e){const t=e.get($.STORAGE_KEY,ge.PROFILE);if(t)try{const o=JSON.parse(t),n=new $("","",null);for(const s in o)switch(s){case"id":case"label":case"description":case"settingsId":case"styleSheetContent":case"hasFileIcons":case"hidesExplorerArrows":case"hasFolderIcons":case"watch":n[s]=o[s];break;case"location":break;case"extensionData":n.extensionData=G.fromJSONObject(o.extensionData);break}return n}catch{return}}toStorage(e){const t=JSON.stringify({id:this.id,label:this.label,description:this.description,settingsId:this.settingsId,styleSheetContent:this.styleSheetContent,hasFileIcons:this.hasFileIcons,hasFolderIcons:this.hasFolderIcons,hidesExplorerArrows:this.hidesExplorerArrows,extensionData:G.toJSONObject(this.extensionData),watch:this.watch});e.store($.STORAGE_KEY,t,ge.PROFILE,ut.MACHINE)}};$.STORAGE_KEY="iconThemeData",$._noIconTheme=null;let X=$;class Xo{constructor(e,t){this.fileService=e,this.languageService=t}load(e){return e.location?this.loadIconThemeDocument(e.location).then(t=>{const o=this.processIconThemeDocument(e.id,e.location,t);return e.styleSheetContent=o.content,e.hasFileIcons=o.hasFileIcons,e.hasFolderIcons=o.hasFolderIcons,e.hidesExplorerArrows=o.hidesExplorerArrows,e.isLoaded=!0,e.styleSheetContent}):Promise.resolve(e.styleSheetContent)}loadIconThemeDocument(e){return this.fileService.readExtensionResource(e).then(t=>{const o=[],n=mt(t,o);return o.length>0?Promise.reject(new Error(r(12891,"Problems parsing file icons file: {0}",o.map(s=>gt(s.error)).join(", ")))):pt(n)!=="object"?Promise.reject(new Error(r(12892,"Invalid format for file icons theme file: Object expected."))):Promise.resolve(n)})}processIconThemeDocument(e,t,o){const n={content:"",hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!!o.hidesExplorerArrows};let s=!1;if(!o.iconDefinitions)return n;const a={},l={},c=Ge(t);function h(T){return ne(c,T)}function d(T,R){function S(E,A){if(A){let U=a[A];U||(U=a[A]=new ee),U.push(E)}}if(T){let E=y`.show-file-icons`;R&&(E=y`${R} ${E}`);const A=y`.monaco-tl-twistie.collapsible:not(.collapsed) + .monaco-tl-contents`;T.folder&&(S(y`${E} .folder-icon::before`,T.folder),n.hasFolderIcons=!0),T.folderExpanded&&(S(y`${E} ${A} .folder-icon::before`,T.folderExpanded),n.hasFolderIcons=!0);const U=T.rootFolder||T.folder,F=T.rootFolderExpanded||T.folderExpanded;U&&(S(y`${E} .rootfolder-icon::before`,U),n.hasFolderIcons=!0),F&&(S(y`${E} ${A} .rootfolder-icon::before`,F),n.hasFolderIcons=!0),T.file&&(S(y`${E} .file-icon::before`,T.file),n.hasFileIcons=!0);const ye=T.folderNames;if(ye)for(const x in ye){const _=new ee,Y=He(x.toLowerCase(),_);_.push(y`.${W(Y)}-name-folder-icon`),S(y`${E} ${_.join("")}.folder-icon::before`,ye[x]),n.hasFolderIcons=!0}const de=T.folderNamesExpanded;if(de)for(const x in de){const _=new ee,Y=He(x.toLowerCase(),_);_.push(y`.${W(Y)}-name-folder-icon`),S(y`${E} ${A} ${_.join("")}.folder-icon::before`,de[x]),n.hasFolderIcons=!0}const Ee=T.rootFolderNames;if(Ee)for(const x in Ee){const _=x.toLowerCase();S(y`${E} .${W(_)}-root-name-folder-icon.rootfolder-icon::before`,Ee[x]),n.hasFolderIcons=!0}const be=T.rootFolderNamesExpanded;if(be)for(const x in be){const _=x.toLowerCase();S(y`${E} ${A} .${W(_)}-root-name-folder-icon.rootfolder-icon::before`,be[x]),n.hasFolderIcons=!0}const J=T.languageIds;if(J){!J.jsonc&&J.json&&(J.jsonc=J.json);for(const x in J)S(y`${E} .${W(x)}-lang-file-icon.file-icon::before`,J[x]),n.hasFileIcons=!0,s=!0,l[x]=!0}const ke=T.fileExtensions;if(ke)for(const x in ke){const _=new ee,Q=He(x.toLowerCase(),_).split(".");if(Q.length){for(let L=0;L<Q.length;L++)_.push(y`.${W(Q.slice(L).join("."))}-ext-file-icon`);_.push(y`.ext-file-icon`)}S(y`${E} ${_.join("")}.file-icon::before`,ke[x]),n.hasFileIcons=!0,s=!0}const Re=T.fileNames;if(Re)for(const x in Re){const _=new ee,Y=He(x.toLowerCase(),_);_.push(y`.${W(Y)}-name-file-icon`),_.push(y`.name-file-icon`);const Q=Y.split(".");if(Q.length){for(let L=1;L<Q.length;L++)_.push(y`.${W(Q.slice(L).join("."))}-ext-file-icon`);_.push(y`.ext-file-icon`)}S(y`${E} ${_.join("")}.file-icon::before`,Re[x]),n.hasFileIcons=!0,s=!0}}}if(d(o),d(o.light,y`.vs`),d(o.highContrast,y`.hc-black`),d(o.highContrast,y`.hc-light`),!n.hasFileIcons&&!n.hasFolderIcons)return n;const f=o.showLanguageModeIcons===!0||s&&o.showLanguageModeIcons!==!1,u=new ee,m=o.fonts,I=new Map;if(Array.isArray(m)){const T=this.tryNormalizeFontSize(m[0].size)||"150%";m.forEach(R=>{const S=new ee;S.push(...R.src.map(A=>y`${Pe(h(A.path))} format(${ue(A.format)})`)),u.push(y`@font-face { src: ${S.join(", ")}; font-family: ${ue(R.id)}; font-weight: ${Dt(R.weight)}; font-style: ${Dt(R.style)}; font-display: block; }`);const E=this.tryNormalizeFontSize(R.size);E!==void 0&&E!==T&&I.set(R.id,E)}),u.push(y`.show-file-icons .file-icon::before, .show-file-icons .folder-icon::before, .show-file-icons .rootfolder-icon::before { font-family: ${ue(m[0].id)}; font-size: ${At(T)}; }`)}const p=ue("\\2001");for(const T in a){const R=a[T],S=o.iconDefinitions[T];if(S){if(S.iconPath)u.push(y`${R.join(", ")} { content: ${p}; background-image: ${Pe(h(S.iconPath))}; }`);else if(S.fontCharacter||S.fontColor){const E=new ee;S.fontColor&&S.fontColor.match(sn)&&E.push(y`color: ${Gn(S.fontColor)};`),S.fontCharacter&&E.push(y`content: ${ue(S.fontCharacter)};`);const A=S.fontSize??(S.fontId?I.get(S.fontId):void 0);A&&A.match(rt)&&E.push(y`font-size: ${At(A)};`),S.fontId&&E.push(y`font-family: ${ue(S.fontId)};`),f&&E.push(y`background-image: unset;`),u.push(y`${R.join(", ")} { ${E.join(" ")} }`)}}}if(f){for(const T of this.languageService.getRegisteredLanguageIds())if(!l[T]){const R=this.languageService.getIcon(T);if(R){const S=y`.show-file-icons .${W(T)}-lang-file-icon.file-icon::before`;u.push(y`${S} { content: ${p}; background-image: ${Pe(R.dark)}; }`),u.push(y`.vs ${S} { content: ${p}; background-image: ${Pe(R.light)}; }`)}}}return n.content=u.join(`
|
|
2
|
+
`),n}tryNormalizeFontSize(e){if(!e)return;const t=13;if(e.endsWith("px")){const o=parseInt(e,10);if(!isNaN(o))return Math.round(o/t*100)+"%"}return e}}function He(i,e){const t=i.lastIndexOf("/");if(t>=0){const o=i.substring(0,t);return e.push(y`.${W(o)}-name-dir-icon`),i.substring(t+1)}return i}function W(i){return i=Un(i),Kn(i,!0)}const Yt=["comment","comment.block","comment.block.documentation","comment.line","constant","constant.character","constant.character.escape","constant.numeric","constant.numeric.integer","constant.numeric.float","constant.numeric.hex","constant.numeric.octal","constant.other","constant.regexp","constant.rgb-value","emphasis","entity","entity.name","entity.name.class","entity.name.function","entity.name.method","entity.name.section","entity.name.selector","entity.name.tag","entity.name.type","entity.other","entity.other.attribute-name","entity.other.inherited-class","invalid","invalid.deprecated","invalid.illegal","keyword","keyword.control","keyword.operator","keyword.operator.new","keyword.operator.assignment","keyword.operator.arithmetic","keyword.operator.logical","keyword.other","markup","markup.bold","markup.changed","markup.deleted","markup.heading","markup.inline.raw","markup.inserted","markup.italic","markup.list","markup.list.numbered","markup.list.unnumbered","markup.other","markup.quote","markup.raw","markup.underline","markup.underline.link","meta","meta.block","meta.cast","meta.class","meta.function","meta.function-call","meta.preprocessor","meta.return-type","meta.selector","meta.tag","meta.type.annotation","meta.type","punctuation.definition.string.begin","punctuation.definition.string.end","punctuation.separator","punctuation.separator.continuation","punctuation.terminator","storage","storage.modifier","storage.type","string","string.interpolated","string.other","string.quoted","string.quoted.double","string.quoted.other","string.quoted.single","string.quoted.triple","string.regexp","string.unquoted","strong","support","support.class","support.constant","support.function","support.other","support.type","support.type.property-name","support.variable","variable","variable.language","variable.name","variable.other","variable.other.readwrite","variable.parameter"],Ve="vscode://schemas/textmate-colors",Zo=`${Ve}#/definitions/colorGroup`,ei={type:"array",definitions:{colorGroup:{default:"#FF0000",anyOf:[{type:"string",format:"color-hex"},{$ref:"#/definitions/settings"}]},settings:{type:"object",description:r(12936,"Colors and styles for the token."),properties:{foreground:{type:"string",description:r(12937,"Foreground color for the token."),format:"color-hex",default:"#ff0000"},background:{type:"string",deprecationMessage:r(12938,"Token background colors are currently not supported.")},fontStyle:{type:"string",description:r(12939,"Font style of the rule: 'italic', 'bold', 'underline', 'strikethrough' or a combination. The empty string unsets inherited settings."),pattern:"^(\\s*\\b(italic|bold|underline|strikethrough))*\\s*$",patternErrorMessage:r(12940,"Font style must be 'italic', 'bold', 'underline', 'strikethrough' or a combination or the empty string."),defaultSnippets:[{label:r(12941,"None (clear inherited style)"),bodyText:'""'},{body:"italic"},{body:"bold"},{body:"underline"},{body:"strikethrough"},{body:"italic bold"},{body:"italic underline"},{body:"italic strikethrough"},{body:"bold underline"},{body:"bold strikethrough"},{body:"underline strikethrough"},{body:"italic bold underline"},{body:"italic bold strikethrough"},{body:"italic underline strikethrough"},{body:"bold underline strikethrough"},{body:"italic bold underline strikethrough"}]}},additionalProperties:!1,defaultSnippets:[{body:{foreground:"${1:#FF0000}",fontStyle:"${2:bold}"}}]}},items:{type:"object",defaultSnippets:[{body:{scope:"${1:keyword.operator}",settings:{foreground:"${2:#FF0000}"}}}],properties:{name:{type:"string",description:r(12942,"Description of the rule.")},scope:{description:r(12943,"Scope selector against which this rule matches."),anyOf:[{enum:Yt},{type:"string"},{type:"array",items:{enum:Yt}},{type:"array",items:{type:"string"}}]},settings:{$ref:"#/definitions/settings"}},required:["settings"],additionalProperties:!1}},Sn="vscode://schemas/color-theme",ti={type:"object",allowComments:!0,allowTrailingCommas:!0,properties:{colors:{description:r(12944,"Colors in the workbench"),$ref:It,additionalProperties:!1},tokenColors:{anyOf:[{type:"string",description:r(12945,"Path to a tmTheme file (relative to the current file).")},{description:r(12946,"Colors for syntax highlighting"),$ref:Ve}]},semanticHighlighting:{type:"boolean",description:r(12947,"Whether semantic highlighting should be enabled for this theme.")},semanticTokenColors:{type:"object",description:r(12948,"Colors for semantic tokens"),$ref:mn}}};function ni(){const i=oe.as(Tt.JSONContribution);i.registerSchema(Sn,ti),i.registerSchema(Ve,ei)}function oi(){return yt.registerExtensionPoint({extensionPoint:"themes",jsonSchema:{description:r(13038,"Contributes textmate color themes."),type:"array",items:{type:"object",defaultSnippets:[{body:{label:"${1:label}",id:"${2:id}",uiTheme:H.VS_DARK,path:"./themes/${3:id}.tmTheme."}}],properties:{id:{description:r(13039,"Id of the color theme as used in the user settings."),type:"string"},label:{description:r(13040,"Label of the color theme as shown in the UI."),type:"string"},uiTheme:{description:r(13041,"Base theme defining the colors around the editor: 'vs' is the light color theme, 'vs-dark' is the dark color theme. 'hc-black' is the dark high contrast theme, 'hc-light' is the light high contrast theme."),enum:[H.VS,H.VS_DARK,H.HC_BLACK,H.HC_LIGHT]},path:{description:r(13042,"Path of the tmTheme file. The path is relative to the extension folder and is typically './colorthemes/awesome-color-theme.json'."),type:"string"}},required:["path","uiTheme"]}}})}function ii(){return yt.registerExtensionPoint({extensionPoint:"iconThemes",jsonSchema:{description:r(13043,"Contributes file icon themes."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:id}",label:"${2:label}",path:"./fileicons/${3:id}-icon-theme.json"}}],properties:{id:{description:r(13044,"Id of the file icon theme as used in the user settings."),type:"string"},label:{description:r(13045,"Label of the file icon theme as shown in the UI."),type:"string"},path:{description:r(13046,"Path of the file icon theme definition file. The path is relative to the extension folder and is typically './fileicons/awesome-icon-theme.json'."),type:"string"}},required:["path","id"]}}})}function si(){return yt.registerExtensionPoint({extensionPoint:"productIconThemes",jsonSchema:{description:r(13047,"Contributes product icon themes."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:id}",label:"${2:label}",path:"./producticons/${3:id}-product-icon-theme.json"}}],properties:{id:{description:r(13048,"Id of the product icon theme as used in the user settings."),type:"string"},label:{description:r(13049,"Label of the product icon theme as shown in the UI."),type:"string"},path:{description:r(13050,"Path of the product icon theme definition file. The path is relative to the extension folder and is typically './producticons/awesome-product-icon-theme.json'."),type:"string"}},required:["path","id"]}}})}class ri extends an{constructor(){super(...arguments),this.type="markdown"}shouldRender(e){return!!e.contributes?.themes||!!e.contributes?.iconThemes||!!e.contributes?.productIconThemes}render(e){const t=new Wn;if(e.contributes?.themes){t.appendMarkdown(`### ${r(13051,"Color Themes")}
|
|
3
|
+
|
|
4
|
+
`);for(const o of e.contributes.themes)t.appendMarkdown(`- ${o.label}
|
|
5
|
+
`)}if(e.contributes?.iconThemes){t.appendMarkdown(`### ${r(13052,"File Icon Themes")}
|
|
6
|
+
|
|
7
|
+
`);for(const o of e.contributes.iconThemes)t.appendMarkdown(`- ${o.label}
|
|
8
|
+
`)}if(e.contributes?.productIconThemes){t.appendMarkdown(`### ${r(13053,"Product Icon Themes")}
|
|
9
|
+
|
|
10
|
+
`);for(const o of e.contributes.productIconThemes)t.appendMarkdown(`- ${o.label}
|
|
11
|
+
`)}return{data:t,dispose:()=>{}}}}oe.as(zn.ExtensionFeaturesRegistry).registerExtensionFeature({id:"themes",label:r(13054,"Themes"),access:{canToggle:!1},renderer:new rn(ri)});class Qe{constructor(e,t,o=!1,n=void 0){this.themesExtPoint=e,this.create=t,this.idRequired=o,this.builtInTheme=n,this.onDidChangeEmitter=new we,this.onDidChange=this.onDidChangeEmitter.event,this.extensionThemes=[],this.initialize()}dispose(){this.themesExtPoint.setHandler(()=>{})}initialize(){this.themesExtPoint.setHandler((e,t)=>{const o={},n=[];for(const a of this.extensionThemes)o[a.id]=a;this.extensionThemes.length=0;for(const a of e){const l=G.fromName(a.description.publisher,a.description.name,a.description.isBuiltin);this.onThemes(l,a.description.extensionLocation,a.value,this.extensionThemes,a.collector)}for(const a of this.extensionThemes)o[a.id]?delete o[a.id]:n.push(a);const s=Object.values(o);this.onDidChangeEmitter.fire({themes:this.extensionThemes,added:n,removed:s})})}onThemes(e,t,o,n=[],s){return Array.isArray(o)?(o.forEach(a=>{if(!a.path||!O(a.path)){s?.error(r(13056,"Expected string in `contributes.{0}.path`. Provided value: {1}",this.themesExtPoint.name,String(a.path)));return}if(this.idRequired&&(!a.id||!O(a.id))){s?.error(r(13057,"Expected string in `contributes.{0}.id`. Provided value: {1}",this.themesExtPoint.name,String(a.id)));return}const l=ne(t,a.path);Ot(l,t)||s?.warn(r(13058,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",this.themesExtPoint.name,l.path,t.path));const c=this.create(a,l,e);n.push(c)}),n):(s?.error(r(13055,"Extension point `{0}` must be an array.",this.themesExtPoint.name)),n)}findThemeById(e){if(this.builtInTheme&&this.builtInTheme.id===e)return this.builtInTheme;const t=this.getThemes();for(const o of t)if(o.id===e)return o}findThemeBySettingsId(e,t){if(this.builtInTheme&&this.builtInTheme.settingsId===e)return this.builtInTheme;const o=this.getThemes();let n;for(const s of o){if(s.settingsId===e)return s;s.settingsId===t&&(n=s)}return n}findThemeByExtensionLocation(e){return e?this.getThemes().filter(t=>t.location&&Ot(t.location,e)):[]}getThemes(){return this.extensionThemes}getMarketplaceThemes(e,t,o){const n=e?.contributes?.[this.themesExtPoint.name];return Array.isArray(n)?this.onThemes(o,t,n):[]}}const Ie=oe.as(qn.Configuration),re=[],ae=[],ce=[];function V(i){return`\`#${i}#\``}const he="colorThemeConfiguration",ai={type:"string",markdownDescription:r(13006,"Specifies the color theme used in the workbench when {0} is not enabled.",V(C.DETECT_COLOR_SCHEME)),default:cn?P.COLOR_THEME_LIGHT:P.COLOR_THEME_DARK,tags:[he],enum:re,enumDescriptions:ce,enumItemLabels:ae,errorMessage:r(13007,"Theme is unknown or not installed.")},ci={type:"string",markdownDescription:r(13008,"Specifies the color theme when system color mode is dark and {0} is enabled.",V(C.DETECT_COLOR_SCHEME)),default:P.COLOR_THEME_DARK,tags:[he],enum:re,enumDescriptions:ce,enumItemLabels:ae,errorMessage:r(13007,"Theme is unknown or not installed.")},li={type:"string",markdownDescription:r(13009,"Specifies the color theme when system color mode is light and {0} is enabled.",V(C.DETECT_COLOR_SCHEME)),default:P.COLOR_THEME_LIGHT,tags:[he],enum:re,enumDescriptions:ce,enumItemLabels:ae,errorMessage:r(13007,"Theme is unknown or not installed.")},hi={type:"string",markdownDescription:r(13010,"Specifies the color theme when in high contrast dark mode and {0} is enabled.",V(C.DETECT_HC)),default:P.COLOR_THEME_HC_DARK,tags:[he],enum:re,enumDescriptions:ce,enumItemLabels:ae,errorMessage:r(13007,"Theme is unknown or not installed.")},di={type:"string",markdownDescription:r(13011,"Specifies the color theme when in high contrast light mode and {0} is enabled.",V(C.DETECT_HC)),default:P.COLOR_THEME_HC_LIGHT,tags:[he],enum:re,enumDescriptions:ce,enumItemLabels:ae,errorMessage:r(13007,"Theme is unknown or not installed.")},ui={type:"boolean",markdownDescription:r(13012,"If enabled, will automatically select a color theme based on the system color mode. If the system color mode is dark, {0} is used, else {1}.",V(C.PREFERRED_DARK_THEME),V(C.PREFERRED_LIGHT_THEME)),default:!1,tags:[he]},Cn={type:"object",description:r(13013,"Overrides colors from the currently selected color theme."),allOf:[{$ref:It}],default:{},defaultSnippets:[{body:{}}]},Be={type:["string","null"],default:P.FILE_ICON_THEME,description:r(13014,"Specifies the file icon theme used in the workbench or 'null' to not show any file icons."),enum:[null],enumItemLabels:[r(13015,"None")],enumDescriptions:[r(13016,"No file icons")],errorMessage:r(13017,"File icon theme is unknown or not installed.")},je={type:["string","null"],default:P.PRODUCT_ICON_THEME,description:r(13018,"Specifies the product icon theme used."),enum:[P.PRODUCT_ICON_THEME],enumItemLabels:[r(13019,"Default")],enumDescriptions:[r(13020,"Default")],errorMessage:r(13021,"Product icon theme is unknown or not installed.")},fi={type:"boolean",default:!0,markdownDescription:r(13022,"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by {0} and {1}.",V(C.PREFERRED_HC_DARK_THEME),V(C.PREFERRED_HC_LIGHT_THEME)),scope:Vn.APPLICATION,tags:[he]},Je={id:"workbench",order:7.1,type:"object",properties:{[C.COLOR_THEME]:ai,[C.PREFERRED_DARK_THEME]:ci,[C.PREFERRED_LIGHT_THEME]:li,[C.PREFERRED_HC_DARK_THEME]:hi,[C.PREFERRED_HC_LIGHT_THEME]:di,[C.FILE_ICON_THEME]:Be,[C.COLOR_CUSTOMIZATIONS]:Cn,[C.PRODUCT_ICON_THEME]:je}};Ie.registerConfiguration(Je);const mi={id:"window",order:8.1,type:"object",properties:{[C.DETECT_HC]:fi,[C.DETECT_COLOR_SCHEME]:ui}};Ie.registerConfiguration(mi);function ie(i){return{description:i,$ref:Zo}}const Xe="^\\[[^\\]]*(\\]\\s*\\[[^\\]]*)*\\]$",In={type:"object",properties:{comments:ie(r(13023,"Sets the colors and styles for comments")),strings:ie(r(13024,"Sets the colors and styles for strings literals.")),keywords:ie(r(13025,"Sets the colors and styles for keywords.")),numbers:ie(r(13026,"Sets the colors and styles for number literals.")),types:ie(r(13027,"Sets the colors and styles for type declarations and references.")),functions:ie(r(13028,"Sets the colors and styles for functions declarations and references.")),variables:ie(r(13029,"Sets the colors and styles for variables declarations and references.")),textMateRules:{description:r(13030,"Sets colors and styles using textmate theming rules (advanced)."),$ref:Ve},semanticHighlighting:{description:r(13031,"Whether semantic highlighting should be enabled for this theme."),deprecationMessage:r(13032,"Use `enabled` in `editor.semanticTokenColorCustomizations` setting instead."),markdownDeprecationMessage:r(13033,"Use `enabled` in {0} setting instead.",V("editor.semanticTokenColorCustomizations")),type:"boolean"}},additionalProperties:!1},yn={description:r(13034,"Overrides editor syntax colors and font style from the currently selected color theme."),default:{},allOf:[{...In,patternProperties:{"^\\[":{}}}]},ht={type:"object",properties:{enabled:{type:"boolean",description:r(13035,"Whether semantic highlighting is enabled or disabled for this theme"),suggestSortText:"0_enabled"},rules:{$ref:mn,description:r(13036,"Semantic token styling rules for this theme."),suggestSortText:"0_rules"}},additionalProperties:!1},En={description:r(13037,"Overrides editor semantic token color and styles from the currently selected color theme."),default:{},allOf:[{...ht,patternProperties:{"^\\[":{}}}]},bn={id:"editor",order:7.2,type:"object",properties:{[C.TOKEN_COLOR_CUSTOMIZATIONS]:yn,[C.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS]:En}};Ie.registerConfiguration(bn);function Qt(i){i.sort((a,l)=>a.label.localeCompare(l.label)),re.splice(0,re.length,...i.map(a=>a.settingsId)),ce.splice(0,ce.length,...i.map(a=>a.description||"")),ae.splice(0,ae.length,...i.map(a=>a.label||""));const e={properties:{}},t={properties:{}},o={properties:{}},n={$ref:It,additionalProperties:!1},s={properties:In.properties,additionalProperties:!1};for(const a of i){const l=`[${a.settingsId}]`;e.properties[l]=n,t.properties[l]=s,o.properties[l]=ht}e.patternProperties={[Xe]:n},t.patternProperties={[Xe]:s},o.patternProperties={[Xe]:ht},Cn.allOf[1]=e,yn.allOf[1]=t,En.allOf[1]=o,Ie.notifyConfigurationSchemaUpdated(Je,bn)}function Xt(i){Be.enum.splice(1,Number.MAX_VALUE,...i.map(e=>e.settingsId)),Be.enumItemLabels.splice(1,Number.MAX_VALUE,...i.map(e=>e.label)),Be.enumDescriptions.splice(1,Number.MAX_VALUE,...i.map(e=>e.description||"")),Ie.notifyConfigurationSchemaUpdated(Je)}function Zt(i){je.enum.splice(1,Number.MAX_VALUE,...i.map(e=>e.settingsId)),je.enumItemLabels.splice(1,Number.MAX_VALUE,...i.map(e=>e.label)),je.enumDescriptions.splice(1,Number.MAX_VALUE,...i.map(e=>e.description||"")),Ie.notifyConfigurationSchemaUpdated(Je)}const gi={[k.DARK]:C.PREFERRED_DARK_THEME,[k.LIGHT]:C.PREFERRED_LIGHT_THEME,[k.HIGH_CONTRAST_DARK]:C.PREFERRED_HC_DARK_THEME,[k.HIGH_CONTRAST_LIGHT]:C.PREFERRED_HC_LIGHT_THEME};class pi{constructor(e,t){this.configurationService=e,this.hostColorService=t}get colorTheme(){return this.configurationService.getValue(this.getColorThemeSettingId())}get fileIconTheme(){return this.configurationService.getValue(C.FILE_ICON_THEME)}get productIconTheme(){return this.configurationService.getValue(C.PRODUCT_ICON_THEME)}get colorCustomizations(){return this.configurationService.getValue(C.COLOR_CUSTOMIZATIONS)||{}}get tokenColorCustomizations(){return this.configurationService.getValue(C.TOKEN_COLOR_CUSTOMIZATIONS)||{}}get semanticTokenColorCustomizations(){return this.configurationService.getValue(C.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS)}getPreferredColorScheme(){if(this.configurationService.getValue(C.DETECT_HC)&&this.hostColorService.highContrast)return this.hostColorService.dark?k.HIGH_CONTRAST_DARK:k.HIGH_CONTRAST_LIGHT;if(this.configurationService.getValue(C.DETECT_COLOR_SCHEME))return this.hostColorService.dark?k.DARK:k.LIGHT}isDetectingColorScheme(){return this.configurationService.getValue(C.DETECT_COLOR_SCHEME)}getColorThemeSettingId(){const e=this.getPreferredColorScheme();return e?gi[e]:C.COLOR_THEME}async setColorTheme(e,t){return await this.writeConfiguration(this.getColorThemeSettingId(),e.settingsId,t),e}async setFileIconTheme(e,t){return await this.writeConfiguration(C.FILE_ICON_THEME,e.settingsId,t),e}async setProductIconTheme(e,t){return await this.writeConfiguration(C.PRODUCT_ICON_THEME,e.settingsId,t),e}isDefaultColorTheme(){const e=this.configurationService.inspect(this.getColorThemeSettingId());return e&&e.default?.value===e.value}findAutoConfigurationTarget(e){const t=this.configurationService.inspect(e);if(se(t.workspaceFolderValue))if(se(t.workspaceValue)){if(!se(t.userRemote))return K.USER_REMOTE}else return K.WORKSPACE;else return K.WORKSPACE_FOLDER;return K.USER}async writeConfiguration(e,t,o){if(o===void 0||o==="preview")return;const n=this.configurationService.inspect(e);if(o==="auto")return this.configurationService.updateValue(e,t);if(o===K.USER){if(t===n.userValue)return Promise.resolve(void 0);if(t===n.defaultValue){if(se(n.userValue))return Promise.resolve(void 0);t=void 0}}else if((o===K.WORKSPACE||o===K.WORKSPACE_FOLDER||o===K.USER_REMOTE)&&t===n.value)return Promise.resolve(void 0);return this.configurationService.updateValue(e,t,o)}}const xe="",B=class B{constructor(e,t,o){this.iconThemeDocument={iconDefinitions:new Map},this.id=e,this.label=t,this.settingsId=o,this.isLoaded=!1}getIcon(e){return Ci(e,this.iconThemeDocument)}ensureLoaded(e,t){return this.isLoaded?Promise.resolve(this.styleSheetContent):this.load(e,t)}reload(e,t){return this.load(e,t)}async load(e,t){const o=this.location;if(!o)return Promise.resolve(this.styleSheetContent);const n=[];return this.iconThemeDocument=await Ti(e,o,n),this.isLoaded=!0,n.length&&t.error(r(12893,`Problems processing product icons definitions in {0}:
|
|
12
|
+
{1}`,o.toString(),n.join(`
|
|
13
|
+
`))),this.styleSheetContent}static fromExtensionTheme(e,t,o){const n=o.extensionId+"-"+e.id,s=e.label||ft(e.path),a=e.id,l=new B(n,s,a);return l.description=e.description,l.location=t,l.extensionData=o,l.watch=e._watch,l.isLoaded=!1,l}static createUnloadedTheme(e){const t=new B(e,"","__"+e);return t.isLoaded=!1,t.extensionData=void 0,t.watch=!1,t}static get defaultTheme(){let e=B._defaultProductIconTheme;return e||(e=B._defaultProductIconTheme=new B(xe,r(12894,"Default"),P.PRODUCT_ICON_THEME),e.isLoaded=!0,e.extensionData=void 0,e.watch=!1),e}static fromStorageData(e){const t=e.get(B.STORAGE_KEY,ge.PROFILE);if(t)try{const o=JSON.parse(t),n=new B("","","");for(const l in o)switch(l){case"id":case"label":case"description":case"settingsId":case"styleSheetContent":case"watch":n[l]=o[l];break;case"location":break;case"extensionData":n.extensionData=G.fromJSONObject(o.extensionData);break}const{iconDefinitions:s,iconFontDefinitions:a}=o;if(Array.isArray(s)&&Ne(a)){const l=new Map;for(const c of s){const{id:h,fontCharacter:d,fontId:f}=c;if(O(h)&&O(d))if(O(f)){const u=Mt.fromJSONObject(a[f]);u&&l.set(h,{fontCharacter:d,font:{id:f,definition:u}})}else l.set(h,{fontCharacter:d})}n.iconThemeDocument={iconDefinitions:l}}return n}catch{return}}toStorage(e){const t=[],o={};for(const s of this.iconThemeDocument.iconDefinitions.entries()){const a=s[1].font;t.push({id:s[0],fontCharacter:s[1].fontCharacter,fontId:a?.id}),a&&o[a.id]===void 0&&(o[a.id]=Mt.toJSONObject(a.definition))}const n=JSON.stringify({id:this.id,label:this.label,description:this.description,settingsId:this.settingsId,styleSheetContent:this.styleSheetContent,watch:this.watch,extensionData:G.toJSONObject(this.extensionData),iconDefinitions:t,iconFontDefinitions:o});e.store(B.STORAGE_KEY,n,ge.PROFILE,ut.MACHINE)}};B.STORAGE_KEY="productIconThemeData",B._defaultProductIconTheme=null;let Z=B;function Ti(i,e,t){return i.readExtensionResource(e).then(o=>{const n=[],s=mt(o,n);if(n.length>0)return Promise.reject(new Error(r(12895,"Problems parsing product icons file: {0}",n.map(d=>gt(d.error)).join(", "))));if(pt(s)!=="object")return Promise.reject(new Error(r(12896,"Invalid format for product icons theme file: Object expected.")));if(!s.iconDefinitions||!Array.isArray(s.fonts)||!s.fonts.length)return Promise.reject(new Error(r(12897,"Invalid format for product icons theme file: Must contain iconDefinitions and fonts.")));const a=Ge(e),l=new Map;for(const d of s.fonts){const f=d.id;if(O(f)&&f.match(Ue)){let u;O(d.weight)&&d.weight.match(Ct)?u=d.weight:t.push(r(12898,"Invalid font weight in font '{0}'. Ignoring setting.",d.id));let m;O(d.style)&&d.style.match(St)?m=d.style:t.push(r(12899,"Invalid font style in font '{0}'. Ignoring setting.",d.id));const I=[];if(Array.isArray(d.src))for(const p of d.src)if(O(p.path)&&O(p.format)&&p.format.match(Yn)){const T=ne(a,p.path);I.push({location:T,format:p.format})}else t.push(r(12900,"Invalid font source in font '{0}'. Ignoring source.",d.id));I.length?l.set(f,{weight:u,style:m,src:I}):t.push(r(12901,"No valid font source in font '{0}'. Ignoring font definition.",d.id))}else t.push(r(12902,"Missing or invalid font id '{0}'. Skipping font definition.",d.id))}const c=new Map,h=s.fonts[0].id;for(const d in s.iconDefinitions){const f=s.iconDefinitions[d];if(O(f.fontCharacter)){const u=f.fontId??h,m=l.get(u);if(m){const I={id:`pi-${u}`,definition:m};c.set(d,{fontCharacter:f.fontCharacter,font:I})}else t.push(r(12903,"Skipping icon definition '{0}'. Unknown font.",d))}else t.push(r(12904,"Skipping icon definition '{0}': Needs to be defined",d))}return{iconDefinitions:c}})}const Si=Jn();function Ci(i,e){const t=e.iconDefinitions;let o=t.get(i.id),n=i.defaults;for(;!o&&at.isThemeIcon(n);){const s=Si.getIcon(n.id);if(s)o=t.get(s.id),n=s.defaults;else return}if(o)return o;if(!at.isThemeIcon(n))return n}const Ii="vscode://schemas/product-icon-theme",yi={type:"object",allowComments:!0,allowTrailingCommas:!0,properties:{fonts:{type:"array",items:{type:"object",properties:{id:{type:"string",description:r(12999,"The ID of the font."),pattern:Ue.source,patternErrorMessage:st},src:{type:"array",description:r(13e3,"The location of the font."),items:{type:"object",properties:{path:{type:"string",description:r(13001,"The font path, relative to the current product icon theme file.")},format:{type:"string",description:r(13002,"The format of the font."),enum:["woff","woff2","truetype","opentype","embedded-opentype","svg"]}},required:["path","format"]}},weight:{type:"string",description:r(13003,"The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values."),anyOf:[{enum:["normal","bold","lighter","bolder"]},{type:"string",pattern:Ct.source}]},style:{type:"string",description:r(13004,"The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values."),anyOf:[{enum:["normal","italic","oblique"]},{type:"string",pattern:St.source}]}},required:["id","src"]}},iconDefinitions:{description:r(13005,"Association of icon name to a font character."),$ref:Qn}}};function Ei(){oe.as(Tt.JSONContribution).registerSchema(Ii,yi)}const Fe="vscode-theme-defaults",Ze="vscode.vscode-theme-seti-vs-seti",en="file-icons-enabled",bi="contributedColorTheme",ki="contributedFileIconTheme",Ri="contributedProductIconTheme",tn=oe.as(oo.ThemingContribution);function _i(i){switch(i){case H.VS:return`vs ${Fe}-themes-light_vs-json`;case H.VS_DARK:return`vs-dark ${Fe}-themes-dark_vs-json`;case H.HC_BLACK:return`hc-black ${Fe}-themes-hc_black-json`;case H.HC_LIGHT:return`hc-light ${Fe}-themes-hc_light-json`}return i}const wi=oi(),xi=ii(),vi=si();let dt=class extends an{constructor(e,t,o,n,s,a,l,c,h,d,f,u){super(),this.storageService=t,this.configurationService=o,this.telemetryService=n,this.environmentService=s,this.extensionResourceLoaderService=l,this.logService=h,this.hostColorService=d,this.userDataInitializationService=f,this.languageService=u,this.themeExtensionsActivated=new Map,this.container=c.mainContainer,this.settings=new pi(o,d),this.colorThemeRegistry=this._register(new Qe(wi,te.fromExtensionTheme)),this.colorThemeWatcher=this._register(new et(a,s,this.reloadCurrentColorTheme.bind(this))),this.onColorThemeChange=new we({leakWarningThreshold:400}),this.currentColorTheme=te.createUnloadedTheme(""),this.colorThemeSequencer=new Ye,this.fileIconThemeWatcher=this._register(new et(a,s,this.reloadCurrentFileIconTheme.bind(this))),this.fileIconThemeRegistry=this._register(new Qe(xi,X.fromExtensionTheme,!0,X.noIconTheme)),this.fileIconThemeLoader=new Xo(l,u),this.onFileIconThemeChange=new we({leakWarningThreshold:400}),this.currentFileIconTheme=X.createUnloadedTheme(""),this.fileIconThemeSequencer=new Ye,this.productIconThemeWatcher=this._register(new et(a,s,this.reloadCurrentProductIconTheme.bind(this))),this.productIconThemeRegistry=this._register(new Qe(vi,Z.fromExtensionTheme,!0,Z.defaultTheme)),this.onProductIconThemeChange=new we,this.currentProductIconTheme=Z.createUnloadedTheme(""),this.productIconThemeSequencer=new Ye,this._register(this.onDidColorThemeChange(F=>Pt().notifyThemeUpdate(F)));let m=te.fromStorageData(this.storageService);const I=this.settings.colorTheme;m&&I!==m.settingsId&&(m=void 0);const p=I===P.COLOR_THEME_LIGHT?Fo:I===P.COLOR_THEME_DARK?Ho:void 0;if(!m){const F=s.options?.initialColorTheme;F&&(m=te.createUnloadedThemeForThemeType(F.themeType,F.colors??p))}if(!m){const F=this.settings.getPreferredColorScheme()??(cn?k.LIGHT:k.DARK);m=te.createUnloadedThemeForThemeType(F,p)}m.setCustomizations(this.settings),this.applyTheme(m,void 0,!0);const T=X.fromStorageData(this.storageService);T&&this.applyAndSetFileIconTheme(T,!0);const R=Z.fromStorageData(this.storageService);R&&this.applyAndSetProductIconTheme(R,!0),e.whenInstalledExtensionsRegistered().then(F=>{this.installConfigurationListener(),this.installPreferredSchemeListener(),this.installRegistryListeners(),this.initialize().catch(Ke)});const S=ln();S.id="codiconStyles";const E=this._register(Xn(this));function A(){S.textContent=E.getCSS()}const U=this._register(new Zn(A,0));this._register(E.onDidChange(()=>U.schedule())),U.schedule()}initialize(){const e=this.environmentService.extensionDevelopmentLocationURI,t=e&&e.length===1?e[0]:void 0,o=async()=>{const a=this.colorThemeRegistry.findThemeByExtensionLocation(t);if(a.length){const c=a.find(h=>h.type===this.currentColorTheme.type);return this.setColorTheme(c?c.id:a[0].id,void 0)}let l=this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme,void 0);if(!l){await this.userDataInitializationService.whenInitializationFinished();const c=this.currentColorTheme.type===k.LIGHT?P.COLOR_THEME_LIGHT:P.COLOR_THEME_DARK;l=this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme,c)}return this.setColorTheme(l&&l.id,void 0)},n=async()=>{const a=this.fileIconThemeRegistry.findThemeByExtensionLocation(t);if(a.length)return this.setFileIconTheme(a[0].id,K.MEMORY);let l=this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);return l||(await this.userDataInitializationService.whenInitializationFinished(),l=this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme)),this.setFileIconTheme(l?l.id:Ze,void 0)},s=async()=>{const a=this.productIconThemeRegistry.findThemeByExtensionLocation(t);if(a.length)return this.setProductIconTheme(a[0].id,K.MEMORY);let l=this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);return l||(await this.userDataInitializationService.whenInitializationFinished(),l=this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme)),this.setProductIconTheme(l?l.id:xe,void 0)};return Promise.all([o(),n(),s()])}installConfigurationListener(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if((e.affectsConfiguration(C.COLOR_THEME)||e.affectsConfiguration(C.PREFERRED_DARK_THEME)||e.affectsConfiguration(C.PREFERRED_LIGHT_THEME)||e.affectsConfiguration(C.PREFERRED_HC_DARK_THEME)||e.affectsConfiguration(C.PREFERRED_HC_LIGHT_THEME)||e.affectsConfiguration(C.DETECT_COLOR_SCHEME)||e.affectsConfiguration(C.DETECT_HC)||e.affectsConfiguration(C.SYSTEM_COLOR_THEME))&&this.restoreColorTheme(),e.affectsConfiguration(C.FILE_ICON_THEME)&&this.restoreFileIconTheme(),e.affectsConfiguration(C.PRODUCT_ICON_THEME)&&this.restoreProductIconTheme(),this.currentColorTheme){let t=!1;e.affectsConfiguration(C.COLOR_CUSTOMIZATIONS)&&(this.currentColorTheme.setCustomColors(this.settings.colorCustomizations),t=!0),e.affectsConfiguration(C.TOKEN_COLOR_CUSTOMIZATIONS)&&(this.currentColorTheme.setCustomTokenColors(this.settings.tokenColorCustomizations),t=!0),e.affectsConfiguration(C.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS)&&(this.currentColorTheme.setCustomSemanticTokenColors(this.settings.semanticTokenColorCustomizations),t=!0),t&&(this.updateDynamicCSSRules(this.currentColorTheme),this.onColorThemeChange.fire(this.currentColorTheme))}}))}installRegistryListeners(){let e;this._register(this.colorThemeRegistry.onDidChange(async n=>{if(Qt(n.themes),await this.restoreColorTheme())this.currentColorTheme.settingsId===P.COLOR_THEME_DARK&&!se(e)&&await this.colorThemeRegistry.findThemeById(e)?(await this.setColorTheme(e,"auto"),e=void 0):n.added.some(s=>s.settingsId===this.currentColorTheme.settingsId)&&await this.reloadCurrentColorTheme();else if(n.removed.some(s=>s.settingsId===this.currentColorTheme.settingsId)){e=this.currentColorTheme.id;const s=this.colorThemeRegistry.findThemeBySettingsId(P.COLOR_THEME_DARK);await this.setColorTheme(s,"auto")}}));let t;this._register(this._register(this.fileIconThemeRegistry.onDidChange(async n=>{Xt(n.themes),await this.restoreFileIconTheme()?this.currentFileIconTheme.id===Ze&&!se(t)&&this.fileIconThemeRegistry.findThemeById(t)?(await this.setFileIconTheme(t,"auto"),t=void 0):n.added.some(s=>s.settingsId===this.currentFileIconTheme.settingsId)&&await this.reloadCurrentFileIconTheme():n.removed.some(s=>s.settingsId===this.currentFileIconTheme.settingsId)&&(t=this.currentFileIconTheme.id,await this.setFileIconTheme(Ze,"auto"))})));let o;return this._register(this.productIconThemeRegistry.onDidChange(async n=>{Zt(n.themes),await this.restoreProductIconTheme()?this.currentProductIconTheme.id===xe&&!se(o)&&this.productIconThemeRegistry.findThemeById(o)?(await this.setProductIconTheme(o,"auto"),o=void 0):n.added.some(s=>s.settingsId===this.currentProductIconTheme.settingsId)&&await this.reloadCurrentProductIconTheme():n.removed.some(s=>s.settingsId===this.currentProductIconTheme.settingsId)&&(o=this.currentProductIconTheme.id,await this.setProductIconTheme(xe,"auto"))})),this._register(this.languageService.onDidChange(()=>this.reloadCurrentFileIconTheme())),Promise.all([this.getColorThemes(),this.getFileIconThemes(),this.getProductIconThemes()]).then(([n,s,a])=>{Qt(n),Xt(s),Zt(a)})}installPreferredSchemeListener(){this._register(this.hostColorService.onDidChangeColorScheme(()=>{this.settings.isDetectingColorScheme()&&this.restoreColorTheme()}))}getColorTheme(){return this.currentColorTheme}async getColorThemes(){return this.colorThemeRegistry.getThemes()}getPreferredColorScheme(){return this.settings.getPreferredColorScheme()}async getMarketplaceColorThemes(e,t,o){const n=await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({publisher:e,name:t,version:o},"extension");if(n)try{const s=await this.extensionResourceLoaderService.readExtensionResource(ne(n,"package.json"));return this.colorThemeRegistry.getMarketplaceThemes(JSON.parse(s),n,G.fromName(e,t))}catch(s){this.logService.error("Problem loading themes from marketplace",s)}return[]}get onDidColorThemeChange(){return this.onColorThemeChange.event}setColorTheme(e,t){return this.colorThemeSequencer.queue(async()=>this.internalSetColorTheme(e,t))}async internalSetColorTheme(e,t){if(!e)return null;const o=O(e)?_i(e):e.id;if(this.currentColorTheme.isLoaded&&o===this.currentColorTheme.id)return t!=="preview"&&this.currentColorTheme.toStorage(this.storageService),this.settings.setColorTheme(this.currentColorTheme,t);let n=this.colorThemeRegistry.findThemeById(o);if(!n)if(e instanceof te)n=e;else return null;try{return await n.ensureLoaded(this.extensionResourceLoaderService),n.setCustomizations(this.settings),this.applyTheme(n,t)}catch(s){throw new Error(r(12905,"Unable to load {0}: {1}",n.location?.toString(),s.message))}}reloadCurrentColorTheme(){return this.colorThemeSequencer.queue(async()=>{try{const e=this.colorThemeRegistry.findThemeBySettingsId(this.currentColorTheme.settingsId)||this.currentColorTheme;await e.reload(this.extensionResourceLoaderService),e.setCustomizations(this.settings),await this.applyTheme(e,void 0,!1)}catch{this.logService.info("Unable to reload {0}: {1}",this.currentColorTheme.location?.toString())}})}async restoreColorTheme(){return this.colorThemeSequencer.queue(async()=>{const e=this.settings.colorTheme,t=this.colorThemeRegistry.findThemeBySettingsId(e);return t?(e!==this.currentColorTheme.settingsId?await this.internalSetColorTheme(t.id,void 0):t!==this.currentColorTheme&&(await t.ensureLoaded(this.extensionResourceLoaderService),t.setCustomizations(this.settings),await this.applyTheme(t,void 0,!0)),!0):!1})}updateDynamicCSSRules(e){const t=new Set,o={addRule:s=>{t.has(s)||t.add(s)}};o.addRule(".monaco-workbench { forced-color-adjust: none; }"),tn.getThemingParticipants().forEach(s=>s(e,o,this.environmentService));const n=[];for(const s of Pt().getColors()){const a=e.getColor(s.id,!0);a&&n.push(`${eo(s.id)}: ${a.toString()};`)}o.addRule(`.monaco-workbench { ${n.join(`
|
|
14
|
+
`)} }`),tt([...t].join(`
|
|
15
|
+
`),bi)}applyTheme(e,t,o=!1){return this.updateDynamicCSSRules(e),this.currentColorTheme.id?this.container.classList.remove(...this.currentColorTheme.classNames):this.container.classList.remove(H.VS,H.VS_DARK,H.HC_BLACK,H.HC_LIGHT),this.container.classList.add(...e.classNames),this.currentColorTheme.clearCaches(),this.currentColorTheme=e,this.colorThemingParticipantChangeListener||(this.colorThemingParticipantChangeListener=tn.onThemingParticipantAdded(n=>this.updateDynamicCSSRules(this.currentColorTheme))),this.colorThemeWatcher.update(e),this.sendTelemetry(e.id,e.extensionData,"color"),o?Promise.resolve(null):(this.onColorThemeChange.fire(this.currentColorTheme),e.isLoaded&&t!=="preview"&&e.toStorage(this.storageService),this.settings.setColorTheme(this.currentColorTheme,t))}sendTelemetry(e,t,o){if(t){const n=o+t.extensionId;this.themeExtensionsActivated.get(n)||(this.telemetryService.publicLog2("activatePlugin",{id:t.extensionId,name:t.extensionName,isBuiltin:t.extensionIsBuiltin,publisherDisplayName:t.extensionPublisher,themeId:e}),this.themeExtensionsActivated.set(n,!0))}}async getFileIconThemes(){return this.fileIconThemeRegistry.getThemes()}getFileIconTheme(){return this.currentFileIconTheme}get onDidFileIconThemeChange(){return this.onFileIconThemeChange.event}async setFileIconTheme(e,t){return this.fileIconThemeSequencer.queue(async()=>this.internalSetFileIconTheme(e,t))}async internalSetFileIconTheme(e,t){e===void 0&&(e="");const o=O(e)?e:e.id;if(o!==this.currentFileIconTheme.id||!this.currentFileIconTheme.isLoaded){let s=this.fileIconThemeRegistry.findThemeById(o);!s&&e instanceof X&&(s=e),s||(s=X.noIconTheme),await s.ensureLoaded(this.fileIconThemeLoader),this.applyAndSetFileIconTheme(s)}const n=this.currentFileIconTheme;return n.isLoaded&&t!=="preview"&&(!n.location||!Lt(n.location))&&n.toStorage(this.storageService),await this.settings.setFileIconTheme(this.currentFileIconTheme,t),n}async getMarketplaceFileIconThemes(e,t,o){const n=await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({publisher:e,name:t,version:o},"extension");if(n)try{const s=await this.extensionResourceLoaderService.readExtensionResource(ne(n,"package.json"));return this.fileIconThemeRegistry.getMarketplaceThemes(JSON.parse(s),n,G.fromName(e,t))}catch(s){this.logService.error("Problem loading themes from marketplace",s)}return[]}async reloadCurrentFileIconTheme(){return this.fileIconThemeSequencer.queue(async()=>{await this.currentFileIconTheme.reload(this.fileIconThemeLoader),this.applyAndSetFileIconTheme(this.currentFileIconTheme)})}async restoreFileIconTheme(){return this.fileIconThemeSequencer.queue(async()=>{const e=this.settings.fileIconTheme,t=this.fileIconThemeRegistry.findThemeBySettingsId(e);return t?(e!==this.currentFileIconTheme.settingsId?await this.internalSetFileIconTheme(t.id,void 0):t!==this.currentFileIconTheme&&(await t.ensureLoaded(this.fileIconThemeLoader),this.applyAndSetFileIconTheme(t,!0)),!0):!1})}applyAndSetFileIconTheme(e,t=!1){this.currentFileIconTheme=e,tt(e.styleSheetContent,ki),e.id?this.container.classList.add(en):this.container.classList.remove(en),this.fileIconThemeWatcher.update(e),e.id&&this.sendTelemetry(e.id,e.extensionData,"fileIcon"),t||this.onFileIconThemeChange.fire(this.currentFileIconTheme)}async getProductIconThemes(){return this.productIconThemeRegistry.getThemes()}getProductIconTheme(){return this.currentProductIconTheme}get onDidProductIconThemeChange(){return this.onProductIconThemeChange.event}async setProductIconTheme(e,t){return this.productIconThemeSequencer.queue(async()=>this.internalSetProductIconTheme(e,t))}async internalSetProductIconTheme(e,t){e===void 0&&(e="");const o=O(e)?e:e.id;if(o!==this.currentProductIconTheme.id||!this.currentProductIconTheme.isLoaded){let s=this.productIconThemeRegistry.findThemeById(o);!s&&e instanceof Z&&(s=e),s||(s=Z.defaultTheme),await s.ensureLoaded(this.extensionResourceLoaderService,this.logService),this.applyAndSetProductIconTheme(s)}const n=this.currentProductIconTheme;return n.isLoaded&&t!=="preview"&&(!n.location||!Lt(n.location))&&n.toStorage(this.storageService),await this.settings.setProductIconTheme(this.currentProductIconTheme,t),n}async getMarketplaceProductIconThemes(e,t,o){const n=await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({publisher:e,name:t,version:o},"extension");if(n)try{const s=await this.extensionResourceLoaderService.readExtensionResource(ne(n,"package.json"));return this.productIconThemeRegistry.getMarketplaceThemes(JSON.parse(s),n,G.fromName(e,t))}catch(s){this.logService.error("Problem loading themes from marketplace",s)}return[]}async reloadCurrentProductIconTheme(){return this.productIconThemeSequencer.queue(async()=>{await this.currentProductIconTheme.reload(this.extensionResourceLoaderService,this.logService),this.applyAndSetProductIconTheme(this.currentProductIconTheme)})}async restoreProductIconTheme(){return this.productIconThemeSequencer.queue(async()=>{const e=this.settings.productIconTheme,t=this.productIconThemeRegistry.findThemeBySettingsId(e);return t?(e!==this.currentProductIconTheme.settingsId?await this.internalSetProductIconTheme(t.id,void 0):t!==this.currentProductIconTheme&&(await t.ensureLoaded(this.extensionResourceLoaderService,this.logService),this.applyAndSetProductIconTheme(t,!0)),!0):!1})}applyAndSetProductIconTheme(e,t=!1){this.currentProductIconTheme=e,tt(e.styleSheetContent,Ri),this.productIconThemeWatcher.update(e),e.id&&this.sendTelemetry(e.id,e.extensionData,"productIcon"),t||this.onProductIconThemeChange.fire(this.currentProductIconTheme)}};dt=kt([w(0,so),w(1,ro),w(2,hn),w(3,ao),w(4,co),w(5,lo),w(6,Rt),w(7,ho),w(8,dn),w(9,uo),w(10,fo),w(11,mo)],dt);class et{constructor(e,t,o){this.fileService=e,this.environmentService=t,this.onUpdate=o,this.watcherDisposables=new Et}update(e){to(e.location,this.watchedLocation)||(this.watchedLocation=void 0,this.watcherDisposables.clear(),e.location&&(e.watch||this.environmentService.isExtensionDevelopment)&&(this.watchedLocation=e.location,this.watcherDisposables.add(this.fileService.watch(e.location)),this.watcherDisposables.add(this.fileService.onDidFilesChange(t=>{this.watchedLocation&&t.contains(this.watchedLocation,no.UPDATED)&&this.onUpdate()}))))}dispose(){this.watcherDisposables.dispose(),this.watchedLocation=void 0}}function tt(i,e){const t=(io??bt.document.head).querySelectorAll(`.${e}`);if(t.length===0){const o=ln();o.className=e,o.textContent=i}else t[0].textContent=i}ni();Qo();Ei();const Di=go("theme-selection-manage-extension",ct.gear,r(11359,"Icon for the 'Manage' action in the theme selection quick pick."));var me;(function(i){i.BROWSE_GALLERY="marketplace",i.EXTENSIONS_VIEW="extensions",i.CUSTOM_TOP_ENTRY="customTopEntry"})(me||(me={}));let We=class{constructor(e,t,o,n,s,a,l,c,h){this.getMarketplaceColorThemes=e,this.marketplaceQuery=t,this.extensionGalleryService=o,this.extensionManagementService=n,this.quickInputService=s,this.logService=a,this.progressService=l,this.extensionsWorkbenchService=c,this.dialogService=h,this._marketplaceExtensions=new Set,this._marketplaceThemes=[],this._searchOngoing=!1,this._searchError=void 0,this._onDidChange=new we,this._queryDelayer=new _o(200),this._installedExtensions=n.getInstalled().then(d=>{const f=new Set;for(const u of d)f.add(u.identifier.id);return f})}get themes(){return this._marketplaceThemes}get onDidChange(){return this._onDidChange.event}trigger(e){this._tokenSource&&(this._tokenSource.cancel(),this._tokenSource=void 0),this._queryDelayer.trigger(()=>(this._tokenSource=new wo,this.doSearch(e,this._tokenSource.token)))}async doSearch(e,t){this._searchOngoing=!0,this._onDidChange.fire();try{const o=await this._installedExtensions,n={text:`${this.marketplaceQuery} ${e}`,pageSize:20},s=await this.extensionGalleryService.query(n,t);for(let a=0;a<s.total&&a<1&&!t.isCancellationRequested;a++){const l=this._marketplaceThemes.length,c=a===0?s.firstPage:await s.getPage(a,t),h=[],d=[];for(let u=0;u<c.length&&!t.isCancellationRequested;u++){const m=c[u];!o.has(m.identifier.id)&&!this._marketplaceExtensions.has(m.identifier.id)&&(this._marketplaceExtensions.add(m.identifier.id),h.push(this.getMarketplaceColorThemes(m.publisher,m.name,m.version)),d.push(m))}const f=await Promise.all(h);for(let u=0;u<f.length;u++){const m=d[u];for(const I of f[u])this._marketplaceThemes.push({id:I.id,theme:I,label:I.label,description:`${m.displayName} · ${m.publisherDisplayName}`,galleryExtension:m,buttons:[vt]})}l!==this._marketplaceThemes.length&&(this._marketplaceThemes.sort((u,m)=>u.label.localeCompare(m.label)),this._onDidChange.fire())}}catch(o){xo(o)||(this.logService.error("Error while searching for themes:",o),this._searchError="message"in o?o.message:String(o))}finally{this._searchOngoing=!1,this._onDidChange.fire()}}openQuickPick(e,t,o){let n;const s=new Et;return new Promise((a,l)=>{const c=s.add(this.quickInputService.createQuickPick());c.items=[],c.sortByLabel=!1,c.matchOnDescription=!0,c.buttons=[this.quickInputService.backButton],c.title="Marketplace Themes",c.placeholder=r(11360,"Type to Search More. Select to Install. Up/Down Keys to Preview"),c.canSelectMany=!1,s.add(c.onDidChangeValue(()=>this.trigger(c.value))),s.add(c.onDidAccept(async h=>{const d=c.selectedItems[0];if(d?.galleryExtension){n="selected",c.hide();const f=await this.installExtension(d.galleryExtension);o(f?d.theme:t,!0)}})),s.add(c.onDidTriggerItemButton(h=>{if(qe(h.item)){const d=h.item.theme?.extensionData?.extensionId;d?this.extensionsWorkbenchService.openSearch(`@id:${d}`):this.extensionsWorkbenchService.openSearch(`${this.marketplaceQuery} ${c.value}`)}})),s.add(c.onDidChangeActive(h=>{n===void 0&&o(h[0]?.theme,!1)})),s.add(c.onDidHide(()=>{n===void 0&&(o(t,!0),n="cancelled"),a(n)})),s.add(c.onDidTriggerButton(h=>{h===this.quickInputService.backButton&&(n="back",c.hide())})),s.add(this.onDidChange(()=>{let h=this.themes;this._searchOngoing?h=h.concat({label:"$(loading~spin) Searching for themes...",id:void 0,alwaysShow:!0}):h.length===0&&this._searchError&&(h=[{label:`$(error) ${r(11361,"Error while searching for themes: {0}",this._searchError)}`,id:void 0,alwaysShow:!0}]);const d=c.activeItems[0]?.id,f=d?h.find(u=>qe(u)&&u.id===d):void 0;c.items=h,f&&(c.activeItems=[f])})),this.trigger(e),c.show()}).finally(()=>{s.dispose()})}async installExtension(e){if(this.extensionsWorkbenchService.openSearch(`@id:${e.identifier.id}`),!(await this.dialogService.confirm({message:r(11362,"This will install extension '{0}' published by '{1}'. Do you want to continue?",e.displayName,e.publisherDisplayName),primaryButton:r(11363,"OK")})).confirmed)return!1;try{return await this.progressService.withProgress({location:vo.Notification,title:r(11364,"Installing Extension {0}...",e.displayName)},async()=>{await this.extensionManagementService.installFromGallery(e,{isMachineScoped:!1})}),!0}catch(o){return this.logService.error(`Problem installing extension ${e.identifier.id}`,o),!1}}dispose(){this._tokenSource&&(this._tokenSource.cancel(),this._tokenSource=void 0),this._queryDelayer.dispose(),this._marketplaceExtensions.clear(),this._marketplaceThemes.length=0,this._onDidChange.dispose()}};We=kt([w(2,_t),w(3,po),w(4,un),w(5,dn),w(6,To),w(7,wt),w(8,So)],We);let De=class{constructor(e,t,o,n,s,a,l,c){this.options=e,this.setTheme=t,this.getMarketplaceColorThemes=o,this.quickInputService=n,this.extensionGalleryService=s,this.extensionsWorkbenchService=a,this.extensionResourceLoaderService=l,this.instantiationService=c}async openQuickPick(e,t){let o;this.extensionGalleryService.isEnabled()&&(await this.extensionResourceLoaderService.supportsExtensionGalleryResources()&&this.options.browseMessage?(o=this.instantiationService.createInstance(We,this.getMarketplaceColorThemes.bind(this),this.options.marketplaceTag),e=[nn(this.options.browseMessage,me.BROWSE_GALLERY),...e]):e=[...e,{type:"separator"},nn(this.options.installMessage,me.EXTENSIONS_VIEW)]);let n;const s=(l,c)=>{n&&clearTimeout(n),n=bt.setTimeout(()=>{n=void 0;const h=l??t;this.setTheme(h,c?"auto":"preview").then(void 0,d=>{Ke(d),this.setTheme(t,void 0)})},c?0:200)},a=l=>{const c=new Et;return new Promise((h,d)=>{let f=!1;const u=e.findIndex(I=>qe(I)&&I.id===l),m=c.add(this.quickInputService.createQuickPick({useSeparators:!0}));m.items=e,m.title=this.options.title,m.description=this.options.description,m.placeholder=this.options.placeholderMessage,m.activeItems=[e[u]],m.canSelectMany=!1,m.toggles=this.options.toggles,m.toggles?.forEach(I=>{c.add(I.onChange(()=>this.options.onToggle?.(I,m)))}),m.matchOnDescription=!0,c.add(m.onDidAccept(async I=>{f=!0;const p=m.selectedItems[0];!p||p.configureItem?!p||p.configureItem===me.EXTENSIONS_VIEW?this.extensionsWorkbenchService.openSearch(`${this.options.marketplaceTag} ${m.value}`):p.configureItem===me.BROWSE_GALLERY&&o&&await o.openQuickPick(m.value,t,s)==="back"&&await a(void 0):s(p.theme,!0),m.hide(),h()})),c.add(m.onDidChangeActive(I=>s(I[0]?.theme,!1))),c.add(m.onDidHide(()=>{f||(s(t,!0),h()),m.dispose()})),c.add(m.onDidTriggerItemButton(I=>{if(qe(I.item)){const p=I.item.theme?.extensionData?.extensionId;p?this.extensionsWorkbenchService.openSearch(`@id:${p}`):this.extensionsWorkbenchService.openSearch(`${this.options.marketplaceTag} ${m.value}`)}})),m.show()}).finally(()=>{c.dispose()})};await a(t.id),o?.dispose()}};De=kt([w(3,un),w(4,_t),w(5,wt),w(6,Rt),w(7,Ae)],De);const kn="workbench.action.selectTheme";pe(class extends Te{constructor(){super({id:kn,title:Ce(11365,"Color Theme"),category:Se.Preferences,f1:!0,keybinding:{weight:Io.WorkbenchContrib,primary:Co(Ht.CtrlCmd|Ft.KeyK,Ht.CtrlCmd|Ft.KeyT)}})}getTitle(i){switch(i){case k.DARK:return r(11366,"Select Color Theme for System Dark Mode");case k.LIGHT:return r(11367,"Select Color Theme for System Light Mode");case k.HIGH_CONTRAST_DARK:return r(11368,"Select Color Theme for High Contrast Dark Mode");case k.HIGH_CONTRAST_LIGHT:return r(11369,"Select Color Theme for High Contrast Light Mode");default:return r(11370,"Select Color Theme (detect system color mode disabled)")}}async run(i){const e=i.get(le),t=i.get(fn),o=e.getPreferredColorScheme();let n;o?n=new Nt({title:r(11371,"Detect system color mode enabled. Click to configure."),icon:ct.colorMode,isChecked:!1,...$t}):n=new Nt({title:r(11372,"Detect system color mode disabled. Click to configure."),icon:ct.colorMode,isChecked:!1,...$t});const s={installMessage:r(11373,"Install Additional Color Themes..."),browseMessage:"$(plus) "+r(11374,"Browse Additional Color Themes..."),placeholderMessage:this.getTitle(o),marketplaceTag:"category:themes",toggles:[n],onToggle:async(T,R)=>{R.hide(),await t.openSettings({query:C.DETECT_COLOR_SCHEME})}},a=(T,R)=>e.setColorTheme(T,R),l=(T,R,S)=>e.getMarketplaceColorThemes(T,R,S),h=i.get(Ae).createInstance(De,s,a,l),d=await e.getColorThemes(),f=e.getColorTheme(),u=ve(d.filter(T=>T.type===k.LIGHT),r(11375,"light themes")),m=ve(d.filter(T=>T.type===k.DARK),r(11376,"dark themes")),I=ve(d.filter(T=>yo(T.type)),r(11377,"high contrast themes"));let p;switch(o){case k.DARK:p=[...m,...u,...I];break;case k.HIGH_CONTRAST_DARK:case k.HIGH_CONTRAST_LIGHT:p=[...I,...u,...m];break;case k.LIGHT:default:p=[...u,...m,...I];break}await h.openQuickPick(p,f)}});const Rn="workbench.action.selectIconTheme";pe(class extends Te{constructor(){super({id:Rn,title:Ce(11378,"File Icon Theme"),category:Se.Preferences,f1:!0})}async run(i){const e=i.get(le),t={installMessage:r(11379,"Install Additional File Icon Themes..."),placeholderMessage:r(11380,"Select File Icon Theme (Up/Down Keys to Preview)"),marketplaceTag:"tag:icon-theme"},o=(c,h)=>e.setFileIconTheme(c,h),n=(c,h,d)=>e.getMarketplaceFileIconThemes(c,h,d),a=i.get(Ae).createInstance(De,t,o,n),l=[{type:"separator",label:r(11381,"file icon themes")},{id:"",theme:X.noIconTheme,label:r(11382,"None"),description:r(11383,"Disable File Icons")},...ve(await e.getFileIconThemes())];await a.openQuickPick(l,e.getFileIconTheme())}});const _n="workbench.action.selectProductIconTheme";pe(class extends Te{constructor(){super({id:_n,title:Ce(11384,"Product Icon Theme"),category:Se.Preferences,f1:!0})}async run(i){const e=i.get(le),t={installMessage:r(11385,"Install Additional Product Icon Themes..."),browseMessage:"$(plus) "+r(11386,"Browse Additional Product Icon Themes..."),placeholderMessage:r(11387,"Select Product Icon Theme (Up/Down Keys to Preview)"),marketplaceTag:"tag:product-icon-theme"},o=(c,h)=>e.setProductIconTheme(c,h),n=(c,h,d)=>e.getMarketplaceProductIconThemes(c,h,d),a=i.get(Ae).createInstance(De,t,o,n),l=[{type:"separator",label:r(11388,"product icon themes")},{id:xe,theme:Z.defaultTheme,label:r(11389,"Default")},...ve(await e.getProductIconThemes())];await a.openQuickPick(l,e.getProductIconTheme())}});Eo.registerCommand("workbench.action.previewColorTheme",async function(i,e,t){const o=i.get(le);let n=Ai(await o.getColorThemes(),e);n.length===0&&(n=await o.getMarketplaceColorThemes(e.publisher,e.name,e.version));for(const s of n)if(!t||s.settingsId===t)return await o.setColorTheme(s,"preview"),s.settingsId});function Ai(i,e){return i.filter(({extensionData:t})=>t&&t.extensionIsBuiltin&&Bt(t.extensionPublisher,e.publisher)&&Bt(t.extensionName,e.name))}function nn(i,e){return{id:void 0,label:i,alwaysShow:!0,buttons:[vt],configureItem:e}}function qe(i){return i.type!=="separator"}function Oi(i){const e=i.settingsId??void 0,t={id:i.id,theme:i,label:i.label,description:i.description||(i.label===e?void 0:e)};return i.extensionData&&(t.buttons=[vt]),t}function ve(i,e){const t=(n,s)=>n.label.localeCompare(s.label),o=i.map(Oi).sort(t);return o.length>0&&e&&o.unshift({type:"separator",label:e}),o}const vt={iconClass:at.asClassName(Di),tooltip:r(11390,"Manage Extension")};pe(class extends Te{constructor(){super({id:"workbench.action.generateColorTheme",title:Ce(11391,"Generate Color Theme From Current Settings"),category:Se.Developer,f1:!0})}run(i){const t=i.get(le).getColorTheme(),n=oe.as(on.ColorContribution).getColors().filter(d=>!d.deprecationMessage).map(d=>d.id).sort(),s={},a=[];for(const d of n){const f=t.getColor(d,!1);f?s[d]=z.Format.CSS.formatHexA(f,!0):a.push(d)}const l=[];for(const d of a){const f=t.getColor(d);f?s["__"+d]=z.Format.CSS.formatHexA(f,!0):l.push(d)}for(const d of l)s["__"+d]=null;let c=JSON.stringify({$schema:Sn,type:t.type,colors:s,tokenColors:t.tokenColors.filter(d=>!!d.scope)},null," ");return c=c.replace(/\"__/g,'//"'),i.get(bo).openEditor({resource:void 0,contents:c,languageId:"jsonc",options:{pinned:!0}})}});const Mi="workbench.action.toggleLightDarkThemes";pe(class extends Te{constructor(){super({id:Mi,title:Ce(11392,"Toggle between Light/Dark Themes"),category:Se.Preferences,f1:!0})}async run(i){const e=i.get(le),t=i.get(hn),o=i.get(ko),n=i.get(fn);if(t.getValue(C.DETECT_COLOR_SCHEME)){const c=r(11393,"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",C.DETECT_COLOR_SCHEME);o.prompt(Ro.Info,c,[{label:r(11394,"Open Settings"),run:()=>n.openUserSettings({query:C.DETECT_COLOR_SCHEME})}]);return}const s=e.getColorTheme();let a=C.PREFERRED_DARK_THEME;switch(s.type){case k.LIGHT:a=C.PREFERRED_DARK_THEME;break;case k.DARK:a=C.PREFERRED_LIGHT_THEME;break;case k.HIGH_CONTRAST_LIGHT:a=C.PREFERRED_HC_DARK_THEME;break;case k.HIGH_CONTRAST_DARK:a=C.PREFERRED_HC_LIGHT_THEME;break}const l=t.getValue(a);if(l&&typeof l=="string"){const c=(await e.getColorThemes()).find(h=>h.settingsId===l);c&&e.setColorTheme(c.id,"auto")}}});const Pi="workbench.action.browseColorThemesInMarketplace";pe(class extends Te{constructor(){super({id:Pi,title:Ce(11395,"Browse Color Themes in Marketplace"),category:Se.Preferences,f1:!0})}async run(i){const e="category:themes",t=i.get(le),o=i.get(_t),n=i.get(Rt),s=i.get(wt),a=i.get(Ae);if(!o.isEnabled())return;if(!await n.supportsExtensionGalleryResources()){await s.openSearch(e);return}const l=t.getColorTheme(),c=(u,m,I)=>t.getMarketplaceColorThemes(u,m,I);let h;const d=(u,m)=>{h&&clearTimeout(h),h=bt.setTimeout(()=>{h=void 0;const I=u??l;t.setColorTheme(I,m?"auto":"preview").then(void 0,p=>{Ke(p),t.setColorTheme(l,void 0)})},m?0:200)};await a.createInstance(We,c,e).openQuickPick("",t.getColorTheme(),d).then(void 0,Ke)}});const Me=new xt("ThemesSubMenu");Oe.appendMenuItem(xt.GlobalActivity,{title:r(11396,"Themes"),submenu:Me,group:"2_configuration",order:7});Oe.appendMenuItem(xt.MenubarPreferencesMenu,{title:r(11397,"&&Themes"),submenu:Me,group:"2_configuration",order:7});Oe.appendMenuItem(Me,{command:{id:kn,title:r(11365,"Color Theme")},order:1});Oe.appendMenuItem(Me,{command:{id:Rn,title:r(11398,"File Icon Theme")},order:2});Oe.appendMenuItem(Me,{command:{id:_n,title:r(11399,"Product Icon Theme")},order:3});class Li extends dt{registerEditorContainer(){return{dispose(){}}}setTheme(e){this.getColorThemes().then(t=>{setTimeout(()=>{this.setColorTheme(t.find(o=>o.settingsId===e)??e,K.MEMORY)})})}}function Gi(){return{...Do(),[Ao.toString()]:new rn(Li,[],!1)}}export{Gi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ak as _,cb as Q,bW as U,cc as L,ap as Z,f as ee,g as te,W as ie,cd as oe,ce as re,cf as ne,an as se,bx as ae,O as le,bw as ce,cg as de,ch as ue,h as fe,bz as pe,ci as ge,cj as Pe,ck as p,cl as O,cm as V,cn as g,co as we,cp as d,cq as M,aJ as T,U as ve,cr as K,cs as x,ct as E,cu as ye,cv as me,cw as Re,G as Se}from"./index-BwfWF2CI.js";import{cD as Ne,cE as Fe,cx as Ye,cB as Xe,cH as $e,cF as je,cz as qe,cy as Je,cC as ze,cG as Qe,cA as Ze}from"./index-BwfWF2CI.js";import{g as he,a as Te,E as Ae,S as Ce,P as be,A as Ee}from"./views-hUfpm9tT.js";import{b as tt}from"./views-hUfpm9tT.js";import{M as Ie,a as Be}from"./editor-BivTGeL1.js";import"./files.contribution._fileEditorFactory-vS4ZLYi1.js";import"./workbenchThemeService.service-qBFVnuYD.js";function Oe(t,r,c){const P=document.createElement(r==="status"?"footer":"div");return P.classList.add("part","monaco-workbench-part",...c),P.id=t,P.setAttribute("role",r),r==="status"&&P.setAttribute("aria-live","off"),P}function Ve(t){const r=t.getContainer()?.parentNode;r!=null&&t.layout(Math.max(t.minimumWidth,Math.min(t.maximumWidth,r.offsetWidth)),Math.max(t.minimumHeight,Math.min(t.maximumHeight,r.offsetHeight)),r.offsetTop,r.offsetLeft)}function xe(t,r){t.oncontextmenu=()=>!1;function c(){Ve(r)}r.onDidVisibilityChange(P=>{P&&c()}),c()}function De(t){return t.isConnected?t.checkVisibility!=null?t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):t.offsetHeight>0&&t.offsetWidth>0:!1}function I(){const t=Z.get(L).mainPart.getContainer();return t!=null&&De(t)}let D=class extends Be{constructor(r){super(r.createInstance(Ae),!1,r),this.restoreGroup=(...c)=>this.delegate.restoreGroup(...c)}getId(){return"standalone"}updateStyles(){}registerPart(r){return this.delegate.registerPart(r)}bind(r,c){return this.delegate.bind(r,c)}get activePart(){return this.delegate.activePart}};D=ee([te(0,ie)],D);let H=t=>t;oe(async t=>{const r=t.get(re),c=t.get(ne),P=t.get(se),m=t.get(ae),R=t.get(L),N=t.get(U),S=t.get(le),F=t.get(ce),A=t.get(de),k=t.get(ue),W=t.get(fe),Y=t.get(pe),X=t.get(ge),u=t.get(Pe);function $(){const e=A.options?.defaultLayout;if((e?.editors!=null&&e.editors.length>0||e?.layout?.editors!=null)&&((e.force??!1)||m.isNew(T.WORKSPACE)))return{layout:e.layout?.editors,filesToOpenOrCreate:e.editors?.map(i=>({viewColumn:i.viewColumn,fileUri:ve.revive(i.uri),openOnlyIfExists:i.openOnlyIfExists,options:i.options}))};const{filesToOpenOrCreate:l,filesToDiff:o,filesToMerge:a}=A;if(l!=null||o!=null||a!=null)return{filesToOpenOrCreate:l,filesToDiff:o,filesToMerge:a}}function j(e,l){const o=e.options?.defaultLayout;if(o==null||!(o.force??!1)&&!l.isNew(T.WORKSPACE))return;const{views:a}=o;if(a!=null&&a.length>0)return a.map(i=>i.id)}function q(e,l){return me(e.getWorkspace())?!1:!!(W.getValue("window.restoreWindows")==="preserve")||l===void 0}async function J(e,l){if(l!=null){const o=K(await x(l.filesToMerge,e,S));if(o.length===4&&E(o[0])&&E(o[1])&&E(o[2])&&E(o[3]))return[{editor:{input1:{resource:o[0].resource},input2:{resource:o[1].resource},base:{resource:o[2].resource},result:{resource:o[3].resource},options:{pinned:!0}}}];const a=K(await x(l.filesToDiff,e,S));if(a.length===2)return[{editor:{original:{resource:a[0].resource},modified:{resource:a[1].resource},options:{pinned:!0}}}];const i=[],f=await x(l.filesToOpenOrCreate,e,S);for(let s=0;s<f.length;s++){const w=f[s];w!=null&&i.push({editor:w,viewColumn:l.filesToOpenOrCreate?.[s].viewColumn})}return i}else if(k.getWorkbenchState()===ye.EMPTY&&W.getValue("workbench.startupEditor")==="newUntitledFile")return R.mainPart.hasRestorableState?[]:await X.hasBackups()?[]:[{editor:{resource:void 0}}];return[]}const h=$();h!=null&&S.info("Initial editor state",h);let n={layout:{editors:h?.layout},editor:{restoreEditors:q(k,h),editorsToOpen:J(Y,h)},views:{defaults:j(A,m),containerToRestore:{}}};function v(e){return c.getDefaultViewContainer(e)??c.getViewContainersByLocation(e)[0]}function z(){if(u.isVisible(p.SIDEBAR_PART)){let e;!A.isBuilt||P.startupKind===Re.ReloadedWindow||Se?e=m.get(Ce.activeViewletSettingsKey,T.WORKSPACE,v(d.Sidebar)?.id):e=v(d.Sidebar)?.id,n.views.containerToRestore.sideBar=e}if(u.isVisible(p.PANEL_PART)){const e=m.get(be.activePanelSettingsKey,T.WORKSPACE,v(d.Panel)?.id);n.views.containerToRestore.panel=e}if(u.isVisible(p.AUXILIARYBAR_PART)){const e=m.get(Ee.activeViewSettingsKey,T.WORKSPACE,v(d.AuxiliaryBar)?.id);n.views.containerToRestore.auxiliaryBar=e}}z(),n=H(n),n.views.containerToRestore.sideBar==null&&u.setPartHidden(!0,p.SIDEBAR_PART),n.views.containerToRestore.panel==null&&u.setPartHidden(!0,p.PANEL_PART),n.views.containerToRestore.auxiliaryBar==null&&u.setPartHidden(!0,p.AUXILIARYBAR_PART);const B=document.createElement("div");B.style.display="none",document.body.append(B);for(const{id:e,role:l,classes:o,options:a,getPosition:i,onDidChangePosition:f}of[{id:p.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:p.BANNER_PART,role:"banner",classes:["banner"]},{id:p.ACTIVITYBAR_PART,role:"none",classes:["activitybar"],getPosition:()=>u.getSideBarPosition(),onDidChangePosition:u.onDidChangeSideBarPosition},{id:p.SIDEBAR_PART,role:"none",classes:["sidebar"],getPosition:()=>u.getSideBarPosition(),onDidChangePosition:u.onDidChangeSideBarPosition},{id:p.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:n.editor.restoreEditors}},{id:p.PANEL_PART,role:"none",classes:["panel","basepanel"],getPosition:()=>u.getPanelPosition(),onDidChangePosition:u.onDidChangePanelPosition},{id:p.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel"],getPosition:()=>u.getSideBarPosition()===O.LEFT?O.RIGHT:O.LEFT,onDidChangePosition:u.onDidChangeSideBarPosition},{id:p.STATUSBAR_PART,role:"status",classes:["statusbar"]}]){const s=u.getPart(e);if(s!=null){const w=Oe(e,l,o);if(s.create(w,a),xe(w,s),s.layout(9999,9999,0,0),B.append(w),i!=null){let b=i();s.element.classList.add(V(b)),f?.(()=>{s.element.classList.remove(V(b)),b=i(),s.element.classList.add(V(b))})}}}const y=[],G=[];y.push((async()=>{g("code/willRestoreEditors"),await R.mainPart.whenReady,g("code/restoreEditors/editorGroupsReady"),n.layout?.editors!=null&&R.applyLayout(n.layout.editors);const e=await n.editor.editorsToOpen;g("code/restoreEditors/editorsToOpenResolved");let l;if(e.length>0){const o=R.getGroups(we.GRID_APPEARANCE),a=new Map;for(const i of e){const f=o[(i.viewColumn??1)-1];let s=a.get(f.id);s==null&&(s=new Set,a.set(f.id,s)),s.add(i.editor)}l=Promise.all(Array.from(a).map(async([i,f])=>{try{await N.openEditors(Array.from(f),i,{validateTrust:!0})}catch(s){S.error(s)}}))}G.push(Promise.all([l?.finally(()=>g("code/restoreEditors/editorsOpened")),R.mainPart.whenRestored.finally(()=>g("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{g("code/didRestoreEditors")}))})());const C=(async()=>{if(n.views.defaults!=null&&n.views.defaults.length>0){g("code/willOpenDefaultViews");const e=[],l=i=>{const f=c.getViewLocationById(i.id);if(f!==null){const s=c.getViewContainerByViewId(i.id);if(s!=null){i.order>=(e[f]?.order??0)&&(e[f]={id:s.id,order:i.order});const w=c.getViewContainerModel(s);return w.setCollapsed(i.id,!1),w.setVisible(i.id,!0),!0}}return!1},o=[...n.views.defaults].reverse().map((i,f)=>({id:i,order:f}));let a=o.length;for(;a>0;)a--,l(o[a])&&o.splice(a,1);if(o.length>0){await F.whenInstalledExtensionsRegistered();let i=o.length;for(;i>0;)i--,l(o[i])&&o.splice(i,1)}e[d.Sidebar]!=null&&(n.views.containerToRestore.sideBar=e[d.Sidebar].id),e[d.Panel]!=null&&(n.views.containerToRestore.panel=e[d.Panel].id),e[d.AuxiliaryBar]!=null&&(n.views.containerToRestore.auxiliaryBar=e[d.AuxiliaryBar].id),g("code/didOpenDefaultViews")}})();y.push(C),y.push((async()=>{if(await C,n.views.containerToRestore.sideBar==null)return;g("code/willRestoreViewlet"),await r.openPaneComposite(n.views.containerToRestore.sideBar,d.Sidebar)==null&&await r.openPaneComposite(v(d.Sidebar)?.id,d.Sidebar),g("code/didRestoreViewlet")})()),y.push((async()=>{if(await C,n.views.containerToRestore.panel==null)return;g("code/willRestorePanel"),await r.openPaneComposite(n.views.containerToRestore.panel,d.Panel)==null&&await r.openPaneComposite(v(d.Panel)?.id,d.Panel),g("code/didRestorePanel")})()),y.push((async()=>{if(await C,n.views.containerToRestore.auxiliaryBar==null)return;g("code/willRestoreAuxiliaryBar"),await r.openPaneComposite(n.views.containerToRestore.auxiliaryBar,d.AuxiliaryBar)==null&&await r.openPaneComposite(v(d.AuxiliaryBar)?.id,d.AuxiliaryBar),g("code/didRestoreAuxiliaryBar")})()),await M.settled(y),await M.settled(G)});function Ke(t,r,c){return c!=null&&(H=typeof c=="boolean"?P=>({...P,editor:{...P.editor,restoreEditors:c}}):c),{...Te(r),...Q({isKeybindingConfigurationVisible:I,shouldUseGlobalPicker:I}),...he({shouldUseGlobalKeybindings:I}),[L.toString()]:new _(D,[],!1),[U.toString()]:new _(Ie,[t,I],!1)}}export{Ne as AbstractResourceEditorInput,Fe as AbstractTextResourceEditorInput,tt as ActivityService,Ye as ActivitybarPart,Xe as ConfirmResult,$e as DomScrollableElement,je as EditorInput,qe as EditorInputCapabilities,Je as GroupOrientation,be as PanelPart,p as Parts,O as Position,ze as RegisteredEditorPriority,Ce as SidebarPart,Qe as SplitView,d as ViewContainerLocation,Ze as ViewPaneContainer,Ke as default,I as isEditorPartVisible,xe as renderPart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.monaco-editor .tokens-inspect-widget{z-index:50;user-select:text;-webkit-user-select:text;padding:10px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{height:1px;border:0;background-color:var(--vscode-editorHoverWidget-border)}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}
|