@opensumi/cli-engine 3.9.1-next-1748435481.0 → 3.9.1-next-1748519038.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.
@@ -31685,7 +31685,7 @@ and limitations under the License.
31685
31685
  `)[0];let d,y=f.match(QUERY_WORD_REGEX)[0];switch(u){case 2:d=new RangeError(`Bad node name '${y}'`);break;case 3:d=new RangeError(`Bad field name '${y}'`);break;case 4:d=new RangeError(`Bad capture name @${y}`);break;case 5:d=new TypeError(`Bad pattern structure at offset ${E}: '${f}'...`),y="";break;default:d=new SyntaxError(`Bad syntax at offset ${E}: '${f}'...`),y=""}throw d.index=E,d.length=y.length,C._free(n),d}const o=C._ts_query_string_count(r),l=C._ts_query_capture_count(r),_=C._ts_query_pattern_count(r),v=new Array(l),m=new Array(o);for(let u=0;u<l;u++){const c=C._ts_query_capture_name_for_id(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");v[u]=UTF8ToString(c,E)}for(let u=0;u<o;u++){const c=C._ts_query_string_value_for_id(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");m[u]=UTF8ToString(c,E)}const p=new Array(_),s=new Array(_),g=new Array(_),a=new Array(_),h=new Array(_);for(let u=0;u<_;u++){const c=C._ts_query_predicates_for_pattern(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");a[u]=[],h[u]=[];const f=[];let d=c;for(let y=0;y<E;y++){const b=getValue(d,"i32");d+=SIZE_OF_INT;const A=getValue(d,"i32");if(d+=SIZE_OF_INT,b===PREDICATE_STEP_TYPE_CAPTURE)f.push({type:"capture",name:v[A]});else if(b===PREDICATE_STEP_TYPE_STRING)f.push({type:"string",value:m[A]});else if(f.length>0){if(f[0].type!=="string")throw new Error("Predicates must begin with a literal value");const S=f[0].value;let D,I=!0,w=!0;switch(S){case"any-not-eq?":case"not-eq?":I=!1;case"any-eq?":case"eq?":if(f.length!==3)throw new Error(`Wrong number of arguments to \`#${S}\` predicate. Expected 2, got ${f.length-1}`);if(f[1].type!=="capture")throw new Error(`First argument of \`#${S}\` predicate must be a capture. Got "${f[1].value}"`);if(w=!S.startsWith("any-"),f[2].type==="capture"){const O=f[1].name,M=f[2].name;h[u].push(k=>{const F=[],L=[];for(const U of k)U.name===O&&F.push(U.node),U.name===M&&L.push(U.node);const B=(U,W,j)=>j?U.text===W.text:U.text!==W.text;return w?F.every(U=>L.some(W=>B(U,W,I))):F.some(U=>L.some(W=>B(U,W,I)))})}else{D=f[1].name;const O=f[2].value,M=F=>F.text===O,k=F=>F.text!==O;h[u].push(F=>{const L=[];for(const U of F)U.name===D&&L.push(U.node);const B=I?M:k;return w?L.every(B):L.some(B)})}break;case"any-not-match?":case"not-match?":I=!1;case"any-match?":case"match?":if(f.length!==3)throw new Error(`Wrong number of arguments to \`#${S}\` predicate. Expected 2, got ${f.length-1}.`);if(f[1].type!=="capture")throw new Error(`First argument of \`#${S}\` predicate must be a capture. Got "${f[1].value}".`);if(f[2].type!=="string")throw new Error(`Second argument of \`#${S}\` predicate must be a string. Got @${f[2].value}.`);D=f[1].name;const T=new RegExp(f[2].value);w=!S.startsWith("any-"),h[u].push(O=>{const M=[];for(const F of O)F.name===D&&M.push(F.node.text);const k=(F,L)=>L?T.test(F):!T.test(F);return M.length===0?!I:w?M.every(F=>k(F,I)):M.some(F=>k(F,I))});break;case"set!":if(f.length<2||f.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${f.length-1}.`);if(f.some(O=>O.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');p[u]||(p[u]={}),p[u][f[1].value]=f[2]?f[2].value:null;break;case"is?":case"is-not?":if(f.length<2||f.length>3)throw new Error(`Wrong number of arguments to \`#${S}\` predicate. Expected 1 or 2. Got ${f.length-1}.`);if(f.some(O=>O.type!=="string"))throw new Error(`Arguments to \`#${S}\` predicate must be a strings.".`);const R=S==="is?"?s:g;R[u]||(R[u]={}),R[u][f[1].value]=f[2]?f[2].value:null;break;case"not-any-of?":I=!1;case"any-of?":if(f.length<2)throw new Error(`Wrong number of arguments to \`#${S}\` predicate. Expected at least 1. Got ${f.length-1}.`);if(f[1].type!=="capture")throw new Error(`First argument of \`#${S}\` predicate must be a capture. Got "${f[1].value}".`);for(let O=2;O<f.length;O++)if(f[O].type!=="string")throw new Error(`Arguments to \`#${S}\` predicate must be a strings.".`);D=f[1].name;const P=f.slice(2).map(O=>O.value);h[u].push(O=>{const M=[];for(const k of O)k.name===D&&M.push(k.node.text);return M.length===0?!I:M.every(k=>P.includes(k))===I});break;default:a[u].push({operator:S,operands:f.slice(1)})}f.length=0}}Object.freeze(p[u]),Object.freeze(s[u]),Object.freeze(g[u])}return C._free(n),new Query(INTERNAL,r,v,h,a,Object.freeze(p),Object.freeze(s),Object.freeze(g))}static load(t){let e;if(t instanceof Uint8Array)e=Promise.resolve(t);else{const n=t;if(typeof process<"u"&&process.versions&&process.versions.node){const r=__webpack_require__(83078);e=Promise.resolve(r.readFileSync(n))}else e=fetch(n).then(r=>r.arrayBuffer().then(o=>{if(r.ok)return new Uint8Array(o);{const l=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${r.status}.
31686
31686
 
31687
31687
  ${l}`)}}))}return e.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{const r=Object.keys(n),o=r.find(_=>LANGUAGE_FUNCTION_REGEX.test(_)&&!_.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols:
31688
- ${JSON.stringify(r,null,2)}`);const l=n[o]();return new Language(INTERNAL,l)})}}class LookaheadIterable{constructor(t,e,n){assertInternal(t),this[0]=e,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(t){return C._ts_lookahead_iterator_reset_state(this[0],t)}reset(t,e){return!!C._ts_lookahead_iterator_reset(this[0],t[0],e)&&(this.language=t,!0)}[Symbol.iterator](){const t=this;return{next:()=>C._ts_lookahead_iterator_next(t[0])?{done:!1,value:t.currentType}:{done:!0,value:""}}}}class Query{constructor(t,e,n,r,o,l,_,v){assertInternal(t),this[0]=e,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=l,this.assertedProperties=_,this.refutedProperties=v,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:_=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_matches_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,_);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=new Array(v);this.exceededMatchLimit=!!p;let g=0,a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const c=getValue(a,"i32");a+=SIZE_OF_INT;const E=new Array(c);if(a=unmarshalCaptures(this,t.tree,a,E),this.textPredicates[u].every(f=>f(E))){s[g]={pattern:u,captures:E};const f=this.setProperties[u];f&&(s[g].setProperties=f);const d=this.assertedProperties[u];d&&(s[g].assertedProperties=d);const y=this.refutedProperties[u];y&&(s[g].refutedProperties=y),g++}}return s.length=g,C._free(m),s}captures(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:_=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_captures_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,_);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=[];this.exceededMatchLimit=!!p;const g=[];let a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const c=getValue(a,"i32");a+=SIZE_OF_INT;const E=getValue(a,"i32");if(a+=SIZE_OF_INT,g.length=c,a=unmarshalCaptures(this,t.tree,a,g),this.textPredicates[u].every(f=>f(g))){const f=g[E],d=this.setProperties[u];d&&(f.setProperties=d);const y=this.assertedProperties[u];y&&(f.assertedProperties=y);const b=this.refutedProperties[u];b&&(f.refutedProperties=b),s.push(f)}}return C._free(m),s}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){const e=lengthBytesUTF8(t),n=C._malloc(e+1);stringToUTF8(t,n,e+1),C._ts_query_disable_capture(this[0],n,e),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(x,t,e){const n=e-t;let r=x.textCallback(t,null,e);for(t+=r.length;t<e;){const o=x.textCallback(t,null,e);if(!(o&&o.length>0))break;t+=o.length,r+=o}return t>e&&(r=r.slice(0,n)),r}function unmarshalCaptures(x,t,e,n){for(let r=0,o=n.length;r<o;r++){const l=getValue(e,"i32"),_=unmarshalNode(t,e+=SIZE_OF_INT);e+=SIZE_OF_NODE,n[r]={name:x.captureNames[l],node:_}}return e}function assertInternal(x){if(x!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(x){return x&&typeof x.row=="number"&&typeof x.column=="number"}function marshalNode(x){let t=TRANSFER_BUFFER;setValue(t,x.id,"i32"),t+=SIZE_OF_INT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.row,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.column,"i32"),t+=SIZE_OF_INT,setValue(t,x[0],"i32")}function unmarshalNode(x,t=TRANSFER_BUFFER){const e=getValue(t,"i32");if(e===0)return null;const n=getValue(t+=SIZE_OF_INT,"i32"),r=getValue(t+=SIZE_OF_INT,"i32"),o=getValue(t+=SIZE_OF_INT,"i32"),l=getValue(t+=SIZE_OF_INT,"i32"),_=new Node(INTERNAL,x);return _.id=e,_.startIndex=n,_.startPosition={row:r,column:o},_[0]=l,_}function marshalTreeCursor(x,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,x[0],"i32"),setValue(t+1*SIZE_OF_INT,x[1],"i32"),setValue(t+2*SIZE_OF_INT,x[2],"i32"),setValue(t+3*SIZE_OF_INT,x[3],"i32")}function unmarshalTreeCursor(x){x[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),x[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),x[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),x[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(x,t){setValue(x,t.row,"i32"),setValue(x+SIZE_OF_INT,t.column,"i32")}function unmarshalPoint(x){return{row:getValue(x,"i32")>>>0,column:getValue(x+SIZE_OF_INT,"i32")>>>0}}function marshalRange(x,t){marshalPoint(x,t.startPosition),marshalPoint(x+=SIZE_OF_POINT,t.endPosition),setValue(x+=SIZE_OF_POINT,t.startIndex,"i32"),setValue(x+=SIZE_OF_INT,t.endIndex,"i32"),x+=SIZE_OF_INT}function unmarshalRange(x){const t={};return t.startPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.startIndex=getValue(x,"i32")>>>0,x+=SIZE_OF_INT,t.endIndex=getValue(x,"i32")>>>0,t}function marshalEdit(x){let t=TRANSFER_BUFFER;marshalPoint(t,x.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.newEndPosition),t+=SIZE_OF_POINT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.oldEndIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.newEndIndex,"i32"),t+=SIZE_OF_INT}for(const x of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,x,{value:ParserImpl.prototype[x],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser}();module.exports=TreeSitter},52730:(x,t,e)=>{"use strict";var n=e(80705),r=e(14834),o=e(28498),l=e(79818),_=e(69336),v=l("Object.prototype.toString"),m=e(51913)(),p=typeof globalThis>"u"?e.g:globalThis,s=r(),g=l("String.prototype.slice"),a=Object.getPrototypeOf,h=l("Array.prototype.indexOf",!0)||function(d,y){for(var b=0;b<d.length;b+=1)if(d[b]===y)return b;return-1},u={__proto__:null};m&&_&&a?n(s,function(f){var d=new p[f];if(Symbol.toStringTag in d){var y=a(d),b=_(y,Symbol.toStringTag);if(!b){var A=a(y);b=_(A,Symbol.toStringTag)}u["$"+f]=o(b.get)}}):n(s,function(f){var d=new p[f],y=d.slice||d.set;y&&(u["$"+f]=o(y))});var c=function(d){var y=!1;return n(u,function(b,A){if(!y)try{"$"+b(d)===A&&(y=g(A,1))}catch{}}),y},E=function(d){var y=!1;return n(u,function(b,A){if(!y)try{b(d),y=g(A,1)}catch{}}),y};x.exports=function(d){if(!d||typeof d!="object")return!1;if(!m){var y=g(v(d),8,-1);return h(s,y)>-1?y:y!=="Object"?!1:E(d)}return _?c(d):null}},97442:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const n=e(94705);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const r=l=>JSON.stringify(l,null,2).replace(/"([^"]+)":/g,"$1:");t.quotelessJson=r;class o extends Error{get errors(){return this.issues}constructor(_){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const v=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,v):this.__proto__=v,this.name="ZodError",this.issues=_}format(_){const v=_||function(s){return s.message},m={_errors:[]},p=s=>{for(const g of s.issues)if(g.code==="invalid_union")g.unionErrors.map(p);else if(g.code==="invalid_return_type")p(g.returnTypeError);else if(g.code==="invalid_arguments")p(g.argumentsError);else if(g.path.length===0)m._errors.push(v(g));else{let a=m,h=0;for(;h<g.path.length;){const u=g.path[h];h===g.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(v(g))):a[u]=a[u]||{_errors:[]},a=a[u],h++}}};return p(this),m}static assert(_){if(!(_ instanceof o))throw new Error(`Not a ZodError: ${_}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(_=v=>v.message){const v={},m=[];for(const p of this.issues)p.path.length>0?(v[p.path[0]]=v[p.path[0]]||[],v[p.path[0]].push(_(p))):m.push(_(p));return{formErrors:m,fieldErrors:v}}get formErrors(){return this.flatten()}}t.ZodError=o,o.create=l=>new o(l)},30548:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const r=n(e(28412));t.defaultErrorMap=r.default;let o=r.default;function l(v){o=v}t.setErrorMap=l;function _(){return o}t.getErrorMap=_},86340:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(o,l,_,v){v===void 0&&(v=_);var m=Object.getOwnPropertyDescriptor(l,_);(!m||("get"in m?!l.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return l[_]}}),Object.defineProperty(o,v,m)}:function(o,l,_,v){v===void 0&&(v=_),o[v]=l[_]}),r=this&&this.__exportStar||function(o,l){for(var _ in o)_!=="default"&&!Object.prototype.hasOwnProperty.call(l,_)&&n(l,o,_)};Object.defineProperty(t,"__esModule",{value:!0}),r(e(30548),t),r(e(66258),t),r(e(29201),t),r(e(94705),t),r(e(75226),t),r(e(97442),t)},15759:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0;var e;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(e||(t.errorUtil=e={}))},66258:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const r=e(30548),o=n(e(28412)),l=u=>{const{data:c,path:E,errorMaps:f,issueData:d}=u,y=[...E,...d.path||[]],b={...d,path:y};if(d.message!==void 0)return{...d,path:y,message:d.message};let A="";const S=f.filter(D=>!!D).slice().reverse();for(const D of S)A=D(b,{data:c,defaultError:A}).message;return{...d,path:y,message:A}};t.makeIssue=l,t.EMPTY_PATH=[];function _(u,c){const E=(0,r.getErrorMap)(),f=(0,t.makeIssue)({issueData:c,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,E,E===o.default?void 0:o.default].filter(d=>!!d)});u.common.issues.push(f)}t.addIssueToContext=_;class v{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(c,E){const f=[];for(const d of E){if(d.status==="aborted")return t.INVALID;d.status==="dirty"&&c.dirty(),f.push(d.value)}return{status:c.value,value:f}}static async mergeObjectAsync(c,E){const f=[];for(const d of E){const y=await d.key,b=await d.value;f.push({key:y,value:b})}return v.mergeObjectSync(c,f)}static mergeObjectSync(c,E){const f={};for(const d of E){const{key:y,value:b}=d;if(y.status==="aborted"||b.status==="aborted")return t.INVALID;y.status==="dirty"&&c.dirty(),b.status==="dirty"&&c.dirty(),y.value!=="__proto__"&&(typeof b.value<"u"||d.alwaysSet)&&(f[y.value]=b.value)}return{status:c.value,value:f}}}t.ParseStatus=v,t.INVALID=Object.freeze({status:"aborted"});const m=u=>({status:"dirty",value:u});t.DIRTY=m;const p=u=>({status:"valid",value:u});t.OK=p;const s=u=>u.status==="aborted";t.isAborted=s;const g=u=>u.status==="dirty";t.isDirty=g;const a=u=>u.status==="valid";t.isValid=a;const h=u=>typeof Promise<"u"&&u instanceof Promise;t.isAsync=h},29201:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94705:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var e;(function(o){o.assertEqual=m=>m;function l(m){}o.assertIs=l;function _(m){throw new Error}o.assertNever=_,o.arrayToEnum=m=>{const p={};for(const s of m)p[s]=s;return p},o.getValidEnumValues=m=>{const p=o.objectKeys(m).filter(g=>typeof m[m[g]]!="number"),s={};for(const g of p)s[g]=m[g];return o.objectValues(s)},o.objectValues=m=>o.objectKeys(m).map(function(p){return m[p]}),o.objectKeys=typeof Object.keys=="function"?m=>Object.keys(m):m=>{const p=[];for(const s in m)Object.prototype.hasOwnProperty.call(m,s)&&p.push(s);return p},o.find=(m,p)=>{for(const s of m)if(p(s))return s},o.isInteger=typeof Number.isInteger=="function"?m=>Number.isInteger(m):m=>typeof m=="number"&&isFinite(m)&&Math.floor(m)===m;function v(m,p=" | "){return m.map(s=>typeof s=="string"?`'${s}'`:s).join(p)}o.joinValues=v,o.jsonStringifyReplacer=(m,p)=>typeof p=="bigint"?p.toString():p})(e||(t.util=e={}));var n;(function(o){o.mergeShapes=(l,_)=>({...l,..._})})(n||(t.objectUtil=n={})),t.ZodParsedType=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const r=o=>{switch(typeof o){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(o)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(o)?t.ZodParsedType.array:o===null?t.ZodParsedType.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?t.ZodParsedType.promise:typeof Map<"u"&&o instanceof Map?t.ZodParsedType.map:typeof Set<"u"&&o instanceof Set?t.ZodParsedType.set:typeof Date<"u"&&o instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=r},75995:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(v,m,p,s){s===void 0&&(s=p);var g=Object.getOwnPropertyDescriptor(m,p);(!g||("get"in g?!m.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return m[p]}}),Object.defineProperty(v,s,g)}:function(v,m,p,s){s===void 0&&(s=p),v[s]=m[p]}),r=this&&this.__setModuleDefault||(Object.create?function(v,m){Object.defineProperty(v,"default",{enumerable:!0,value:m})}:function(v,m){v.default=m}),o=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var m={};if(v!=null)for(var p in v)p!=="default"&&Object.prototype.hasOwnProperty.call(v,p)&&n(m,v,p);return r(m,v),m},l=this&&this.__exportStar||function(v,m){for(var p in v)p!=="default"&&!Object.prototype.hasOwnProperty.call(m,p)&&n(m,v,p)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const _=o(e(86340));t.z=_,l(e(86340),t),t.default=_},28412:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(94705),r=e(97442),o=(l,_)=>{let v;switch(l.code){case r.ZodIssueCode.invalid_type:l.received===n.ZodParsedType.undefined?v="Required":v=`Expected ${l.expected}, received ${l.received}`;break;case r.ZodIssueCode.invalid_literal:v=`Invalid literal value, expected ${JSON.stringify(l.expected,n.util.jsonStringifyReplacer)}`;break;case r.ZodIssueCode.unrecognized_keys:v=`Unrecognized key(s) in object: ${n.util.joinValues(l.keys,", ")}`;break;case r.ZodIssueCode.invalid_union:v="Invalid input";break;case r.ZodIssueCode.invalid_union_discriminator:v=`Invalid discriminator value. Expected ${n.util.joinValues(l.options)}`;break;case r.ZodIssueCode.invalid_enum_value:v=`Invalid enum value. Expected ${n.util.joinValues(l.options)}, received '${l.received}'`;break;case r.ZodIssueCode.invalid_arguments:v="Invalid function arguments";break;case r.ZodIssueCode.invalid_return_type:v="Invalid function return type";break;case r.ZodIssueCode.invalid_date:v="Invalid date";break;case r.ZodIssueCode.invalid_string:typeof l.validation=="object"?"includes"in l.validation?(v=`Invalid input: must include "${l.validation.includes}"`,typeof l.validation.position=="number"&&(v=`${v} at one or more positions greater than or equal to ${l.validation.position}`)):"startsWith"in l.validation?v=`Invalid input: must start with "${l.validation.startsWith}"`:"endsWith"in l.validation?v=`Invalid input: must end with "${l.validation.endsWith}"`:n.util.assertNever(l.validation):l.validation!=="regex"?v=`Invalid ${l.validation}`:v="Invalid";break;case r.ZodIssueCode.too_small:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at least":"more than"} ${l.minimum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at least":"over"} ${l.minimum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${l.minimum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(l.minimum))}`:v="Invalid input";break;case r.ZodIssueCode.too_big:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at most":"less than"} ${l.maximum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at most":"under"} ${l.maximum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="bigint"?v=`BigInt must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly":l.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(l.maximum))}`:v="Invalid input";break;case r.ZodIssueCode.custom:v="Invalid input";break;case r.ZodIssueCode.invalid_intersection_types:v="Intersection results could not be merged";break;case r.ZodIssueCode.not_multiple_of:v=`Number must be a multiple of ${l.multipleOf}`;break;case r.ZodIssueCode.not_finite:v="Number must be finite";break;default:v=_.defaultError,n.util.assertNever(l)}return{message:v}};t.default=o},75226:function(x,t,e){"use strict";var n=this&&this.__classPrivateFieldGet||function(qt,nt,Ft,Jt){if(Ft==="a"&&!Jt)throw new TypeError("Private accessor was defined without a getter");if(typeof nt=="function"?qt!==nt||!Jt:!nt.has(qt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ft==="m"?Jt:Ft==="a"?Jt.call(qt):Jt?Jt.value:nt.get(qt)},r=this&&this.__classPrivateFieldSet||function(qt,nt,Ft,Jt,Dn){if(Jt==="m")throw new TypeError("Private method is not writable");if(Jt==="a"&&!Dn)throw new TypeError("Private accessor was defined without a setter");if(typeof nt=="function"?qt!==nt||!Dn:!nt.has(qt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Jt==="a"?Dn.call(qt,Ft):Dn?Dn.value=Ft:nt.set(qt,Ft),Ft},o,l;Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const _=e(30548),v=e(15759),m=e(66258),p=e(94705),s=e(97442);class g{constructor(nt,Ft,Jt,Dn){this._cachedPath=[],this.parent=nt,this.data=Ft,this._path=Jt,this._key=Dn}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(qt,nt)=>{if((0,m.isValid)(nt))return{success:!0,data:nt.value};if(!qt.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const Ft=new s.ZodError(qt.common.issues);return this._error=Ft,this._error}}};function h(qt){if(!qt)return{};const{errorMap:nt,invalid_type_error:Ft,required_error:Jt,description:Dn}=qt;if(nt&&(Ft||Jt))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return nt?{errorMap:nt,description:Dn}:{errorMap:(Bi,Mi)=>{var Xi,vi;const{message:Qi}=qt;return Bi.code==="invalid_enum_value"?{message:Qi??Mi.defaultError}:typeof Mi.data>"u"?{message:(Xi=Qi??Jt)!==null&&Xi!==void 0?Xi:Mi.defaultError}:Bi.code!=="invalid_type"?{message:Mi.defaultError}:{message:(vi=Qi??Ft)!==null&&vi!==void 0?vi:Mi.defaultError}},description:Dn}}class u{get description(){return this._def.description}_getType(nt){return(0,p.getParsedType)(nt.data)}_getOrReturnCtx(nt,Ft){return Ft||{common:nt.parent.common,data:nt.data,parsedType:(0,p.getParsedType)(nt.data),schemaErrorMap:this._def.errorMap,path:nt.path,parent:nt.parent}}_processInputParams(nt){return{status:new m.ParseStatus,ctx:{common:nt.parent.common,data:nt.data,parsedType:(0,p.getParsedType)(nt.data),schemaErrorMap:this._def.errorMap,path:nt.path,parent:nt.parent}}}_parseSync(nt){const Ft=this._parse(nt);if((0,m.isAsync)(Ft))throw new Error("Synchronous parse encountered promise.");return Ft}_parseAsync(nt){const Ft=this._parse(nt);return Promise.resolve(Ft)}parse(nt,Ft){const Jt=this.safeParse(nt,Ft);if(Jt.success)return Jt.data;throw Jt.error}safeParse(nt,Ft){var Jt;const Dn={common:{issues:[],async:(Jt=Ft?.async)!==null&&Jt!==void 0?Jt:!1,contextualErrorMap:Ft?.errorMap},path:Ft?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)},Fn=this._parseSync({data:nt,path:Dn.path,parent:Dn});return a(Dn,Fn)}"~validate"(nt){var Ft,Jt;const Dn={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)};if(!this["~standard"].async)try{const Fn=this._parseSync({data:nt,path:[],parent:Dn});return(0,m.isValid)(Fn)?{value:Fn.value}:{issues:Dn.common.issues}}catch(Fn){!((Jt=(Ft=Fn?.message)===null||Ft===void 0?void 0:Ft.toLowerCase())===null||Jt===void 0)&&Jt.includes("encountered")&&(this["~standard"].async=!0),Dn.common={issues:[],async:!0}}return this._parseAsync({data:nt,path:[],parent:Dn}).then(Fn=>(0,m.isValid)(Fn)?{value:Fn.value}:{issues:Dn.common.issues})}async parseAsync(nt,Ft){const Jt=await this.safeParseAsync(nt,Ft);if(Jt.success)return Jt.data;throw Jt.error}async safeParseAsync(nt,Ft){const Jt={common:{issues:[],contextualErrorMap:Ft?.errorMap,async:!0},path:Ft?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)},Dn=this._parse({data:nt,path:Jt.path,parent:Jt}),Fn=await((0,m.isAsync)(Dn)?Dn:Promise.resolve(Dn));return a(Jt,Fn)}refine(nt,Ft){const Jt=Dn=>typeof Ft=="string"||typeof Ft>"u"?{message:Ft}:typeof Ft=="function"?Ft(Dn):Ft;return this._refinement((Dn,Fn)=>{const Bi=nt(Dn),Mi=()=>Fn.addIssue({code:s.ZodIssueCode.custom,...Jt(Dn)});return typeof Promise<"u"&&Bi instanceof Promise?Bi.then(Xi=>Xi?!0:(Mi(),!1)):Bi?!0:(Mi(),!1)})}refinement(nt,Ft){return this._refinement((Jt,Dn)=>nt(Jt)?!0:(Dn.addIssue(typeof Ft=="function"?Ft(Jt,Dn):Ft),!1))}_refinement(nt){return new Ye({schema:this,typeName:At.ZodEffects,effect:{type:"refinement",refinement:nt}})}superRefine(nt){return this._refinement(nt)}constructor(nt){this.spa=this.safeParseAsync,this._def=nt,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:Ft=>this["~validate"](Ft)}}optional(){return Ke.create(this,this._def)}nullable(){return mt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return Ue.create(this,this._def)}or(nt){return fe.create([this,nt],this._def)}and(nt){return Pe.create(this,nt,this._def)}transform(nt){return new Ye({...h(this._def),schema:this,typeName:At.ZodEffects,effect:{type:"transform",transform:nt}})}default(nt){const Ft=typeof nt=="function"?nt:()=>nt;return new _t({...h(this._def),innerType:this,defaultValue:Ft,typeName:At.ZodDefault})}brand(){return new wt({typeName:At.ZodBranded,type:this,...h(this._def)})}catch(nt){const Ft=typeof nt=="function"?nt:()=>nt;return new Mt({...h(this._def),innerType:this,catchValue:Ft,typeName:At.ZodCatch})}describe(nt){const Ft=this.constructor;return new Ft({...this._def,description:nt})}pipe(nt){return st.create(this,nt)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const c=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,f=/^[0-9A-HJKMNP-TV-Z]{26}$/i,d=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,b=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,A=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,S=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,D="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let I;const w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,P=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,k="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F=new RegExp(`^${k}$`);function L(qt){let nt="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return qt.precision?nt=`${nt}\\.\\d{${qt.precision}}`:qt.precision==null&&(nt=`${nt}(\\.\\d+)?`),nt}function B(qt){return new RegExp(`^${L(qt)}$`)}function U(qt){let nt=`${k}T${L(qt)}`;const Ft=[];return Ft.push(qt.local?"Z?":"Z"),qt.offset&&Ft.push("([+-]\\d{2}:?\\d{2})"),nt=`${nt}(${Ft.join("|")})`,new RegExp(`^${nt}$`)}t.datetimeRegex=U;function W(qt,nt){return!!((nt==="v4"||!nt)&&w.test(qt)||(nt==="v6"||!nt)&&R.test(qt))}function j(qt,nt){if(!b.test(qt))return!1;try{const[Ft]=qt.split("."),Jt=Ft.replace(/-/g,"+").replace(/_/g,"/").padEnd(Ft.length+(4-Ft.length%4)%4,"="),Dn=JSON.parse(atob(Jt));return!(typeof Dn!="object"||Dn===null||!Dn.typ||!Dn.alg||nt&&Dn.alg!==nt)}catch{return!1}}function Q(qt,nt){return!!((nt==="v4"||!nt)&&T.test(qt)||(nt==="v6"||!nt)&&P.test(qt))}class G extends u{_parse(nt){if(this._def.coerce&&(nt.data=String(nt.data)),this._getType(nt)!==p.ZodParsedType.string){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.string,received:Fn.parsedType}),m.INVALID}const Jt=new m.ParseStatus;let Dn;for(const Fn of this._def.checks)if(Fn.kind==="min")nt.data.length<Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"string",inclusive:!0,exact:!1,message:Fn.message}),Jt.dirty());else if(Fn.kind==="max")nt.data.length>Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"string",inclusive:!0,exact:!1,message:Fn.message}),Jt.dirty());else if(Fn.kind==="length"){const Bi=nt.data.length>Fn.value,Mi=nt.data.length<Fn.value;(Bi||Mi)&&(Dn=this._getOrReturnCtx(nt,Dn),Bi?(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"string",inclusive:!0,exact:!0,message:Fn.message}):Mi&&(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"string",inclusive:!0,exact:!0,message:Fn.message}),Jt.dirty())}else if(Fn.kind==="email")S.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"email",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="emoji")I||(I=new RegExp(D,"u")),I.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="uuid")d.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="nanoid")y.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"nanoid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="cuid")c.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="cuid2")E.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="ulid")f.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="url")try{new URL(nt.data)}catch{Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"url",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()}else Fn.kind==="regex"?(Fn.regex.lastIndex=0,Fn.regex.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty())):Fn.kind==="trim"?nt.data=nt.data.trim():Fn.kind==="includes"?nt.data.includes(Fn.value,Fn.position)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{includes:Fn.value,position:Fn.position},message:Fn.message}),Jt.dirty()):Fn.kind==="toLowerCase"?nt.data=nt.data.toLowerCase():Fn.kind==="toUpperCase"?nt.data=nt.data.toUpperCase():Fn.kind==="startsWith"?nt.data.startsWith(Fn.value)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:Fn.value},message:Fn.message}),Jt.dirty()):Fn.kind==="endsWith"?nt.data.endsWith(Fn.value)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:Fn.value},message:Fn.message}),Jt.dirty()):Fn.kind==="datetime"?U(Fn).test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:Fn.message}),Jt.dirty()):Fn.kind==="date"?F.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"date",message:Fn.message}),Jt.dirty()):Fn.kind==="time"?B(Fn).test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"time",message:Fn.message}),Jt.dirty()):Fn.kind==="duration"?A.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"duration",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="ip"?W(nt.data,Fn.version)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="jwt"?j(nt.data,Fn.alg)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"jwt",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="cidr"?Q(nt.data,Fn.version)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cidr",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="base64"?O.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"base64",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="base64url"?M.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"base64url",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):p.util.assertNever(Fn);return{status:Jt.value,value:nt.data}}_regex(nt,Ft,Jt){return this.refinement(Dn=>nt.test(Dn),{validation:Ft,code:s.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(Jt)})}_addCheck(nt){return new G({...this._def,checks:[...this._def.checks,nt]})}email(nt){return this._addCheck({kind:"email",...v.errorUtil.errToObj(nt)})}url(nt){return this._addCheck({kind:"url",...v.errorUtil.errToObj(nt)})}emoji(nt){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(nt)})}uuid(nt){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(nt)})}nanoid(nt){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(nt)})}cuid(nt){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(nt)})}cuid2(nt){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(nt)})}ulid(nt){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(nt)})}base64(nt){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(nt)})}base64url(nt){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(nt)})}jwt(nt){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(nt)})}ip(nt){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(nt)})}cidr(nt){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(nt)})}datetime(nt){var Ft,Jt;return typeof nt=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:nt}):this._addCheck({kind:"datetime",precision:typeof nt?.precision>"u"?null:nt?.precision,offset:(Ft=nt?.offset)!==null&&Ft!==void 0?Ft:!1,local:(Jt=nt?.local)!==null&&Jt!==void 0?Jt:!1,...v.errorUtil.errToObj(nt?.message)})}date(nt){return this._addCheck({kind:"date",message:nt})}time(nt){return typeof nt=="string"?this._addCheck({kind:"time",precision:null,message:nt}):this._addCheck({kind:"time",precision:typeof nt?.precision>"u"?null:nt?.precision,...v.errorUtil.errToObj(nt?.message)})}duration(nt){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(nt)})}regex(nt,Ft){return this._addCheck({kind:"regex",regex:nt,...v.errorUtil.errToObj(Ft)})}includes(nt,Ft){return this._addCheck({kind:"includes",value:nt,position:Ft?.position,...v.errorUtil.errToObj(Ft?.message)})}startsWith(nt,Ft){return this._addCheck({kind:"startsWith",value:nt,...v.errorUtil.errToObj(Ft)})}endsWith(nt,Ft){return this._addCheck({kind:"endsWith",value:nt,...v.errorUtil.errToObj(Ft)})}min(nt,Ft){return this._addCheck({kind:"min",value:nt,...v.errorUtil.errToObj(Ft)})}max(nt,Ft){return this._addCheck({kind:"max",value:nt,...v.errorUtil.errToObj(Ft)})}length(nt,Ft){return this._addCheck({kind:"length",value:nt,...v.errorUtil.errToObj(Ft)})}nonempty(nt){return this.min(1,v.errorUtil.errToObj(nt))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(nt=>nt.kind==="datetime")}get isDate(){return!!this._def.checks.find(nt=>nt.kind==="date")}get isTime(){return!!this._def.checks.find(nt=>nt.kind==="time")}get isDuration(){return!!this._def.checks.find(nt=>nt.kind==="duration")}get isEmail(){return!!this._def.checks.find(nt=>nt.kind==="email")}get isURL(){return!!this._def.checks.find(nt=>nt.kind==="url")}get isEmoji(){return!!this._def.checks.find(nt=>nt.kind==="emoji")}get isUUID(){return!!this._def.checks.find(nt=>nt.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(nt=>nt.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(nt=>nt.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(nt=>nt.kind==="cuid2")}get isULID(){return!!this._def.checks.find(nt=>nt.kind==="ulid")}get isIP(){return!!this._def.checks.find(nt=>nt.kind==="ip")}get isCIDR(){return!!this._def.checks.find(nt=>nt.kind==="cidr")}get isBase64(){return!!this._def.checks.find(nt=>nt.kind==="base64")}get isBase64url(){return!!this._def.checks.find(nt=>nt.kind==="base64url")}get minLength(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxLength(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}}t.ZodString=G,G.create=qt=>{var nt;return new G({checks:[],typeName:At.ZodString,coerce:(nt=qt?.coerce)!==null&&nt!==void 0?nt:!1,...h(qt)})};function Z(qt,nt){const Ft=(qt.toString().split(".")[1]||"").length,Jt=(nt.toString().split(".")[1]||"").length,Dn=Ft>Jt?Ft:Jt,Fn=parseInt(qt.toFixed(Dn).replace(".","")),Bi=parseInt(nt.toFixed(Dn).replace(".",""));return Fn%Bi/Math.pow(10,Dn)}class $ extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(nt){if(this._def.coerce&&(nt.data=Number(nt.data)),this._getType(nt)!==p.ZodParsedType.number){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.number,received:Fn.parsedType}),m.INVALID}let Jt;const Dn=new m.ParseStatus;for(const Fn of this._def.checks)Fn.kind==="int"?p.util.isInteger(nt.data)||(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Fn.message}),Dn.dirty()):Fn.kind==="min"?(Fn.inclusive?nt.data<Fn.value:nt.data<=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"number",inclusive:Fn.inclusive,exact:!1,message:Fn.message}),Dn.dirty()):Fn.kind==="max"?(Fn.inclusive?nt.data>Fn.value:nt.data>=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"number",inclusive:Fn.inclusive,exact:!1,message:Fn.message}),Dn.dirty()):Fn.kind==="multipleOf"?Z(nt.data,Fn.value)!==0&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Fn.value,message:Fn.message}),Dn.dirty()):Fn.kind==="finite"?Number.isFinite(nt.data)||(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_finite,message:Fn.message}),Dn.dirty()):p.util.assertNever(Fn);return{status:Dn.value,value:nt.data}}gte(nt,Ft){return this.setLimit("min",nt,!0,v.errorUtil.toString(Ft))}gt(nt,Ft){return this.setLimit("min",nt,!1,v.errorUtil.toString(Ft))}lte(nt,Ft){return this.setLimit("max",nt,!0,v.errorUtil.toString(Ft))}lt(nt,Ft){return this.setLimit("max",nt,!1,v.errorUtil.toString(Ft))}setLimit(nt,Ft,Jt,Dn){return new $({...this._def,checks:[...this._def.checks,{kind:nt,value:Ft,inclusive:Jt,message:v.errorUtil.toString(Dn)}]})}_addCheck(nt){return new $({...this._def,checks:[...this._def.checks,nt]})}int(nt){return this._addCheck({kind:"int",message:v.errorUtil.toString(nt)})}positive(nt){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(nt)})}negative(nt){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(nt)})}nonpositive(nt){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(nt)})}nonnegative(nt){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(nt)})}multipleOf(nt,Ft){return this._addCheck({kind:"multipleOf",value:nt,message:v.errorUtil.toString(Ft)})}finite(nt){return this._addCheck({kind:"finite",message:v.errorUtil.toString(nt)})}safe(nt){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(nt)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(nt)})}get minValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}get isInt(){return!!this._def.checks.find(nt=>nt.kind==="int"||nt.kind==="multipleOf"&&p.util.isInteger(nt.value))}get isFinite(){let nt=null,Ft=null;for(const Jt of this._def.checks){if(Jt.kind==="finite"||Jt.kind==="int"||Jt.kind==="multipleOf")return!0;Jt.kind==="min"?(Ft===null||Jt.value>Ft)&&(Ft=Jt.value):Jt.kind==="max"&&(nt===null||Jt.value<nt)&&(nt=Jt.value)}return Number.isFinite(Ft)&&Number.isFinite(nt)}}t.ZodNumber=$,$.create=qt=>new $({checks:[],typeName:At.ZodNumber,coerce:qt?.coerce||!1,...h(qt)});class V extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(nt){if(this._def.coerce)try{nt.data=BigInt(nt.data)}catch{return this._getInvalidInput(nt)}if(this._getType(nt)!==p.ZodParsedType.bigint)return this._getInvalidInput(nt);let Jt;const Dn=new m.ParseStatus;for(const Fn of this._def.checks)Fn.kind==="min"?(Fn.inclusive?nt.data<Fn.value:nt.data<=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:Fn.value,inclusive:Fn.inclusive,message:Fn.message}),Dn.dirty()):Fn.kind==="max"?(Fn.inclusive?nt.data>Fn.value:nt.data>=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:Fn.value,inclusive:Fn.inclusive,message:Fn.message}),Dn.dirty()):Fn.kind==="multipleOf"?nt.data%Fn.value!==BigInt(0)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Fn.value,message:Fn.message}),Dn.dirty()):p.util.assertNever(Fn);return{status:Dn.value,value:nt.data}}_getInvalidInput(nt){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.bigint,received:Ft.parsedType}),m.INVALID}gte(nt,Ft){return this.setLimit("min",nt,!0,v.errorUtil.toString(Ft))}gt(nt,Ft){return this.setLimit("min",nt,!1,v.errorUtil.toString(Ft))}lte(nt,Ft){return this.setLimit("max",nt,!0,v.errorUtil.toString(Ft))}lt(nt,Ft){return this.setLimit("max",nt,!1,v.errorUtil.toString(Ft))}setLimit(nt,Ft,Jt,Dn){return new V({...this._def,checks:[...this._def.checks,{kind:nt,value:Ft,inclusive:Jt,message:v.errorUtil.toString(Dn)}]})}_addCheck(nt){return new V({...this._def,checks:[...this._def.checks,nt]})}positive(nt){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(nt)})}negative(nt){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(nt)})}nonpositive(nt){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(nt)})}nonnegative(nt){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(nt)})}multipleOf(nt,Ft){return this._addCheck({kind:"multipleOf",value:nt,message:v.errorUtil.toString(Ft)})}get minValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}}t.ZodBigInt=V,V.create=qt=>{var nt;return new V({checks:[],typeName:At.ZodBigInt,coerce:(nt=qt?.coerce)!==null&&nt!==void 0?nt:!1,...h(qt)})};class H extends u{_parse(nt){if(this._def.coerce&&(nt.data=!!nt.data),this._getType(nt)!==p.ZodParsedType.boolean){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.boolean,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodBoolean=H,H.create=qt=>new H({typeName:At.ZodBoolean,coerce:qt?.coerce||!1,...h(qt)});class K extends u{_parse(nt){if(this._def.coerce&&(nt.data=new Date(nt.data)),this._getType(nt)!==p.ZodParsedType.date){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.date,received:Fn.parsedType}),m.INVALID}if(isNaN(nt.data.getTime())){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_date}),m.INVALID}const Jt=new m.ParseStatus;let Dn;for(const Fn of this._def.checks)Fn.kind==="min"?nt.data.getTime()<Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,message:Fn.message,inclusive:!0,exact:!1,minimum:Fn.value,type:"date"}),Jt.dirty()):Fn.kind==="max"?nt.data.getTime()>Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,message:Fn.message,inclusive:!0,exact:!1,maximum:Fn.value,type:"date"}),Jt.dirty()):p.util.assertNever(Fn);return{status:Jt.value,value:new Date(nt.data.getTime())}}_addCheck(nt){return new K({...this._def,checks:[...this._def.checks,nt]})}min(nt,Ft){return this._addCheck({kind:"min",value:nt.getTime(),message:v.errorUtil.toString(Ft)})}max(nt,Ft){return this._addCheck({kind:"max",value:nt.getTime(),message:v.errorUtil.toString(Ft)})}get minDate(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt!=null?new Date(nt):null}get maxDate(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt!=null?new Date(nt):null}}t.ZodDate=K,K.create=qt=>new K({checks:[],coerce:qt?.coerce||!1,typeName:At.ZodDate,...h(qt)});class Y extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.symbol){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.symbol,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodSymbol=Y,Y.create=qt=>new Y({typeName:At.ZodSymbol,...h(qt)});class X extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.undefined){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.undefined,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodUndefined=X,X.create=qt=>new X({typeName:At.ZodUndefined,...h(qt)});class oe extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.null){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.null,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodNull=oe,oe.create=qt=>new oe({typeName:At.ZodNull,...h(qt)});class ie extends u{constructor(){super(...arguments),this._any=!0}_parse(nt){return(0,m.OK)(nt.data)}}t.ZodAny=ie,ie.create=qt=>new ie({typeName:At.ZodAny,...h(qt)});class he extends u{constructor(){super(...arguments),this._unknown=!0}_parse(nt){return(0,m.OK)(nt.data)}}t.ZodUnknown=he,he.create=qt=>new he({typeName:At.ZodUnknown,...h(qt)});class me extends u{_parse(nt){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.never,received:Ft.parsedType}),m.INVALID}}t.ZodNever=me,me.create=qt=>new me({typeName:At.ZodNever,...h(qt)});class q extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.undefined){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.void,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodVoid=q,q.create=qt=>new q({typeName:At.ZodVoid,...h(qt)});class Ee extends u{_parse(nt){const{ctx:Ft,status:Jt}=this._processInputParams(nt),Dn=this._def;if(Ft.parsedType!==p.ZodParsedType.array)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.array,received:Ft.parsedType}),m.INVALID;if(Dn.exactLength!==null){const Bi=Ft.data.length>Dn.exactLength.value,Mi=Ft.data.length<Dn.exactLength.value;(Bi||Mi)&&((0,m.addIssueToContext)(Ft,{code:Bi?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:Mi?Dn.exactLength.value:void 0,maximum:Bi?Dn.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Dn.exactLength.message}),Jt.dirty())}if(Dn.minLength!==null&&Ft.data.length<Dn.minLength.value&&((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.too_small,minimum:Dn.minLength.value,type:"array",inclusive:!0,exact:!1,message:Dn.minLength.message}),Jt.dirty()),Dn.maxLength!==null&&Ft.data.length>Dn.maxLength.value&&((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.too_big,maximum:Dn.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Dn.maxLength.message}),Jt.dirty()),Ft.common.async)return Promise.all([...Ft.data].map((Bi,Mi)=>Dn.type._parseAsync(new g(Ft,Bi,Ft.path,Mi)))).then(Bi=>m.ParseStatus.mergeArray(Jt,Bi));const Fn=[...Ft.data].map((Bi,Mi)=>Dn.type._parseSync(new g(Ft,Bi,Ft.path,Mi)));return m.ParseStatus.mergeArray(Jt,Fn)}get element(){return this._def.type}min(nt,Ft){return new Ee({...this._def,minLength:{value:nt,message:v.errorUtil.toString(Ft)}})}max(nt,Ft){return new Ee({...this._def,maxLength:{value:nt,message:v.errorUtil.toString(Ft)}})}length(nt,Ft){return new Ee({...this._def,exactLength:{value:nt,message:v.errorUtil.toString(Ft)}})}nonempty(nt){return this.min(1,nt)}}t.ZodArray=Ee,Ee.create=(qt,nt)=>new Ee({type:qt,minLength:null,maxLength:null,exactLength:null,typeName:At.ZodArray,...h(nt)});function ue(qt){if(qt instanceof te){const nt={};for(const Ft in qt.shape){const Jt=qt.shape[Ft];nt[Ft]=Ke.create(ue(Jt))}return new te({...qt._def,shape:()=>nt})}else return qt instanceof Ee?new Ee({...qt._def,type:ue(qt.element)}):qt instanceof Ke?Ke.create(ue(qt.unwrap())):qt instanceof mt?mt.create(ue(qt.unwrap())):qt instanceof we?we.create(qt.items.map(nt=>ue(nt))):qt}class te extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const nt=this._def.shape(),Ft=p.util.objectKeys(nt);return this._cached={shape:nt,keys:Ft}}_parse(nt){if(this._getType(nt)!==p.ZodParsedType.object){const vi=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(vi,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:vi.parsedType}),m.INVALID}const{status:Jt,ctx:Dn}=this._processInputParams(nt),{shape:Fn,keys:Bi}=this._getCached(),Mi=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(const vi in Dn.data)Bi.includes(vi)||Mi.push(vi);const Xi=[];for(const vi of Bi){const Qi=Fn[vi],qi=Dn.data[vi];Xi.push({key:{status:"valid",value:vi},value:Qi._parse(new g(Dn,qi,Dn.path,vi)),alwaysSet:vi in Dn.data})}if(this._def.catchall instanceof me){const vi=this._def.unknownKeys;if(vi==="passthrough")for(const Qi of Mi)Xi.push({key:{status:"valid",value:Qi},value:{status:"valid",value:Dn.data[Qi]}});else if(vi==="strict")Mi.length>0&&((0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.unrecognized_keys,keys:Mi}),Jt.dirty());else if(vi!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const vi=this._def.catchall;for(const Qi of Mi){const qi=Dn.data[Qi];Xi.push({key:{status:"valid",value:Qi},value:vi._parse(new g(Dn,qi,Dn.path,Qi)),alwaysSet:Qi in Dn.data})}}return Dn.common.async?Promise.resolve().then(async()=>{const vi=[];for(const Qi of Xi){const qi=await Qi.key,lo=await Qi.value;vi.push({key:qi,value:lo,alwaysSet:Qi.alwaysSet})}return vi}).then(vi=>m.ParseStatus.mergeObjectSync(Jt,vi)):m.ParseStatus.mergeObjectSync(Jt,Xi)}get shape(){return this._def.shape()}strict(nt){return v.errorUtil.errToObj,new te({...this._def,unknownKeys:"strict",...nt!==void 0?{errorMap:(Ft,Jt)=>{var Dn,Fn,Bi,Mi;const Xi=(Bi=(Fn=(Dn=this._def).errorMap)===null||Fn===void 0?void 0:Fn.call(Dn,Ft,Jt).message)!==null&&Bi!==void 0?Bi:Jt.defaultError;return Ft.code==="unrecognized_keys"?{message:(Mi=v.errorUtil.errToObj(nt).message)!==null&&Mi!==void 0?Mi:Xi}:{message:Xi}}}:{}})}strip(){return new te({...this._def,unknownKeys:"strip"})}passthrough(){return new te({...this._def,unknownKeys:"passthrough"})}extend(nt){return new te({...this._def,shape:()=>({...this._def.shape(),...nt})})}merge(nt){return new te({unknownKeys:nt._def.unknownKeys,catchall:nt._def.catchall,shape:()=>({...this._def.shape(),...nt._def.shape()}),typeName:At.ZodObject})}setKey(nt,Ft){return this.augment({[nt]:Ft})}catchall(nt){return new te({...this._def,catchall:nt})}pick(nt){const Ft={};return p.util.objectKeys(nt).forEach(Jt=>{nt[Jt]&&this.shape[Jt]&&(Ft[Jt]=this.shape[Jt])}),new te({...this._def,shape:()=>Ft})}omit(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{nt[Jt]||(Ft[Jt]=this.shape[Jt])}),new te({...this._def,shape:()=>Ft})}deepPartial(){return ue(this)}partial(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{const Dn=this.shape[Jt];nt&&!nt[Jt]?Ft[Jt]=Dn:Ft[Jt]=Dn.optional()}),new te({...this._def,shape:()=>Ft})}required(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{if(nt&&!nt[Jt])Ft[Jt]=this.shape[Jt];else{let Fn=this.shape[Jt];for(;Fn instanceof Ke;)Fn=Fn._def.innerType;Ft[Jt]=Fn}}),new te({...this._def,shape:()=>Ft})}keyof(){return ge(p.util.objectKeys(this.shape))}}t.ZodObject=te,te.create=(qt,nt)=>new te({shape:()=>qt,unknownKeys:"strip",catchall:me.create(),typeName:At.ZodObject,...h(nt)}),te.strictCreate=(qt,nt)=>new te({shape:()=>qt,unknownKeys:"strict",catchall:me.create(),typeName:At.ZodObject,...h(nt)}),te.lazycreate=(qt,nt)=>new te({shape:qt,unknownKeys:"strip",catchall:me.create(),typeName:At.ZodObject,...h(nt)});class fe extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt=this._def.options;function Dn(Fn){for(const Mi of Fn)if(Mi.result.status==="valid")return Mi.result;for(const Mi of Fn)if(Mi.result.status==="dirty")return Ft.common.issues.push(...Mi.ctx.common.issues),Mi.result;const Bi=Fn.map(Mi=>new s.ZodError(Mi.ctx.common.issues));return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union,unionErrors:Bi}),m.INVALID}if(Ft.common.async)return Promise.all(Jt.map(async Fn=>{const Bi={...Ft,common:{...Ft.common,issues:[]},parent:null};return{result:await Fn._parseAsync({data:Ft.data,path:Ft.path,parent:Bi}),ctx:Bi}})).then(Dn);{let Fn;const Bi=[];for(const Xi of Jt){const vi={...Ft,common:{...Ft.common,issues:[]},parent:null},Qi=Xi._parseSync({data:Ft.data,path:Ft.path,parent:vi});if(Qi.status==="valid")return Qi;Qi.status==="dirty"&&!Fn&&(Fn={result:Qi,ctx:vi}),vi.common.issues.length&&Bi.push(vi.common.issues)}if(Fn)return Ft.common.issues.push(...Fn.ctx.common.issues),Fn.result;const Mi=Bi.map(Xi=>new s.ZodError(Xi));return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union,unionErrors:Mi}),m.INVALID}}get options(){return this._def.options}}t.ZodUnion=fe,fe.create=(qt,nt)=>new fe({options:qt,typeName:At.ZodUnion,...h(nt)});const Ie=qt=>qt instanceof pe?Ie(qt.schema):qt instanceof Ye?Ie(qt.innerType()):qt instanceof re?[qt.value]:qt instanceof De?qt.options:qt instanceof Ae?p.util.objectValues(qt.enum):qt instanceof _t?Ie(qt._def.innerType):qt instanceof X?[void 0]:qt instanceof oe?[null]:qt instanceof Ke?[void 0,...Ie(qt.unwrap())]:qt instanceof mt?[null,...Ie(qt.unwrap())]:qt instanceof wt||qt instanceof rt?Ie(qt.unwrap()):qt instanceof Mt?Ie(qt._def.innerType):[];class Me extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.object)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:Ft.parsedType}),m.INVALID;const Jt=this.discriminator,Dn=Ft.data[Jt],Fn=this.optionsMap.get(Dn);return Fn?Ft.common.async?Fn._parseAsync({data:Ft.data,path:Ft.path,parent:Ft}):Fn._parseSync({data:Ft.data,path:Ft.path,parent:Ft}):((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Jt]}),m.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(nt,Ft,Jt){const Dn=new Map;for(const Fn of Ft){const Bi=Ie(Fn.shape[nt]);if(!Bi.length)throw new Error(`A discriminator value for key \`${nt}\` could not be extracted from all schema options`);for(const Mi of Bi){if(Dn.has(Mi))throw new Error(`Discriminator property ${String(nt)} has duplicate value ${String(Mi)}`);Dn.set(Mi,Fn)}}return new Me({typeName:At.ZodDiscriminatedUnion,discriminator:nt,options:Ft,optionsMap:Dn,...h(Jt)})}}t.ZodDiscriminatedUnion=Me;function Be(qt,nt){const Ft=(0,p.getParsedType)(qt),Jt=(0,p.getParsedType)(nt);if(qt===nt)return{valid:!0,data:qt};if(Ft===p.ZodParsedType.object&&Jt===p.ZodParsedType.object){const Dn=p.util.objectKeys(nt),Fn=p.util.objectKeys(qt).filter(Mi=>Dn.indexOf(Mi)!==-1),Bi={...qt,...nt};for(const Mi of Fn){const Xi=Be(qt[Mi],nt[Mi]);if(!Xi.valid)return{valid:!1};Bi[Mi]=Xi.data}return{valid:!0,data:Bi}}else if(Ft===p.ZodParsedType.array&&Jt===p.ZodParsedType.array){if(qt.length!==nt.length)return{valid:!1};const Dn=[];for(let Fn=0;Fn<qt.length;Fn++){const Bi=qt[Fn],Mi=nt[Fn],Xi=Be(Bi,Mi);if(!Xi.valid)return{valid:!1};Dn.push(Xi.data)}return{valid:!0,data:Dn}}else return Ft===p.ZodParsedType.date&&Jt===p.ZodParsedType.date&&+qt==+nt?{valid:!0,data:qt}:{valid:!1}}class Pe extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt),Dn=(Fn,Bi)=>{if((0,m.isAborted)(Fn)||(0,m.isAborted)(Bi))return m.INVALID;const Mi=Be(Fn.value,Bi.value);return Mi.valid?(((0,m.isDirty)(Fn)||(0,m.isDirty)(Bi))&&Ft.dirty(),{status:Ft.value,value:Mi.data}):((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_intersection_types}),m.INVALID)};return Jt.common.async?Promise.all([this._def.left._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}),this._def.right._parseAsync({data:Jt.data,path:Jt.path,parent:Jt})]).then(([Fn,Bi])=>Dn(Fn,Bi)):Dn(this._def.left._parseSync({data:Jt.data,path:Jt.path,parent:Jt}),this._def.right._parseSync({data:Jt.data,path:Jt.path,parent:Jt}))}}t.ZodIntersection=Pe,Pe.create=(qt,nt,Ft)=>new Pe({left:qt,right:nt,typeName:At.ZodIntersection,...h(Ft)});class we extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.array)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.array,received:Jt.parsedType}),m.INVALID;if(Jt.data.length<this._def.items.length)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m.INVALID;!this._def.rest&&Jt.data.length>this._def.items.length&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ft.dirty());const Fn=[...Jt.data].map((Bi,Mi)=>{const Xi=this._def.items[Mi]||this._def.rest;return Xi?Xi._parse(new g(Jt,Bi,Jt.path,Mi)):null}).filter(Bi=>!!Bi);return Jt.common.async?Promise.all(Fn).then(Bi=>m.ParseStatus.mergeArray(Ft,Bi)):m.ParseStatus.mergeArray(Ft,Fn)}get items(){return this._def.items}rest(nt){return new we({...this._def,rest:nt})}}t.ZodTuple=we,we.create=(qt,nt)=>{if(!Array.isArray(qt))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:qt,typeName:At.ZodTuple,rest:null,...h(nt)})};class _e extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.object)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:Jt.parsedType}),m.INVALID;const Dn=[],Fn=this._def.keyType,Bi=this._def.valueType;for(const Mi in Jt.data)Dn.push({key:Fn._parse(new g(Jt,Mi,Jt.path,Mi)),value:Bi._parse(new g(Jt,Jt.data[Mi],Jt.path,Mi)),alwaysSet:Mi in Jt.data});return Jt.common.async?m.ParseStatus.mergeObjectAsync(Ft,Dn):m.ParseStatus.mergeObjectSync(Ft,Dn)}get element(){return this._def.valueType}static create(nt,Ft,Jt){return Ft instanceof u?new _e({keyType:nt,valueType:Ft,typeName:At.ZodRecord,...h(Jt)}):new _e({keyType:G.create(),valueType:nt,typeName:At.ZodRecord,...h(Ft)})}}t.ZodRecord=_e;class Ne extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.map)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.map,received:Jt.parsedType}),m.INVALID;const Dn=this._def.keyType,Fn=this._def.valueType,Bi=[...Jt.data.entries()].map(([Mi,Xi],vi)=>({key:Dn._parse(new g(Jt,Mi,Jt.path,[vi,"key"])),value:Fn._parse(new g(Jt,Xi,Jt.path,[vi,"value"]))}));if(Jt.common.async){const Mi=new Map;return Promise.resolve().then(async()=>{for(const Xi of Bi){const vi=await Xi.key,Qi=await Xi.value;if(vi.status==="aborted"||Qi.status==="aborted")return m.INVALID;(vi.status==="dirty"||Qi.status==="dirty")&&Ft.dirty(),Mi.set(vi.value,Qi.value)}return{status:Ft.value,value:Mi}})}else{const Mi=new Map;for(const Xi of Bi){const vi=Xi.key,Qi=Xi.value;if(vi.status==="aborted"||Qi.status==="aborted")return m.INVALID;(vi.status==="dirty"||Qi.status==="dirty")&&Ft.dirty(),Mi.set(vi.value,Qi.value)}return{status:Ft.value,value:Mi}}}}t.ZodMap=Ne,Ne.create=(qt,nt,Ft)=>new Ne({valueType:nt,keyType:qt,typeName:At.ZodMap,...h(Ft)});class Te extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.set)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.set,received:Jt.parsedType}),m.INVALID;const Dn=this._def;Dn.minSize!==null&&Jt.data.size<Dn.minSize.value&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:Dn.minSize.value,type:"set",inclusive:!0,exact:!1,message:Dn.minSize.message}),Ft.dirty()),Dn.maxSize!==null&&Jt.data.size>Dn.maxSize.value&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:Dn.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Dn.maxSize.message}),Ft.dirty());const Fn=this._def.valueType;function Bi(Xi){const vi=new Set;for(const Qi of Xi){if(Qi.status==="aborted")return m.INVALID;Qi.status==="dirty"&&Ft.dirty(),vi.add(Qi.value)}return{status:Ft.value,value:vi}}const Mi=[...Jt.data.values()].map((Xi,vi)=>Fn._parse(new g(Jt,Xi,Jt.path,vi)));return Jt.common.async?Promise.all(Mi).then(Xi=>Bi(Xi)):Bi(Mi)}min(nt,Ft){return new Te({...this._def,minSize:{value:nt,message:v.errorUtil.toString(Ft)}})}max(nt,Ft){return new Te({...this._def,maxSize:{value:nt,message:v.errorUtil.toString(Ft)}})}size(nt,Ft){return this.min(nt,Ft).max(nt,Ft)}nonempty(nt){return this.min(1,nt)}}t.ZodSet=Te,Te.create=(qt,nt)=>new Te({valueType:qt,minSize:null,maxSize:null,typeName:At.ZodSet,...h(nt)});class We extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.function)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.function,received:Ft.parsedType}),m.INVALID;function Jt(Mi,Xi){return(0,m.makeIssue)({data:Mi,path:Ft.path,errorMaps:[Ft.common.contextualErrorMap,Ft.schemaErrorMap,(0,_.getErrorMap)(),_.defaultErrorMap].filter(vi=>!!vi),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:Xi}})}function Dn(Mi,Xi){return(0,m.makeIssue)({data:Mi,path:Ft.path,errorMaps:[Ft.common.contextualErrorMap,Ft.schemaErrorMap,(0,_.getErrorMap)(),_.defaultErrorMap].filter(vi=>!!vi),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:Xi}})}const Fn={errorMap:Ft.common.contextualErrorMap},Bi=Ft.data;if(this._def.returns instanceof Ue){const Mi=this;return(0,m.OK)(async function(...Xi){const vi=new s.ZodError([]),Qi=await Mi._def.args.parseAsync(Xi,Fn).catch(yo=>{throw vi.addIssue(Jt(Xi,yo)),vi}),qi=await Reflect.apply(Bi,this,Qi);return await Mi._def.returns._def.type.parseAsync(qi,Fn).catch(yo=>{throw vi.addIssue(Dn(qi,yo)),vi})})}else{const Mi=this;return(0,m.OK)(function(...Xi){const vi=Mi._def.args.safeParse(Xi,Fn);if(!vi.success)throw new s.ZodError([Jt(Xi,vi.error)]);const Qi=Reflect.apply(Bi,this,vi.data),qi=Mi._def.returns.safeParse(Qi,Fn);if(!qi.success)throw new s.ZodError([Dn(Qi,qi.error)]);return qi.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...nt){return new We({...this._def,args:we.create(nt).rest(he.create())})}returns(nt){return new We({...this._def,returns:nt})}implement(nt){return this.parse(nt)}strictImplement(nt){return this.parse(nt)}static create(nt,Ft,Jt){return new We({args:nt||we.create([]).rest(he.create()),returns:Ft||he.create(),typeName:At.ZodFunction,...h(Jt)})}}t.ZodFunction=We;class pe extends u{get schema(){return this._def.getter()}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);return this._def.getter()._parse({data:Ft.data,path:Ft.path,parent:Ft})}}t.ZodLazy=pe,pe.create=(qt,nt)=>new pe({getter:qt,typeName:At.ZodLazy,...h(nt)});class re extends u{_parse(nt){if(nt.data!==this._def.value){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{received:Ft.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),m.INVALID}return{status:"valid",value:nt.data}}get value(){return this._def.value}}t.ZodLiteral=re,re.create=(qt,nt)=>new re({value:qt,typeName:At.ZodLiteral,...h(nt)});function ge(qt,nt){return new De({values:qt,typeName:At.ZodEnum,...h(nt)})}class De extends u{constructor(){super(...arguments),o.set(this,void 0)}_parse(nt){if(typeof nt.data!="string"){const Ft=this._getOrReturnCtx(nt),Jt=this._def.values;return(0,m.addIssueToContext)(Ft,{expected:p.util.joinValues(Jt),received:Ft.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,o,"f")||r(this,o,new Set(this._def.values),"f"),!n(this,o,"f").has(nt.data)){const Ft=this._getOrReturnCtx(nt),Jt=this._def.values;return(0,m.addIssueToContext)(Ft,{received:Ft.data,code:s.ZodIssueCode.invalid_enum_value,options:Jt}),m.INVALID}return(0,m.OK)(nt.data)}get options(){return this._def.values}get enum(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}get Values(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}get Enum(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}extract(nt,Ft=this._def){return De.create(nt,{...this._def,...Ft})}exclude(nt,Ft=this._def){return De.create(this.options.filter(Jt=>!nt.includes(Jt)),{...this._def,...Ft})}}t.ZodEnum=De,o=new WeakMap,De.create=ge;class Ae extends u{constructor(){super(...arguments),l.set(this,void 0)}_parse(nt){const Ft=p.util.getValidEnumValues(this._def.values),Jt=this._getOrReturnCtx(nt);if(Jt.parsedType!==p.ZodParsedType.string&&Jt.parsedType!==p.ZodParsedType.number){const Dn=p.util.objectValues(Ft);return(0,m.addIssueToContext)(Jt,{expected:p.util.joinValues(Dn),received:Jt.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,l,"f")||r(this,l,new Set(p.util.getValidEnumValues(this._def.values)),"f"),!n(this,l,"f").has(nt.data)){const Dn=p.util.objectValues(Ft);return(0,m.addIssueToContext)(Jt,{received:Jt.data,code:s.ZodIssueCode.invalid_enum_value,options:Dn}),m.INVALID}return(0,m.OK)(nt.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Ae,l=new WeakMap,Ae.create=(qt,nt)=>new Ae({values:qt,typeName:At.ZodNativeEnum,...h(nt)});class Ue extends u{unwrap(){return this._def.type}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.promise&&Ft.common.async===!1)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.promise,received:Ft.parsedType}),m.INVALID;const Jt=Ft.parsedType===p.ZodParsedType.promise?Ft.data:Promise.resolve(Ft.data);return(0,m.OK)(Jt.then(Dn=>this._def.type.parseAsync(Dn,{path:Ft.path,errorMap:Ft.common.contextualErrorMap})))}}t.ZodPromise=Ue,Ue.create=(qt,nt)=>new Ue({type:qt,typeName:At.ZodPromise,...h(nt)});class Ye extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===At.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt),Dn=this._def.effect||null,Fn={addIssue:Bi=>{(0,m.addIssueToContext)(Jt,Bi),Bi.fatal?Ft.abort():Ft.dirty()},get path(){return Jt.path}};if(Fn.addIssue=Fn.addIssue.bind(Fn),Dn.type==="preprocess"){const Bi=Dn.transform(Jt.data,Fn);if(Jt.common.async)return Promise.resolve(Bi).then(async Mi=>{if(Ft.value==="aborted")return m.INVALID;const Xi=await this._def.schema._parseAsync({data:Mi,path:Jt.path,parent:Jt});return Xi.status==="aborted"?m.INVALID:Xi.status==="dirty"||Ft.value==="dirty"?(0,m.DIRTY)(Xi.value):Xi});{if(Ft.value==="aborted")return m.INVALID;const Mi=this._def.schema._parseSync({data:Bi,path:Jt.path,parent:Jt});return Mi.status==="aborted"?m.INVALID:Mi.status==="dirty"||Ft.value==="dirty"?(0,m.DIRTY)(Mi.value):Mi}}if(Dn.type==="refinement"){const Bi=Mi=>{const Xi=Dn.refinement(Mi,Fn);if(Jt.common.async)return Promise.resolve(Xi);if(Xi instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Mi};if(Jt.common.async===!1){const Mi=this._def.schema._parseSync({data:Jt.data,path:Jt.path,parent:Jt});return Mi.status==="aborted"?m.INVALID:(Mi.status==="dirty"&&Ft.dirty(),Bi(Mi.value),{status:Ft.value,value:Mi.value})}else return this._def.schema._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}).then(Mi=>Mi.status==="aborted"?m.INVALID:(Mi.status==="dirty"&&Ft.dirty(),Bi(Mi.value).then(()=>({status:Ft.value,value:Mi.value}))))}if(Dn.type==="transform")if(Jt.common.async===!1){const Bi=this._def.schema._parseSync({data:Jt.data,path:Jt.path,parent:Jt});if(!(0,m.isValid)(Bi))return Bi;const Mi=Dn.transform(Bi.value,Fn);if(Mi instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Ft.value,value:Mi}}else return this._def.schema._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}).then(Bi=>(0,m.isValid)(Bi)?Promise.resolve(Dn.transform(Bi.value,Fn)).then(Mi=>({status:Ft.value,value:Mi})):Bi);p.util.assertNever(Dn)}}t.ZodEffects=Ye,t.ZodTransformer=Ye,Ye.create=(qt,nt,Ft)=>new Ye({schema:qt,typeName:At.ZodEffects,effect:nt,...h(Ft)}),Ye.createWithPreprocess=(qt,nt,Ft)=>new Ye({schema:nt,effect:{type:"preprocess",transform:qt},typeName:At.ZodEffects,...h(Ft)});class Ke extends u{_parse(nt){return this._getType(nt)===p.ZodParsedType.undefined?(0,m.OK)(void 0):this._def.innerType._parse(nt)}unwrap(){return this._def.innerType}}t.ZodOptional=Ke,Ke.create=(qt,nt)=>new Ke({innerType:qt,typeName:At.ZodOptional,...h(nt)});class mt extends u{_parse(nt){return this._getType(nt)===p.ZodParsedType.null?(0,m.OK)(null):this._def.innerType._parse(nt)}unwrap(){return this._def.innerType}}t.ZodNullable=mt,mt.create=(qt,nt)=>new mt({innerType:qt,typeName:At.ZodNullable,...h(nt)});class _t extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt);let Jt=Ft.data;return Ft.parsedType===p.ZodParsedType.undefined&&(Jt=this._def.defaultValue()),this._def.innerType._parse({data:Jt,path:Ft.path,parent:Ft})}removeDefault(){return this._def.innerType}}t.ZodDefault=_t,_t.create=(qt,nt)=>new _t({innerType:qt,typeName:At.ZodDefault,defaultValue:typeof nt.default=="function"?nt.default:()=>nt.default,...h(nt)});class Mt extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt={...Ft,common:{...Ft.common,issues:[]}},Dn=this._def.innerType._parse({data:Jt.data,path:Jt.path,parent:{...Jt}});return(0,m.isAsync)(Dn)?Dn.then(Fn=>({status:"valid",value:Fn.status==="valid"?Fn.value:this._def.catchValue({get error(){return new s.ZodError(Jt.common.issues)},input:Jt.data})})):{status:"valid",value:Dn.status==="valid"?Dn.value:this._def.catchValue({get error(){return new s.ZodError(Jt.common.issues)},input:Jt.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=Mt,Mt.create=(qt,nt)=>new Mt({innerType:qt,typeName:At.ZodCatch,catchValue:typeof nt.catch=="function"?nt.catch:()=>nt.catch,...h(nt)});class ct extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.nan){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.nan,received:Jt.parsedType}),m.INVALID}return{status:"valid",value:nt.data}}}t.ZodNaN=ct,ct.create=qt=>new ct({typeName:At.ZodNaN,...h(qt)}),t.BRAND=Symbol("zod_brand");class wt extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt=Ft.data;return this._def.type._parse({data:Jt,path:Ft.path,parent:Ft})}unwrap(){return this._def.type}}t.ZodBranded=wt;class st extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.common.async)return(async()=>{const Fn=await this._def.in._parseAsync({data:Jt.data,path:Jt.path,parent:Jt});return Fn.status==="aborted"?m.INVALID:Fn.status==="dirty"?(Ft.dirty(),(0,m.DIRTY)(Fn.value)):this._def.out._parseAsync({data:Fn.value,path:Jt.path,parent:Jt})})();{const Dn=this._def.in._parseSync({data:Jt.data,path:Jt.path,parent:Jt});return Dn.status==="aborted"?m.INVALID:Dn.status==="dirty"?(Ft.dirty(),{status:"dirty",value:Dn.value}):this._def.out._parseSync({data:Dn.value,path:Jt.path,parent:Jt})}}static create(nt,Ft){return new st({in:nt,out:Ft,typeName:At.ZodPipeline})}}t.ZodPipeline=st;class rt extends u{_parse(nt){const Ft=this._def.innerType._parse(nt),Jt=Dn=>((0,m.isValid)(Dn)&&(Dn.value=Object.freeze(Dn.value)),Dn);return(0,m.isAsync)(Ft)?Ft.then(Dn=>Jt(Dn)):Jt(Ft)}unwrap(){return this._def.innerType}}t.ZodReadonly=rt,rt.create=(qt,nt)=>new rt({innerType:qt,typeName:At.ZodReadonly,...h(nt)});function lt(qt,nt={},Ft){return qt?ie.create().superRefine((Jt,Dn)=>{var Fn,Bi;if(!qt(Jt)){const Mi=typeof nt=="function"?nt(Jt):typeof nt=="string"?{message:nt}:nt,Xi=(Bi=(Fn=Mi.fatal)!==null&&Fn!==void 0?Fn:Ft)!==null&&Bi!==void 0?Bi:!0,vi=typeof Mi=="string"?{message:Mi}:Mi;Dn.addIssue({code:"custom",...vi,fatal:Xi})}}):ie.create()}t.custom=lt,t.late={object:te.lazycreate};var At;(function(qt){qt.ZodString="ZodString",qt.ZodNumber="ZodNumber",qt.ZodNaN="ZodNaN",qt.ZodBigInt="ZodBigInt",qt.ZodBoolean="ZodBoolean",qt.ZodDate="ZodDate",qt.ZodSymbol="ZodSymbol",qt.ZodUndefined="ZodUndefined",qt.ZodNull="ZodNull",qt.ZodAny="ZodAny",qt.ZodUnknown="ZodUnknown",qt.ZodNever="ZodNever",qt.ZodVoid="ZodVoid",qt.ZodArray="ZodArray",qt.ZodObject="ZodObject",qt.ZodUnion="ZodUnion",qt.ZodDiscriminatedUnion="ZodDiscriminatedUnion",qt.ZodIntersection="ZodIntersection",qt.ZodTuple="ZodTuple",qt.ZodRecord="ZodRecord",qt.ZodMap="ZodMap",qt.ZodSet="ZodSet",qt.ZodFunction="ZodFunction",qt.ZodLazy="ZodLazy",qt.ZodLiteral="ZodLiteral",qt.ZodEnum="ZodEnum",qt.ZodEffects="ZodEffects",qt.ZodNativeEnum="ZodNativeEnum",qt.ZodOptional="ZodOptional",qt.ZodNullable="ZodNullable",qt.ZodDefault="ZodDefault",qt.ZodCatch="ZodCatch",qt.ZodPromise="ZodPromise",qt.ZodBranded="ZodBranded",qt.ZodPipeline="ZodPipeline",qt.ZodReadonly="ZodReadonly"})(At||(t.ZodFirstPartyTypeKind=At={}));class jt{constructor(...nt){}}const _n=(qt,nt={message:`Input not instance of ${qt.name}`})=>lt(Ft=>Ft instanceof qt,nt);t.instanceof=_n;const In=G.create;t.string=In;const ci=$.create;t.number=ci;const xn=ct.create;t.nan=xn;const dn=V.create;t.bigint=dn;const jn=H.create;t.boolean=jn;const sn=K.create;t.date=sn;const at=Y.create;t.symbol=at;const $e=X.create;t.undefined=$e;const Oe=oe.create;t.null=Oe;const Le=ie.create;t.any=Le;const ze=he.create;t.unknown=ze;const St=me.create;t.never=St;const $t=q.create;t.void=$t;const On=Ee.create;t.array=On;const Bn=te.create;t.object=Bn;const ui=te.strictCreate;t.strictObject=ui;const li=fe.create;t.union=li;const Ni=Me.create;t.discriminatedUnion=Ni;const Rn=Pe.create;t.intersection=Rn;const Cn=we.create;t.tuple=Cn;const $n=_e.create;t.record=$n;const Si=Ne.create;t.map=Si;const Ui=Te.create;t.set=Ui;const bi=We.create;t.function=bi;const un=pe.create;t.lazy=un;const Vn=re.create;t.literal=Vn;const Xt=De.create;t.enum=Xt;const Qe=Ae.create;t.nativeEnum=Qe;const vt=Ue.create;t.promise=vt;const pt=Ye.create;t.effect=pt,t.transformer=pt;const gt=Ke.create;t.optional=gt;const nn=mt.create;t.nullable=nn;const Gt=Ye.createWithPreprocess;t.preprocess=Gt;const Kt=st.create;t.pipeline=Kt;const vn=()=>In().optional();t.ostring=vn;const Hn=()=>ci().optional();t.onumber=Hn;const Jn=()=>jn().optional();t.oboolean=Jn,t.coerce={string:qt=>G.create({...qt,coerce:!0}),number:qt=>$.create({...qt,coerce:!0}),boolean:qt=>H.create({...qt,coerce:!0}),bigint:qt=>V.create({...qt,coerce:!0}),date:qt=>K.create({...qt,coerce:!0})},t.NEVER=m.INVALID},79682:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeDevtoolsContribution=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(65265),v=e(98295),m=e(27654);let p=n=class extends l.Disposable{constructor(){super(...arguments),this.lantencyHandler=g=>{const{command:a}=g.detail;a===_.DevtoolsLantencyCommand.Start?this.interval||this.startRTTInterval():a===_.DevtoolsLantencyCommand.Stop&&this.interval&&(clearInterval(this.interval),this.interval=void 0)}}initialize(){var g;this.appConfig.devtools&&(window.addEventListener(_.EDevtoolsEvent.Latency,this.lantencyHandler),this.addDispose(l.Disposable.create(()=>{window.removeEventListener(_.EDevtoolsEvent.Latency,this.lantencyHandler),this.interval&&(clearInterval(this.interval),this.interval=void 0)})),!((g=window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__)===null||g===void 0)&&g.captureRPC&&(this.interval||this.startRTTInterval()))}startRTTInterval(){this.interval=setInterval(async()=>{const g=Date.now();await this.rttService.measure();const a=Date.now()-g;window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.captureRPC&&(window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.latency=a)},n.INTERVAL)}};t.ChromeDevtoolsContribution=p,p.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],p.prototype,"rttService",void 0),t.ChromeDevtoolsContribution=p=n=r.__decorate([(0,v.Domain)(l.ClientAppContribution)],p)},72915:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTContribution=void 0;const r=e(85608),o=e(76003),l=e(26542),_=e(92323),v=e(98295),m=e(27654),p={id:"connection.start.rtt",label:"%connection.start.rtt%",category:"%command.category.developerTools%"},s={id:"connection.stop.rtt",label:"%connection.stop.rtt%",category:"%command.category.developerTools%"},g={alignment:l.StatusBarAlignment.LEFT,priority:1/0-1};let a=n=class{registerCommands(u){u.registerCommand(p,{execute:()=>{this.interval||this.startRTTInterval()}}),u.registerCommand(s,{execute:()=>{this.interval&&(clearInterval(this.interval),this.statusBar&&(this.statusBar.dispose(),this.statusBar=void 0))}})}startRTTInterval(){this.interval=setInterval(async()=>{const u=Date.now();await this.rttService.measure();const E={text:`${Date.now()-u}ms`};if(this.statusBar)this.statusBar.update({...E,...g});else{const f=this.statusBarService.addElement("connection-rtt",{...E,...g});this.statusBar=f}},n.INTERVAL)}};t.ConnectionRTTContribution=a,a.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],a.prototype,"rttService",void 0),t.ConnectionRTTContribution=a=n=r.__decorate([(0,v.Domain)(_.CommandContribution)],a)},27654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTBrowserService=t.ConnectionRTTBrowserServiceToken=void 0;const n=e(85608),r=e(76003),o=e(69452);t.ConnectionRTTBrowserServiceToken=Symbol("ConnectionRTTBrowserService");let l=class{async measure(){await this.connectionBackService.$measure()}};t.ConnectionRTTBrowserService=l,n.__decorate([(0,r.Autowired)(o.ConnectionBackServicePath),n.__metadata("design:type",Object)],l.prototype,"connectionBackService",void 0),t.ConnectionRTTBrowserService=l=n.__decorate([(0,r.Injectable)()],l)},17631:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(69452);let v=class extends l.WithEventBus{onDidDropFile(p){this.dropService.onDidDropFile(p)}};t.FileDropContribution=v,n.__decorate([(0,r.Autowired)(_.IFileDropFrontendServiceToken),n.__metadata("design:type",Object)],v.prototype,"dropService",void 0),n.__decorate([(0,l.OnEvent)(l.FileTreeDropEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[l.FileTreeDropEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"onDidDropFile",null),t.FileDropContribution=v=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution)],v)},22874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(43718),v=e(42933),{Path:m}=_.path,p=e(69452);let s=class extends _.WithEventBus{constructor(){super(...arguments),this.pending=new Set}onDidUploadFileStart(a){this.pending.add(a),this.createOrUpdateStatusBar()}onDidUploadFileEnd(a){this.pending.delete(a),this.createOrUpdateStatusBar()}createOrUpdateStatusBar(a){if(this.pending.size===0){this.uploadStatus&&(this.uploadStatus.dispose(),this.uploadStatus=void 0);return}const h="sumi-upload-file-status",u=(0,o.formatLocalize)("workbench.uploadingFiles",this.pending.size,a||"0 MB"),c={text:u,alignment:l.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.uploadStatus?this.uploadStatus.update({id:h,...c}):this.uploadStatus=this.statusBarService.addElement(h,c)}onDidDropFile(a){var h;const{payload:{event:u,targetDir:c}}=a;if(!c||!(!((h=u.dataTransfer)===null||h===void 0)&&h.files)||u.dataTransfer.files.length===0)return;const E=u.dataTransfer.items;let f=0;const d=Date.now(),y=b=>{f+=b;const A=Date.now(),D=`${(f/((A-d)/1e3)/1024/1024).toFixed(2)} MB`;this.createOrUpdateStatusBar(D)};for(const b of E){const A=b.webkitGetAsEntry();this.processFilesEntry(c,A,y)}}async processFilesEntry(a,h,u){if(h.isFile)this.processFileEntry(h,a,u);else{const c=_.Uri.file(new m(a).join(h.fullPath).toString()).toString();await this.fs.createFolder(c),this.processDirEntry(h,a,u)}}toBinaryString(a){let h;const u=a.length;let c="";for(h=0;h<u;h+=1)c+=String.fromCharCode(a[h]);return c}async doUploadFile(a,h,u){var c;const E=new m(h).join(a.name).toString();this.onDidUploadFileStart(E.toString()),await this.fs.createFile(_.Uri.file(E.toString()).toString()),await this.dropService.$ensureFileExist(a.name,h);const f=a.stream().getReader();let d=await f.read();for(;!d.done;)await this.dropService.$writeStream(this.toBinaryString(d.value),a.name,h,d.done),u((c=d.value)===null||c===void 0?void 0:c.byteLength),d=await f.read();d.done&&this.onDidUploadFileEnd(E.toString())}processFileEntry(a,h,u){a.file(c=>{const E=new File([c],a.fullPath,{type:a.type});this.doUploadFile(E,h,u)},()=>{})}processDirEntry(a,h,u){a.createReader().readEntries(E=>{E.forEach(async f=>{this.processFilesEntry(h,f,u)})},()=>{})}};t.FileDropService=s,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fs",void 0),n.__decorate([(0,r.Autowired)(p.FileDropServicePath),n.__metadata("design:type",Object)],s.prototype,"dropService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],s.prototype,"statusBarService",void 0),t.FileDropService=s=n.__decorate([(0,r.Injectable)()],s)},79240:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchContribution=t.FileSearchQuickCommandHandler=t.matchLineReg=t.quickGoToSymbol=t.quickFileOpen=void 0,t.getValidateInput=y;const n=e(85608),r=n.__importDefault(e(39050)),o=e(76003),l=e(41869),_=e(26542),v=e(43718),m=e(98295),p=e(54414),s=e(17459),g=e(84660),a=n.__importStar(e(20868)),h=e(97821),u=e(80490),c=e(51500),E=e(30981),f=200;t.quickFileOpen={id:"workbench.action.quickOpen",category:"File",label:"Open File..."},t.quickGoToSymbol={id:"workbench.action.gotoSymbol",category:"File",label:"Open File Symbol..."},t.matchLineReg=/^([^:#(]*)[:#(]?L?(\d+)?[:,]?(\d+)?\)?/;function d(I=""){const w=I.match(t.matchLineReg)||[];if(w.length<2)return;const T={line:Number(w[2]||0),start:Number(w[3]||0)};return new a.Range(T.line,T.start,T.line,T.start)}function y(I){return I.replace(t.matchLineReg,"$1")}let b=class extends h.QuickOpenBaseAction{constructor(){super({id:"file-search:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,l.getIcon)("embed")})}async run(w){await this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,w.getUri(),{preview:!1,split:p.EditorGroupSplitAction.Right,range:d(this.injector.get(S).currentLookFor),focus:!0})}};n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b);let A=class{hasActions(){return!0}getActions(){return[this.fileSearchActionLeftRight]}getValidateInput(w){return y(w)}};n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",b)],A.prototype,"fileSearchActionLeftRight",void 0),A=n.__decorate([(0,o.Injectable)()],A);let S=class{constructor(){this.cancelIndicator=new v.CancellationTokenSource,this.default=!0,this.prefix="...",this.description=(0,l.localize)("file-search.command.fileOpen.description"),this.prevEditorState={},this.currentLookFor=""}getModel(){return{onType:async(w,T)=>{this.cancelIndicator.cancel(),this.cancelIndicator=new v.CancellationTokenSource;const R=this.cancelIndicator.token,P=new Set;let O=[];w=w.trim().replace(/\s/g,""),this.currentLookFor=w;const M=y(w),k=this.reporterService.time(v.REPORT_NAME.QUICK_OPEN_MEASURE),F=await this.getRecentlyItems(P,M,R);if(w&&(this.logger.debug("lookFor",w,M),O=await this.getFindOutItems(P,M,R)),R.isCancellationRequested)return;const L=F.concat(O);T(L,L.length?this.fileSearchActionProvider:void 0),k.timeEnd(w.indexOf("@")>-1?"file-symbol":"file",{lookFor:w,stat:{recently:F.length,find:O.length}})}}}getOptions(){return{placeholder:(0,l.localize)("file-search.command.fileOpen.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:{enableSeparateSubstringMatching:!0},getPlaceholderItem:w=>new l.QuickOpenItem({label:(0,l.localize)(w.indexOf("@")>-1?"search.fileSymbolResults.notfound":"search.fileResults.notfound"),run:()=>!1})}}onClose(w){w&&this.prevEditorState.uri&&(this.workbenchEditorService.open(this.prevEditorState.uri,{range:this.prevEditorState.range}),this.prevEditorState={}),this.prevSelected=void 0,this.cancelIndicator.cancel()}onToggle(){this.cancelIndicator.cancel()}trySaveEditorState(){var w;if(this.workbenchEditorService.currentResource){let T={startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1};const R=(w=this.workbenchEditorService.currentEditor)===null||w===void 0?void 0:w.getSelections();if(R){const{selectionStartLineNumber:P,selectionStartColumn:O,positionLineNumber:M,positionColumn:k}=R[0];T=new a.Range(P,O,M,k)}this.prevEditorState={uri:this.workbenchEditorService.currentResource.uri,range:T}}}async getFindOutItems(w,T,R){var P;let O;if(T.indexOf("@")>-1){this.trySaveEditorState(),O=[];const[M,k]=T.split("@");let F;if(this.prevSelected)F=this.prevSelected.withoutFragment();else if(M){const L=await this.getQueryFiles(M,w,R);L.length&&(F=L[0].getUri())}else F=(P=this.workbenchEditorService.currentResource)===null||P===void 0?void 0:P.uri;if(F){const L=await this.documentSymbolStore.getDocumentSymbolAsync(F)||[],B=[];this.flattenSymbols({children:L},B),O=B.filter(W=>{const j=(0,E.matchesFuzzy)(k,W.name,!0)||[];return j&&(W.labelHighlights=j),j&&j.length}).map((W,j)=>{var Q;return new l.QuickOpenItem({uri:F,label:W.name,iconClass:(0,l.getSymbolIcon)(W.kind),description:(Q=W.parent)===null||Q===void 0?void 0:Q.name,labelHighlights:W.labelHighlights,groupLabel:j===0?(0,l.formatLocalize)("search.fileSymbolResults",B.length):"",showBorder:!1,run:G=>G===l.Mode.PREVIEW?(this.locateSymbol(F,W),!0):G===l.Mode.OPEN?(this.locateSymbol(F,W),!0):!1})})}else return[]}else if(O=await this.getQueryFiles(T,w,R),O[0]){const M=await this.getItems([O[0].getUri().codeUri.fsPath],{groupLabel:(0,l.localize)("search.fileResults"),showBorder:!0});O[0]=M[0]}return O}async getQueryFiles(w,T,R){const O=(await this.workspaceService.roots).map(F=>new l.URI(F.uri).codeUri.fsPath),M=await this.fileSearchService.find(w,{rootUris:O,fuzzyMatch:!0,limit:f,useGitIgnore:!0,noIgnoreParent:!0,excludePatterns:this.getPreferenceSearchExcludes()},R),k=await this.getItems(M.filter(F=>T.has(F)||R.isCancellationRequested?!1:(T.add(F),!0)),{});return k.sort(this.compareItems.bind(this)),k}async flattenSymbols(w,T){w.children.forEach(R=>{T.push(R),R.children&&this.flattenSymbols(R,T)})}async getRecentlyItems(w,T,R){const P=await this.recentFilesManager.getMostRecentlyOpenedFiles(!0)||[];return await this.getItems(P.filter(O=>{const M=new l.URI(O);return w.has(O)||!r.default.test(T,M.displayName)||R.isCancellationRequested?!1:(w.add(O),!0)}),{groupLabel:(0,l.localize)("search.historyMatches")})}async getItems(w,T){const R=[];for(const[P,O]of w.entries()){const M=l.URI.isUriString(O)?new l.URI(O):l.URI.file(O),k=`file-icon ${this.labelService.getIcon(M.withoutFragment())}`;let F="";const L=await this.workspaceService.asRelativePath(M.parent);L&&(this.workspaceService.isMultiRootWorkspaceOpened?F=`${new l.URI(L.root).displayName}${L.path?` \u30FB ${L.path}`:""}`:F=L.path||"");const B=new l.QuickOpenItem({uri:M,label:M.displayName,tooltip:O,iconClass:k,description:F,groupLabel:P===0?T.groupLabel:"",showBorder:w.length>0&&P===0?T.showBorder:!1,run:U=>(U===l.Mode.PREVIEW&&(this.prevSelected=M),U===l.Mode.OPEN?(this.openFile(M),!0):!1)});R.push(B)}return R}openFile(w){const T=w.codeUri.fsPath;let R=d(this.currentLookFor);(!R||!R.startLineNumber&&!R.startColumn)&&(R=d(w.fragment?"#"+w.fragment:T)),this.currentLookFor="",this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,w.withoutFragment(),{preview:!1,range:R,focus:!0})}locateSymbol(w,T){this.workbenchEditorService.open(w,{range:T.range,preview:!0})}compareItems(w,T,R="getLabel"){function P(U){return U.trim().toLowerCase()}const O=P(y(this.currentLookFor));function M(U){const W=r.default.match(O,U);return W===null?0:W.score}let k=w[R](),F=T[R]();typeof k!="string"&&(k=k.path.toString()),typeof F!="string"&&(F=F.path.toString()),k=P(k),F=P(F);const L=M(k),B=M(F);if(L===B){const U=k.indexOf(O),W=F.indexOf(O);return U===W?k.length!==F.length?k.length<F.length?-1:1:F.localeCompare(k)===0?R==="getUri"?0:this.compareItems(w,T,"getUri"):F.localeCompare(k):U-W}return B-L}getPreferenceSearchExcludes(){const w=[],T=this.preferenceService.get("files.exclude"),R=this.preferenceService.get("search.exclude"),P=Object.assign({},T,R);for(const O of Object.keys(P))P[O]&&w.push(O);return w}};t.FileSearchQuickCommandHandler=S,n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],S.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(g.FileSearchServicePath),n.__metadata("design:type",Object)],S.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],S.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(s.DocumentSymbolStore),n.__metadata("design:type",s.DocumentSymbolStore)],S.prototype,"documentSymbolStore",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",_.LabelService)],S.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(c.IWorkspaceService),n.__metadata("design:type",Object)],S.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(l.RecentFilesManager),n.__metadata("design:type",l.RecentFilesManager)],S.prototype,"recentFilesManager",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],S.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",A)],S.prototype,"fileSearchActionProvider",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),t.FileSearchQuickCommandHandler=S=n.__decorate([(0,o.Injectable)()],S);let D=class{registerQuickOpenHandlers(w){w.registerHandler(this.fileSearchQuickCommandHandler,{title:(0,l.localize)("quickopen.tab.file"),commandId:t.quickFileOpen.id,order:1})}registerCommands(w){w.registerCommand(t.quickFileOpen,{execute:()=>this.quickOpenService.open("...")}),w.registerCommand(t.quickGoToSymbol,{execute:()=>this.quickOpenService.open("...@")})}registerKeybindings(w){w.registerKeybinding({command:t.quickFileOpen.id,keybinding:"ctrlcmd+p"})}};t.FileSearchContribution=D,n.__decorate([(0,o.Autowired)(S),n.__metadata("design:type",S)],D.prototype,"fileSearchQuickCommandHandler",void 0),n.__decorate([(0,o.Autowired)(h.PrefixQuickOpenService),n.__metadata("design:type",Object)],D.prototype,"quickOpenService",void 0),t.FileSearchContribution=D=n.__decorate([(0,m.Domain)(v.CommandContribution,l.KeybindingContribution,u.QuickOpenContribution)],D)},73827:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientAddonModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69452),_=e(79682),v=e(72915),m=e(27654),p=e(17631),s=e(22874),g=e(79240),a=e(18256),h=e(7756),u=e(16426);let c=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.ChromeDevtoolsContribution,a.LanguageChangeHintContribution,g.FileSearchContribution,h.StatusBarContribution,u.ToolbarCustomizeContribution,p.FileDropContribution,v.ConnectionRTTContribution,{token:l.IFileDropFrontendServiceToken,useClass:s.FileDropService},{token:m.ConnectionRTTBrowserServiceToken,useClass:m.ConnectionRTTBrowserService}],this.backServices=[{servicePath:l.FileDropServicePath},{servicePath:l.ConnectionBackServicePath}]}};t.ClientAddonModule=c,t.ClientAddonModule=c=n.__decorate([(0,r.Injectable)()],c)},18256:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageChangeHintContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665);let _=class{onStart(){this.preferenceService.onSpecificPreferenceChange(o.GeneralSettingsId.Language,async m=>{(0,o.setLanguageId)(m.newValue),this.preferenceService.get("general.askReloadOnLanguageChange")&&await this.dialogService.info((0,o.localize)("preference.general.language.change.refresh.info","After changing the language, it should be restarted to take effect. Will it be refreshed immediately?"),[(0,o.localize)("preference.general.language.change.refresh.later","Later"),(0,o.localize)("preference.general.language.change.refresh.now","Now")])===(0,o.localize)("preference.general.language.change.refresh.now","Now")&&this.clientApp.fireOnReload()})}};t.LanguageChangeHintContribution=_,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],_.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(l.IDialogService),n.__metadata("design:type",Object)],_.prototype,"dialogService",void 0),t.LanguageChangeHintContribution=_=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],_)},7756:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);let _=class extends l.WithEventBus{onStart(){}handleBrowserConnectionOpen(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.logger.log("Browser connection open, change status bar background color")}handleBrowserConnectionClose(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--kt-statusbar-offline-background)"),this.logger.log("Browser connection close, change status bar background color")}};t.StatusBarContribution=_,n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],_.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],_.prototype,"handleBrowserConnectionClose",null),t.StatusBarContribution=_=n.__decorate([(0,l.Domain)(o.ClientAppContribution)],_)},16426:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(62132);let v=class{registerCommands(p){p.registerCommand({id:"toolbar.showCustomizePanel",label:"Show Toolbar Customization"},{execute:()=>{this.viewService.setVisible(!0)}})}registerComponent(p){p.register("addon/toolbar-customize",{id:"addon/toolbar-customize",component:_.ToolbarCustomizeComponent}),this.config.layoutConfig[o.SlotLocation.extra]||(this.config.layoutConfig[o.SlotLocation.extra]={modules:[]}),this.config.layoutConfig[o.SlotLocation.extra].modules.push("addon/toolbar-customize")}registerMenus(p){p.registerMenuItem(l.MenuId.KTToolbarLocationContext,{command:{id:"toolbar.showCustomizePanel",label:(0,o.localize)("toolbar.customize.menu")}})}};t.ToolbarCustomizeContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(_.ToolbarCustomizeViewService),n.__metadata("design:type",_.ToolbarCustomizeViewService)],v.prototype,"viewService",void 0),t.ToolbarCustomizeContribution=v=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ComponentContribution,l.MenuContribution)],v)},62132:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeComponent=t.ToolbarCustomizeViewService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(97267),_=e(41869),v=n.__importDefault(e(18541));let m=class{bindSetVisibleHandle(g){this._setVisible=g}setVisible(g){this._setVisible(g)}async toggleActionVisibility(g,a,h){const u=this.preferenceService.getValid("toolbar.ignoreActions",{});if(u[g]||(u[g]=[]),!h)u[g].indexOf(a)===-1&&u[g].push(a);else{const E=u[g].indexOf(a);E!==-1&&u[g].splice(E,1)}const c=this.preferenceService.inspect("toolbar.ignoreActions").workspaceValue?_.PreferenceScope.Workspace:_.PreferenceScope.User;await this.preferenceService.set("toolbar.ignoreActions",u,c)}};t.ToolbarCustomizeViewService=m,n.__decorate([(0,o.Autowired)(_.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.ToolbarCustomizeViewService=m=n.__decorate([(0,o.Injectable)()],m);const p=()=>{const[s,g]=r.default.useState(!1),a=(0,_.useInjectable)(m),h=(0,_.useInjectable)(_.IToolbarRegistry),u=(0,_.useInjectable)(_.PreferenceService);if(a.bindSetVisibleHandle(g),!s)return null;const c=h.getAllLocations(),E=u.get("toolbar.ignoreActions")||{};let f=u.get("toolbar.buttonDisplay","iconAndText");function d(y){const b=[{id:"_head"},...h.getActionGroups(y)||[],{id:"_tail"}],A=[],S=E[y]||[];return b.forEach((D,I)=>{const w=h.getToolbarActions({location:y,group:D.id});w&&w.actions.length>0&&(A.length>0&&A.push(r.default.createElement("div",{className:v.default["group-split"],key:"split-"+I})),w.actions.forEach((T,R)=>{var P;let O=S.indexOf(T.id)===-1;const M="action-toggle-"+T.id;A.push(r.default.createElement("div",{className:v.default["action-item"],key:R+"_"+T.id},r.default.createElement(l.CheckBox,{onChange:()=>{a.toggleActionVisibility(y,T.id,!O),O=!O},defaultChecked:O,id:M,label:(P=T.description)!==null&&P!==void 0?P:T.id})))}))}),A.length===0?null:r.default.createElement("div",{key:y,className:v.default["toolbar-customize-location"]},A)}return r.default.createElement("div",{className:v.default["toolbar-customize-overlay"]},r.default.createElement("div",{className:v.default["toolbar-customize"]},c.map(y=>d(y)),r.default.createElement("div",{className:v.default["button-display"]},r.default.createElement("div",null,(0,_.localize)("toolbar-customize.buttonDisplay.description")),r.default.createElement(l.Select,{options:[{label:(0,_.localize)("toolbar-customize.buttonDisplay.icon"),value:"icon"},{label:(0,_.localize)("toolbar-customize.buttonDisplay.iconAndText"),value:"iconAndText"}],value:f,onChange:y=>{const b=u.inspect("toolbar.buttonDisplay").workspaceValue?_.PreferenceScope.Workspace:_.PreferenceScope.User;u.set("toolbar.buttonDisplay",y,b),f=y},className:v.default["button-display-select"]})),r.default.createElement("div",{className:v.default["customize-complete"]},r.default.createElement(l.Button,{type:"primary",onClick:()=>g(!1)},(0,_.localize)("toolbar-customize.complete")))))};t.ToolbarCustomizeComponent=p},69452:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IConnectionBackService=t.ConnectionBackServicePath=t.IFileDropFrontendServiceToken=t.IFileDropServiceToken=t.FileDropServicePath=void 0,t.FileDropServicePath="FileDropServicePath",t.IFileDropServiceToken=Symbol("IFileDropService"),t.IFileDropFrontendServiceToken=Symbol("IFileDropFrontendService"),t.ConnectionBackServicePath="ConnectionBackServicePath",t.IConnectionBackService=Symbol("IConnectionBackService")},77659:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(50394);let _=class{get contextKeyService(){return this._contextKeyService}constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.inlineChatIsVisible=l.InlineChatIsVisible.bind(this._contextKeyService),this.inlineCompletionIsTrigger=l.InlineCompletionIsTrigger.bind(this._contextKeyService),this.inlineHintWidgetIsVisible=l.InlineHintWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsVisible=l.InlineInputWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsStreaming=l.InlineInputWidgetIsStreaming.bind(this._contextKeyService),this.inlineDiffPartialEditsIsVisible=l.InlineDiffPartialEditsIsVisible.bind(this._contextKeyService),this.codeEditsIsVisible=l.CodeEditsIsVisible.bind(this._contextKeyService)}};t.AINativeContextKey=_,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"globalContextKeyService",void 0),t.AINativeContextKey=_=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_)},32016:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeBrowserContribution=t.INLINE_DIFF_MANAGER_WIDGET_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),_=e(50394),v=e(1149),m=e(97222),p=e(43718),s=e(82353),g=e(54414),a=e(57517),h=e(51553),u=e(63067),c=e(46507),E=e(97682),f=e(68415),d=e(96640),y=e(19413),b=e(64811),A=e(69820),S=e(98987),D=e(61282),I=e(42995),w=e(51081),T=e(59347),R=e(76154),P=e(79559),O=e(57232),M=e(72991),k=e(71863),F=e(7511),L=e(42911),B=e(72801),U=e(87817),W=e(4972),j=e(82983),Q=e(73974),G=e(33108),Z=e(77633),$=e(51221),V=e(2281),H=e(31031),K=e(95608),Y=e(38890),X=e(77886),oe=e(89060),ie=e(74353),he=e(22169),me=e(90058);t.INLINE_DIFF_MANAGER_WIDGET_ID="inline-diff-manager-widget";let q=class{constructor(){this.registerFeature()}registerMultiDiffSourceResolver(ue){return ue.registerResolver(this.chatMultiDiffResolver)}registerEditorDocumentModelContentProvider(ue){ue.registerEditorDocumentModelContentProvider(this.chatEditResourceProvider)}async initialize(){const{supportsChatAssistant:ue}=this.aiNativeConfigService.capabilities;ue&&(o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,y.AI_CHAT_VIEW_ID,y.AI_CHAT_CONTAINER_ID),o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,s.DESIGN_MENU_BAR_RIGHT,y.AI_CHAT_LOGO_AVATAR_ID),this.chatProxyService.registerDefaultAgent(),this.chatInternalService.init(),await this.chatManagerService.init())}registerEditorExtensionContribution(ue){const{supportsInlineChat:te,supportsInlineCompletion:fe,supportsProblemFix:Ie,supportsCodeAction:Me}=this.aiNativeConfigService.capabilities;ue(Y.InlineDiffController.ID,new d.SyncDescriptor(Y.InlineDiffController,[this.injector]),E.EditorContributionInstantiation.Lazy),Me&&ue(me.SumiLightBulbWidget.ID,me.SumiLightBulbWidget,E.EditorContributionInstantiation.Lazy),te&&(ue($.InlineChatEditorController.ID,new d.SyncDescriptor($.InlineChatEditorController,[this.injector]),E.EditorContributionInstantiation.BeforeFirstInteraction),this.inlineInputService.getInteractiveInputHandler()&&(ue(X.InlineHintController.ID,new d.SyncDescriptor(X.InlineHintController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender),ue(oe.InlineInputController.ID,new d.SyncDescriptor(oe.InlineInputController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender))),fe&&(ue(F.IntelligentCompletionsController.ID,new d.SyncDescriptor(F.IntelligentCompletionsController,[this.injector]),E.EditorContributionInstantiation.Eager),ue(M.InlineCompletionsController.ID,new d.SyncDescriptor(M.InlineCompletionsController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)),Ie&&ue(L.ProblemFixController.ID,new d.SyncDescriptor(L.ProblemFixController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)}onReconnect(){const{supportsMCP:ue}=this.aiNativeConfigService.capabilities;ue&&this.initMCPServers()}onDidStart(){(0,p.runWhenIdle)(()=>{const{supportsRenameSuggestions:ue,supportsInlineChat:te,supportsMCP:fe,supportsCustomLLMSettings:Ie}=this.aiNativeConfigService.capabilities,Me=this.preferenceService.getValid(o.AINativeSettingSectionsId.ChatVisibleType);Me==="always"?this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!0):Me==="never"&&this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!1),ue&&this.renameSingleHandler.load(),te&&this.codeActionSingleHandler.load(),Ie&&(this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.LLMModelSelection,Be=>{const Pe=this.getModelByName(Be.newValue),we=Pe?Object.keys(Pe):[],_e=we.length?we[0]:"",Ne=this.preferenceSchemaProvider.getPreferenceProperty(o.AINativeSettingSectionsId.ModelID);this.preferenceSchemaProvider.setSchema({properties:{[o.AINativeSettingSectionsId.ModelID]:{...Ne,default:_e,defaultValue:_e,enum:we.length?we:void 0}}},!0),this.preferenceService.set(o.AINativeSettingSectionsId.ModelID,_e,Be.scope),this.preferenceSettings.setEnumLabels(o.AINativeSettingSectionsId.ModelID,we.reduce((Te,We)=>({...Te,[We]:We}),{}))}),this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.ModelID,Be=>{const Pe=this.preferenceService.get(o.AINativeSettingSectionsId.LLMModelSelection);if(!Pe)return;const we=this.getModelByName(Pe);we&&we[Be.newValue]&&(this.preferenceService.set(o.AINativeSettingSectionsId.MaxTokens,we[Be.newValue].maxTokens,Be.scope),this.preferenceService.set(o.AINativeSettingSectionsId.ContextWindow,we[Be.newValue].contextWindow,Be.scope))})),fe&&this.initMCPServers()})}async initMCPServers(){var ue;const te=await this.storageProvider(p.STORAGE_NAMESPACE.CHAT);let fe=te.get(b.MCPServersEnabledKey,[y.BUILTIN_MCP_SERVER_NAME]);const Ie=this.preferenceService.get(o.AINativeSettingSectionsId.MCPServers,[]);let Me=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0);if(Me.scope===p.PreferenceScope.Default&&Ie.length>0){const Pe={mcpServers:{}},we=new Set([y.BUILTIN_MCP_SERVER_NAME]);Ie.forEach(_e=>{_e.type===A.MCP_SERVER_TYPE.SSE?Pe.mcpServers[_e.name]={url:_e.serverHost}:_e.type===A.MCP_SERVER_TYPE.STDIO&&(Pe.mcpServers[_e.name]={command:_e.command,args:_e.args,env:_e.env}),_e.enabled&&we.add(_e.name)}),await this.preferenceService.set("mcp",Pe,p.PreferenceScope.Workspace),Me=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0),fe=Array.from(we),te.set(b.MCPServersEnabledKey,fe)}const Be=(ue=Me.value)===null||ue===void 0?void 0:ue.mcpServers;if(this.sumiMCPServerBackendProxy.$initBuiltinMCPServer(fe.includes(y.BUILTIN_MCP_SERVER_NAME)),Be&&Object.keys(Be).length>0){const Pe=(await Promise.all(Object.keys(Be).map(async we=>await this.mcpConfigService.getServerConfigByName(we)))).filter(we=>we!==void 0);await this.sumiMCPServerBackendProxy.$initExternalMCPServers(Pe)}this.mcpConfigService.fireMCPServersChange(!0)}getModelByName(ue){switch(ue){case"deepseek":return y.deepSeekModels;case"anthropic":return y.anthropicModels;case"openai":return y.openAiNativeModels;default:return}}registerFeature(){this.contributions.getContributions().forEach(ue=>{var te,fe,Ie,Me,Be,Pe,we,_e,Ne;(te=ue.registerInlineChatFeature)===null||te===void 0||te.call(ue,this.inlineChatFeatureRegistry),(fe=ue.registerChatFeature)===null||fe===void 0||fe.call(ue,this.chatFeatureRegistry),(Ie=ue.registerResolveConflictFeature)===null||Ie===void 0||Ie.call(ue,this.resolveConflictRegistry),(Me=ue.registerRenameProvider)===null||Me===void 0||Me.call(ue,this.renameCandidatesProviderRegistry),(Be=ue.registerChatRender)===null||Be===void 0||Be.call(ue,this.chatRenderRegistry),(Pe=ue.registerTerminalProvider)===null||Pe===void 0||Pe.call(ue,this.terminalProviderRegistry),(we=ue.registerIntelligentCompletionFeature)===null||we===void 0||we.call(ue,this.intelligentCompletionsRegistry),(_e=ue.registerProblemFixFeature)===null||_e===void 0||_e.call(ue,this.problemFixProviderRegistry),(Ne=ue.registerChatAgentPromptProvider)===null||Ne===void 0||Ne.call(ue)}),this.mcpServerContributions.getContributions().forEach(ue=>{ue.registerMCPServer(this.mcpServerRegistry)})}registerSetting(ue){ue.registerSettingGroup({id:o.AI_NATIVE_SETTING_GROUP_ID,title:p.AI_NATIVE_SETTING_GROUP_TITLE,iconClass:(0,o.getIcon)("magic-wand")}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.chat.title"),preferences:[{id:o.AINativeSettingSectionsId.ChatVisibleType,localized:"preference.ai.native.chat.visible.type"}]}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.interface.quick.title"),preferences:[{id:o.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,localized:"preference.ai.native.interface.quick.navigation"}]}),this.aiNativeConfigService.capabilities.supportsInlineCompletion&&(ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.intelligentCompletions.title"),preferences:[{id:o.AINativeSettingSectionsId.IntelligentCompletionsCacheEnabled,localized:"preference.ai.native.intelligentCompletions.cache.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsDebounceTime,localized:"preference.ai.native.intelligentCompletions.debounceTime"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsPromptEngineeringEnabled,localized:"preference.ai.native.intelligentCompletions.promptEngineering.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,localized:"preference.ai.native.intelligentCompletions.alwaysVisible"}]}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.codeEdits.title"),preferences:[{id:o.AINativeSettingSectionsId.CodeEditsLintErrors,localized:"preference.ai.native.codeEdits.lintErrors"},{id:o.AINativeSettingSectionsId.CodeEditsLineChange,localized:"preference.ai.native.codeEdits.lineChange"},{id:o.AINativeSettingSectionsId.CodeEditsTyping,localized:"preference.ai.native.codeEdits.typing"},{id:o.AINativeSettingSectionsId.CodeEditsRenderType,localized:"preference.ai.native.codeEdits.renderType"},{id:o.AINativeSettingSectionsId.SystemPrompt,localized:"preference.ai.native.chat.system.prompt"}]})),this.aiNativeConfigService.capabilities.supportsCustomLLMSettings&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.llm.apiSettings.title"),preferences:[{id:o.AINativeSettingSectionsId.LLMModelSelection,localized:"preference.ai.native.llm.model.selection"},{id:o.AINativeSettingSectionsId.ModelID,localized:"preference.ai.native.llm.model.id"},{id:o.AINativeSettingSectionsId.DeepseekApiKey,localized:"preference.ai.native.deepseek.apiKey"},{id:o.AINativeSettingSectionsId.AnthropicApiKey,localized:"preference.ai.native.anthropic.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiApiKey,localized:"preference.ai.native.openai.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiBaseURL,localized:"preference.ai.native.openai.baseURL"},{id:o.AINativeSettingSectionsId.MaxTokens,localized:"preference.ai.native.maxTokens"},{id:o.AINativeSettingSectionsId.ContextWindow,localized:"preference.ai.native.contextWindow"}]}),this.aiNativeConfigService.capabilities.supportsMCP&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.mcp.settings.title"),preferences:[{id:o.AINativeSettingSectionsId.MCPServers,localized:"preference.ai.native.mcp.servers"},{id:o.AINativeSettingSectionsId.TerminalAutoRun,localized:"ai.native.terminal.autorun"}]}),this.aiNativeConfigService.capabilities.supportsInlineChat&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.inlineChat.title"),preferences:[{id:o.AINativeSettingSectionsId.InlineChatAutoVisible,localized:"preference.ai.native.inlineChat.auto.visible"},{id:o.AINativeSettingSectionsId.InlineChatCodeActionEnabled,localized:"preference.ai.native.inlineChat.codeAction.enabled"},{id:o.AINativeSettingSectionsId.InlineDiffPreviewMode,localized:"preference.ai.native.inlineDiff.preview.mode"}]})}registerEditorFeature(ue){ue.registerEditorFeatureContribution({contribute:te=>{const{monacoEditor:fe}=te;return this.codeActionSingleHandler.mountEditor(te.monacoEditor),fe.onDidScrollChange(()=>{this.ctxMenuRenderer.visible&&this.ctxMenuRenderer.hide(!0)})}})}registerEditorComponent(ue){ue.registerEditorSideWidget({id:t.INLINE_DIFF_MANAGER_WIDGET_ID,component:K.InlineDiffManager,displaysOnResource:te=>{var fe;return!!(this.aiNativeConfigService.capabilities.supportsMCP&&(!((fe=this.applyService.getUriCodeBlocks(te.uri))===null||fe===void 0)&&fe.filter(Ie=>Ie.status==="pending").length))}})}registerCommands(ue){ue.registerCommand(l.AI_INLINE_CHAT_VISIBLE,{execute:te=>{this.aiInlineChatService._onInlineChatVisible.fire(te)}}),ue.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE,{execute:async te=>{var fe;if(!te){this.inlineInputService.hide();return}this.commandService.executeCommand(l.AI_INLINE_CHAT_VISIBLE.id,!1);const Ie=this.workbenchEditorService.currentCodeEditor;if(!Ie)return;const Me=Ie.monacoEditor.getPosition();if(!Me)return;const Be=Ie.monacoEditor.getSelection();if(Me?((fe=Ie.monacoEditor.getModel())===null||fe===void 0?void 0:fe.getLineLength(Me.lineNumber))===0:!1){this.inlineInputService.visibleByPosition(Me);return}if(Be&&!Be.isEmpty()){this.inlineInputService.visibleBySelection(Be);return}this.inlineInputService.visibleByNearestCodeBlock(Me,Ie.monacoEditor)}}),ue.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL,{execute:()=>{var te;const fe=this.workbenchEditorService.currentCodeEditor;fe&&((te=oe.InlineInputController.get(fe.monacoEditor))===null||te===void 0||te.cancelToken())}}),ue.registerCommand(l.AI_INLINE_COMPLETION_REPORTER,{execute:(te,fe,Ie,Me)=>{this.aiCompletionsService.report({sessionId:fe,accept:Ie,relationId:te,code:Me})}}),ue.registerCommand(l.AI_CHAT_VISIBLE,{execute:te=>{this.layoutService.toggleSlot(y.AI_CHAT_VIEW_ID,(0,p.isUndefined)(te)?!0:te)}}),ue.registerCommand(l.AI_INLINE_COMPLETION_VISIBLE,{execute:async te=>{te||(this.aiCompletionsService.hideStatusBarItem(),this.aiInlineCompletionsProvider.setVisibleCompletion(!1),this.aiInlineCompletionsProvider.cancelRequest())}}),ue.registerCommand(l.AI_INLINE_DIFF_PARTIAL_EDIT,{execute:te=>{this.inlineStreamDiffService.launchAcceptDiscardPartialEdit(te)}}),ue.afterExecuteCommand(f.HideInlineCompletion.ID,()=>{this.commandService.executeCommand(l.AI_INLINE_COMPLETION_VISIBLE.id,!1)})}registerRenderer(ue){const te={isLatter:!0,supportedActions:{accordion:!0}};this.designLayoutConfig.supportExternalChatPanel?ue.registerSlotRenderer(y.AI_CHAT_VIEW_ID,W.AIChatTabRendererWithTab,te):ue.registerSlotRenderer(y.AI_CHAT_VIEW_ID,W.AIChatTabRenderer,te),this.designLayoutConfig.useMergeRightWithLeftPanel&&(ue.registerSlotRenderer(o.SlotLocation.view,W.AILeftTabRenderer,Object.assign({},te,{isLatter:!1})),ue.registerSlotRenderer(o.SlotLocation.extendView,W.AIRightTabRenderer,te))}registerComponent(ue){ue.register(y.AI_CHAT_CONTAINER_ID,[],{component:R.AIChatView,title:(0,o.localize)("aiNative.chat.ai.assistant.name"),iconClass:(0,o.getIcon)("magic-wand"),containerId:y.AI_CHAT_CONTAINER_ID}),ue.register(y.AI_MENU_BAR_DEBUG_TOOLBAR,{id:y.AI_MENU_BAR_DEBUG_TOOLBAR,component:U.AIRunToolbar}),ue.register(y.AI_CHAT_LOGO_AVATAR_ID,{id:y.AI_CHAT_LOGO_AVATAR_ID,component:j.AIChatLogoAvatar})}registerKeybindings(ue){this.aiNativeConfigService.capabilities.supportsInlineChat&&(ue.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"ctrlcmd+i",when:"editorTextFocus",args:!0,priority:0},o.KeybindingScope.USER),ue.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"esc",args:!1,when:`editorFocus && ${_.InlineChatIsVisible.raw}`}),this.inlineInputService.getInteractiveInputHandler()&&(ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && (${_.InlineChatIsVisible.raw} || inlineSuggestionVisible)`},o.KeybindingScope.USER),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:"esc",args:!1,priority:0,when:`editorFocus && ${_.InlineInputWidgetIsVisible.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL.id,keybinding:"esc",priority:1,when:`editorFocus && ${_.InlineInputWidgetIsStreaming.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && ${_.InlineHintWidgetIsVisible.raw} && ${_.InlineChatIsVisible.not}`},o.KeybindingScope.USER))),ue.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+y",args:!0,priority:100,when:`editorTextFocus && ${_.InlineDiffPartialEditsIsVisible.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+n",args:!1,priority:100,when:`editorTextFocus && ${_.InlineDiffPartialEditsIsVisible.raw}`})}};t.AINativeBrowserContribution=q,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IBrowserCtxMenu),n.__metadata("design:type",m.IBrowserCtxMenu)],q.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(Z.AINativeCoreContribution),n.__metadata("design:type",Object)],q.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(Z.MCPServerContribution),n.__metadata("design:type",Object)],q.prototype,"mcpServerContributions",void 0),n.__decorate([(0,r.Autowired)(Z.TokenMCPServerRegistry),n.__metadata("design:type",Object)],q.prototype,"mcpServerRegistry",void 0),n.__decorate([(0,r.Autowired)(p.InlineChatFeatureRegistryToken),n.__metadata("design:type",V.InlineChatFeatureRegistry)],q.prototype,"inlineChatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],q.prototype,"chatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ChatRenderRegistryToken),n.__metadata("design:type",Object)],q.prototype,"chatRenderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ResolveConflictRegistryToken),n.__metadata("design:type",Object)],q.prototype,"resolveConflictRegistry",void 0),n.__decorate([(0,r.Autowired)(p.RenameCandidatesProviderRegistryToken),n.__metadata("design:type",Object)],q.prototype,"renameCandidatesProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.TerminalRegistryToken),n.__metadata("design:type",Object)],q.prototype,"terminalProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.IntelligentCompletionsRegistryToken),n.__metadata("design:type",Object)],q.prototype,"intelligentCompletionsRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ProblemFixRegistryToken),n.__metadata("design:type",Object)],q.prototype,"problemFixProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],q.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(v.DesignLayoutConfig),n.__metadata("design:type",v.DesignLayoutConfig)],q.prototype,"designLayoutConfig",void 0),n.__decorate([(0,r.Autowired)(k.AICompletionsService),n.__metadata("design:type",k.AICompletionsService)],q.prototype,"aiCompletionsService",void 0),n.__decorate([(0,r.Autowired)(O.AIInlineCompletionsProvider),n.__metadata("design:type",O.AIInlineCompletionsProvider)],q.prototype,"aiInlineCompletionsProvider",void 0),n.__decorate([(0,r.Autowired)(p.CommandService),n.__metadata("design:type",Object)],q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],q.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],q.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(u.IMainLayoutService),n.__metadata("design:type",Object)],q.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(y.ChatProxyServiceToken),n.__metadata("design:type",w.ChatProxyService)],q.prototype,"chatProxyService",void 0),n.__decorate([(0,r.Autowired)(o.IAIInlineChatService),n.__metadata("design:type",H.InlineChatService)],q.prototype,"aiInlineChatService",void 0),n.__decorate([(0,r.Autowired)(ie.InlineInputService),n.__metadata("design:type",ie.InlineInputService)],q.prototype,"inlineInputService",void 0),n.__decorate([(0,r.Autowired)(he.InlineStreamDiffService),n.__metadata("design:type",he.InlineStreamDiffService)],q.prototype,"inlineStreamDiffService",void 0),n.__decorate([(0,r.Autowired)(B.RenameSingleHandler),n.__metadata("design:type",B.RenameSingleHandler)],q.prototype,"renameSingleHandler",void 0),n.__decorate([(0,r.Autowired)(P.CodeActionSingleHandler),n.__metadata("design:type",P.CodeActionSingleHandler)],q.prototype,"codeActionSingleHandler",void 0),n.__decorate([(0,r.Autowired)(y.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],q.prototype,"sumiMCPServerBackendProxy",void 0),n.__decorate([(0,r.Autowired)(p.MCPConfigServiceToken),n.__metadata("design:type",G.MCPConfigService)],q.prototype,"mcpConfigService",void 0),n.__decorate([(0,r.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",h.WorkbenchEditorServiceImpl)],q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(y.IChatManagerService),n.__metadata("design:type",D.ChatManagerService)],q.prototype,"chatManagerService",void 0),n.__decorate([(0,r.Autowired)(y.IChatInternalService),n.__metadata("design:type",T.ChatInternalService)],q.prototype,"chatInternalService",void 0),n.__decorate([(0,r.Autowired)(Q.BaseApplyService),n.__metadata("design:type",Q.BaseApplyService)],q.prototype,"applyService",void 0),n.__decorate([(0,r.Autowired)(p.StorageProvider),n.__metadata("design:type",Function)],q.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",S.ChatEditSchemeDocumentProvider)],q.prototype,"chatEditResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",I.ChatMultiDiffResolver)],q.prototype,"chatMultiDiffResolver",void 0),t.AINativeBrowserContribution=q=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.BrowserEditorContribution,o.CommandContribution,c.SettingContribution,o.KeybindingContribution,o.ComponentContribution,o.SlotRendererContribution,o.MonacoContribution,a.MultiDiffSourceContribution),n.__metadata("design:paramtypes",[])],q)},96366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplyService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),_=e(19413),v=e(73974),m=e(51081);let p=class extends v.BaseApplyService{async doApply(g){const a=new o.URI(o.path.join(this.appConfig.workspaceDir,g.relativePath)),u=(await this.modelService.createModelReference(a)).instance.getMonacoModel().getValue();return{stream:await this.aiBackService.requestStream(`Merge all changes from the <update> snippet into the <code> below.
31688
+ ${JSON.stringify(r,null,2)}`);const l=n[o]();return new Language(INTERNAL,l)})}}class LookaheadIterable{constructor(t,e,n){assertInternal(t),this[0]=e,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(t){return C._ts_lookahead_iterator_reset_state(this[0],t)}reset(t,e){return!!C._ts_lookahead_iterator_reset(this[0],t[0],e)&&(this.language=t,!0)}[Symbol.iterator](){const t=this;return{next:()=>C._ts_lookahead_iterator_next(t[0])?{done:!1,value:t.currentType}:{done:!0,value:""}}}}class Query{constructor(t,e,n,r,o,l,_,v){assertInternal(t),this[0]=e,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=l,this.assertedProperties=_,this.refutedProperties=v,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:_=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_matches_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,_);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=new Array(v);this.exceededMatchLimit=!!p;let g=0,a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const c=getValue(a,"i32");a+=SIZE_OF_INT;const E=new Array(c);if(a=unmarshalCaptures(this,t.tree,a,E),this.textPredicates[u].every(f=>f(E))){s[g]={pattern:u,captures:E};const f=this.setProperties[u];f&&(s[g].setProperties=f);const d=this.assertedProperties[u];d&&(s[g].assertedProperties=d);const y=this.refutedProperties[u];y&&(s[g].refutedProperties=y),g++}}return s.length=g,C._free(m),s}captures(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:_=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_captures_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,_);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=[];this.exceededMatchLimit=!!p;const g=[];let a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const c=getValue(a,"i32");a+=SIZE_OF_INT;const E=getValue(a,"i32");if(a+=SIZE_OF_INT,g.length=c,a=unmarshalCaptures(this,t.tree,a,g),this.textPredicates[u].every(f=>f(g))){const f=g[E],d=this.setProperties[u];d&&(f.setProperties=d);const y=this.assertedProperties[u];y&&(f.assertedProperties=y);const b=this.refutedProperties[u];b&&(f.refutedProperties=b),s.push(f)}}return C._free(m),s}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){const e=lengthBytesUTF8(t),n=C._malloc(e+1);stringToUTF8(t,n,e+1),C._ts_query_disable_capture(this[0],n,e),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(x,t,e){const n=e-t;let r=x.textCallback(t,null,e);for(t+=r.length;t<e;){const o=x.textCallback(t,null,e);if(!(o&&o.length>0))break;t+=o.length,r+=o}return t>e&&(r=r.slice(0,n)),r}function unmarshalCaptures(x,t,e,n){for(let r=0,o=n.length;r<o;r++){const l=getValue(e,"i32"),_=unmarshalNode(t,e+=SIZE_OF_INT);e+=SIZE_OF_NODE,n[r]={name:x.captureNames[l],node:_}}return e}function assertInternal(x){if(x!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(x){return x&&typeof x.row=="number"&&typeof x.column=="number"}function marshalNode(x){let t=TRANSFER_BUFFER;setValue(t,x.id,"i32"),t+=SIZE_OF_INT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.row,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.column,"i32"),t+=SIZE_OF_INT,setValue(t,x[0],"i32")}function unmarshalNode(x,t=TRANSFER_BUFFER){const e=getValue(t,"i32");if(e===0)return null;const n=getValue(t+=SIZE_OF_INT,"i32"),r=getValue(t+=SIZE_OF_INT,"i32"),o=getValue(t+=SIZE_OF_INT,"i32"),l=getValue(t+=SIZE_OF_INT,"i32"),_=new Node(INTERNAL,x);return _.id=e,_.startIndex=n,_.startPosition={row:r,column:o},_[0]=l,_}function marshalTreeCursor(x,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,x[0],"i32"),setValue(t+1*SIZE_OF_INT,x[1],"i32"),setValue(t+2*SIZE_OF_INT,x[2],"i32"),setValue(t+3*SIZE_OF_INT,x[3],"i32")}function unmarshalTreeCursor(x){x[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),x[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),x[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),x[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(x,t){setValue(x,t.row,"i32"),setValue(x+SIZE_OF_INT,t.column,"i32")}function unmarshalPoint(x){return{row:getValue(x,"i32")>>>0,column:getValue(x+SIZE_OF_INT,"i32")>>>0}}function marshalRange(x,t){marshalPoint(x,t.startPosition),marshalPoint(x+=SIZE_OF_POINT,t.endPosition),setValue(x+=SIZE_OF_POINT,t.startIndex,"i32"),setValue(x+=SIZE_OF_INT,t.endIndex,"i32"),x+=SIZE_OF_INT}function unmarshalRange(x){const t={};return t.startPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.startIndex=getValue(x,"i32")>>>0,x+=SIZE_OF_INT,t.endIndex=getValue(x,"i32")>>>0,t}function marshalEdit(x){let t=TRANSFER_BUFFER;marshalPoint(t,x.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.newEndPosition),t+=SIZE_OF_POINT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.oldEndIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.newEndIndex,"i32"),t+=SIZE_OF_INT}for(const x of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,x,{value:ParserImpl.prototype[x],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser}();module.exports=TreeSitter},52730:(x,t,e)=>{"use strict";var n=e(80705),r=e(14834),o=e(28498),l=e(79818),_=e(69336),v=l("Object.prototype.toString"),m=e(51913)(),p=typeof globalThis>"u"?e.g:globalThis,s=r(),g=l("String.prototype.slice"),a=Object.getPrototypeOf,h=l("Array.prototype.indexOf",!0)||function(d,y){for(var b=0;b<d.length;b+=1)if(d[b]===y)return b;return-1},u={__proto__:null};m&&_&&a?n(s,function(f){var d=new p[f];if(Symbol.toStringTag in d){var y=a(d),b=_(y,Symbol.toStringTag);if(!b){var A=a(y);b=_(A,Symbol.toStringTag)}u["$"+f]=o(b.get)}}):n(s,function(f){var d=new p[f],y=d.slice||d.set;y&&(u["$"+f]=o(y))});var c=function(d){var y=!1;return n(u,function(b,A){if(!y)try{"$"+b(d)===A&&(y=g(A,1))}catch{}}),y},E=function(d){var y=!1;return n(u,function(b,A){if(!y)try{b(d),y=g(A,1)}catch{}}),y};x.exports=function(d){if(!d||typeof d!="object")return!1;if(!m){var y=g(v(d),8,-1);return h(s,y)>-1?y:y!=="Object"?!1:E(d)}return _?c(d):null}},97442:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const n=e(94705);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const r=l=>JSON.stringify(l,null,2).replace(/"([^"]+)":/g,"$1:");t.quotelessJson=r;class o extends Error{get errors(){return this.issues}constructor(_){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const v=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,v):this.__proto__=v,this.name="ZodError",this.issues=_}format(_){const v=_||function(s){return s.message},m={_errors:[]},p=s=>{for(const g of s.issues)if(g.code==="invalid_union")g.unionErrors.map(p);else if(g.code==="invalid_return_type")p(g.returnTypeError);else if(g.code==="invalid_arguments")p(g.argumentsError);else if(g.path.length===0)m._errors.push(v(g));else{let a=m,h=0;for(;h<g.path.length;){const u=g.path[h];h===g.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(v(g))):a[u]=a[u]||{_errors:[]},a=a[u],h++}}};return p(this),m}static assert(_){if(!(_ instanceof o))throw new Error(`Not a ZodError: ${_}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(_=v=>v.message){const v={},m=[];for(const p of this.issues)p.path.length>0?(v[p.path[0]]=v[p.path[0]]||[],v[p.path[0]].push(_(p))):m.push(_(p));return{formErrors:m,fieldErrors:v}}get formErrors(){return this.flatten()}}t.ZodError=o,o.create=l=>new o(l)},30548:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const r=n(e(28412));t.defaultErrorMap=r.default;let o=r.default;function l(v){o=v}t.setErrorMap=l;function _(){return o}t.getErrorMap=_},86340:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(o,l,_,v){v===void 0&&(v=_);var m=Object.getOwnPropertyDescriptor(l,_);(!m||("get"in m?!l.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return l[_]}}),Object.defineProperty(o,v,m)}:function(o,l,_,v){v===void 0&&(v=_),o[v]=l[_]}),r=this&&this.__exportStar||function(o,l){for(var _ in o)_!=="default"&&!Object.prototype.hasOwnProperty.call(l,_)&&n(l,o,_)};Object.defineProperty(t,"__esModule",{value:!0}),r(e(30548),t),r(e(66258),t),r(e(29201),t),r(e(94705),t),r(e(75226),t),r(e(97442),t)},15759:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0;var e;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(e||(t.errorUtil=e={}))},66258:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const r=e(30548),o=n(e(28412)),l=u=>{const{data:c,path:E,errorMaps:f,issueData:d}=u,y=[...E,...d.path||[]],b={...d,path:y};if(d.message!==void 0)return{...d,path:y,message:d.message};let A="";const S=f.filter(D=>!!D).slice().reverse();for(const D of S)A=D(b,{data:c,defaultError:A}).message;return{...d,path:y,message:A}};t.makeIssue=l,t.EMPTY_PATH=[];function _(u,c){const E=(0,r.getErrorMap)(),f=(0,t.makeIssue)({issueData:c,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,E,E===o.default?void 0:o.default].filter(d=>!!d)});u.common.issues.push(f)}t.addIssueToContext=_;class v{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(c,E){const f=[];for(const d of E){if(d.status==="aborted")return t.INVALID;d.status==="dirty"&&c.dirty(),f.push(d.value)}return{status:c.value,value:f}}static async mergeObjectAsync(c,E){const f=[];for(const d of E){const y=await d.key,b=await d.value;f.push({key:y,value:b})}return v.mergeObjectSync(c,f)}static mergeObjectSync(c,E){const f={};for(const d of E){const{key:y,value:b}=d;if(y.status==="aborted"||b.status==="aborted")return t.INVALID;y.status==="dirty"&&c.dirty(),b.status==="dirty"&&c.dirty(),y.value!=="__proto__"&&(typeof b.value<"u"||d.alwaysSet)&&(f[y.value]=b.value)}return{status:c.value,value:f}}}t.ParseStatus=v,t.INVALID=Object.freeze({status:"aborted"});const m=u=>({status:"dirty",value:u});t.DIRTY=m;const p=u=>({status:"valid",value:u});t.OK=p;const s=u=>u.status==="aborted";t.isAborted=s;const g=u=>u.status==="dirty";t.isDirty=g;const a=u=>u.status==="valid";t.isValid=a;const h=u=>typeof Promise<"u"&&u instanceof Promise;t.isAsync=h},29201:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94705:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var e;(function(o){o.assertEqual=m=>m;function l(m){}o.assertIs=l;function _(m){throw new Error}o.assertNever=_,o.arrayToEnum=m=>{const p={};for(const s of m)p[s]=s;return p},o.getValidEnumValues=m=>{const p=o.objectKeys(m).filter(g=>typeof m[m[g]]!="number"),s={};for(const g of p)s[g]=m[g];return o.objectValues(s)},o.objectValues=m=>o.objectKeys(m).map(function(p){return m[p]}),o.objectKeys=typeof Object.keys=="function"?m=>Object.keys(m):m=>{const p=[];for(const s in m)Object.prototype.hasOwnProperty.call(m,s)&&p.push(s);return p},o.find=(m,p)=>{for(const s of m)if(p(s))return s},o.isInteger=typeof Number.isInteger=="function"?m=>Number.isInteger(m):m=>typeof m=="number"&&isFinite(m)&&Math.floor(m)===m;function v(m,p=" | "){return m.map(s=>typeof s=="string"?`'${s}'`:s).join(p)}o.joinValues=v,o.jsonStringifyReplacer=(m,p)=>typeof p=="bigint"?p.toString():p})(e||(t.util=e={}));var n;(function(o){o.mergeShapes=(l,_)=>({...l,..._})})(n||(t.objectUtil=n={})),t.ZodParsedType=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const r=o=>{switch(typeof o){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(o)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(o)?t.ZodParsedType.array:o===null?t.ZodParsedType.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?t.ZodParsedType.promise:typeof Map<"u"&&o instanceof Map?t.ZodParsedType.map:typeof Set<"u"&&o instanceof Set?t.ZodParsedType.set:typeof Date<"u"&&o instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=r},75995:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(v,m,p,s){s===void 0&&(s=p);var g=Object.getOwnPropertyDescriptor(m,p);(!g||("get"in g?!m.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return m[p]}}),Object.defineProperty(v,s,g)}:function(v,m,p,s){s===void 0&&(s=p),v[s]=m[p]}),r=this&&this.__setModuleDefault||(Object.create?function(v,m){Object.defineProperty(v,"default",{enumerable:!0,value:m})}:function(v,m){v.default=m}),o=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var m={};if(v!=null)for(var p in v)p!=="default"&&Object.prototype.hasOwnProperty.call(v,p)&&n(m,v,p);return r(m,v),m},l=this&&this.__exportStar||function(v,m){for(var p in v)p!=="default"&&!Object.prototype.hasOwnProperty.call(m,p)&&n(m,v,p)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const _=o(e(86340));t.z=_,l(e(86340),t),t.default=_},28412:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(94705),r=e(97442),o=(l,_)=>{let v;switch(l.code){case r.ZodIssueCode.invalid_type:l.received===n.ZodParsedType.undefined?v="Required":v=`Expected ${l.expected}, received ${l.received}`;break;case r.ZodIssueCode.invalid_literal:v=`Invalid literal value, expected ${JSON.stringify(l.expected,n.util.jsonStringifyReplacer)}`;break;case r.ZodIssueCode.unrecognized_keys:v=`Unrecognized key(s) in object: ${n.util.joinValues(l.keys,", ")}`;break;case r.ZodIssueCode.invalid_union:v="Invalid input";break;case r.ZodIssueCode.invalid_union_discriminator:v=`Invalid discriminator value. Expected ${n.util.joinValues(l.options)}`;break;case r.ZodIssueCode.invalid_enum_value:v=`Invalid enum value. Expected ${n.util.joinValues(l.options)}, received '${l.received}'`;break;case r.ZodIssueCode.invalid_arguments:v="Invalid function arguments";break;case r.ZodIssueCode.invalid_return_type:v="Invalid function return type";break;case r.ZodIssueCode.invalid_date:v="Invalid date";break;case r.ZodIssueCode.invalid_string:typeof l.validation=="object"?"includes"in l.validation?(v=`Invalid input: must include "${l.validation.includes}"`,typeof l.validation.position=="number"&&(v=`${v} at one or more positions greater than or equal to ${l.validation.position}`)):"startsWith"in l.validation?v=`Invalid input: must start with "${l.validation.startsWith}"`:"endsWith"in l.validation?v=`Invalid input: must end with "${l.validation.endsWith}"`:n.util.assertNever(l.validation):l.validation!=="regex"?v=`Invalid ${l.validation}`:v="Invalid";break;case r.ZodIssueCode.too_small:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at least":"more than"} ${l.minimum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at least":"over"} ${l.minimum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${l.minimum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(l.minimum))}`:v="Invalid input";break;case r.ZodIssueCode.too_big:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at most":"less than"} ${l.maximum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at most":"under"} ${l.maximum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="bigint"?v=`BigInt must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly":l.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(l.maximum))}`:v="Invalid input";break;case r.ZodIssueCode.custom:v="Invalid input";break;case r.ZodIssueCode.invalid_intersection_types:v="Intersection results could not be merged";break;case r.ZodIssueCode.not_multiple_of:v=`Number must be a multiple of ${l.multipleOf}`;break;case r.ZodIssueCode.not_finite:v="Number must be finite";break;default:v=_.defaultError,n.util.assertNever(l)}return{message:v}};t.default=o},75226:function(x,t,e){"use strict";var n=this&&this.__classPrivateFieldGet||function(qt,nt,Ft,Jt){if(Ft==="a"&&!Jt)throw new TypeError("Private accessor was defined without a getter");if(typeof nt=="function"?qt!==nt||!Jt:!nt.has(qt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ft==="m"?Jt:Ft==="a"?Jt.call(qt):Jt?Jt.value:nt.get(qt)},r=this&&this.__classPrivateFieldSet||function(qt,nt,Ft,Jt,Dn){if(Jt==="m")throw new TypeError("Private method is not writable");if(Jt==="a"&&!Dn)throw new TypeError("Private accessor was defined without a setter");if(typeof nt=="function"?qt!==nt||!Dn:!nt.has(qt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Jt==="a"?Dn.call(qt,Ft):Dn?Dn.value=Ft:nt.set(qt,Ft),Ft},o,l;Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const _=e(30548),v=e(15759),m=e(66258),p=e(94705),s=e(97442);class g{constructor(nt,Ft,Jt,Dn){this._cachedPath=[],this.parent=nt,this.data=Ft,this._path=Jt,this._key=Dn}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(qt,nt)=>{if((0,m.isValid)(nt))return{success:!0,data:nt.value};if(!qt.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const Ft=new s.ZodError(qt.common.issues);return this._error=Ft,this._error}}};function h(qt){if(!qt)return{};const{errorMap:nt,invalid_type_error:Ft,required_error:Jt,description:Dn}=qt;if(nt&&(Ft||Jt))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return nt?{errorMap:nt,description:Dn}:{errorMap:(Bi,Mi)=>{var Xi,vi;const{message:Qi}=qt;return Bi.code==="invalid_enum_value"?{message:Qi??Mi.defaultError}:typeof Mi.data>"u"?{message:(Xi=Qi??Jt)!==null&&Xi!==void 0?Xi:Mi.defaultError}:Bi.code!=="invalid_type"?{message:Mi.defaultError}:{message:(vi=Qi??Ft)!==null&&vi!==void 0?vi:Mi.defaultError}},description:Dn}}class u{get description(){return this._def.description}_getType(nt){return(0,p.getParsedType)(nt.data)}_getOrReturnCtx(nt,Ft){return Ft||{common:nt.parent.common,data:nt.data,parsedType:(0,p.getParsedType)(nt.data),schemaErrorMap:this._def.errorMap,path:nt.path,parent:nt.parent}}_processInputParams(nt){return{status:new m.ParseStatus,ctx:{common:nt.parent.common,data:nt.data,parsedType:(0,p.getParsedType)(nt.data),schemaErrorMap:this._def.errorMap,path:nt.path,parent:nt.parent}}}_parseSync(nt){const Ft=this._parse(nt);if((0,m.isAsync)(Ft))throw new Error("Synchronous parse encountered promise.");return Ft}_parseAsync(nt){const Ft=this._parse(nt);return Promise.resolve(Ft)}parse(nt,Ft){const Jt=this.safeParse(nt,Ft);if(Jt.success)return Jt.data;throw Jt.error}safeParse(nt,Ft){var Jt;const Dn={common:{issues:[],async:(Jt=Ft?.async)!==null&&Jt!==void 0?Jt:!1,contextualErrorMap:Ft?.errorMap},path:Ft?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)},Fn=this._parseSync({data:nt,path:Dn.path,parent:Dn});return a(Dn,Fn)}"~validate"(nt){var Ft,Jt;const Dn={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)};if(!this["~standard"].async)try{const Fn=this._parseSync({data:nt,path:[],parent:Dn});return(0,m.isValid)(Fn)?{value:Fn.value}:{issues:Dn.common.issues}}catch(Fn){!((Jt=(Ft=Fn?.message)===null||Ft===void 0?void 0:Ft.toLowerCase())===null||Jt===void 0)&&Jt.includes("encountered")&&(this["~standard"].async=!0),Dn.common={issues:[],async:!0}}return this._parseAsync({data:nt,path:[],parent:Dn}).then(Fn=>(0,m.isValid)(Fn)?{value:Fn.value}:{issues:Dn.common.issues})}async parseAsync(nt,Ft){const Jt=await this.safeParseAsync(nt,Ft);if(Jt.success)return Jt.data;throw Jt.error}async safeParseAsync(nt,Ft){const Jt={common:{issues:[],contextualErrorMap:Ft?.errorMap,async:!0},path:Ft?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:nt,parsedType:(0,p.getParsedType)(nt)},Dn=this._parse({data:nt,path:Jt.path,parent:Jt}),Fn=await((0,m.isAsync)(Dn)?Dn:Promise.resolve(Dn));return a(Jt,Fn)}refine(nt,Ft){const Jt=Dn=>typeof Ft=="string"||typeof Ft>"u"?{message:Ft}:typeof Ft=="function"?Ft(Dn):Ft;return this._refinement((Dn,Fn)=>{const Bi=nt(Dn),Mi=()=>Fn.addIssue({code:s.ZodIssueCode.custom,...Jt(Dn)});return typeof Promise<"u"&&Bi instanceof Promise?Bi.then(Xi=>Xi?!0:(Mi(),!1)):Bi?!0:(Mi(),!1)})}refinement(nt,Ft){return this._refinement((Jt,Dn)=>nt(Jt)?!0:(Dn.addIssue(typeof Ft=="function"?Ft(Jt,Dn):Ft),!1))}_refinement(nt){return new Ye({schema:this,typeName:At.ZodEffects,effect:{type:"refinement",refinement:nt}})}superRefine(nt){return this._refinement(nt)}constructor(nt){this.spa=this.safeParseAsync,this._def=nt,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:Ft=>this["~validate"](Ft)}}optional(){return Ke.create(this,this._def)}nullable(){return mt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return Ue.create(this,this._def)}or(nt){return fe.create([this,nt],this._def)}and(nt){return Pe.create(this,nt,this._def)}transform(nt){return new Ye({...h(this._def),schema:this,typeName:At.ZodEffects,effect:{type:"transform",transform:nt}})}default(nt){const Ft=typeof nt=="function"?nt:()=>nt;return new _t({...h(this._def),innerType:this,defaultValue:Ft,typeName:At.ZodDefault})}brand(){return new wt({typeName:At.ZodBranded,type:this,...h(this._def)})}catch(nt){const Ft=typeof nt=="function"?nt:()=>nt;return new Mt({...h(this._def),innerType:this,catchValue:Ft,typeName:At.ZodCatch})}describe(nt){const Ft=this.constructor;return new Ft({...this._def,description:nt})}pipe(nt){return st.create(this,nt)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const c=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,f=/^[0-9A-HJKMNP-TV-Z]{26}$/i,d=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,b=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,A=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,S=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,D="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let I;const w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,P=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,k="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F=new RegExp(`^${k}$`);function L(qt){let nt="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return qt.precision?nt=`${nt}\\.\\d{${qt.precision}}`:qt.precision==null&&(nt=`${nt}(\\.\\d+)?`),nt}function B(qt){return new RegExp(`^${L(qt)}$`)}function U(qt){let nt=`${k}T${L(qt)}`;const Ft=[];return Ft.push(qt.local?"Z?":"Z"),qt.offset&&Ft.push("([+-]\\d{2}:?\\d{2})"),nt=`${nt}(${Ft.join("|")})`,new RegExp(`^${nt}$`)}t.datetimeRegex=U;function W(qt,nt){return!!((nt==="v4"||!nt)&&w.test(qt)||(nt==="v6"||!nt)&&R.test(qt))}function j(qt,nt){if(!b.test(qt))return!1;try{const[Ft]=qt.split("."),Jt=Ft.replace(/-/g,"+").replace(/_/g,"/").padEnd(Ft.length+(4-Ft.length%4)%4,"="),Dn=JSON.parse(atob(Jt));return!(typeof Dn!="object"||Dn===null||!Dn.typ||!Dn.alg||nt&&Dn.alg!==nt)}catch{return!1}}function Q(qt,nt){return!!((nt==="v4"||!nt)&&T.test(qt)||(nt==="v6"||!nt)&&P.test(qt))}class G extends u{_parse(nt){if(this._def.coerce&&(nt.data=String(nt.data)),this._getType(nt)!==p.ZodParsedType.string){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.string,received:Fn.parsedType}),m.INVALID}const Jt=new m.ParseStatus;let Dn;for(const Fn of this._def.checks)if(Fn.kind==="min")nt.data.length<Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"string",inclusive:!0,exact:!1,message:Fn.message}),Jt.dirty());else if(Fn.kind==="max")nt.data.length>Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"string",inclusive:!0,exact:!1,message:Fn.message}),Jt.dirty());else if(Fn.kind==="length"){const Bi=nt.data.length>Fn.value,Mi=nt.data.length<Fn.value;(Bi||Mi)&&(Dn=this._getOrReturnCtx(nt,Dn),Bi?(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"string",inclusive:!0,exact:!0,message:Fn.message}):Mi&&(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"string",inclusive:!0,exact:!0,message:Fn.message}),Jt.dirty())}else if(Fn.kind==="email")S.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"email",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="emoji")I||(I=new RegExp(D,"u")),I.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="uuid")d.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="nanoid")y.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"nanoid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="cuid")c.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="cuid2")E.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="ulid")f.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty());else if(Fn.kind==="url")try{new URL(nt.data)}catch{Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"url",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()}else Fn.kind==="regex"?(Fn.regex.lastIndex=0,Fn.regex.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty())):Fn.kind==="trim"?nt.data=nt.data.trim():Fn.kind==="includes"?nt.data.includes(Fn.value,Fn.position)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{includes:Fn.value,position:Fn.position},message:Fn.message}),Jt.dirty()):Fn.kind==="toLowerCase"?nt.data=nt.data.toLowerCase():Fn.kind==="toUpperCase"?nt.data=nt.data.toUpperCase():Fn.kind==="startsWith"?nt.data.startsWith(Fn.value)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:Fn.value},message:Fn.message}),Jt.dirty()):Fn.kind==="endsWith"?nt.data.endsWith(Fn.value)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:Fn.value},message:Fn.message}),Jt.dirty()):Fn.kind==="datetime"?U(Fn).test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:Fn.message}),Jt.dirty()):Fn.kind==="date"?F.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"date",message:Fn.message}),Jt.dirty()):Fn.kind==="time"?B(Fn).test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.invalid_string,validation:"time",message:Fn.message}),Jt.dirty()):Fn.kind==="duration"?A.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"duration",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="ip"?W(nt.data,Fn.version)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="jwt"?j(nt.data,Fn.alg)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"jwt",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="cidr"?Q(nt.data,Fn.version)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"cidr",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="base64"?O.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"base64",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):Fn.kind==="base64url"?M.test(nt.data)||(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{validation:"base64url",code:s.ZodIssueCode.invalid_string,message:Fn.message}),Jt.dirty()):p.util.assertNever(Fn);return{status:Jt.value,value:nt.data}}_regex(nt,Ft,Jt){return this.refinement(Dn=>nt.test(Dn),{validation:Ft,code:s.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(Jt)})}_addCheck(nt){return new G({...this._def,checks:[...this._def.checks,nt]})}email(nt){return this._addCheck({kind:"email",...v.errorUtil.errToObj(nt)})}url(nt){return this._addCheck({kind:"url",...v.errorUtil.errToObj(nt)})}emoji(nt){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(nt)})}uuid(nt){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(nt)})}nanoid(nt){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(nt)})}cuid(nt){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(nt)})}cuid2(nt){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(nt)})}ulid(nt){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(nt)})}base64(nt){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(nt)})}base64url(nt){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(nt)})}jwt(nt){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(nt)})}ip(nt){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(nt)})}cidr(nt){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(nt)})}datetime(nt){var Ft,Jt;return typeof nt=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:nt}):this._addCheck({kind:"datetime",precision:typeof nt?.precision>"u"?null:nt?.precision,offset:(Ft=nt?.offset)!==null&&Ft!==void 0?Ft:!1,local:(Jt=nt?.local)!==null&&Jt!==void 0?Jt:!1,...v.errorUtil.errToObj(nt?.message)})}date(nt){return this._addCheck({kind:"date",message:nt})}time(nt){return typeof nt=="string"?this._addCheck({kind:"time",precision:null,message:nt}):this._addCheck({kind:"time",precision:typeof nt?.precision>"u"?null:nt?.precision,...v.errorUtil.errToObj(nt?.message)})}duration(nt){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(nt)})}regex(nt,Ft){return this._addCheck({kind:"regex",regex:nt,...v.errorUtil.errToObj(Ft)})}includes(nt,Ft){return this._addCheck({kind:"includes",value:nt,position:Ft?.position,...v.errorUtil.errToObj(Ft?.message)})}startsWith(nt,Ft){return this._addCheck({kind:"startsWith",value:nt,...v.errorUtil.errToObj(Ft)})}endsWith(nt,Ft){return this._addCheck({kind:"endsWith",value:nt,...v.errorUtil.errToObj(Ft)})}min(nt,Ft){return this._addCheck({kind:"min",value:nt,...v.errorUtil.errToObj(Ft)})}max(nt,Ft){return this._addCheck({kind:"max",value:nt,...v.errorUtil.errToObj(Ft)})}length(nt,Ft){return this._addCheck({kind:"length",value:nt,...v.errorUtil.errToObj(Ft)})}nonempty(nt){return this.min(1,v.errorUtil.errToObj(nt))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(nt=>nt.kind==="datetime")}get isDate(){return!!this._def.checks.find(nt=>nt.kind==="date")}get isTime(){return!!this._def.checks.find(nt=>nt.kind==="time")}get isDuration(){return!!this._def.checks.find(nt=>nt.kind==="duration")}get isEmail(){return!!this._def.checks.find(nt=>nt.kind==="email")}get isURL(){return!!this._def.checks.find(nt=>nt.kind==="url")}get isEmoji(){return!!this._def.checks.find(nt=>nt.kind==="emoji")}get isUUID(){return!!this._def.checks.find(nt=>nt.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(nt=>nt.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(nt=>nt.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(nt=>nt.kind==="cuid2")}get isULID(){return!!this._def.checks.find(nt=>nt.kind==="ulid")}get isIP(){return!!this._def.checks.find(nt=>nt.kind==="ip")}get isCIDR(){return!!this._def.checks.find(nt=>nt.kind==="cidr")}get isBase64(){return!!this._def.checks.find(nt=>nt.kind==="base64")}get isBase64url(){return!!this._def.checks.find(nt=>nt.kind==="base64url")}get minLength(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxLength(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}}t.ZodString=G,G.create=qt=>{var nt;return new G({checks:[],typeName:At.ZodString,coerce:(nt=qt?.coerce)!==null&&nt!==void 0?nt:!1,...h(qt)})};function Z(qt,nt){const Ft=(qt.toString().split(".")[1]||"").length,Jt=(nt.toString().split(".")[1]||"").length,Dn=Ft>Jt?Ft:Jt,Fn=parseInt(qt.toFixed(Dn).replace(".","")),Bi=parseInt(nt.toFixed(Dn).replace(".",""));return Fn%Bi/Math.pow(10,Dn)}class $ extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(nt){if(this._def.coerce&&(nt.data=Number(nt.data)),this._getType(nt)!==p.ZodParsedType.number){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.number,received:Fn.parsedType}),m.INVALID}let Jt;const Dn=new m.ParseStatus;for(const Fn of this._def.checks)Fn.kind==="int"?p.util.isInteger(nt.data)||(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Fn.message}),Dn.dirty()):Fn.kind==="min"?(Fn.inclusive?nt.data<Fn.value:nt.data<=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:Fn.value,type:"number",inclusive:Fn.inclusive,exact:!1,message:Fn.message}),Dn.dirty()):Fn.kind==="max"?(Fn.inclusive?nt.data>Fn.value:nt.data>=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:Fn.value,type:"number",inclusive:Fn.inclusive,exact:!1,message:Fn.message}),Dn.dirty()):Fn.kind==="multipleOf"?Z(nt.data,Fn.value)!==0&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Fn.value,message:Fn.message}),Dn.dirty()):Fn.kind==="finite"?Number.isFinite(nt.data)||(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_finite,message:Fn.message}),Dn.dirty()):p.util.assertNever(Fn);return{status:Dn.value,value:nt.data}}gte(nt,Ft){return this.setLimit("min",nt,!0,v.errorUtil.toString(Ft))}gt(nt,Ft){return this.setLimit("min",nt,!1,v.errorUtil.toString(Ft))}lte(nt,Ft){return this.setLimit("max",nt,!0,v.errorUtil.toString(Ft))}lt(nt,Ft){return this.setLimit("max",nt,!1,v.errorUtil.toString(Ft))}setLimit(nt,Ft,Jt,Dn){return new $({...this._def,checks:[...this._def.checks,{kind:nt,value:Ft,inclusive:Jt,message:v.errorUtil.toString(Dn)}]})}_addCheck(nt){return new $({...this._def,checks:[...this._def.checks,nt]})}int(nt){return this._addCheck({kind:"int",message:v.errorUtil.toString(nt)})}positive(nt){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(nt)})}negative(nt){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(nt)})}nonpositive(nt){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(nt)})}nonnegative(nt){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(nt)})}multipleOf(nt,Ft){return this._addCheck({kind:"multipleOf",value:nt,message:v.errorUtil.toString(Ft)})}finite(nt){return this._addCheck({kind:"finite",message:v.errorUtil.toString(nt)})}safe(nt){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(nt)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(nt)})}get minValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}get isInt(){return!!this._def.checks.find(nt=>nt.kind==="int"||nt.kind==="multipleOf"&&p.util.isInteger(nt.value))}get isFinite(){let nt=null,Ft=null;for(const Jt of this._def.checks){if(Jt.kind==="finite"||Jt.kind==="int"||Jt.kind==="multipleOf")return!0;Jt.kind==="min"?(Ft===null||Jt.value>Ft)&&(Ft=Jt.value):Jt.kind==="max"&&(nt===null||Jt.value<nt)&&(nt=Jt.value)}return Number.isFinite(Ft)&&Number.isFinite(nt)}}t.ZodNumber=$,$.create=qt=>new $({checks:[],typeName:At.ZodNumber,coerce:qt?.coerce||!1,...h(qt)});class V extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(nt){if(this._def.coerce)try{nt.data=BigInt(nt.data)}catch{return this._getInvalidInput(nt)}if(this._getType(nt)!==p.ZodParsedType.bigint)return this._getInvalidInput(nt);let Jt;const Dn=new m.ParseStatus;for(const Fn of this._def.checks)Fn.kind==="min"?(Fn.inclusive?nt.data<Fn.value:nt.data<=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:Fn.value,inclusive:Fn.inclusive,message:Fn.message}),Dn.dirty()):Fn.kind==="max"?(Fn.inclusive?nt.data>Fn.value:nt.data>=Fn.value)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:Fn.value,inclusive:Fn.inclusive,message:Fn.message}),Dn.dirty()):Fn.kind==="multipleOf"?nt.data%Fn.value!==BigInt(0)&&(Jt=this._getOrReturnCtx(nt,Jt),(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Fn.value,message:Fn.message}),Dn.dirty()):p.util.assertNever(Fn);return{status:Dn.value,value:nt.data}}_getInvalidInput(nt){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.bigint,received:Ft.parsedType}),m.INVALID}gte(nt,Ft){return this.setLimit("min",nt,!0,v.errorUtil.toString(Ft))}gt(nt,Ft){return this.setLimit("min",nt,!1,v.errorUtil.toString(Ft))}lte(nt,Ft){return this.setLimit("max",nt,!0,v.errorUtil.toString(Ft))}lt(nt,Ft){return this.setLimit("max",nt,!1,v.errorUtil.toString(Ft))}setLimit(nt,Ft,Jt,Dn){return new V({...this._def,checks:[...this._def.checks,{kind:nt,value:Ft,inclusive:Jt,message:v.errorUtil.toString(Dn)}]})}_addCheck(nt){return new V({...this._def,checks:[...this._def.checks,nt]})}positive(nt){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(nt)})}negative(nt){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(nt)})}nonpositive(nt){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(nt)})}nonnegative(nt){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(nt)})}multipleOf(nt,Ft){return this._addCheck({kind:"multipleOf",value:nt,message:v.errorUtil.toString(Ft)})}get minValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt}get maxValue(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt}}t.ZodBigInt=V,V.create=qt=>{var nt;return new V({checks:[],typeName:At.ZodBigInt,coerce:(nt=qt?.coerce)!==null&&nt!==void 0?nt:!1,...h(qt)})};class H extends u{_parse(nt){if(this._def.coerce&&(nt.data=!!nt.data),this._getType(nt)!==p.ZodParsedType.boolean){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.boolean,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodBoolean=H,H.create=qt=>new H({typeName:At.ZodBoolean,coerce:qt?.coerce||!1,...h(qt)});class K extends u{_parse(nt){if(this._def.coerce&&(nt.data=new Date(nt.data)),this._getType(nt)!==p.ZodParsedType.date){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.date,received:Fn.parsedType}),m.INVALID}if(isNaN(nt.data.getTime())){const Fn=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Fn,{code:s.ZodIssueCode.invalid_date}),m.INVALID}const Jt=new m.ParseStatus;let Dn;for(const Fn of this._def.checks)Fn.kind==="min"?nt.data.getTime()<Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_small,message:Fn.message,inclusive:!0,exact:!1,minimum:Fn.value,type:"date"}),Jt.dirty()):Fn.kind==="max"?nt.data.getTime()>Fn.value&&(Dn=this._getOrReturnCtx(nt,Dn),(0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.too_big,message:Fn.message,inclusive:!0,exact:!1,maximum:Fn.value,type:"date"}),Jt.dirty()):p.util.assertNever(Fn);return{status:Jt.value,value:new Date(nt.data.getTime())}}_addCheck(nt){return new K({...this._def,checks:[...this._def.checks,nt]})}min(nt,Ft){return this._addCheck({kind:"min",value:nt.getTime(),message:v.errorUtil.toString(Ft)})}max(nt,Ft){return this._addCheck({kind:"max",value:nt.getTime(),message:v.errorUtil.toString(Ft)})}get minDate(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="min"&&(nt===null||Ft.value>nt)&&(nt=Ft.value);return nt!=null?new Date(nt):null}get maxDate(){let nt=null;for(const Ft of this._def.checks)Ft.kind==="max"&&(nt===null||Ft.value<nt)&&(nt=Ft.value);return nt!=null?new Date(nt):null}}t.ZodDate=K,K.create=qt=>new K({checks:[],coerce:qt?.coerce||!1,typeName:At.ZodDate,...h(qt)});class Y extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.symbol){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.symbol,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodSymbol=Y,Y.create=qt=>new Y({typeName:At.ZodSymbol,...h(qt)});class X extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.undefined){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.undefined,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodUndefined=X,X.create=qt=>new X({typeName:At.ZodUndefined,...h(qt)});class oe extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.null){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.null,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodNull=oe,oe.create=qt=>new oe({typeName:At.ZodNull,...h(qt)});class ie extends u{constructor(){super(...arguments),this._any=!0}_parse(nt){return(0,m.OK)(nt.data)}}t.ZodAny=ie,ie.create=qt=>new ie({typeName:At.ZodAny,...h(qt)});class he extends u{constructor(){super(...arguments),this._unknown=!0}_parse(nt){return(0,m.OK)(nt.data)}}t.ZodUnknown=he,he.create=qt=>new he({typeName:At.ZodUnknown,...h(qt)});class me extends u{_parse(nt){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.never,received:Ft.parsedType}),m.INVALID}}t.ZodNever=me,me.create=qt=>new me({typeName:At.ZodNever,...h(qt)});class q extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.undefined){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.void,received:Jt.parsedType}),m.INVALID}return(0,m.OK)(nt.data)}}t.ZodVoid=q,q.create=qt=>new q({typeName:At.ZodVoid,...h(qt)});class Ee extends u{_parse(nt){const{ctx:Ft,status:Jt}=this._processInputParams(nt),Dn=this._def;if(Ft.parsedType!==p.ZodParsedType.array)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.array,received:Ft.parsedType}),m.INVALID;if(Dn.exactLength!==null){const Bi=Ft.data.length>Dn.exactLength.value,Mi=Ft.data.length<Dn.exactLength.value;(Bi||Mi)&&((0,m.addIssueToContext)(Ft,{code:Bi?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:Mi?Dn.exactLength.value:void 0,maximum:Bi?Dn.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Dn.exactLength.message}),Jt.dirty())}if(Dn.minLength!==null&&Ft.data.length<Dn.minLength.value&&((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.too_small,minimum:Dn.minLength.value,type:"array",inclusive:!0,exact:!1,message:Dn.minLength.message}),Jt.dirty()),Dn.maxLength!==null&&Ft.data.length>Dn.maxLength.value&&((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.too_big,maximum:Dn.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Dn.maxLength.message}),Jt.dirty()),Ft.common.async)return Promise.all([...Ft.data].map((Bi,Mi)=>Dn.type._parseAsync(new g(Ft,Bi,Ft.path,Mi)))).then(Bi=>m.ParseStatus.mergeArray(Jt,Bi));const Fn=[...Ft.data].map((Bi,Mi)=>Dn.type._parseSync(new g(Ft,Bi,Ft.path,Mi)));return m.ParseStatus.mergeArray(Jt,Fn)}get element(){return this._def.type}min(nt,Ft){return new Ee({...this._def,minLength:{value:nt,message:v.errorUtil.toString(Ft)}})}max(nt,Ft){return new Ee({...this._def,maxLength:{value:nt,message:v.errorUtil.toString(Ft)}})}length(nt,Ft){return new Ee({...this._def,exactLength:{value:nt,message:v.errorUtil.toString(Ft)}})}nonempty(nt){return this.min(1,nt)}}t.ZodArray=Ee,Ee.create=(qt,nt)=>new Ee({type:qt,minLength:null,maxLength:null,exactLength:null,typeName:At.ZodArray,...h(nt)});function ue(qt){if(qt instanceof te){const nt={};for(const Ft in qt.shape){const Jt=qt.shape[Ft];nt[Ft]=Ke.create(ue(Jt))}return new te({...qt._def,shape:()=>nt})}else return qt instanceof Ee?new Ee({...qt._def,type:ue(qt.element)}):qt instanceof Ke?Ke.create(ue(qt.unwrap())):qt instanceof mt?mt.create(ue(qt.unwrap())):qt instanceof we?we.create(qt.items.map(nt=>ue(nt))):qt}class te extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const nt=this._def.shape(),Ft=p.util.objectKeys(nt);return this._cached={shape:nt,keys:Ft}}_parse(nt){if(this._getType(nt)!==p.ZodParsedType.object){const vi=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(vi,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:vi.parsedType}),m.INVALID}const{status:Jt,ctx:Dn}=this._processInputParams(nt),{shape:Fn,keys:Bi}=this._getCached(),Mi=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(const vi in Dn.data)Bi.includes(vi)||Mi.push(vi);const Xi=[];for(const vi of Bi){const Qi=Fn[vi],qi=Dn.data[vi];Xi.push({key:{status:"valid",value:vi},value:Qi._parse(new g(Dn,qi,Dn.path,vi)),alwaysSet:vi in Dn.data})}if(this._def.catchall instanceof me){const vi=this._def.unknownKeys;if(vi==="passthrough")for(const Qi of Mi)Xi.push({key:{status:"valid",value:Qi},value:{status:"valid",value:Dn.data[Qi]}});else if(vi==="strict")Mi.length>0&&((0,m.addIssueToContext)(Dn,{code:s.ZodIssueCode.unrecognized_keys,keys:Mi}),Jt.dirty());else if(vi!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const vi=this._def.catchall;for(const Qi of Mi){const qi=Dn.data[Qi];Xi.push({key:{status:"valid",value:Qi},value:vi._parse(new g(Dn,qi,Dn.path,Qi)),alwaysSet:Qi in Dn.data})}}return Dn.common.async?Promise.resolve().then(async()=>{const vi=[];for(const Qi of Xi){const qi=await Qi.key,lo=await Qi.value;vi.push({key:qi,value:lo,alwaysSet:Qi.alwaysSet})}return vi}).then(vi=>m.ParseStatus.mergeObjectSync(Jt,vi)):m.ParseStatus.mergeObjectSync(Jt,Xi)}get shape(){return this._def.shape()}strict(nt){return v.errorUtil.errToObj,new te({...this._def,unknownKeys:"strict",...nt!==void 0?{errorMap:(Ft,Jt)=>{var Dn,Fn,Bi,Mi;const Xi=(Bi=(Fn=(Dn=this._def).errorMap)===null||Fn===void 0?void 0:Fn.call(Dn,Ft,Jt).message)!==null&&Bi!==void 0?Bi:Jt.defaultError;return Ft.code==="unrecognized_keys"?{message:(Mi=v.errorUtil.errToObj(nt).message)!==null&&Mi!==void 0?Mi:Xi}:{message:Xi}}}:{}})}strip(){return new te({...this._def,unknownKeys:"strip"})}passthrough(){return new te({...this._def,unknownKeys:"passthrough"})}extend(nt){return new te({...this._def,shape:()=>({...this._def.shape(),...nt})})}merge(nt){return new te({unknownKeys:nt._def.unknownKeys,catchall:nt._def.catchall,shape:()=>({...this._def.shape(),...nt._def.shape()}),typeName:At.ZodObject})}setKey(nt,Ft){return this.augment({[nt]:Ft})}catchall(nt){return new te({...this._def,catchall:nt})}pick(nt){const Ft={};return p.util.objectKeys(nt).forEach(Jt=>{nt[Jt]&&this.shape[Jt]&&(Ft[Jt]=this.shape[Jt])}),new te({...this._def,shape:()=>Ft})}omit(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{nt[Jt]||(Ft[Jt]=this.shape[Jt])}),new te({...this._def,shape:()=>Ft})}deepPartial(){return ue(this)}partial(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{const Dn=this.shape[Jt];nt&&!nt[Jt]?Ft[Jt]=Dn:Ft[Jt]=Dn.optional()}),new te({...this._def,shape:()=>Ft})}required(nt){const Ft={};return p.util.objectKeys(this.shape).forEach(Jt=>{if(nt&&!nt[Jt])Ft[Jt]=this.shape[Jt];else{let Fn=this.shape[Jt];for(;Fn instanceof Ke;)Fn=Fn._def.innerType;Ft[Jt]=Fn}}),new te({...this._def,shape:()=>Ft})}keyof(){return ge(p.util.objectKeys(this.shape))}}t.ZodObject=te,te.create=(qt,nt)=>new te({shape:()=>qt,unknownKeys:"strip",catchall:me.create(),typeName:At.ZodObject,...h(nt)}),te.strictCreate=(qt,nt)=>new te({shape:()=>qt,unknownKeys:"strict",catchall:me.create(),typeName:At.ZodObject,...h(nt)}),te.lazycreate=(qt,nt)=>new te({shape:qt,unknownKeys:"strip",catchall:me.create(),typeName:At.ZodObject,...h(nt)});class fe extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt=this._def.options;function Dn(Fn){for(const Mi of Fn)if(Mi.result.status==="valid")return Mi.result;for(const Mi of Fn)if(Mi.result.status==="dirty")return Ft.common.issues.push(...Mi.ctx.common.issues),Mi.result;const Bi=Fn.map(Mi=>new s.ZodError(Mi.ctx.common.issues));return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union,unionErrors:Bi}),m.INVALID}if(Ft.common.async)return Promise.all(Jt.map(async Fn=>{const Bi={...Ft,common:{...Ft.common,issues:[]},parent:null};return{result:await Fn._parseAsync({data:Ft.data,path:Ft.path,parent:Bi}),ctx:Bi}})).then(Dn);{let Fn;const Bi=[];for(const Xi of Jt){const vi={...Ft,common:{...Ft.common,issues:[]},parent:null},Qi=Xi._parseSync({data:Ft.data,path:Ft.path,parent:vi});if(Qi.status==="valid")return Qi;Qi.status==="dirty"&&!Fn&&(Fn={result:Qi,ctx:vi}),vi.common.issues.length&&Bi.push(vi.common.issues)}if(Fn)return Ft.common.issues.push(...Fn.ctx.common.issues),Fn.result;const Mi=Bi.map(Xi=>new s.ZodError(Xi));return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union,unionErrors:Mi}),m.INVALID}}get options(){return this._def.options}}t.ZodUnion=fe,fe.create=(qt,nt)=>new fe({options:qt,typeName:At.ZodUnion,...h(nt)});const Ie=qt=>qt instanceof pe?Ie(qt.schema):qt instanceof Ye?Ie(qt.innerType()):qt instanceof re?[qt.value]:qt instanceof De?qt.options:qt instanceof Ae?p.util.objectValues(qt.enum):qt instanceof _t?Ie(qt._def.innerType):qt instanceof X?[void 0]:qt instanceof oe?[null]:qt instanceof Ke?[void 0,...Ie(qt.unwrap())]:qt instanceof mt?[null,...Ie(qt.unwrap())]:qt instanceof wt||qt instanceof rt?Ie(qt.unwrap()):qt instanceof Mt?Ie(qt._def.innerType):[];class Me extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.object)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:Ft.parsedType}),m.INVALID;const Jt=this.discriminator,Dn=Ft.data[Jt],Fn=this.optionsMap.get(Dn);return Fn?Ft.common.async?Fn._parseAsync({data:Ft.data,path:Ft.path,parent:Ft}):Fn._parseSync({data:Ft.data,path:Ft.path,parent:Ft}):((0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Jt]}),m.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(nt,Ft,Jt){const Dn=new Map;for(const Fn of Ft){const Bi=Ie(Fn.shape[nt]);if(!Bi.length)throw new Error(`A discriminator value for key \`${nt}\` could not be extracted from all schema options`);for(const Mi of Bi){if(Dn.has(Mi))throw new Error(`Discriminator property ${String(nt)} has duplicate value ${String(Mi)}`);Dn.set(Mi,Fn)}}return new Me({typeName:At.ZodDiscriminatedUnion,discriminator:nt,options:Ft,optionsMap:Dn,...h(Jt)})}}t.ZodDiscriminatedUnion=Me;function Be(qt,nt){const Ft=(0,p.getParsedType)(qt),Jt=(0,p.getParsedType)(nt);if(qt===nt)return{valid:!0,data:qt};if(Ft===p.ZodParsedType.object&&Jt===p.ZodParsedType.object){const Dn=p.util.objectKeys(nt),Fn=p.util.objectKeys(qt).filter(Mi=>Dn.indexOf(Mi)!==-1),Bi={...qt,...nt};for(const Mi of Fn){const Xi=Be(qt[Mi],nt[Mi]);if(!Xi.valid)return{valid:!1};Bi[Mi]=Xi.data}return{valid:!0,data:Bi}}else if(Ft===p.ZodParsedType.array&&Jt===p.ZodParsedType.array){if(qt.length!==nt.length)return{valid:!1};const Dn=[];for(let Fn=0;Fn<qt.length;Fn++){const Bi=qt[Fn],Mi=nt[Fn],Xi=Be(Bi,Mi);if(!Xi.valid)return{valid:!1};Dn.push(Xi.data)}return{valid:!0,data:Dn}}else return Ft===p.ZodParsedType.date&&Jt===p.ZodParsedType.date&&+qt==+nt?{valid:!0,data:qt}:{valid:!1}}class Pe extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt),Dn=(Fn,Bi)=>{if((0,m.isAborted)(Fn)||(0,m.isAborted)(Bi))return m.INVALID;const Mi=Be(Fn.value,Bi.value);return Mi.valid?(((0,m.isDirty)(Fn)||(0,m.isDirty)(Bi))&&Ft.dirty(),{status:Ft.value,value:Mi.data}):((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_intersection_types}),m.INVALID)};return Jt.common.async?Promise.all([this._def.left._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}),this._def.right._parseAsync({data:Jt.data,path:Jt.path,parent:Jt})]).then(([Fn,Bi])=>Dn(Fn,Bi)):Dn(this._def.left._parseSync({data:Jt.data,path:Jt.path,parent:Jt}),this._def.right._parseSync({data:Jt.data,path:Jt.path,parent:Jt}))}}t.ZodIntersection=Pe,Pe.create=(qt,nt,Ft)=>new Pe({left:qt,right:nt,typeName:At.ZodIntersection,...h(Ft)});class we extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.array)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.array,received:Jt.parsedType}),m.INVALID;if(Jt.data.length<this._def.items.length)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m.INVALID;!this._def.rest&&Jt.data.length>this._def.items.length&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ft.dirty());const Fn=[...Jt.data].map((Bi,Mi)=>{const Xi=this._def.items[Mi]||this._def.rest;return Xi?Xi._parse(new g(Jt,Bi,Jt.path,Mi)):null}).filter(Bi=>!!Bi);return Jt.common.async?Promise.all(Fn).then(Bi=>m.ParseStatus.mergeArray(Ft,Bi)):m.ParseStatus.mergeArray(Ft,Fn)}get items(){return this._def.items}rest(nt){return new we({...this._def,rest:nt})}}t.ZodTuple=we,we.create=(qt,nt)=>{if(!Array.isArray(qt))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:qt,typeName:At.ZodTuple,rest:null,...h(nt)})};class _e extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.object)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.object,received:Jt.parsedType}),m.INVALID;const Dn=[],Fn=this._def.keyType,Bi=this._def.valueType;for(const Mi in Jt.data)Dn.push({key:Fn._parse(new g(Jt,Mi,Jt.path,Mi)),value:Bi._parse(new g(Jt,Jt.data[Mi],Jt.path,Mi)),alwaysSet:Mi in Jt.data});return Jt.common.async?m.ParseStatus.mergeObjectAsync(Ft,Dn):m.ParseStatus.mergeObjectSync(Ft,Dn)}get element(){return this._def.valueType}static create(nt,Ft,Jt){return Ft instanceof u?new _e({keyType:nt,valueType:Ft,typeName:At.ZodRecord,...h(Jt)}):new _e({keyType:G.create(),valueType:nt,typeName:At.ZodRecord,...h(Ft)})}}t.ZodRecord=_e;class Ne extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.map)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.map,received:Jt.parsedType}),m.INVALID;const Dn=this._def.keyType,Fn=this._def.valueType,Bi=[...Jt.data.entries()].map(([Mi,Xi],vi)=>({key:Dn._parse(new g(Jt,Mi,Jt.path,[vi,"key"])),value:Fn._parse(new g(Jt,Xi,Jt.path,[vi,"value"]))}));if(Jt.common.async){const Mi=new Map;return Promise.resolve().then(async()=>{for(const Xi of Bi){const vi=await Xi.key,Qi=await Xi.value;if(vi.status==="aborted"||Qi.status==="aborted")return m.INVALID;(vi.status==="dirty"||Qi.status==="dirty")&&Ft.dirty(),Mi.set(vi.value,Qi.value)}return{status:Ft.value,value:Mi}})}else{const Mi=new Map;for(const Xi of Bi){const vi=Xi.key,Qi=Xi.value;if(vi.status==="aborted"||Qi.status==="aborted")return m.INVALID;(vi.status==="dirty"||Qi.status==="dirty")&&Ft.dirty(),Mi.set(vi.value,Qi.value)}return{status:Ft.value,value:Mi}}}}t.ZodMap=Ne,Ne.create=(qt,nt,Ft)=>new Ne({valueType:nt,keyType:qt,typeName:At.ZodMap,...h(Ft)});class Te extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.parsedType!==p.ZodParsedType.set)return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.set,received:Jt.parsedType}),m.INVALID;const Dn=this._def;Dn.minSize!==null&&Jt.data.size<Dn.minSize.value&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_small,minimum:Dn.minSize.value,type:"set",inclusive:!0,exact:!1,message:Dn.minSize.message}),Ft.dirty()),Dn.maxSize!==null&&Jt.data.size>Dn.maxSize.value&&((0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.too_big,maximum:Dn.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Dn.maxSize.message}),Ft.dirty());const Fn=this._def.valueType;function Bi(Xi){const vi=new Set;for(const Qi of Xi){if(Qi.status==="aborted")return m.INVALID;Qi.status==="dirty"&&Ft.dirty(),vi.add(Qi.value)}return{status:Ft.value,value:vi}}const Mi=[...Jt.data.values()].map((Xi,vi)=>Fn._parse(new g(Jt,Xi,Jt.path,vi)));return Jt.common.async?Promise.all(Mi).then(Xi=>Bi(Xi)):Bi(Mi)}min(nt,Ft){return new Te({...this._def,minSize:{value:nt,message:v.errorUtil.toString(Ft)}})}max(nt,Ft){return new Te({...this._def,maxSize:{value:nt,message:v.errorUtil.toString(Ft)}})}size(nt,Ft){return this.min(nt,Ft).max(nt,Ft)}nonempty(nt){return this.min(1,nt)}}t.ZodSet=Te,Te.create=(qt,nt)=>new Te({valueType:qt,minSize:null,maxSize:null,typeName:At.ZodSet,...h(nt)});class We extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.function)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.function,received:Ft.parsedType}),m.INVALID;function Jt(Mi,Xi){return(0,m.makeIssue)({data:Mi,path:Ft.path,errorMaps:[Ft.common.contextualErrorMap,Ft.schemaErrorMap,(0,_.getErrorMap)(),_.defaultErrorMap].filter(vi=>!!vi),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:Xi}})}function Dn(Mi,Xi){return(0,m.makeIssue)({data:Mi,path:Ft.path,errorMaps:[Ft.common.contextualErrorMap,Ft.schemaErrorMap,(0,_.getErrorMap)(),_.defaultErrorMap].filter(vi=>!!vi),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:Xi}})}const Fn={errorMap:Ft.common.contextualErrorMap},Bi=Ft.data;if(this._def.returns instanceof Ue){const Mi=this;return(0,m.OK)(async function(...Xi){const vi=new s.ZodError([]),Qi=await Mi._def.args.parseAsync(Xi,Fn).catch(yo=>{throw vi.addIssue(Jt(Xi,yo)),vi}),qi=await Reflect.apply(Bi,this,Qi);return await Mi._def.returns._def.type.parseAsync(qi,Fn).catch(yo=>{throw vi.addIssue(Dn(qi,yo)),vi})})}else{const Mi=this;return(0,m.OK)(function(...Xi){const vi=Mi._def.args.safeParse(Xi,Fn);if(!vi.success)throw new s.ZodError([Jt(Xi,vi.error)]);const Qi=Reflect.apply(Bi,this,vi.data),qi=Mi._def.returns.safeParse(Qi,Fn);if(!qi.success)throw new s.ZodError([Dn(Qi,qi.error)]);return qi.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...nt){return new We({...this._def,args:we.create(nt).rest(he.create())})}returns(nt){return new We({...this._def,returns:nt})}implement(nt){return this.parse(nt)}strictImplement(nt){return this.parse(nt)}static create(nt,Ft,Jt){return new We({args:nt||we.create([]).rest(he.create()),returns:Ft||he.create(),typeName:At.ZodFunction,...h(Jt)})}}t.ZodFunction=We;class pe extends u{get schema(){return this._def.getter()}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);return this._def.getter()._parse({data:Ft.data,path:Ft.path,parent:Ft})}}t.ZodLazy=pe,pe.create=(qt,nt)=>new pe({getter:qt,typeName:At.ZodLazy,...h(nt)});class re extends u{_parse(nt){if(nt.data!==this._def.value){const Ft=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Ft,{received:Ft.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),m.INVALID}return{status:"valid",value:nt.data}}get value(){return this._def.value}}t.ZodLiteral=re,re.create=(qt,nt)=>new re({value:qt,typeName:At.ZodLiteral,...h(nt)});function ge(qt,nt){return new De({values:qt,typeName:At.ZodEnum,...h(nt)})}class De extends u{constructor(){super(...arguments),o.set(this,void 0)}_parse(nt){if(typeof nt.data!="string"){const Ft=this._getOrReturnCtx(nt),Jt=this._def.values;return(0,m.addIssueToContext)(Ft,{expected:p.util.joinValues(Jt),received:Ft.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,o,"f")||r(this,o,new Set(this._def.values),"f"),!n(this,o,"f").has(nt.data)){const Ft=this._getOrReturnCtx(nt),Jt=this._def.values;return(0,m.addIssueToContext)(Ft,{received:Ft.data,code:s.ZodIssueCode.invalid_enum_value,options:Jt}),m.INVALID}return(0,m.OK)(nt.data)}get options(){return this._def.values}get enum(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}get Values(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}get Enum(){const nt={};for(const Ft of this._def.values)nt[Ft]=Ft;return nt}extract(nt,Ft=this._def){return De.create(nt,{...this._def,...Ft})}exclude(nt,Ft=this._def){return De.create(this.options.filter(Jt=>!nt.includes(Jt)),{...this._def,...Ft})}}t.ZodEnum=De,o=new WeakMap,De.create=ge;class Ae extends u{constructor(){super(...arguments),l.set(this,void 0)}_parse(nt){const Ft=p.util.getValidEnumValues(this._def.values),Jt=this._getOrReturnCtx(nt);if(Jt.parsedType!==p.ZodParsedType.string&&Jt.parsedType!==p.ZodParsedType.number){const Dn=p.util.objectValues(Ft);return(0,m.addIssueToContext)(Jt,{expected:p.util.joinValues(Dn),received:Jt.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,l,"f")||r(this,l,new Set(p.util.getValidEnumValues(this._def.values)),"f"),!n(this,l,"f").has(nt.data)){const Dn=p.util.objectValues(Ft);return(0,m.addIssueToContext)(Jt,{received:Jt.data,code:s.ZodIssueCode.invalid_enum_value,options:Dn}),m.INVALID}return(0,m.OK)(nt.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Ae,l=new WeakMap,Ae.create=(qt,nt)=>new Ae({values:qt,typeName:At.ZodNativeEnum,...h(nt)});class Ue extends u{unwrap(){return this._def.type}_parse(nt){const{ctx:Ft}=this._processInputParams(nt);if(Ft.parsedType!==p.ZodParsedType.promise&&Ft.common.async===!1)return(0,m.addIssueToContext)(Ft,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.promise,received:Ft.parsedType}),m.INVALID;const Jt=Ft.parsedType===p.ZodParsedType.promise?Ft.data:Promise.resolve(Ft.data);return(0,m.OK)(Jt.then(Dn=>this._def.type.parseAsync(Dn,{path:Ft.path,errorMap:Ft.common.contextualErrorMap})))}}t.ZodPromise=Ue,Ue.create=(qt,nt)=>new Ue({type:qt,typeName:At.ZodPromise,...h(nt)});class Ye extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===At.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt),Dn=this._def.effect||null,Fn={addIssue:Bi=>{(0,m.addIssueToContext)(Jt,Bi),Bi.fatal?Ft.abort():Ft.dirty()},get path(){return Jt.path}};if(Fn.addIssue=Fn.addIssue.bind(Fn),Dn.type==="preprocess"){const Bi=Dn.transform(Jt.data,Fn);if(Jt.common.async)return Promise.resolve(Bi).then(async Mi=>{if(Ft.value==="aborted")return m.INVALID;const Xi=await this._def.schema._parseAsync({data:Mi,path:Jt.path,parent:Jt});return Xi.status==="aborted"?m.INVALID:Xi.status==="dirty"||Ft.value==="dirty"?(0,m.DIRTY)(Xi.value):Xi});{if(Ft.value==="aborted")return m.INVALID;const Mi=this._def.schema._parseSync({data:Bi,path:Jt.path,parent:Jt});return Mi.status==="aborted"?m.INVALID:Mi.status==="dirty"||Ft.value==="dirty"?(0,m.DIRTY)(Mi.value):Mi}}if(Dn.type==="refinement"){const Bi=Mi=>{const Xi=Dn.refinement(Mi,Fn);if(Jt.common.async)return Promise.resolve(Xi);if(Xi instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Mi};if(Jt.common.async===!1){const Mi=this._def.schema._parseSync({data:Jt.data,path:Jt.path,parent:Jt});return Mi.status==="aborted"?m.INVALID:(Mi.status==="dirty"&&Ft.dirty(),Bi(Mi.value),{status:Ft.value,value:Mi.value})}else return this._def.schema._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}).then(Mi=>Mi.status==="aborted"?m.INVALID:(Mi.status==="dirty"&&Ft.dirty(),Bi(Mi.value).then(()=>({status:Ft.value,value:Mi.value}))))}if(Dn.type==="transform")if(Jt.common.async===!1){const Bi=this._def.schema._parseSync({data:Jt.data,path:Jt.path,parent:Jt});if(!(0,m.isValid)(Bi))return Bi;const Mi=Dn.transform(Bi.value,Fn);if(Mi instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Ft.value,value:Mi}}else return this._def.schema._parseAsync({data:Jt.data,path:Jt.path,parent:Jt}).then(Bi=>(0,m.isValid)(Bi)?Promise.resolve(Dn.transform(Bi.value,Fn)).then(Mi=>({status:Ft.value,value:Mi})):Bi);p.util.assertNever(Dn)}}t.ZodEffects=Ye,t.ZodTransformer=Ye,Ye.create=(qt,nt,Ft)=>new Ye({schema:qt,typeName:At.ZodEffects,effect:nt,...h(Ft)}),Ye.createWithPreprocess=(qt,nt,Ft)=>new Ye({schema:nt,effect:{type:"preprocess",transform:qt},typeName:At.ZodEffects,...h(Ft)});class Ke extends u{_parse(nt){return this._getType(nt)===p.ZodParsedType.undefined?(0,m.OK)(void 0):this._def.innerType._parse(nt)}unwrap(){return this._def.innerType}}t.ZodOptional=Ke,Ke.create=(qt,nt)=>new Ke({innerType:qt,typeName:At.ZodOptional,...h(nt)});class mt extends u{_parse(nt){return this._getType(nt)===p.ZodParsedType.null?(0,m.OK)(null):this._def.innerType._parse(nt)}unwrap(){return this._def.innerType}}t.ZodNullable=mt,mt.create=(qt,nt)=>new mt({innerType:qt,typeName:At.ZodNullable,...h(nt)});class _t extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt);let Jt=Ft.data;return Ft.parsedType===p.ZodParsedType.undefined&&(Jt=this._def.defaultValue()),this._def.innerType._parse({data:Jt,path:Ft.path,parent:Ft})}removeDefault(){return this._def.innerType}}t.ZodDefault=_t,_t.create=(qt,nt)=>new _t({innerType:qt,typeName:At.ZodDefault,defaultValue:typeof nt.default=="function"?nt.default:()=>nt.default,...h(nt)});class Mt extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt={...Ft,common:{...Ft.common,issues:[]}},Dn=this._def.innerType._parse({data:Jt.data,path:Jt.path,parent:{...Jt}});return(0,m.isAsync)(Dn)?Dn.then(Fn=>({status:"valid",value:Fn.status==="valid"?Fn.value:this._def.catchValue({get error(){return new s.ZodError(Jt.common.issues)},input:Jt.data})})):{status:"valid",value:Dn.status==="valid"?Dn.value:this._def.catchValue({get error(){return new s.ZodError(Jt.common.issues)},input:Jt.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=Mt,Mt.create=(qt,nt)=>new Mt({innerType:qt,typeName:At.ZodCatch,catchValue:typeof nt.catch=="function"?nt.catch:()=>nt.catch,...h(nt)});class ct extends u{_parse(nt){if(this._getType(nt)!==p.ZodParsedType.nan){const Jt=this._getOrReturnCtx(nt);return(0,m.addIssueToContext)(Jt,{code:s.ZodIssueCode.invalid_type,expected:p.ZodParsedType.nan,received:Jt.parsedType}),m.INVALID}return{status:"valid",value:nt.data}}}t.ZodNaN=ct,ct.create=qt=>new ct({typeName:At.ZodNaN,...h(qt)}),t.BRAND=Symbol("zod_brand");class wt extends u{_parse(nt){const{ctx:Ft}=this._processInputParams(nt),Jt=Ft.data;return this._def.type._parse({data:Jt,path:Ft.path,parent:Ft})}unwrap(){return this._def.type}}t.ZodBranded=wt;class st extends u{_parse(nt){const{status:Ft,ctx:Jt}=this._processInputParams(nt);if(Jt.common.async)return(async()=>{const Fn=await this._def.in._parseAsync({data:Jt.data,path:Jt.path,parent:Jt});return Fn.status==="aborted"?m.INVALID:Fn.status==="dirty"?(Ft.dirty(),(0,m.DIRTY)(Fn.value)):this._def.out._parseAsync({data:Fn.value,path:Jt.path,parent:Jt})})();{const Dn=this._def.in._parseSync({data:Jt.data,path:Jt.path,parent:Jt});return Dn.status==="aborted"?m.INVALID:Dn.status==="dirty"?(Ft.dirty(),{status:"dirty",value:Dn.value}):this._def.out._parseSync({data:Dn.value,path:Jt.path,parent:Jt})}}static create(nt,Ft){return new st({in:nt,out:Ft,typeName:At.ZodPipeline})}}t.ZodPipeline=st;class rt extends u{_parse(nt){const Ft=this._def.innerType._parse(nt),Jt=Dn=>((0,m.isValid)(Dn)&&(Dn.value=Object.freeze(Dn.value)),Dn);return(0,m.isAsync)(Ft)?Ft.then(Dn=>Jt(Dn)):Jt(Ft)}unwrap(){return this._def.innerType}}t.ZodReadonly=rt,rt.create=(qt,nt)=>new rt({innerType:qt,typeName:At.ZodReadonly,...h(nt)});function lt(qt,nt={},Ft){return qt?ie.create().superRefine((Jt,Dn)=>{var Fn,Bi;if(!qt(Jt)){const Mi=typeof nt=="function"?nt(Jt):typeof nt=="string"?{message:nt}:nt,Xi=(Bi=(Fn=Mi.fatal)!==null&&Fn!==void 0?Fn:Ft)!==null&&Bi!==void 0?Bi:!0,vi=typeof Mi=="string"?{message:Mi}:Mi;Dn.addIssue({code:"custom",...vi,fatal:Xi})}}):ie.create()}t.custom=lt,t.late={object:te.lazycreate};var At;(function(qt){qt.ZodString="ZodString",qt.ZodNumber="ZodNumber",qt.ZodNaN="ZodNaN",qt.ZodBigInt="ZodBigInt",qt.ZodBoolean="ZodBoolean",qt.ZodDate="ZodDate",qt.ZodSymbol="ZodSymbol",qt.ZodUndefined="ZodUndefined",qt.ZodNull="ZodNull",qt.ZodAny="ZodAny",qt.ZodUnknown="ZodUnknown",qt.ZodNever="ZodNever",qt.ZodVoid="ZodVoid",qt.ZodArray="ZodArray",qt.ZodObject="ZodObject",qt.ZodUnion="ZodUnion",qt.ZodDiscriminatedUnion="ZodDiscriminatedUnion",qt.ZodIntersection="ZodIntersection",qt.ZodTuple="ZodTuple",qt.ZodRecord="ZodRecord",qt.ZodMap="ZodMap",qt.ZodSet="ZodSet",qt.ZodFunction="ZodFunction",qt.ZodLazy="ZodLazy",qt.ZodLiteral="ZodLiteral",qt.ZodEnum="ZodEnum",qt.ZodEffects="ZodEffects",qt.ZodNativeEnum="ZodNativeEnum",qt.ZodOptional="ZodOptional",qt.ZodNullable="ZodNullable",qt.ZodDefault="ZodDefault",qt.ZodCatch="ZodCatch",qt.ZodPromise="ZodPromise",qt.ZodBranded="ZodBranded",qt.ZodPipeline="ZodPipeline",qt.ZodReadonly="ZodReadonly"})(At||(t.ZodFirstPartyTypeKind=At={}));class jt{constructor(...nt){}}const _n=(qt,nt={message:`Input not instance of ${qt.name}`})=>lt(Ft=>Ft instanceof qt,nt);t.instanceof=_n;const In=G.create;t.string=In;const ci=$.create;t.number=ci;const xn=ct.create;t.nan=xn;const dn=V.create;t.bigint=dn;const jn=H.create;t.boolean=jn;const sn=K.create;t.date=sn;const at=Y.create;t.symbol=at;const $e=X.create;t.undefined=$e;const Oe=oe.create;t.null=Oe;const Le=ie.create;t.any=Le;const ze=he.create;t.unknown=ze;const St=me.create;t.never=St;const $t=q.create;t.void=$t;const On=Ee.create;t.array=On;const Bn=te.create;t.object=Bn;const ui=te.strictCreate;t.strictObject=ui;const li=fe.create;t.union=li;const Ni=Me.create;t.discriminatedUnion=Ni;const Rn=Pe.create;t.intersection=Rn;const Cn=we.create;t.tuple=Cn;const $n=_e.create;t.record=$n;const Si=Ne.create;t.map=Si;const Ui=Te.create;t.set=Ui;const bi=We.create;t.function=bi;const un=pe.create;t.lazy=un;const Vn=re.create;t.literal=Vn;const Xt=De.create;t.enum=Xt;const Qe=Ae.create;t.nativeEnum=Qe;const vt=Ue.create;t.promise=vt;const pt=Ye.create;t.effect=pt,t.transformer=pt;const gt=Ke.create;t.optional=gt;const nn=mt.create;t.nullable=nn;const Gt=Ye.createWithPreprocess;t.preprocess=Gt;const Kt=st.create;t.pipeline=Kt;const vn=()=>In().optional();t.ostring=vn;const Hn=()=>ci().optional();t.onumber=Hn;const Jn=()=>jn().optional();t.oboolean=Jn,t.coerce={string:qt=>G.create({...qt,coerce:!0}),number:qt=>$.create({...qt,coerce:!0}),boolean:qt=>H.create({...qt,coerce:!0}),bigint:qt=>V.create({...qt,coerce:!0}),date:qt=>K.create({...qt,coerce:!0})},t.NEVER=m.INVALID},79682:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeDevtoolsContribution=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(65265),v=e(98295),m=e(27654);let p=n=class extends l.Disposable{constructor(){super(...arguments),this.lantencyHandler=g=>{const{command:a}=g.detail;a===_.DevtoolsLantencyCommand.Start?this.interval||this.startRTTInterval():a===_.DevtoolsLantencyCommand.Stop&&this.interval&&(clearInterval(this.interval),this.interval=void 0)}}initialize(){var g;this.appConfig.devtools&&(window.addEventListener(_.EDevtoolsEvent.Latency,this.lantencyHandler),this.addDispose(l.Disposable.create(()=>{window.removeEventListener(_.EDevtoolsEvent.Latency,this.lantencyHandler),this.interval&&(clearInterval(this.interval),this.interval=void 0)})),!((g=window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__)===null||g===void 0)&&g.captureRPC&&(this.interval||this.startRTTInterval()))}startRTTInterval(){this.interval=setInterval(async()=>{const g=Date.now();await this.rttService.measure();const a=Date.now()-g;window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.captureRPC&&(window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.latency=a)},n.INTERVAL)}};t.ChromeDevtoolsContribution=p,p.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],p.prototype,"rttService",void 0),t.ChromeDevtoolsContribution=p=n=r.__decorate([(0,v.Domain)(l.ClientAppContribution)],p)},72915:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTContribution=void 0;const r=e(85608),o=e(76003),l=e(26542),_=e(92323),v=e(98295),m=e(27654),p={id:"connection.start.rtt",label:"%connection.start.rtt%",category:"%command.category.developerTools%"},s={id:"connection.stop.rtt",label:"%connection.stop.rtt%",category:"%command.category.developerTools%"},g={alignment:l.StatusBarAlignment.LEFT,priority:1/0-1};let a=n=class{registerCommands(u){u.registerCommand(p,{execute:()=>{this.interval||this.startRTTInterval()}}),u.registerCommand(s,{execute:()=>{this.interval&&(clearInterval(this.interval),this.statusBar&&(this.statusBar.dispose(),this.statusBar=void 0))}})}startRTTInterval(){this.interval=setInterval(async()=>{const u=Date.now();await this.rttService.measure();const E={text:`${Date.now()-u}ms`};if(this.statusBar)this.statusBar.update({...E,...g});else{const f=this.statusBarService.addElement("connection-rtt",{...E,...g});this.statusBar=f}},n.INTERVAL)}};t.ConnectionRTTContribution=a,a.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],a.prototype,"rttService",void 0),t.ConnectionRTTContribution=a=n=r.__decorate([(0,v.Domain)(_.CommandContribution)],a)},27654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTBrowserService=t.ConnectionRTTBrowserServiceToken=void 0;const n=e(85608),r=e(76003),o=e(69452);t.ConnectionRTTBrowserServiceToken=Symbol("ConnectionRTTBrowserService");let l=class{async measure(){await this.connectionBackService.$measure()}};t.ConnectionRTTBrowserService=l,n.__decorate([(0,r.Autowired)(o.ConnectionBackServicePath),n.__metadata("design:type",Object)],l.prototype,"connectionBackService",void 0),t.ConnectionRTTBrowserService=l=n.__decorate([(0,r.Injectable)()],l)},17631:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(69452);let v=class extends l.WithEventBus{onDidDropFile(p){this.dropService.onDidDropFile(p)}};t.FileDropContribution=v,n.__decorate([(0,r.Autowired)(_.IFileDropFrontendServiceToken),n.__metadata("design:type",Object)],v.prototype,"dropService",void 0),n.__decorate([(0,l.OnEvent)(l.FileTreeDropEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[l.FileTreeDropEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"onDidDropFile",null),t.FileDropContribution=v=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution)],v)},22874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(43718),v=e(42933),{Path:m}=_.path,p=e(69452);let s=class extends _.WithEventBus{constructor(){super(...arguments),this.pending=new Set}onDidUploadFileStart(a){this.pending.add(a),this.createOrUpdateStatusBar()}onDidUploadFileEnd(a){this.pending.delete(a),this.createOrUpdateStatusBar()}createOrUpdateStatusBar(a){if(this.pending.size===0){this.uploadStatus&&(this.uploadStatus.dispose(),this.uploadStatus=void 0);return}const h="sumi-upload-file-status",u=(0,o.formatLocalize)("workbench.uploadingFiles",this.pending.size,a||"0 MB"),c={text:u,alignment:l.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.uploadStatus?this.uploadStatus.update({id:h,...c}):this.uploadStatus=this.statusBarService.addElement(h,c)}onDidDropFile(a){var h;const{payload:{event:u,targetDir:c}}=a;if(!c||!(!((h=u.dataTransfer)===null||h===void 0)&&h.files)||u.dataTransfer.files.length===0)return;const E=u.dataTransfer.items;let f=0;const d=Date.now(),y=b=>{f+=b;const A=Date.now(),D=`${(f/((A-d)/1e3)/1024/1024).toFixed(2)} MB`;this.createOrUpdateStatusBar(D)};for(const b of E){const A=b.webkitGetAsEntry();this.processFilesEntry(c,A,y)}}async processFilesEntry(a,h,u){if(h.isFile)this.processFileEntry(h,a,u);else{const c=_.Uri.file(new m(a).join(h.fullPath).toString()).toString();await this.fs.createFolder(c),this.processDirEntry(h,a,u)}}toBinaryString(a){let h;const u=a.length;let c="";for(h=0;h<u;h+=1)c+=String.fromCharCode(a[h]);return c}async doUploadFile(a,h,u){var c;const E=new m(h).join(a.name).toString();this.onDidUploadFileStart(E.toString()),await this.fs.createFile(_.Uri.file(E.toString()).toString()),await this.dropService.$ensureFileExist(a.name,h);const f=a.stream().getReader();let d=await f.read();for(;!d.done;)await this.dropService.$writeStream(this.toBinaryString(d.value),a.name,h,d.done),u((c=d.value)===null||c===void 0?void 0:c.byteLength),d=await f.read();d.done&&this.onDidUploadFileEnd(E.toString())}processFileEntry(a,h,u){a.file(c=>{const E=new File([c],a.fullPath,{type:a.type});this.doUploadFile(E,h,u)},()=>{})}processDirEntry(a,h,u){a.createReader().readEntries(E=>{E.forEach(async f=>{this.processFilesEntry(h,f,u)})},()=>{})}};t.FileDropService=s,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fs",void 0),n.__decorate([(0,r.Autowired)(p.FileDropServicePath),n.__metadata("design:type",Object)],s.prototype,"dropService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],s.prototype,"statusBarService",void 0),t.FileDropService=s=n.__decorate([(0,r.Injectable)()],s)},79240:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchContribution=t.FileSearchQuickCommandHandler=t.matchLineReg=t.quickGoToSymbol=t.quickFileOpen=void 0,t.getValidateInput=y;const n=e(85608),r=n.__importDefault(e(39050)),o=e(76003),l=e(41869),_=e(26542),v=e(43718),m=e(98295),p=e(54414),s=e(17459),g=e(84660),a=n.__importStar(e(20868)),h=e(97821),u=e(80490),c=e(51500),E=e(30981),f=200;t.quickFileOpen={id:"workbench.action.quickOpen",category:"File",label:"Open File..."},t.quickGoToSymbol={id:"workbench.action.gotoSymbol",category:"File",label:"Open File Symbol..."},t.matchLineReg=/^([^:#(]*)[:#(]?L?(\d+)?[:,]?(\d+)?\)?/;function d(I=""){const w=I.match(t.matchLineReg)||[];if(w.length<2)return;const T={line:Number(w[2]||0),start:Number(w[3]||0)};return new a.Range(T.line,T.start,T.line,T.start)}function y(I){return I.replace(t.matchLineReg,"$1")}let b=class extends h.QuickOpenBaseAction{constructor(){super({id:"file-search:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,l.getIcon)("embed")})}async run(w){await this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,w.getUri(),{preview:!1,split:p.EditorGroupSplitAction.Right,range:d(this.injector.get(S).currentLookFor),focus:!0})}};n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b);let A=class{hasActions(){return!0}getActions(){return[this.fileSearchActionLeftRight]}getValidateInput(w){return y(w)}};n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",b)],A.prototype,"fileSearchActionLeftRight",void 0),A=n.__decorate([(0,o.Injectable)()],A);let S=class{constructor(){this.cancelIndicator=new v.CancellationTokenSource,this.default=!0,this.prefix="...",this.description=(0,l.localize)("file-search.command.fileOpen.description"),this.prevEditorState={},this.currentLookFor=""}getModel(){return{onType:async(w,T)=>{this.cancelIndicator.cancel(),this.cancelIndicator=new v.CancellationTokenSource;const R=this.cancelIndicator.token,P=new Set;let O=[];w=w.trim().replace(/\s/g,""),this.currentLookFor=w;const M=y(w),k=this.reporterService.time(v.REPORT_NAME.QUICK_OPEN_MEASURE),F=await this.getRecentlyItems(P,M,R);if(w&&(this.logger.debug("lookFor",w,M),O=await this.getFindOutItems(P,M,R)),R.isCancellationRequested)return;const L=F.concat(O);T(L,L.length?this.fileSearchActionProvider:void 0),k.timeEnd(w.indexOf("@")>-1?"file-symbol":"file",{lookFor:w,stat:{recently:F.length,find:O.length}})}}}getOptions(){return{placeholder:(0,l.localize)("file-search.command.fileOpen.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:{enableSeparateSubstringMatching:!0},getPlaceholderItem:w=>new l.QuickOpenItem({label:(0,l.localize)(w.indexOf("@")>-1?"search.fileSymbolResults.notfound":"search.fileResults.notfound"),run:()=>!1})}}onClose(w){w&&this.prevEditorState.uri&&(this.workbenchEditorService.open(this.prevEditorState.uri,{range:this.prevEditorState.range}),this.prevEditorState={}),this.prevSelected=void 0,this.cancelIndicator.cancel()}onToggle(){this.cancelIndicator.cancel()}trySaveEditorState(){var w;if(this.workbenchEditorService.currentResource){let T={startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1};const R=(w=this.workbenchEditorService.currentEditor)===null||w===void 0?void 0:w.getSelections();if(R){const{selectionStartLineNumber:P,selectionStartColumn:O,positionLineNumber:M,positionColumn:k}=R[0];T=new a.Range(P,O,M,k)}this.prevEditorState={uri:this.workbenchEditorService.currentResource.uri,range:T}}}async getFindOutItems(w,T,R){var P;let O;if(T.indexOf("@")>-1){this.trySaveEditorState(),O=[];const[M,k]=T.split("@");let F;if(this.prevSelected)F=this.prevSelected.withoutFragment();else if(M){const L=await this.getQueryFiles(M,w,R);L.length&&(F=L[0].getUri())}else F=(P=this.workbenchEditorService.currentResource)===null||P===void 0?void 0:P.uri;if(F){const L=await this.documentSymbolStore.getDocumentSymbolAsync(F)||[],B=[];this.flattenSymbols({children:L},B),O=B.filter(W=>{const j=(0,E.matchesFuzzy)(k,W.name,!0)||[];return j&&(W.labelHighlights=j),j&&j.length}).map((W,j)=>{var Q;return new l.QuickOpenItem({uri:F,label:W.name,iconClass:(0,l.getSymbolIcon)(W.kind),description:(Q=W.parent)===null||Q===void 0?void 0:Q.name,labelHighlights:W.labelHighlights,groupLabel:j===0?(0,l.formatLocalize)("search.fileSymbolResults",B.length):"",showBorder:!1,run:G=>G===l.Mode.PREVIEW?(this.locateSymbol(F,W),!0):G===l.Mode.OPEN?(this.locateSymbol(F,W),!0):!1})})}else return[]}else if(O=await this.getQueryFiles(T,w,R),O[0]){const M=await this.getItems([O[0].getUri().codeUri.fsPath],{groupLabel:(0,l.localize)("search.fileResults"),showBorder:!0});O[0]=M[0]}return O}async getQueryFiles(w,T,R){const O=(await this.workspaceService.roots).map(F=>new l.URI(F.uri).codeUri.fsPath),M=await this.fileSearchService.find(w,{rootUris:O,fuzzyMatch:!0,limit:f,useGitIgnore:!0,noIgnoreParent:!0,excludePatterns:this.getPreferenceSearchExcludes()},R),k=await this.getItems(M.filter(F=>T.has(F)||R.isCancellationRequested?!1:(T.add(F),!0)),{});return k.sort(this.compareItems.bind(this)),k}async flattenSymbols(w,T){w.children.forEach(R=>{T.push(R),R.children&&this.flattenSymbols(R,T)})}async getRecentlyItems(w,T,R){const P=await this.recentFilesManager.getMostRecentlyOpenedFiles(!0)||[];return await this.getItems(P.filter(O=>{const M=new l.URI(O);return w.has(O)||!r.default.test(T,M.displayName)||R.isCancellationRequested?!1:(w.add(O),!0)}),{groupLabel:(0,l.localize)("search.historyMatches")})}async getItems(w,T){const R=[];for(const[P,O]of w.entries()){const M=l.URI.isUriString(O)?new l.URI(O):l.URI.file(O),k=`file-icon ${this.labelService.getIcon(M.withoutFragment())}`;let F="";const L=await this.workspaceService.asRelativePath(M.parent);L&&(this.workspaceService.isMultiRootWorkspaceOpened?F=`${new l.URI(L.root).displayName}${L.path?` \u30FB ${L.path}`:""}`:F=L.path||"");const B=new l.QuickOpenItem({uri:M,label:M.displayName,tooltip:O,iconClass:k,description:F,groupLabel:P===0?T.groupLabel:"",showBorder:w.length>0&&P===0?T.showBorder:!1,run:U=>(U===l.Mode.PREVIEW&&(this.prevSelected=M),U===l.Mode.OPEN?(this.openFile(M),!0):!1)});R.push(B)}return R}openFile(w){const T=w.codeUri.fsPath;let R=d(this.currentLookFor);(!R||!R.startLineNumber&&!R.startColumn)&&(R=d(w.fragment?"#"+w.fragment:T)),this.currentLookFor="",this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,w.withoutFragment(),{preview:!1,range:R,focus:!0})}locateSymbol(w,T){this.workbenchEditorService.open(w,{range:T.range,preview:!0})}compareItems(w,T,R="getLabel"){function P(U){return U.trim().toLowerCase()}const O=P(y(this.currentLookFor));function M(U){const W=r.default.match(O,U);return W===null?0:W.score}let k=w[R](),F=T[R]();typeof k!="string"&&(k=k.path.toString()),typeof F!="string"&&(F=F.path.toString()),k=P(k),F=P(F);const L=M(k),B=M(F);if(L===B){const U=k.indexOf(O),W=F.indexOf(O);return U===W?k.length!==F.length?k.length<F.length?-1:1:F.localeCompare(k)===0?R==="getUri"?0:this.compareItems(w,T,"getUri"):F.localeCompare(k):U-W}return B-L}getPreferenceSearchExcludes(){const w=[],T=this.preferenceService.get("files.exclude"),R=this.preferenceService.get("search.exclude"),P=Object.assign({},T,R);for(const O of Object.keys(P))P[O]&&w.push(O);return w}};t.FileSearchQuickCommandHandler=S,n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],S.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(g.FileSearchServicePath),n.__metadata("design:type",Object)],S.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],S.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(s.DocumentSymbolStore),n.__metadata("design:type",s.DocumentSymbolStore)],S.prototype,"documentSymbolStore",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",_.LabelService)],S.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(c.IWorkspaceService),n.__metadata("design:type",Object)],S.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(l.RecentFilesManager),n.__metadata("design:type",l.RecentFilesManager)],S.prototype,"recentFilesManager",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],S.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",A)],S.prototype,"fileSearchActionProvider",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),t.FileSearchQuickCommandHandler=S=n.__decorate([(0,o.Injectable)()],S);let D=class{registerQuickOpenHandlers(w){w.registerHandler(this.fileSearchQuickCommandHandler,{title:(0,l.localize)("quickopen.tab.file"),commandId:t.quickFileOpen.id,order:1})}registerCommands(w){w.registerCommand(t.quickFileOpen,{execute:()=>this.quickOpenService.open("...")}),w.registerCommand(t.quickGoToSymbol,{execute:()=>this.quickOpenService.open("...@")})}registerKeybindings(w){w.registerKeybinding({command:t.quickFileOpen.id,keybinding:"ctrlcmd+p"})}};t.FileSearchContribution=D,n.__decorate([(0,o.Autowired)(S),n.__metadata("design:type",S)],D.prototype,"fileSearchQuickCommandHandler",void 0),n.__decorate([(0,o.Autowired)(h.PrefixQuickOpenService),n.__metadata("design:type",Object)],D.prototype,"quickOpenService",void 0),t.FileSearchContribution=D=n.__decorate([(0,m.Domain)(v.CommandContribution,l.KeybindingContribution,u.QuickOpenContribution)],D)},73827:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientAddonModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69452),_=e(79682),v=e(72915),m=e(27654),p=e(17631),s=e(22874),g=e(79240),a=e(18256),h=e(7756),u=e(16426);let c=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.ChromeDevtoolsContribution,a.LanguageChangeHintContribution,g.FileSearchContribution,h.StatusBarContribution,u.ToolbarCustomizeContribution,p.FileDropContribution,v.ConnectionRTTContribution,{token:l.IFileDropFrontendServiceToken,useClass:s.FileDropService},{token:m.ConnectionRTTBrowserServiceToken,useClass:m.ConnectionRTTBrowserService}],this.backServices=[{servicePath:l.FileDropServicePath},{servicePath:l.ConnectionBackServicePath}]}};t.ClientAddonModule=c,t.ClientAddonModule=c=n.__decorate([(0,r.Injectable)()],c)},18256:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageChangeHintContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665);let _=class{onStart(){this.preferenceService.onSpecificPreferenceChange(o.GeneralSettingsId.Language,async m=>{(0,o.setLanguageId)(m.newValue),this.preferenceService.get("general.askReloadOnLanguageChange")&&await this.dialogService.info((0,o.localize)("preference.general.language.change.refresh.info","After changing the language, it should be restarted to take effect. Will it be refreshed immediately?"),[(0,o.localize)("preference.general.language.change.refresh.later","Later"),(0,o.localize)("preference.general.language.change.refresh.now","Now")])===(0,o.localize)("preference.general.language.change.refresh.now","Now")&&this.clientApp.fireOnReload()})}};t.LanguageChangeHintContribution=_,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],_.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(l.IDialogService),n.__metadata("design:type",Object)],_.prototype,"dialogService",void 0),t.LanguageChangeHintContribution=_=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],_)},7756:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);let _=class extends l.WithEventBus{onStart(){}handleBrowserConnectionOpen(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.logger.log("Browser connection open, change status bar background color")}handleBrowserConnectionClose(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--kt-statusbar-offline-background)"),this.logger.log("Browser connection close, change status bar background color")}};t.StatusBarContribution=_,n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],_.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],_.prototype,"handleBrowserConnectionClose",null),t.StatusBarContribution=_=n.__decorate([(0,l.Domain)(o.ClientAppContribution)],_)},16426:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(62132);let v=class{registerCommands(p){p.registerCommand({id:"toolbar.showCustomizePanel",label:"Show Toolbar Customization"},{execute:()=>{this.viewService.setVisible(!0)}})}registerComponent(p){p.register("addon/toolbar-customize",{id:"addon/toolbar-customize",component:_.ToolbarCustomizeComponent}),this.config.layoutConfig[o.SlotLocation.extra]||(this.config.layoutConfig[o.SlotLocation.extra]={modules:[]}),this.config.layoutConfig[o.SlotLocation.extra].modules.push("addon/toolbar-customize")}registerMenus(p){p.registerMenuItem(l.MenuId.KTToolbarLocationContext,{command:{id:"toolbar.showCustomizePanel",label:(0,o.localize)("toolbar.customize.menu")}})}};t.ToolbarCustomizeContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(_.ToolbarCustomizeViewService),n.__metadata("design:type",_.ToolbarCustomizeViewService)],v.prototype,"viewService",void 0),t.ToolbarCustomizeContribution=v=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ComponentContribution,l.MenuContribution)],v)},62132:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeComponent=t.ToolbarCustomizeViewService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(97267),_=e(41869),v=n.__importDefault(e(18541));let m=class{bindSetVisibleHandle(g){this._setVisible=g}setVisible(g){this._setVisible(g)}async toggleActionVisibility(g,a,h){const u=this.preferenceService.getValid("toolbar.ignoreActions",{});if(u[g]||(u[g]=[]),!h)u[g].indexOf(a)===-1&&u[g].push(a);else{const E=u[g].indexOf(a);E!==-1&&u[g].splice(E,1)}const c=this.preferenceService.inspect("toolbar.ignoreActions").workspaceValue?_.PreferenceScope.Workspace:_.PreferenceScope.User;await this.preferenceService.set("toolbar.ignoreActions",u,c)}};t.ToolbarCustomizeViewService=m,n.__decorate([(0,o.Autowired)(_.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.ToolbarCustomizeViewService=m=n.__decorate([(0,o.Injectable)()],m);const p=()=>{const[s,g]=r.default.useState(!1),a=(0,_.useInjectable)(m),h=(0,_.useInjectable)(_.IToolbarRegistry),u=(0,_.useInjectable)(_.PreferenceService);if(a.bindSetVisibleHandle(g),!s)return null;const c=h.getAllLocations(),E=u.get("toolbar.ignoreActions")||{};let f=u.get("toolbar.buttonDisplay","iconAndText");function d(y){const b=[{id:"_head"},...h.getActionGroups(y)||[],{id:"_tail"}],A=[],S=E[y]||[];return b.forEach((D,I)=>{const w=h.getToolbarActions({location:y,group:D.id});w&&w.actions.length>0&&(A.length>0&&A.push(r.default.createElement("div",{className:v.default["group-split"],key:"split-"+I})),w.actions.forEach((T,R)=>{var P;let O=S.indexOf(T.id)===-1;const M="action-toggle-"+T.id;A.push(r.default.createElement("div",{className:v.default["action-item"],key:R+"_"+T.id},r.default.createElement(l.CheckBox,{onChange:()=>{a.toggleActionVisibility(y,T.id,!O),O=!O},defaultChecked:O,id:M,label:(P=T.description)!==null&&P!==void 0?P:T.id})))}))}),A.length===0?null:r.default.createElement("div",{key:y,className:v.default["toolbar-customize-location"]},A)}return r.default.createElement("div",{className:v.default["toolbar-customize-overlay"]},r.default.createElement("div",{className:v.default["toolbar-customize"]},c.map(y=>d(y)),r.default.createElement("div",{className:v.default["button-display"]},r.default.createElement("div",null,(0,_.localize)("toolbar-customize.buttonDisplay.description")),r.default.createElement(l.Select,{options:[{label:(0,_.localize)("toolbar-customize.buttonDisplay.icon"),value:"icon"},{label:(0,_.localize)("toolbar-customize.buttonDisplay.iconAndText"),value:"iconAndText"}],value:f,onChange:y=>{const b=u.inspect("toolbar.buttonDisplay").workspaceValue?_.PreferenceScope.Workspace:_.PreferenceScope.User;u.set("toolbar.buttonDisplay",y,b),f=y},className:v.default["button-display-select"]})),r.default.createElement("div",{className:v.default["customize-complete"]},r.default.createElement(l.Button,{type:"primary",onClick:()=>g(!1)},(0,_.localize)("toolbar-customize.complete")))))};t.ToolbarCustomizeComponent=p},69452:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IConnectionBackService=t.ConnectionBackServicePath=t.IFileDropFrontendServiceToken=t.IFileDropServiceToken=t.FileDropServicePath=void 0,t.FileDropServicePath="FileDropServicePath",t.IFileDropServiceToken=Symbol("IFileDropService"),t.IFileDropFrontendServiceToken=Symbol("IFileDropFrontendService"),t.ConnectionBackServicePath="ConnectionBackServicePath",t.IConnectionBackService=Symbol("IConnectionBackService")},77659:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(50394);let _=class{get contextKeyService(){return this._contextKeyService}constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.inlineChatIsVisible=l.InlineChatIsVisible.bind(this._contextKeyService),this.inlineCompletionIsTrigger=l.InlineCompletionIsTrigger.bind(this._contextKeyService),this.inlineHintWidgetIsVisible=l.InlineHintWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsVisible=l.InlineInputWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsStreaming=l.InlineInputWidgetIsStreaming.bind(this._contextKeyService),this.inlineDiffPartialEditsIsVisible=l.InlineDiffPartialEditsIsVisible.bind(this._contextKeyService),this.codeEditsIsVisible=l.CodeEditsIsVisible.bind(this._contextKeyService)}};t.AINativeContextKey=_,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"globalContextKeyService",void 0),t.AINativeContextKey=_=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_)},32016:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeBrowserContribution=t.INLINE_DIFF_MANAGER_WIDGET_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),_=e(50394),v=e(1149),m=e(97222),p=e(43718),s=e(82353),g=e(54414),a=e(57517),h=e(51553),u=e(63067),c=e(46507),E=e(97682),f=e(68415),d=e(96640),y=e(19413),b=e(64811),A=e(69820),S=e(98987),D=e(61282),I=e(42995),w=e(51081),T=e(59347),R=e(76154),P=e(79559),O=e(57232),M=e(72991),k=e(71863),F=e(7511),L=e(42911),B=e(72801),U=e(87817),W=e(4972),j=e(82983),Q=e(73974),G=e(33108),Z=e(77633),$=e(51221),V=e(2281),H=e(31031),K=e(95608),Y=e(38890),X=e(77886),oe=e(89060),ie=e(74353),he=e(22169),me=e(90058);t.INLINE_DIFF_MANAGER_WIDGET_ID="inline-diff-manager-widget";let q=class{constructor(){this.registerFeature()}registerMultiDiffSourceResolver(ue){return ue.registerResolver(this.chatMultiDiffResolver)}registerEditorDocumentModelContentProvider(ue){ue.registerEditorDocumentModelContentProvider(this.chatEditResourceProvider)}async initialize(){const{supportsChatAssistant:ue}=this.aiNativeConfigService.capabilities;ue&&(o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,y.AI_CHAT_VIEW_ID,y.AI_CHAT_CONTAINER_ID),o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,s.DESIGN_MENU_BAR_RIGHT,y.AI_CHAT_LOGO_AVATAR_ID),this.chatProxyService.registerDefaultAgent(),this.chatInternalService.init(),await this.chatManagerService.init())}registerEditorExtensionContribution(ue){const{supportsInlineChat:te,supportsInlineCompletion:fe,supportsProblemFix:Ie,supportsCodeAction:Me}=this.aiNativeConfigService.capabilities;ue(Y.InlineDiffController.ID,new d.SyncDescriptor(Y.InlineDiffController,[this.injector]),E.EditorContributionInstantiation.Lazy),Me&&ue(me.SumiLightBulbWidget.ID,me.SumiLightBulbWidget,E.EditorContributionInstantiation.Lazy),te&&(ue($.InlineChatEditorController.ID,new d.SyncDescriptor($.InlineChatEditorController,[this.injector]),E.EditorContributionInstantiation.BeforeFirstInteraction),this.inlineInputService.getInteractiveInputHandler()&&(ue(X.InlineHintController.ID,new d.SyncDescriptor(X.InlineHintController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender),ue(oe.InlineInputController.ID,new d.SyncDescriptor(oe.InlineInputController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender))),fe&&(ue(F.IntelligentCompletionsController.ID,new d.SyncDescriptor(F.IntelligentCompletionsController,[this.injector]),E.EditorContributionInstantiation.Eager),ue(M.InlineCompletionsController.ID,new d.SyncDescriptor(M.InlineCompletionsController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)),Ie&&ue(L.ProblemFixController.ID,new d.SyncDescriptor(L.ProblemFixController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)}onReconnect(){const{supportsMCP:ue}=this.aiNativeConfigService.capabilities;ue&&this.initMCPServers()}onDidStart(){(0,p.runWhenIdle)(()=>{const{supportsRenameSuggestions:ue,supportsInlineChat:te,supportsMCP:fe,supportsCustomLLMSettings:Ie}=this.aiNativeConfigService.capabilities,Me=this.preferenceService.getValid(o.AINativeSettingSectionsId.ChatVisibleType);Me==="always"?this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!0):Me==="never"&&this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!1),ue&&this.renameSingleHandler.load(),te&&this.codeActionSingleHandler.load(),Ie&&(this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.LLMModelSelection,Be=>{const Pe=this.getModelByName(Be.newValue),we=Pe?Object.keys(Pe):[],_e=we.length?we[0]:"",Ne=this.preferenceSchemaProvider.getPreferenceProperty(o.AINativeSettingSectionsId.ModelID);this.preferenceSchemaProvider.setSchema({properties:{[o.AINativeSettingSectionsId.ModelID]:{...Ne,default:_e,defaultValue:_e,enum:we.length?we:void 0}}},!0),this.preferenceService.set(o.AINativeSettingSectionsId.ModelID,_e,Be.scope),this.preferenceSettings.setEnumLabels(o.AINativeSettingSectionsId.ModelID,we.reduce((Te,We)=>({...Te,[We]:We}),{}))}),this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.ModelID,Be=>{const Pe=this.preferenceService.get(o.AINativeSettingSectionsId.LLMModelSelection);if(!Pe)return;const we=this.getModelByName(Pe);we&&we[Be.newValue]&&(this.preferenceService.set(o.AINativeSettingSectionsId.MaxTokens,we[Be.newValue].maxTokens,Be.scope),this.preferenceService.set(o.AINativeSettingSectionsId.ContextWindow,we[Be.newValue].contextWindow,Be.scope))})),fe&&this.initMCPServers()})}async initMCPServers(){var ue;const te=await this.storageProvider(p.STORAGE_NAMESPACE.CHAT);let fe=te.get(b.MCPServersEnabledKey,[y.BUILTIN_MCP_SERVER_NAME]);const Ie=this.preferenceService.get(o.AINativeSettingSectionsId.MCPServers,[]);let Me=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0);if(Me.scope===p.PreferenceScope.Default&&Ie.length>0){const Pe={mcpServers:{}},we=new Set([y.BUILTIN_MCP_SERVER_NAME]);Ie.forEach(_e=>{_e.type===A.MCP_SERVER_TYPE.SSE?Pe.mcpServers[_e.name]={url:_e.serverHost}:_e.type===A.MCP_SERVER_TYPE.STDIO&&(Pe.mcpServers[_e.name]={command:_e.command,args:_e.args,env:_e.env}),_e.enabled&&we.add(_e.name)}),await this.preferenceService.set("mcp",Pe,p.PreferenceScope.Workspace),Me=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0),fe=Array.from(we),te.set(b.MCPServersEnabledKey,fe)}const Be=(ue=Me.value)===null||ue===void 0?void 0:ue.mcpServers;if(this.sumiMCPServerBackendProxy.$initBuiltinMCPServer(fe.includes(y.BUILTIN_MCP_SERVER_NAME)),Be&&Object.keys(Be).length>0){const Pe=(await Promise.all(Object.keys(Be).map(async we=>await this.mcpConfigService.getServerConfigByName(we)))).filter(we=>we!==void 0);await this.sumiMCPServerBackendProxy.$initExternalMCPServers(Pe)}this.mcpConfigService.fireMCPServersChange(!0)}getModelByName(ue){switch(ue){case"deepseek":return y.deepSeekModels;case"anthropic":return y.anthropicModels;case"openai":return y.openAiNativeModels;default:return}}registerFeature(){this.contributions.getContributions().forEach(ue=>{var te,fe,Ie,Me,Be,Pe,we,_e,Ne;(te=ue.registerInlineChatFeature)===null||te===void 0||te.call(ue,this.inlineChatFeatureRegistry),(fe=ue.registerChatFeature)===null||fe===void 0||fe.call(ue,this.chatFeatureRegistry),(Ie=ue.registerResolveConflictFeature)===null||Ie===void 0||Ie.call(ue,this.resolveConflictRegistry),(Me=ue.registerRenameProvider)===null||Me===void 0||Me.call(ue,this.renameCandidatesProviderRegistry),(Be=ue.registerChatRender)===null||Be===void 0||Be.call(ue,this.chatRenderRegistry),(Pe=ue.registerTerminalProvider)===null||Pe===void 0||Pe.call(ue,this.terminalProviderRegistry),(we=ue.registerIntelligentCompletionFeature)===null||we===void 0||we.call(ue,this.intelligentCompletionsRegistry),(_e=ue.registerProblemFixFeature)===null||_e===void 0||_e.call(ue,this.problemFixProviderRegistry),(Ne=ue.registerChatAgentPromptProvider)===null||Ne===void 0||Ne.call(ue)}),this.mcpServerContributions.getContributions().forEach(ue=>{ue.registerMCPServer(this.mcpServerRegistry)})}registerSetting(ue){ue.registerSettingGroup({id:o.AI_NATIVE_SETTING_GROUP_ID,title:p.AI_NATIVE_SETTING_GROUP_TITLE,iconClass:(0,o.getIcon)("magic-wand")}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.chat.title"),preferences:[{id:o.AINativeSettingSectionsId.ChatVisibleType,localized:"preference.ai.native.chat.visible.type"}]}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.interface.quick.title"),preferences:[{id:o.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,localized:"preference.ai.native.interface.quick.navigation"}]}),this.aiNativeConfigService.capabilities.supportsInlineCompletion&&(ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.intelligentCompletions.title"),preferences:[{id:o.AINativeSettingSectionsId.IntelligentCompletionsCacheEnabled,localized:"preference.ai.native.intelligentCompletions.cache.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsDebounceTime,localized:"preference.ai.native.intelligentCompletions.debounceTime"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsPromptEngineeringEnabled,localized:"preference.ai.native.intelligentCompletions.promptEngineering.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,localized:"preference.ai.native.intelligentCompletions.alwaysVisible"}]}),ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.codeEdits.title"),preferences:[{id:o.AINativeSettingSectionsId.CodeEditsLintErrors,localized:"preference.ai.native.codeEdits.lintErrors"},{id:o.AINativeSettingSectionsId.CodeEditsLineChange,localized:"preference.ai.native.codeEdits.lineChange"},{id:o.AINativeSettingSectionsId.CodeEditsTyping,localized:"preference.ai.native.codeEdits.typing"},{id:o.AINativeSettingSectionsId.CodeEditsRenderType,localized:"preference.ai.native.codeEdits.renderType"},{id:o.AINativeSettingSectionsId.SystemPrompt,localized:"preference.ai.native.chat.system.prompt"}]})),this.aiNativeConfigService.capabilities.supportsCustomLLMSettings&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.llm.apiSettings.title"),preferences:[{id:o.AINativeSettingSectionsId.LLMModelSelection,localized:"preference.ai.native.llm.model.selection"},{id:o.AINativeSettingSectionsId.ModelID,localized:"preference.ai.native.llm.model.id"},{id:o.AINativeSettingSectionsId.DeepseekApiKey,localized:"preference.ai.native.deepseek.apiKey"},{id:o.AINativeSettingSectionsId.AnthropicApiKey,localized:"preference.ai.native.anthropic.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiApiKey,localized:"preference.ai.native.openai.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiBaseURL,localized:"preference.ai.native.openai.baseURL"},{id:o.AINativeSettingSectionsId.MaxTokens,localized:"preference.ai.native.maxTokens"},{id:o.AINativeSettingSectionsId.ContextWindow,localized:"preference.ai.native.contextWindow"}]}),this.aiNativeConfigService.capabilities.supportsMCP&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.mcp.settings.title"),preferences:[{id:o.AINativeSettingSectionsId.MCPServers,localized:"preference.ai.native.mcp.servers"},{id:o.AINativeSettingSectionsId.TerminalAutoRun,localized:"ai.native.terminal.autorun"}]}),this.aiNativeConfigService.capabilities.supportsInlineChat&&ue.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.inlineChat.title"),preferences:[{id:o.AINativeSettingSectionsId.InlineChatAutoVisible,localized:"preference.ai.native.inlineChat.auto.visible"},{id:o.AINativeSettingSectionsId.InlineChatCodeActionEnabled,localized:"preference.ai.native.inlineChat.codeAction.enabled"},{id:o.AINativeSettingSectionsId.InlineDiffPreviewMode,localized:"preference.ai.native.inlineDiff.preview.mode"}]})}registerEditorFeature(ue){ue.registerEditorFeatureContribution({contribute:te=>{const{monacoEditor:fe}=te;return this.codeActionSingleHandler.mountEditor(te.monacoEditor),fe.onDidScrollChange(()=>{this.ctxMenuRenderer.visible&&this.ctxMenuRenderer.hide(!0)})}})}registerEditorComponent(ue){ue.registerEditorSideWidget({id:t.INLINE_DIFF_MANAGER_WIDGET_ID,component:K.InlineDiffManager,displaysOnResource:te=>{var fe;return!!(this.aiNativeConfigService.capabilities.supportsMCP&&(!((fe=this.applyService.getUriCodeBlocks(te.uri))===null||fe===void 0)&&fe.filter(Ie=>Ie.status==="pending").length))}})}registerCommands(ue){ue.registerCommand(l.AI_INLINE_CHAT_VISIBLE,{execute:te=>{this.aiInlineChatService._onInlineChatVisible.fire(te)}}),ue.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE,{execute:async te=>{var fe;if(!te){this.inlineInputService.hide();return}this.commandService.executeCommand(l.AI_INLINE_CHAT_VISIBLE.id,!1);const Ie=this.workbenchEditorService.currentCodeEditor;if(!Ie)return;const Me=Ie.monacoEditor.getPosition();if(!Me)return;const Be=Ie.monacoEditor.getSelection();if(Me?((fe=Ie.monacoEditor.getModel())===null||fe===void 0?void 0:fe.getLineLength(Me.lineNumber))===0:!1){this.inlineInputService.visibleByPosition(Me);return}if(Be&&!Be.isEmpty()){this.inlineInputService.visibleBySelection(Be);return}this.inlineInputService.visibleByNearestCodeBlock(Me,Ie.monacoEditor)}}),ue.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL,{execute:()=>{var te;const fe=this.workbenchEditorService.currentCodeEditor;fe&&((te=oe.InlineInputController.get(fe.monacoEditor))===null||te===void 0||te.cancelToken())}}),ue.registerCommand(l.AI_INLINE_COMPLETION_REPORTER,{execute:(te,fe,Ie,Me)=>{this.aiCompletionsService.report({sessionId:fe,accept:Ie,relationId:te,code:Me})}}),ue.registerCommand(l.AI_CHAT_VISIBLE,{execute:te=>{this.layoutService.toggleSlot(y.AI_CHAT_VIEW_ID,(0,p.isUndefined)(te)?!0:te)}}),ue.registerCommand(l.AI_INLINE_COMPLETION_VISIBLE,{execute:async te=>{te||(this.aiCompletionsService.hideStatusBarItem(),this.aiInlineCompletionsProvider.setVisibleCompletion(!1),this.aiInlineCompletionsProvider.cancelRequest())}}),ue.registerCommand(l.AI_INLINE_DIFF_PARTIAL_EDIT,{execute:te=>{this.inlineStreamDiffService.launchAcceptDiscardPartialEdit(te)}}),ue.afterExecuteCommand(f.HideInlineCompletion.ID,()=>{this.commandService.executeCommand(l.AI_INLINE_COMPLETION_VISIBLE.id,!1)})}registerRenderer(ue){const te={isLatter:!0};this.designLayoutConfig.supportExternalChatPanel?ue.registerSlotRenderer(y.AI_CHAT_VIEW_ID,W.AIChatTabRendererWithTab,te):ue.registerSlotRenderer(y.AI_CHAT_VIEW_ID,W.AIChatTabRenderer,te),this.designLayoutConfig.useMergeRightWithLeftPanel&&(ue.registerSlotRenderer(o.SlotLocation.view,W.AILeftTabRenderer,Object.assign({},te,{isLatter:!1})),ue.registerSlotRenderer(o.SlotLocation.extendView,W.AIRightTabRenderer,te))}registerComponent(ue){ue.register(y.AI_CHAT_CONTAINER_ID,[],{component:R.AIChatView,title:(0,o.localize)("aiNative.chat.ai.assistant.name"),iconClass:(0,o.getIcon)("magic-wand"),containerId:y.AI_CHAT_CONTAINER_ID}),ue.register(y.AI_MENU_BAR_DEBUG_TOOLBAR,{id:y.AI_MENU_BAR_DEBUG_TOOLBAR,component:U.AIRunToolbar}),ue.register(y.AI_CHAT_LOGO_AVATAR_ID,{id:y.AI_CHAT_LOGO_AVATAR_ID,component:j.AIChatLogoAvatar})}registerKeybindings(ue){this.aiNativeConfigService.capabilities.supportsInlineChat&&(ue.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"ctrlcmd+i",when:"editorTextFocus",args:!0,priority:0},o.KeybindingScope.USER),ue.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"esc",args:!1,when:`editorFocus && ${_.InlineChatIsVisible.raw}`}),this.inlineInputService.getInteractiveInputHandler()&&(ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && (${_.InlineChatIsVisible.raw} || inlineSuggestionVisible)`},o.KeybindingScope.USER),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:"esc",args:!1,priority:0,when:`editorFocus && ${_.InlineInputWidgetIsVisible.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL.id,keybinding:"esc",priority:1,when:`editorFocus && ${_.InlineInputWidgetIsStreaming.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && ${_.InlineHintWidgetIsVisible.raw} && ${_.InlineChatIsVisible.not}`},o.KeybindingScope.USER))),ue.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+y",args:!0,priority:100,when:`editorTextFocus && ${_.InlineDiffPartialEditsIsVisible.raw}`}),ue.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+n",args:!1,priority:100,when:`editorTextFocus && ${_.InlineDiffPartialEditsIsVisible.raw}`})}};t.AINativeBrowserContribution=q,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IBrowserCtxMenu),n.__metadata("design:type",m.IBrowserCtxMenu)],q.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(Z.AINativeCoreContribution),n.__metadata("design:type",Object)],q.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(Z.MCPServerContribution),n.__metadata("design:type",Object)],q.prototype,"mcpServerContributions",void 0),n.__decorate([(0,r.Autowired)(Z.TokenMCPServerRegistry),n.__metadata("design:type",Object)],q.prototype,"mcpServerRegistry",void 0),n.__decorate([(0,r.Autowired)(p.InlineChatFeatureRegistryToken),n.__metadata("design:type",V.InlineChatFeatureRegistry)],q.prototype,"inlineChatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],q.prototype,"chatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ChatRenderRegistryToken),n.__metadata("design:type",Object)],q.prototype,"chatRenderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ResolveConflictRegistryToken),n.__metadata("design:type",Object)],q.prototype,"resolveConflictRegistry",void 0),n.__decorate([(0,r.Autowired)(p.RenameCandidatesProviderRegistryToken),n.__metadata("design:type",Object)],q.prototype,"renameCandidatesProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.TerminalRegistryToken),n.__metadata("design:type",Object)],q.prototype,"terminalProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(p.IntelligentCompletionsRegistryToken),n.__metadata("design:type",Object)],q.prototype,"intelligentCompletionsRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ProblemFixRegistryToken),n.__metadata("design:type",Object)],q.prototype,"problemFixProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],q.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(v.DesignLayoutConfig),n.__metadata("design:type",v.DesignLayoutConfig)],q.prototype,"designLayoutConfig",void 0),n.__decorate([(0,r.Autowired)(k.AICompletionsService),n.__metadata("design:type",k.AICompletionsService)],q.prototype,"aiCompletionsService",void 0),n.__decorate([(0,r.Autowired)(O.AIInlineCompletionsProvider),n.__metadata("design:type",O.AIInlineCompletionsProvider)],q.prototype,"aiInlineCompletionsProvider",void 0),n.__decorate([(0,r.Autowired)(p.CommandService),n.__metadata("design:type",Object)],q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],q.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],q.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(u.IMainLayoutService),n.__metadata("design:type",Object)],q.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(y.ChatProxyServiceToken),n.__metadata("design:type",w.ChatProxyService)],q.prototype,"chatProxyService",void 0),n.__decorate([(0,r.Autowired)(o.IAIInlineChatService),n.__metadata("design:type",H.InlineChatService)],q.prototype,"aiInlineChatService",void 0),n.__decorate([(0,r.Autowired)(ie.InlineInputService),n.__metadata("design:type",ie.InlineInputService)],q.prototype,"inlineInputService",void 0),n.__decorate([(0,r.Autowired)(he.InlineStreamDiffService),n.__metadata("design:type",he.InlineStreamDiffService)],q.prototype,"inlineStreamDiffService",void 0),n.__decorate([(0,r.Autowired)(B.RenameSingleHandler),n.__metadata("design:type",B.RenameSingleHandler)],q.prototype,"renameSingleHandler",void 0),n.__decorate([(0,r.Autowired)(P.CodeActionSingleHandler),n.__metadata("design:type",P.CodeActionSingleHandler)],q.prototype,"codeActionSingleHandler",void 0),n.__decorate([(0,r.Autowired)(y.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],q.prototype,"sumiMCPServerBackendProxy",void 0),n.__decorate([(0,r.Autowired)(p.MCPConfigServiceToken),n.__metadata("design:type",G.MCPConfigService)],q.prototype,"mcpConfigService",void 0),n.__decorate([(0,r.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",h.WorkbenchEditorServiceImpl)],q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(y.IChatManagerService),n.__metadata("design:type",D.ChatManagerService)],q.prototype,"chatManagerService",void 0),n.__decorate([(0,r.Autowired)(y.IChatInternalService),n.__metadata("design:type",T.ChatInternalService)],q.prototype,"chatInternalService",void 0),n.__decorate([(0,r.Autowired)(Q.BaseApplyService),n.__metadata("design:type",Q.BaseApplyService)],q.prototype,"applyService",void 0),n.__decorate([(0,r.Autowired)(p.StorageProvider),n.__metadata("design:type",Function)],q.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",S.ChatEditSchemeDocumentProvider)],q.prototype,"chatEditResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",I.ChatMultiDiffResolver)],q.prototype,"chatMultiDiffResolver",void 0),t.AINativeBrowserContribution=q=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.BrowserEditorContribution,o.CommandContribution,c.SettingContribution,o.KeybindingContribution,o.ComponentContribution,o.SlotRendererContribution,o.MonacoContribution,a.MultiDiffSourceContribution),n.__metadata("design:paramtypes",[])],q)},96366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplyService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),_=e(19413),v=e(73974),m=e(51081);let p=class extends v.BaseApplyService{async doApply(g){const a=new o.URI(o.path.join(this.appConfig.workspaceDir,g.relativePath)),u=(await this.modelService.createModelReference(a)).instance.getMonacoModel().getValue();return{stream:await this.aiBackService.requestStream(`Merge all changes from the <update> snippet into the <code> below.
31689
31689
  - Preserve the code's structure, order, comments, and indentation exactly.
31690
31690
  - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
31691
31691
  - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
@@ -31819,7 +31819,7 @@ ${A.slice(1).join(`
31819
31819
  `).slice(c.startPosition.row);return`${f[0].slice(c.startPosition.column)}${f.length>1?`
31820
31820
  ${f.slice(1).join(`
31821
31821
  `)}`:""}`}}return a.text}findTypeIdentifier(a){let h=a;for(;h;){if(h.type==="type_identifier")return h.text;const u=h.child(1);if(!u)break;h=u}return""}async extractImportPaths(a){var h;const u=[],c=await this.parser.parse(a),E=c?.rootNode,f=[],d=[];if(E)for(let y=0;y<E?.childCount;y++){const b=E.child(y);if(b?.type==="import_statement")f.push(b);else if(b?.type==="type_annotation"){const A=b.child(1);A&&d.push(A.text)}else if(b?.type==="lexical_declaration"){const A=this.findTypeIdentifier(b);A&&d.push(A)}}for(const y of f)if(d.some(b=>y.text.includes(b))){let b=(h=y.child(3))===null||h===void 0?void 0:h.text;(b?.includes("'")||b?.includes('"'))&&(b=b.slice(1,-1)),b&&u.push(b)}return u}async extractInterfaceOrTypeCode(a){var h;const u=[];if(this.language==="typescript"){await this.parserLoaded.promise;const c=(h=this.parser)===null||h===void 0?void 0:h.parse(a),E=c?.rootNode;if(E)for(let f=0;f<E?.childCount;f++){const d=E.child(f);if(d?.type==="export_statement"){const y=d.child(1);(y?.type==="interface_declaration"||y?.type==="type_alias_declaration")&&u.push(y.text)}else(d?.type==="interface_declaration"||d?.type==="type_alias_declaration")&&u.push(d.text)}}return u}async findSyntaxErrorCount(a){var h;await this.parserLoaded.promise;const u=(h=this.parser)===null||h===void 0?void 0:h.parse(a),c=u?.rootNode;if(!c)return 0;let E=0;const f=d=>{(d.type==="function_declaration"||d.type==="class_declaration"||d.type==="variable_declarator"||d.type==="statement_block"||d.type==="expression_statement")&&(d.hasError||d.isMissing||d.type==="ERROR")&&E++;for(let b=0;b<d.childCount;b++){const A=d.child(b);A&&f(A)}};return f(c),E}async findNearestCodeBlockWithPosition(a,h){const u=await this.parser.parse(a);if(u){const{rootNode:c}=u,E=c.namedDescendantForIndex(h),f=this.findContainingCodeBlockWithPosition(E,h);if(!f)return null;let y=a.split(`
31822
- `).slice(0,f.startPosition.row).reduce((b,A)=>b+A.length,0);return y+=f.startPosition.row,y+=f.startPosition.column,{codeBlock:f.text,range:{start:{line:f.startPosition.row,character:0},end:{line:f.endPosition.row,character:1/0}},offset:y,type:f.startPosition.row===f.endPosition.row?_.NearestCodeBlockType.Line:_.NearestCodeBlockType.Block}}return null}dispose(){this.parser.delete(),this.lruCache.clear()}};t.LanguageParser=s,n.__decorate([(0,o.Autowired)(p.WasmModuleManager),n.__metadata("design:type",p.WasmModuleManager)],s.prototype,"wasmModuleManager",void 0),n.__decorate([(0,o.Autowired)(m.TreeSitterLanguageFacts),n.__metadata("design:type",m.TreeSitterLanguageFacts)],s.prototype,"languageFacts",void 0),t.LanguageParser=s=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],s)},85679:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParserService=void 0;const n=e(85608),r=e(76003),o=e(3073),l=e(22486);let _=class{constructor(){this.pool=new Map}createParser(m){const p=l.parserNameMap[m];if(p)return this.pool.has(p)||this.pool.set(p,this.injector.get(o.LanguageParser,[p])),this.pool.get(p)}dispose(){this.pool.forEach(m=>m.dispose()),this.pool.clear()}};t.LanguageParserService=_,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],_.prototype,"injector",void 0),t.LanguageParserService=_=n.__decorate([(0,r.Injectable)()],_)},53374:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toMonacoRange=e;function e(n){return{startLineNumber:n.startPosition.row+1,startColumn:n.startPosition.column+1,endLineNumber:n.endPosition.row+1,endColumn:n.endPosition.column+1}}},19584:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GolangLanguageFacts=void 0;const e=["function_declaration","method_declaration","block","if_statement","else_statement","switch_statement","case_clause","for_statement","range_clause","type_switch_statement","type_case_clause","comm_clause","select_statement","go_statement","defer_statement"],n=new Set(e);class r{constructor(){this.name="go",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return n}isCodeBlock(l){return n.has(l)}}t.GolangLanguageFacts=r},22486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeSitterLanguageFacts=t.knownLanguageFacts=void 0;const n=e(85608);n.__exportStar(e(17973),t);const r=e(76003),o=e(19584),l=e(44606),_=e(82381),v=e(41486),m=e(98588),p=e(96436),s=e(2349),g=e(78542),a=new Set;t.knownLanguageFacts=[o.GolangLanguageFacts,l.JavaLanguageFacts,_.JavaScriptLanguageFacts,v.JavaScriptReactLanguageFacts,m.PythonLanguageFacts,p.RustLanguageFacts,s.TypeScriptLanguageFacts,g.TypeScriptReactLanguageFacts];let h=class{constructor(){this.langs=new Map,t.knownLanguageFacts.forEach(c=>{const E=new c;this.langs.set(E.name,E)})}isCodeBlock(c,E){const f=this.langs.get(c);return f&&f.isCodeBlock?f.isCodeBlock(E):!1}isFunctionCodeBlock(c,E){const f=this.langs.get(c);return f&&f.isFunctionCodeBlocks?f.isFunctionCodeBlocks(E):!1}provideFunctionInfo(c,E){const f=this.langs.get(c);return f&&f.provideFunctionInfo?f.provideFunctionInfo(E):null}getCodeBlockTypes(c){const E=this.langs.get(c);return E?E.provideCodeBlocks():a}};t.TreeSitterLanguageFacts=h,t.TreeSitterLanguageFacts=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},44606:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaLanguageFacts=void 0;const e=["compilation_unit","class_declaration","interface_declaration","enum_declaration","method_declaration","constructor_declaration","block","static_initializer","instance_initializer","if_statement","switch_statement","while_statement","do_statement","for_statement","enhanced_for_statement","try_statement","catch_clause","finally_clause"],n=new Set(["method_declaration","constructor_declaration"]),r=new Set(e);class o{constructor(){this.name="java",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}isFunctionCodeBlocks(_){return n.has(_)}}t.JavaLanguageFacts=o},82381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptLanguageFacts=t.functionBlockCodeTypes=t.javascriptBlockCodeTypes=void 0;const n=e(53374);t.javascriptBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","method_definition","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","try_statement","catch_clause","block","export_statement","lexical_declaration"],t.functionBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","method_definition"];const r=new Set(t.functionBlockCodeTypes),o=new Set(t.javascriptBlockCodeTypes);class l{constructor(){this.name="javascript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return o}isCodeBlock(v){return o.has(v)}isFunctionCodeBlocks(v){return r.has(v)}provideFunctionInfo(v){var m,p,s;switch(v.type){case"function_declaration":case"function_expression":return{infoCategory:"function",type:v.type,name:((m=v.firstNamedChild)===null||m===void 0?void 0:m.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var a;return((a=g.firstChild)===null||a===void 0?void 0:a.text)||""}),range:(0,n.toMonacoRange)(v)};case"arrow_function":{const g=v.parent;return g&&g.type==="variable_declarator"&&g.parent&&(g.parent.type==="lexical_declaration"||g.parent.type==="export_statement"||g.parent.type==="variable_declaration")?{infoCategory:"function",type:v.type,name:((p=g.firstChild)===null||p===void 0?void 0:p.text)||"",signatures:v.children.filter(a=>a.type==="parameter").map(a=>{var h;return((h=a.firstChild)===null||h===void 0?void 0:h.text)||""}),range:(0,n.toMonacoRange)(g.parent)}:null}case"method_definition":return{infoCategory:"function",type:v.type,name:((s=v.firstNamedChild)===null||s===void 0?void 0:s.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var a;return((a=g.firstChild)===null||a===void 0?void 0:a.text)||""}),range:(0,n.toMonacoRange)(v)}}return null}}t.JavaScriptLanguageFacts=l},41486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptReactLanguageFacts=t.javascriptreactBlockCodeTypes=void 0;const n=e(82381);t.javascriptreactBlockCodeTypes=[...n.javascriptBlockCodeTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.javascriptreactBlockCodeTypes);class o{constructor(){this.name="jsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}}t.JavaScriptReactLanguageFacts=o},98588:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonLanguageFacts=t.pythonBlockCodeTypes=void 0,t.pythonBlockCodeTypes=["function_definition","class_definition","compound_statement","if_statement","elif_clause","else_clause","for_statement","while_statement","try_statement","except_clause","with_statement","decorated_definition"];const e=new Set(t.pythonBlockCodeTypes);class n{constructor(){this.name="python",this.listCommentStyle="# ",this.blockCommentStyle={start:"'''",end:"'''",linePrefix:""}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.PythonLanguageFacts=n},96436:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RustLanguageFacts=t.rustBlockCodeTypes=void 0,t.rustBlockCodeTypes=["function_item","impl_item","trait_item","block","if_expression","match_expression","while_expression","loop_expression","for_expression","closure_expression","struct_item","enum_item","union_item","mod_item"];const e=new Set(t.rustBlockCodeTypes);class n{constructor(){this.name="rust",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.RustLanguageFacts=n},17973:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserIdentifierMap=t.parserNameMap=void 0;const r=e(85608).__importDefault(e(19891)),o={typescript:"typescript",typescriptreact:"tsx",javascript:"javascript",javascriptreact:"jsx",rust:"rust",python:"python",java:"java",go:"go"};t.parserNameMap=o,t.parserIdentifierMap=(0,r.default)(t.parserNameMap)},2349:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptLanguageFacts=t.typescriptBlockTypes=void 0,t.typescriptBlockTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","interface_declaration","method_definition","method_signature","enum_declaration","type_alias_declaration","lexical_declaration","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","for_of_statement","try_statement","catch_clause","block","module","public_field_definition","private_field_definition","export_statement"];const e=new Set(t.typescriptBlockTypes);class n{constructor(){this.name="typescript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.TypeScriptLanguageFacts=n},78542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptReactLanguageFacts=t.typescriptreactBlockTypes=void 0;const n=e(2349);t.typescriptreactBlockTypes=[...n.typescriptBlockTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.typescriptreactBlockTypes);class o{constructor(){this.name="tsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}}t.TypeScriptReactLanguageFacts=o},67045:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WasmModuleManager=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),l=e(6858),_=e(70392);let v=class{async resolveResourceUri(){const p=await this.rendererRuntime.provideResourceUri(l.EKnownResources.TreeSitterWasmDirectory);this.resolvedResourceUriDeferred.resolve(p)}constructor(){this.resolvedResourceUriDeferred=new _.Deferred,this.cachedRuntime=new Map,this.parserInitialized=!1,this.resolveResourceUri()}async initParser(){const p=await this.resolvedResourceUriDeferred.promise;let s;return p.endsWith("/")?s=`${p}tree-sitter.wasm`:s=`${p}/tree-sitter.wasm`,this.parserInitialized||(await r.default.init({locateFile:()=>s}),this.parserInitialized=!0),new r.default}async loadLanguage(p){if(!this.cachedRuntime.has(p)){const s=new _.Deferred;this.cachedRuntime.set(p,s);const g=await this.resolvedResourceUriDeferred.promise;let a;g.endsWith("/")?a=`${g}tree-sitter-${p}.wasm`:a=`${g}/tree-sitter-${p}.wasm`,fetch(a).then(h=>h.arrayBuffer()).then(h=>{s.resolve(h)})}return this.cachedRuntime.get(p).promise}};t.WasmModuleManager=v,n.__decorate([(0,o.Autowired)(l.RendererRuntime),n.__metadata("design:type",l.RendererRuntime)],v.prototype,"rendererRuntime",void 0),t.WasmModuleManager=v=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],v)},4972:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIRightTabRenderer=t.AILeftTabRenderer=t.AIChatTabRendererWithTab=t.AIChatTabRenderer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(89195),v=e(1149),m=e(43718),p=e(11090),s=e(63067),g=e(46245),a=e(66368),h=e(19951),u=e(752),c=e(19413),E=n.__importDefault(e(87708)),f=()=>o.default.createElement("div",{style:{width:0}},o.default.createElement(g.TabbarViewBase,{tabSize:0,MoreTabView:g.IconElipses,TabView:g.IconTabView,barSize:0,panelBorderSize:1})),d=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:c.AI_CHAT_VIEW_ID,direction:"left-to-right",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${c.AI_CHAT_VIEW_ID}-slot`),components:I,TabbarView:()=>o.default.createElement(f,null),TabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:a.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRenderer=d;const y=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:c.AI_CHAT_VIEW_ID,direction:"right-to-left",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${c.AI_CHAT_VIEW_ID}-slot`,"design_right_slot"),components:I,TabbarView:()=>o.default.createElement(g.ChatTabbarRenderer2,null),TabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:a.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRendererWithTab=y;const b=({className:D,components:I})=>o.default.createElement(p.DesignLeftTabRenderer,{className:D,components:I,tabbarView:A});t.AILeftTabRenderer=b;const A=()=>{const D=(0,l.useInjectable)(s.IMainLayoutService),I=(0,l.useInjectable)(u.TabbarServiceFactory)(l.SlotLocation.extendView),w=(0,l.useAutorun)(I.currentContainerId),T=o.default.useMemo(()=>D.getExtraMenu(),[D]),[R]=(0,l.useContextMenus)(T),P=(0,o.useCallback)(({renderContainers:O})=>{const M=I.visibleContainers.filter(k=>{var F;return!(!((F=k.options)===null||F===void 0)&&F.hideTab)});return o.default.createElement(o.default.Fragment,null,M.length>0&&o.default.createElement(_.HorizontalVertical,{margin:"8px auto 0px",width:"60%"}),M.map(k=>O(k,I,w)))},[w,I]);return o.default.createElement(g.LeftTabbarRenderer,{renderOtherVisibleContainers:P,isRenderExtraTopMenus:!1,renderExtraMenus:o.default.createElement("div",{className:E.default.extra_bottom_icon_container},R.length>=0?R.map(O=>o.default.createElement(_.EnhanceIconWithCtxMenu,{key:O.id,id:O.id,wrapperClassName:E.default.extra_bottom_icon,iconClass:O.icon,menuNodes:O.children,skew:{x:-8,y:-4}})):null)})},S=({components:D})=>{const I=(0,l.useInjectable)(u.TabbarServiceFactory)(l.SlotLocation.extendView),w=(0,l.useInjectable)(v.DesignLayoutConfig),T=(0,o.useCallback)(()=>{I.updateCurrentContainerId("")},[]),R=(0,o.useCallback)(O=>{const{component:M}=O,{options:k}=M;return o.default.createElement(a.ContainerView,{...O,customTitleBar:o.default.createElement("div",{className:E.default.header},o.default.createElement("span",{className:E.default.title},k&&k.title),o.default.createElement("div",{className:E.default.side},o.default.createElement(_.EnhancePopover,{id:"ai_right_panel_header_close",title:(0,m.localize)("editor.title.context.close")},o.default.createElement(_.EnhanceIcon,{icon:"close",onClick:T})))),renderContainerWrap:({children:F})=>o.default.createElement("div",{className:E.default.right_slot_container_wrap},o.default.createElement("div",{className:E.default.container},F))})},[]),P=(0,o.useMemo)(()=>w.useMergeRightWithLeftPanel?E.default.right_tab_renderer:"",[w]);return o.default.createElement(p.DesignRightTabRenderer,{components:D,className:P,tabbarView:()=>o.default.createElement(g.RightTabbarRenderer,{barSize:0,style:{width:0}}),tabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:R})})};t.AIRightTabRenderer=S},82983:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIChatLogoAvatar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(89195),_=e(63067),v=e(19413),m=n.__importDefault(e(88473)),p=()=>{const s=(0,o.useInjectable)(_.IMainLayoutService),g=r.default.useCallback(()=>{s.toggleSlot(v.AI_CHAT_VIEW_ID)},[s]);return r.default.createElement("div",{className:m.default.ai_switch,onClick:g},r.default.createElement(l.AILogoAvatar,{iconClassName:m.default.avatar_icon_large}))};t.AIChatLogoAvatar=p},73974:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseApplyService=void 0;const n=e(85608),r=e(41429),o=e(76003),l=e(41869),_=e(54414),v=e(57517),m=e(55126),p=e(20868),s=e(70392),g=e(2261),a=e(19413),h=e(59347),u=e(40111),c=e(15989);class E extends l.WithEventBus{constructor(){super(),this.onCodeBlockUpdateEmitter=new s.Emitter,this.onCodeBlockUpdate=this.onCodeBlockUpdateEmitter.event,this.activePreviewerMap=this.registerDispose(new s.DisposableMap),this.editorListenerMap=this.registerDispose(new s.DisposableMap),this.addDispose(this.chatInternalService.onCancelRequest(()=>{const d=this.chatInternalService.sessionModel.history.lastMessageId;if(!d)return;const y=this.getMessageCodeBlocks(d);y&&Object.values(y).forEach(b=>{this.cancelApply(b)})})),this.currentSessionId=this.chatInternalService.sessionModel.sessionId,this.addDispose(this.chatInternalService.onChangeSession(d=>{d!==this.currentSessionId&&(this.cancelAllApply(),this.currentSessionId=d)})),this.addDispose(this.chatInternalService.onRegenerateRequest(()=>{const d=this.chatInternalService.sessionModel.history.getMessages(),y=d[d.length-1].id,b=this.getMessageCodeBlocks(y);b&&Object.values(b).forEach(A=>{this.cancelApply(A)})})),this.addDispose(this.chatInternalService.onWillClearSession(d=>{this.cancelAllApply(d)}))}getMessageCodeBlocks(d,y){y=y||this.chatInternalService.sessionModel.sessionId;const b=this.chatInternalService.getSession(y);if(!b)throw new Error(`Session ${y} not found`);const A=b.history.getMessageAdditional(d);return A?.codeBlockMap}onEditorGroupClose(d){const y=s.path.relative(this.appConfig.workspaceDir,d.payload.resource.uri.path.toString());this.activePreviewerMap.get(y)&&this.activePreviewerMap.disposeKey(y),this.editorListenerMap.disposeKey(d.payload.resource.uri.toString())}async onEditorGroupOpen(d){var y;const b=s.path.relative(this.appConfig.workspaceDir,d.payload.resource.uri.path.toString());if(this.duringApply||this.activePreviewerMap.has(b)||!this.chatInternalService.sessionModel.history.getMessages().length)return;const A=((y=this.getUriCodeBlocks(d.payload.resource.uri))===null||y===void 0?void 0:y.filter(S=>S.status==="pending"))||[];if(A.length>0&&A[0].updatedCode){const S=d.payload.group.codeEditor.monacoEditor;await this.renderApplyResult(S,A[0],A[0].updatedCode)}}get currentPreviewer(){var d;const y=(d=this.editorService.currentEditor)===null||d===void 0?void 0:d.currentUri;if(y)return this.activePreviewerMap.get(s.path.relative(this.appConfig.workspaceDir,y.path.toString()))}getUriCodeBlocks(d){const y=this.getSessionCodeBlocks(),b=s.path.relative(this.appConfig.workspaceDir,d.path.toString());return y.filter(A=>A.relativePath===b).sort((A,S)=>S.version-A.version)}getPendingPaths(d){return this.getSessionCodeBlocks(d).filter(b=>b.status==="pending").map(b=>b.relativePath)}getSessionCodeBlocks(d){const y=d?this.chatInternalService.getSession(d):this.chatInternalService.sessionModel;if(!y)throw new Error(`Session ${d} not found`);const b=y.history.sessionAdditionals;return Array.from(b.values()).map(A=>A.codeBlockMap||{}).reduce((A,S)=>(Object.values(S).forEach(D=>{A.push(D)}),A),[])}getCodeBlock(d,y){if(y=y||this.chatInternalService.sessionModel.history.lastMessageId,!y)throw new Error("Message ID is required");const b=this.getMessageCodeBlocks(y);if(b)return b[d]}updateCodeBlock(d){const y=d.messageId,b=this.getMessageCodeBlocks(y);if(!b)throw new Error("Code block not found");b[d.toolCallId]=d,this.chatInternalService.sessionModel.history.setMessageAdditional(y,{codeBlockMap:b}),this.onCodeBlockUpdateEmitter.fire(d)}async registerCodeBlock(d,y,b,A){var S,D;const I=this.chatInternalService.sessionModel.history.lastMessageId,w=this.getUriCodeBlocks(s.URI.file(s.path.join(this.appConfig.workspaceDir,d))),T=await this.editorDocumentModelService.createModelReference(s.URI.file(s.path.join(this.appConfig.workspaceDir,d))),R={codeEdit:y,relativePath:d,status:"generating",iterationCount:1,version:1,createdAt:Date.now(),toolCallId:b,messageId:I,instructions:A,originalCode:T.instance.getText()};if(w?.length){R.version=w.length+1;for(const O of w)if(O.relativePath===d&&(!((D=(S=O.applyResult)===null||S===void 0?void 0:S.diagnosticInfos)===null||D===void 0)&&D.length))R.iterationCount++;else break}const P=this.getMessageCodeBlocks(I)||{};return P[b]=R,this.chatInternalService.sessionModel.history.setMessageAdditional(I,{codeBlockMap:P}),this.onCodeBlockUpdateEmitter.fire(R),R}async apply(d){try{if(this.duringApply=!0,d.iterationCount>3)throw new Error("Lint error max iteration count exceeded");const y=d.originalCode?await this.doApply(d):{result:d.codeEdit};if(!y.stream&&!y.result)return d.status="failed",this.updateCodeBlock(d),d;this.activePreviewerMap.has(d.relativePath)&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)).toString()),this.activePreviewerMap.disposeKey(d.relativePath));const b=await this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)));if(!b)throw new Error("Failed to open file");const A=await this.renderApplyResult(b.group.codeEditor.monacoEditor,d,y.result||y.stream,y.range);return d.updatedCode=A.updatedCode,d.status="pending",d.applyResult=A.result,this.updateCodeBlock(d),d}catch(y){throw d.status="failed",this.updateCodeBlock(d),y}finally{this.duringApply=!1}}async renderApplyResult(d,y,b,A){var S,D,I;const w=new s.Deferred,T=c.InlineDiffController.get(d);if(A=A||d.getModel().getFullModelRange(),typeof b=="string"){const R=b,P=d.getModel().getValue(),O=s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)),M=this.editorDocumentModelService.getModelReference(O);(P!==R||M?.instance.dirty)&&((S=d.getModel())===null||S===void 0||S.pushEditOperations([],[g.EditOperation.replace(A,R)],()=>null),await this.editorService.save(O));const k=(D=this.getUriCodeBlocks(O))===null||D===void 0?void 0:D.filter(j=>j.status==="pending"),F=k?.[k.length-1];if(((I=F||y)===null||I===void 0?void 0:I.originalCode)===R)throw new Error("No changes applied");const L=T.createDiffPreviewer(d,p.Selection.fromRange(A,p.SelectionDirection.LTR),{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!0,reverse:!0});this.activePreviewerMap.set(y.relativePath,L),L.setValue(F?.originalCode||y.originalCode||`
31822
+ `).slice(0,f.startPosition.row).reduce((b,A)=>b+A.length,0);return y+=f.startPosition.row,y+=f.startPosition.column,{codeBlock:f.text,range:{start:{line:f.startPosition.row,character:0},end:{line:f.endPosition.row,character:1/0}},offset:y,type:f.startPosition.row===f.endPosition.row?_.NearestCodeBlockType.Line:_.NearestCodeBlockType.Block}}return null}dispose(){this.parser.delete(),this.lruCache.clear()}};t.LanguageParser=s,n.__decorate([(0,o.Autowired)(p.WasmModuleManager),n.__metadata("design:type",p.WasmModuleManager)],s.prototype,"wasmModuleManager",void 0),n.__decorate([(0,o.Autowired)(m.TreeSitterLanguageFacts),n.__metadata("design:type",m.TreeSitterLanguageFacts)],s.prototype,"languageFacts",void 0),t.LanguageParser=s=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],s)},85679:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParserService=void 0;const n=e(85608),r=e(76003),o=e(3073),l=e(22486);let _=class{constructor(){this.pool=new Map}createParser(m){const p=l.parserNameMap[m];if(p)return this.pool.has(p)||this.pool.set(p,this.injector.get(o.LanguageParser,[p])),this.pool.get(p)}dispose(){this.pool.forEach(m=>m.dispose()),this.pool.clear()}};t.LanguageParserService=_,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],_.prototype,"injector",void 0),t.LanguageParserService=_=n.__decorate([(0,r.Injectable)()],_)},53374:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toMonacoRange=e;function e(n){return{startLineNumber:n.startPosition.row+1,startColumn:n.startPosition.column+1,endLineNumber:n.endPosition.row+1,endColumn:n.endPosition.column+1}}},19584:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GolangLanguageFacts=void 0;const e=["function_declaration","method_declaration","block","if_statement","else_statement","switch_statement","case_clause","for_statement","range_clause","type_switch_statement","type_case_clause","comm_clause","select_statement","go_statement","defer_statement"],n=new Set(e);class r{constructor(){this.name="go",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return n}isCodeBlock(l){return n.has(l)}}t.GolangLanguageFacts=r},22486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeSitterLanguageFacts=t.knownLanguageFacts=void 0;const n=e(85608);n.__exportStar(e(17973),t);const r=e(76003),o=e(19584),l=e(44606),_=e(82381),v=e(41486),m=e(98588),p=e(96436),s=e(2349),g=e(78542),a=new Set;t.knownLanguageFacts=[o.GolangLanguageFacts,l.JavaLanguageFacts,_.JavaScriptLanguageFacts,v.JavaScriptReactLanguageFacts,m.PythonLanguageFacts,p.RustLanguageFacts,s.TypeScriptLanguageFacts,g.TypeScriptReactLanguageFacts];let h=class{constructor(){this.langs=new Map,t.knownLanguageFacts.forEach(c=>{const E=new c;this.langs.set(E.name,E)})}isCodeBlock(c,E){const f=this.langs.get(c);return f&&f.isCodeBlock?f.isCodeBlock(E):!1}isFunctionCodeBlock(c,E){const f=this.langs.get(c);return f&&f.isFunctionCodeBlocks?f.isFunctionCodeBlocks(E):!1}provideFunctionInfo(c,E){const f=this.langs.get(c);return f&&f.provideFunctionInfo?f.provideFunctionInfo(E):null}getCodeBlockTypes(c){const E=this.langs.get(c);return E?E.provideCodeBlocks():a}};t.TreeSitterLanguageFacts=h,t.TreeSitterLanguageFacts=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},44606:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaLanguageFacts=void 0;const e=["compilation_unit","class_declaration","interface_declaration","enum_declaration","method_declaration","constructor_declaration","block","static_initializer","instance_initializer","if_statement","switch_statement","while_statement","do_statement","for_statement","enhanced_for_statement","try_statement","catch_clause","finally_clause"],n=new Set(["method_declaration","constructor_declaration"]),r=new Set(e);class o{constructor(){this.name="java",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}isFunctionCodeBlocks(_){return n.has(_)}}t.JavaLanguageFacts=o},82381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptLanguageFacts=t.functionBlockCodeTypes=t.javascriptBlockCodeTypes=void 0;const n=e(53374);t.javascriptBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","method_definition","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","try_statement","catch_clause","block","export_statement","lexical_declaration"],t.functionBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","method_definition"];const r=new Set(t.functionBlockCodeTypes),o=new Set(t.javascriptBlockCodeTypes);class l{constructor(){this.name="javascript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return o}isCodeBlock(v){return o.has(v)}isFunctionCodeBlocks(v){return r.has(v)}provideFunctionInfo(v){var m,p,s;switch(v.type){case"function_declaration":case"function_expression":return{infoCategory:"function",type:v.type,name:((m=v.firstNamedChild)===null||m===void 0?void 0:m.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var a;return((a=g.firstChild)===null||a===void 0?void 0:a.text)||""}),range:(0,n.toMonacoRange)(v)};case"arrow_function":{const g=v.parent;return g&&g.type==="variable_declarator"&&g.parent&&(g.parent.type==="lexical_declaration"||g.parent.type==="export_statement"||g.parent.type==="variable_declaration")?{infoCategory:"function",type:v.type,name:((p=g.firstChild)===null||p===void 0?void 0:p.text)||"",signatures:v.children.filter(a=>a.type==="parameter").map(a=>{var h;return((h=a.firstChild)===null||h===void 0?void 0:h.text)||""}),range:(0,n.toMonacoRange)(g.parent)}:null}case"method_definition":return{infoCategory:"function",type:v.type,name:((s=v.firstNamedChild)===null||s===void 0?void 0:s.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var a;return((a=g.firstChild)===null||a===void 0?void 0:a.text)||""}),range:(0,n.toMonacoRange)(v)}}return null}}t.JavaScriptLanguageFacts=l},41486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptReactLanguageFacts=t.javascriptreactBlockCodeTypes=void 0;const n=e(82381);t.javascriptreactBlockCodeTypes=[...n.javascriptBlockCodeTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.javascriptreactBlockCodeTypes);class o{constructor(){this.name="jsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}}t.JavaScriptReactLanguageFacts=o},98588:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonLanguageFacts=t.pythonBlockCodeTypes=void 0,t.pythonBlockCodeTypes=["function_definition","class_definition","compound_statement","if_statement","elif_clause","else_clause","for_statement","while_statement","try_statement","except_clause","with_statement","decorated_definition"];const e=new Set(t.pythonBlockCodeTypes);class n{constructor(){this.name="python",this.listCommentStyle="# ",this.blockCommentStyle={start:"'''",end:"'''",linePrefix:""}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.PythonLanguageFacts=n},96436:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RustLanguageFacts=t.rustBlockCodeTypes=void 0,t.rustBlockCodeTypes=["function_item","impl_item","trait_item","block","if_expression","match_expression","while_expression","loop_expression","for_expression","closure_expression","struct_item","enum_item","union_item","mod_item"];const e=new Set(t.rustBlockCodeTypes);class n{constructor(){this.name="rust",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.RustLanguageFacts=n},17973:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserIdentifierMap=t.parserNameMap=void 0;const r=e(85608).__importDefault(e(19891)),o={typescript:"typescript",typescriptreact:"tsx",javascript:"javascript",javascriptreact:"jsx",rust:"rust",python:"python",java:"java",go:"go"};t.parserNameMap=o,t.parserIdentifierMap=(0,r.default)(t.parserNameMap)},2349:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptLanguageFacts=t.typescriptBlockTypes=void 0,t.typescriptBlockTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","interface_declaration","method_definition","method_signature","enum_declaration","type_alias_declaration","lexical_declaration","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","for_of_statement","try_statement","catch_clause","block","module","public_field_definition","private_field_definition","export_statement"];const e=new Set(t.typescriptBlockTypes);class n{constructor(){this.name="typescript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.TypeScriptLanguageFacts=n},78542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptReactLanguageFacts=t.typescriptreactBlockTypes=void 0;const n=e(2349);t.typescriptreactBlockTypes=[...n.typescriptBlockTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.typescriptreactBlockTypes);class o{constructor(){this.name="tsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(_){return r.has(_)}}t.TypeScriptReactLanguageFacts=o},67045:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WasmModuleManager=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),l=e(6858),_=e(70392);let v=class{async resolveResourceUri(){const p=await this.rendererRuntime.provideResourceUri(l.EKnownResources.TreeSitterWasmDirectory);this.resolvedResourceUriDeferred.resolve(p)}constructor(){this.resolvedResourceUriDeferred=new _.Deferred,this.cachedRuntime=new Map,this.parserInitialized=!1,this.resolveResourceUri()}async initParser(){const p=await this.resolvedResourceUriDeferred.promise;let s;return p.endsWith("/")?s=`${p}tree-sitter.wasm`:s=`${p}/tree-sitter.wasm`,this.parserInitialized||(await r.default.init({locateFile:()=>s}),this.parserInitialized=!0),new r.default}async loadLanguage(p){if(!this.cachedRuntime.has(p)){const s=new _.Deferred;this.cachedRuntime.set(p,s);const g=await this.resolvedResourceUriDeferred.promise;let a;g.endsWith("/")?a=`${g}tree-sitter-${p}.wasm`:a=`${g}/tree-sitter-${p}.wasm`,fetch(a).then(h=>h.arrayBuffer()).then(h=>{s.resolve(h)})}return this.cachedRuntime.get(p).promise}};t.WasmModuleManager=v,n.__decorate([(0,o.Autowired)(l.RendererRuntime),n.__metadata("design:type",l.RendererRuntime)],v.prototype,"rendererRuntime",void 0),t.WasmModuleManager=v=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],v)},4972:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIRightTabRenderer=t.AILeftTabRenderer=t.AIChatTabRendererWithTab=t.AIChatTabRenderer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(89195),v=e(1149),m=e(43718),p=e(11090),s=e(63067),g=e(46245),a=e(66368),h=e(19951),u=e(752),c=e(19413),E=n.__importDefault(e(87708)),f=()=>o.default.createElement("div",{style:{width:0}},o.default.createElement(g.TabbarViewBase,{tabSize:0,MoreTabView:g.IconElipses,TabView:g.IconTabView,barSize:0,panelBorderSize:0})),d=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:c.AI_CHAT_VIEW_ID,direction:"left-to-right",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${c.AI_CHAT_VIEW_ID}-slot`),components:I,TabbarView:()=>o.default.createElement(f,null),TabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:a.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRenderer=d;const y=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:c.AI_CHAT_VIEW_ID,direction:"right-to-left",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${c.AI_CHAT_VIEW_ID}-slot`,"design_right_slot"),components:I,TabbarView:()=>o.default.createElement(g.ChatTabbarRenderer2,null),TabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:a.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRendererWithTab=y;const b=({className:D,components:I})=>o.default.createElement(p.DesignLeftTabRenderer,{className:D,components:I,tabbarView:A});t.AILeftTabRenderer=b;const A=()=>{const D=(0,l.useInjectable)(s.IMainLayoutService),I=(0,l.useInjectable)(u.TabbarServiceFactory)(l.SlotLocation.extendView),w=(0,l.useAutorun)(I.currentContainerId),T=o.default.useMemo(()=>D.getExtraMenu(),[D]),[R]=(0,l.useContextMenus)(T),P=(0,o.useCallback)(({renderContainers:O})=>{const M=I.visibleContainers.filter(k=>{var F;return!(!((F=k.options)===null||F===void 0)&&F.hideTab)});return o.default.createElement(o.default.Fragment,null,M.length>0&&o.default.createElement(_.HorizontalVertical,{margin:"8px auto 0px",width:"60%"}),M.map(k=>O(k,I,w)))},[w,I]);return o.default.createElement(g.LeftTabbarRenderer,{renderOtherVisibleContainers:P,isRenderExtraTopMenus:!1,renderExtraMenus:o.default.createElement("div",{className:E.default.extra_bottom_icon_container},R.length>=0?R.map(O=>o.default.createElement(_.EnhanceIconWithCtxMenu,{key:O.id,id:O.id,wrapperClassName:E.default.extra_bottom_icon,iconClass:O.icon,menuNodes:O.children,skew:{x:-8,y:-4}})):null)})},S=({components:D})=>{const I=(0,l.useInjectable)(u.TabbarServiceFactory)(l.SlotLocation.extendView),w=(0,l.useInjectable)(v.DesignLayoutConfig),T=(0,o.useCallback)(()=>{I.updateCurrentContainerId("")},[]),R=(0,o.useCallback)(O=>{const{component:M}=O,{options:k}=M;return o.default.createElement(a.ContainerView,{...O,customTitleBar:o.default.createElement("div",{className:E.default.header},o.default.createElement("span",{className:E.default.title},k&&k.title),o.default.createElement("div",{className:E.default.side},o.default.createElement(_.EnhancePopover,{id:"ai_right_panel_header_close",title:(0,m.localize)("editor.title.context.close")},o.default.createElement(_.EnhanceIcon,{icon:"close",onClick:T})))),renderContainerWrap:({children:F})=>o.default.createElement("div",{className:E.default.right_slot_container_wrap},o.default.createElement("div",{className:E.default.container},F))})},[]),P=(0,o.useMemo)(()=>w.useMergeRightWithLeftPanel?E.default.right_tab_renderer:"",[w]);return o.default.createElement(p.DesignRightTabRenderer,{components:D,className:P,tabbarView:()=>o.default.createElement(g.RightTabbarRenderer,{barSize:0,style:{width:0}}),tabpanelView:()=>o.default.createElement(a.BaseTabPanelView,{PanelView:R})})};t.AIRightTabRenderer=S},82983:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIChatLogoAvatar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(89195),_=e(63067),v=e(19413),m=n.__importDefault(e(88473)),p=()=>{const s=(0,o.useInjectable)(_.IMainLayoutService),g=r.default.useCallback(()=>{s.toggleSlot(v.AI_CHAT_VIEW_ID)},[s]);return r.default.createElement("div",{className:m.default.ai_switch,onClick:g},r.default.createElement(l.AILogoAvatar,{iconClassName:m.default.avatar_icon_large}))};t.AIChatLogoAvatar=p},73974:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseApplyService=void 0;const n=e(85608),r=e(41429),o=e(76003),l=e(41869),_=e(54414),v=e(57517),m=e(55126),p=e(20868),s=e(70392),g=e(2261),a=e(19413),h=e(59347),u=e(40111),c=e(15989);class E extends l.WithEventBus{constructor(){super(),this.onCodeBlockUpdateEmitter=new s.Emitter,this.onCodeBlockUpdate=this.onCodeBlockUpdateEmitter.event,this.activePreviewerMap=this.registerDispose(new s.DisposableMap),this.editorListenerMap=this.registerDispose(new s.DisposableMap),this.addDispose(this.chatInternalService.onCancelRequest(()=>{const d=this.chatInternalService.sessionModel.history.lastMessageId;if(!d)return;const y=this.getMessageCodeBlocks(d);y&&Object.values(y).forEach(b=>{this.cancelApply(b)})})),this.currentSessionId=this.chatInternalService.sessionModel.sessionId,this.addDispose(this.chatInternalService.onChangeSession(d=>{d!==this.currentSessionId&&(this.cancelAllApply(),this.currentSessionId=d)})),this.addDispose(this.chatInternalService.onRegenerateRequest(()=>{const d=this.chatInternalService.sessionModel.history.getMessages(),y=d[d.length-1].id,b=this.getMessageCodeBlocks(y);b&&Object.values(b).forEach(A=>{this.cancelApply(A)})})),this.addDispose(this.chatInternalService.onWillClearSession(d=>{this.cancelAllApply(d)}))}getMessageCodeBlocks(d,y){y=y||this.chatInternalService.sessionModel.sessionId;const b=this.chatInternalService.getSession(y);if(!b)throw new Error(`Session ${y} not found`);const A=b.history.getMessageAdditional(d);return A?.codeBlockMap}onEditorGroupClose(d){const y=s.path.relative(this.appConfig.workspaceDir,d.payload.resource.uri.path.toString());this.activePreviewerMap.get(y)&&this.activePreviewerMap.disposeKey(y),this.editorListenerMap.disposeKey(d.payload.resource.uri.toString())}async onEditorGroupOpen(d){var y;const b=s.path.relative(this.appConfig.workspaceDir,d.payload.resource.uri.path.toString());if(this.duringApply||this.activePreviewerMap.has(b)||!this.chatInternalService.sessionModel.history.getMessages().length)return;const A=((y=this.getUriCodeBlocks(d.payload.resource.uri))===null||y===void 0?void 0:y.filter(S=>S.status==="pending"))||[];if(A.length>0&&A[0].updatedCode){const S=d.payload.group.codeEditor.monacoEditor;await this.renderApplyResult(S,A[0],A[0].updatedCode)}}get currentPreviewer(){var d;const y=(d=this.editorService.currentEditor)===null||d===void 0?void 0:d.currentUri;if(y)return this.activePreviewerMap.get(s.path.relative(this.appConfig.workspaceDir,y.path.toString()))}getUriCodeBlocks(d){const y=this.getSessionCodeBlocks(),b=s.path.relative(this.appConfig.workspaceDir,d.path.toString());return y.filter(A=>A.relativePath===b).sort((A,S)=>S.version-A.version)}getPendingPaths(d){return this.getSessionCodeBlocks(d).filter(b=>b.status==="pending").map(b=>b.relativePath)}getSessionCodeBlocks(d){const y=d?this.chatInternalService.getSession(d):this.chatInternalService.sessionModel;if(!y)throw new Error(`Session ${d} not found`);const b=y.history.sessionAdditionals;return Array.from(b.values()).map(A=>A.codeBlockMap||{}).reduce((A,S)=>(Object.values(S).forEach(D=>{A.push(D)}),A),[])}getCodeBlock(d,y){if(y=y||this.chatInternalService.sessionModel.history.lastMessageId,!y)throw new Error("Message ID is required");const b=this.getMessageCodeBlocks(y);if(b)return b[d]}updateCodeBlock(d){const y=d.messageId,b=this.getMessageCodeBlocks(y);if(!b)throw new Error("Code block not found");b[d.toolCallId]=d,this.chatInternalService.sessionModel.history.setMessageAdditional(y,{codeBlockMap:b}),this.onCodeBlockUpdateEmitter.fire(d)}async registerCodeBlock(d,y,b,A){var S,D;const I=this.chatInternalService.sessionModel.history.lastMessageId,w=this.getUriCodeBlocks(s.URI.file(s.path.join(this.appConfig.workspaceDir,d))),T=await this.editorDocumentModelService.createModelReference(s.URI.file(s.path.join(this.appConfig.workspaceDir,d))),R={codeEdit:y,relativePath:d,status:"generating",iterationCount:1,version:1,createdAt:Date.now(),toolCallId:b,messageId:I,instructions:A,originalCode:T.instance.getText()};if(w?.length){R.version=w.length+1;for(const O of w)if(O.relativePath===d&&(!((D=(S=O.applyResult)===null||S===void 0?void 0:S.diagnosticInfos)===null||D===void 0)&&D.length))R.iterationCount++;else break}const P=this.getMessageCodeBlocks(I)||{};return P[b]=R,this.chatInternalService.sessionModel.history.setMessageAdditional(I,{codeBlockMap:P}),this.onCodeBlockUpdateEmitter.fire(R),R}async apply(d){try{if(this.duringApply=!0,d.iterationCount>3)throw new Error("Lint error max iteration count exceeded");const y=d.originalCode?await this.doApply(d):{result:d.codeEdit};if(!y.stream&&!y.result)return d.status="failed",this.updateCodeBlock(d),d;this.activePreviewerMap.has(d.relativePath)&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)).toString()),this.activePreviewerMap.disposeKey(d.relativePath));const b=await this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)));if(!b)throw new Error("Failed to open file");const A=await this.renderApplyResult(b.group.codeEditor.monacoEditor,d,y.result||y.stream,y.range);return d.updatedCode=A.updatedCode,d.status="pending",d.applyResult=A.result,this.updateCodeBlock(d),d}catch(y){throw d.status="failed",this.updateCodeBlock(d),y}finally{this.duringApply=!1}}async renderApplyResult(d,y,b,A){var S,D,I;const w=new s.Deferred,T=c.InlineDiffController.get(d);if(A=A||d.getModel().getFullModelRange(),typeof b=="string"){const R=b,P=d.getModel().getValue(),O=s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)),M=this.editorDocumentModelService.getModelReference(O);(P!==R||M?.instance.dirty)&&((S=d.getModel())===null||S===void 0||S.pushEditOperations([],[g.EditOperation.replace(A,R)],()=>null),await this.editorService.save(O));const k=(D=this.getUriCodeBlocks(O))===null||D===void 0?void 0:D.filter(j=>j.status==="pending"),F=k?.[k.length-1];if(((I=F||y)===null||I===void 0?void 0:I.originalCode)===R)throw new Error("No changes applied");const L=T.createDiffPreviewer(d,p.Selection.fromRange(A,p.SelectionDirection.LTR),{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!0,reverse:!0});this.activePreviewerMap.set(y.relativePath,L),L.setValue(F?.originalCode||y.originalCode||`
31823
31823
  `),this.eventBus.fire(new v.RegisterEditorSideComponentEvent),this.listenPartialEdit(d.getModel(),y).then(j=>{j&&(y.applyResult=j),this.updateCodeBlock(y),this.editorService.save(s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)))});const{diff:B,rangesFromDiffHunk:U}=this.getDiffResult(y.originalCode,R,y.relativePath),W=this.getDiagnosticInfos(d.getModel().uri.toString(),U);w.resolve({result:{diff:B,diagnosticInfos:W},updatedCode:R})}else{const R=new u.InlineChatController;R.mountReadable(b);const P=T.showPreviewerByStream(d,{crossSelection:p.Selection.fromRange(A,p.SelectionDirection.LTR),chatResponse:R,previewerOptions:{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!1}});this.addDispose(R.onError(O=>{w.reject(O)})),this.addDispose(R.onAbort(()=>{w.reject(new Error("Apply aborted"))})),this.addDispose(P.getNode().onDiffFinished(async O=>{const M=O.newFullRangeTextLines.join(`
31824
31824
  `);if(y.originalCode===M){P.dispose(),w.reject(new Error("no changes applied"));return}P.dispose();try{const k=await this.renderApplyResult(d,y,M);w.resolve(k)}catch(k){w.reject(k)}})),this.activePreviewerMap.set(y.relativePath,P)}return w.promise}cancelApply(d,y){var b,A;(d.status==="generating"||d.status==="pending")&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)).toString()),this.activePreviewerMap.has(d.relativePath)&&((A=(b=this.activePreviewerMap.get(d.relativePath))===null||b===void 0?void 0:b.getNode())===null||A===void 0||A.livePreviewDiffDecorationModel.discardUnProcessed(),this.activePreviewerMap.disposeKey(d.relativePath)),d.status="cancelled",this.updateCodeBlock(d))}cancelAllApply(d){this.getSessionCodeBlocks(d).forEach(b=>{this.cancelApply(b)})}revealApplyPosition(d){var y;const b=(y=d.applyResult)===null||y===void 0?void 0:y.diff.split(`
31825
31825
  `).find(I=>I.startsWith("@@"));let A=0,S=0;if(b){const[,,,I,w]=b.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);A=parseInt(I,10)-1,S=parseInt(w,10)-1}this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,d.relativePath)));const D=this.editorService.currentEditor;D&&D.setSelection(new p.Selection(A,0,S,0))}async processAll(d,y){var b;const A=y?(b=this.getUriCodeBlocks(y))===null||b===void 0?void 0:b.filter(w=>w.status==="pending"):this.getSessionCodeBlocks().filter(w=>w.status==="pending");if(!A?.length)throw new Error("No pending code block found");const S=y?[A[0].relativePath]:A.map(w=>w.relativePath).reduce((w,T)=>(w.includes(T)||w.push(T),w),[]),D=this.editorService.getAllOpenedUris(),I=S.filter(w=>!D.some(T=>T.codeUri.fsPath.endsWith(w))).map(w=>s.URI.file(s.path.join(this.appConfig.workspaceDir,w)));I.length&&await this.editorService.openUris(I),S.forEach(w=>{this.doProcess(d,w)}),A.forEach(w=>{w.status=d==="accept"?"success":"cancelled",this.updateCodeBlock(w)})}doProcess(d,y){var b,A;const S=(A=(b=this.activePreviewerMap.get(y))===null||b===void 0?void 0:b.getNode())===null||A===void 0?void 0:A.livePreviewDiffDecorationModel;if(!S)throw new Error("No active previewer found");d==="accept"?S.acceptUnProcessed():S.discardUnProcessed(),this.editorService.save(s.URI.file(s.path.join(this.appConfig.workspaceDir,y)))}listenPartialEdit(d,y){const b=new s.Deferred,A=d.uri.toString(),S=this.inlineDiffService.onPartialEdit(D=>{if(D.totalPartialEditCount===D.resolvedPartialEditCount&&D.uri.path===d.uri.path.toString()){if(D.acceptPartialEditCount>0){y.status="success";const I=d.getValue(),{diff:w,rangesFromDiffHunk:T}=this.getDiffResult(y.originalCode,I,y.relativePath),R=this.getDiagnosticInfos(d.uri.toString(),T);this.aiReporter.send({msgType:l.AIServiceType.Chat,actionType:l.ActionTypeEnum.Accept,actionSource:l.ActionSourceEnum.Chat,sessionId:this.chatInternalService.sessionModel.sessionId,isReceive:!0,isDrop:D.acceptPartialEditCount!==D.totalPartialEditCount,code:I,originCode:y.originalCode,message:JSON.stringify({diff:w,diagnosticInfos:R,instructions:y.instructions,codeEdit:y.codeEdit,partialEditCount:D.totalPartialEditCount,acceptPartialEditCount:D.acceptPartialEditCount,addedLinesCount:D.totalAddedLinesCount,deletedLinesCount:D.totalDeletedLinesCount})}),b.resolve({diff:w,diagnosticInfos:R})}else y.status="cancelled",b.resolve(),this.aiReporter.send({msgType:l.AIServiceType.Chat,actionType:l.ActionTypeEnum.Discard,actionSource:l.ActionSourceEnum.Chat,sessionId:this.chatInternalService.sessionModel.sessionId,isReceive:!1,isDrop:!0,originCode:y.originalCode,message:JSON.stringify({instructions:y.instructions,codeEdit:y.codeEdit})});this.editorListenerMap.disposeKey(A)}});return this.editorListenerMap.set(A,S),b.promise}getDiffResult(d,y,b){const A=(0,r.createPatch)(b,d,y).split(`
@@ -32208,7 +32208,7 @@ your modifications. Are you sure to regenerate?`,"aiNative.resolve.conflict.mess
32208
32208
 
32209
32209
  \u662F\u5426\u8981\u9000\u51FA?`,"authentication.signOutMessageSimple":"\u662F\u5426\u8981\u9000\u51FA {0}?","authentication.useOtherAccount":"\u4F7F\u7528\u5176\u4ED6\u8D26\u6237\u767B\u5F55","authentication.selectAccount":"\u6269\u5C55 '{0}' \u5C06\u8981\u8BBF\u95EE {1} \u8D26\u6237","authentication.getSessionPlaceholder":"\u9009\u62E9\u4E00\u4E2A\u8D26\u6237\u7ED9 '{0}' \u4F7F\u7528","authentication.confirmAuthenticationAccess":"\u6269\u5C55 '{0}' \u5C06\u8981\u4F7F\u7528 '{2}' \u8BBF\u95EE {1}","authentication.confirmLogin":"\u6269\u5C55 '{0}' \u5C06\u8981\u4F7F\u7528 {1} \u767B\u5F55","authentication.confirmReLogin":"\u6269\u5C55 '{0}' \u5C06\u8981\u4F7F\u7528 {1} \u518D\u6B21\u767B\u5F55","authentication.signInRequests":"\u767B\u5F55 {0}","authentication.signOut":"\u9000\u51FA {0}","authentication.noAccounts":"\u76EE\u524D\u6CA1\u6709\u767B\u5F55\u4EFB\u4F55\u8D26\u6237","authentication.signedOut":"\u6210\u529F\u9000\u51FA","refactoring-changes.ask.1.create":"\u6269\u5C55 '{0} ' \u5E0C\u671B\u901A\u8FC7\u65B0\u5EFA\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.1.copy":"\u6269\u5C55 '{0} ' \u5E0C\u671B\u901A\u8FC7\u590D\u5236\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.1.move":"\u6269\u5C55 '{0} ' \u5E0C\u671B\u901A\u8FC7\u79FB\u52A8\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.1.delete":"\u6269\u5C55 '{0} ' \u5E0C\u671B\u901A\u8FC7\u5220\u9664\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.N.create":"{0} \u4E2A\u63D2\u4EF6\u5E0C\u671B\u901A\u8FC7\u65B0\u5EFA\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.N.copy":"{0} \u4E2A\u63D2\u4EF6\u5E0C\u671B\u901A\u8FC7\u590D\u5236\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.N.move":"{0} \u4E2A\u63D2\u4EF6\u5E0C\u671B\u901A\u8FC7\u79FB\u52A8\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.ask.N.delete":"{0} \u4E2A\u63D2\u4EF6\u5E0C\u671B\u901A\u8FC7\u5220\u9664\u6B64\u6587\u4EF6\u6765\u8FDB\u884C\u91CD\u6784\u66F4\u6539","refactoring-changes.msg.showPreview":"\u663E\u793A\u9884\u89C8","refactoring-changes.msg.skipChanges":"\u8DF3\u8FC7\u66F4\u6539","keyboard.chooseKeyboardLayout":"\u9009\u62E9\u5E03\u5C40\u6587\u4EF6\u914D\u7F6E","keyboard.autoDetect.label":"\u81EA\u52A8\u68C0\u6D4B","keyboard.autoDetect.description":"\uFF08\u5F53\u524D\uFF1A'{0} '\uFF09","keyboard.autoDetect.detail":"\u5C1D\u8BD5\u901A\u8FC7\u6D4F\u89C8\u5668\u53CA\u6309\u952E\u4FE1\u606F\u8FDB\u884C\u5E03\u5C40\u81EA\u52A8\u68C0\u6D4B","editor.configuration.suggest.filterGraceful":"\u63A7\u5236\u5BF9\u5EFA\u8BAE\u7684\u7B5B\u9009\u548C\u6392\u5E8F\u662F\u5426\u8003\u8651\u5C0F\u7684\u62FC\u5199\u9519\u8BEF\u3002","editor.configuration.suggest.insertMode":"\u63A7\u5236\u63A5\u53D7\u8865\u5168\u65F6\u662F\u5426\u8986\u76D6\u5355\u8BCD\u3002\u8BF7\u6CE8\u610F\uFF0C\u8FD9\u53D6\u51B3\u4E8E\u6269\u5C55\u9009\u62E9\u4F7F\u7528\u6B64\u529F\u80FD\u3002","editor.configuration.suggest.insertMode.insert":"\u63D2\u5165\u5EFA\u8BAE\u800C\u4E0D\u8986\u76D6\u5149\u6807\u53F3\u4FA7\u7684\u6587\u672C\u3002","editor.configuration.suggest.insertMode.replace":"\u63D2\u5165\u5EFA\u8BAE\u5E76\u8986\u76D6\u5149\u6807\u53F3\u4FA7\u7684\u6587\u672C\u3002","editor.configuration.suggest.localityBonus":"\u63A7\u5236\u6392\u5E8F\u65F6\u662F\u5426\u9996\u9009\u5149\u6807\u9644\u8FD1\u7684\u5B57\u8BCD\u3002","editor.configuration.suggest.maxVisibleSuggestions.dep":"\u6B64\u8BBE\u7F6E\u5DF2\u5F03\u7528\u3002\u73B0\u5728\u53EF\u4EE5\u8C03\u6574\u5EFA\u8BAE\u5C0F\u7EC4\u4EF6\u7684\u5927\u5C0F\u3002","editor.configuration.suggest.preview":"\u63A7\u5236\u662F\u5426\u5728\u7F16\u8F91\u5668\u4E2D\u9884\u89C8\u5EFA\u8BAE\u7ED3\u679C\u3002","editor.configuration.suggest.shareSuggestSelections":"\u63A7\u5236\u662F\u5426\u5728\u591A\u4E2A\u5DE5\u4F5C\u533A\u548C\u7A97\u53E3\u95F4\u5171\u4EAB\u8BB0\u5FC6\u7684\u5EFA\u8BAE\u9009\u9879(\u9700\u8981 `#editor.suggestSelection#`)\u3002","editor.configuration.suggest.showIcons":"\u63A7\u5236\u662F\u5426\u5728\u5EFA\u8BAE\u4E2D\u663E\u793A\u6216\u9690\u85CF\u56FE\u6807\u3002","editor.configuration.suggest.showInlineDetails":"\u63A7\u5236\u5EFA\u8BAE\u8BE6\u7EC6\u4FE1\u606F\u662F\u968F\u6807\u7B7E\u4E00\u8D77\u663E\u793A\u8FD8\u662F\u4EC5\u663E\u793A\u5728\u8BE6\u7EC6\u4FE1\u606F\u5C0F\u7EC4\u4EF6\u4E2D","editor.configuration.suggest.showStatusBar":"\u63A7\u5236\u5EFA\u8BAE\u5C0F\u90E8\u4EF6\u5E95\u90E8\u7684\u72B6\u6001\u680F\u7684\u53EF\u89C1\u6027\u3002","editor.configuration.suggest.snippetsPreventQuickSuggestions":"\u63A7\u5236\u6D3B\u52A8\u4EE3\u7801\u6BB5\u662F\u5426\u963B\u6B62\u5FEB\u901F\u5EFA\u8BAE\u3002","editor.configuration.suggestFontSize":"\u5EFA\u8BAE\u5C0F\u90E8\u4EF6\u7684\u5B57\u53F7\u3002\u5982\u679C\u8BBE\u7F6E\u4E3A `0`\uFF0C\u5219\u4F7F\u7528 `#editor.fontSize#` \u7684\u503C\u3002","editor.configuration.suggestLineHeight":"\u5EFA\u8BAE\u5C0F\u90E8\u4EF6\u7684\u884C\u9AD8\u3002\u5982\u679C\u8BBE\u7F6E\u4E3A `0`\uFF0C\u5219\u4F7F\u7528 `#editor.lineHeight#` \u7684\u503C\u3002\u6700\u5C0F\u503C\u4E3A 8\u3002","editor.configuration.suggestOnTriggerCharacters":"\u63A7\u5236\u5728\u952E\u5165\u89E6\u53D1\u5B57\u7B26\u540E\u662F\u5426\u81EA\u52A8\u663E\u793A\u5EFA\u8BAE\u3002","editor.configuration.acceptSuggestionOnEnterSmart":"\u4EC5\u5728\u5EFA\u8BAE\u505A\u51FA\u6587\u672C\u66F4\u6539\u65F6\uFF0C\u624D\u4F7F\u7528 `Enter` \u63A5\u53D7\u5EFA\u8BAE\u3002","editor.configuration.acceptSuggestionOnEnter":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5426\u5E94\u8BE5\u5728 `Tab` \u952E\u4E4B\u5916\uFF0C\u8FD8\u4F7F\u7528 `Enter` \u952E\u6765\u63A5\u53D7\u5EFA\u8BAE\u3002\u8FD9\u6709\u52A9\u4E8E\u907F\u514D\u5728\u63D2\u5165\u65B0\u884C\u6216\u63A5\u53D7\u5EFA\u8BAE\u4E4B\u95F4\u7684\u6B67\u4E49\u3002","editor.configuration.acceptSuggestionOnCommitCharacter":"\u63A7\u5236\u662F\u5426\u5728\u4F7F\u7528\u63D0\u4EA4\u5B57\u7B26\u65F6\u63A5\u53D7\u5EFA\u8BAE\u3002\u4F8B\u5982\uFF0C\u5728 JavaScript \u4E2D\uFF0C\u5206\u53F7 (`;`) \u662F\u4E00\u4E2A\u63D0\u4EA4\u5B57\u7B26\uFF0C\u53EF\u4EE5\u63A5\u53D7\u4E00\u4E2A\u5EFA\u8BAE\u5E76\u952E\u5165\u8BE5\u5B57\u7B26\u3002","editor.configuration.snippetSuggestions.top":"\u5C06\u4EE3\u7801\u7247\u6BB5\u7684\u5EFA\u8BAE\u653E\u5728\u5176\u4ED6\u5EFA\u8BAE\u7684\u9876\u90E8\u3002","editor.configuration.snippetSuggestions.bottom":"\u5C06\u4EE3\u7801\u7247\u6BB5\u7684\u5EFA\u8BAE\u653E\u5728\u5176\u4ED6\u5EFA\u8BAE\u7684\u5E95\u90E8\u3002","editor.configuration.snippetSuggestions.inline":"\u5C06\u4EE3\u7801\u7247\u6BB5\u7684\u5EFA\u8BAE\u6DF7\u5408\u5728\u5176\u4ED6\u5EFA\u8BAE\u7684\u4E2D\u95F4\u3002","editor.configuration.snippetSuggestions.none":"\u4E0D\u5C55\u793A\u4EE3\u7801\u7247\u6BB5\u5EFA\u8BAE\u3002","editor.configuration.snippetSuggestions":"\u63A7\u5236\u4EE3\u7801\u7247\u6BB5\u662F\u5426\u4E0E\u5176\u4ED6\u5EFA\u8BAE\u4E00\u540C\u663E\u793A\u4EE5\u53CA\u5B83\u4EEC\u7684\u6392\u5E8F\u65B9\u5F0F\u3002","editor.configuration.wordBasedSuggestions":"\u63A7\u5236\u662F\u5426\u6839\u636E\u6587\u6863\u4E2D\u7684\u5B57\u8BCD\u8BA1\u7B97\u81EA\u52A8\u8865\u5168\u5217\u8868\u3002","editor.configuration.suggestSelection":"\u63A7\u5236\u5728\u5EFA\u8BAE\u5217\u8868\u4E2D\u5982\u4F55\u9884\u5148\u9009\u62E9\u5EFA\u8BAE\u3002","editor.configuration.suggestSelection.first":"\u59CB\u7EC8\u9009\u62E9\u7B2C\u4E00\u4E2A\u5EFA\u8BAE\u3002","editor.configuration.suggestSelection.recentlyUsed":"\u9009\u62E9\u6700\u8FD1\u7684\u5EFA\u8BAE\uFF0C\u9664\u975E\u8FDB\u4E00\u6B65\u952E\u5165\u9009\u62E9\u5176\u4ED6\u9879\u3002\u4F8B\u5982 `console. -> console.log`\uFF0C\u56E0\u4E3A\u6700\u8FD1\u8865\u5168\u8FC7 `log`\u3002","editor.configuration.suggestSelection.recentlyUsedByPrefix":"\u6839\u636E\u4E4B\u524D\u8865\u5168\u8FC7\u7684\u5EFA\u8BAE\u7684\u524D\u7F00\u6765\u8FDB\u884C\u9009\u62E9\u3002\u4F8B\u5982\uFF0C`co -> console`\u3001`con -> const`\u3002","editor.configuration.tabCompletion":"\u542F\u7528 Tab \u8865\u5168\u3002","editor.configuration.tabCompletion.off":"\u7981\u7528 Tab \u8865\u5168\u3002","editor.configuration.tabCompletion.on":"\u5728\u6309\u4E0B Tab \u952E\u65F6\u8FDB\u884C Tab \u8865\u5168\uFF0C\u5C06\u63D2\u5165\u6700\u4F73\u5339\u914D\u5EFA\u8BAE\u3002","editor.configuration.tabCompletion.onlySnippets":'\u5728\u524D\u7F00\u5339\u914D\u65F6\u8FDB\u884C Tab \u8865\u5168\u3002\u5728 "quickSuggestions" \u672A\u542F\u7528\u65F6\u4F53\u9A8C\u6700\u597D\u3002',"editor.configuration.editor.guides.bracketPairs":"\u63A7\u5236\u662F\u5426\u542F\u7528\u62EC\u53F7\u5BF9\u6307\u5357\u3002","editor.configuration.editor.guides.bracketPairsHorizontal":"\u63A7\u5236\u662F\u5426\u542F\u7528\u6C34\u5E73\u62EC\u53F7\u5BF9\u6307\u5357\u3002","editor.configuration.renderLineHighlight":"\u63A7\u5236\u7F16\u8F91\u5668\u7684\u5F53\u524D\u884C\u8FDB\u884C\u9AD8\u4EAE\u663E\u793A\u7684\u65B9\u5F0F\u3002","editor.configuration.renderLineHighlight.all":"\u540C\u65F6\u7A81\u51FA\u663E\u793A\u5BFC\u822A\u7EBF\u548C\u5F53\u524D\u884C\u3002","editor.configuration.renderLineHighlightOnlyWhenFocus":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5426\u4EC5\u5728\u7126\u70B9\u5728\u7F16\u8F91\u5668\u65F6\u7A81\u51FA\u663E\u793A\u5F53\u524D\u884C\u3002","editor.configuration.codeLens":"\u63A7\u5236\u662F\u5426\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A CodeLens\u3002","editor.configuration.suggest.showClasss":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u7C7B\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showColors":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u989C\u8272\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showConstants":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5E38\u91CF\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showConstructors":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u6784\u9020\u51FD\u6570\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showCustomcolors":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u81EA\u5B9A\u4E49\u989C\u8272\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showDeprecated":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5DF2\u542F\u7528\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showEnumMembers":'\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A "enumMember" \u5EFA\u8BAE\u3002',"editor.configuration.suggest.showEnums":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u679A\u4E3E\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showEvents":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u4E8B\u4EF6\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showFields":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5B57\u6BB5\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showFiles":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u6587\u4EF6\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showFolders":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u6587\u4EF6\u5939\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showFunctions":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u51FD\u6570\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showInterfaces":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u63A5\u53E3\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showIssues":'\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A"\u95EE\u9898"\u5EFA\u8BAE\u3002',"editor.configuration.suggest.showKeywords":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5173\u952E\u5B57\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showMethods":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u65B9\u6CD5\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showModules":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u6A21\u5757\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showOperators":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u64CD\u4F5C\u7B26\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showPropertys":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5C5E\u6027\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showReferences":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u53C2\u8003\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showSnippets":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u7247\u6BB5\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showStructs":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u7ED3\u6784\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showTexts":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u6587\u672C\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showTypeParameters":'\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A "typeParameter" \u5EFA\u8BAE\u3002',"editor.configuration.suggest.showUnits":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u5355\u4F4D\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showUsers":'\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A"\u7528\u6237"\u5EFA\u8BAE\u3002',"editor.configuration.suggest.showValues":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u503C\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.showVariables":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u663E\u793A\u201C\u53D8\u91CF\u201D\u5EFA\u8BAE\u3002","editor.configuration.suggest.maxVisibleSuggestions":"\u63A7\u5236 IntelliSense \u5728\u663E\u793A\u6EDA\u52A8\u6761\u4E4B\u524D\u5C06\u663E\u793A\u7684\u5EFA\u8BAE\u6570\u91CF\uFF08\u6700\u591A 15 \u4E2A\uFF09\u3002","editor.configuration.suggest.details.visible":"\u63A7\u5236\u7F16\u8F91\u5668\u4EE3\u7801\u8865\u5168\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\u8BE6\u60C5\u4FE1\u606F","editor.configuration.suggest.filtered":"\u63A7\u5236\u662F\u5426\u5E94\u4ECE IntelliSense \u4E2D\u8FC7\u6EE4\u6389\u67D0\u4E9B\u5EFA\u8BAE\u7C7B\u578B\u3002\u53EF\u4EE5\u5728\u6B64\u5904\u627E\u5230\u4E00\u4EFD\u5EFA\u8BAE\u7C7B\u578B\u5217\u8868: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions.","editor.configuration.suggest.filtered.method":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `method` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.function":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `function` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.constructor":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `constructor` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.field":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `field` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.variable":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `variable` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.class":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `class` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.struct":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `struct` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.interface":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `interface` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.module":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `module` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.property":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `property` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.event":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `event` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.operator":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `operator` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.unit":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `unit` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.value":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `value` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.constant":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `constant` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.enum":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `enum` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.enumMember":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `enumMember` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.keyword":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `keyword` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.text":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `text` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.color":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `color` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.file":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `file` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.reference":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `reference` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.customcolor":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `customcolor` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.folder":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `folder` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.typeParameter":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `typeParameter` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.suggest.filtered.snippet":"\u542F\u7528\u540E\uFF0CIntelliSense \u5C06\u4F1A\u5C55\u793A `snippet` \u7C7B\u578B\u7684\u5EFA\u8BAE\u3002","editor.configuration.editor.gotoLocation.multiple":'\u63A7\u5236 "\u8F6C\u5230" \u547D\u4EE4\uFF08\u4F8B\u5982\u8F6C\u5230\u5B9A\u4E49\uFF09\u5728\u5B58\u5728\u591A\u4E2A\u76EE\u6807\u4F4D\u7F6E\u65F6\u7684\u884C\u4E3A\u3002',"editor.configuration.gotoLocation.multiple.peek":"\u5728\u901F\u89C8\u89C6\u56FE(Peek View)\u4E2D\u663E\u793A\u7ED3\u679C\u3002(\u9ED8\u8BA4)","editor.configuration.gotoLocation.multiple.gotoAndPeek":"\u8F6C\u5230\u4E3B\u7ED3\u679C\u5E76\u663E\u793A\u901F\u89C8\u89C6\u56FE(Peek View)\u3002","editor.configuration.gotoLocation.multiple.goto":"\u8F6C\u5230\u4E3B\u7ED3\u679C\uFF0C\u5E76\u5BF9\u5176\u4ED6\u7ED3\u679C\u542F\u7528\u65E0\u901F\u89C8\u5BFC\u822A","editor.configuration.experimental.stickyScroll.enabled":"\u5728\u7F16\u8F91\u5668\u9876\u90E8\u7684\u6EDA\u52A8\u8FC7\u7A0B\u4E2D\u663E\u793A\u5D4C\u5957\u7684\u5F53\u524D\u4F5C\u7528\u57DF\u3002","editor.configuration.maxTokenizationLineLength":"\u7531\u4E8E\u6027\u80FD\u539F\u56E0\uFF0C\u8D85\u8FC7\u8FD9\u4E2A\u957F\u5EA6\u7684\u884C\u5C06\u4E0D\u4F1A\u88AB\u6807\u8BC6\u3002","editor.configuration.codeActionsOnSave.organizeImports":"\u63A7\u5236\u662F\u5426\u5E94\u5728\u6587\u4EF6\u4FDD\u5B58\u65F6\u6574\u7406\u5BFC\u5165\uFF08Import\uFF09\u8BED\u53E5\u3002","editor.configuration.codeActionsOnSave.fixAll":"\u63A7\u5236\u662F\u5426\u5E94\u5728\u6587\u4EF6\u4FDD\u5B58\u65F6\u8FD0\u884C\u81EA\u52A8\u4FEE\u590D\u64CD\u4F5C\u3002","editor.configuration.codeActionsOnSave":"\u5728\u4FDD\u5B58\u65F6\u8FD0\u884C\u7684\u4EE3\u7801\u64CD\u4F5C\u7C7B\u578B","editor.configuration.codeActionsOnSaveTimeout":"\u5728\u6B64\u8D85\u65F6\u65F6\u95F4(\u6BEB\u79D2)\u4E4B\u540E\u4EE3\u7801\u64CD\u4F5C\u5C06\u88AB\u53D6\u6D88\u3002","editor.configuration.codeActionsOnSaveNotification":"\u4EE3\u7801\u64CD\u4F5C\u6267\u884C\u65F6\u662F\u5426\u5C55\u793A\u901A\u77E5\u4FE1\u606F","editor.configuration.quickSuggestionsDelay":"\u63A7\u5236\u663E\u793A\u667A\u80FD\u63D0\u793A\u7684\u5EF6\u8FDF\u65F6\u957F (\u6BEB\u79D2)\u3002","editor.configuration.tabSize":"\u63A7\u5236 Tab \u7F29\u8FDB\u7B49\u4E8E\u7684\u7A7A\u683C\u6570\u3002\u82E5\u542F\u7528 `#editor.detectIndentation#`\uFF0C\u8BE5\u8BBE\u7F6E\u53EF\u80FD\u4F1A\u88AB\u8986\u76D6","editor.configuration.fontWeight":'\u63A7\u5236\u5B57\u4F53\u7C97\u7EC6\uFF0C\u63A5\u6536 "normal" \u548C "bold" \u5173\u952E\u8BCD\u6216\u8005 1 \u5230 1000 \u6570\u503C\u3002',"editor.configuration.largeFileSize":"\u63A7\u5236\u8D85\u5927\u6587\u4EF6\u7684\u81EA\u5B9A\u4E49\u4F53\u79EF\u3002(\u5355\u4F4D\uFF1AB)","editor.configuration.preferredFormatter":"\u914D\u7F6E\u4F18\u5148\u4F7F\u7528\u7684\u683C\u5F0F\u5316\u5668\u3002","editor.configuration.wrapTab":"\u63A7\u5236\u5F53\u7F16\u8F91\u5668 Tab \u8D85\u8FC7\u53EF\u7528\u7A7A\u95F4\u65F6\uFF0C\u662F\u5426\u4F7F\u7528\u6362\u884C\u6765\u4EE3\u66FF\u6EDA\u52A8\u6A21\u5F0F\u3002","editor.configuration.enablePreviewFromCodeNavigation":"\u63A7\u5236\u5F53\u4EE3\u7801\u5BFC\u822A\u4ECE\u5176\u51FA\u53D1\u65F6\uFF0C\u7F16\u8F91\u5668\u662F\u5426\u4ECD\u5904\u4E8E\u9884\u89C8\u6A21\u5F0F\u3002","editor.configuration.formatOnSaveTimeout":"\u63A7\u5236\u4FDD\u5B58\u65F6\u683C\u5F0F\u5316\u7684\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\u3002\u4EC5\u5F53 `#editor.formatOnSave#` \u542F\u7528\u65F6\u751F\u6548\u3002","editor.configuration.inlineSuggest.enabled":"\u63A7\u5236\u662F\u5426\u5728\u7F16\u8F91\u5668\u4E2D\u81EA\u52A8\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u3002","editor.configuration.inlineSuggest.showToolbar":"\u63A7\u5236\u4F55\u65F6\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u5DE5\u5177\u680F\u3002","editor.configuration.inlineSuggest.showToolbar.always":"\u6BCF\u5F53\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u65F6\uFF0C\u5C31\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u5DE5\u5177\u680F\u3002","editor.configuration.inlineSuggest.showToolbar.onHover":"\u5C06\u9F20\u6807\u60AC\u505C\u5728\u5185\u8054\u5EFA\u8BAE\u4E0A\u65F6\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u5DE5\u5177\u680F\u3002","editor.configuration.inlineSuggest.showToolbar.never":"\u6C38\u4E0D\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u5DE5\u5177\u680F\u3002","editor.configuration.hover.enabled":"\u63A7\u5236\u662F\u5426\u5728\u7F16\u8F91\u5668\u4E2D\u542F\u7528\u4EE3\u7801\u63D0\u793A\u3002","editor.configuration.hover.delay":"\u63A7\u5236\u4EE3\u7801\u63D0\u793A\u663E\u793A\u7684\u5EF6\u8FDF\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\u3002","editor.configuration.hover.sticky":"\u63A7\u5236\u4EE3\u7801\u63D0\u793A\u662F\u5426\u5728\u9F20\u6807\u60AC\u505C\u65F6\u4FDD\u6301\u53EF\u89C1\u3002","editor.configuration.hover.hidingDelay":"\u63A7\u5236\u4EE3\u7801\u63D0\u793A\u9690\u85CF\u7684\u5EF6\u8FDF\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\u3002\u9700\u8981 `editor.hover.sticky` \u8BBE\u7F6E\u4E3A true \u65F6\u751F\u6548\u3002","editor.configuration.hover.above":"\u4F18\u5148\u663E\u793A\u4EE3\u7801\u63D0\u793A\u5728\u884C\u4E0A\u65B9\uFF0C\u5982\u679C\u884C\u6709\u7A7A\u95F4\u3002","editor.configuration.autoSave":"\u63A7\u5236\u5982\u4F55\u81EA\u52A8\u4FDD\u5B58\u6587\u4EF6\u3002","editor.configuration.formatOnSave":"\u5728\u4FDD\u5B58\u65F6\u683C\u5F0F\u5316\u6587\u4EF6","editor.configuration.formatOnType":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5728\u952E\u5165\u540E\u81EA\u52A8\u683C\u5F0F\u5316\u8BE5\u884C\u3002","editor.configuration.formatOnPaste":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5426\u81EA\u52A8\u683C\u5F0F\u5316\u7C98\u8D34\u7684\u5185\u5BB9\u3002\u9700\u8981\u5F53\u524D\u6587\u4EF6\u6709\u4E00\u4E2A\u683C\u5F0F\u5316\u5DE5\u5177\u5E76\u4E14\u8BE5\u683C\u5F0F\u5316\u683C\u5C40\u5FC5\u987B\u80FD\u591F\u5728\u6587\u6863\u4E2D\u683C\u5F0F\u5316\u4E00\u4E2A\u8303\u56F4\u3002","editor.configuration.autoIndent":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5426\u5E94\u8BE5\u5728\u7528\u6237\u952E\u5165\u3001\u7C98\u8D34\u6216\u79FB\u52A8\u884C\u65F6\u81EA\u52A8\u8C03\u6574\u7F29\u8FDB\u3002\u5FC5\u987B\u63D0\u4F9B\u5E26\u6709\u8BE5\u8BED\u8A00\u7F29\u8FDB\u89C4\u5219\u7684\u6269\u5C55\u3002","editor.configuration.autoSaveDelay":"\u63A7\u5236\u81EA\u52A8\u4FDD\u5B58\u7684\u5EF6\u8FDF\u65F6\u957F\uFF08\u6BEB\u79D2\uFF09\u3002\u4EC5\u5F53 `#editor.autoSave#` \u8BBE\u7F6E\u4E3A\u201C\u7F16\u8F91\u540E\u81EA\u52A8\u4FDD\u5B58\u201D\u65F6\u751F\u6548\u3002","editor.configuration.askIfDiff":"\u4FDD\u5B58\u6587\u4EF6\u65F6\u5982\u679C\u78C1\u76D8\u4E0A\u7684\u6587\u4EF6\u8F83\u65B0\uFF0C\u8FDB\u884C\u63D0\u793A\u624B\u52A8\u89E3\u51B3\u4FDD\u5B58\u51B2\u7A81\u3002","editor.configuration.forceReadOnly":"\u662F\u5426\u542F\u7528 \u53EA\u8BFB\u6A21\u5F0F","editor.configuration.bracketPairColorization.enabled":"\u63A7\u5236\u662F\u5426\u542F\u7528\u62EC\u53F7\u5BF9\u7740\u8272\u3002\u4F7F\u7528 \u201Cworkbench.colorCustomizations\u201D \u66FF\u4EE3\u62EC\u53F7\u7A81\u51FA\u663E\u793A\u989C\u8272\u3002","editor.configuration.guides.bracketPairs":"\u63A7\u5236\u662F\u5426\u542F\u7528\u62EC\u53F7\u5BF9\u6307\u5357\u3002","editor.configuration.mouseBackForwardToNavigate":"\u5141\u8BB8\u4F7F\u7528\u9F20\u6807\u6309\u94AE 4 \u548C 5 \u6765\u6267\u884C\u547D\u4EE4\u201CGo Back\u201D\u548C\u201CGo Forward\u201D\u3002","editor.configuration.previewMode":"\u4F7F\u7528\u9884\u89C8\u6A21\u5F0F\u6253\u5F00","editor.configuration.tokenColorCustomizations":"\u8986\u76D6\u5F53\u524D\u6240\u9009\u989C\u8272\u4E3B\u9898\u4E2D\u7684\u7F16\u8F91\u5668\u989C\u8272\u548C\u5B57\u4F53\u6837\u5F0F","editor.configuration.workbench.editorAssociations":'\u5C06 glob \u6A21\u5F0F\u914D\u7F6E\u5230\u7F16\u8F91\u5668(\u4F8B\u5982 `"*\u5341\u516D\u8FDB\u5236": "hexEditor.hexEdit"`)\u3002\u8FD9\u4E9B\u4F18\u5148\u987A\u5E8F\u9AD8\u4E8E\u9ED8\u8BA4\u884C\u4E3A\u3002',"editor.configuration.guides.indentation":"\u63A7\u5236\u7F16\u8F91\u5668\u662F\u5426\u663E\u793A\u7F29\u8FDB\u53C2\u8003\u7EBF\u3002","editor.configuration.guides.highlightActiveIndentation":"\u63A7\u5236\u662F\u5426\u7A81\u51FA\u663E\u793A\u7F16\u8F91\u5668\u4E2D\u6D3B\u52A8\u7684\u7F29\u8FDB\u53C2\u8003\u7EBF\u3002","editor.configuration.trimAutoWhitespace":"\u5220\u9664\u81EA\u52A8\u63D2\u5165\u7684\u5C3E\u968F\u7A7A\u767D\u7B26\u53F7\u3002","editor.configuration.unicodeHighlight.ambiguousCharacters":"\u63A7\u5236\u662F\u5426\u7A81\u51FA\u663E\u793A\u53EF\u80FD\u4E0E\u57FA\u672C ASCII \u5B57\u7B26\u6DF7\u6DC6\u7684\u5B57\u7B26\uFF0C\u4F46\u5F53\u524D\u7528\u6237\u533A\u57DF\u8BBE\u7F6E\u4E2D\u5E38\u89C1\u7684\u5B57\u7B26\u9664\u5916\u3002","editor.configuration.lightbulb.enabled":"\u5728\u7F16\u8F91\u5668\u4E2D\u542F\u7528\u4EE3\u7801\u64CD\u4F5C\u83DC\u5355\u3002","editor.configuration.lightbulb.enabled.off":"\u7981\u7528\u4EE3\u7801\u64CD\u4F5C\u83DC\u5355\u3002","editor.configuration.lightbulb.enabled.onCode":"\u5F53\u5149\u6807\u4E0E\u4EE3\u7801\u4E00\u8D77\u6392\u5217\u65F6\uFF0C\u663E\u793A\u4EE3\u7801\u64CD\u4F5C\u83DC\u5355\u3002","editor.configuration.lightbulb.enabled.on":"\u5F53\u5149\u6807\u4E0E\u4EE3\u7801\u4E00\u8D77\u6392\u5217\u6216\u5728\u7A7A\u7684\u884C\u65F6\uFF0C\u663E\u793A\u4EE3\u7801\u64CD\u4F5C\u83DC\u5355\u3002","diffEditor.configuration.renderSideBySide":"\u63A7\u5236\u5DEE\u5F02\u7F16\u8F91\u5668\u7684\u663E\u793A\u65B9\u5F0F\u3002","diffEditor.configuration.ignoreTrimWhitespace":"\u542F\u7528\u540E\uFF0C\u5DEE\u5F02\u7F16\u8F91\u5668\u7684\u524D\u5BFC\u548C\u5C3E\u968F\u7A7A\u767D\u5B57\u7B26\u5C06\u4F1A\u5FFD\u7565","diffEditor.action.toggleCollapseUnchangedRegions":"\u6298\u53E0\u672A\u66F4\u6539\u7684\u4EE3\u7801\u533A\u57DF","multiDiffEditor.action.collapseFiles":"\u6298\u53E0\u6240\u6709\u6587\u4EF6","multiDiffEditor.action.expandFiles":"\u5C55\u5F00\u6240\u6709\u6587\u4EF6","inlineSuggest.enabled":"\u63A7\u5236\u662F\u5426\u5728\u7F16\u8F91\u5668\u4E2D\u81EA\u52A8\u663E\u793A\u5185\u8054\u5EFA\u8BAE\u3002","view.component.renderedError":"\u89C6\u56FE\u7EC4\u4EF6\u6E32\u67D3\u5F02\u5E38","view.component.tryAgain":"\u91CD\u65B0\u52A0\u8F7D","test.title":"\u6D4B\u8BD5\u7BA1\u7406\u5668","test.result.runFinished":"\u6D4B\u8BD5\u8FD0\u884C\u5B8C\u6210\u4E8E {0}","test.task.unnamed":"\u672A\u547D\u540D\u4EFB\u52A1","test.results":"\u6D4B\u8BD5\u7ED3\u679C","menu.missing.command":"\u83DC\u5355{0} \u8981\u6267\u884C\u7684\u547D\u4EE4\u4E0D\u5B58\u5728\uFF1A{1}","menu.missing.altCommand":"\u83DC\u5355{0} \u8981\u6267\u884C\u7684\u547D\u4EE4(altCommand)\u4E0D\u5B58\u5728\uFF1A{1}","menu.dupe.command":"\u83DC\u5355{0} command({1}) \u548C alt({2}) \u6CE8\u518C\u91CD\u590D","command.category.developerTools":"\u5F00\u53D1\u4EBA\u5458\u5DE5\u5177","connection.start.rtt":"\u67E5\u770B\u901A\u4FE1\u5EF6\u8FDF","connection.stop.rtt":"\u5173\u95ED\u901A\u4FE1\u5EF6\u8FDF\u68C0\u67E5","debug.terminal.label":"\u521B\u5EFA Javascript Debug Terminal","debug.terminal.title":"\u8C03\u8BD5\u8FDB\u7A0B","workbench.action.tasks.runTask":"\u8FD0\u884C\u4EFB\u52A1","workbench.action.tasks.reRunTask":"\u6267\u884C\u4E0A\u6B21\u8FD0\u884C\u7684\u4EFB\u52A1","workbench.action.tasks.restartTask":"\u91CD\u65B0\u5F00\u59CB\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1","workbench.action.tasks.terminate":"\u7EC8\u6B62\u4EFB\u52A1","workbench.action.tasks.showTasks":"\u5C55\u793A\u4EFB\u52A1","workbench.action.tasks.showLog":"\u5C55\u793A\u4EFB\u52A1\u65E5\u5FD7","task.contribute":"\u8D21\u732E","task.cannotFindTask":"\u672A\u627E\u5230 {0} \u7684\u4EFB\u52A1\uFF0C\u6309\u56DE\u8F66\u952E\u8FD4\u56DE","comment.reply.count":"{0} \u4E2A\u8BC4\u8BBA","comment.reply.lastReply":"\u6700\u540E\u7531 {0} \u8BC4\u8BBA","walkthroughs.welcome":"\u6B22\u8FCE\u4F7F\u7528","walkthroughs.get.started":"\u6253\u5F00 `\u5165\u95E8` \u6F14\u793A","mergeEditor.reset":"\u91CD\u7F6E","mergeEditor.workbench.tab.name":"\u6B63\u5728\u5408\u5E76: {0}","mergeEditor.conflict.action.apply.confirm.title":"\u5F53\u524D\u6587\u4EF6\u8FD8\u6709\u672A\u5904\u7406\u7684\u51B2\u7A81\u6216\u53D8\u66F4\uFF0C\u662F\u5426\u5E94\u7528\u5E76\u4FDD\u5B58\u66F4\u6539\uFF1F","mergeEditor.conflict.action.apply.confirm.continue":"\u7EE7\u7EED\u5408\u5E76","mergeEditor.conflict.action.apply.confirm.complete":"\u786E\u8BA4\u4FDD\u5B58\u5E76\u66F4\u6539","mergeEditor.action.button.apply":"\u5E94\u7528\u66F4\u6539","mergeEditor.action.button.apply-and-stash":"\u5E94\u7528\u5E76\u6682\u5B58","mergeEditor.action.button.accept.left":"\u63A5\u53D7\u5DE6\u8FB9","mergeEditor.action.button.accept.right":"\u63A5\u53D7\u53F3\u8FB9","mergeEditor.open.3way":"3-way \u7F16\u8F91\u5668","mergeEditor.conflict.prev":"\u4E0A\u4E00\u5904\u51B2\u7A81","mergeEditor.conflict.next":"\u4E0B\u4E00\u5904\u51B2\u7A81","mergeEditor.conflict.ai.resolve.all":"AI \u89E3\u51B3","mergeEditor.conflict.ai.resolve.all.stop":"\u5168\u90E8\u505C\u6B62","mergeEditor.open.tradition":"\u6587\u672C\u7F16\u8F91\u5668","workbench.quickOpen.preserveInput":"\u662F\u5426\u5728 QuickOpen \u7684\u8F93\u5165\u6846\uFF08\u5305\u62EC\u547D\u4EE4\u9762\u677F\uFF09\u4E2D\u4FDD\u7559\u4E0A\u6B21\u8F93\u5165\u7684\u5185\u5BB9","aiNative.chat.ai.assistant.name":"AI \u7814\u53D1\u52A9\u624B","aiNative.chat.input.placeholder.default":"\u53EF\u4EE5\u95EE\u6211\u4EFB\u4F55\u95EE\u9898\uFF0C\u8F93\u5165 @ \u53EF\u5F15\u7528\u5185\u5BB9","aiNative.chat.stop.immediately":"\u6211\u5148\u4E0D\u60F3\u4E86\uFF0C\u6709\u9700\u8981\u53EF\u4EE5\u968F\u65F6\u95EE\u6211","aiNative.chat.error.response":"\u5F53\u524D\u4E0E\u6211\u4E92\u52A8\u7684\u4EBA\u592A\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF0C\u611F\u8C22\u60A8\u7684\u7406\u89E3\u4E0E\u652F\u6301","aiNative.chat.code.insert":"\u63D2\u5165\u4EE3\u7801","aiNative.chat.code.copy":"\u590D\u5236\u4EE3\u7801","aiNative.chat.code.copy.success":"\u590D\u5236\u6210\u529F","aiNative.chat.expand.unfullscreen":"\u6536\u8D77","aiNative.chat.expand.fullescreen":"\u5C55\u5F00\u5168\u5C4F","aiNative.chat.enter.send":"Enter \u53D1\u9001","aiNative.chat.defaultContextFile":"\u5F53\u524D\u6587\u4EF6","aiNative.chat.defaultContextFolder":"\u5F53\u524D\u6587\u4EF6\u5939","aiNative.chat.thinking":"\u6DF1\u5EA6\u601D\u8003","aiNative.chat.imageUpload":"\u4E0A\u4F20\u56FE\u7247","aiNative.chat.clearContext":"\u6E05\u7A7A\u4E0A\u4E0B\u6587","aiNative.chat.context.description":"\u5171 {0} \u4E2A\u5F15\u7528","aiNative.chat.context.clear":"\u70B9\u51FB\u6E05\u7A7A\u5F15\u7528","aiNative.chat.modelSelector.disableTip":"\u5982\u9700\u5207\u6362\u6A21\u578B\uFF0C\u8BF7\u65B0\u5EFA\u6216\u6E05\u7A7A\u4F1A\u8BDD","aiNative.inline.chat.operate.chat.title":"Chat({0})","aiNative.inline.chat.operate.check.title":"\u91C7\u7EB3","aiNative.inline.chat.operate.thumbsup.title":"\u8D5E","aiNative.inline.chat.operate.thumbsdown.title":"\u8E29","aiNative.inline.chat.operate.loading.cancel":"\u6309 ESC \u53D6\u6D88","aiNative.inline.chat.input.placeholder.default":"\u8BF7\u8F93\u5165\u4F60\u7684\u610F\u56FE...(\u2191\u2193 \u5207\u6362\u5386\u53F2)","aiNative.inline.chat.generating.canceled":"Inline Chat \u5DF2\u505C\u6B62\u751F\u6210","aiNative.inline.hint.widget.placeholder":"\u6309 {0} \u5524\u8D77 Inline Chat","aiNative.inline.problem.fix.title":"AI \u4FEE\u590D","aiNative.inline.diff.accept":"\u91C7\u7EB3","aiNative.inline.diff.reject":"\u62D2\u7EDD","aiNative.chat.view-changes":"\u67E5\u770B\u6539\u52A8","aiNative.resolve.conflict.dialog.afresh":"\u4F60\u786E\u5B9A\u8981\u91CD\u65B0\u751F\u6210\u5417\uFF1F","aiNative.resolve.conflict.dialog.detection":`\u68C0\u6D4B\u5230\u60A8\u5DF2\u505A\u4E86\u4FEE\u6539\uFF0C\u91CD\u65B0\u751F\u6210\u4F1A\u8986\u76D6\u6389
32210
32210
  \u60A8\u4FEE\u6539\u7684\u90E8\u5206\uFF0C\u662F\u5426\u786E\u8BA4\u8FDB\u884C\u91CD\u65B0\u751F\u6210\u3002`,"aiNative.resolve.conflict.message.not.processed.yet":"AI \u5DF2\u5904\u7406 {0} \u5904\u51B2\u7A81\uFF0C{1} \u5904\u51B2\u7A81\u6682\u672A\u5904\u7406\uFF08\u4ECD\u6807\u8BB0\u4E3A\u9EC4\u8272\u90E8\u5206\uFF09\uFF0C\u9700\u4EBA\u5DE5\u5904\u7406","aiNative.operate.discard.title":"\u4E22\u5F03","aiNative.operate.afresh.title":"\u91CD\u65B0\u751F\u6210","aiNative.operate.stop.title":"\u505C\u6B62","aiNative.operate.close.title":"\u5173\u95ED","aiNative.operate.clear.title":"\u6E05\u7A7A","aiNative.operate.tools.title":"MCP \u5DE5\u5177","aiNative.operate.newChat.title":"\u65B0\u5EFA\u804A\u5929","aiNative.operate.chatHistory.title":"\u804A\u5929\u5386\u53F2","aiNative.operate.chatHistory.searchPlaceholder":"\u8BF7\u641C\u7D22...","aiNative.operate.chatHistory.edit":"\u7F16\u8F91","aiNative.operate.chatHistory.delete":"\u5220\u9664","aiNative.chat.welcome.loading.text":"\u521D\u59CB\u5316\u4E2D...","aiNative.chat.ai.assistant.limit.message":"{0} \u6761\u6700\u65E9\u7684\u6D88\u606F\u56E0\u8F93\u5165 Tokens \u9650\u5236\u800C\u88AB\u4E22\u5F03","aiNative.inlineDiff.acceptAll":"\u63A5\u53D7\u5168\u90E8","aiNative.inlineDiff.rejectAll":"\u62D2\u7EDD\u5168\u90E8","aiNative.inlineDiff.reveal":"\u5728\u804A\u5929\u4E2D\u5C55\u793A","aiNative.inlineDiff.up":"\u4E0A\u4E00\u5904\u53D8\u66F4","aiNative.inlineDiff.down":"\u4E0B\u4E00\u5904\u53D8\u66F4","aiNative.inlineDiff.right":"\u4E0B\u4E00\u5904\u6587\u4EF6","aiNative.inlineDiff.left":"\u4E0A\u4E00\u5904\u6587\u4EF6","aiNative.inlineDiff.noMoreChangesUp":"\u9876\u90E8\u6CA1\u6709\u66F4\u591A\u53D8\u66F4\u4E86","aiNative.inlineDiff.noMoreChangesDown":"\u5E95\u90E8\u6CA1\u6709\u66F4\u591A\u53D8\u66F4\u4E86","aiNative.chat.session.max":"\u6700\u591A\u53EA\u80FD\u521B\u5EFA {0} \u4E2A\u804A\u5929","preference.ai.native.inlineChat.title":"Inline Chat","preference.ai.native.chat.title":"Chat","preference.ai.native.interface.quick.title":"\u63A5\u53E3\u5FEB\u901F\u8DF3\u8F6C","preference.ai.native.interface.quick.navigation":"\u70B9\u51FB\u7F16\u8F91\u5668\u5DE6\u4FA7\u56FE\u6807\u5FEB\u901F\u8DF3\u8F6C\u5230\u63A5\u53E3\u5B9E\u73B0","preference.ai.native.interface.quick.navigation.hover":"\u8DF3\u8F6C\u5230\u5B9E\u73B0","preference.ai.native.inlineChat.auto.visible":"\u662F\u5426\u5728\u9009\u4E2D\u4EE3\u7801\u7247\u6BB5\u65F6\u81EA\u52A8\u663E\u793A Inline Chat?","preference.ai.native.inlineChat.codeAction.enabled":"\u662F\u5426\u542F\u7528\u5728\u9009\u4E2D\u4EE3\u7801\u7247\u6BB5\u65F6\u663E\u793A Inline Chat \u76F8\u5173\u7684 Code Actions?","preference.ai.native.chat.visible.type":"\u63A7\u5236 Chat \u9762\u677F\u9ED8\u8BA4\u7684\u5C55\u793A\u65B9\u5F0F","preference.ai.native.inlineDiff.preview.mode":"Inline Diff \u7684\u9884\u89C8\u6A21\u5F0F","preference.ai.native.inlineDiff.preview.mode.sideBySide":"\u5728\u7F16\u8F91\u5668\u5F53\u4E2D\u4EE5\u5DE6\u53F3 diff \u9762\u677F\u7684\u65B9\u5F0F\u5C55\u793A","preference.ai.native.inlineDiff.preview.mode.inlineLive":"\u5728\u7F16\u8F91\u5668\u5F53\u4E2D\u4EE5\u6D41\u5F0F\u6E32\u67D3\u7684\u65B9\u5F0F\u5C55\u793A","preference.ai.native.intelligentCompletions.title":"\u667A\u80FD\u8865\u5168","preference.ai.native.intelligentCompletions.promptEngineering.enabled":"\u662F\u5426\u542F\u7528\u63D0\u793A\u8BCD\u5DE5\u7A0B\uFF0C\u4E00\u4E9B LLM \u6A21\u578B\u5728\u63D0\u793A\u8BCD\u5DE5\u7A0B\u4E0A\u53EF\u80FD\u8868\u73B0\u4E0D\u4F73\u3002","preference.ai.native.intelligentCompletions.debounceTime":"\u667A\u80FD\u8865\u5168\u7684\u5EF6\u8FDF\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09","preference.ai.native.intelligentCompletions.cache.enabled":"\u662F\u5426\u542F\u7528\u667A\u80FD\u8865\u5168\u7684\u7F13\u5B58","preference.ai.native.intelligentCompletions.alwaysVisible":"\u662F\u5426\u603B\u662F\u5C55\u793A\u667A\u80FD\u8865\u5168","preference.ai.native.codeEdits.title":"\u667A\u80FD\u6539\u5199","preference.ai.native.codeEdits.lintErrors":"\u662F\u5426\u5728\u53D1\u751F Lint Error \u65F6\u89E6\u53D1\u667A\u80FD\u6539\u5199","preference.ai.native.codeEdits.lineChange":"\u662F\u5426\u5728\u5149\u6807\u884C\u53F7\u53D1\u751F\u53D8\u5316\u65F6\u89E6\u53D1\u667A\u80FD\u6539\u5199","preference.ai.native.codeEdits.typing":"\u662F\u5426\u5728\u5185\u5BB9\u53D1\u751F\u53D8\u5316\u65F6\u89E6\u53D1\u667A\u80FD\u6539\u5199","preference.ai.native.codeEdits.renderType":"\u667A\u80FD\u6539\u5199\u6E32\u67D3\u65B9\u5F0F","preference.ai.native.chat.system.prompt":"\u9ED8\u8BA4\u804A\u5929\u7CFB\u7EDF\u63D0\u793A\u8BCD","webview.webviewTagUnavailable":"\u975E Electron \u73AF\u5883\u4E0D\u652F\u6301 webview \u6807\u7B7E\uFF0C\u8BF7\u4F7F\u7528 iframe \u6807\u7B7E","notebook.kernel.panel.empty":"\u6682\u65E0\u5185\u5BB9","notebook.kernel.panel.title":"\u8FD0\u884C\u7684\u7EC8\u7AEF\u548C\u5185\u6838","notebook.kernel.panel.opened.pages":"\u5DF2\u5F00\u542F\u7684\u6807\u7B7E\u9875","notebook.kernel.panel.running.kernels":"\u8FD0\u884C\u7684\u5185\u6838","notebook.kernel.close.all.confirmation":"\u4F60\u786E\u5B9A\u8981\u5173\u95ED\u5168\u90E8\u5417\uFF1F","notebook.variable.panel.title":"\u53D8\u91CF\u68C0\u67E5\u5668","notebook.variable.panel.unsupported":"\u8BE5\u6587\u4EF6\u683C\u5F0F\u6682\u4E0D\u652F\u6301\u53D8\u91CF\u68C0\u67E5","notebook.variable.panel.refresh.success":"\u53D8\u91CF\u5237\u65B0\u6210\u529F","notebook.variable.panel.refresh.error":"\u53D8\u91CF\u5237\u65B0\u5931\u8D25","notebook.variable.panel.search.placeholder":"\u8BF7\u8F93\u5165\u53D8\u91CF\u540D\u79F0\u641C\u7D22","notebook.variable.panel.show.detail":"\u67E5\u770B\u8BE6\u60C5",...r.browserViews,...o.editorLocalizations,...l.zhCN,"preference.ai.native.llm.apiSettings.title":"\u5927\u6A21\u578B API \u8BBE\u7F6E","preference.ai.native.llm.model.id":"\u6A21\u578B ID","preference.ai.native.deepseek.apiKey":"Deepseek API \u5BC6\u94A5","preference.ai.native.deepseek.apiKey.description":"Deepseek \u8BED\u8A00\u6A21\u578B\u7684 API \u5BC6\u94A5","preference.ai.native.anthropic.apiKey":"Anthropic API \u5BC6\u94A5","preference.ai.native.anthropic.apiKey.description":"Anthropic \u8BED\u8A00\u6A21\u578B\u7684 API \u5BC6\u94A5","preference.ai.native.openai.apiKey":"OpenAI API \u5BC6\u94A5","preference.ai.native.openai.apiKey.description":"OpenAI \u517C\u5BB9\u8BED\u8A00\u6A21\u578B\u7684 API \u5BC6\u94A5","preference.ai.native.openai.baseURL":"OpenAI Base URL","preference.ai.native.openai.baseURL.description":"OpenAI \u517C\u5BB9\u8BED\u8A00\u6A21\u578B\u7684 Base URL","preference.ai.native.contextWindow":"\u4E0A\u4E0B\u6587\u7A97\u53E3","preference.ai.native.contextWindow.description":"\u4E0A\u4E0B\u6587\u7A97\u53E3\u7684\u6700\u5927Token\u6570","preference.ai.native.maxTokens":"\u6700\u5927\u8F93\u51FA","preference.ai.native.maxTokens.description":"\u6700\u5927\u8F93\u51FAToken\u6570","preference.ai.native.mcp.settings.title":"MCP \u670D\u52A1\u5668\u8BBE\u7F6E","preference.ai.native.mcp.servers":"MCP \u670D\u52A1\u5668","preference.ai.native.mcp.servers.description":"\u914D\u7F6E MCP (Model Context Protocol) \u670D\u52A1\u5668","preference.ai.native.mcp.servers.name.description":"MCP \u670D\u52A1\u5668\u540D\u79F0","preference.ai.native.mcp.servers.command.description":"\u542F\u52A8 MCP \u670D\u52A1\u5668\u7684\u547D\u4EE4","preference.ai.native.mcp.servers.args.description":"MCP \u670D\u52A1\u5668\u7684\u547D\u4EE4\u884C\u53C2\u6570","preference.ai.native.mcp.servers.env.description":"MCP \u670D\u52A1\u5668\u7684\u73AF\u5883\u53D8\u91CF","preference.ai.native.mcp.servers.type.description":"MCP \u670D\u52A1\u5668\u8FDE\u63A5\u7C7B\u578B","preference.ai.native.mcp.servers.type.stdio":"Stdio \u8FDE\u63A5","preference.ai.native.mcp.servers.type.sse":"SSE \u8FDE\u63A5","ai.native.mcp.terminal.command":"\u547D\u4EE4","ai.native.mcp.terminal.output":"\u8F93\u51FA","ai.native.mcp.terminal.allow-question":"\u662F\u5426\u5141\u8BB8\u8FD0\u884C\u547D\u4EE4?","ai.native.mcp.terminal.allow":"\u5141\u8BB8","ai.native.mcp.terminal.deny":"\u62D2\u7EDD","ai.native.terminal.autorun":"\u7EC8\u7AEF\u547D\u4EE4\u81EA\u52A8\u6267\u884C\u7B56\u7565","ai.native.terminal.autorun.description":"Agent\u7EC8\u7AEF\u547D\u4EE4\u7684\u81EA\u52A8\u6267\u884C\u7B56\u7565\u3002`off` \u8868\u793A\u6C38\u8FDC\u4E0D\u81EA\u52A8\u6267\u884C\uFF0C`auto` \u8868\u793A\u6A21\u578B\u5C06\u6839\u636E\u547D\u4EE4\u51B3\u5B9A\u662F\u5426\u81EA\u52A8\u6267\u884C\uFF08\u53EA\u9002\u7528\u4E8E\u9AD8\u7EA7\u6A21\u578B\uFF09\uFF0C`always` \u8868\u793A\u6C38\u8FDC\u81EA\u52A8\u6267\u884C\u3002","ai.native.terminal.autorun.denied":"\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u62D2\u7EDD\u81EA\u52A8\u8FD0\u884C","ai.native.terminal.autorun.question":"\u5E0C\u671B\u81EA\u52A8\u8FD0\u884C?","ai.native.terminal.autorun.command":"\u70B9\u51FB\u66F4\u6539\u547D\u4EE4\u81EA\u52A8\u6267\u884C\u7B56\u7565.","ai.native.terminal.autorun.always":"\u59CB\u7EC8\u5141\u8BB8","ai.native.terminal.autorun.auto":"\u6A21\u578B\u81EA\u52A8\u6267\u884C","ai.native.terminal.autorun.off":"\u7981\u6B62\u81EA\u52A8\u6267\u884C","ai.native.terminal.autorun.running":"\u547D\u4EE4\u6267\u884C\u4E2D...","ai.native.mcp.name":"\u540D\u79F0:","ai.native.mcp.command":"\u547D\u4EE4:","ai.native.mcp.args":"\u53C2\u6570:","ai.native.mcp.env":"\u73AF\u5883\u53D8\u91CF:","ai.native.mcp.type":"\u7C7B\u578B:","ai.native.mcp.stdio":"Command","ai.native.mcp.sse":"SSE","ai.native.mcp.buttonSave":"\u6DFB\u52A0","ai.native.mcp.buttonUpdate":"\u66F4\u65B0","ai.native.mcp.buttonCancel":"\u53D6\u6D88","ai.native.mcp.addMCPServer.title":"\u6DFB\u52A0 MCP \u670D\u52A1\u5668","ai.native.mcp.editMCPServer.title":"\u7F16\u8F91 MCP \u670D\u52A1\u5668","ai.native.mcp.url.placeHolder":"\u8F93\u5165 SSE URL","ai.native.mcp.command.placeHolder":"\u8F93\u5165\u547D\u4EE4","ai.native.mcp.args.placeHolder":"\u8FD0\u884C\u53C2\u6570","ai.native.mcp.env.placeHolder":"KEY=value\uFF08\u6BCF\u884C\u4E00\u4E2A\uFF09","ai.native.mcp.name.placeHolder":"\u670D\u52A1\u5668\u540D\u79F0","ai.native.mcp.type.builtin":"\u5185\u7F6E","ai.native.mcp.type.sse":"SSE","ai.native.mcp.type.stdio":"\u547D\u4EE4","ai.native.mcp.serverNameExists":'\u670D\u52A1\u540D\u79F0 "{0}" \u5DF2\u5B58\u5728',"ai.native.mcp.name.isRequired":"\u670D\u52A1\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","ai.native.mcp.command.isRequired":"\u547D\u4EE4\u4E0D\u80FD\u4E3A\u7A7A","ai.native.mcp.url.isRequired":"SSE URL \u4E0D\u80FD\u4E3A\u7A7A","ai.native.mcp.manage.connections":"\u7BA1\u7406\u4F60\u7684 MCP \u670D\u52A1\u5668\u8FDE\u63A5","ai.native.mcp.enabled":"\u5DF2\u542F\u7528","ai.native.mcp.disabled":"\u5DF2\u7981\u7528","ai.native.mcp.enable.title":"\u542F\u52A8\u8BE5\u670D\u52A1","ai.native.mcp.disable.title":"\u505C\u6B62\u8BE5\u670D\u52A1","ai.native.mcp.config.title":"MCP \u914D\u7F6E","ai.native.mcp.tool.arguments":"\u53C2\u6570","ai.native.mcp.tool.results":"\u8FD4\u56DE","ai.native.mcp.tool.action.edit":"\u4FEE\u6539","ai.native.mcp.tool.action.delete":"\u5220\u9664","ai.native.mcp.tool.action.sync":"\u540C\u6B65"}}},10199:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(32581),t)},21774:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(25067),_=e(48644),v=e(85448);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IKeymapService,useClass:v.KeymapService},_.KeymapsContribution]}};t.KeymapsModule=m,t.KeymapsModule=m=n.__decorate([(0,r.Injectable)()],m)},2312:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapsParser=t.keymapsSchema=void 0;const n=e(85608),r=n.__importDefault(e(82174)),o=n.__importStar(e(23304)),l=e(76003);t.keymapsSchema={type:"array",items:{type:"object",properties:{key:{type:"string"},keybinding:{type:"string",deprecated:!0},command:{type:"string"},context:{type:"string"},when:{type:"string"},args:{}},required:["command"],optional:["key","keybinding","when","args"],additionalProperties:!1}};let _=class{constructor(){this.validate=new r.default({jsonPointers:!0}).compile(t.keymapsSchema)}parse(m,p){const s=o.stripComments(m),g=p?[]:void 0,a=o.parse(s,g);if(g&&p)for(const h of g)p.push(`${this.printParseErrorCode(h.error)} at ${h.offset} offset of ${h.length} length`);if(this.validate(a))return a;if(p&&this.validate.errors)for(const h of this.validate.errors)p.push(`${h.message} at ${h.dataPath}`);return[]}printParseErrorCode(m){return o.printParseErrorCode(m)}};t.KeymapsParser=_,t.KeymapsParser=_=n.__decorate([(0,l.Injectable)(),n.__metadata("design:paramtypes",[])],_)},48644:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapsContribution=t.KEYMAP_COMMANDS=t.KeymapsContextMenu=t.KeymapsResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(57517),v=e(42933),m=e(97821),p=e(25067),s=e(34879),g="keymaps-preview";let a=class extends o.WithEventBus{constructor(){super(),this.scheme=p.KEYMAPS_SCHEME}provideResource(f){return{supportsRevive:!0,name:(0,o.localize)("keymaps.tab.name"),icon:(0,o.getIcon)("setting"),uri:f}}provideResourceSubname(f,d){return null}async shouldCloseResource(f,d){return!0}};t.KeymapsResourceProvider=a,t.KeymapsResourceProvider=a=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],a);var h;(function(E){E.KEYMAPS="2_keymaps"})(h||(t.KeymapsContextMenu=h={}));var u;(function(E){const f="keymaps";E.OPEN_SOURCE_FILE={id:"keymaps.open.source",label:"%keymaps.editorTitle.openSource%",category:f}})(u||(t.KEYMAP_COMMANDS=u={}));let c=class{registerCommands(f){f.registerCommand(o.COMMON_COMMANDS.OPEN_KEYMAPS,{isEnabled:()=>!0,execute:async()=>{await this.keymapService.open()}}),f.registerCommand(u.OPEN_SOURCE_FILE,{execute:async()=>{this.keymapService.openResource()}}),f.registerCommand(o.KEYBOARD_COMMANDS.CHOOSE_KEYBOARD_LAYOUT,{execute:()=>{this.chooseLayout()}})}registerMenus(f){f.registerMenuItem(l.MenuId.SettingsIconMenu,{command:o.COMMON_COMMANDS.OPEN_KEYMAPS.id,group:h.KEYMAPS}),f.registerMenuItem(l.MenuId.EditorTitle,{command:u.OPEN_SOURCE_FILE.id,iconClass:(0,o.getIcon)("open"),group:"navigation",order:4,when:`resourceScheme == ${p.KEYMAPS_SCHEME}`}),f.registerMenuItem(l.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_KEYMAPS.id,iconClass:(0,o.getIcon)("open"),group:"navigation",order:4,when:"resourceFilename =~ /keymaps.json/"})}registerKeybindings(f){f.registerKeybinding({command:o.COMMON_COMMANDS.OPEN_KEYMAPS.id,keybinding:"ctrlcmd+K ctrlcmd+S"})}onStart(){this.keymapService.init()}registerResource(f){f.registerResourceProvider(this.keymapsResourceProvider)}registerEditorComponent(f){f.registerEditorComponent({component:s.KeymapsView,uid:g,scheme:p.KEYMAPS_SCHEME}),f.registerEditorComponentResolver(p.KEYMAPS_SCHEME,(d,y,b)=>{b([{type:_.EditorOpenType.component,componentId:g}])})}async chooseLayout(){const f=this.layoutProvider.currentLayoutData,d={label:(0,o.localize)("keyboard.autoDetect.label"),description:f&&this.layoutProvider.currentLayoutSource!=="user-choice"?(0,o.formatLocalize)("keyboard.autoDetect.description",(0,o.getKeyboardLayoutId)(f.layout)):void 0,detail:(0,o.localize)("keyboard.autoDetect.detail"),value:"autodetect"},y=this.layoutProvider.allLayoutData.map(S=>this.toQuickPickValue(S,f===S));let b;b=[d,...y];const A=await this.quickPickService.show(b,{placeholder:"Choose a keyboard layout"});if(A)return this.layoutProvider.setLayoutData(A)}toQuickPickValue(f,d){return{label:(0,o.getKeyboardLayoutId)(f.layout),value:f}}};t.KeymapsContribution=c,n.__decorate([(0,r.Autowired)(m.QuickPickService),n.__metadata("design:type",Object)],c.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(o.KeyboardNativeLayoutService),n.__metadata("design:type",Object)],c.prototype,"layoutProvider",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],c.prototype,"filesystem",void 0),n.__decorate([(0,r.Autowired)(a),n.__metadata("design:type",a)],c.prototype,"keymapsResourceProvider",void 0),n.__decorate([(0,r.Autowired)(p.IKeymapService),n.__metadata("design:type",Object)],c.prototype,"keymapService",void 0),t.KeymapsContribution=c=n.__decorate([(0,o.Domain)(o.CommandContribution,o.KeybindingContribution,o.ClientAppContribution,_.BrowserEditorContribution,l.MenuContribution)],c)},85448:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapService=void 0;const r=e(85608),o=r.__importStar(e(39050)),l=e(76003),_=e(41869),v=e(68969),m=e(14951),p=e(25067),s=e(2312);let g=n=class{constructor(){this.keymapChangeEmitter=new _.Emitter,this.convertKeySequence=[],this.toUnregisterUserKeybindingMap=new Map,this.toRestoreDefaultKeybindingMap=new Map,this.searchDelayer=new _.ThrottledDelayer(n.DEFAULT_SEARCH_DELAY),this.disposableCollection=new _.DisposableCollection,this._whenReadyDeferred=new _.Deferred,this.fuzzyOptions={pre:"<match>",post:"</match>"},this.reconcileQueue=new _.Throttler,this.keybindings=[],this.updateKeybindings=()=>{this.currentSearchValue?this.doSearchKeybindings(this.currentSearchValue):(0,_.runWhenIdle)(()=>{this.keybindings=this.getKeybindingItems(),this.keymapChangeEmitter.fire(this.keybindings)})},this.setKeybinding=(h,u)=>this.progressService.withProgress({location:_.ProgressLocation.Notification},c=>new Promise((E,f)=>{c.report({message:(0,_.localize)("keymaps.keybinding.loading"),increment:0,total:100});const d=this.storeKeybindings||[];let y=!1;for(const b of d){const A={when:b.when,command:b.command,keybinding:b.key};if(b.command===u.command){y=!0,this.unregisterUserKeybinding(A);const S=this.toUniqueKey(h),D=this.toRestoreDefaultKeybindingMap.get(S);if(D){const I=this.toUniqueKey(u);this.toRestoreDefaultKeybindingMap.delete(S),this.toRestoreDefaultKeybindingMap.set(I,D)}b.key=u.keybinding,this.registerUserKeybinding({...A,priority:_.KeybindingWeight.WorkbenchContrib*100})}}if(!y){const b=this.keybindings.find(S=>S.id===u.command&&this.getRaw(S.when)===u.when);if(b&&b.keybinding){this.unregisterDefaultKeybinding({when:this.getRaw(b.when),command:b.id,keybinding:this.getRaw(b.keybinding)});const S=this.toUniqueKey(h),D=this.toRestoreDefaultKeybindingMap.get(S);if(D){const I=this.toUniqueKey(u);this.toRestoreDefaultKeybindingMap.delete(S),this.toRestoreDefaultKeybindingMap.set(I,D)}}const A={when:this.getWhen(u),command:u.command,key:u.keybinding};d.push(A),this.registerUserKeybinding(u)}return this.saveKeybinding(d).then(()=>{E(void 0),c.report({message:(0,_.localize)("keymaps.keybinding.success"),increment:99})}).catch(b=>{f(b),c.report({message:(0,_.localize)("keymaps.keybinding.fail"),increment:99})}).finally(()=>{setTimeout(()=>{c.report({increment:100})},3e3)})}),()=>{}),this.covert=h=>this.keybindingService.convert(h," "),this.clearCovert=()=>this.keybindingService.clearConvert(),this.resetKeybinding=async h=>{if(!this.resource)return;const c=this.storeKeybindings.filter(E=>E.command!==h.command);return this.unregisterUserKeybinding(h),this.restoreDefaultKeybinding(h),this.saveKeybinding(c)},this.fixed=async()=>{this.commandService.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI().withScheme(p.KEYMAPS_SCHEME),{preview:!1})},this.searchKeybindings=h=>{this.currentSearchValue=h,this.searchDelayer.isTriggered()||this.searchDelayer.cancel(),this.searchDelayer.trigger(async()=>{this.doSearchKeybindings(this.currentSearchValue)})},this.isSearching=!1,this.doSearchKeybindings=h=>{h?this.isSearching=!0:this.isSearching=!1;const u=this.getKeybindingItems(),c=[];u.forEach(E=>{const f=["id","command","keybinding","when","context","source"];let d=!1;for(const y of f){const b=E[y];if(b){const A=o.match(h,b,this.fuzzyOptions);if(A)E[y]=A.rendered,d=!0;else if(y==="keybinding"){const S=h.split("+"),D=b.split(" "),I=[0];let w=[];D.length>1?D.forEach(P=>{const O=P.split("+");I.push(O.length+I[-1]),w.push(...O)}):w=b.split("+"),I.shift();const T=[...w];let R=0;if(S.forEach(P=>{let O={rendered:"",score:0},M=-1;if(b){w.forEach(F=>{const L=o.match(P,F,this.fuzzyOptions);L&&L.score>O.score&&(O=L,M=T.indexOf(F))});const k=O.rendered;k&&(M>-1&&(T[M]=k),w.splice(M,1,""),R+=1)}}),R===S.length){if(I.length>0){const P="";T.forEach((O,M)=>{M===0?P.concat(O):I.indexOf(M)!==-1?P.concat(" "+O):P.concat("+"+O)}),E[y]=P}E[y]=T.join("+"),d=!0}}}}d&&c.push(E)}),this.keybindings=c,this.keymapChangeEmitter.fire(this.keybindings)},this.validateKeybinding=(h,u)=>{if(!u)return(0,_.localize)("keymaps.keybinding.require");try{const c={command:this.isSearching?this.getRaw(h.command):h.command,when:this.isSearching?this.getRaw(h.when):h.when,keybinding:this.isSearching?this.getRaw(u):u};return h.keybinding===u?" ":this.keybindingRegistry.validateKeybindingInScope(c)}catch(c){return c}},this.detectKeybindings=(h,u)=>{if(!u)return[];try{if(h.keybinding===u)return[];const c=this.keybindings.filter(E=>this.getRaw(E.keybinding)===u);if(c.length>0)return c.map(E=>{const f=this.commandRegistry.getCommand(this.getRaw(E.command)),d=this.storeKeybindings.find(y=>f&&y.command===f.id);return E.when=this.getRaw(E.when),E.keybinding=this.getRaw(E.keybinding),{id:f?f.id:this.getRaw(E.command),command:(f?f.label||f.id:E.command)||"",when:this.keybindingService.convertMonacoWhen(E.when),keybinding:this.getRaw(E.keybinding),source:d?this.getScope(_.KeybindingScope.USER):this.getScope(_.KeybindingScope.DEFAULT)}})}catch(c){this.logger.error(c)}return[]}}get onDidKeymapChanges(){return this.keymapChangeEmitter.event}get storeKeybindings(){return this._storeKeybindings&&this._storeKeybindings.map(h=>({...h,command:this.getValidateCommand(h.command),key:h.key||h.keybinding}))}set storeKeybindings(h){this._storeKeybindings=h}get whenReady(){return this._whenReadyDeferred.promise}async init(){await this.reconcile();const h=await this.filesystem.watchFileChanges(n.KEYMAP_FILE_URI);this.disposableCollection.push(h),h.onFilesChanged(()=>{this.reconcileQueue.queue(this.reconcile.bind(this))}),this._whenReadyDeferred.resolve()}async openResource(){if(!this.resource||!this.resource.uri)return;const h=await this.resource.uri;if(!h)return;if(!await this.filesystem.access(h)){const c=await this.filesystem.createFile(h),E=await this.filesystem.setContent(c,`{
32211
- }`);this.resource=E||void 0}h&&this.commandService.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(h),{preview:!1})}disposeRegistedKeybinding(){for(const[,h]of this.toUnregisterUserKeybindingMap)h.dispose();for(const[,h]of this.toRestoreDefaultKeybindingMap)h.dispose()}dispose(){this.disposeRegistedKeybinding(),this.disposableCollection.dispose()}getValidateCommand(h){return h.replace(/^monaco.editor/,"editor")}async reconcile(h){const u=n.KEYMAP_FILE_URI.toString();this.resource=await this.filesystem.getFileStat(u),this.resource||(this.resource=await this.filesystem.createFile(u,{content:JSON.stringify([])}));const E=(h?h.slice(0):await this.parseKeybindings()).map(y=>({when:y.when,command:this.getValidateCommand(y.command),keybinding:y.key||y.keybinding})),f=[],d=[];this.disposeRegistedKeybinding(),E.forEach(y=>{y.command.startsWith("-")?d.push(y):f.push(y)}),f.map(y=>{this.unregisterDefaultKeybinding(y,!0),this.registerUserKeybinding(y)}),d.map(y=>{y.command=y.command.slice(1),this.unregisterDefaultKeybinding(y,!0)})}unregisterUserKeybinding(h){const u=this.toUniqueKey(h);if(this.toUnregisterUserKeybindingMap.has(u)){const c=this.toUnregisterUserKeybindingMap.get(u);c?.dispose(),this.toUnregisterUserKeybindingMap.delete(u)}}registerUserKeybinding(h){const u=this.toUniqueKey(h);this.toUnregisterUserKeybindingMap.set(u,this.keybindingRegistry.registerKeybinding(h,_.KeybindingScope.USER))}unregisterDefaultKeybinding(h,u=!1){if(u)this.keybindingRegistry.getKeybindingsForCommand(h.command).map(E=>{const f={...h,keybinding:E.keybinding};this.keybindingRegistry.unregisterKeybinding(f);const d=this.toUniqueKey(h);this.toRestoreDefaultKeybindingMap.set(d,_.Disposable.create(()=>{this.keybindingRegistry.registerKeybinding(f)}))});else{this.keybindingRegistry.unregisterKeybinding(h);const c=this.toUniqueKey(h);this.toRestoreDefaultKeybindingMap.set(c,_.Disposable.create(()=>{this.keybindingRegistry.registerKeybinding(h)}))}}restoreDefaultKeybinding(h){const u=this.toUniqueKey(h),c=this.toRestoreDefaultKeybindingMap.get(u);c&&(c?.dispose(),this.toRestoreDefaultKeybindingMap.delete(u))}toUniqueKey(h){return`${h.command}${h.when?`-${h.when}`:"-"}${h.keybinding?`-${h.keybinding}`:"-"}`}async parseKeybindings(){try{const h=await this.resource;if(!h)return[];const{content:u}=await this.filesystem.readFile(h.uri);this.storeKeybindings=this.parser.parse(u.toString())}catch(h){this.logger.warn(`ParseKeybindings fail: ${h.stack}`),this.storeKeybindings=[]}return this.storeKeybindings}async saveKeybinding(h){this.storeKeybindings=h,this.updateKeybindings(),this.resource||(this.resource=await this.filesystem.createFile(n.KEYMAP_FILE_URI.toString()));const u=await this.filesystem.setContent(this.resource,JSON.stringify(h,void 0,2));this.resource=u||void 0}async getKeybindings(){return this.storeKeybindings.map(h=>({command:h.command,keybinding:h.key,when:h.when,args:h.args}))}async open(){this.commandService.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI().withScheme(p.KEYMAPS_SCHEME),{preview:!0})}getWhen(h){return h?this.keybindingService.convertMonacoWhen(h.when):""}getScope(h){return h===_.KeybindingScope.DEFAULT?(0,_.localize)("keymaps.source.default"):h===_.KeybindingScope.USER?(0,_.localize)("keymaps.source.user"):h===_.KeybindingScope.WORKSPACE?(0,_.localize)("keymaps.source.workspace"):""}getKeybindingItems(){const h=this.commandRegistry.getCommands(),u=[];for(const b of h){const A=this.keybindingRegistry.getKeybindingsForCommand(b.id);!A||!A.length?b.label&&u.push({id:b.id,command:b.label,hasCommandLabel:!0}):A.forEach(S=>{let D;if(this.storeKeybindings){const I=this.storeKeybindings.find(w=>b&&w.command===b.id);D={id:b.id,command:b.label||b.id,keybinding:I?I.key:S?this.keybindingRegistry.acceleratorFor(S,"+").join(" "):"",when:I?this.getWhen(I):this.getWhen(A&&S),source:I?this.getScope(_.KeybindingScope.USER):this.getScope(_.KeybindingScope.DEFAULT),hasCommandLabel:!!b.label}}else D={id:b.id,command:b.label||b.id,keybinding:A&&S?this.keybindingRegistry.acceleratorFor(S,"+").join(" "):"",when:this.getWhen(A&&S),source:A&&S&&typeof S.scope<"u"?this.getScope(S.scope):"",hasCommandLabel:!!b.label};u.push(D)})}const c=u.sort((b,A)=>this.compareItem(b,A)),E=c.filter(b=>!!b.keybinding),f=c.filter(b=>!b.keybinding&&b.hasCommandLabel),d=E.filter(b=>b.hasCommandLabel),y=E.filter(b=>!b.hasCommandLabel);return[...d,...y,...f]}compareItem(h,u){return h&&u?h.source===u.source?h.command.toLowerCase().localeCompare(u.command.toLowerCase()):h.source===this.getScope(_.KeybindingScope.USER)?-1:1:0}getRaw(h){return h?h.replace(new RegExp(/<(\/)?match>/gi),""):""}};t.KeymapService=g,g.DEFAULT_SEARCH_DELAY=100,g.KEYMAP_FILE_URI=new _.URI().withScheme(_.Schemes.userStorage).withPath(p.KEYMAPS_FILE_NAME),r.__decorate([(0,l.Autowired)(_.KeybindingRegistry),r.__metadata("design:type",Object)],g.prototype,"keyBindingRegistry",void 0),r.__decorate([(0,l.Autowired)(s.KeymapsParser),r.__metadata("design:type",s.KeymapsParser)],g.prototype,"parser",void 0),r.__decorate([(0,l.Autowired)(_.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,l.Autowired)(_.CommandRegistry),r.__metadata("design:type",Object)],g.prototype,"commandRegistry",void 0),r.__decorate([(0,l.Autowired)(_.KeybindingRegistry),r.__metadata("design:type",Object)],g.prototype,"keybindingRegistry",void 0),r.__decorate([(0,l.Autowired)(_.KeybindingService),r.__metadata("design:type",Object)],g.prototype,"keybindingService",void 0),r.__decorate([(0,l.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],g.prototype,"filesystem",void 0),r.__decorate([(0,l.Autowired)(_.ILogger),r.__metadata("design:type",Object)],g.prototype,"logger",void 0),r.__decorate([(0,l.Autowired)(v.IProgressService),r.__metadata("design:type",Object)],g.prototype,"progressService",void 0),t.KeymapService=g=n=r.__decorate([(0,l.Injectable)()],g)},34879:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapsView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25067),m=n.__importDefault(e(78541)),p=()=>{const{keybindings:s,searchKeybindings:g,validateKeybinding:a,detectKeybindings:h,setKeybinding:u,resetKeybinding:c,getRaw:E,getScope:f,covert:d,clearCovert:y,fixed:b,onDidKeymapChanges:A,updateKeybindings:S}=(0,_.useInjectable)(v.IKeymapService),[D,I]=o.default.useState(!1),[w,T]=o.default.useState(""),[R,P]=o.default.useState(s),O=({data:Q,index:G})=>{const{id:Z,command:$,when:V,source:H,keybinding:K}=Q,[Y,X]=o.default.useState(!1),[oe,ie]=o.default.useState(K||""),[he,me]=o.default.useState(!1),[q,Ee]=o.default.useState(),[ue,te]=o.default.useState([]),fe=()=>{he||(b(),me(!0)),y(),ie(E(K)),X(!0)},Ie=We=>{const pe=a(Q,We);pe?pe!==" "?Ee({message:pe,type:l.VALIDATE_TYPE.ERROR}):X(!1):(u({command:E(Z),when:E(V)||"",keybinding:E(K)},{command:E(Z),when:E(V)||"",keybinding:We}),X(!1),y())},Me=()=>{X(!1)},Be=We=>{We.stopPropagation(),We.preventDefault();const{key:pe}=_.KeyCode.createKeyCode(We.nativeEvent),re=We.nativeEvent.shiftKey||We.nativeEvent.metaKey||We.nativeEvent.altKey||We.nativeEvent.ctrlKey;pe&&_.Key.ENTER.keyCode===pe.keyCode&&!re?oe&&Ie(oe):ie(d(We.nativeEvent))},Pe=()=>{const We=()=>{Ee(void 0),oe&&ie(""),y()},pe=re=>{re.stopPropagation(),re.preventDefault()};return o.default.createElement("div",{className:m.default.keybinding_optional_actions,onMouseDown:pe},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("close-circle-fill"),m.default.keybinding_optional_action),onClick:We,title:(0,_.localize)("keymaps.action.clear")}))},we=()=>o.default.createElement("div",{className:m.default.keybinding_key_input_placeholder},"\u23CE"),_e=We=>{const pe=re=>{re.preventDefault(),he||(b(),me(!0)),c({command:E(Z),when:E(V)||"",keybinding:oe})};if(We&&E(We)===f(_.KeybindingScope.USER))return o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("rollback"),m.default.keybinding_inline_action),onClick:pe,title:(0,_.localize)("keymaps.action.reset")})},Ne=()=>{if(!q&&ue.length>0)return o.default.createElement("div",{className:m.default.keybinding_detective_messages},o.default.createElement("div",{className:m.default.keybinding_detective_messages_label},(0,_.formatLocalize)("keymaps.keybinding.duplicate",ue.length)),o.default.createElement("ul",{className:m.default.keybinding_detective_messages_container},ue.map((We,pe)=>o.default.createElement("li",{className:m.default.keybinding_detective_messages_item,key:`${We.id}_${pe}`,title:`${We.command}-${We.when}`},o.default.createElement("div",{className:m.default.title},(0,_.localize)("keymaps.header.command.title"),": ",E(We.command)||"-"),o.default.createElement("div",{className:m.default.description},o.default.createElement("div",{style:{marginRight:4}},(0,_.localize)("keymaps.header.source.title"),": ",E(We.source)||"-"),o.default.createElement("div",null,(0,_.localize)("keymaps.header.when.title"),": ",E(We.when)||"\u2014"))))))},Te=()=>{if(Y)return o.default.createElement("div",{className:m.default.keybinding_key_input_container},Pe(),o.default.createElement(l.ValidateInput,{placeholder:(0,_.localize)("keymaps.edit.placeholder"),validateMessage:q,className:m.default.keybinding_key_input,size:"small",autoFocus:!0,name:_.NO_KEYBINDING_NAME,value:oe,onKeyDown:Be,onBlur:Me}),we(),Ne());{const We=K?.split(" ");return o.default.createElement("div",{className:m.default.keybinding_key,title:E(K),onDoubleClick:fe},o.default.createElement("div",{className:m.default.keybinding_action,onClick:fe},o.default.createElement("span",{className:(0,r.default)(K?(0,_.getIcon)("edit"):(0,_.getIcon)("plus"),m.default.keybinding_inline_action),title:K?(0,_.localize)("keymaps.action.edit"):(0,_.localize)("keymaps.action.add")}),_e(H)),We&&We[0]?We.map((pe,re)=>{const ge=pe.split("+");return o.default.createElement("div",{className:m.default.keybinding_key_block,key:`${pe}_${re}`},ge.map((De,Ae)=>o.default.createElement("div",{className:m.default.keybinding_key_item,key:`${De}_${Ae}`,dangerouslySetInnerHTML:{__html:De||""}})))}):"\u2014")}};return(0,o.useEffect)(()=>{q&&Ee(void 0),te(oe&&Y?h(Q,oe):[])},[oe]),o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item,G%2===1&&m.default.odd)},o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item_box,m.default.keybinding_command)},o.default.createElement("div",{className:m.default.command_name,title:E($),dangerouslySetInnerHTML:{__html:$}}),o.default.createElement("div",{className:(0,r.default)(m.default.limit_warp,m.default.command_id),title:E(Z),dangerouslySetInnerHTML:{__html:(0,_.formatLocalize)("keymaps.commandId.title",Z)}})),o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item_box)},Te()),o.default.createElement("div",{className:m.default.keybinding_list_item_box},o.default.createElement("div",{className:m.default.limit_warp,title:E(V||"\u2014"),dangerouslySetInnerHTML:{__html:V||"\u2014"}})),o.default.createElement("div",{className:m.default.keybinding_list_item_box},o.default.createElement("div",{title:E(H),dangerouslySetInnerHTML:{__html:H||""}})))},M=()=>{const Q=()=>{I(!D)};return o.default.createElement("div",{className:m.default.search_inline_action},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("keyboard"),m.default.search_inline_action_icon,D&&m.default.active),onClick:Q}))},k=(0,o.useCallback)(Q=>{T(Q),g(Q)},[w]),F=Q=>{if(!D){const G=Q.target&&Q.target.value?Q.target.value.toLocaleLowerCase():"";k(G)}},L=Q=>{if(D){Q.stopPropagation(),Q.preventDefault();const{key:G}=_.KeyCode.createKeyCode(Q.nativeEvent);if(G&&_.Key.ENTER.keyCode===G.keyCode)return;k(d(Q.nativeEvent))}},B=()=>{w&&(T(""),g("")),y()},U=()=>o.default.createElement("div",{className:m.default.keybinding_optional_actions},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("close-circle-fill"),m.default.keybinding_optional_action),onClick:B,title:(0,_.localize)("keymaps.action.reset")})),W=()=>o.default.createElement("div",{className:m.default.search_container},o.default.createElement(l.Input,{className:m.default.search_input,placeholder:(0,_.localize)(D?"keymaps.search.keyboard.placeholder":"keymaps.search.placeholder"),type:"text",value:w,name:_.NO_KEYBINDING_NAME,onChange:F,onKeyDown:L,addonBefore:M()}),U()),j=(0,o.useMemo)(()=>{const Q=[{title:(0,_.localize)("keymaps.header.command.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.keybinding.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.when.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.source.title"),classname:m.default.keybinding_header_item}];return o.default.createElement("div",{className:m.default.keybinding_header},Q.map((G,Z)=>o.default.createElement("div",{className:G.classname,key:`${G.title}_${Z}`},G.title)))},[]);return(0,o.useEffect)(()=>{const Q=A(G=>{P(G)});return S(),()=>{Q.dispose()}},[]),o.default.createElement("div",{className:m.default.keybinding_container},o.default.createElement("div",{className:m.default.keybinding_searchbar},W()),o.default.createElement("div",{className:m.default.keybinding_body},j,o.default.createElement("div",{className:m.default.keybinding_list},o.default.createElement(l.RecycleList,{itemHeight:40,data:R,template:O,className:m.default.keybinding_list_container}))))};t.KeymapsView=p},79312:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEYMAPS_FILE_NAME=t.KEYMAPS_SCHEME=void 0,t.KEYMAPS_SCHEME="keymaps",t.KEYMAPS_FILE_NAME="keymaps.json"},25067:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79312),t),n.__exportStar(e(88811),t)},88811:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKeymapService=void 0,t.IKeymapService=Symbol("IKeymapService")},83507:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogModule=t.LogServiceClient=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(47548),_=e(49187);n.__exportStar(e(47548),t);var v=e(1700);Object.defineProperty(t,"LogServiceClient",{enumerable:!0,get:function(){return v.LogServiceClient}});let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.ILoggerManagerClient,useClass:_.LoggerManagerClient}],this.backServices=[{servicePath:l.LogServiceForClientPath,clientToken:l.ILoggerManagerClient}]}};t.LogModule=m,t.LogModule=m=n.__decorate([(0,r.Injectable)()],m)},49187:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerManagerClient=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(47548),_=e(1700);let v=class{constructor(){this.logLevelChangeEmitter=new o.Emitter}getLogger(p,s){const g=new _.LogServiceClient(p);return g.setup(this.logServiceForClient,s),g}getBrowserLogger(p){return new _.LogServiceClient(p)}async getLogFolder(){return await this.logServiceForClient.getLogFolder()}async setGlobalLogLevel(p){return await this.logServiceForClient.setGlobalLogLevel(p)}async getGlobalLogLevel(){return await this.logServiceForClient.getGlobalLogLevel()}async dispose(){return this.logLevelChangeEmitter.dispose(),await this.logServiceForClient.disposeAll()}get onDidChangeLogLevel(){return this.logLevelChangeEmitter.event}onDidLogLevelChanged(p){this.logLevelChangeEmitter.fire(p)}};t.LoggerManagerClient=v,n.__decorate([(0,r.Autowired)(l.LogServiceForClientPath),n.__metadata("design:type",Object)],v.prototype,"logServiceForClient",void 0),t.LoggerManagerClient=v=n.__decorate([(0,r.Injectable)()],v)},1700:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogServiceClient=void 0;const n=e(43718),r=e(47548);class o{constructor(_){this.level=r.LogLevel.Verbose,this.ready=new n.Deferred,this.namespace=_,this.debugLog=new r.DebugLog(_)}async setup(_,v){this.logServiceForClient=_,this.pid=v;const m=await this.logServiceForClient.getGlobalLogLevel();this.level=m,this.ready.resolve()}async getLevel(){return this.logServiceForClient?await this.logServiceForClient.getLevel(this.namespace):this.level}async setLevel(_){this.level=_,this.logServiceForClient&&await this.logServiceForClient.setLevel(this.namespace,_)}async verbose(..._){this.debugLog.verbose(..._),this.logServiceForClient&&await this.logServiceForClient.verbose(this.namespace,(0,r.format)(_),this.pid)}async debug(..._){this.debugLog.debug(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Debug)&&await this.logServiceForClient.debug(this.namespace,(0,r.format)(_),this.pid))}async log(..._){this.debugLog.log(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Info)&&await this.logServiceForClient.log(this.namespace,(0,r.format)(_),this.pid))}async warn(..._){this.debugLog.warn(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Warning)&&await this.logServiceForClient.warn(this.namespace,(0,r.format)(_),this.pid))}async error(..._){this.debugLog.error(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Error)&&await this.logServiceForClient.error(this.namespace,(0,r.format)(_),this.pid))}async critical(..._){this.debugLog.error(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Critical)&&await this.logServiceForClient.critical(this.namespace,(0,r.format)(_),this.pid))}async dispose(){this.debugLog.destroy(),this.logServiceForClient&&await this.logServiceForClient.disposeLogger(this.namespace)}}t.LogServiceClient=o},47548:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(4892),t),n.__exportStar(e(46196),t)},46196:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILogServiceForClient=void 0,t.format=e,t.ILogServiceForClient=Symbol("LogServiceForClient");function e(n){let r="";for(let o=0;o<n.length;o++){let l=n[o];if(l instanceof Error){const _=Array.prototype.slice.call(arguments);_[0]=l.stack,l=e(_)}else if(typeof l=="object")try{l=JSON.stringify(l)}catch{}else if(typeof l=="symbol")try{l=l.toString()}catch{}r+=(o>0?" ":"")+l}return r}},73344:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(47548),t)},9522:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccordionServiceFactory=t.AccordionService=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(46343)),l=e(76003),_=e(41869),v=e(81878),m=e(71707),p=e(95416),s=e(93899),g=e(68969),a=e(28423),h=e(17793);let u=class extends _.WithEventBus{get views(){return this.viewsObservable.get()}get state(){return this.stateObservable.get()}set alignment(E){this._alignment!==E&&(this._alignment=E,this.doUpdateResize())}constructor(E,f){super(),this.containerId=E,this.noRestore=f,this.forceRevealContextKeys=new Map,this.viewWhenContextkeys=new Set,this.appendedViewSet=new Set,this.viewsWithContextKey=new Set,this.viewsObservable=(0,a.observableValue)(this,[]),this.stateObservable=(0,a.observableValue)(this,{}),this.visibleViews=(0,a.derived)(this,d=>{const y=this.viewsObservable.read(d);return this.stateObservable.read(d),y.filter(b=>!this.getViewState(b.id).hidden)}),this.rendered=!1,this.menuId=`${s.MenuId.AccordionContext}/${this.containerId}`,this.toDispose=new Map,this.didChangeViewTitleEmitter=this.registerDispose(new _.Emitter),this.onDidChangeViewTitle=this.didChangeViewTitleEmitter.event,this.beforeAppendViewEmitter=this.registerDispose(new _.Emitter),this.onBeforeAppendViewEvent=this.beforeAppendViewEmitter.event,this.afterAppendViewEmitter=this.registerDispose(new _.Emitter),this.onAfterAppendViewEvent=this.afterAppendViewEmitter.event,this.afterDisposeViewEmitter=this.registerDispose(new _.Emitter),this.onAfterDisposeViewEvent=this.afterDisposeViewEmitter.event,this._alignment="vertical",this.doUpdateResize=(0,r.default)(()=>{var d,y;let b;if(Object.keys(this.state).forEach(A=>{this.state[A].hidden||this.state[A].collapsed||(b?(this.state[A].size||0)>(this.state[b].size||0)&&(b=A):b=A)}),b&&this.splitPanelService.isVisible&&this.expandedViews.length>1&&!((d=this.splitPanelService.rootNode)===null||d===void 0)&&d.clientHeight){const A=((y=this.splitPanelService.rootNode)===null||y===void 0?void 0:y.clientHeight)-this.getPanelFullHeight();if(A){const S=this.state;S[b].size+=A,(0,a.transaction)(D=>{this.stateObservable.set({...S},D)}),this.toggleOpen(b,!1)}}},16),this.storeState=()=>{this.noRestore||!this.rendered||this.layoutState.setState(p.LAYOUT_STATE.getContainerSpace(this.containerId),this.state)},this.handleSectionClick=(d,y,b)=>{this.doToggleOpen(d,y,b)},this.handleContextMenu=(d,y)=>{d.preventDefault();const b=this.ctxMenuService.createMenu({id:this.menuId,config:{args:[{viewId:y}]},contextKeyService:y?this.viewContextKeyRegistry.getContextKeyService(y):void 0}),A=b.getGroupedMenuNodes();b.dispose(),this.contextMenuRenderer.show({menuNodes:A[1],anchor:{x:d.clientX,y:d.clientY}})},this.addDispose((0,a.recomputeInitiallyAndOnChange)(this.visibleViews)),this.splitPanelService=this.splitPanelManager.getService(E),this.addDispose(this.splitPanelService),this.scopedCtxKeyService=this.contextKeyService.createScoped(),this.scopedCtxKeyService.createKey("triggerWithSection",!0),this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerGlobalToggleCommand(),label:(0,_.localize)("layout.view.hide","Hide")},group:"0_global",when:"triggerWithSection == true"}),this.viewContextKeyRegistry.afterContextKeyServiceRegistered(this.containerId,d=>{this.topViewKey=d.createKey("view",E),setTimeout(()=>{this.popViewKeyIfOnlyOneViewVisible()})}),this.addDispose(_.Event.debounce(this.contextKeyService.onDidChangeContext,(d,y)=>d||y.payload.affectsSome(this.viewWhenContextkeys),50)(d=>d&&this.handleContextKeyChange(),this)),this.splitPanelService.whenReady.then(()=>{this.listenWindowResize()})}updateViewTitle(E,f){const d=this.views.find(y=>y.id===E);d?(d.name=f,this.didChangeViewTitleEmitter.fire({id:E,title:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion title`)}updateViewDesciption(E,f){const d=this.views.find(y=>y.id===E);d?(d.description=f,this.didChangeViewTitleEmitter.fire({id:E,description:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion description`)}updateViewMessage(E,f){const d=this.views.find(y=>y.id===E);d?(d.message=f,this.didChangeViewTitleEmitter.fire({id:E,message:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion message`)}updateViewBadge(E,f){const d=this.views.find(y=>y.id===E);d?(d.badge=f,this.didChangeViewTitleEmitter.fire({id:E,badge:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion message`)}tryUpdateResize(){this.doUpdateResize()}restoreState(){if(this.noRestore)return;const E={};this.visibleViews.get().forEach(d=>E[d.id]={collapsed:!1,hidden:!1});const f=this.layoutState.getState(p.LAYOUT_STATE.getContainerSpace(this.containerId),E);(0,o.default)(f,E)||(0,a.transaction)(d=>{this.stateObservable.set({...f},d)}),this.popViewKeyIfOnlyOneViewVisible(),this.splitPanelService.whenReady.then(()=>{this.restoreSize(),this.rendered=!0})}restoreSize(){var E;let f=((E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientHeight)||0,d;if(this.visibleViews.get().forEach((y,b)=>{const A=this.state[y.id];A.collapsed?(this.setSize(b,0,!1,!0),f-=this.headerSize):!A.collapsed&&A.size&&(this.setSize(b,A.size,!1,!0),f-=A.size,d=b)}),d){const y=this.visibleViews.get()[d];this.setSize(d,this.state[y.id].size+f)}}initConfig(E){const{headerSize:f,minSize:d}=E;this.headerSize=f,this.minSize=d}registerContextService(E){let f=this.viewContextKeyRegistry.getContextKeyService(E);return f||(f=this.contextKeyService.createScoped(),f.createKey("view",E),this.viewContextKeyRegistry.registerContextKeyService(E,f)),f}getSectionToolbarMenu(E){const f=this.registerContextService(E),d=this.menuService.createMenu(s.MenuId.ViewTitle,f),y=this.views.find(b=>b.id===E);return y&&(y.titleMenu=d),d}updateView(E){(0,a.transaction)(f=>{const d=this.views;if(E.priority){const y=d.findIndex(b=>(b.priority||0)<(E.priority||0));d.splice(y===-1?d.length:y,0,E),this.viewsObservable.set([...d],f)}else this.viewsObservable.set([...d,E],f)})}appendView(E,f){if(this.appendedViewSet.has(E.id)&&!f)return;const d=new _.DisposableCollection;d.push(this.progressService.registerProgressIndicator(E.id));const y=this.views.findIndex(b=>b.id===E.id);if(y!==-1){(0,a.transaction)(b=>{const A=this.views;A[y]=Object.assign({},A[y],E),this.viewsObservable.set([...A],b)});return}if(E.when){this.viewsWithContextKey.add(E);const b=this.createRevealContextKey(E.id);if(this.fillKeysInWhenExpr(this.viewWhenContextkeys,E.when),!this.contextKeyService.match(E.when)&&!this.contextKeyService.match(b))return;this.appendedViewSet.add(E.id)}this.beforeAppendViewEmitter.fire(E.id),this.updateView(E),this.registerContextService(E.id),d.push(this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerVisibleToggleCommand(E.id,d),label:(E.name||E.id).toUpperCase()},group:"1_widgets"})),this.toDispose.set(E.id,d),this.popViewKeyIfOnlyOneViewVisible(),this.afterAppendViewEmitter.fire(E.id)}disposeView(E){const f=this.views.findIndex(y=>y.id===E);f>-1&&(0,a.transaction)(y=>{const b=this.views;b.splice(f,1),this.viewsObservable.set([...b],y)});const d=this.toDispose.get(E);d&&d.dispose(),this.appendedViewSet.delete(E),this.popViewKeyIfOnlyOneViewVisible(),this.afterDisposeViewEmitter.fire(E)}revealView(E){const f=this.forceRevealContextKeys.get(E);f&&f.key.set(!0)}disposeAll(){(0,a.transaction)(E=>{this.viewsObservable.set([],E)}),this.toDispose.forEach(E=>{E.dispose()})}onResize(E){if(E.payload.slotLocation&&this.state[E.payload.slotLocation]){const f=E.payload.slotLocation;_.fastdom.measureAtNextFrame(()=>{const d=document.getElementById(f);if(d){const y=this.state;y[f].size=d.clientHeight,(0,a.transaction)(b=>{this.stateObservable.set({...y},b)}),this.storeState()}})}}getPanelFullHeight(E){return Object.keys(this.state).filter(f=>this.views.find(d=>d.id===f)&&f!==E).reduce((f,d)=>f+(this.state[d].collapsed?this.headerSize:this.state[d].hidden?0:this.state[d].size),0)}listenWindowResize(){window.addEventListener("resize",this.doUpdateResize),this.addDispose({dispose:()=>window.removeEventListener("resize",this.doUpdateResize)})}createRevealContextKey(E){const f=`forceShow.${E}`;return this.forceRevealContextKeys.set(E,{when:`${f} == true`,key:this.contextKeyService.createKey(f,!1)}),this.viewWhenContextkeys.add(f),`${f} == true`}registerGlobalToggleCommand(){const E=`view-container.hide.${this.containerId}`;return this.commandRegistry.registerCommand({id:E},{execute:({viewId:f})=>{this.doToggleView(f)},isEnabled:()=>this.visibleViews.get().length>1}),E}registerVisibleToggleCommand(E,f){const d=`view-container.hide.${E}`;return f.push(this.commandRegistry.registerCommand({id:d},{execute:({forceShow:y}={})=>{this.doToggleView(E,y)},isToggled:()=>!this.getViewState(E).hidden,isEnabled:()=>this.getViewState(E).hidden||this.visibleViews.get().length>1})),d}doToggleView(E,f){const d=this.getViewState(E);let y;f===void 0?y=!d.hidden:y=!f,d.hidden=y,this.updateViewState(E,d),this.popViewKeyIfOnlyOneViewVisible(),this.storeState()}popViewKeyIfOnlyOneViewVisible(){if(!this.topViewKey)return;const E=this.visibleViews.get();E.length===1?this.topViewKey.set(E[0].id):this.topViewKey.reset()}toggleViewVisibility(E,f){this.doToggleView(E,f)}get expandedViews(){return this.views.filter(E=>{const f=this.state[E.id];return!f||f&&!f.hidden&&!f.collapsed})}toggleOpen(E,f){const d=this.visibleViews.get().findIndex(y=>y.id===E);d>-1&&this.doToggleOpen(E,f,d,!0)}getViewState(E){let f=this.state[E];const d=this.views.find(y=>y.id===E);return f||(this.updateViewState(E,{collapsed:d?.collapsed||!1,hidden:d?.hidden||!1}),f=this.state[E]),f}updateViewState(E,f){const d=this.state;d[E]=f,(0,a.transaction)(y=>{this.stateObservable.set({...d},y)})}doToggleOpen(E,f,d,y){const b=this.getViewState(E);this.updateViewState(E,{...b,collapsed:f});const A=this._alignment==="horizontal";let S;if(f)S=this.setSizeByAlignment(d,0,!1,y,A);else{const D=this.expandedViews.length===1?this.getAvailableSizeByAlignment(A):b.size||this.minSize;S=this.setSizeByAlignment(d,D,!1,y,A)}this.adjustAdjacentViews(d,S,y,A),this.eventBus.fire(new h.ViewCollapseChangedEvent({viewId:E,collapsed:f}))}setSizeByAlignment(E,f,d,y,b){return b?this.setSizeHorizontal(E,f,d,y):this.setSize(E,f,d,y)}getAvailableSizeByAlignment(E){return E?this.getAvailableSizeHorizontal():this.getAvailableSize()}adjustAdjacentViews(E,f,d,y){const b=this.visibleViews.get();for(let A=b.length-1;A>E;A--)this.getViewState(b[A].id).collapsed!==!0?f=this.setSizeByAlignment(A,f,!0,d,y):this.setSizeByAlignment(A,0,!1,d,y);for(let A=E-1;A>=0;A--)(this.state[b[A].id]||{}).collapsed!==!0?f=this.setSizeByAlignment(A,f,!0,d,y):this.setSizeByAlignment(A,0,!1,d,y)}setSize(E,f,d,y){var b;const A=this.visibleViews.get()[E],S=(b=this.splitPanelService.rootNode)===null||b===void 0?void 0:b.clientHeight,D=this.splitPanelService.panels[E];if(!D)return 0;y||D.classList.add("resize-ease"),!f&&!d?(f=this.headerSize,D.classList.add(v.RESIZE_LOCK)):D.classList.remove(v.RESIZE_LOCK);const I=D.clientHeight,w=this.getViewState(A.id);let T=f;if(d&&(T=Math.max(I-f,this.minSize)),E===this.expandedViews.length-1&&(0,_.isDefined)(S))if(T+E*this.minSize>S)T-=T+E*this.minSize-S;else{const R=this.getPanelFullHeight(A.id);T+R<S&&(T+=S-(T+R))}if(this.rendered){let R;f===this.headerSize?R=I:R=T,R!==this.headerSize&&(w.size=R)}return this.storeState(),w.nextSize=T,y||setTimeout(()=>{D.classList.remove("resize-ease")},200),d?T-(I-f):f-I}getAvailableSize(){var E;const f=(E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientHeight;return f?f-(this.visibleViews.get().length-1)*this.headerSize:0}setSizeHorizontal(E,f,d,y){var b;const A=this.visibleViews.get()[E],S=(b=this.splitPanelService.rootNode)===null||b===void 0?void 0:b.clientWidth,D=this.splitPanelService.panels[E];if(!D)return 0;y||D.classList.add("resize-ease-horizontal"),!f&&!d?(f=this.headerSize,D.classList.add(v.RESIZE_LOCK)):D.classList.remove(v.RESIZE_LOCK);const I=D.clientWidth,w=this.getViewState(A.id);let T=f;if(d&&(T=Math.max(I-f,this.minSize)),E===this.expandedViews.length-1&&(0,_.isDefined)(S))if(T+E*this.minSize>S)T-=T+E*this.minSize-S;else{const R=this.getPanelFullWidthHorizontal(A.id);T+R<S&&(T+=S-(T+R))}if(this.rendered){let R;f===this.headerSize?R=I:R=T,R!==this.headerSize&&(w.size=R)}return this.storeState(),w.nextSize=T,y||setTimeout(()=>{D.classList.remove("resize-ease-horizontal")},200),d?T-(I-f):f-I}getAvailableSizeHorizontal(){var E;const f=(E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientWidth;return f?f-(this.visibleViews.get().length-1)*this.headerSize:0}getPanelFullWidthHorizontal(E){return Object.keys(this.state).filter(f=>this.views.find(d=>d.id===f)&&f!==E).reduce((f,d)=>f+(this.state[d].collapsed?this.headerSize:this.state[d].hidden?0:this.state[d].size),0)}handleContextKeyChange(){Array.from(this.viewsWithContextKey.values()).forEach(E=>{this.contextKeyService.match(E.when)||this.contextKeyService.match(this.forceRevealContextKeys.get(E.id).when)?this.appendView(E):this.disposeView(E.id)})}fillKeysInWhenExpr(E,f){this.contextKeyService.getKeysInWhen(f).forEach(y=>{E.add(y)})}};t.AccordionService=u,n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",m.SplitPanelManager)],u.prototype,"splitPanelManager",void 0),n.__decorate([(0,l.Autowired)(s.AbstractMenuService),n.__metadata("design:type",s.AbstractMenuService)],u.prototype,"menuService",void 0),n.__decorate([(0,l.Autowired)(s.AbstractContextMenuService),n.__metadata("design:type",s.AbstractContextMenuService)],u.prototype,"ctxMenuService",void 0),n.__decorate([(0,l.Autowired)(s.IMenuRegistry),n.__metadata("design:type",s.IMenuRegistry)],u.prototype,"menuRegistry",void 0),n.__decorate([(0,l.Autowired)(_.CommandRegistry),n.__metadata("design:type",Object)],u.prototype,"commandRegistry",void 0),n.__decorate([(0,l.Autowired)(s.ICtxMenuRenderer),n.__metadata("design:type",s.ICtxMenuRenderer)],u.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",_.ViewContextKeyRegistry)],u.prototype,"viewContextKeyRegistry",void 0),n.__decorate([(0,l.Autowired)(_.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),n.__decorate([(0,l.Autowired)(p.LayoutState),n.__metadata("design:type",p.LayoutState)],u.prototype,"layoutState",void 0),n.__decorate([(0,l.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],u.prototype,"progressService",void 0),n.__decorate([(0,l.Autowired)(_.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,_.OnEvent)(_.ResizeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.ResizeEvent]),n.__metadata("design:returntype",void 0)],u.prototype,"onResize",null),t.AccordionService=u=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Boolean])],u),t.AccordionServiceFactory=Symbol("AccordionServiceFactory")},70936:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Panel=t.AccordionContainer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(1149),m=e(43718),p=e(9522),s=e(95867),g=({alignment:h="vertical",views:u,containerId:c,headerSize:E=24,minSize:f=120,className:d,noRestore:y,style:b})=>{const A=(0,l.useInjectable)(v.LayoutViewSizeConfig),S=(0,l.useInjectable)(p.AccordionServiceFactory)(c,y);S.alignment=h;const D=(0,l.useAutorun)(S.visibleViews);(0,l.useAutorun)(S.stateObservable);const I=(0,o.useMemo)(()=>E||A.accordionHeaderSizeHeight,[E]);return o.default.useEffect(()=>{if(u.length)for(const w of u)S.appendView(w)},[u]),o.default.useEffect(()=>{S.initConfig({headerSize:I,minSize:f})},[]),o.default.createElement(_.SplitPanel,{className:(0,r.default)(d,{horizontal:h==="horizontal"}),style:b,headerSize:E,dynamicTarget:!0,id:c,resizeKeep:!1,direction:h==="horizontal"?"left-to-right":"top-to-bottom"},D.map((w,T)=>{const R=S.getViewState(w.id),P=w.titleMenu||S.getSectionToolbarMenu(w.id),{collapsed:O,nextSize:M}=R;return o.default.createElement(s.AccordionSection,{noHeader:D.length===1,onItemClick:()=>{S.handleSectionClick(w.id,!O,T)},onContextMenuHandler:S.handleContextMenu,alignment:h,header:w.name&&(0,m.replaceLocalizePlaceholder)(w.name)||w.id,viewId:w.id,key:w.id,message:w.message,description:w.description,badge:w.badge,title:w.name,expanded:!O,accordionService:S,index:T,headerSize:E,minSize:E,initialProps:w.initialProps,titleMenu:P,titleMenuContext:w.titleMenuContext,savedSize:O?E:M,flex:w.weight||1},w.component)}))};t.AccordionContainer=g,t.AccordionContainer.displayName="AccordionContainer";const a=({children:h})=>o.default.createElement("div",null,h);t.Panel=a,t.Panel.displayName="Panel"},95867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccordionSection=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),_=e(25918),v=e(93899),m=e(68969),p=e(68974),s=e(69589),g=e(52416),a=n.__importDefault(e(81388)),h={tabIndex:0},u=({header:c,description:E,message:f,headerClass:d,onItemClick:y,noHeader:b,children:A,badge:S,headerSize:D,viewId:I,initialProps:w,titleMenu:T,titleMenuContext:R,expanded:P,accordionService:O,onContextMenuHandler:M,alignment:k})=>{const F=(0,l.useInjectable)(g.IIconService),L=(0,l.useDesignStyles)(a.default.actions_wrap,"actions_wrap"),B=(0,l.useDesignStyles)(a.default.kt_split_panel,"kt_split_panel"),U=(0,l.useDesignStyles)(a.default.kt_split_panel_header,"kt_split_panel_header"),W=(0,l.useDesignStyles)(a.default.kt_split_panel_body,"kt_split_panel_body"),j=(0,l.useDesignStyles)(a.default.section_badge,"section_badge"),Q=o.default.useRef(null),[G,Z]=o.default.useState({header:c,description:E,message:f,badge:S});o.default.useEffect(()=>{const ie=O.onDidChangeViewTitle(({id:he,title:me,description:q,message:Ee,badge:ue})=>{let te=!1;const fe={...G};I===he&&me&&me!==G.header&&(fe.header=me,te=!0),I===he&&ue!==G.badge&&(fe.badge=ue,te=!0),I===he&&q&&q!==G.description&&(fe.description=q,te=!0),I===he&&Ee&&Ee!==G.message&&(fe.message=Ee,te=!0),te&&Z(fe)});return()=>{ie.dispose()}},[]);const $=o.default.useCallback(()=>{y()},[y]),V=o.default.useMemo(()=>({overflow:P?"auto":"hidden"}),[P]),H=(0,l.useViewState)(I,Q,!0),Y=(0,l.useInjectable)(m.IProgressService).getIndicator(I),X=A,oe=o.default.useMemo(()=>P?`${D}px`:k==="horizontal"?"100%":`${D}px`,[P,D,k]);return o.default.createElement("div",{className:(0,r.default)(B,{horizontal:k==="horizontal"}),"data-view-id":I,draggable:!1},!b&&o.default.createElement("div",{...h,className:(0,r.default)(U,d),onClick:$,onContextMenu:ie=>M(ie,I),style:{height:oe,lineHeight:oe}},o.default.createElement("div",{className:a.default.label_wrap},o.default.createElement("i",{className:(0,r.default)((0,l.getIcon)("arrow-down"),a.default.arrow_icon,P?"":a.default.kt_mod_collapsed)}),o.default.createElement("div",{className:a.default.section_label,style:{lineHeight:D+"px"}},G.header),G.description&&o.default.createElement("div",{className:a.default.section_description,style:{lineHeight:D+"px"}},typeof G.description=="string"?(0,s.transformLabelWithCodicon)(G.description,{},F.fromString.bind(F)):G.description),G.badge&&o.default.createElement("div",{className:j},typeof G.badge=="string"?G.badge:G.badge.value)),P&&T&&o.default.createElement("div",{className:L},(0,v.isIMenu)(T)?o.default.createElement(_.InlineActionBar,{menus:T,context:R}):o.default.createElement(_.InlineMenuBar,{menus:T,context:R}))),o.default.createElement("div",{className:(0,r.default)([W,{[a.default.hide]:!P}]),style:V,ref:Q},o.default.createElement(p.ProgressBar,{className:a.default.progressBar,progressModel:Y?.progressModel}),o.default.createElement(l.ErrorBoundary,null,G.message&&o.default.createElement("div",{className:a.default.kt_split_panel_message},G.message),o.default.createElement(X,{...w,viewState:{height:H.height-(G.message?22:0),width:H.width}}))))};t.AccordionSection=u},91527:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleBar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(752),_=n.__importDefault(e(81388));t.TitleBar=r.default.memo(v=>{const m=(0,o.useDesignStyles)(_.default.titlebar,"titlebar"),p=(0,o.useInjectable)(l.TabbarServiceFactory)(v.side),s=r.default.useCallback(a=>{v.containerId&&v.side&&p.handleDragStart(a,v.containerId)},[v.containerId,v.side,p]),g=r.default.useCallback(a=>{p.handleDragEnd(a)},[p]);return r.default.createElement("div",{className:m,style:{height:v.height}},!v.draggable&&r.default.createElement("h1",null,v.title),!!v.draggable&&r.default.createElement("h1",{draggable:!0,style:{cursor:"pointer"},onDragStart:s,onDragEnd:g},v.title),v.menubar||null)}),t.TitleBar.displayName="TitleBar"},75053:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RETRACT_PANEL_COMMAND=t.EXPAND_PANEL_COMMAND=t.IS_VISIBLE_PANEL_COMMAND=t.IS_VISIBLE_EXTEND_VIEW_COMMAND=t.IS_VISIBLE_VIEW_COMMAND=t.TOGGLE_PANEL_COMMAND=t.TOGGLE_EXTEND_VIEW_COMMAND=t.TOGGLE_VIEW_COMMAND=t.WORKBENCH_ACTION_CLOSEPANEL=t.WORKBENCH_ACTION_CLOSESIDECAR=t.RETRACT_BOTTOM_PANEL=t.EXPAND_BOTTOM_PANEL=t.IS_VISIBLE_RIGHT_PANEL_COMMAND=t.IS_VISIBLE_LEFT_PANEL_COMMAND=t.IS_VISIBLE_BOTTOM_PANEL_COMMAND=t.TOGGLE_BOTTOM_PANEL_COMMAND=t.TOGGLE_RIGHT_PANEL_COMMAND=t.TOGGLE_LEFT_PANEL_COMMAND=void 0;const n=e(41869);t.TOGGLE_LEFT_PANEL_COMMAND={id:"main-layout.left-panel.toggle",delegate:"main-layout.view.toggle"},t.TOGGLE_RIGHT_PANEL_COMMAND={id:"main-layout.right-panel.toggle",delegate:"main-layout.extend-view.toggle"},t.TOGGLE_BOTTOM_PANEL_COMMAND={id:"main-layout.bottom-panel.toggle",delegate:"main-layout.panel.toggle"},t.IS_VISIBLE_BOTTOM_PANEL_COMMAND={id:"main-layout.bottom-panel.is-visible",delegate:"main-layout.panel.is-visible"},t.IS_VISIBLE_LEFT_PANEL_COMMAND={id:"main-layout.left-panel.is-visible",delegate:"main-layout.view.is-visible"},t.IS_VISIBLE_RIGHT_PANEL_COMMAND={id:"main-layout.right-panel.is-visible",delegate:"main-layout.extend-view.is-visible"},t.EXPAND_BOTTOM_PANEL={id:"main-layout.bottom-panel.expand",delegate:"main-layout.panel.expand"},t.RETRACT_BOTTOM_PANEL={id:"main-layout.bottom-panel.retract",delegate:"main-layout.panel.retract"},t.WORKBENCH_ACTION_CLOSESIDECAR={id:"workbench.action.closeSidebar",label:"%main-layout.sidebar.hide%"},t.WORKBENCH_ACTION_CLOSEPANEL={id:"workbench.action.closePanel"},t.TOGGLE_VIEW_COMMAND={id:"main-layout.view.toggle",label:"%main-layout.view.toggle%"},t.TOGGLE_EXTEND_VIEW_COMMAND={id:"main-layout.extend-view.toggle",label:"%main-layout.extend-view.toggle%"},t.TOGGLE_PANEL_COMMAND={id:"main-layout.panel.toggle",iconClass:(0,n.getIcon)("minus"),label:"%main-layout.panel.toggle%"},t.IS_VISIBLE_VIEW_COMMAND={id:"main-layout.view.is-visible"},t.IS_VISIBLE_EXTEND_VIEW_COMMAND={id:"main-layout.extend-view.is-visible"},t.IS_VISIBLE_PANEL_COMMAND={id:"main-layout.panel.is-visible"},t.EXPAND_PANEL_COMMAND={id:"main-layout.panel.expand",label:"%layout.tabbar.expand%",iconClass:(0,n.getIcon)("expand")},t.RETRACT_PANEL_COMMAND={id:"main-layout.panel.retract",label:"%layout.tabbar.retract%",iconClass:(0,n.getIcon)("shrink")}},25072:(x,t,e)=>{"use strict";var n;n={value:!0},t.s=void 0;const r=e(41869),o=e(17793);t.s={[r.SlotLocation.top]:{modules:["@opensumi/ide-menu-bar"]},[r.SlotLocation.action]:{modules:["@opensumi/ide-toolbar-action"]},[r.SlotLocation.view]:{modules:[o.DROP_VIEW_CONTAINER,"@opensumi/ide-explorer","@opensumi/ide-search","@opensumi/ide-scm","@opensumi/ide-debug","@opensumi/ide-extension-manager","@opensumi/ide-notebook"]},[r.SlotLocation.extendView]:{modules:[o.DROP_EXTEND_VIEW_CONTAINER]},[r.SlotLocation.main]:{modules:["@opensumi/ide-editor"]},[r.SlotLocation.panel]:{modules:[o.DROP_PANEL_CONTAINER,"@opensumi/ide-terminal-next","@opensumi/ide-output","debug-console","@opensumi/ide-markers"]},[r.SlotLocation.statusBar]:{modules:["@opensumi/ide-status-bar"]},[r.SlotLocation.extra]:{modules:["breadcrumb-menu"]}}},45395:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelDropArea=t.ExtendViewDropArea=t.ViewDropArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(17793),_=n.__importDefault(e(36623)),v=g=>{const{location:a}=g,h=(0,o.useInjectable)(l.IMainLayoutService),u=r.default.useCallback(c=>{var E;const f=(E=c.dataTransfer)===null||E===void 0?void 0:E.getData("containerId");h.moveContainerTo(f,a),h.hideDropArea()},[h,a]);return r.default.createElement("div",{className:_.default.drop_area,onDrop:u,onDragOver:c=>{c.preventDefault()}},(0,o.localize)("main-layout.drop-area.tip"))},m=()=>r.default.createElement(v,{location:o.SlotLocation.view});t.ViewDropArea=m;const p=()=>r.default.createElement(v,{location:o.SlotLocation.extendView});t.ExtendViewDropArea=p;const s=()=>r.default.createElement(v,{location:o.SlotLocation.panel});t.PanelDropArea=s},7480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainLayoutModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(17793),_=e(9522),v=e(22537),m=e(53576),p=e(752),s=e(58296);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.MainLayoutModuleContribution,{token:l.IMainLayoutService,useClass:v.LayoutService},{token:l.IViewsRegistry,useClass:s.ViewsRegistry},{token:p.TabbarServiceFactory,useFactory:p.TabbarServiceFactoryFn},{token:_.AccordionServiceFactory,useFactory:h=>(u,c)=>h.get(l.IMainLayoutService).getAccordionService(u,c)}],this.contributionProvider=l.MainLayoutContribution}};t.MainLayoutModule=g,t.MainLayoutModule=g=n.__decorate([(0,r.Injectable)()],g)},5567:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoFocusedInput=void 0;const r=e(85608).__importStar(e(14041)),o=e(97267),l=e(48560),_=e(17793),v=({containerId:m,...p})=>{const s=(0,l.useInjectable)(_.IMainLayoutService),g=(0,r.useRef)(null),a=r.default.useCallback(()=>{g&&g.current&&queueMicrotask(()=>{var h;return(h=g.current)===null||h===void 0?void 0:h.focus()})},[g.current]);return(0,r.useEffect)(()=>{a();const h=s.getTabbarHandler(m),u=h?.onActivate(a);return()=>{u?.dispose()}},[s]),r.default.createElement(o.Input,{ref:g,...p})};t.AutoFocusedInput=v},22537:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutService=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),_=e(81878),v=e(95416),m=e(93899),p=e(43718),s=e(28423),g=e(52416),a=e(17793),h=e(9522),u=e(752),c=e(58999),E={[l.SlotLocation.view]:{currentId:void 0,size:void 0},[l.SlotLocation.extendView]:{currentId:"",size:void 0},[l.SlotLocation.panel]:{currentId:void 0,size:void 0},containerLocations:{}};let f=class extends l.WithEventBus{constructor(){super(...arguments),this.handleMap=new Map,this.tabbarServices=new Map,this.accordionServices=new Map,this.pendingViewsMap=new Map,this.viewToContainerMap=new Map,this.disposableMap=new Map,this.state={},this.customViews=new Map,this.debug=(0,p.getDebugLogger)(),this.viewReady=new p.Deferred,this.restoreTabbarService=async y=>{this.state=(0,_.fixLayout)(this.layoutState.getState(v.LAYOUT_STATE.MAIN,E));const{currentId:b,size:A}=this.state[y.location]||{};if(y.prevSize=A,this.state.containerLocations){for(const[D,I]of Object.entries(this.state.containerLocations))if(I===y.location&&!this.isDropContainer(D)){const w=this.findTabbarServiceByContainerId(D);w&&w.location!==y.location?this.moveContainerTo(D,y.location):(delete this.state.containerLocations[D],this.layoutState.setState(v.LAYOUT_STATE.MAIN,this.state))}}const S=this.getDefaultContainer(y);this.restoreContainerId(y,b,S)},this.holdTabbarComponent=new Map,this.tabbarUpdateSet=new Set}didMount(){for(const[b,A]of this.pendingViewsMap.entries())A.forEach(({view:S,props:D})=>{this.collectViewComponent(S,b,D)});for(const b of this.contributions.getContributions())b.onDidRender&&b.onDidRender();const y=[];this.tabbarServices.forEach(b=>{l.slotRendererRegistry.isTabbar(b.location)&&b.containersMap.size>0&&y.push(b.viewReady.promise)}),Promise.all(y).then(()=>{this.viewReady.resolve()})}storeState(y,b){this.state[y.location]={currentId:b,size:y.prevSize},this.layoutState.setState(v.LAYOUT_STATE.MAIN,this.state)}onThemeChange(y){var b,A,S,D,I;const w=y.payload.theme;localStorage.setItem("theme",JSON.stringify({menuBarBackground:(b=w.getColor("kt.menubar.background"))===null||b===void 0?void 0:b.toString(),sideBarBackground:(A=w.getColor("sideBar.background"))===null||A===void 0?void 0:A.toString(),editorBackground:(S=w.getColor("editor.background"))===null||S===void 0?void 0:S.toString(),panelBackground:(D=w.getColor("panel.background"))===null||D===void 0?void 0:D.toString(),statusBarBackground:(I=w.getColor("statusBar.background"))===null||I===void 0?void 0:I.toString()}))}getDefaultContainer(y){var b,A,S,D;const I=this.appConfig.defaultPanels,w=I&&I[y.location];if(I&&w!==void 0){if(!w)return"";if(y.containersMap.has(w))return w;const T=this.componentRegistry.getComponentRegistryInfo(w);if(T&&((A=(b=this.appConfig.layoutConfig[y.location])===null||b===void 0?void 0:b.modules)===null||A===void 0?void 0:A.includes(w)))return T.options.containerId;this.logger.warn(`[defaultPanels] No \`${w}\` view found!`)}return(D=(S=y.visibleContainers[0])===null||S===void 0?void 0:S.options)===null||D===void 0?void 0:D.containerId}restoreContainerId(y,b,A){if((0,p.isUndefined)(b)){(0,p.isUndefined)(A)?y.updateNextContainerId():y.updateCurrentContainerId(A);return}if(b&&!this.isDropContainer(b)){if(y.containersMap.has(b)){y.updateCurrentContainerId(b);return}y.updateCurrentContainerId(A||""),y.updateNextContainerId(b);return}(b===""||this.isDropContainer(b))&&y.updateCurrentContainerId("")}findTabbarServiceByContainerId(y){let b;for(const A of this.tabbarServices.values())if(A.containersMap.has(y)){b=A;break}return b}moveContainerTo(y,b){var A;const S=this.findTabbarServiceByContainerId(y);if(!S){this.logger.error(`cannot find container: ${y}`);return}const D=S.getContainer(y);if(!D){this.logger.error(`cannot find container: ${y}`);return}if(((A=D.options)===null||A===void 0?void 0:A.draggable)===!1){this.logger.warn(`container: ${y} is not draggable`);return}const I=this.getTabbarService(b);S.removeContainer(y),(!S.visibleContainers.length||S.currentContainerId.get()===y)&&this.toggleSlot(S.location,!1),I.dynamicAddContainer(y,D);const w=this.injector.get(c.TabBarHandler,[y,this.getTabbarService(I.location)]);this.handleMap.set(y,w),this.state.containerLocations||(this.state.containerLocations={}),this.state.containerLocations[y]=b}showDropAreaForContainer(y){const b=this.findTabbarServiceByContainerId(y),A=this.tabbarServices.get(l.SlotLocation.panel),S=this.tabbarServices.get(l.SlotLocation.extendView),D=this.tabbarServices.get(l.SlotLocation.view);if(!b){this.logger.error(`cannot find container: ${y}`);return}const I={[l.SlotLocation.extendView]:[A,D],[l.SlotLocation.panel]:[S,D],[l.SlotLocation.view]:[A,S]},w={[l.SlotLocation.panel]:a.DROP_PANEL_CONTAINER,[l.SlotLocation.extendView]:a.DROP_EXTEND_VIEW_CONTAINER,[l.SlotLocation.view]:a.DROP_VIEW_CONTAINER};(0,s.transaction)(T=>{var R;(R=I[b?.location])===null||R===void 0||R.forEach(P=>{P?.updateCurrentContainerId(w[P?.location],T)})})}hideDropArea(){const y=this.tabbarServices.get(l.SlotLocation.panel),b=this.tabbarServices.get(l.SlotLocation.extendView),A=this.tabbarServices.get(l.SlotLocation.view);(0,s.transaction)(S=>{y?.currentContainerId.get()===a.DROP_PANEL_CONTAINER&&y.updateCurrentContainerId(y.previousContainerId||"",S),b?.currentContainerId.get()===a.DROP_EXTEND_VIEW_CONTAINER&&b.updateCurrentContainerId(b.previousContainerId||"",S),A?.currentContainerId.get()===a.DROP_VIEW_CONTAINER&&A.updateCurrentContainerId(A.previousContainerId||"",S)})}isVisible(y){return!!this.getTabbarService(y).currentContainerId.get()}isViewVisible(y){const b=this.getTabbarHandler(y);if(!b||!b.isActivated())return!1;const A=b.accordionService.getViewState(y);return!A.collapsed&&!A.hidden}toggleSlot(y,b,A){var S;const D=this.getTabbarService(y);if(!D){this.debug.error(`Unable to switch panels because no TabbarService corresponding to \`${y}\` was found.`);return}b===!0?D.updateCurrentContainerId(this.findNonDropContainerId(D)):b===!1?D.updateCurrentContainerId(""):D.updateCurrentContainerId(D.currentContainerId.get()?"":this.findNonDropContainerId(D)),D.currentContainerId.get()&&A&&((S=D.resizeHandle)===null||S===void 0||S.setSize(A))}isDropContainer(y){return[a.DROP_PANEL_CONTAINER,a.DROP_EXTEND_VIEW_CONTAINER,a.DROP_VIEW_CONTAINER].includes(y)}findNonDropContainerId(y){const b=y.currentContainerId.get();if(b&&!this.isDropContainer(b))return b;if(y.previousContainerId&&!this.isDropContainer(y.previousContainerId))return y.previousContainerId;for(const A of y.containersMap.keys())if(!this.isDropContainer(A))return A;return""}getTabbarService(y){const b=this.tabbarServices.get(y)||this.injector.get(u.TabbarService,[y]);if(!this.tabbarServices.get(y)){b.addDispose(b.onCurrentChange(({currentId:S})=>{if(this.storeState(b,S),this.eventBus.fire(new l.ExtensionActivateEvent({topic:"onView",data:S})),S&&a.SUPPORT_ACCORDION_LOCATION.has(b.location)){const D=this.getAccordionService(S);D?.tryUpdateResize(),D?.expandedViews.forEach(I=>{this.eventBus.fire(new l.ExtensionActivateEvent({topic:"onView",data:I.id}))})}})),b.viewReady.promise.then(()=>b.restoreState()).then(()=>this.restoreTabbarService(b)).catch(S=>{this.logger.error(`[TabbarService:${y}] restore state error`,S)});const A=(0,r.default)(()=>this.storeState(b,b.currentContainerId.get()),100);if(b.addDispose(b.onSizeChange(A)),y===l.SlotLocation.panel){const S=(0,r.default)(()=>void this.bottomExpanded,100);b.addDispose(b.onSizeChange(()=>S))}this.tabbarServices.set(y,b)}return b}getAllAccordionService(){return this.accordionServices}getAccordionService(y,b){let A=this.accordionServices.get(y);return A||(A=this.injector.get(h.AccordionService,[y,b]),this.accordionServices.set(y,A)),A}getTabbarHandler(y){let b=this.doGetTabbarHandler(y);if(!b){const A=this.viewToContainerMap.get(y);A?b=this.doGetTabbarHandler(A||""):this.debug.warn(`${y} view tabbar not found.`)}return b}getContainer(y){for(const b of this.tabbarServices.values()){const A=b.getContainer(y);if(A)return A}}getExtraTopMenu(){return this.contextmenuService.createMenu({id:m.MenuId.ActivityBarTopExtra})}getExtraMenu(){return this.contextmenuService.createMenu({id:m.MenuId.ActivityBarExtra})}doGetTabbarHandler(y){let b=this.handleMap.get(y);if(!b){let A;for(const S of this.tabbarServices.values())if(S.getContainer(y)){A=S.location;break}A&&(b=this.injector.get(c.TabBarHandler,[y,this.getTabbarService(A)]),this.handleMap.set(y,b))}return b}collectTabbarComponent(y,b,A,S){if(S&&this.debug.warn("collectTabbarComponent api warning: Please move react component into options.component!"),A=this.mapSideToLocation(A),b.hideIfEmpty&&!y.length&&!b.component){this.holdTabbarComponent.set(b.containerId,{views:y,options:b,side:A}),this.tabbarUpdateSet.has(b.containerId)&&this.tryUpdateTabbar(b.containerId);const I=this.getAccordionService(b.containerId);return I.addDispose(I.onBeforeAppendViewEvent(()=>{this.tryUpdateTabbar(b.containerId)})),I.addDispose(I.onAfterDisposeViewEvent(()=>{I.views.length===0&&(this.disposeContainer(b.containerId),this.holdTabbarComponent.set(b.containerId,{views:y,options:b,side:A}))})),b.containerId}return this.getTabbarService(A).registerContainer(b.containerId,{views:y,options:b}),y.forEach(I=>{this.viewToContainerMap.set(I.id,b.containerId)}),b.containerId}mapSideToLocation(y){switch(y){case"left":return l.SlotLocation.view;case"right":return l.SlotLocation.extendView;case"bottom":return l.SlotLocation.panel;default:return y}}getViewAccordionService(y){const b=this.viewToContainerMap.get(y);if(b)return this.getAccordionService(b)}collectViewComponent(y,b,A={},S){this.customViews.set(y.id,y),this.viewToContainerMap.set(y.id,b);const D=this.getAccordionService(b);return A&&(y.initialProps=A),D.appendView(y,S?.isReplace),D.views.length===1&&(this.tabbarUpdateSet.add(b),this.tryUpdateTabbar(b)),S?.fromExtension&&this.disposableMap.set(y.id,this.commandRegistry.registerCommand({id:`${y.id}.focus`},{execute:async()=>(await this.ensureViewReady(y.id),this.commandService.executeCommand(`workbench.view.extension.${b}`,{forceShow:!0}))})),b}ensureViewReady(y){const b=this.viewToContainerMap.get(y),A=new p.Deferred,S=this.getAccordionService(b);return S.visibleViews.get().find(D=>D.id===y)?A.resolve():S.addDispose(S.onAfterAppendViewEvent(D=>{D===y&&A.resolve()})),A.promise}tryUpdateTabbar(y){const b=this.holdTabbarComponent.get(y);b&&(this.getTabbarService(b.side).registerContainer(y,{views:b.views,options:b.options}),this.tabbarUpdateSet.delete(y),this.holdTabbarComponent.delete(y))}replaceViewComponent(y,b){const A=this.viewToContainerMap.get(y.id);if(!A){this.debug.warn(`The container corresponding to \`${y.id}\` was not found, please check the incoming parameters!`);return}const S=this.customViews.get(y.id);S&&(y=Object.assign(S,y)),this.collectViewComponent(y,A,b,{isReplace:!0})}disposeViewComponent(y){const b=this.disposableMap.get(y);b&&b.dispose();const A=this.viewToContainerMap.get(y);if(!A){this.debug.warn(`The container corresponding to \`${y}\` was not found, please check the incoming parameters!`);return}this.getAccordionService(A).disposeView(y)}revealView(y){const b=this.viewToContainerMap.get(y);if(!b){this.debug.warn(`The container corresponding to \`${y}\` was not found, please check the incoming parameters!`);return}this.getAccordionService(b).revealView(y)}disposeContainer(y){let b;for(const A of this.tabbarServices.values())if(A.getContainer(y)){b=A.location;break}b?this.getTabbarService(b).disposeContainer(y):this.debug.warn(`The Tabbar to the \`${y}\` was not found.`)}expandBottom(y){const b=this.getTabbarService(l.SlotLocation.panel);b.currentContainerId.get()||b.updateCurrentContainerId(b.currentContainerId.get()||b.previousContainerId||b.containersMap.keys().next().value),b.doExpand(y),this.contextKeyService.createKey("bottomFullExpanded",b.isExpanded)}get bottomExpanded(){const y=this.getTabbarService(l.SlotLocation.panel);return this.contextKeyService.createKey("bottomFullExpanded",y.isExpanded),y.isExpanded}};t.LayoutService=f,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(a.MainLayoutContribution),n.__metadata("design:type",Object)],f.prototype,"contributions",void 0),n.__decorate([(0,o.Autowired)(m.IMenuRegistry),n.__metadata("design:type",m.IMenuRegistry)],f.prototype,"menus",void 0),n.__decorate([(0,o.Autowired)(l.CommandRegistry),n.__metadata("design:type",Object)],f.prototype,"commandRegistry",void 0),n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",v.LayoutState)],f.prototype,"layoutState",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,o.Autowired)(l.ComponentRegistry),n.__metadata("design:type",Object)],f.prototype,"componentRegistry",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(m.AbstractMenuService),n.__metadata("design:type",m.AbstractMenuService)],f.prototype,"menuService",void 0),n.__decorate([(0,o.Autowired)(m.AbstractContextMenuService),n.__metadata("design:type",m.AbstractContextMenuService)],f.prototype,"contextmenuService",void 0),n.__decorate([(0,l.OnEvent)(g.ThemeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[g.ThemeChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onThemeChange",null),t.LayoutService=f=n.__decorate([(0,o.Injectable)()],f)},53576:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainLayoutModuleContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144),_=e(68456),v=e(95416),m=e(93899),p=e(43718),s=e(92323),g=e(17793),a=e(75053),h=e(45395),u=e(68988),c=e(19951);let E=class extends p.WithEventBus{async initialize(){await this.layoutState.initStorage();const d=this.contributionProvider.getContributions();for(const A of d)A.registerComponent&&A.registerComponent(this.componentRegistry);const y=this.rendererContributionProvider.getContributions();for(const A of y)A.registerRenderer&&A.registerRenderer(o.slotRendererRegistry);const b=this.toolBarContributionProvider.getContributions();for(const A of b)A.registerToolbarItems&&A.registerToolbarItems(this.toolBarRegistry)}registerComponent(d){d.register(g.DROP_EXTEND_VIEW_CONTAINER,[],{component:h.ExtendViewDropArea,hideTab:!0,containerId:g.DROP_EXTEND_VIEW_CONTAINER}),d.register(g.DROP_PANEL_CONTAINER,[],{component:h.PanelDropArea,hideTab:!0,containerId:g.DROP_PANEL_CONTAINER}),d.register(g.DROP_VIEW_CONTAINER,[],{component:h.ViewDropArea,hideTab:!0,containerId:g.DROP_VIEW_CONTAINER})}async onStart(){this.registerSideToggleKey()}async onDidStart(){this.mainLayoutService.didMount()}registerRenderer(d){d.registerSlotRenderer(o.SlotLocation.extendView,c.RightTabRenderer,{isLatter:!0,supportedActions:{accordion:!0}}),d.registerSlotRenderer(o.SlotLocation.view,c.LeftTabRenderer,{supportedActions:{accordion:!0}}),d.registerSlotRenderer(o.SlotLocation.panel,c.BottomTabRenderer,{isLatter:!0,supportedActions:{expand:!0,toggle:!0}})}registerCommands(d){d.registerCommand(a.TOGGLE_VIEW_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.view,y,b)}}),d.registerCommand(a.TOGGLE_EXTEND_VIEW_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.extendView,y,b)}}),d.registerCommand(a.TOGGLE_PANEL_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.panel,y,b)}}),d.registerCommand(a.IS_VISIBLE_VIEW_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.view)}),d.registerCommand(a.IS_VISIBLE_EXTEND_VIEW_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.extendView)}),d.registerCommand(a.IS_VISIBLE_PANEL_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.panel)}),d.registerCommand(a.TOGGLE_LEFT_PANEL_COMMAND),d.registerCommand(a.TOGGLE_RIGHT_PANEL_COMMAND),d.registerCommand(a.TOGGLE_BOTTOM_PANEL_COMMAND),d.registerCommand(a.EXPAND_BOTTOM_PANEL),d.registerCommand(a.RETRACT_BOTTOM_PANEL),d.registerCommand(a.IS_VISIBLE_LEFT_PANEL_COMMAND),d.registerCommand(a.IS_VISIBLE_RIGHT_PANEL_COMMAND),d.registerCommand(a.IS_VISIBLE_BOTTOM_PANEL_COMMAND),d.registerCommand(a.WORKBENCH_ACTION_CLOSESIDECAR,{execute:()=>Promise.all([this.mainLayoutService.toggleSlot(o.SlotLocation.view,!1),this.mainLayoutService.toggleSlot(o.SlotLocation.extendView,!1)])}),d.registerCommand(a.WORKBENCH_ACTION_CLOSEPANEL,{execute:()=>{this.mainLayoutService.toggleSlot(o.SlotLocation.panel,!1)}}),d.registerCommand({id:"view.outward.right-panel.hide"},{execute:()=>{this.commandService.executeCommand("main-layout.right-panel.toggle",!1)}}),d.registerCommand({id:"view.outward.right-panel.show"},{execute:y=>{this.commandService.executeCommand("main-layout.right-panel.toggle",!0,y)}}),d.registerCommand({id:"view.outward.left-panel.hide"},{execute:()=>{this.commandService.executeCommand("main-layout.left-panel.toggle",!1)}}),d.registerCommand({id:"view.outward.left-panel.show"},{execute:y=>{this.commandService.executeCommand("main-layout.left-panel.toggle",!0,y)}}),d.registerCommand({id:o.LAYOUT_COMMANDS.MAXIMIZE_EDITOR.id},{execute:()=>{this.commandService.executeCommand(a.TOGGLE_RIGHT_PANEL_COMMAND.id,!1),this.commandService.executeCommand(a.TOGGLE_LEFT_PANEL_COMMAND.id,!1)}}),d.registerCommand(o.LAYOUT_COMMANDS.OPEN_VIEW,{execute:()=>{this.commandService.executeCommand(o.QUICK_OPEN_COMMANDS.OPEN_VIEW.id)}})}registerMenus(d){d.registerMenuItem(m.MenuId.ActivityBarExtra,{submenu:m.MenuId.SettingsIconMenu,iconClass:(0,o.getIcon)("setting"),label:(0,p.localize)("layout.tabbar.setting"),order:1,group:"navigation"}),Object.entries({[o.SlotLocation.view]:[l.EXPLORER_CONTAINER_ID,l.SEARCH_CONTAINER_ID,l.SCM_CONTAINER_ID,l.DEBUG_CONTAINER_ID,l.EXTENSION_CONTAINER_ID],[o.SlotLocation.panel]:[l.MARKER_CONTAINER_ID,l.OUTPUT_CONTAINER_ID,l.DEBUG_CONSOLE_CONTAINER_ID,l.TERMINAL_CONTAINER_ID]}).forEach(([y,b],A)=>{const S=this.mainLayoutService.getTabbarService(y);S.viewReady.promise.then(()=>{b.forEach(D=>{var I,w;const T=S.getContainer(D);T&&d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:{id:`container.toggle.${D}`,label:(w=(I=T.options)===null||I===void 0?void 0:I.title)!==null&&w!==void 0?w:D},group:`${3+A}_${y}`})})})}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_VIEW_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_EXTEND_VIEW_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_PANEL_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.EXPAND_PANEL_COMMAND,group:"5_panel",when:"!bottomFullExpanded"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.RETRACT_PANEL_COMMAND,group:"5_panel",when:"bottomFullExpanded"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:{id:o.EDITOR_COMMANDS.TOGGLE_WORD_WRAP.id,label:"%preference.editor.wordWrap%"},group:"6_capability",toggledWhen:"config.editor.wordWrap == on"})}registerSideToggleKey(){this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+b",command:a.TOGGLE_VIEW_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+alt+b",command:a.TOGGLE_EXTEND_VIEW_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+j",command:a.TOGGLE_PANEL_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+shift+j",command:a.EXPAND_PANEL_COMMAND.id,when:"!bottomFullExpanded"}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+shift+j",command:a.RETRACT_PANEL_COMMAND.id,when:"bottomFullExpanded"})}registerQuickOpenHandlers(d){d.registerHandler(this.quickOpenViewHandler,{title:(0,p.localize)("layout.action.openView"),commandId:o.LAYOUT_COMMANDS.QUICK_OPEN_VIEW.id,order:5,hideTab:!0})}};t.MainLayoutModuleContribution=E,n.__decorate([(0,r.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],E.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.ComponentContribution),n.__metadata("design:type",Object)],E.prototype,"contributionProvider",void 0),n.__decorate([(0,r.Autowired)(o.SlotRendererContribution),n.__metadata("design:type",Object)],E.prototype,"rendererContributionProvider",void 0),n.__decorate([(0,r.Autowired)(_.ComponentRegistry),n.__metadata("design:type",Object)],E.prototype,"componentRegistry",void 0),n.__decorate([(0,r.Autowired)(s.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.LayoutState)],E.prototype,"layoutState",void 0),n.__decorate([(0,r.Autowired)(_.TabBarToolbarContribution),n.__metadata("design:type",Object)],E.prototype,"toolBarContributionProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.ToolbarRegistry)],E.prototype,"toolBarRegistry",void 0),n.__decorate([(0,r.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],E.prototype,"keybindingRegistry",void 0),n.__decorate([(0,r.Autowired)(u.ViewQuickOpenHandler),n.__metadata("design:type",u.ViewQuickOpenHandler)],E.prototype,"quickOpenViewHandler",void 0),t.MainLayoutModuleContribution=E=n.__decorate([(0,p.Domain)(s.CommandContribution,o.ClientAppContribution,o.SlotRendererContribution,m.MenuContribution,o.QuickOpenContribution,_.ComponentContribution)],E)},68988:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewQuickOpenItem=t.ContainerQuickOpenItem=t.ViewQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(74404),_=e(17793);let v=class{constructor(){this.prefix="view ",this.description=(0,o.localize)("layout.action.openView")}getModel(){return{onType:(g,a)=>a(this.getViewQuickOpenItems())}}getViewQuickOpenItems(){var g;const a=this.layoutService.getAllAccordionService(),h=Array.from(a.keys());let u=[];u=u.concat(h.map((c,E)=>this.injector.get(m,[c,{groupLabel:E===0?(0,o.localize)("layout.openView.containerTitle"):"",showBorder:!1}])));for(const c of h){const E=(g=a.get(c))===null||g===void 0?void 0:g.views;if(E)for(let f=0,d=E.length;f<d;f++)u.push(this.injector.get(p,[c,E[f],{groupLabel:f===0?(0,o.formatLocalize)("layout.openView.viewTitle",String(c).toUpperCase()):"",showBorder:!1}]))}return u}getOptions(){return{}}onClose(){}};t.ViewQuickOpenHandler=v,n.__decorate([(0,r.Autowired)(l.PrefixQuickOpenService),n.__metadata("design:type",Object)],v.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],v.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],v.prototype,"injector",void 0),t.ViewQuickOpenHandler=v=n.__decorate([(0,r.Injectable)()],v);let m=class extends l.QuickOpenItem{constructor(g,a){super(a),this.containerId=g,this.options=a}getLabel(){return String(this.containerId).toLocaleUpperCase()}isHidden(){return super.isHidden()}run(g){if(g!==l.Mode.OPEN)return!1;const a=this.layoutService.getTabbarHandler(this.containerId);return a?.activate(),!0}};t.ContainerQuickOpenItem=m,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],m.prototype,"layoutService",void 0),t.ContainerQuickOpenItem=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],m);let p=class extends l.QuickOpenItem{constructor(g,a,h){super(h),this.containerId=g,this.view=a,this.options=h}getLabel(){var g;return(g=this.view.name)===null||g===void 0?void 0:g.toUpperCase()}isHidden(){return super.isHidden()}run(g){if(g!==l.Mode.OPEN)return!1;const a=this.layoutService.getTabbarHandler(this.containerId);return a&&(a.activate(),a.isCollapsed(this.view.id)&&a?.setCollapsed(this.view.id,!1)),!0}};t.ViewQuickOpenItem=p,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],p.prototype,"layoutService",void 0),t.ViewQuickOpenItem=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Object,Object])],p)},58999:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabBarHandler=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(17793),_=e(752);let v=class{constructor(p,s){this.containerId=p,this.tabbarService=s,this.onActivateEmitter=new o.Emitter,this.onActivate=this.onActivateEmitter.event,this.onInActivateEmitter=new o.Emitter,this.onInActivate=this.onInActivateEmitter.event,this.onCollapseEmitter=new o.Emitter,this.onCollapse=this.onCollapseEmitter.event,this.isVisible=!1,this.accordionService=this.layoutService.getAccordionService(this.containerId),s.currentContainerId.get()===this.containerId&&(this.onActivateEmitter.fire(),this.isVisible=!0),this.tabbarService.onCurrentChange(g=>{g.currentId===this.containerId?(this.onActivateEmitter.fire(),this.isVisible=!0):g.previousId===this.containerId&&(this.onInActivateEmitter.fire(),this.isVisible=!1)})}dispose(){this.tabbarService.containersMap.delete(this.containerId),this.tabbarService.disposeContainer(this.containerId)}disposeView(p){this.layoutService.disposeViewComponent(p)}activate(){this.tabbarService.updateCurrentContainerId(this.containerId)}deactivate(){this.tabbarService.updateCurrentContainerId("")}isActivated(){return this.tabbarService.currentContainerId.get()===this.containerId}show(){this.tabbarService.showContainer(this.containerId)}hide(){this.tabbarService.hideContainer(this.containerId)}setTitleComponent(p,s){const g=this.tabbarService.getContainer(this.containerId);g&&g.options&&(g.options.titleProps=s,g.options.titleComponent=p,g.fireChange(g))}setSize(p){this.layoutService.toggleSlot(this.tabbarService.location,!0,p+this.tabbarService.getBarSize())}setBadge(p){this.tabbarService.updateBadge(this.containerId,p)}getBadge(){return this.tabbarService.getContainer(this.containerId).options.badge}setIconClass(p){this.tabbarService.getContainer(this.containerId).options.iconClass=p}isCollapsed(p){return this.accordionService.getViewState(p).collapsed}setCollapsed(p,s){this.accordionService.toggleOpen(p,s)}toggleViews(p,s){for(const g of p){const a=this.accordionService.getViewState(g);this.accordionService.updateViewState(g,{...a,hidden:!s})}}updateViewTitle(p,s){this.accordionService.updateViewTitle(p,s)}updateViewDescription(p,s){this.accordionService.updateViewDesciption(p,s)}updateViewMessage(p,s){this.accordionService.updateViewMessage(p,s)}updateTitle(p){this.tabbarService.updateTitle(this.containerId,p)}setResizeLock(p){this.tabbarService.resizeHandle.lockSize(p)}};t.TabBarHandler=v,n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],v.prototype,"layoutService",void 0),t.TabBarHandler=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,_.TabbarService])],v)},46245:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatTabbarRenderer2=t.BottomTabbarRenderer=t.LeftTabbarRenderer=t.RightTabbarRenderer=t.TextElipses=t.IconElipses=t.TextTabView=t.IconTabView=t.TabbarViewBase=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25918),m=e(25719),p=e(63373),s=e(68969),g=e(17793),a=e(19951),h=n.__importDefault(e(5330)),u=e(752);function c(T,R){return R>=T.length?[T,[]]:R<=1?[[],T]:[T.slice(0,R-1),T.slice(R-1)]}function E(T){return typeof T=="string"?parseInt(T,10)>99?"99+":T:typeof T=="object"&&T.value?T.value>99?"99+":T.value:""}const f=T=>{var R;const{TabView:P,MoreTabView:O,forbidCollapse:M,barSize:k=48,panelBorderSize:F=0,tabClassName:L,className:B,margin:U,tabSize:W,canHideTabbar:j,renderOtherVisibleContainers:Q=()=>null,disableAutoAdjust:G}=T,{side:Z,direction:$,fullSize:V}=(0,o.useContext)(a.TabbarConfig),H=(0,_.useInjectable)(u.TabbarServiceFactory)(Z),K=(0,_.useDesignStyles)(h.default.tab_bar,"tab_bar"),Y=(0,_.useDesignStyles)(h.default.bar_content,"bar_content"),X=(0,o.useMemo)(()=>G?Number.MAX_SAFE_INTEGER:Math.floor(V-(U||0)/W),[G,V,U,W]),[oe,ie]=(0,o.useState)(c(H.visibleContainers.filter(fe=>{var Ie;return!(!((Ie=fe.options)===null||Ie===void 0)&&Ie.hideTab)}),X));(0,o.useEffect)(()=>{H.updateBarSize(k+F)},[]),(0,o.useEffect)(()=>{const fe=()=>{ie(c(H.visibleContainers.filter(Me=>{var Be;return!(!((Be=Me.options)===null||Be===void 0)&&Be.hideTab)}),X))};fe();const Ie=_.Event.any(H.onDidRegisterContainer,H.onStateChange)(fe);return()=>{Ie.dispose()}},[X]);const he=(0,_.useAutorun)(H.currentContainerId),me=(0,_.usePreference)("workbench.hideSlotTabBarWhenHidePanel",!1),q=j&&me;q&&!he&&((R=H.resizeHandle)===null||R===void 0||R.setSize(0));const[Ee,ue]=oe;ue.forEach(fe=>{H.updateTabInMoreKey(fe.options.containerId,!0)});const te=(0,o.useCallback)((fe,Ie,Me,Be)=>{var Pe;const we=(Pe=fe.options)===null||Pe===void 0?void 0:Pe.containerId;if(!we)return null;Ie.updateTabInMoreKey(we,!1);let _e;return o.default.createElement("li",{draggable:!0,onDragStart:Ne=>{if(_e){const Te=_e.cloneNode(!0);Te.classList.add(h.default.dragging),L&&(0,_.addClassName)(Te,L),document.body.appendChild(Te),Ne.persist(),requestAnimationFrame(()=>{Ne.dataTransfer.setDragImage(Te,0,0),document.body.removeChild(Te)})}Ie.handleDragStart(Ne,we)},onDragOver:Ne=>{Ne.preventDefault(),_e&&_e.classList.add("on-drag-over")},onDragLeave:()=>{_e&&_e.classList.remove("on-drag-over")},onDrop:Ne=>{_e&&_e.classList.remove("on-drag-over"),Ie.handleDrop(Ne,we)},onDragEnd:Ne=>{Ie.handleDragEnd(Ne)},key:we,id:we,onContextMenu:Ne=>Ie.handleContextMenu(Ne,we),onClick:Ne=>Ie.handleTabClick(Ne,q||M),ref:Ne=>_e=Ne,className:(0,r.default)({active:Me===we},L)},o.default.createElement(P,{component:fe}))},[]);return o.default.createElement("div",{className:(0,r.default)([K,B])},o.default.createElement("div",{className:Y,style:{flexDirection:m.Layout.getTabbarDirection($)}},Ee.map(fe=>te(fe,H,he,Z)),Q({props:T,renderContainers:te}),ue.length?o.default.createElement("li",{key:"tab-more",onClick:fe=>{var Ie;return H.showMoreMenu(fe,Ee[Ee.length-1]&&((Ie=Ee[Ee.length-1].options)===null||Ie===void 0?void 0:Ie.containerId))},className:L},o.default.createElement(O,null)):null))};t.TabbarViewBase=f;const d=({component:T})=>{var R,P,O;const M=(0,_.useInjectable)(s.IProgressService),k=(0,_.useInjectable)(_.KeybindingRegistry),F=(0,_.useDesignStyles)(h.default.icon_tab,"icon_tab"),[L,B]=(0,o.useState)(T),U=M.getIndicator(((R=L.options)===null||R===void 0?void 0:R.containerId)||""),W=U?(0,_.useAutorun)(U.progressModel.show):!1,j=(0,o.useMemo)(()=>{const Q=L.options;return Q?.activateKeyBinding?`${Q?.title} (${k.acceleratorForKeyString(Q.activateKeyBinding,"+")})`:Q?.title},[L]);return(0,o.useEffect)(()=>{const Q=L.onChange(G=>{B({...G})});return()=>{Q.dispose()}},[L]),o.default.createElement("div",{className:F},o.default.createElement("div",{className:(0,r.default)((P=L.options)===null||P===void 0?void 0:P.iconClass,"activity-icon"),title:j}),W?o.default.createElement(l.Badge,{className:h.default.tab_badge},o.default.createElement("span",{className:h.default.icon_wrapper},o.default.createElement(l.Icon,{icon:"time-circle"}))):((O=L.options)===null||O===void 0?void 0:O.badge)&&o.default.createElement(l.Badge,{className:h.default.tab_badge},E(L.options.badge)))};t.IconTabView=d;const y=({component:T})=>{var R,P,O;const[M,k]=(0,o.useState)(T);return(0,o.useEffect)(()=>{const F=M.onChange(L=>{k({...L})});return()=>{F.dispose()}},[M]),o.default.createElement("div",{className:h.default.text_tab},o.default.createElement("div",{className:h.default.bottom_tab_title},(P=(R=M.options)===null||R===void 0?void 0:R.title)===null||P===void 0?void 0:P.toUpperCase()),((O=M.options)===null||O===void 0?void 0:O.badge)&&o.default.createElement(l.Badge,{className:h.default.tab_badge},E(M.options.badge)))};t.TextTabView=y;const b=()=>{const T=(0,_.useDesignStyles)(h.default.icon_tab,"icon_tab");return o.default.createElement("div",{className:T},o.default.createElement("div",{className:(0,r.default)((0,_.getIcon)("ellipsis"),"activity-icon"),title:"extra tabs"}))};t.IconElipses=b;const A=()=>o.default.createElement("div",{className:h.default.text_tab},o.default.createElement("div",{className:h.default.bottom_tab_title},o.default.createElement("i",{className:(0,_.getIcon)("doubleright")})));t.TextElipses=A;const S=T=>{const{barSize:R=48,style:P}=T,{side:O}=(0,o.useContext)(a.TabbarConfig),M=(0,_.useInjectable)(u.TabbarServiceFactory)(O),k=(0,_.useDesignStyles)(h.default.right_tab_bar,"right_tab_bar"),F=(0,_.useDesignStyles)(h.default.right_tab,"right_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.RIGHT_TABBAR,className:k,style:P,onContextMenu:M.handleContextMenu},o.default.createElement(t.TabbarViewBase,{tabSize:48,MoreTabView:t.IconElipses,tabClassName:F,TabView:t.IconTabView,barSize:R,panelBorderSize:1}))};t.RightTabbarRenderer=S;const D=({renderOtherVisibleContainers:T,isRenderExtraTopMenus:R=!0,renderExtraMenus:P,tabbarViewProps:O})=>{const{side:M}=(0,o.useContext)(a.TabbarConfig),k=(0,_.useInjectable)(g.IMainLayoutService),F=(0,_.useInjectable)(u.TabbarServiceFactory)(M),L=(0,o.useMemo)(()=>k.getExtraTopMenu(),[k]),B=(0,o.useMemo)(()=>k.getExtraMenu(),[k]),U=(0,_.useDesignStyles)(h.default.left_tab_bar,"left_tab_bar"),W=(0,_.useDesignStyles)(h.default.left_tab,"left_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.LEFT_TABBAR,className:U,onContextMenu:F.handleContextMenu},R&&o.default.createElement(v.InlineMenuBar,{className:(0,r.default)(h.default.vertical_icons,h.default.extra_top_menus),menus:L}),o.default.createElement(t.TabbarViewBase,{tabSize:48,MoreTabView:t.IconElipses,className:h.default.left_tab_content,tabClassName:W,TabView:t.IconTabView,barSize:48,margin:90,panelBorderSize:1,renderOtherVisibleContainers:T,...O}),P||o.default.createElement(v.InlineMenuBar,{className:h.default.vertical_icons,menus:B}))};t.LeftTabbarRenderer=D;const I=()=>{const{side:T}=(0,o.useContext)(a.TabbarConfig),R=(0,_.useInjectable)(u.TabbarServiceFactory)(T),P=(0,_.useDesignStyles)(h.default.bottom_bar_container,"bottom_bar_container"),O=(0,_.useDesignStyles)(h.default.bottom_tab,"bottom_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.BOTTOM_TABBAR,onContextMenu:R.handleContextMenu,className:(0,r.default)(P,"next_bottom_bar")},o.default.createElement(t.TabbarViewBase,{tabSize:80,MoreTabView:t.TextElipses,tabClassName:O,TabView:t.TextTabView,barSize:24,panelBorderSize:1,canHideTabbar:!0}))};t.BottomTabbarRenderer=I;const w=T=>{const{barSize:R=32,style:P}=T,{side:O}=(0,o.useContext)(a.TabbarConfig),M=(0,_.useInjectable)(u.TabbarServiceFactory)(O),k=(0,_.useDesignStyles)(h.default.ai_right_tab_bar,"ai_right_tab_bar"),F=(0,_.useDesignStyles)(h.default.ai_right_tab,"ai_right_tab");return o.default.createElement("div",{id:O,className:k,style:P,onContextMenu:M.handleContextMenu},o.default.createElement(t.TabbarViewBase,{tabSize:32,MoreTabView:t.IconElipses,tabClassName:F,TabView:t.IconTabView,barSize:R,panelBorderSize:1}))};t.ChatTabbarRenderer2=w},66368:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BottomTabPanelRenderer=t.LeftTabPanelRenderer=t.RightTabPanelRenderer=t.ContainerView=t.BaseTabPanelView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),_=e(41869),v=e(25918),m=e(1149),p=e(68969),s=e(68974),g=e(9522),a=e(70936),h=e(91527),u=e(19951),c=n.__importDefault(e(5330)),E=e(752),f=o.default.memo(({children:T})=>T,(T,R)=>!(T.visible||R.visible)),d={display:"block"},y={display:"none"},b=T=>{const{PanelView:R,panelSize:P,id:O,PanelViewProps:M}=T,{side:k}=o.default.useContext(u.TabbarConfig),F=(0,_.useInjectable)(_.AppConfig),L=F.panelSizes&&F.panelSizes[k],B=(0,_.useInjectable)(E.TabbarServiceFactory)(k),U=(0,_.useAutorun)(B.currentContainerId),W=(0,_.useDesignStyles)(c.default.tab_panel,"tab_panel"),j=(0,_.useDesignStyles)(c.default.tab_panel_hidden,"tab_panel_hidden");return o.default.useEffect(()=>{B.updatePanelSize(L||P||335)},[]),o.default.createElement("div",{id:O,className:(0,r.default)("kt-tab-panel",W,{[j]:!U})},B.visibleContainers.map(Q=>{var G;const Z=(G=Q.options)===null||G===void 0?void 0:G.containerId;if(!Z)return null;const $=B.getTitleToolbarMenu(Z);return o.default.createElement("div",{key:Z,className:(0,r.default)(c.default.panel_wrap,Z),"data-viewlet-id":Z,style:U===Z?d:y,id:O},o.default.createElement(_.ErrorBoundary,null,o.default.createElement(f,{visible:U===Z},o.default.createElement(R,{titleMenu:$,side:k,component:Q,...M}))))}))};t.BaseTabPanelView=b;const A=({component:T,titleMenu:R,side:P,renderContainerWrap:O,className:M,customTitleBar:k})=>{var F,L;const B=o.default.useRef(),U=o.default.useRef(null),W=(0,_.useInjectable)(_.AppConfig),{title:j,titleComponent:Q,component:G,containerId:Z,draggable:$}=T.options||{},V=(0,_.useInjectable)(l.INJECTOR_TOKEN),H=(0,_.useInjectable)(m.LayoutViewSizeConfig),K=(0,o.useCallback)(he=>{V.get(g.AccordionServiceFactory)(Z).handleContextMenu(he)},[Z]);if(!Z)return null;const X=(0,_.useInjectable)(p.IProgressService).getIndicator(Z);if(!X)return null;const oe=(0,_.useViewState)(P,U),ie=o.default.useCallback(he=>O?O({children:he}):he,[O]);return o.default.createElement("div",{ref:U,className:(0,r.default)(c.default.view_container,M)},!!k&&k,!G&&o.default.createElement("div",{onContextMenu:K,className:c.default.panel_titlebar},j?o.default.createElement(h.TitleBar,{containerId:Z,side:P,title:j,draggable:$,height:H.panelTitleBarHeight,menubar:o.default.createElement(v.InlineActionBar,{menus:R})}):null,Q&&o.default.createElement("div",{className:c.default.panel_component},o.default.createElement(_.ConfigProvider,{value:W},o.default.createElement(_.ComponentRenderer,{Component:Q,initialProps:(F=T.options)===null||F===void 0?void 0:F.titleProps})))),o.default.createElement("div",{className:c.default.container_wrap,ref:he=>B.current=he},o.default.createElement(s.ProgressBar,{progressModel:X.progressModel}),ie(G?o.default.createElement(_.ConfigProvider,{value:W},o.default.createElement(_.ComponentRenderer,{initialProps:{viewState:oe,...(L=T.options)===null||L===void 0?void 0:L.initialProps},Component:G})):o.default.createElement(a.AccordionContainer,{views:T.views,minSize:T.options.miniSize,containerId:T.options.containerId}))))};t.ContainerView=A;const S=({component:T,titleMenu:R,side:P})=>{var O,M,k,F;const L=o.default.useRef(),B=o.default.useRef(null),U=(0,_.useInjectable)(_.AppConfig),W=(0,_.useInjectable)(E.TabbarServiceFactory)(P),j=(0,_.useDesignStyles)(c.default.panel_title_bar,"panel_title_bar"),Q=(0,_.useDesignStyles)(c.default.panel_toolbar_container,"panel_toolbar_container"),G=(0,_.useViewState)(P,B),Z=(0,_.useInjectable)(m.LayoutViewSizeConfig),$=(0,_.useInjectable)(p.IProgressService),{component:V,containerId:H}=T.options||{},K=T.options&&T.options.titleComponent;if(!H)return null;const Y=$.getIndicator(H);return Y?o.default.createElement("div",{ref:B,className:c.default.panel_container},o.default.createElement("div",{className:j,style:{height:Z.panelTitleBarHeight}},o.default.createElement("h1",null,(M=(O=T.options)===null||O===void 0?void 0:O.title)===null||M===void 0?void 0:M.toUpperCase()),o.default.createElement("div",{className:c.default.title_component_container},K&&o.default.createElement(_.ComponentRenderer,{Component:K,initialProps:(k=T.options)===null||k===void 0?void 0:k.titleProps})),o.default.createElement("div",{className:Q},R&&o.default.createElement(v.InlineActionBar,{menus:R}),o.default.createElement(v.InlineMenuBar,{menus:W.commonTitleMenu,moreAtFirst:!0}))),o.default.createElement("div",{className:c.default.container_wrap,ref:X=>L.current=X},o.default.createElement(s.ProgressBar,{progressModel:Y.progressModel}),V?o.default.createElement(_.ConfigProvider,{value:U},o.default.createElement(_.ComponentRenderer,{initialProps:{viewState:G,...(F=T.options)===null||F===void 0?void 0:F.initialProps},Component:V})):o.default.createElement(a.AccordionContainer,{views:T.views,alignment:"horizontal",minSize:T.options.miniSize||200,containerId:T.options.containerId}))):null},D=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:t.ContainerView});t.RightTabPanelRenderer=D;const I=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:t.ContainerView});t.LeftTabPanelRenderer=I;const w=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:S,panelSize:280});t.BottomTabPanelRenderer=w},19951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BottomTabRenderer=t.LeftTabRenderer=t.RightTabRenderer=t.TabRendererBase=t.TabbarConfig=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(25719),m=e(63373),p=e(46245),s=e(66368),g=n.__importDefault(e(5330)),a=e(752);t.TabbarConfig=(0,o.createContext)({side:l.SlotLocation.view,direction:"left-to-right",fullSize:0}),t.TabRendererBase=(0,o.memo)(({id:E,className:f,components:d,direction:y="left-to-right",TabbarView:b,side:A,TabpanelView:S})=>{const D=(0,l.useInjectable)(a.TabbarServiceFactory)(A),I=(0,l.useInjectable)(l.IEventBus),w=(0,o.useContext)(_.PanelContext),T=(0,o.useRef)(null),[R,P]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{D.registerResizeHandle(w),d.forEach(M=>{D.registerContainer(M.options.containerId,M)}),D.updatePanelVisibility(),D.ensureViewReady()},[d]);const O=(0,o.useCallback)(()=>{T.current&&P(T.current[v.Layout.getDomSizeProperty(y)])},[]);return(0,o.useEffect)(()=>{l.fastdom.measure(()=>{O()});let M;I.onDirective(l.ResizeEvent.createDirective(A),()=>{M&&M.dispose(),M=l.fastdom.measureAtNextFrame(()=>{O()})})},[]),o.default.createElement("div",{ref:T,id:E,className:(0,r.default)(g.default.tab_container,f),style:{flexDirection:v.Layout.getFlexDirection(y)}},o.default.createElement(t.TabbarConfig.Provider,{value:{side:A,direction:y,fullSize:R}},o.default.createElement(b,null),o.default.createElement(S,null)))});const h=({className:E,components:f,tabbarView:d,tabpanelView:y})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.extendView,direction:"right-to-left",id:m.VIEW_CONTAINERS.RIGHT_TABBAR_PANEL,className:(0,r.default)(E,"right-slot"),components:f,TabbarView:d??p.RightTabbarRenderer,TabpanelView:y??s.RightTabPanelRenderer});t.RightTabRenderer=h;const u=({className:E,components:f,tabbarView:d})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.view,direction:"left-to-right",id:m.VIEW_CONTAINERS.LEFT_TABBAR_PANEL,className:(0,r.default)(E,"left-slot"),components:f,TabbarView:d??p.LeftTabbarRenderer,TabpanelView:s.LeftTabPanelRenderer});t.LeftTabRenderer=u;const c=({className:E,components:f,tabbarView:d})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.panel,id:m.VIEW_CONTAINERS.BOTTOM_TABBAR_PANEL,direction:"bottom-to-top",className:(0,r.default)(E,"bottom-slot"),components:f,TabbarView:d??p.BottomTabbarRenderer,TabpanelView:s.BottomTabPanelRenderer});t.BottomTabRenderer=c},94813:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarBehaviorHandler=void 0;const n=e(41869),r=e(30144),o=e(75053);class l{constructor(v,m){this.location=v,this.config=m,this.accordionRestored=new Set}getIsLatter(){var v;return((v=this.config)===null||v===void 0?void 0:v.isLatter)!==void 0?this.config.isLatter:this.location==="extendView"||this.location==="panel"}wrapResizeHandle(v){const{setSize:m,setRelativeSize:p,getSize:s,getRelativeSize:g,lockSize:a,setMaxSize:h,hidePanel:u}=v,c=this.getIsLatter();return{setSize:E=>m(E,c),setRelativeSize:(E,f)=>p(E,f,c),getSize:()=>s(c),getRelativeSize:()=>g(c),setMaxSize:E=>h(E,c),lockSize:E=>a(E,c),hidePanel:E=>u(E)}}registerLocationSpecificCommands(v){const m=new n.DisposableCollection,{supportedActions:p}=this.config||{};return p?.expand&&(m.push(v.commandRegistry.registerCommand(o.EXPAND_PANEL_COMMAND,{execute:()=>{v.layoutService.expandBottom(!0)}})),m.push(v.commandRegistry.registerCommand(o.RETRACT_PANEL_COMMAND,{execute:()=>{v.layoutService.expandBottom(!1)}}))),p?.toggle&&m.push(v.commandRegistry.registerCommand(o.TOGGLE_PANEL_COMMAND,{execute:(s,g)=>{v.layoutService.toggleSlot(this.location,s,g)}})),m}registerLocationSpecificMenus(v){var m,p,s,g;const a=[];if(!((p=(m=this.config)===null||m===void 0?void 0:m.supportedActions)===null||p===void 0)&&p.expand&&a.push({command:o.EXPAND_PANEL_COMMAND.id,group:"navigation",when:"!bottomFullExpanded",order:1},{command:o.RETRACT_PANEL_COMMAND.id,group:"navigation",when:"bottomFullExpanded",order:1}),!((g=(s=this.config)===null||s===void 0?void 0:s.supportedActions)===null||g===void 0)&&g.toggle&&a.push({command:o.TOGGLE_PANEL_COMMAND.id,group:"navigation",order:2}),a.length>0)return v.menuRegistry.registerMenuItems(`tabbar/${this.location}/common`,a),v.ctxMenuService.createMenu({id:`tabbar/${this.location}/common`})}doExpand(v,m){var p,s;if(!(!((s=(p=this.config)===null||p===void 0?void 0:p.supportedActions)===null||s===void 0)&&s.expand)||!m)return;const{setRelativeSize:g}=m,a=this.getIsLatter();v?a?g(0,1):g(1,0):g(2,1)}isExpanded(v){var m,p;if(!(!((p=(m=this.config)===null||m===void 0?void 0:m.supportedActions)===null||p===void 0)&&p.expand)||!v)return!1;const{getRelativeSize:s}=v,g=s().join(",");return this.getIsLatter()?g==="0,1":g==="1,0"}handleActivateKeyBinding(v,m,p,s){var g,a;!((a=(g=this.config)===null||g===void 0?void 0:g.supportedActions)===null||a===void 0)&&a.toggle&&!s?p(m===v?"":v):p(v)}handleFullExpanded(v,m,p,s){var g,a;const{barSize:h,panelSize:u,prevSize:c}=s,{setRelativeSize:E,setSize:f}=p;v?m&&(!((a=(g=this.config)===null||g===void 0?void 0:g.supportedActions)===null||a===void 0)&&a.expand)?this.getIsLatter()?E(0,1):E(1,0):f(c||u+h):f(h)}tryRestoreAccordionSize(v,m){var p,s,g,a;if(!(!((s=(p=this.config)===null||p===void 0?void 0:p.supportedActions)===null||s===void 0)&&s.accordion))return;const{containerId:h}=v.options||{};if(!h||this.accordionRestored.has(h)||(!v||!((g=v.options)===null||g===void 0)&&g.component)&&((a=v?.options)===null||a===void 0?void 0:a.containerId)!==r.SCM_CONTAINER_ID)return;m.getAccordionService(h).restoreState(),this.accordionRestored.add(h)}}t.TabbarBehaviorHandler=l},752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarService=t.TabbarServiceFactoryFn=t.TabbarServiceFactory=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),_=e(95416),v=e(93899),m=e(68969),p=e(38578),s=e(28423),g=e(17793),a=e(94813);t.TabbarServiceFactory=Symbol("TabbarServiceFactory");const h=E=>f=>E.get(g.IMainLayoutService).getTabbarService(f);t.TabbarServiceFactoryFn=h;const u=void 0;let c=class extends l.WithEventBus{constructor(f){super(),this.location=f,this.doChangeViewEmitter=new l.Emitter,this.onStateChangeEmitter=new l.Emitter,this.onStateChange=this.onStateChangeEmitter.event,this.shouldChangeView=(0,s.observableFromEventOpts)({owner:this,equalsFn:()=>!1},this.doChangeViewEmitter.event,()=>{}),this.containerIdObs=(0,s.observableValue)(this,u),this.currentContainerId=(0,s.derivedOpts)({owner:this,equalsFn:()=>!1},y=>(this.shouldChangeView.read(y),this.containerIdObs.read(y))),this.nextContainerId="",this.useFirstContainerId=!1,this.previousContainerId=void 0,this.containersMap=new Map,this.viewReady=new l.Deferred,this.state=new Map,this.storedState={},this.onCurrentChangeEmitter=new l.Emitter,this.onCurrentChange=this.onCurrentChangeEmitter.event,this.onSizeChangeEmitter=new l.Emitter,this.onSizeChange=this.onSizeChangeEmitter.event,this.menuId=`tabbar/${this.location}`,this.moreMenuId=`tabbar/${this.location}/more`,this.sortedContainers=[],this.disposableMap=new Map,this.tabInMoreKeyMap=new Map,this.shouldWaitForViewRender=!1,this.onDidRegisterContainerEmitter=new l.Emitter,this.isEmptyTabbar=!0,this.updatePanel=(0,r.default)(y=>{this.resizeHandle&&this.resizeHandle.hidePanel(y)},60),this._menuMap=new Map,this.handleContextMenu=(y,b)=>{y.preventDefault(),y.stopPropagation();const A=this.menuService.createMenu(this.menuId,b?this.scopedCtxKeyService:this.contextKeyService),S=(0,v.generateCtxMenu)({menus:A,args:[{containerId:b}]});this.contextMenuRenderer.show({menuNodes:S[1],anchor:{x:y.clientX,y:y.clientY}})};const d=p.slotRendererRegistry.getTabbarConfig(f);this.behaviorHandler=new a.TabbarBehaviorHandler(f,d),this.scopedCtxKeyService=this.contextKeyService.createScoped(),this.scopedCtxKeyService.createKey("triggerWithTab",!0),this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerGlobalToggleCommand(),label:(0,l.localize)("layout.tabbar.toggle")},group:"0_global",when:"triggerWithTab == true"}),this.activatedKey=this.contextKeyService.createKey((0,l.getTabbarCtxKey)(this.location),""),this.behaviorHandler.registerLocationSpecificCommands({commandRegistry:this.commandRegistry,layoutService:this.layoutService}),this.commonTitleMenu=this.behaviorHandler.registerLocationSpecificMenus({menuRegistry:this.menuRegistry,ctxMenuService:this.ctxMenuService}),this.eventBus.onDirective(l.ResizeEvent.createDirective(this.location),()=>{this.onResize()})}get onDidRegisterContainer(){return this.onDidRegisterContainerEmitter.event}updateNextContainerId(f){(0,l.isUndefined)(f)?this.useFirstContainerId=!0:this.nextContainerId=f}updateCurrentContainerId(f,d){d?this.containerIdObs.set(f,d):(0,s.transaction)(y=>{this.containerIdObs.set(f,y)})}updateBadge(f,d){const y=this.getContainer(f);y&&y.options&&(y.options.badge=d),y?.fireChange(y)}getContainerState(f){return this.state.get(f)}hideContainer(f){const d=this.state.get(f);d&&(d.hidden=!0,this.onStateChangeEmitter.fire())}showContainer(f){const d=this.state.get(f);d&&(d.hidden=!1,this.onStateChangeEmitter.fire())}updatePanelVisibility(f){f===void 0&&(f=this.containersMap.size>0),this.updatePanel(f)}ensureViewReady(){(0,l.isDefined)(this.barSize)&&(0,l.isDefined)(this.panelSize)?this.resolveViewReady():this.shouldWaitForViewRender=!0}updatePanelSize(f){this.panelSize=f,(0,l.isDefined)(this.barSize)&&this.shouldWaitForViewRender&&this.resolveViewReady()}updateBarSize(f){this.barSize=f,(0,l.isDefined)(this.panelSize)&&this.shouldWaitForViewRender&&this.resolveViewReady()}resolveViewReady(){this.isEmptyTabbar?l.Event.once(this.onDidRegisterContainer)(()=>{this.viewReady.resolve()}):this.viewReady.resolve()}getBarSize(){return this.barSize}updateTabInMoreKey(f,d){const y=this.tabInMoreKeyMap.get(f);y&&y.set(d)}get visibleContainers(){const f=[];return this.containersMap.forEach(d=>{const y=d.options&&this.state.get(d.options.containerId);(!y||!y.hidden)&&f.push(d)}),f.sort((d,y)=>this.getContainerState(d.options.containerId).priority-this.getContainerState(y.options.containerId).priority)}registerResizeHandle(f){return this.resizeHandle=this.behaviorHandler.wrapResizeHandle(f),this.listenCurrentChange()}registerContainer(f,d){var y;if(this.containersMap.has(f))return;this.useFirstContainerId&&(this.useFirstContainerId=!1,this.updateCurrentContainerId(f)),this.nextContainerId===f&&this.updateCurrentContainerId(f);const b=new l.DisposableCollection,A=d.options||{containerId:f};d.options=A;const S=new l.Emitter;this.containersMap.set(f,{fireChange:I=>S.fire(I),onChange:S.event,views:d.views,options:A}),b.push({dispose:()=>{this.containersMap.delete(f),this.state.delete(f)}}),this.updatePanelVisibility(this.containersMap.size>0);let D=this.sortedContainers.findIndex(I=>{var w,T;return(((w=I.options)===null||w===void 0?void 0:w.priority)||1)<=(((T=d.options)===null||T===void 0?void 0:T.priority)||1)});D===-1&&(D=this.sortedContainers.length),this.sortedContainers.splice(D,0,d);for(let I=D;I<this.sortedContainers.length;I++){const T=(y=this.sortedContainers[I].options)===null||y===void 0?void 0:y.containerId;if(T){const R=this.storedState[T]||this.getContainerState(T)||{};this.state.set(T,{hidden:R.hidden,priority:I})}}b.push(this.registerSideEffects(d)),this.eventBus.fire(new g.TabBarRegistrationEvent({tabBarId:f})),f===this.currentContainerId.get()&&this.handleChange(f,""),this.viewContextKeyRegistry.registerContextKeyService(f,this.contextKeyService.createScoped()).createKey("view",f),this.isEmptyTabbar&&(this.isEmptyTabbar=!1),this.disposableMap.set(f,b),this.onDidRegisterContainerEmitter.fire(f)}registerSideEffects(f){var d;const y=new l.DisposableCollection;!((d=f.options)===null||d===void 0)&&d.hideTab||(y.push(this.registerHideMenu(f)),y.push(this.registerMoreMenu(f))),y.push(this.registerActivateKeyBinding(f,f.options.fromExtension));const b=this.contextKeyService.createKey(`workbench.${this.location}.${f.options.containerId}`,!0);return y.push({dispose:()=>{b.set(!1)}}),y.push(this.progressService.registerProgressIndicator(f.options.containerId)),y.push(this.registerContainerPanelRelatedCommand(f)),y}registerContainerPanelRelatedCommand(f){var d,y,b,A,S;const D=new l.DisposableCollection,I=(d=f.options)===null||d===void 0?void 0:d.containerId;return D.push(this.commandRegistry.registerCommand({id:"container.show."+I,label:(0,l.formatLocalize)("view.command.show",(b=(y=f.options)===null||y===void 0?void 0:y.title)!==null&&b!==void 0?b:I),labelLocalized:(0,l.createFormatLocalizedStr)("view.command.show",(S=(A=f.options)===null||A===void 0?void 0:A.title)!==null&&S!==void 0?S:I),category:"View"},{execute:()=>{this.updateCurrentContainerId(I)}})),D.push(this.commandRegistry.registerCommand({id:"container.hide."+I},{execute:()=>{this.updateCurrentContainerId("")}})),D.push(this.commandRegistry.registerCommand({id:"container.toggle."+I},{execute:()=>{this.currentContainerId.get()===I?this.updateCurrentContainerId(""):this.updateCurrentContainerId(I)}})),D}registerHideMenu(f){const d=new l.DisposableCollection,y=f.options.containerId;return d.push(this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerVisibleToggleCommand(y,d),label:f.options.title||y},group:"1_widgets"})),d}registerMoreMenu(f){const d=new l.DisposableCollection,y=f.options.containerId,b=this.scopedCtxKeyService.createKey(this.getTabInMoreCtxKey(y),!1);return this.tabInMoreKeyMap.set(y,b),d.push({dispose:()=>this.tabInMoreKeyMap.delete(y)}),d.push(this.menuRegistry.registerMenuItem(this.moreMenuId,{command:{id:this.registerMoreToggleCommand(f,d),label:f.options.title||y},group:"inline",when:`${this.getTabInMoreCtxKey(y)} == true`,toggledWhen:`${(0,l.getTabbarCtxKey)(this.location)} == ${y}`,iconClass:f.options.iconClass})),d}disposeContainer(f){var d;const y=this.disposableMap.get(f);y&&y.dispose(),this.currentContainerId.get()===f&&this.updateCurrentContainerId(((d=this.visibleContainers[0].options)===null||d===void 0?void 0:d.containerId)||"")}updateTitle(f,d){const y=this.getContainer(f);y&&(y.options.title=d)}getContainer(f){return f?this.containersMap.get(f):void 0}getTitleToolbarMenu(f){const d=this._menuMap.get(f);if(d)return d;const y=this.menuService.createMenu(v.MenuId.ViewTitle,this.viewContextKeyRegistry.getContextKeyService(f));this._menuMap.set(f,y);const b=this.disposableMap.get(f),A=[y,(0,l.toDisposable)(()=>{this._menuMap.delete(f)})];return b?b.pushAll(A):this.addDispose(A),y}doExpand(f){this.behaviorHandler.doExpand(f,this.resizeHandle)}get isExpanded(){return this.behaviorHandler.isExpanded(this.resizeHandle)}handleTabClick(f,d){const y=f.currentTarget.id;y===this.currentContainerId.get()&&!d?this.updateCurrentContainerId(""):this.updateCurrentContainerId(y)}showMoreMenu(f,d){const y=this.menuService.createMenu(this.moreMenuId,this.scopedCtxKeyService),b=(0,v.generateCtxMenu)({menus:y,args:[{lastContainerId:d}]});this.contextMenuRenderer.show({menuNodes:b[1],anchor:{x:f.clientX,y:f.clientY}})}handleDragStart(f,d){f.dataTransfer.setData("containerId",d),this.layoutService.showDropAreaForContainer(d)}handleDrop(f,d){if(f.dataTransfer.getData("containerId")){const y=f.dataTransfer.getData("containerId"),b=this.visibleContainers,A=b.findIndex(D=>y===D.options.containerId),S=b.findIndex(D=>d===D.options.containerId);this.doInsertTab(b,A,S),this.storeState()}}handleDragEnd(f){this.layoutService.hideDropArea()}restoreState(){this.storedState=this.layoutState.getState(_.LAYOUT_STATE.getTabbarSpace(this.location),{});for(const f of this.state.keys())this.storedState[f]&&this.state.set(f,this.storedState[f]);this.visibleContainers.forEach(f=>{this.tryRestoreAccordionSize(f)})}removeContainer(f){const d=this.disposableMap.get(f);d?.dispose(),this.onStateChangeEmitter.fire()}dynamicAddContainer(f,d){this.registerContainer(f,d),this.updateCurrentContainerId(f)}doInsertTab(f,d,y){const b=this.getContainerState(f[y].options.containerId).priority,A=(D,I)=>{const w=this.getContainerState(f[D].options.containerId),T=this.getContainerState(f[I].options.containerId);w.priority=T.priority};let S;if(d>y)for(S=y;S<d;S++)A(S,S+1);else for(S=y;S>d;S--)A(S,S-1);this.getContainerState(f[S].options.containerId).priority=b,this.doChangeViewEmitter.fire()}storeState(){const f={};this.state.forEach((d,y)=>{f[y]=d}),this.layoutState.setState(_.LAYOUT_STATE.getTabbarSpace(this.location),f),this.onStateChangeEmitter.fire()}registerActivateKeyBinding(f,d){const y=f.options,b=y.containerId,A=d?`workbench.view.extension.${b}`:`workbench.view.${b}`,S=new l.DisposableCollection;return S.push(this.commandRegistry.registerCommand({id:A},{execute:({forceShow:D}={})=>{this.behaviorHandler.handleActivateKeyBinding(b,this.currentContainerId.get()||"",I=>this.updateCurrentContainerId(I),D)}})),y.activateKeyBinding&&S.push(this.keybindingRegistry.registerKeybinding({command:A,keybinding:y.activateKeyBinding})),S}registerGlobalToggleCommand(){const f=`activity.bar.toggle.${this.location}`;return this.commandRegistry.registerCommand({id:f},{execute:({containerId:d})=>{this.doToggleTab(d)},isEnabled:()=>this.visibleContainers.length>1}),f}registerVisibleToggleCommand(f,d){const y=`activity.bar.toggle.${f}`;return d.push(this.commandRegistry.registerCommand({id:y},{execute:({forceShow:b}={})=>{this.doToggleTab(f,b)},isToggled:()=>!this.getContainerState(f).hidden,isEnabled:()=>this.getContainerState(f).hidden||this.visibleContainers.length!==1})),y}registerMoreToggleCommand(f,d){const{options:y}=f,{containerId:b}=y,A=`activity.bar.activate.more.${b}`;return d.push(this.commandRegistry.registerCommand({id:A},{execute:({lastContainerId:S})=>{if(this.updateCurrentContainerId(b),S){const D=this.getContainerState(b),I=this.getContainerState(S),w=D.priority;D.priority=I.priority,I.priority=w,this.storeState()}}})),A}getTabInMoreCtxKey(f){return`${f}.isInMore`}doToggleTab(f,d){const y=this.getContainerState(f);d===void 0?y.hidden=!y.hidden:y.hidden=!d,y.hidden&&this.currentContainerId.get()===f&&this.updateCurrentContainerId(this.visibleContainers[0].options.containerId),this.storeState()}shouldExpand(f){const d=this.getContainer(f);return!!(d&&d.options&&d.options.expanded)}onResize(){l.fastdom.measureAtNextFrame(()=>{if(!this.currentContainerId||!this.resizeHandle)return;const f=this.resizeHandle.getSize();f!==this.barSize&&!this.shouldExpand(this.currentContainerId.get())&&(this.prevSize=f,this.onSizeChangeEmitter.fire({size:f}))})}listenCurrentChange(){return(0,s.autorunDelta)(this.currentContainerId,({lastValue:f,newValue:d})=>{this.previousContainerId=f===u?"":f,this.handleChange(d,f)})}handleChange(f,d){var y;if(!this.resizeHandle)return;const{getSize:b,setSize:A,lockSize:S}=this.resizeHandle;this.onCurrentChangeEmitter.fire({previousId:d,currentId:f});const D=this.shouldExpand(f);if(this.shouldExpand(this.previousContainerId)||D)this.behaviorHandler.handleFullExpanded(f,D,this.resizeHandle,{barSize:this.barSize,panelSize:this.panelSize,prevSize:this.prevSize});else if(f){d&&f!==d&&(this.prevSize=b());const I=this.getContainer(f);A(this.prevSize||this.panelSize+this.barSize),S(!!(!((y=I?.options)===null||y===void 0)&&y.noResize)),this.activatedKey.set(f)}else A(this.barSize),S(!0)}tryRestoreAccordionSize(f){this.behaviorHandler.tryRestoreAccordionSize(f,this.layoutService)}};t.TabbarService=c,n.__decorate([(0,o.Autowired)(v.AbstractMenuService),n.__metadata("design:type",v.AbstractMenuService)],c.prototype,"menuService",void 0),n.__decorate([(0,o.Autowired)(v.AbstractContextMenuService),n.__metadata("design:type",v.AbstractContextMenuService)],c.prototype,"ctxMenuService",void 0),n.__decorate([(0,o.Autowired)(v.IMenuRegistry),n.__metadata("design:type",v.IMenuRegistry)],c.prototype,"menuRegistry",void 0),n.__decorate([(0,o.Autowired)(l.CommandRegistry),n.__metadata("design:type",Object)],c.prototype,"commandRegistry",void 0),n.__decorate([(0,o.Autowired)(v.ICtxMenuRenderer),n.__metadata("design:type",v.ICtxMenuRenderer)],c.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,o.Autowired)(l.KeybindingRegistry),n.__metadata("design:type",Object)],c.prototype,"keybindingRegistry",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",l.ViewContextKeyRegistry)],c.prototype,"viewContextKeyRegistry",void 0),n.__decorate([(0,o.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],c.prototype,"contextKeyService",void 0),n.__decorate([(0,o.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],c.prototype,"layoutService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",_.LayoutState)],c.prototype,"layoutState",void 0),n.__decorate([(0,o.Autowired)(m.IProgressService),n.__metadata("design:type",Object)],c.prototype,"progressService",void 0),t.TabbarService=c=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],c)},58296:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsRegistry=t.ViewsController=t.ViewContentGroups=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(17793);var v;(function(g){g.Open="2_open",g.Debug="4_debug",g.SCM="5_scm",g.More="9_more"})(v||(t.ViewContentGroups=v={}));function m(g,a){var h,u,c,E;const f=(h=g.group)!==null&&h!==void 0?h:v.More,d=(u=a.group)!==null&&u!==void 0?u:v.More;return f!==d?f.localeCompare(d):((c=g.order)!==null&&c!==void 0?c:5)-((E=a.order)!==null&&E!==void 0?E:5)}let p=class{get contents(){const a=this.items.filter(h=>h.visible);return a.length===0&&this.defaultItem?[this.defaultItem.descriptor]:a.map(h=>h.descriptor)}constructor(a){this.id=a,this._onDidChange=new o.Emitter,this.onDidChange=this._onDidChange.event,this.items=[],this.disposables=[],this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.disposables),o.Event.filter(this.viewsRegistry.onDidChangeViewWelcomeContent,h=>h===this.id)(this.onDidChangeViewWelcomeContent,this,this.disposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const a=this.viewsRegistry.getViewWelcomeContent(this.id);this.items=[];for(const h of a)if(h.when==="default")this.defaultItem={descriptor:h,visible:!0};else{const u=h.when?this.contextKeyService.match(h.when):!0;this.items.push({descriptor:h,visible:u})}this._onDidChange.fire()}onDidChangeContext(){let a=!1;for(const h of this.items){if(!h.descriptor.when||h.descriptor.when==="default")continue;const u=this.contextKeyService.match(h.descriptor.when);h.visible!==u&&(h.visible=u,a=!0)}a&&this._onDidChange.fire()}dispose(){this.disposables.forEach(a=>a.dispose()),this.disposables=[]}};t.ViewsController=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(_.IViewsRegistry),n.__metadata("design:type",Object)],p.prototype,"viewsRegistry",void 0),t.ViewsController=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],p);let s=class{constructor(){this.viewWelcomeContent=new l.SetMap,this._onDidChangeViewWelcomeContent=new o.Emitter,this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event}registerViewWelcomeContent(a,h){return this.viewWelcomeContent.add(a,h),this._onDidChangeViewWelcomeContent.fire(a),{dispose:()=>{this.viewWelcomeContent.delete(a,h),this._onDidChangeViewWelcomeContent.fire(a)}}}registerViewWelcomeContent2(a,h){const u=new Map;for(const[c,E]of h)this.viewWelcomeContent.add(a,E),u.set(c,(0,o.toDisposable)(()=>{this.viewWelcomeContent.delete(a,E),this._onDidChangeViewWelcomeContent.fire(a)}));return this._onDidChangeViewWelcomeContent.fire(a),u}getViewWelcomeContent(a){const h=[];return this.viewWelcomeContent.forEach(a,u=>h.push(u)),h.sort(m),h}};t.ViewsRegistry=s,t.ViewsRegistry=s=n.__decorate([(0,r.Injectable)()],s)},24429:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeView=t.CSSIcon=void 0,t.renderLabelWithIcons=a;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(48412),_=e(41869),v=e(43718),m=n.__importDefault(e(81388)),p=e(58296);var s;(function(c){c.iconNameSegment="[A-Za-z0-9]+",c.iconNameExpression="[A-Za-z0-9\\-]+",c.iconModifierExpression="~[A-Za-z]+"})(s||(t.CSSIcon=s={}));const g=new RegExp(`(\\\\)?\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)`,"g");function a(c){const E=new Array;let f,d=0,y=0;for(;(f=g.exec(c))!==null;){y=f.index||0,E.push(c.substring(d,y)),d=(f.index||0)+f[0].length;const[,b,A]=f;E.push(b?`$(${A})`:o.default.createElement("span",{className:(0,_.getExternalIcon)(A)}))}return d<c.length&&E.push(c.substring(d)),E}const h=c=>{const{contents:E}=c,[f,d]=o.default.useState(E.map(A=>A.precondition?!1:null)),y=(0,_.useInjectable)(_.IContextKeyService),b=(0,_.useInjectable)(_.IOpenerService);return o.default.useEffect(()=>{const A=E.map(D=>{if(D.precondition){const I=new Set;return D.precondition.keys().forEach(w=>I.add(w)),I}return null}),S=y.onDidChangeContext(D=>{A.forEach((I,w)=>{I&&D.payload.affectsSome(I)&&d(f.map((T,R)=>R===w?y.match(E[w].precondition):T))})});return()=>S.dispose()},[E]),E.length===0?null:o.default.createElement(o.default.Fragment,null,E.map(({content:A,precondition:S},D)=>{const I=A.split(`
32211
+ }`);this.resource=E||void 0}h&&this.commandService.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(h),{preview:!1})}disposeRegistedKeybinding(){for(const[,h]of this.toUnregisterUserKeybindingMap)h.dispose();for(const[,h]of this.toRestoreDefaultKeybindingMap)h.dispose()}dispose(){this.disposeRegistedKeybinding(),this.disposableCollection.dispose()}getValidateCommand(h){return h.replace(/^monaco.editor/,"editor")}async reconcile(h){const u=n.KEYMAP_FILE_URI.toString();this.resource=await this.filesystem.getFileStat(u),this.resource||(this.resource=await this.filesystem.createFile(u,{content:JSON.stringify([])}));const E=(h?h.slice(0):await this.parseKeybindings()).map(y=>({when:y.when,command:this.getValidateCommand(y.command),keybinding:y.key||y.keybinding})),f=[],d=[];this.disposeRegistedKeybinding(),E.forEach(y=>{y.command.startsWith("-")?d.push(y):f.push(y)}),f.map(y=>{this.unregisterDefaultKeybinding(y,!0),this.registerUserKeybinding(y)}),d.map(y=>{y.command=y.command.slice(1),this.unregisterDefaultKeybinding(y,!0)})}unregisterUserKeybinding(h){const u=this.toUniqueKey(h);if(this.toUnregisterUserKeybindingMap.has(u)){const c=this.toUnregisterUserKeybindingMap.get(u);c?.dispose(),this.toUnregisterUserKeybindingMap.delete(u)}}registerUserKeybinding(h){const u=this.toUniqueKey(h);this.toUnregisterUserKeybindingMap.set(u,this.keybindingRegistry.registerKeybinding(h,_.KeybindingScope.USER))}unregisterDefaultKeybinding(h,u=!1){if(u)this.keybindingRegistry.getKeybindingsForCommand(h.command).map(E=>{const f={...h,keybinding:E.keybinding};this.keybindingRegistry.unregisterKeybinding(f);const d=this.toUniqueKey(h);this.toRestoreDefaultKeybindingMap.set(d,_.Disposable.create(()=>{this.keybindingRegistry.registerKeybinding(f)}))});else{this.keybindingRegistry.unregisterKeybinding(h);const c=this.toUniqueKey(h);this.toRestoreDefaultKeybindingMap.set(c,_.Disposable.create(()=>{this.keybindingRegistry.registerKeybinding(h)}))}}restoreDefaultKeybinding(h){const u=this.toUniqueKey(h),c=this.toRestoreDefaultKeybindingMap.get(u);c&&(c?.dispose(),this.toRestoreDefaultKeybindingMap.delete(u))}toUniqueKey(h){return`${h.command}${h.when?`-${h.when}`:"-"}${h.keybinding?`-${h.keybinding}`:"-"}`}async parseKeybindings(){try{const h=await this.resource;if(!h)return[];const{content:u}=await this.filesystem.readFile(h.uri);this.storeKeybindings=this.parser.parse(u.toString())}catch(h){this.logger.warn(`ParseKeybindings fail: ${h.stack}`),this.storeKeybindings=[]}return this.storeKeybindings}async saveKeybinding(h){this.storeKeybindings=h,this.updateKeybindings(),this.resource||(this.resource=await this.filesystem.createFile(n.KEYMAP_FILE_URI.toString()));const u=await this.filesystem.setContent(this.resource,JSON.stringify(h,void 0,2));this.resource=u||void 0}async getKeybindings(){return this.storeKeybindings.map(h=>({command:h.command,keybinding:h.key,when:h.when,args:h.args}))}async open(){this.commandService.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI().withScheme(p.KEYMAPS_SCHEME),{preview:!0})}getWhen(h){return h?this.keybindingService.convertMonacoWhen(h.when):""}getScope(h){return h===_.KeybindingScope.DEFAULT?(0,_.localize)("keymaps.source.default"):h===_.KeybindingScope.USER?(0,_.localize)("keymaps.source.user"):h===_.KeybindingScope.WORKSPACE?(0,_.localize)("keymaps.source.workspace"):""}getKeybindingItems(){const h=this.commandRegistry.getCommands(),u=[];for(const b of h){const A=this.keybindingRegistry.getKeybindingsForCommand(b.id);!A||!A.length?b.label&&u.push({id:b.id,command:b.label,hasCommandLabel:!0}):A.forEach(S=>{let D;if(this.storeKeybindings){const I=this.storeKeybindings.find(w=>b&&w.command===b.id);D={id:b.id,command:b.label||b.id,keybinding:I?I.key:S?this.keybindingRegistry.acceleratorFor(S,"+").join(" "):"",when:I?this.getWhen(I):this.getWhen(A&&S),source:I?this.getScope(_.KeybindingScope.USER):this.getScope(_.KeybindingScope.DEFAULT),hasCommandLabel:!!b.label}}else D={id:b.id,command:b.label||b.id,keybinding:A&&S?this.keybindingRegistry.acceleratorFor(S,"+").join(" "):"",when:this.getWhen(A&&S),source:A&&S&&typeof S.scope<"u"?this.getScope(S.scope):"",hasCommandLabel:!!b.label};u.push(D)})}const c=u.sort((b,A)=>this.compareItem(b,A)),E=c.filter(b=>!!b.keybinding),f=c.filter(b=>!b.keybinding&&b.hasCommandLabel),d=E.filter(b=>b.hasCommandLabel),y=E.filter(b=>!b.hasCommandLabel);return[...d,...y,...f]}compareItem(h,u){return h&&u?h.source===u.source?h.command.toLowerCase().localeCompare(u.command.toLowerCase()):h.source===this.getScope(_.KeybindingScope.USER)?-1:1:0}getRaw(h){return h?h.replace(new RegExp(/<(\/)?match>/gi),""):""}};t.KeymapService=g,g.DEFAULT_SEARCH_DELAY=100,g.KEYMAP_FILE_URI=new _.URI().withScheme(_.Schemes.userStorage).withPath(p.KEYMAPS_FILE_NAME),r.__decorate([(0,l.Autowired)(_.KeybindingRegistry),r.__metadata("design:type",Object)],g.prototype,"keyBindingRegistry",void 0),r.__decorate([(0,l.Autowired)(s.KeymapsParser),r.__metadata("design:type",s.KeymapsParser)],g.prototype,"parser",void 0),r.__decorate([(0,l.Autowired)(_.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,l.Autowired)(_.CommandRegistry),r.__metadata("design:type",Object)],g.prototype,"commandRegistry",void 0),r.__decorate([(0,l.Autowired)(_.KeybindingRegistry),r.__metadata("design:type",Object)],g.prototype,"keybindingRegistry",void 0),r.__decorate([(0,l.Autowired)(_.KeybindingService),r.__metadata("design:type",Object)],g.prototype,"keybindingService",void 0),r.__decorate([(0,l.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],g.prototype,"filesystem",void 0),r.__decorate([(0,l.Autowired)(_.ILogger),r.__metadata("design:type",Object)],g.prototype,"logger",void 0),r.__decorate([(0,l.Autowired)(v.IProgressService),r.__metadata("design:type",Object)],g.prototype,"progressService",void 0),t.KeymapService=g=n=r.__decorate([(0,l.Injectable)()],g)},34879:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeymapsView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25067),m=n.__importDefault(e(78541)),p=()=>{const{keybindings:s,searchKeybindings:g,validateKeybinding:a,detectKeybindings:h,setKeybinding:u,resetKeybinding:c,getRaw:E,getScope:f,covert:d,clearCovert:y,fixed:b,onDidKeymapChanges:A,updateKeybindings:S}=(0,_.useInjectable)(v.IKeymapService),[D,I]=o.default.useState(!1),[w,T]=o.default.useState(""),[R,P]=o.default.useState(s),O=({data:Q,index:G})=>{const{id:Z,command:$,when:V,source:H,keybinding:K}=Q,[Y,X]=o.default.useState(!1),[oe,ie]=o.default.useState(K||""),[he,me]=o.default.useState(!1),[q,Ee]=o.default.useState(),[ue,te]=o.default.useState([]),fe=()=>{he||(b(),me(!0)),y(),ie(E(K)),X(!0)},Ie=We=>{const pe=a(Q,We);pe?pe!==" "?Ee({message:pe,type:l.VALIDATE_TYPE.ERROR}):X(!1):(u({command:E(Z),when:E(V)||"",keybinding:E(K)},{command:E(Z),when:E(V)||"",keybinding:We}),X(!1),y())},Me=()=>{X(!1)},Be=We=>{We.stopPropagation(),We.preventDefault();const{key:pe}=_.KeyCode.createKeyCode(We.nativeEvent),re=We.nativeEvent.shiftKey||We.nativeEvent.metaKey||We.nativeEvent.altKey||We.nativeEvent.ctrlKey;pe&&_.Key.ENTER.keyCode===pe.keyCode&&!re?oe&&Ie(oe):ie(d(We.nativeEvent))},Pe=()=>{const We=()=>{Ee(void 0),oe&&ie(""),y()},pe=re=>{re.stopPropagation(),re.preventDefault()};return o.default.createElement("div",{className:m.default.keybinding_optional_actions,onMouseDown:pe},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("close-circle-fill"),m.default.keybinding_optional_action),onClick:We,title:(0,_.localize)("keymaps.action.clear")}))},we=()=>o.default.createElement("div",{className:m.default.keybinding_key_input_placeholder},"\u23CE"),_e=We=>{const pe=re=>{re.preventDefault(),he||(b(),me(!0)),c({command:E(Z),when:E(V)||"",keybinding:oe})};if(We&&E(We)===f(_.KeybindingScope.USER))return o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("rollback"),m.default.keybinding_inline_action),onClick:pe,title:(0,_.localize)("keymaps.action.reset")})},Ne=()=>{if(!q&&ue.length>0)return o.default.createElement("div",{className:m.default.keybinding_detective_messages},o.default.createElement("div",{className:m.default.keybinding_detective_messages_label},(0,_.formatLocalize)("keymaps.keybinding.duplicate",ue.length)),o.default.createElement("ul",{className:m.default.keybinding_detective_messages_container},ue.map((We,pe)=>o.default.createElement("li",{className:m.default.keybinding_detective_messages_item,key:`${We.id}_${pe}`,title:`${We.command}-${We.when}`},o.default.createElement("div",{className:m.default.title},(0,_.localize)("keymaps.header.command.title"),": ",E(We.command)||"-"),o.default.createElement("div",{className:m.default.description},o.default.createElement("div",{style:{marginRight:4}},(0,_.localize)("keymaps.header.source.title"),": ",E(We.source)||"-"),o.default.createElement("div",null,(0,_.localize)("keymaps.header.when.title"),": ",E(We.when)||"\u2014"))))))},Te=()=>{if(Y)return o.default.createElement("div",{className:m.default.keybinding_key_input_container},Pe(),o.default.createElement(l.ValidateInput,{placeholder:(0,_.localize)("keymaps.edit.placeholder"),validateMessage:q,className:m.default.keybinding_key_input,size:"small",autoFocus:!0,name:_.NO_KEYBINDING_NAME,value:oe,onKeyDown:Be,onBlur:Me}),we(),Ne());{const We=K?.split(" ");return o.default.createElement("div",{className:m.default.keybinding_key,title:E(K),onDoubleClick:fe},o.default.createElement("div",{className:m.default.keybinding_action,onClick:fe},o.default.createElement("span",{className:(0,r.default)(K?(0,_.getIcon)("edit"):(0,_.getIcon)("plus"),m.default.keybinding_inline_action),title:K?(0,_.localize)("keymaps.action.edit"):(0,_.localize)("keymaps.action.add")}),_e(H)),We&&We[0]?We.map((pe,re)=>{const ge=pe.split("+");return o.default.createElement("div",{className:m.default.keybinding_key_block,key:`${pe}_${re}`},ge.map((De,Ae)=>o.default.createElement("div",{className:m.default.keybinding_key_item,key:`${De}_${Ae}`,dangerouslySetInnerHTML:{__html:De||""}})))}):"\u2014")}};return(0,o.useEffect)(()=>{q&&Ee(void 0),te(oe&&Y?h(Q,oe):[])},[oe]),o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item,G%2===1&&m.default.odd)},o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item_box,m.default.keybinding_command)},o.default.createElement("div",{className:m.default.command_name,title:E($),dangerouslySetInnerHTML:{__html:$}}),o.default.createElement("div",{className:(0,r.default)(m.default.limit_warp,m.default.command_id),title:E(Z),dangerouslySetInnerHTML:{__html:(0,_.formatLocalize)("keymaps.commandId.title",Z)}})),o.default.createElement("div",{className:(0,r.default)(m.default.keybinding_list_item_box)},Te()),o.default.createElement("div",{className:m.default.keybinding_list_item_box},o.default.createElement("div",{className:m.default.limit_warp,title:E(V||"\u2014"),dangerouslySetInnerHTML:{__html:V||"\u2014"}})),o.default.createElement("div",{className:m.default.keybinding_list_item_box},o.default.createElement("div",{title:E(H),dangerouslySetInnerHTML:{__html:H||""}})))},M=()=>{const Q=()=>{I(!D)};return o.default.createElement("div",{className:m.default.search_inline_action},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("keyboard"),m.default.search_inline_action_icon,D&&m.default.active),onClick:Q}))},k=(0,o.useCallback)(Q=>{T(Q),g(Q)},[w]),F=Q=>{if(!D){const G=Q.target&&Q.target.value?Q.target.value.toLocaleLowerCase():"";k(G)}},L=Q=>{if(D){Q.stopPropagation(),Q.preventDefault();const{key:G}=_.KeyCode.createKeyCode(Q.nativeEvent);if(G&&_.Key.ENTER.keyCode===G.keyCode)return;k(d(Q.nativeEvent))}},B=()=>{w&&(T(""),g("")),y()},U=()=>o.default.createElement("div",{className:m.default.keybinding_optional_actions},o.default.createElement("span",{className:(0,r.default)((0,_.getIcon)("close-circle-fill"),m.default.keybinding_optional_action),onClick:B,title:(0,_.localize)("keymaps.action.reset")})),W=()=>o.default.createElement("div",{className:m.default.search_container},o.default.createElement(l.Input,{className:m.default.search_input,placeholder:(0,_.localize)(D?"keymaps.search.keyboard.placeholder":"keymaps.search.placeholder"),type:"text",value:w,name:_.NO_KEYBINDING_NAME,onChange:F,onKeyDown:L,addonBefore:M()}),U()),j=(0,o.useMemo)(()=>{const Q=[{title:(0,_.localize)("keymaps.header.command.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.keybinding.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.when.title"),classname:m.default.keybinding_header_item},{title:(0,_.localize)("keymaps.header.source.title"),classname:m.default.keybinding_header_item}];return o.default.createElement("div",{className:m.default.keybinding_header},Q.map((G,Z)=>o.default.createElement("div",{className:G.classname,key:`${G.title}_${Z}`},G.title)))},[]);return(0,o.useEffect)(()=>{const Q=A(G=>{P(G)});return S(),()=>{Q.dispose()}},[]),o.default.createElement("div",{className:m.default.keybinding_container},o.default.createElement("div",{className:m.default.keybinding_searchbar},W()),o.default.createElement("div",{className:m.default.keybinding_body},j,o.default.createElement("div",{className:m.default.keybinding_list},o.default.createElement(l.RecycleList,{itemHeight:40,data:R,template:O,className:m.default.keybinding_list_container}))))};t.KeymapsView=p},79312:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEYMAPS_FILE_NAME=t.KEYMAPS_SCHEME=void 0,t.KEYMAPS_SCHEME="keymaps",t.KEYMAPS_FILE_NAME="keymaps.json"},25067:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79312),t),n.__exportStar(e(88811),t)},88811:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKeymapService=void 0,t.IKeymapService=Symbol("IKeymapService")},83507:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogModule=t.LogServiceClient=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(47548),_=e(49187);n.__exportStar(e(47548),t);var v=e(1700);Object.defineProperty(t,"LogServiceClient",{enumerable:!0,get:function(){return v.LogServiceClient}});let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.ILoggerManagerClient,useClass:_.LoggerManagerClient}],this.backServices=[{servicePath:l.LogServiceForClientPath,clientToken:l.ILoggerManagerClient}]}};t.LogModule=m,t.LogModule=m=n.__decorate([(0,r.Injectable)()],m)},49187:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerManagerClient=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(47548),_=e(1700);let v=class{constructor(){this.logLevelChangeEmitter=new o.Emitter}getLogger(p,s){const g=new _.LogServiceClient(p);return g.setup(this.logServiceForClient,s),g}getBrowserLogger(p){return new _.LogServiceClient(p)}async getLogFolder(){return await this.logServiceForClient.getLogFolder()}async setGlobalLogLevel(p){return await this.logServiceForClient.setGlobalLogLevel(p)}async getGlobalLogLevel(){return await this.logServiceForClient.getGlobalLogLevel()}async dispose(){return this.logLevelChangeEmitter.dispose(),await this.logServiceForClient.disposeAll()}get onDidChangeLogLevel(){return this.logLevelChangeEmitter.event}onDidLogLevelChanged(p){this.logLevelChangeEmitter.fire(p)}};t.LoggerManagerClient=v,n.__decorate([(0,r.Autowired)(l.LogServiceForClientPath),n.__metadata("design:type",Object)],v.prototype,"logServiceForClient",void 0),t.LoggerManagerClient=v=n.__decorate([(0,r.Injectable)()],v)},1700:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogServiceClient=void 0;const n=e(43718),r=e(47548);class o{constructor(_){this.level=r.LogLevel.Verbose,this.ready=new n.Deferred,this.namespace=_,this.debugLog=new r.DebugLog(_)}async setup(_,v){this.logServiceForClient=_,this.pid=v;const m=await this.logServiceForClient.getGlobalLogLevel();this.level=m,this.ready.resolve()}async getLevel(){return this.logServiceForClient?await this.logServiceForClient.getLevel(this.namespace):this.level}async setLevel(_){this.level=_,this.logServiceForClient&&await this.logServiceForClient.setLevel(this.namespace,_)}async verbose(..._){this.debugLog.verbose(..._),this.logServiceForClient&&await this.logServiceForClient.verbose(this.namespace,(0,r.format)(_),this.pid)}async debug(..._){this.debugLog.debug(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Debug)&&await this.logServiceForClient.debug(this.namespace,(0,r.format)(_),this.pid))}async log(..._){this.debugLog.log(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Info)&&await this.logServiceForClient.log(this.namespace,(0,r.format)(_),this.pid))}async warn(..._){this.debugLog.warn(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Warning)&&await this.logServiceForClient.warn(this.namespace,(0,r.format)(_),this.pid))}async error(..._){this.debugLog.error(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Error)&&await this.logServiceForClient.error(this.namespace,(0,r.format)(_),this.pid))}async critical(..._){this.debugLog.error(..._),this.logServiceForClient&&(await this.ready.promise,!(this.level>r.LogLevel.Critical)&&await this.logServiceForClient.critical(this.namespace,(0,r.format)(_),this.pid))}async dispose(){this.debugLog.destroy(),this.logServiceForClient&&await this.logServiceForClient.disposeLogger(this.namespace)}}t.LogServiceClient=o},47548:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(4892),t),n.__exportStar(e(46196),t)},46196:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILogServiceForClient=void 0,t.format=e,t.ILogServiceForClient=Symbol("LogServiceForClient");function e(n){let r="";for(let o=0;o<n.length;o++){let l=n[o];if(l instanceof Error){const _=Array.prototype.slice.call(arguments);_[0]=l.stack,l=e(_)}else if(typeof l=="object")try{l=JSON.stringify(l)}catch{}else if(typeof l=="symbol")try{l=l.toString()}catch{}r+=(o>0?" ":"")+l}return r}},73344:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(47548),t)},9522:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccordionServiceFactory=t.AccordionService=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(46343)),l=e(76003),_=e(41869),v=e(81878),m=e(71707),p=e(95416),s=e(93899),g=e(68969),a=e(28423),h=e(17793);let u=class extends _.WithEventBus{get views(){return this.viewsObservable.get()}get state(){return this.stateObservable.get()}set alignment(E){this._alignment!==E&&(this._alignment=E,this.doUpdateResize())}constructor(E,f){super(),this.containerId=E,this.noRestore=f,this.forceRevealContextKeys=new Map,this.viewWhenContextkeys=new Set,this.appendedViewSet=new Set,this.viewsWithContextKey=new Set,this.viewsObservable=(0,a.observableValue)(this,[]),this.stateObservable=(0,a.observableValue)(this,{}),this.visibleViews=(0,a.derived)(this,d=>{const y=this.viewsObservable.read(d);return this.stateObservable.read(d),y.filter(b=>!this.getViewState(b.id).hidden)}),this.rendered=!1,this.menuId=`${s.MenuId.AccordionContext}/${this.containerId}`,this.toDispose=new Map,this.didChangeViewTitleEmitter=this.registerDispose(new _.Emitter),this.onDidChangeViewTitle=this.didChangeViewTitleEmitter.event,this.beforeAppendViewEmitter=this.registerDispose(new _.Emitter),this.onBeforeAppendViewEvent=this.beforeAppendViewEmitter.event,this.afterAppendViewEmitter=this.registerDispose(new _.Emitter),this.onAfterAppendViewEvent=this.afterAppendViewEmitter.event,this.afterDisposeViewEmitter=this.registerDispose(new _.Emitter),this.onAfterDisposeViewEvent=this.afterDisposeViewEmitter.event,this._alignment="vertical",this.doUpdateResize=(0,r.default)(()=>{var d,y;let b;if(Object.keys(this.state).forEach(A=>{this.state[A].hidden||this.state[A].collapsed||(b?(this.state[A].size||0)>(this.state[b].size||0)&&(b=A):b=A)}),b&&this.splitPanelService.isVisible&&this.expandedViews.length>1&&!((d=this.splitPanelService.rootNode)===null||d===void 0)&&d.clientHeight){const A=((y=this.splitPanelService.rootNode)===null||y===void 0?void 0:y.clientHeight)-this.getPanelFullHeight();if(A){const S=this.state;S[b].size+=A,(0,a.transaction)(D=>{this.stateObservable.set({...S},D)}),this.toggleOpen(b,!1)}}},16),this.storeState=()=>{this.noRestore||!this.rendered||this.layoutState.setState(p.LAYOUT_STATE.getContainerSpace(this.containerId),this.state)},this.handleSectionClick=(d,y,b)=>{this.doToggleOpen(d,y,b)},this.handleContextMenu=(d,y)=>{d.preventDefault();const b=this.ctxMenuService.createMenu({id:this.menuId,config:{args:[{viewId:y}]},contextKeyService:y?this.viewContextKeyRegistry.getContextKeyService(y):void 0}),A=b.getGroupedMenuNodes();b.dispose(),this.contextMenuRenderer.show({menuNodes:A[1],anchor:{x:d.clientX,y:d.clientY}})},this.addDispose((0,a.recomputeInitiallyAndOnChange)(this.visibleViews)),this.splitPanelService=this.splitPanelManager.getService(E),this.addDispose(this.splitPanelService),this.scopedCtxKeyService=this.contextKeyService.createScoped(),this.scopedCtxKeyService.createKey("triggerWithSection",!0),this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerGlobalToggleCommand(),label:(0,_.localize)("layout.view.hide","Hide")},group:"0_global",when:"triggerWithSection == true"}),this.viewContextKeyRegistry.afterContextKeyServiceRegistered(this.containerId,d=>{this.topViewKey=d.createKey("view",E),setTimeout(()=>{this.popViewKeyIfOnlyOneViewVisible()})}),this.addDispose(_.Event.debounce(this.contextKeyService.onDidChangeContext,(d,y)=>d||y.payload.affectsSome(this.viewWhenContextkeys),50)(d=>d&&this.handleContextKeyChange(),this)),this.splitPanelService.whenReady.then(()=>{this.listenWindowResize()})}updateViewTitle(E,f){const d=this.views.find(y=>y.id===E);d?(d.name=f,this.didChangeViewTitleEmitter.fire({id:E,title:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion title`)}updateViewDesciption(E,f){const d=this.views.find(y=>y.id===E);d?(d.description=f,this.didChangeViewTitleEmitter.fire({id:E,description:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion description`)}updateViewMessage(E,f){const d=this.views.find(y=>y.id===E);d?(d.message=f,this.didChangeViewTitleEmitter.fire({id:E,message:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion message`)}updateViewBadge(E,f){const d=this.views.find(y=>y.id===E);d?(d.badge=f,this.didChangeViewTitleEmitter.fire({id:E,badge:f})):this.logger.error(`No target view \`${E}\` found, unable to update accordion message`)}tryUpdateResize(){this.doUpdateResize()}restoreState(){if(this.noRestore)return;const E={};this.visibleViews.get().forEach(d=>E[d.id]={collapsed:!1,hidden:!1});const f=this.layoutState.getState(p.LAYOUT_STATE.getContainerSpace(this.containerId),E);(0,o.default)(f,E)||(0,a.transaction)(d=>{this.stateObservable.set({...f},d)}),this.popViewKeyIfOnlyOneViewVisible(),this.splitPanelService.whenReady.then(()=>{this.restoreSize(),this.rendered=!0})}restoreSize(){var E;let f=((E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientHeight)||0,d;if(this.visibleViews.get().forEach((y,b)=>{const A=this.state[y.id];A.collapsed?(this.setSize(b,0,!1,!0),f-=this.headerSize):!A.collapsed&&A.size&&(this.setSize(b,A.size,!1,!0),f-=A.size,d=b)}),d){const y=this.visibleViews.get()[d];this.setSize(d,this.state[y.id].size+f)}}initConfig(E){const{headerSize:f,minSize:d}=E;this.headerSize=f,this.minSize=d}registerContextService(E){let f=this.viewContextKeyRegistry.getContextKeyService(E);return f||(f=this.contextKeyService.createScoped(),f.createKey("view",E),this.viewContextKeyRegistry.registerContextKeyService(E,f)),f}getSectionToolbarMenu(E){const f=this.registerContextService(E),d=this.menuService.createMenu(s.MenuId.ViewTitle,f),y=this.views.find(b=>b.id===E);return y&&(y.titleMenu=d),d}updateView(E){(0,a.transaction)(f=>{const d=this.views;if(E.priority){const y=d.findIndex(b=>(b.priority||0)<(E.priority||0));d.splice(y===-1?d.length:y,0,E),this.viewsObservable.set([...d],f)}else this.viewsObservable.set([...d,E],f)})}appendView(E,f){if(this.appendedViewSet.has(E.id)&&!f)return;const d=new _.DisposableCollection;d.push(this.progressService.registerProgressIndicator(E.id));const y=this.views.findIndex(b=>b.id===E.id);if(y!==-1){(0,a.transaction)(b=>{const A=this.views;A[y]=Object.assign({},A[y],E),this.viewsObservable.set([...A],b)});return}if(E.when){this.viewsWithContextKey.add(E);const b=this.createRevealContextKey(E.id);if(this.fillKeysInWhenExpr(this.viewWhenContextkeys,E.when),!this.contextKeyService.match(E.when)&&!this.contextKeyService.match(b))return;this.appendedViewSet.add(E.id)}this.beforeAppendViewEmitter.fire(E.id),this.updateView(E),this.registerContextService(E.id),d.push(this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerVisibleToggleCommand(E.id,d),label:(E.name||E.id).toUpperCase()},group:"1_widgets"})),this.toDispose.set(E.id,d),this.popViewKeyIfOnlyOneViewVisible(),this.afterAppendViewEmitter.fire(E.id)}disposeView(E){const f=this.views.findIndex(y=>y.id===E);f>-1&&(0,a.transaction)(y=>{const b=this.views;b.splice(f,1),this.viewsObservable.set([...b],y)});const d=this.toDispose.get(E);d&&d.dispose(),this.appendedViewSet.delete(E),this.popViewKeyIfOnlyOneViewVisible(),this.afterDisposeViewEmitter.fire(E)}revealView(E){const f=this.forceRevealContextKeys.get(E);f&&f.key.set(!0)}disposeAll(){(0,a.transaction)(E=>{this.viewsObservable.set([],E)}),this.toDispose.forEach(E=>{E.dispose()})}onResize(E){if(E.payload.slotLocation&&this.state[E.payload.slotLocation]){const f=E.payload.slotLocation;_.fastdom.measureAtNextFrame(()=>{const d=document.getElementById(f);if(d){const y=this.state;y[f].size=d.clientHeight,(0,a.transaction)(b=>{this.stateObservable.set({...y},b)}),this.storeState()}})}}getPanelFullHeight(E){return Object.keys(this.state).filter(f=>this.views.find(d=>d.id===f)&&f!==E).reduce((f,d)=>f+(this.state[d].collapsed?this.headerSize:this.state[d].hidden?0:this.state[d].size),0)}listenWindowResize(){window.addEventListener("resize",this.doUpdateResize),this.addDispose({dispose:()=>window.removeEventListener("resize",this.doUpdateResize)})}createRevealContextKey(E){const f=`forceShow.${E}`;return this.forceRevealContextKeys.set(E,{when:`${f} == true`,key:this.contextKeyService.createKey(f,!1)}),this.viewWhenContextkeys.add(f),`${f} == true`}registerGlobalToggleCommand(){const E=`view-container.hide.${this.containerId}`;return this.commandRegistry.registerCommand({id:E},{execute:({viewId:f})=>{this.doToggleView(f)},isEnabled:()=>this.visibleViews.get().length>1}),E}registerVisibleToggleCommand(E,f){const d=`view-container.hide.${E}`;return f.push(this.commandRegistry.registerCommand({id:d},{execute:({forceShow:y}={})=>{this.doToggleView(E,y)},isToggled:()=>!this.getViewState(E).hidden,isEnabled:()=>this.getViewState(E).hidden||this.visibleViews.get().length>1})),d}doToggleView(E,f){const d=this.getViewState(E);let y;f===void 0?y=!d.hidden:y=!f,d.hidden=y,this.updateViewState(E,d),this.popViewKeyIfOnlyOneViewVisible(),this.storeState()}popViewKeyIfOnlyOneViewVisible(){if(!this.topViewKey)return;const E=this.visibleViews.get();E.length===1?this.topViewKey.set(E[0].id):this.topViewKey.reset()}toggleViewVisibility(E,f){this.doToggleView(E,f)}get expandedViews(){return this.views.filter(E=>{const f=this.state[E.id];return!f||f&&!f.hidden&&!f.collapsed})}toggleOpen(E,f){const d=this.visibleViews.get().findIndex(y=>y.id===E);d>-1&&this.doToggleOpen(E,f,d,!0)}getViewState(E){let f=this.state[E];const d=this.views.find(y=>y.id===E);return f||(this.updateViewState(E,{collapsed:d?.collapsed||!1,hidden:d?.hidden||!1}),f=this.state[E]),f}updateViewState(E,f){const d=this.state;d[E]=f,(0,a.transaction)(y=>{this.stateObservable.set({...d},y)})}doToggleOpen(E,f,d,y){const b=this.getViewState(E);this.updateViewState(E,{...b,collapsed:f});const A=this._alignment==="horizontal";let S;if(f)S=this.setSizeByAlignment(d,0,!1,y,A);else{const D=this.expandedViews.length===1?this.getAvailableSizeByAlignment(A):b.size||this.minSize;S=this.setSizeByAlignment(d,D,!1,y,A)}this.adjustAdjacentViews(d,S,y,A),this.eventBus.fire(new h.ViewCollapseChangedEvent({viewId:E,collapsed:f}))}setSizeByAlignment(E,f,d,y,b){return b?this.setSizeHorizontal(E,f,d,y):this.setSize(E,f,d,y)}getAvailableSizeByAlignment(E){return E?this.getAvailableSizeHorizontal():this.getAvailableSize()}adjustAdjacentViews(E,f,d,y){const b=this.visibleViews.get();for(let A=b.length-1;A>E;A--)this.getViewState(b[A].id).collapsed!==!0?f=this.setSizeByAlignment(A,f,!0,d,y):this.setSizeByAlignment(A,0,!1,d,y);for(let A=E-1;A>=0;A--)(this.state[b[A].id]||{}).collapsed!==!0?f=this.setSizeByAlignment(A,f,!0,d,y):this.setSizeByAlignment(A,0,!1,d,y)}setSize(E,f,d,y){var b;const A=this.visibleViews.get()[E],S=(b=this.splitPanelService.rootNode)===null||b===void 0?void 0:b.clientHeight,D=this.splitPanelService.panels[E];if(!D)return 0;y||D.classList.add("resize-ease"),!f&&!d?(f=this.headerSize,D.classList.add(v.RESIZE_LOCK)):D.classList.remove(v.RESIZE_LOCK);const I=D.clientHeight,w=this.getViewState(A.id);let T=f;if(d&&(T=Math.max(I-f,this.minSize)),E===this.expandedViews.length-1&&(0,_.isDefined)(S))if(T+E*this.minSize>S)T-=T+E*this.minSize-S;else{const R=this.getPanelFullHeight(A.id);T+R<S&&(T+=S-(T+R))}if(this.rendered){let R;f===this.headerSize?R=I:R=T,R!==this.headerSize&&(w.size=R)}return this.storeState(),w.nextSize=T,y||setTimeout(()=>{D.classList.remove("resize-ease")},200),d?T-(I-f):f-I}getAvailableSize(){var E;const f=(E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientHeight;return f?f-(this.visibleViews.get().length-1)*this.headerSize:0}setSizeHorizontal(E,f,d,y){var b;const A=this.visibleViews.get()[E],S=(b=this.splitPanelService.rootNode)===null||b===void 0?void 0:b.clientWidth,D=this.splitPanelService.panels[E];if(!D)return 0;y||D.classList.add("resize-ease-horizontal"),!f&&!d?(f=this.headerSize,D.classList.add(v.RESIZE_LOCK)):D.classList.remove(v.RESIZE_LOCK);const I=D.clientWidth,w=this.getViewState(A.id);let T=f;if(d&&(T=Math.max(I-f,this.minSize)),E===this.expandedViews.length-1&&(0,_.isDefined)(S))if(T+E*this.minSize>S)T-=T+E*this.minSize-S;else{const R=this.getPanelFullWidthHorizontal(A.id);T+R<S&&(T+=S-(T+R))}if(this.rendered){let R;f===this.headerSize?R=I:R=T,R!==this.headerSize&&(w.size=R)}return this.storeState(),w.nextSize=T,y||setTimeout(()=>{D.classList.remove("resize-ease-horizontal")},200),d?T-(I-f):f-I}getAvailableSizeHorizontal(){var E;const f=(E=this.splitPanelService.rootNode)===null||E===void 0?void 0:E.clientWidth;return f?f-(this.visibleViews.get().length-1)*this.headerSize:0}getPanelFullWidthHorizontal(E){return Object.keys(this.state).filter(f=>this.views.find(d=>d.id===f)&&f!==E).reduce((f,d)=>f+(this.state[d].collapsed?this.headerSize:this.state[d].hidden?0:this.state[d].size),0)}handleContextKeyChange(){Array.from(this.viewsWithContextKey.values()).forEach(E=>{this.contextKeyService.match(E.when)||this.contextKeyService.match(this.forceRevealContextKeys.get(E.id).when)?this.appendView(E):this.disposeView(E.id)})}fillKeysInWhenExpr(E,f){this.contextKeyService.getKeysInWhen(f).forEach(y=>{E.add(y)})}};t.AccordionService=u,n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",m.SplitPanelManager)],u.prototype,"splitPanelManager",void 0),n.__decorate([(0,l.Autowired)(s.AbstractMenuService),n.__metadata("design:type",s.AbstractMenuService)],u.prototype,"menuService",void 0),n.__decorate([(0,l.Autowired)(s.AbstractContextMenuService),n.__metadata("design:type",s.AbstractContextMenuService)],u.prototype,"ctxMenuService",void 0),n.__decorate([(0,l.Autowired)(s.IMenuRegistry),n.__metadata("design:type",s.IMenuRegistry)],u.prototype,"menuRegistry",void 0),n.__decorate([(0,l.Autowired)(_.CommandRegistry),n.__metadata("design:type",Object)],u.prototype,"commandRegistry",void 0),n.__decorate([(0,l.Autowired)(s.ICtxMenuRenderer),n.__metadata("design:type",s.ICtxMenuRenderer)],u.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",_.ViewContextKeyRegistry)],u.prototype,"viewContextKeyRegistry",void 0),n.__decorate([(0,l.Autowired)(_.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),n.__decorate([(0,l.Autowired)(p.LayoutState),n.__metadata("design:type",p.LayoutState)],u.prototype,"layoutState",void 0),n.__decorate([(0,l.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],u.prototype,"progressService",void 0),n.__decorate([(0,l.Autowired)(_.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,_.OnEvent)(_.ResizeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.ResizeEvent]),n.__metadata("design:returntype",void 0)],u.prototype,"onResize",null),t.AccordionService=u=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Boolean])],u),t.AccordionServiceFactory=Symbol("AccordionServiceFactory")},70936:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Panel=t.AccordionContainer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(1149),m=e(43718),p=e(9522),s=e(95867),g=({alignment:h="vertical",views:u,containerId:c,headerSize:E=24,minSize:f=120,className:d,noRestore:y,style:b})=>{const A=(0,l.useInjectable)(v.LayoutViewSizeConfig),S=(0,l.useInjectable)(p.AccordionServiceFactory)(c,y);S.alignment=h;const D=(0,l.useAutorun)(S.visibleViews);(0,l.useAutorun)(S.stateObservable);const I=(0,o.useMemo)(()=>E||A.accordionHeaderSizeHeight,[E]);return o.default.useEffect(()=>{if(u.length)for(const w of u)S.appendView(w)},[u]),o.default.useEffect(()=>{S.initConfig({headerSize:I,minSize:f})},[]),o.default.createElement(_.SplitPanel,{className:(0,r.default)(d,{horizontal:h==="horizontal"}),style:b,headerSize:E,dynamicTarget:!0,id:c,resizeKeep:!1,direction:h==="horizontal"?"left-to-right":"top-to-bottom"},D.map((w,T)=>{const R=S.getViewState(w.id),P=w.titleMenu||S.getSectionToolbarMenu(w.id),{collapsed:O,nextSize:M}=R;return o.default.createElement(s.AccordionSection,{noHeader:D.length===1,onItemClick:()=>{S.handleSectionClick(w.id,!O,T)},onContextMenuHandler:S.handleContextMenu,alignment:h,header:w.name&&(0,m.replaceLocalizePlaceholder)(w.name)||w.id,viewId:w.id,key:w.id,message:w.message,description:w.description,badge:w.badge,title:w.name,expanded:!O,accordionService:S,index:T,headerSize:E,minSize:E,initialProps:w.initialProps,titleMenu:P,titleMenuContext:w.titleMenuContext,savedSize:O?E:M,flex:w.weight||1},w.component)}))};t.AccordionContainer=g,t.AccordionContainer.displayName="AccordionContainer";const a=({children:h})=>o.default.createElement("div",null,h);t.Panel=a,t.Panel.displayName="Panel"},95867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccordionSection=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),_=e(25918),v=e(93899),m=e(68969),p=e(68974),s=e(69589),g=e(52416),a=n.__importDefault(e(81388)),h={tabIndex:0},u=({header:c,description:E,message:f,headerClass:d,onItemClick:y,noHeader:b,children:A,badge:S,headerSize:D,viewId:I,initialProps:w,titleMenu:T,titleMenuContext:R,expanded:P,accordionService:O,onContextMenuHandler:M,alignment:k})=>{const F=(0,l.useInjectable)(g.IIconService),L=(0,l.useDesignStyles)(a.default.actions_wrap,"actions_wrap"),B=(0,l.useDesignStyles)(a.default.kt_split_panel,"kt_split_panel"),U=(0,l.useDesignStyles)(a.default.kt_split_panel_header,"kt_split_panel_header"),W=(0,l.useDesignStyles)(a.default.kt_split_panel_body,"kt_split_panel_body"),j=(0,l.useDesignStyles)(a.default.section_badge,"section_badge"),Q=o.default.useRef(null),[G,Z]=o.default.useState({header:c,description:E,message:f,badge:S});o.default.useEffect(()=>{const ie=O.onDidChangeViewTitle(({id:he,title:me,description:q,message:Ee,badge:ue})=>{let te=!1;const fe={...G};I===he&&me&&me!==G.header&&(fe.header=me,te=!0),I===he&&ue!==G.badge&&(fe.badge=ue,te=!0),I===he&&q&&q!==G.description&&(fe.description=q,te=!0),I===he&&Ee&&Ee!==G.message&&(fe.message=Ee,te=!0),te&&Z(fe)});return()=>{ie.dispose()}},[]);const $=o.default.useCallback(()=>{y()},[y]),V=o.default.useMemo(()=>({overflow:P?"auto":"hidden"}),[P]),H=(0,l.useViewState)(I,Q,!0),Y=(0,l.useInjectable)(m.IProgressService).getIndicator(I),X=A,oe=o.default.useMemo(()=>P?`${D}px`:k==="horizontal"?"100%":`${D}px`,[P,D,k]);return o.default.createElement("div",{className:(0,r.default)(B,{horizontal:k==="horizontal"}),"data-view-id":I,draggable:!1},!b&&o.default.createElement("div",{...h,className:(0,r.default)(U,d),onClick:$,onContextMenu:ie=>M(ie,I),style:{height:oe,lineHeight:oe}},o.default.createElement("div",{className:a.default.label_wrap},o.default.createElement("i",{className:(0,r.default)((0,l.getIcon)("arrow-down"),a.default.arrow_icon,P?"":a.default.kt_mod_collapsed)}),o.default.createElement("div",{className:a.default.section_label,style:{lineHeight:D+"px"}},G.header),G.description&&o.default.createElement("div",{className:a.default.section_description,style:{lineHeight:D+"px"}},typeof G.description=="string"?(0,s.transformLabelWithCodicon)(G.description,{},F.fromString.bind(F)):G.description),G.badge&&o.default.createElement("div",{className:j},typeof G.badge=="string"?G.badge:G.badge.value)),P&&T&&o.default.createElement("div",{className:L},(0,v.isIMenu)(T)?o.default.createElement(_.InlineActionBar,{menus:T,context:R}):o.default.createElement(_.InlineMenuBar,{menus:T,context:R}))),o.default.createElement("div",{className:(0,r.default)([W,{[a.default.hide]:!P}]),style:V,ref:Q},o.default.createElement(p.ProgressBar,{className:a.default.progressBar,progressModel:Y?.progressModel}),o.default.createElement(l.ErrorBoundary,null,G.message&&o.default.createElement("div",{className:a.default.kt_split_panel_message},G.message),o.default.createElement(X,{...w,viewState:{height:H.height-(G.message?22:0),width:H.width}}))))};t.AccordionSection=u},91527:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleBar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(752),_=n.__importDefault(e(81388));t.TitleBar=r.default.memo(v=>{const m=(0,o.useDesignStyles)(_.default.titlebar,"titlebar"),p=(0,o.useInjectable)(l.TabbarServiceFactory)(v.side),s=r.default.useCallback(a=>{v.containerId&&v.side&&p.handleDragStart(a,v.containerId)},[v.containerId,v.side,p]),g=r.default.useCallback(a=>{p.handleDragEnd(a)},[p]);return r.default.createElement("div",{className:m,style:{height:v.height}},!v.draggable&&r.default.createElement("h1",null,v.title),!!v.draggable&&r.default.createElement("h1",{draggable:!0,style:{cursor:"pointer"},onDragStart:s,onDragEnd:g},v.title),v.menubar||null)}),t.TitleBar.displayName="TitleBar"},75053:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RETRACT_PANEL_COMMAND=t.EXPAND_PANEL_COMMAND=t.IS_VISIBLE_PANEL_COMMAND=t.IS_VISIBLE_EXTEND_VIEW_COMMAND=t.IS_VISIBLE_VIEW_COMMAND=t.TOGGLE_PANEL_COMMAND=t.TOGGLE_EXTEND_VIEW_COMMAND=t.TOGGLE_VIEW_COMMAND=t.WORKBENCH_ACTION_CLOSEPANEL=t.WORKBENCH_ACTION_CLOSESIDECAR=t.RETRACT_BOTTOM_PANEL=t.EXPAND_BOTTOM_PANEL=t.IS_VISIBLE_RIGHT_PANEL_COMMAND=t.IS_VISIBLE_LEFT_PANEL_COMMAND=t.IS_VISIBLE_BOTTOM_PANEL_COMMAND=t.TOGGLE_BOTTOM_PANEL_COMMAND=t.TOGGLE_RIGHT_PANEL_COMMAND=t.TOGGLE_LEFT_PANEL_COMMAND=void 0;const n=e(41869);t.TOGGLE_LEFT_PANEL_COMMAND={id:"main-layout.left-panel.toggle",delegate:"main-layout.view.toggle"},t.TOGGLE_RIGHT_PANEL_COMMAND={id:"main-layout.right-panel.toggle",delegate:"main-layout.extend-view.toggle"},t.TOGGLE_BOTTOM_PANEL_COMMAND={id:"main-layout.bottom-panel.toggle",delegate:"main-layout.panel.toggle"},t.IS_VISIBLE_BOTTOM_PANEL_COMMAND={id:"main-layout.bottom-panel.is-visible",delegate:"main-layout.panel.is-visible"},t.IS_VISIBLE_LEFT_PANEL_COMMAND={id:"main-layout.left-panel.is-visible",delegate:"main-layout.view.is-visible"},t.IS_VISIBLE_RIGHT_PANEL_COMMAND={id:"main-layout.right-panel.is-visible",delegate:"main-layout.extend-view.is-visible"},t.EXPAND_BOTTOM_PANEL={id:"main-layout.bottom-panel.expand",delegate:"main-layout.panel.expand"},t.RETRACT_BOTTOM_PANEL={id:"main-layout.bottom-panel.retract",delegate:"main-layout.panel.retract"},t.WORKBENCH_ACTION_CLOSESIDECAR={id:"workbench.action.closeSidebar",label:"%main-layout.sidebar.hide%"},t.WORKBENCH_ACTION_CLOSEPANEL={id:"workbench.action.closePanel"},t.TOGGLE_VIEW_COMMAND={id:"main-layout.view.toggle",label:"%main-layout.view.toggle%"},t.TOGGLE_EXTEND_VIEW_COMMAND={id:"main-layout.extend-view.toggle",label:"%main-layout.extend-view.toggle%"},t.TOGGLE_PANEL_COMMAND={id:"main-layout.panel.toggle",iconClass:(0,n.getIcon)("minus"),label:"%main-layout.panel.toggle%"},t.IS_VISIBLE_VIEW_COMMAND={id:"main-layout.view.is-visible"},t.IS_VISIBLE_EXTEND_VIEW_COMMAND={id:"main-layout.extend-view.is-visible"},t.IS_VISIBLE_PANEL_COMMAND={id:"main-layout.panel.is-visible"},t.EXPAND_PANEL_COMMAND={id:"main-layout.panel.expand",label:"%layout.tabbar.expand%",iconClass:(0,n.getIcon)("expand")},t.RETRACT_PANEL_COMMAND={id:"main-layout.panel.retract",label:"%layout.tabbar.retract%",iconClass:(0,n.getIcon)("shrink")}},25072:(x,t,e)=>{"use strict";var n;n={value:!0},t.s=void 0;const r=e(41869),o=e(17793);t.s={[r.SlotLocation.top]:{modules:["@opensumi/ide-menu-bar"]},[r.SlotLocation.action]:{modules:["@opensumi/ide-toolbar-action"]},[r.SlotLocation.view]:{modules:[o.DROP_VIEW_CONTAINER,"@opensumi/ide-explorer","@opensumi/ide-search","@opensumi/ide-scm","@opensumi/ide-debug","@opensumi/ide-extension-manager","@opensumi/ide-notebook"]},[r.SlotLocation.extendView]:{modules:[o.DROP_EXTEND_VIEW_CONTAINER]},[r.SlotLocation.main]:{modules:["@opensumi/ide-editor"]},[r.SlotLocation.panel]:{modules:[o.DROP_PANEL_CONTAINER,"@opensumi/ide-terminal-next","@opensumi/ide-output","debug-console","@opensumi/ide-markers"]},[r.SlotLocation.statusBar]:{modules:["@opensumi/ide-status-bar"]},[r.SlotLocation.extra]:{modules:["breadcrumb-menu"]}}},45395:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelDropArea=t.ExtendViewDropArea=t.ViewDropArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(17793),_=n.__importDefault(e(36623)),v=g=>{const{location:a}=g,h=(0,o.useInjectable)(l.IMainLayoutService),u=r.default.useCallback(c=>{var E;const f=(E=c.dataTransfer)===null||E===void 0?void 0:E.getData("containerId");h.moveContainerTo(f,a),h.hideDropArea()},[h,a]);return r.default.createElement("div",{className:_.default.drop_area,onDrop:u,onDragOver:c=>{c.preventDefault()}},(0,o.localize)("main-layout.drop-area.tip"))},m=()=>r.default.createElement(v,{location:o.SlotLocation.view});t.ViewDropArea=m;const p=()=>r.default.createElement(v,{location:o.SlotLocation.extendView});t.ExtendViewDropArea=p;const s=()=>r.default.createElement(v,{location:o.SlotLocation.panel});t.PanelDropArea=s},7480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainLayoutModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(17793),_=e(9522),v=e(22537),m=e(53576),p=e(752),s=e(58296);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.MainLayoutModuleContribution,{token:l.IMainLayoutService,useClass:v.LayoutService},{token:l.IViewsRegistry,useClass:s.ViewsRegistry},{token:p.TabbarServiceFactory,useFactory:p.TabbarServiceFactoryFn},{token:_.AccordionServiceFactory,useFactory:h=>(u,c)=>h.get(l.IMainLayoutService).getAccordionService(u,c)}],this.contributionProvider=l.MainLayoutContribution}};t.MainLayoutModule=g,t.MainLayoutModule=g=n.__decorate([(0,r.Injectable)()],g)},5567:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoFocusedInput=void 0;const r=e(85608).__importStar(e(14041)),o=e(97267),l=e(48560),_=e(17793),v=({containerId:m,...p})=>{const s=(0,l.useInjectable)(_.IMainLayoutService),g=(0,r.useRef)(null),a=r.default.useCallback(()=>{g&&g.current&&queueMicrotask(()=>{var h;return(h=g.current)===null||h===void 0?void 0:h.focus()})},[g.current]);return(0,r.useEffect)(()=>{a();const h=s.getTabbarHandler(m),u=h?.onActivate(a);return()=>{u?.dispose()}},[s]),r.default.createElement(o.Input,{ref:g,...p})};t.AutoFocusedInput=v},22537:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutService=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),_=e(81878),v=e(95416),m=e(93899),p=e(43718),s=e(28423),g=e(52416),a=e(17793),h=e(9522),u=e(752),c=e(58999),E={[l.SlotLocation.view]:{currentId:void 0,size:void 0},[l.SlotLocation.extendView]:{currentId:"",size:void 0},[l.SlotLocation.panel]:{currentId:void 0,size:void 0},containerLocations:{}};let f=class extends l.WithEventBus{constructor(){super(...arguments),this.handleMap=new Map,this.tabbarServices=new Map,this.accordionServices=new Map,this.pendingViewsMap=new Map,this.viewToContainerMap=new Map,this.disposableMap=new Map,this.state={},this.isRestoring=new Set,this.customViews=new Map,this.debug=(0,p.getDebugLogger)(),this.viewReady=new p.Deferred,this.restoreTabbarService=async y=>{this.state=(0,_.fixLayout)(this.layoutState.getState(v.LAYOUT_STATE.MAIN,E));const{currentId:b,size:A}=this.state[y.location]||{};if(y.prevSize=A,this.state.containerLocations){for(const[D,I]of Object.entries(this.state.containerLocations))if(I===y.location&&!this.isDropContainer(D)){const w=this.findTabbarServiceByContainerId(D);w&&w.location!==y.location?this.moveContainerTo(D,y.location):(delete this.state.containerLocations[D],this.layoutState.setState(v.LAYOUT_STATE.MAIN,this.state))}}const S=this.getDefaultContainer(y);this.restoreContainerId(y,b,S)},this.holdTabbarComponent=new Map,this.tabbarUpdateSet=new Set}didMount(){for(const[b,A]of this.pendingViewsMap.entries())A.forEach(({view:S,props:D})=>{this.collectViewComponent(S,b,D)});for(const b of this.contributions.getContributions())b.onDidRender&&b.onDidRender();const y=[];this.tabbarServices.forEach(b=>{l.slotRendererRegistry.isTabbar(b.location)&&b.containersMap.size>0&&y.push(b.viewReady.promise)}),Promise.all(y).then(()=>{this.viewReady.resolve()})}storeState(y,b){this.isRestoring.has(y.location)||(this.state[y.location]={currentId:b,size:y.prevSize},this.layoutState.setState(v.LAYOUT_STATE.MAIN,this.state))}onThemeChange(y){var b,A,S,D,I;const w=y.payload.theme;localStorage.setItem("theme",JSON.stringify({menuBarBackground:(b=w.getColor("kt.menubar.background"))===null||b===void 0?void 0:b.toString(),sideBarBackground:(A=w.getColor("sideBar.background"))===null||A===void 0?void 0:A.toString(),editorBackground:(S=w.getColor("editor.background"))===null||S===void 0?void 0:S.toString(),panelBackground:(D=w.getColor("panel.background"))===null||D===void 0?void 0:D.toString(),statusBarBackground:(I=w.getColor("statusBar.background"))===null||I===void 0?void 0:I.toString()}))}getDefaultContainer(y){var b,A,S,D;const I=this.appConfig.defaultPanels,w=I&&I[y.location];if(I&&w!==void 0){if(!w)return"";if(y.containersMap.has(w))return w;const T=this.componentRegistry.getComponentRegistryInfo(w);if(T&&((A=(b=this.appConfig.layoutConfig[y.location])===null||b===void 0?void 0:b.modules)===null||A===void 0?void 0:A.includes(w)))return T.options.containerId;this.logger.warn(`[defaultPanels] No \`${w}\` view found!`)}return(D=(S=y.visibleContainers[0])===null||S===void 0?void 0:S.options)===null||D===void 0?void 0:D.containerId}restoreContainerId(y,b,A){if((0,p.isUndefined)(b)){(0,p.isUndefined)(A)?y.updateNextContainerId():y.updateCurrentContainerId(A);return}if(b&&!this.isDropContainer(b)){if(y.containersMap.has(b)){y.updateCurrentContainerId(b);return}y.updateCurrentContainerId(A||""),y.updateNextContainerId(b);return}(b===""||this.isDropContainer(b))&&y.updateCurrentContainerId("")}findTabbarServiceByContainerId(y){let b;for(const A of this.tabbarServices.values())if(A.containersMap.has(y)){b=A;break}return b}moveContainerTo(y,b){var A;const S=this.findTabbarServiceByContainerId(y);if(!S){this.logger.error(`cannot find container: ${y}`);return}const D=S.getContainer(y);if(!D){this.logger.error(`cannot find container: ${y}`);return}if(((A=D.options)===null||A===void 0?void 0:A.draggable)===!1){this.logger.warn(`container: ${y} is not draggable`);return}const I=this.getTabbarService(b);S.removeContainer(y),(!S.visibleContainers.length||S.currentContainerId.get()===y)&&this.toggleSlot(S.location,!1),I.dynamicAddContainer(y,D);const w=this.injector.get(c.TabBarHandler,[y,this.getTabbarService(I.location)]);this.handleMap.set(y,w),this.state.containerLocations||(this.state.containerLocations={}),this.state.containerLocations[y]=b}showDropAreaForContainer(y){const b=this.findTabbarServiceByContainerId(y),A=this.tabbarServices.get(l.SlotLocation.panel),S=this.tabbarServices.get(l.SlotLocation.extendView),D=this.tabbarServices.get(l.SlotLocation.view);if(!b){this.logger.error(`cannot find container: ${y}`);return}const I={[l.SlotLocation.extendView]:[A,D],[l.SlotLocation.panel]:[S,D],[l.SlotLocation.view]:[A,S]},w={[l.SlotLocation.panel]:a.DROP_PANEL_CONTAINER,[l.SlotLocation.extendView]:a.DROP_EXTEND_VIEW_CONTAINER,[l.SlotLocation.view]:a.DROP_VIEW_CONTAINER};(0,s.transaction)(T=>{var R;(R=I[b?.location])===null||R===void 0||R.forEach(P=>{P?.updateCurrentContainerId(w[P?.location],T)})})}hideDropArea(){const y=this.tabbarServices.get(l.SlotLocation.panel),b=this.tabbarServices.get(l.SlotLocation.extendView),A=this.tabbarServices.get(l.SlotLocation.view);(0,s.transaction)(S=>{y?.currentContainerId.get()===a.DROP_PANEL_CONTAINER&&y.updateCurrentContainerId(y.previousContainerId||"",S),b?.currentContainerId.get()===a.DROP_EXTEND_VIEW_CONTAINER&&b.updateCurrentContainerId(b.previousContainerId||"",S),A?.currentContainerId.get()===a.DROP_VIEW_CONTAINER&&A.updateCurrentContainerId(A.previousContainerId||"",S)})}isVisible(y){return!!this.getTabbarService(y).currentContainerId.get()}isViewVisible(y){const b=this.getTabbarHandler(y);if(!b||!b.isActivated())return!1;const A=b.accordionService.getViewState(y);return!A.collapsed&&!A.hidden}toggleSlot(y,b,A){var S;const D=this.getTabbarService(y);if(!D){this.debug.error(`Unable to switch panels because no TabbarService corresponding to \`${y}\` was found.`);return}b===!0?D.updateCurrentContainerId(this.findNonDropContainerId(D)):b===!1?D.updateCurrentContainerId(""):D.updateCurrentContainerId(D.currentContainerId.get()?"":this.findNonDropContainerId(D)),D.currentContainerId.get()&&A&&((S=D.resizeHandle)===null||S===void 0||S.setSize(A))}isDropContainer(y){return[a.DROP_PANEL_CONTAINER,a.DROP_EXTEND_VIEW_CONTAINER,a.DROP_VIEW_CONTAINER].includes(y)}findNonDropContainerId(y){const b=y.currentContainerId.get();if(b&&!this.isDropContainer(b))return b;if(y.previousContainerId&&!this.isDropContainer(y.previousContainerId))return y.previousContainerId;for(const A of y.containersMap.keys())if(!this.isDropContainer(A))return A;return""}getTabbarService(y){const b=this.tabbarServices.get(y)||this.injector.get(u.TabbarService,[y]);if(!this.tabbarServices.get(y)){b.addDispose(b.onCurrentChange(({currentId:S})=>{if(this.storeState(b,S),this.eventBus.fire(new l.ExtensionActivateEvent({topic:"onView",data:S})),S&&a.SUPPORT_ACCORDION_LOCATION.has(b.location)){const D=this.getAccordionService(S);D?.tryUpdateResize(),D?.expandedViews.forEach(I=>{this.eventBus.fire(new l.ExtensionActivateEvent({topic:"onView",data:I.id}))})}})),b.viewReady.promise.then(()=>(this.isRestoring.add(b.location),b.restoreState())).then(()=>this.restoreTabbarService(b)).then(()=>{this.isRestoring.delete(b.location)}).catch(S=>{this.isRestoring.delete(b.location),this.logger.error(`[TabbarService:${y}] restore state error`,S)});const A=(0,r.default)(()=>this.storeState(b,b.currentContainerId.get()),100);if(b.addDispose(b.onSizeChange(A)),y===l.SlotLocation.panel){const S=(0,r.default)(()=>void this.bottomExpanded,100);b.addDispose(b.onSizeChange(()=>S))}this.tabbarServices.set(y,b)}return b}getAllAccordionService(){return this.accordionServices}getAccordionService(y,b){let A=this.accordionServices.get(y);return A||(A=this.injector.get(h.AccordionService,[y,b]),this.accordionServices.set(y,A)),A}getTabbarHandler(y){let b=this.doGetTabbarHandler(y);if(!b){const A=this.viewToContainerMap.get(y);A?b=this.doGetTabbarHandler(A||""):this.debug.warn(`${y} view tabbar not found.`)}return b}getContainer(y){for(const b of this.tabbarServices.values()){const A=b.getContainer(y);if(A)return A}}getExtraTopMenu(){return this.contextmenuService.createMenu({id:m.MenuId.ActivityBarTopExtra})}getExtraMenu(){return this.contextmenuService.createMenu({id:m.MenuId.ActivityBarExtra})}doGetTabbarHandler(y){let b=this.handleMap.get(y);if(!b){let A;for(const S of this.tabbarServices.values())if(S.getContainer(y)){A=S.location;break}A&&(b=this.injector.get(c.TabBarHandler,[y,this.getTabbarService(A)]),this.handleMap.set(y,b))}return b}collectTabbarComponent(y,b,A,S){if(S&&this.debug.warn("collectTabbarComponent api warning: Please move react component into options.component!"),A=this.mapSideToLocation(A),b.hideIfEmpty&&!y.length&&!b.component){this.holdTabbarComponent.set(b.containerId,{views:y,options:b,side:A}),this.tabbarUpdateSet.has(b.containerId)&&this.tryUpdateTabbar(b.containerId);const I=this.getAccordionService(b.containerId);return I.addDispose(I.onBeforeAppendViewEvent(()=>{this.tryUpdateTabbar(b.containerId)})),I.addDispose(I.onAfterDisposeViewEvent(()=>{I.views.length===0&&(this.disposeContainer(b.containerId),this.holdTabbarComponent.set(b.containerId,{views:y,options:b,side:A}))})),b.containerId}return this.getTabbarService(A).registerContainer(b.containerId,{views:y,options:b}),y.forEach(I=>{this.viewToContainerMap.set(I.id,b.containerId)}),b.containerId}mapSideToLocation(y){switch(y){case"left":return l.SlotLocation.view;case"right":return l.SlotLocation.extendView;case"bottom":return l.SlotLocation.panel;default:return y}}getViewAccordionService(y){const b=this.viewToContainerMap.get(y);if(b)return this.getAccordionService(b)}collectViewComponent(y,b,A={},S){this.customViews.set(y.id,y),this.viewToContainerMap.set(y.id,b);const D=this.getAccordionService(b);return A&&(y.initialProps=A),D.appendView(y,S?.isReplace),D.views.length===1&&(this.tabbarUpdateSet.add(b),this.tryUpdateTabbar(b)),S?.fromExtension&&this.disposableMap.set(y.id,this.commandRegistry.registerCommand({id:`${y.id}.focus`},{execute:async()=>(await this.ensureViewReady(y.id),this.commandService.executeCommand(`workbench.view.extension.${b}`,{forceShow:!0}))})),b}ensureViewReady(y){const b=this.viewToContainerMap.get(y),A=new p.Deferred,S=this.getAccordionService(b);return S.visibleViews.get().find(D=>D.id===y)?A.resolve():S.addDispose(S.onAfterAppendViewEvent(D=>{D===y&&A.resolve()})),A.promise}tryUpdateTabbar(y){const b=this.holdTabbarComponent.get(y);b&&(this.getTabbarService(b.side).registerContainer(y,{views:b.views,options:b.options}),this.tabbarUpdateSet.delete(y),this.holdTabbarComponent.delete(y))}replaceViewComponent(y,b){const A=this.viewToContainerMap.get(y.id);if(!A){this.debug.warn(`The container corresponding to \`${y.id}\` was not found, please check the incoming parameters!`);return}const S=this.customViews.get(y.id);S&&(y=Object.assign(S,y)),this.collectViewComponent(y,A,b,{isReplace:!0})}disposeViewComponent(y){const b=this.disposableMap.get(y);b&&b.dispose();const A=this.viewToContainerMap.get(y);if(!A){this.debug.warn(`The container corresponding to \`${y}\` was not found, please check the incoming parameters!`);return}this.getAccordionService(A).disposeView(y)}revealView(y){const b=this.viewToContainerMap.get(y);if(!b){this.debug.warn(`The container corresponding to \`${y}\` was not found, please check the incoming parameters!`);return}this.getAccordionService(b).revealView(y)}disposeContainer(y){let b;for(const A of this.tabbarServices.values())if(A.getContainer(y)){b=A.location;break}b?this.getTabbarService(b).disposeContainer(y):this.debug.warn(`The Tabbar to the \`${y}\` was not found.`)}expandBottom(y){const b=this.getTabbarService(l.SlotLocation.panel);b.currentContainerId.get()||b.updateCurrentContainerId(b.currentContainerId.get()||b.previousContainerId||b.containersMap.keys().next().value),b.doExpand(y),this.contextKeyService.createKey("bottomFullExpanded",b.isExpanded)}get bottomExpanded(){const y=this.getTabbarService(l.SlotLocation.panel);return this.contextKeyService.createKey("bottomFullExpanded",y.isExpanded),y.isExpanded}};t.LayoutService=f,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(a.MainLayoutContribution),n.__metadata("design:type",Object)],f.prototype,"contributions",void 0),n.__decorate([(0,o.Autowired)(m.IMenuRegistry),n.__metadata("design:type",m.IMenuRegistry)],f.prototype,"menus",void 0),n.__decorate([(0,o.Autowired)(l.CommandRegistry),n.__metadata("design:type",Object)],f.prototype,"commandRegistry",void 0),n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",v.LayoutState)],f.prototype,"layoutState",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,o.Autowired)(l.ComponentRegistry),n.__metadata("design:type",Object)],f.prototype,"componentRegistry",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(m.AbstractMenuService),n.__metadata("design:type",m.AbstractMenuService)],f.prototype,"menuService",void 0),n.__decorate([(0,o.Autowired)(m.AbstractContextMenuService),n.__metadata("design:type",m.AbstractContextMenuService)],f.prototype,"contextmenuService",void 0),n.__decorate([(0,l.OnEvent)(g.ThemeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[g.ThemeChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onThemeChange",null),t.LayoutService=f=n.__decorate([(0,o.Injectable)()],f)},53576:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainLayoutModuleContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144),_=e(68456),v=e(95416),m=e(93899),p=e(43718),s=e(92323),g=e(17793),a=e(75053),h=e(45395),u=e(68988),c=e(19951);let E=class extends p.WithEventBus{async initialize(){await this.layoutState.initStorage();const d=this.contributionProvider.getContributions();for(const A of d)A.registerComponent&&A.registerComponent(this.componentRegistry);const y=this.rendererContributionProvider.getContributions();for(const A of y)A.registerRenderer&&A.registerRenderer(o.slotRendererRegistry);const b=this.toolBarContributionProvider.getContributions();for(const A of b)A.registerToolbarItems&&A.registerToolbarItems(this.toolBarRegistry)}registerComponent(d){d.register(g.DROP_EXTEND_VIEW_CONTAINER,[],{component:h.ExtendViewDropArea,hideTab:!0,containerId:g.DROP_EXTEND_VIEW_CONTAINER}),d.register(g.DROP_PANEL_CONTAINER,[],{component:h.PanelDropArea,hideTab:!0,containerId:g.DROP_PANEL_CONTAINER}),d.register(g.DROP_VIEW_CONTAINER,[],{component:h.ViewDropArea,hideTab:!0,containerId:g.DROP_VIEW_CONTAINER})}async onStart(){this.registerSideToggleKey()}async onDidStart(){this.mainLayoutService.didMount()}registerRenderer(d){d.registerSlotRenderer(o.SlotLocation.extendView,c.RightTabRenderer,{isLatter:!0,supportedActions:{accordion:!0}}),d.registerSlotRenderer(o.SlotLocation.view,c.LeftTabRenderer,{supportedActions:{accordion:!0}}),d.registerSlotRenderer(o.SlotLocation.panel,c.BottomTabRenderer,{isLatter:!0,supportedActions:{expand:!0,toggle:!0}})}registerCommands(d){d.registerCommand(a.TOGGLE_VIEW_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.view,y,b)}}),d.registerCommand(a.TOGGLE_EXTEND_VIEW_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.extendView,y,b)}}),d.registerCommand(a.TOGGLE_PANEL_COMMAND,{execute:(y,b)=>{this.mainLayoutService.toggleSlot(o.SlotLocation.panel,y,b)}}),d.registerCommand(a.IS_VISIBLE_VIEW_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.view)}),d.registerCommand(a.IS_VISIBLE_EXTEND_VIEW_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.extendView)}),d.registerCommand(a.IS_VISIBLE_PANEL_COMMAND,{execute:()=>this.mainLayoutService.isVisible(o.SlotLocation.panel)}),d.registerCommand(a.TOGGLE_LEFT_PANEL_COMMAND),d.registerCommand(a.TOGGLE_RIGHT_PANEL_COMMAND),d.registerCommand(a.TOGGLE_BOTTOM_PANEL_COMMAND),d.registerCommand(a.EXPAND_BOTTOM_PANEL),d.registerCommand(a.RETRACT_BOTTOM_PANEL),d.registerCommand(a.IS_VISIBLE_LEFT_PANEL_COMMAND),d.registerCommand(a.IS_VISIBLE_RIGHT_PANEL_COMMAND),d.registerCommand(a.IS_VISIBLE_BOTTOM_PANEL_COMMAND),d.registerCommand(a.WORKBENCH_ACTION_CLOSESIDECAR,{execute:()=>Promise.all([this.mainLayoutService.toggleSlot(o.SlotLocation.view,!1),this.mainLayoutService.toggleSlot(o.SlotLocation.extendView,!1)])}),d.registerCommand(a.WORKBENCH_ACTION_CLOSEPANEL,{execute:()=>{this.mainLayoutService.toggleSlot(o.SlotLocation.panel,!1)}}),d.registerCommand({id:"view.outward.right-panel.hide"},{execute:()=>{this.commandService.executeCommand("main-layout.right-panel.toggle",!1)}}),d.registerCommand({id:"view.outward.right-panel.show"},{execute:y=>{this.commandService.executeCommand("main-layout.right-panel.toggle",!0,y)}}),d.registerCommand({id:"view.outward.left-panel.hide"},{execute:()=>{this.commandService.executeCommand("main-layout.left-panel.toggle",!1)}}),d.registerCommand({id:"view.outward.left-panel.show"},{execute:y=>{this.commandService.executeCommand("main-layout.left-panel.toggle",!0,y)}}),d.registerCommand({id:o.LAYOUT_COMMANDS.MAXIMIZE_EDITOR.id},{execute:()=>{this.commandService.executeCommand(a.TOGGLE_RIGHT_PANEL_COMMAND.id,!1),this.commandService.executeCommand(a.TOGGLE_LEFT_PANEL_COMMAND.id,!1)}}),d.registerCommand(o.LAYOUT_COMMANDS.OPEN_VIEW,{execute:()=>{this.commandService.executeCommand(o.QUICK_OPEN_COMMANDS.OPEN_VIEW.id)}})}registerMenus(d){d.registerMenuItem(m.MenuId.ActivityBarExtra,{submenu:m.MenuId.SettingsIconMenu,iconClass:(0,o.getIcon)("setting"),label:(0,p.localize)("layout.tabbar.setting"),order:1,group:"navigation"}),Object.entries({[o.SlotLocation.view]:[l.EXPLORER_CONTAINER_ID,l.SEARCH_CONTAINER_ID,l.SCM_CONTAINER_ID,l.DEBUG_CONTAINER_ID,l.EXTENSION_CONTAINER_ID],[o.SlotLocation.panel]:[l.MARKER_CONTAINER_ID,l.OUTPUT_CONTAINER_ID,l.DEBUG_CONSOLE_CONTAINER_ID,l.TERMINAL_CONTAINER_ID]}).forEach(([y,b],A)=>{const S=this.mainLayoutService.getTabbarService(y);S.viewReady.promise.then(()=>{b.forEach(D=>{var I,w;const T=S.getContainer(D);T&&d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:{id:`container.toggle.${D}`,label:(w=(I=T.options)===null||I===void 0?void 0:I.title)!==null&&w!==void 0?w:D},group:`${3+A}_${y}`})})})}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_VIEW_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_EXTEND_VIEW_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.TOGGLE_PANEL_COMMAND,group:"5_panel"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.EXPAND_PANEL_COMMAND,group:"5_panel",when:"!bottomFullExpanded"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:a.RETRACT_PANEL_COMMAND,group:"5_panel",when:"bottomFullExpanded"}),d.registerMenuItem(m.MenuId.MenubarViewMenu,{command:{id:o.EDITOR_COMMANDS.TOGGLE_WORD_WRAP.id,label:"%preference.editor.wordWrap%"},group:"6_capability",toggledWhen:"config.editor.wordWrap == on"})}registerSideToggleKey(){this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+b",command:a.TOGGLE_VIEW_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+alt+b",command:a.TOGGLE_EXTEND_VIEW_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+j",command:a.TOGGLE_PANEL_COMMAND.id}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+shift+j",command:a.EXPAND_PANEL_COMMAND.id,when:"!bottomFullExpanded"}),this.keybindingRegistry.registerKeybinding({keybinding:"ctrlcmd+shift+j",command:a.RETRACT_PANEL_COMMAND.id,when:"bottomFullExpanded"})}registerQuickOpenHandlers(d){d.registerHandler(this.quickOpenViewHandler,{title:(0,p.localize)("layout.action.openView"),commandId:o.LAYOUT_COMMANDS.QUICK_OPEN_VIEW.id,order:5,hideTab:!0})}};t.MainLayoutModuleContribution=E,n.__decorate([(0,r.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],E.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.ComponentContribution),n.__metadata("design:type",Object)],E.prototype,"contributionProvider",void 0),n.__decorate([(0,r.Autowired)(o.SlotRendererContribution),n.__metadata("design:type",Object)],E.prototype,"rendererContributionProvider",void 0),n.__decorate([(0,r.Autowired)(_.ComponentRegistry),n.__metadata("design:type",Object)],E.prototype,"componentRegistry",void 0),n.__decorate([(0,r.Autowired)(s.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.LayoutState)],E.prototype,"layoutState",void 0),n.__decorate([(0,r.Autowired)(_.TabBarToolbarContribution),n.__metadata("design:type",Object)],E.prototype,"toolBarContributionProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.ToolbarRegistry)],E.prototype,"toolBarRegistry",void 0),n.__decorate([(0,r.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],E.prototype,"keybindingRegistry",void 0),n.__decorate([(0,r.Autowired)(u.ViewQuickOpenHandler),n.__metadata("design:type",u.ViewQuickOpenHandler)],E.prototype,"quickOpenViewHandler",void 0),t.MainLayoutModuleContribution=E=n.__decorate([(0,p.Domain)(s.CommandContribution,o.ClientAppContribution,o.SlotRendererContribution,m.MenuContribution,o.QuickOpenContribution,_.ComponentContribution)],E)},68988:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewQuickOpenItem=t.ContainerQuickOpenItem=t.ViewQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(74404),_=e(17793);let v=class{constructor(){this.prefix="view ",this.description=(0,o.localize)("layout.action.openView")}getModel(){return{onType:(g,a)=>a(this.getViewQuickOpenItems())}}getViewQuickOpenItems(){var g;const a=this.layoutService.getAllAccordionService(),h=Array.from(a.keys());let u=[];u=u.concat(h.map((c,E)=>this.injector.get(m,[c,{groupLabel:E===0?(0,o.localize)("layout.openView.containerTitle"):"",showBorder:!1}])));for(const c of h){const E=(g=a.get(c))===null||g===void 0?void 0:g.views;if(E)for(let f=0,d=E.length;f<d;f++)u.push(this.injector.get(p,[c,E[f],{groupLabel:f===0?(0,o.formatLocalize)("layout.openView.viewTitle",String(c).toUpperCase()):"",showBorder:!1}]))}return u}getOptions(){return{}}onClose(){}};t.ViewQuickOpenHandler=v,n.__decorate([(0,r.Autowired)(l.PrefixQuickOpenService),n.__metadata("design:type",Object)],v.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],v.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],v.prototype,"injector",void 0),t.ViewQuickOpenHandler=v=n.__decorate([(0,r.Injectable)()],v);let m=class extends l.QuickOpenItem{constructor(g,a){super(a),this.containerId=g,this.options=a}getLabel(){return String(this.containerId).toLocaleUpperCase()}isHidden(){return super.isHidden()}run(g){if(g!==l.Mode.OPEN)return!1;const a=this.layoutService.getTabbarHandler(this.containerId);return a?.activate(),!0}};t.ContainerQuickOpenItem=m,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],m.prototype,"layoutService",void 0),t.ContainerQuickOpenItem=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],m);let p=class extends l.QuickOpenItem{constructor(g,a,h){super(h),this.containerId=g,this.view=a,this.options=h}getLabel(){var g;return(g=this.view.name)===null||g===void 0?void 0:g.toUpperCase()}isHidden(){return super.isHidden()}run(g){if(g!==l.Mode.OPEN)return!1;const a=this.layoutService.getTabbarHandler(this.containerId);return a&&(a.activate(),a.isCollapsed(this.view.id)&&a?.setCollapsed(this.view.id,!1)),!0}};t.ViewQuickOpenItem=p,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],p.prototype,"layoutService",void 0),t.ViewQuickOpenItem=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Object,Object])],p)},58999:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabBarHandler=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(17793),_=e(752);let v=class{constructor(p,s){this.containerId=p,this.tabbarService=s,this.onActivateEmitter=new o.Emitter,this.onActivate=this.onActivateEmitter.event,this.onInActivateEmitter=new o.Emitter,this.onInActivate=this.onInActivateEmitter.event,this.onCollapseEmitter=new o.Emitter,this.onCollapse=this.onCollapseEmitter.event,this.isVisible=!1,this.accordionService=this.layoutService.getAccordionService(this.containerId),s.currentContainerId.get()===this.containerId&&(this.onActivateEmitter.fire(),this.isVisible=!0),this.tabbarService.onCurrentChange(g=>{g.currentId===this.containerId?(this.onActivateEmitter.fire(),this.isVisible=!0):g.previousId===this.containerId&&(this.onInActivateEmitter.fire(),this.isVisible=!1)})}dispose(){this.tabbarService.containersMap.delete(this.containerId),this.tabbarService.disposeContainer(this.containerId)}disposeView(p){this.layoutService.disposeViewComponent(p)}activate(){this.tabbarService.updateCurrentContainerId(this.containerId)}deactivate(){this.tabbarService.updateCurrentContainerId("")}isActivated(){return this.tabbarService.currentContainerId.get()===this.containerId}show(){this.tabbarService.showContainer(this.containerId)}hide(){this.tabbarService.hideContainer(this.containerId)}setTitleComponent(p,s){const g=this.tabbarService.getContainer(this.containerId);g&&g.options&&(g.options.titleProps=s,g.options.titleComponent=p,g.fireChange(g))}setSize(p){this.layoutService.toggleSlot(this.tabbarService.location,!0,p+this.tabbarService.getBarSize())}setBadge(p){this.tabbarService.updateBadge(this.containerId,p)}getBadge(){return this.tabbarService.getContainer(this.containerId).options.badge}setIconClass(p){this.tabbarService.getContainer(this.containerId).options.iconClass=p}isCollapsed(p){return this.accordionService.getViewState(p).collapsed}setCollapsed(p,s){this.accordionService.toggleOpen(p,s)}toggleViews(p,s){for(const g of p){const a=this.accordionService.getViewState(g);this.accordionService.updateViewState(g,{...a,hidden:!s})}}updateViewTitle(p,s){this.accordionService.updateViewTitle(p,s)}updateViewDescription(p,s){this.accordionService.updateViewDesciption(p,s)}updateViewMessage(p,s){this.accordionService.updateViewMessage(p,s)}updateTitle(p){this.tabbarService.updateTitle(this.containerId,p)}setResizeLock(p){this.tabbarService.resizeHandle.lockSize(p)}};t.TabBarHandler=v,n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],v.prototype,"layoutService",void 0),t.TabBarHandler=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,_.TabbarService])],v)},46245:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatTabbarRenderer2=t.BottomTabbarRenderer=t.LeftTabbarRenderer=t.RightTabbarRenderer=t.TextElipses=t.IconElipses=t.TextTabView=t.IconTabView=t.TabbarViewBase=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25918),m=e(25719),p=e(63373),s=e(68969),g=e(17793),a=e(19951),h=n.__importDefault(e(5330)),u=e(752);function c(T,R){return R>=T.length?[T,[]]:R<=1?[[],T]:[T.slice(0,R-1),T.slice(R-1)]}function E(T){return typeof T=="string"?parseInt(T,10)>99?"99+":T:typeof T=="object"&&T.value?T.value>99?"99+":T.value:""}const f=T=>{var R;const{TabView:P,MoreTabView:O,forbidCollapse:M,barSize:k=48,panelBorderSize:F=0,tabClassName:L,className:B,margin:U,tabSize:W,canHideTabbar:j,renderOtherVisibleContainers:Q=()=>null,disableAutoAdjust:G}=T,{side:Z,direction:$,fullSize:V}=(0,o.useContext)(a.TabbarConfig),H=(0,_.useInjectable)(u.TabbarServiceFactory)(Z),K=(0,_.useDesignStyles)(h.default.tab_bar,"tab_bar"),Y=(0,_.useDesignStyles)(h.default.bar_content,"bar_content"),X=(0,o.useMemo)(()=>G?Number.MAX_SAFE_INTEGER:Math.floor(V-(U||0)/W),[G,V,U,W]),[oe,ie]=(0,o.useState)(c(H.visibleContainers.filter(fe=>{var Ie;return!(!((Ie=fe.options)===null||Ie===void 0)&&Ie.hideTab)}),X));(0,o.useEffect)(()=>{H.updateBarSize(k+F)},[]),(0,o.useEffect)(()=>{const fe=()=>{ie(c(H.visibleContainers.filter(Me=>{var Be;return!(!((Be=Me.options)===null||Be===void 0)&&Be.hideTab)}),X))};fe();const Ie=_.Event.any(H.onDidRegisterContainer,H.onStateChange)(fe);return()=>{Ie.dispose()}},[X]);const he=(0,_.useAutorun)(H.currentContainerId),me=(0,_.usePreference)("workbench.hideSlotTabBarWhenHidePanel",!1),q=j&&me;q&&!he&&((R=H.resizeHandle)===null||R===void 0||R.setSize(0));const[Ee,ue]=oe;ue.forEach(fe=>{H.updateTabInMoreKey(fe.options.containerId,!0)});const te=(0,o.useCallback)((fe,Ie,Me,Be)=>{var Pe;const we=(Pe=fe.options)===null||Pe===void 0?void 0:Pe.containerId;if(!we)return null;Ie.updateTabInMoreKey(we,!1);let _e;return o.default.createElement("li",{draggable:!0,onDragStart:Ne=>{if(_e){const Te=_e.cloneNode(!0);Te.classList.add(h.default.dragging),L&&(0,_.addClassName)(Te,L),document.body.appendChild(Te),Ne.persist(),requestAnimationFrame(()=>{Ne.dataTransfer.setDragImage(Te,0,0),document.body.removeChild(Te)})}Ie.handleDragStart(Ne,we)},onDragOver:Ne=>{Ne.preventDefault(),_e&&_e.classList.add("on-drag-over")},onDragLeave:()=>{_e&&_e.classList.remove("on-drag-over")},onDrop:Ne=>{_e&&_e.classList.remove("on-drag-over"),Ie.handleDrop(Ne,we)},onDragEnd:Ne=>{Ie.handleDragEnd(Ne)},key:we,id:we,onContextMenu:Ne=>Ie.handleContextMenu(Ne,we),onClick:Ne=>Ie.handleTabClick(Ne,q||M),ref:Ne=>_e=Ne,className:(0,r.default)({active:Me===we},L)},o.default.createElement(P,{component:fe}))},[]);return o.default.createElement("div",{className:(0,r.default)([K,B])},o.default.createElement("div",{className:Y,style:{flexDirection:m.Layout.getTabbarDirection($)}},Ee.map(fe=>te(fe,H,he,Z)),Q({props:T,renderContainers:te}),ue.length?o.default.createElement("li",{key:"tab-more",onClick:fe=>{var Ie;return H.showMoreMenu(fe,Ee[Ee.length-1]&&((Ie=Ee[Ee.length-1].options)===null||Ie===void 0?void 0:Ie.containerId))},className:L},o.default.createElement(O,null)):null))};t.TabbarViewBase=f;const d=({component:T})=>{var R,P,O;const M=(0,_.useInjectable)(s.IProgressService),k=(0,_.useInjectable)(_.KeybindingRegistry),F=(0,_.useDesignStyles)(h.default.icon_tab,"icon_tab"),[L,B]=(0,o.useState)(T),U=M.getIndicator(((R=L.options)===null||R===void 0?void 0:R.containerId)||""),W=U?(0,_.useAutorun)(U.progressModel.show):!1,j=(0,o.useMemo)(()=>{const Q=L.options;return Q?.activateKeyBinding?`${Q?.title} (${k.acceleratorForKeyString(Q.activateKeyBinding,"+")})`:Q?.title},[L]);return(0,o.useEffect)(()=>{const Q=L.onChange(G=>{B({...G})});return()=>{Q.dispose()}},[L]),o.default.createElement("div",{className:F},o.default.createElement("div",{className:(0,r.default)((P=L.options)===null||P===void 0?void 0:P.iconClass,"activity-icon"),title:j}),W?o.default.createElement(l.Badge,{className:h.default.tab_badge},o.default.createElement("span",{className:h.default.icon_wrapper},o.default.createElement(l.Icon,{icon:"time-circle"}))):((O=L.options)===null||O===void 0?void 0:O.badge)&&o.default.createElement(l.Badge,{className:h.default.tab_badge},E(L.options.badge)))};t.IconTabView=d;const y=({component:T})=>{var R,P,O;const[M,k]=(0,o.useState)(T);return(0,o.useEffect)(()=>{const F=M.onChange(L=>{k({...L})});return()=>{F.dispose()}},[M]),o.default.createElement("div",{className:h.default.text_tab},o.default.createElement("div",{className:h.default.bottom_tab_title},(P=(R=M.options)===null||R===void 0?void 0:R.title)===null||P===void 0?void 0:P.toUpperCase()),((O=M.options)===null||O===void 0?void 0:O.badge)&&o.default.createElement(l.Badge,{className:h.default.tab_badge},E(M.options.badge)))};t.TextTabView=y;const b=()=>{const T=(0,_.useDesignStyles)(h.default.icon_tab,"icon_tab");return o.default.createElement("div",{className:T},o.default.createElement("div",{className:(0,r.default)((0,_.getIcon)("ellipsis"),"activity-icon"),title:"extra tabs"}))};t.IconElipses=b;const A=()=>o.default.createElement("div",{className:h.default.text_tab},o.default.createElement("div",{className:h.default.bottom_tab_title},o.default.createElement("i",{className:(0,_.getIcon)("doubleright")})));t.TextElipses=A;const S=T=>{const{barSize:R=48,style:P}=T,{side:O}=(0,o.useContext)(a.TabbarConfig),M=(0,_.useInjectable)(u.TabbarServiceFactory)(O),k=(0,_.useDesignStyles)(h.default.right_tab_bar,"right_tab_bar"),F=(0,_.useDesignStyles)(h.default.right_tab,"right_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.RIGHT_TABBAR,className:k,style:P,onContextMenu:M.handleContextMenu},o.default.createElement(t.TabbarViewBase,{tabSize:48,MoreTabView:t.IconElipses,tabClassName:F,TabView:t.IconTabView,barSize:R,panelBorderSize:1}))};t.RightTabbarRenderer=S;const D=({renderOtherVisibleContainers:T,isRenderExtraTopMenus:R=!0,renderExtraMenus:P,tabbarViewProps:O})=>{const{side:M}=(0,o.useContext)(a.TabbarConfig),k=(0,_.useInjectable)(g.IMainLayoutService),F=(0,_.useInjectable)(u.TabbarServiceFactory)(M),L=(0,o.useMemo)(()=>k.getExtraTopMenu(),[k]),B=(0,o.useMemo)(()=>k.getExtraMenu(),[k]),U=(0,_.useDesignStyles)(h.default.left_tab_bar,"left_tab_bar"),W=(0,_.useDesignStyles)(h.default.left_tab,"left_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.LEFT_TABBAR,className:U,onContextMenu:F.handleContextMenu},R&&o.default.createElement(v.InlineMenuBar,{className:(0,r.default)(h.default.vertical_icons,h.default.extra_top_menus),menus:L}),o.default.createElement(t.TabbarViewBase,{tabSize:48,MoreTabView:t.IconElipses,className:h.default.left_tab_content,tabClassName:W,TabView:t.IconTabView,barSize:48,margin:90,panelBorderSize:1,renderOtherVisibleContainers:T,...O}),P||o.default.createElement(v.InlineMenuBar,{className:h.default.vertical_icons,menus:B}))};t.LeftTabbarRenderer=D;const I=()=>{const{side:T}=(0,o.useContext)(a.TabbarConfig),R=(0,_.useInjectable)(u.TabbarServiceFactory)(T),P=(0,_.useDesignStyles)(h.default.bottom_bar_container,"bottom_bar_container"),O=(0,_.useDesignStyles)(h.default.bottom_tab,"bottom_tab");return o.default.createElement("div",{id:p.VIEW_CONTAINERS.BOTTOM_TABBAR,onContextMenu:R.handleContextMenu,className:(0,r.default)(P,"next_bottom_bar")},o.default.createElement(t.TabbarViewBase,{tabSize:80,MoreTabView:t.TextElipses,tabClassName:O,TabView:t.TextTabView,barSize:24,panelBorderSize:1,canHideTabbar:!0}))};t.BottomTabbarRenderer=I;const w=T=>{const{barSize:R=32,style:P}=T,{side:O}=(0,o.useContext)(a.TabbarConfig),M=(0,_.useInjectable)(u.TabbarServiceFactory)(O),k=(0,_.useDesignStyles)(h.default.ai_right_tab_bar,"ai_right_tab_bar"),F=(0,_.useDesignStyles)(h.default.ai_right_tab,"ai_right_tab");return o.default.createElement("div",{id:O,className:k,style:P,onContextMenu:M.handleContextMenu},o.default.createElement(t.TabbarViewBase,{tabSize:32,MoreTabView:t.IconElipses,tabClassName:F,TabView:t.IconTabView,barSize:R,panelBorderSize:1}))};t.ChatTabbarRenderer2=w},66368:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BottomTabPanelRenderer=t.LeftTabPanelRenderer=t.RightTabPanelRenderer=t.ContainerView=t.BaseTabPanelView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),_=e(41869),v=e(25918),m=e(1149),p=e(68969),s=e(68974),g=e(9522),a=e(70936),h=e(91527),u=e(19951),c=n.__importDefault(e(5330)),E=e(752),f=o.default.memo(({children:T})=>T,(T,R)=>!(T.visible||R.visible)),d={display:"block"},y={display:"none"},b=T=>{const{PanelView:R,panelSize:P,id:O,PanelViewProps:M}=T,{side:k}=o.default.useContext(u.TabbarConfig),F=(0,_.useInjectable)(_.AppConfig),L=F.panelSizes&&F.panelSizes[k],B=(0,_.useInjectable)(E.TabbarServiceFactory)(k),U=(0,_.useAutorun)(B.currentContainerId),W=(0,_.useDesignStyles)(c.default.tab_panel,"tab_panel"),j=(0,_.useDesignStyles)(c.default.tab_panel_hidden,"tab_panel_hidden");return o.default.useEffect(()=>{B.updatePanelSize(L||P||335)},[]),o.default.createElement("div",{id:O,className:(0,r.default)("kt-tab-panel",W,{[j]:!U})},B.visibleContainers.map(Q=>{var G;const Z=(G=Q.options)===null||G===void 0?void 0:G.containerId;if(!Z)return null;const $=B.getTitleToolbarMenu(Z);return o.default.createElement("div",{key:Z,className:(0,r.default)(c.default.panel_wrap,Z),"data-viewlet-id":Z,style:U===Z?d:y,id:O},o.default.createElement(_.ErrorBoundary,null,o.default.createElement(f,{visible:U===Z},o.default.createElement(R,{titleMenu:$,side:k,component:Q,...M}))))}))};t.BaseTabPanelView=b;const A=({component:T,titleMenu:R,side:P,renderContainerWrap:O,className:M,customTitleBar:k})=>{var F,L;const B=o.default.useRef(),U=o.default.useRef(null),W=(0,_.useInjectable)(_.AppConfig),{title:j,titleComponent:Q,component:G,containerId:Z,draggable:$}=T.options||{},V=(0,_.useInjectable)(l.INJECTOR_TOKEN),H=(0,_.useInjectable)(m.LayoutViewSizeConfig),K=(0,o.useCallback)(he=>{V.get(g.AccordionServiceFactory)(Z).handleContextMenu(he)},[Z]);if(!Z)return null;const X=(0,_.useInjectable)(p.IProgressService).getIndicator(Z);if(!X)return null;const oe=(0,_.useViewState)(P,U),ie=o.default.useCallback(he=>O?O({children:he}):he,[O]);return o.default.createElement("div",{ref:U,className:(0,r.default)(c.default.view_container,M)},!!k&&k,!G&&o.default.createElement("div",{onContextMenu:K,className:c.default.panel_titlebar},j?o.default.createElement(h.TitleBar,{containerId:Z,side:P,title:j,draggable:$,height:H.panelTitleBarHeight,menubar:o.default.createElement(v.InlineActionBar,{menus:R})}):null,Q&&o.default.createElement("div",{className:c.default.panel_component},o.default.createElement(_.ConfigProvider,{value:W},o.default.createElement(_.ComponentRenderer,{Component:Q,initialProps:(F=T.options)===null||F===void 0?void 0:F.titleProps})))),o.default.createElement("div",{className:c.default.container_wrap,ref:he=>B.current=he},o.default.createElement(s.ProgressBar,{progressModel:X.progressModel}),ie(G?o.default.createElement(_.ConfigProvider,{value:W},o.default.createElement(_.ComponentRenderer,{initialProps:{viewState:oe,...(L=T.options)===null||L===void 0?void 0:L.initialProps},Component:G})):o.default.createElement(a.AccordionContainer,{views:T.views,minSize:T.options.miniSize,containerId:T.options.containerId}))))};t.ContainerView=A;const S=({component:T,titleMenu:R,side:P})=>{var O,M,k,F;const L=o.default.useRef(),B=o.default.useRef(null),U=(0,_.useInjectable)(_.AppConfig),W=(0,_.useInjectable)(E.TabbarServiceFactory)(P),j=(0,_.useDesignStyles)(c.default.panel_title_bar,"panel_title_bar"),Q=(0,_.useDesignStyles)(c.default.panel_toolbar_container,"panel_toolbar_container"),G=(0,_.useViewState)(P,B),Z=(0,_.useInjectable)(m.LayoutViewSizeConfig),$=(0,_.useInjectable)(p.IProgressService),{component:V,containerId:H}=T.options||{},K=T.options&&T.options.titleComponent;if(!H)return null;const Y=$.getIndicator(H);return Y?o.default.createElement("div",{ref:B,className:c.default.panel_container},o.default.createElement("div",{className:j,style:{height:Z.panelTitleBarHeight}},o.default.createElement("h1",null,(M=(O=T.options)===null||O===void 0?void 0:O.title)===null||M===void 0?void 0:M.toUpperCase()),o.default.createElement("div",{className:c.default.title_component_container},K&&o.default.createElement(_.ComponentRenderer,{Component:K,initialProps:(k=T.options)===null||k===void 0?void 0:k.titleProps})),o.default.createElement("div",{className:Q},R&&o.default.createElement(v.InlineActionBar,{menus:R}),o.default.createElement(v.InlineMenuBar,{menus:W.commonTitleMenu,moreAtFirst:!0}))),o.default.createElement("div",{className:c.default.container_wrap,ref:X=>L.current=X},o.default.createElement(s.ProgressBar,{progressModel:Y.progressModel}),V?o.default.createElement(_.ConfigProvider,{value:U},o.default.createElement(_.ComponentRenderer,{initialProps:{viewState:G,...(F=T.options)===null||F===void 0?void 0:F.initialProps},Component:V})):o.default.createElement(a.AccordionContainer,{views:T.views,alignment:"horizontal",minSize:T.options.miniSize||200,containerId:T.options.containerId}))):null},D=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:t.ContainerView});t.RightTabPanelRenderer=D;const I=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:t.ContainerView});t.LeftTabPanelRenderer=I;const w=()=>o.default.createElement(t.BaseTabPanelView,{PanelView:S,panelSize:280});t.BottomTabPanelRenderer=w},19951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BottomTabRenderer=t.LeftTabRenderer=t.RightTabRenderer=t.TabRendererBase=t.TabbarConfig=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(25719),m=e(63373),p=e(46245),s=e(66368),g=n.__importDefault(e(5330)),a=e(752);t.TabbarConfig=(0,o.createContext)({side:l.SlotLocation.view,direction:"left-to-right",fullSize:0}),t.TabRendererBase=(0,o.memo)(({id:E,className:f,components:d,direction:y="left-to-right",TabbarView:b,side:A,TabpanelView:S})=>{const D=(0,l.useInjectable)(a.TabbarServiceFactory)(A),I=(0,l.useInjectable)(l.IEventBus),w=(0,o.useContext)(_.PanelContext),T=(0,o.useRef)(null),[R,P]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{D.registerResizeHandle(w),d.forEach(M=>{D.registerContainer(M.options.containerId,M)}),D.updatePanelVisibility(),D.ensureViewReady()},[d]);const O=(0,o.useCallback)(()=>{T.current&&P(T.current[v.Layout.getDomSizeProperty(y)])},[]);return(0,o.useEffect)(()=>{l.fastdom.measure(()=>{O()});let M;I.onDirective(l.ResizeEvent.createDirective(A),()=>{M&&M.dispose(),M=l.fastdom.measureAtNextFrame(()=>{O()})})},[]),o.default.createElement("div",{ref:T,id:E,className:(0,r.default)(g.default.tab_container,f),style:{flexDirection:v.Layout.getFlexDirection(y)}},o.default.createElement(t.TabbarConfig.Provider,{value:{side:A,direction:y,fullSize:R}},o.default.createElement(b,null),o.default.createElement(S,null)))});const h=({className:E,components:f,tabbarView:d,tabpanelView:y})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.extendView,direction:"right-to-left",id:m.VIEW_CONTAINERS.RIGHT_TABBAR_PANEL,className:(0,r.default)(E,"right-slot"),components:f,TabbarView:d??p.RightTabbarRenderer,TabpanelView:y??s.RightTabPanelRenderer});t.RightTabRenderer=h;const u=({className:E,components:f,tabbarView:d})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.view,direction:"left-to-right",id:m.VIEW_CONTAINERS.LEFT_TABBAR_PANEL,className:(0,r.default)(E,"left-slot"),components:f,TabbarView:d??p.LeftTabbarRenderer,TabpanelView:s.LeftTabPanelRenderer});t.LeftTabRenderer=u;const c=({className:E,components:f,tabbarView:d})=>o.default.createElement(t.TabRendererBase,{side:l.SlotLocation.panel,id:m.VIEW_CONTAINERS.BOTTOM_TABBAR_PANEL,direction:"bottom-to-top",className:(0,r.default)(E,"bottom-slot"),components:f,TabbarView:d??p.BottomTabbarRenderer,TabpanelView:s.BottomTabPanelRenderer});t.BottomTabRenderer=c},94813:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarBehaviorHandler=void 0;const n=e(41869),r=e(30144),o=e(75053);class l{constructor(v,m){this.location=v,this.config=m,this.accordionRestored=new Set}getIsLatter(){var v;return((v=this.config)===null||v===void 0?void 0:v.isLatter)!==void 0?this.config.isLatter:this.location==="extendView"||this.location==="panel"}wrapResizeHandle(v){const{setSize:m,setRelativeSize:p,getSize:s,getRelativeSize:g,lockSize:a,setMaxSize:h,hidePanel:u}=v,c=this.getIsLatter();return{setSize:E=>m(E,c),setRelativeSize:(E,f)=>p(E,f,c),getSize:()=>s(c),getRelativeSize:()=>g(c),setMaxSize:E=>h(E,c),lockSize:E=>a(E,c),hidePanel:E=>u(E)}}registerLocationSpecificCommands(v){const m=new n.DisposableCollection,{supportedActions:p}=this.config||{};return p?.expand&&(m.push(v.commandRegistry.registerCommand(o.EXPAND_PANEL_COMMAND,{execute:()=>{v.layoutService.expandBottom(!0)}})),m.push(v.commandRegistry.registerCommand(o.RETRACT_PANEL_COMMAND,{execute:()=>{v.layoutService.expandBottom(!1)}}))),p?.toggle&&m.push(v.commandRegistry.registerCommand(o.TOGGLE_PANEL_COMMAND,{execute:(s,g)=>{v.layoutService.toggleSlot(this.location,s,g)}})),m}registerLocationSpecificMenus(v){var m,p,s,g;const a=[];if(!((p=(m=this.config)===null||m===void 0?void 0:m.supportedActions)===null||p===void 0)&&p.expand&&a.push({command:o.EXPAND_PANEL_COMMAND.id,group:"navigation",when:"!bottomFullExpanded",order:1},{command:o.RETRACT_PANEL_COMMAND.id,group:"navigation",when:"bottomFullExpanded",order:1}),!((g=(s=this.config)===null||s===void 0?void 0:s.supportedActions)===null||g===void 0)&&g.toggle&&a.push({command:o.TOGGLE_PANEL_COMMAND.id,group:"navigation",order:2}),a.length>0)return v.menuRegistry.registerMenuItems(`tabbar/${this.location}/common`,a),v.ctxMenuService.createMenu({id:`tabbar/${this.location}/common`})}doExpand(v,m){var p,s;if(!(!((s=(p=this.config)===null||p===void 0?void 0:p.supportedActions)===null||s===void 0)&&s.expand)||!m)return;const{setRelativeSize:g}=m,a=this.getIsLatter();v?a?g(0,1):g(1,0):g(2,1)}isExpanded(v){var m,p;if(!(!((p=(m=this.config)===null||m===void 0?void 0:m.supportedActions)===null||p===void 0)&&p.expand)||!v)return!1;const{getRelativeSize:s}=v,g=s().join(",");return this.getIsLatter()?g==="0,1":g==="1,0"}handleActivateKeyBinding(v,m,p,s){var g,a;!((a=(g=this.config)===null||g===void 0?void 0:g.supportedActions)===null||a===void 0)&&a.toggle&&!s?p(m===v?"":v):p(v)}handleFullExpanded(v,m,p,s){var g,a;const{barSize:h,panelSize:u,prevSize:c}=s,{setRelativeSize:E,setSize:f}=p;v?m&&(!((a=(g=this.config)===null||g===void 0?void 0:g.supportedActions)===null||a===void 0)&&a.expand)?this.getIsLatter()?E(0,1):E(1,0):f(c||u+h):f(h)}tryRestoreAccordionSize(v,m){var p,s,g,a;if(!(!((s=(p=this.config)===null||p===void 0?void 0:p.supportedActions)===null||s===void 0)&&s.accordion))return;const{containerId:h}=v.options||{};if(!h||this.accordionRestored.has(h)||(!v||!((g=v.options)===null||g===void 0)&&g.component)&&((a=v?.options)===null||a===void 0?void 0:a.containerId)!==r.SCM_CONTAINER_ID)return;m.getAccordionService(h).restoreState(),this.accordionRestored.add(h)}}t.TabbarBehaviorHandler=l},752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarService=t.TabbarServiceFactoryFn=t.TabbarServiceFactory=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),_=e(95416),v=e(93899),m=e(68969),p=e(38578),s=e(28423),g=e(17793),a=e(94813);t.TabbarServiceFactory=Symbol("TabbarServiceFactory");const h=E=>f=>E.get(g.IMainLayoutService).getTabbarService(f);t.TabbarServiceFactoryFn=h;const u=void 0;let c=class extends l.WithEventBus{constructor(f){super(),this.location=f,this.doChangeViewEmitter=new l.Emitter,this.onStateChangeEmitter=new l.Emitter,this.onStateChange=this.onStateChangeEmitter.event,this.shouldChangeView=(0,s.observableFromEventOpts)({owner:this,equalsFn:()=>!1},this.doChangeViewEmitter.event,()=>{}),this.containerIdObs=(0,s.observableValue)(this,u),this.currentContainerId=(0,s.derivedOpts)({owner:this,equalsFn:()=>!1},y=>(this.shouldChangeView.read(y),this.containerIdObs.read(y))),this.nextContainerId="",this.useFirstContainerId=!1,this.previousContainerId=void 0,this.containersMap=new Map,this.viewReady=new l.Deferred,this.state=new Map,this.storedState={},this.onCurrentChangeEmitter=new l.Emitter,this.onCurrentChange=this.onCurrentChangeEmitter.event,this.onSizeChangeEmitter=new l.Emitter,this.onSizeChange=this.onSizeChangeEmitter.event,this.menuId=`tabbar/${this.location}`,this.moreMenuId=`tabbar/${this.location}/more`,this.sortedContainers=[],this.disposableMap=new Map,this.tabInMoreKeyMap=new Map,this.shouldWaitForViewRender=!1,this.onDidRegisterContainerEmitter=new l.Emitter,this.isEmptyTabbar=!0,this.updatePanel=(0,r.default)(y=>{this.resizeHandle&&this.resizeHandle.hidePanel(y)},60),this._menuMap=new Map,this.handleContextMenu=(y,b)=>{y.preventDefault(),y.stopPropagation();const A=this.menuService.createMenu(this.menuId,b?this.scopedCtxKeyService:this.contextKeyService),S=(0,v.generateCtxMenu)({menus:A,args:[{containerId:b}]});this.contextMenuRenderer.show({menuNodes:S[1],anchor:{x:y.clientX,y:y.clientY}})};const d=p.slotRendererRegistry.getTabbarConfig(f);this.behaviorHandler=new a.TabbarBehaviorHandler(f,d),this.scopedCtxKeyService=this.contextKeyService.createScoped(),this.scopedCtxKeyService.createKey("triggerWithTab",!0),this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerGlobalToggleCommand(),label:(0,l.localize)("layout.tabbar.toggle")},group:"0_global",when:"triggerWithTab == true"}),this.activatedKey=this.contextKeyService.createKey((0,l.getTabbarCtxKey)(this.location),""),this.behaviorHandler.registerLocationSpecificCommands({commandRegistry:this.commandRegistry,layoutService:this.layoutService}),this.commonTitleMenu=this.behaviorHandler.registerLocationSpecificMenus({menuRegistry:this.menuRegistry,ctxMenuService:this.ctxMenuService}),this.eventBus.onDirective(l.ResizeEvent.createDirective(this.location),()=>{this.onResize()})}get onDidRegisterContainer(){return this.onDidRegisterContainerEmitter.event}updateNextContainerId(f){(0,l.isUndefined)(f)?this.useFirstContainerId=!0:this.nextContainerId=f}updateCurrentContainerId(f,d){d?this.containerIdObs.set(f,d):(0,s.transaction)(y=>{this.containerIdObs.set(f,y)})}updateBadge(f,d){const y=this.getContainer(f);y&&y.options&&(y.options.badge=d),y?.fireChange(y)}getContainerState(f){return this.state.get(f)}hideContainer(f){const d=this.state.get(f);d&&(d.hidden=!0,this.onStateChangeEmitter.fire())}showContainer(f){const d=this.state.get(f);d&&(d.hidden=!1,this.onStateChangeEmitter.fire())}updatePanelVisibility(f){f===void 0&&(f=this.containersMap.size>0),this.updatePanel(f)}ensureViewReady(){(0,l.isDefined)(this.barSize)&&(0,l.isDefined)(this.panelSize)?this.resolveViewReady():this.shouldWaitForViewRender=!0}updatePanelSize(f){this.panelSize=f,(0,l.isDefined)(this.barSize)&&this.shouldWaitForViewRender&&this.resolveViewReady()}updateBarSize(f){this.barSize=f,(0,l.isDefined)(this.panelSize)&&this.shouldWaitForViewRender&&this.resolveViewReady()}resolveViewReady(){this.isEmptyTabbar?l.Event.once(this.onDidRegisterContainer)(()=>{this.viewReady.resolve()}):this.viewReady.resolve()}getBarSize(){return this.barSize}updateTabInMoreKey(f,d){const y=this.tabInMoreKeyMap.get(f);y&&y.set(d)}get visibleContainers(){const f=[];return this.containersMap.forEach(d=>{const y=d.options&&this.state.get(d.options.containerId);(!y||!y.hidden)&&f.push(d)}),f.sort((d,y)=>this.getContainerState(d.options.containerId).priority-this.getContainerState(y.options.containerId).priority)}registerResizeHandle(f){return this.resizeHandle=this.behaviorHandler.wrapResizeHandle(f),this.listenCurrentChange()}registerContainer(f,d){var y;if(this.containersMap.has(f))return;this.useFirstContainerId&&(this.useFirstContainerId=!1,this.updateCurrentContainerId(f)),this.nextContainerId===f&&this.updateCurrentContainerId(f);const b=new l.DisposableCollection,A=d.options||{containerId:f};d.options=A;const S=new l.Emitter;this.containersMap.set(f,{fireChange:I=>S.fire(I),onChange:S.event,views:d.views,options:A}),b.push({dispose:()=>{this.containersMap.delete(f),this.state.delete(f)}}),this.updatePanelVisibility(this.containersMap.size>0);let D=this.sortedContainers.findIndex(I=>{var w,T;return(((w=I.options)===null||w===void 0?void 0:w.priority)||1)<=(((T=d.options)===null||T===void 0?void 0:T.priority)||1)});D===-1&&(D=this.sortedContainers.length),this.sortedContainers.splice(D,0,d);for(let I=D;I<this.sortedContainers.length;I++){const T=(y=this.sortedContainers[I].options)===null||y===void 0?void 0:y.containerId;if(T){const R=this.storedState[T]||this.getContainerState(T)||{};this.state.set(T,{hidden:R.hidden,priority:I})}}b.push(this.registerSideEffects(d)),this.eventBus.fire(new g.TabBarRegistrationEvent({tabBarId:f})),f===this.currentContainerId.get()&&this.handleChange(f,""),this.viewContextKeyRegistry.registerContextKeyService(f,this.contextKeyService.createScoped()).createKey("view",f),this.isEmptyTabbar&&(this.isEmptyTabbar=!1),this.disposableMap.set(f,b),this.onDidRegisterContainerEmitter.fire(f)}registerSideEffects(f){var d;const y=new l.DisposableCollection;!((d=f.options)===null||d===void 0)&&d.hideTab||(y.push(this.registerHideMenu(f)),y.push(this.registerMoreMenu(f))),y.push(this.registerActivateKeyBinding(f,f.options.fromExtension));const b=this.contextKeyService.createKey(`workbench.${this.location}.${f.options.containerId}`,!0);return y.push({dispose:()=>{b.set(!1)}}),y.push(this.progressService.registerProgressIndicator(f.options.containerId)),y.push(this.registerContainerPanelRelatedCommand(f)),y}registerContainerPanelRelatedCommand(f){var d,y,b,A,S;const D=new l.DisposableCollection,I=(d=f.options)===null||d===void 0?void 0:d.containerId;return D.push(this.commandRegistry.registerCommand({id:"container.show."+I,label:(0,l.formatLocalize)("view.command.show",(b=(y=f.options)===null||y===void 0?void 0:y.title)!==null&&b!==void 0?b:I),labelLocalized:(0,l.createFormatLocalizedStr)("view.command.show",(S=(A=f.options)===null||A===void 0?void 0:A.title)!==null&&S!==void 0?S:I),category:"View"},{execute:()=>{this.updateCurrentContainerId(I)}})),D.push(this.commandRegistry.registerCommand({id:"container.hide."+I},{execute:()=>{this.updateCurrentContainerId("")}})),D.push(this.commandRegistry.registerCommand({id:"container.toggle."+I},{execute:()=>{this.currentContainerId.get()===I?this.updateCurrentContainerId(""):this.updateCurrentContainerId(I)}})),D}registerHideMenu(f){const d=new l.DisposableCollection,y=f.options.containerId;return d.push(this.menuRegistry.registerMenuItem(this.menuId,{command:{id:this.registerVisibleToggleCommand(y,d),label:f.options.title||y},group:"1_widgets"})),d}registerMoreMenu(f){const d=new l.DisposableCollection,y=f.options.containerId,b=this.scopedCtxKeyService.createKey(this.getTabInMoreCtxKey(y),!1);return this.tabInMoreKeyMap.set(y,b),d.push({dispose:()=>this.tabInMoreKeyMap.delete(y)}),d.push(this.menuRegistry.registerMenuItem(this.moreMenuId,{command:{id:this.registerMoreToggleCommand(f,d),label:f.options.title||y},group:"inline",when:`${this.getTabInMoreCtxKey(y)} == true`,toggledWhen:`${(0,l.getTabbarCtxKey)(this.location)} == ${y}`,iconClass:f.options.iconClass})),d}disposeContainer(f){var d;const y=this.disposableMap.get(f);y&&y.dispose(),this.currentContainerId.get()===f&&this.updateCurrentContainerId(((d=this.visibleContainers[0].options)===null||d===void 0?void 0:d.containerId)||"")}updateTitle(f,d){const y=this.getContainer(f);y&&(y.options.title=d)}getContainer(f){return f?this.containersMap.get(f):void 0}getTitleToolbarMenu(f){const d=this._menuMap.get(f);if(d)return d;const y=this.menuService.createMenu(v.MenuId.ViewTitle,this.viewContextKeyRegistry.getContextKeyService(f));this._menuMap.set(f,y);const b=this.disposableMap.get(f),A=[y,(0,l.toDisposable)(()=>{this._menuMap.delete(f)})];return b?b.pushAll(A):this.addDispose(A),y}doExpand(f){this.behaviorHandler.doExpand(f,this.resizeHandle)}get isExpanded(){return this.behaviorHandler.isExpanded(this.resizeHandle)}handleTabClick(f,d){const y=f.currentTarget.id;y===this.currentContainerId.get()&&!d?this.updateCurrentContainerId(""):this.updateCurrentContainerId(y)}showMoreMenu(f,d){const y=this.menuService.createMenu(this.moreMenuId,this.scopedCtxKeyService),b=(0,v.generateCtxMenu)({menus:y,args:[{lastContainerId:d}]});this.contextMenuRenderer.show({menuNodes:b[1],anchor:{x:f.clientX,y:f.clientY}})}handleDragStart(f,d){f.dataTransfer.setData("containerId",d),this.layoutService.showDropAreaForContainer(d)}handleDrop(f,d){if(f.dataTransfer.getData("containerId")){const y=f.dataTransfer.getData("containerId"),b=this.visibleContainers,A=b.findIndex(D=>y===D.options.containerId),S=b.findIndex(D=>d===D.options.containerId);this.doInsertTab(b,A,S),this.storeState()}}handleDragEnd(f){this.layoutService.hideDropArea()}restoreState(){this.storedState=this.layoutState.getState(_.LAYOUT_STATE.getTabbarSpace(this.location),{});for(const f of this.state.keys())this.storedState[f]&&this.state.set(f,this.storedState[f]);this.visibleContainers.forEach(f=>{this.tryRestoreAccordionSize(f)})}removeContainer(f){const d=this.disposableMap.get(f);d?.dispose(),this.onStateChangeEmitter.fire()}dynamicAddContainer(f,d){this.registerContainer(f,d),this.updateCurrentContainerId(f)}doInsertTab(f,d,y){const b=this.getContainerState(f[y].options.containerId).priority,A=(D,I)=>{const w=this.getContainerState(f[D].options.containerId),T=this.getContainerState(f[I].options.containerId);w.priority=T.priority};let S;if(d>y)for(S=y;S<d;S++)A(S,S+1);else for(S=y;S>d;S--)A(S,S-1);this.getContainerState(f[S].options.containerId).priority=b,this.doChangeViewEmitter.fire()}storeState(){const f={};this.state.forEach((d,y)=>{f[y]=d}),this.layoutState.setState(_.LAYOUT_STATE.getTabbarSpace(this.location),f),this.onStateChangeEmitter.fire()}registerActivateKeyBinding(f,d){const y=f.options,b=y.containerId,A=d?`workbench.view.extension.${b}`:`workbench.view.${b}`,S=new l.DisposableCollection;return S.push(this.commandRegistry.registerCommand({id:A},{execute:({forceShow:D}={})=>{this.behaviorHandler.handleActivateKeyBinding(b,this.currentContainerId.get()||"",I=>this.updateCurrentContainerId(I),D)}})),y.activateKeyBinding&&S.push(this.keybindingRegistry.registerKeybinding({command:A,keybinding:y.activateKeyBinding})),S}registerGlobalToggleCommand(){const f=`activity.bar.toggle.${this.location}`;return this.commandRegistry.registerCommand({id:f},{execute:({containerId:d})=>{this.doToggleTab(d)},isEnabled:()=>this.visibleContainers.length>1}),f}registerVisibleToggleCommand(f,d){const y=`activity.bar.toggle.${f}`;return d.push(this.commandRegistry.registerCommand({id:y},{execute:({forceShow:b}={})=>{this.doToggleTab(f,b)},isToggled:()=>!this.getContainerState(f).hidden,isEnabled:()=>this.getContainerState(f).hidden||this.visibleContainers.length!==1})),y}registerMoreToggleCommand(f,d){const{options:y}=f,{containerId:b}=y,A=`activity.bar.activate.more.${b}`;return d.push(this.commandRegistry.registerCommand({id:A},{execute:({lastContainerId:S})=>{if(this.updateCurrentContainerId(b),S){const D=this.getContainerState(b),I=this.getContainerState(S),w=D.priority;D.priority=I.priority,I.priority=w,this.storeState()}}})),A}getTabInMoreCtxKey(f){return`${f}.isInMore`}doToggleTab(f,d){const y=this.getContainerState(f);d===void 0?y.hidden=!y.hidden:y.hidden=!d,y.hidden&&this.currentContainerId.get()===f&&this.updateCurrentContainerId(this.visibleContainers[0].options.containerId),this.storeState()}shouldExpand(f){const d=this.getContainer(f);return!!(d&&d.options&&d.options.expanded)}onResize(){l.fastdom.measureAtNextFrame(()=>{if(!this.currentContainerId||!this.resizeHandle)return;const f=this.resizeHandle.getSize();f!==this.barSize&&!this.shouldExpand(this.currentContainerId.get())&&(this.prevSize=f,this.onSizeChangeEmitter.fire({size:f}))})}listenCurrentChange(){return(0,s.autorunDelta)(this.currentContainerId,({lastValue:f,newValue:d})=>{this.previousContainerId=f===u?"":f,this.handleChange(d,f)})}handleChange(f,d){var y;if(!this.resizeHandle)return;const{getSize:b,setSize:A,lockSize:S}=this.resizeHandle;this.onCurrentChangeEmitter.fire({previousId:d,currentId:f});const D=this.shouldExpand(f);if(this.shouldExpand(this.previousContainerId)||D)this.behaviorHandler.handleFullExpanded(f,D,this.resizeHandle,{barSize:this.barSize,panelSize:this.panelSize,prevSize:this.prevSize});else if(f){d&&f!==d&&(this.prevSize=b());const I=this.getContainer(f);A(this.prevSize||this.panelSize+this.barSize),S(!!(!((y=I?.options)===null||y===void 0)&&y.noResize)),this.activatedKey.set(f)}else A(this.barSize),S(!0)}tryRestoreAccordionSize(f){this.behaviorHandler.tryRestoreAccordionSize(f,this.layoutService)}};t.TabbarService=c,n.__decorate([(0,o.Autowired)(v.AbstractMenuService),n.__metadata("design:type",v.AbstractMenuService)],c.prototype,"menuService",void 0),n.__decorate([(0,o.Autowired)(v.AbstractContextMenuService),n.__metadata("design:type",v.AbstractContextMenuService)],c.prototype,"ctxMenuService",void 0),n.__decorate([(0,o.Autowired)(v.IMenuRegistry),n.__metadata("design:type",v.IMenuRegistry)],c.prototype,"menuRegistry",void 0),n.__decorate([(0,o.Autowired)(l.CommandRegistry),n.__metadata("design:type",Object)],c.prototype,"commandRegistry",void 0),n.__decorate([(0,o.Autowired)(v.ICtxMenuRenderer),n.__metadata("design:type",v.ICtxMenuRenderer)],c.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,o.Autowired)(l.KeybindingRegistry),n.__metadata("design:type",Object)],c.prototype,"keybindingRegistry",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",l.ViewContextKeyRegistry)],c.prototype,"viewContextKeyRegistry",void 0),n.__decorate([(0,o.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],c.prototype,"contextKeyService",void 0),n.__decorate([(0,o.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],c.prototype,"layoutService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",_.LayoutState)],c.prototype,"layoutState",void 0),n.__decorate([(0,o.Autowired)(m.IProgressService),n.__metadata("design:type",Object)],c.prototype,"progressService",void 0),t.TabbarService=c=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],c)},58296:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsRegistry=t.ViewsController=t.ViewContentGroups=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(17793);var v;(function(g){g.Open="2_open",g.Debug="4_debug",g.SCM="5_scm",g.More="9_more"})(v||(t.ViewContentGroups=v={}));function m(g,a){var h,u,c,E;const f=(h=g.group)!==null&&h!==void 0?h:v.More,d=(u=a.group)!==null&&u!==void 0?u:v.More;return f!==d?f.localeCompare(d):((c=g.order)!==null&&c!==void 0?c:5)-((E=a.order)!==null&&E!==void 0?E:5)}let p=class{get contents(){const a=this.items.filter(h=>h.visible);return a.length===0&&this.defaultItem?[this.defaultItem.descriptor]:a.map(h=>h.descriptor)}constructor(a){this.id=a,this._onDidChange=new o.Emitter,this.onDidChange=this._onDidChange.event,this.items=[],this.disposables=[],this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.disposables),o.Event.filter(this.viewsRegistry.onDidChangeViewWelcomeContent,h=>h===this.id)(this.onDidChangeViewWelcomeContent,this,this.disposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const a=this.viewsRegistry.getViewWelcomeContent(this.id);this.items=[];for(const h of a)if(h.when==="default")this.defaultItem={descriptor:h,visible:!0};else{const u=h.when?this.contextKeyService.match(h.when):!0;this.items.push({descriptor:h,visible:u})}this._onDidChange.fire()}onDidChangeContext(){let a=!1;for(const h of this.items){if(!h.descriptor.when||h.descriptor.when==="default")continue;const u=this.contextKeyService.match(h.descriptor.when);h.visible!==u&&(h.visible=u,a=!0)}a&&this._onDidChange.fire()}dispose(){this.disposables.forEach(a=>a.dispose()),this.disposables=[]}};t.ViewsController=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(_.IViewsRegistry),n.__metadata("design:type",Object)],p.prototype,"viewsRegistry",void 0),t.ViewsController=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],p);let s=class{constructor(){this.viewWelcomeContent=new l.SetMap,this._onDidChangeViewWelcomeContent=new o.Emitter,this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event}registerViewWelcomeContent(a,h){return this.viewWelcomeContent.add(a,h),this._onDidChangeViewWelcomeContent.fire(a),{dispose:()=>{this.viewWelcomeContent.delete(a,h),this._onDidChangeViewWelcomeContent.fire(a)}}}registerViewWelcomeContent2(a,h){const u=new Map;for(const[c,E]of h)this.viewWelcomeContent.add(a,E),u.set(c,(0,o.toDisposable)(()=>{this.viewWelcomeContent.delete(a,E),this._onDidChangeViewWelcomeContent.fire(a)}));return this._onDidChangeViewWelcomeContent.fire(a),u}getViewWelcomeContent(a){const h=[];return this.viewWelcomeContent.forEach(a,u=>h.push(u)),h.sort(m),h}};t.ViewsRegistry=s,t.ViewsRegistry=s=n.__decorate([(0,r.Injectable)()],s)},24429:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeView=t.CSSIcon=void 0,t.renderLabelWithIcons=a;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(48412),_=e(41869),v=e(43718),m=n.__importDefault(e(81388)),p=e(58296);var s;(function(c){c.iconNameSegment="[A-Za-z0-9]+",c.iconNameExpression="[A-Za-z0-9\\-]+",c.iconModifierExpression="~[A-Za-z]+"})(s||(t.CSSIcon=s={}));const g=new RegExp(`(\\\\)?\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)`,"g");function a(c){const E=new Array;let f,d=0,y=0;for(;(f=g.exec(c))!==null;){y=f.index||0,E.push(c.substring(d,y)),d=(f.index||0)+f[0].length;const[,b,A]=f;E.push(b?`$(${A})`:o.default.createElement("span",{className:(0,_.getExternalIcon)(A)}))}return d<c.length&&E.push(c.substring(d)),E}const h=c=>{const{contents:E}=c,[f,d]=o.default.useState(E.map(A=>A.precondition?!1:null)),y=(0,_.useInjectable)(_.IContextKeyService),b=(0,_.useInjectable)(_.IOpenerService);return o.default.useEffect(()=>{const A=E.map(D=>{if(D.precondition){const I=new Set;return D.precondition.keys().forEach(w=>I.add(w)),I}return null}),S=y.onDidChangeContext(D=>{A.forEach((I,w)=>{I&&D.payload.affectsSome(I)&&d(f.map((T,R)=>R===w?y.match(E[w].precondition):T))})});return()=>S.dispose()},[E]),E.length===0?null:o.default.createElement(o.default.Fragment,null,E.map(({content:A,precondition:S},D)=>{const I=A.split(`
32212
32212
  `),w=[];for(let T of I){if(T=T.trim(),!T)continue;const R=(0,v.parseLinkedText)(T);if(R.nodes.length===1&&typeof R.nodes[0]!="string"){const P=R.nodes[0];w.push(o.default.createElement("div",{key:w.length,title:P.title,className:"button-container"},o.default.createElement(l.Button,{disabled:f[D]===!1,onClick:()=>b.open(P.href)},a(P.label))))}else{const P=R.nodes.map((O,M)=>typeof O=="string"?O:o.default.createElement("a",{key:M,className:(0,r.default)({disabled:O.href.startsWith("command:")&&f[D]===!1}),title:O.title,onClick:()=>b.open(O.href)},O.label));w.push(o.default.createElement("p",{key:w.length},P))}}return o.default.createElement(o.default.Fragment,{key:D},w)}))};function u(c,E){return c.viewId===E.viewId}t.WelcomeView=o.default.memo(c=>{const E=(0,_.useInjectable)(p.ViewsController,[c.viewId]),[f,d]=o.default.useState(E.contents);return o.default.useEffect(()=>{E.onDidChange(()=>{const y=E.contents;d(y)})},[]),f.length?o.default.createElement("div",{className:m.default.welcome},o.default.createElement(h,{contents:f})):null},u)},17793:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(72260),t)},72260:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DROP_VIEW_CONTAINER=t.DROP_EXTEND_VIEW_CONTAINER=t.DROP_PANEL_CONTAINER=t.SUPPORT_ACCORDION_LOCATION=t.ViewCollapseChangedEvent=t.IViewsRegistry=t.TabBarRegistrationEvent=t.MainLayoutContribution=t.IMainLayoutService=void 0;const n=e(41869);t.IMainLayoutService=Symbol("IMainLayoutService"),t.MainLayoutContribution=Symbol("MainLayoutContribution");class r extends n.BasicEvent{}t.TabBarRegistrationEvent=r,t.IViewsRegistry=Symbol("IViewsRegistry");class o extends n.BasicEvent{}t.ViewCollapseChangedEvent=o,t.SUPPORT_ACCORDION_LOCATION=new Set([n.SlotLocation.view,n.SlotLocation.extendView]),t.DROP_PANEL_CONTAINER="drop-panel",t.DROP_EXTEND_VIEW_CONTAINER="drop-extend-view",t.DROP_VIEW_CONTAINER="drop-view"},63067:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(17793),t)},93835:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedMarkdownEditorContribution=t.MARKDOWN_EDITOR_COMPONENT_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(57517),v=e(21066),m=e(81001);t.MARKDOWN_EDITOR_COMPONENT_ID="MARKDOWN_EDITOR_COMPONENT_ID";let p=class{registerEditorComponent(g){g.registerEditorComponent({uid:t.MARKDOWN_EDITOR_COMPONENT_ID,component:m.MarkdownEditorComponent,scheme:l.Schemes.file}),g.registerEditorComponentResolver(l.Schemes.file,(a,h)=>{a.uri.path.ext===".md"&&h.push({type:_.EditorOpenType.component,componentId:t.MARKDOWN_EDITOR_COMPONENT_ID,title:(0,l.localize)("editorOpenType.preview"),weight:this.preferenceService.get("application.preferMarkdownPreview")?10:-1})})}};t.EmbeddedMarkdownEditorContribution=p,n.__decorate([(0,r.Autowired)(v.IMarkdownService),n.__metadata("design:type",Object)],p.prototype,"markdownService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],p.prototype,"preferenceService",void 0),t.EmbeddedMarkdownEditorContribution=p=n.__decorate([(0,l.Domain)(_.BrowserEditorContribution)],p)},81001:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownEditorComponent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(57517),_=e(21066),v=({resource:m})=>{let p=null;const s=(0,o.useInjectable)(_.IMarkdownService),g=(0,o.useInjectable)(l.IEditorDocumentModelService);return r.default.useEffect(()=>{if(p){const a=new o.Disposable,h=new o.CancellationTokenSource;return a.addDispose({dispose:()=>{h.cancel()}}),g.createModelReference(m.uri,"markdown-preview").then(u=>{if(h.token.isCancellationRequested){u&&u.dispose();return}const c=new o.Emitter;a.addDispose(c),a.addDispose(u.instance.getMonacoModel().onDidChangeContent(E=>{c.fire(u.instance.getText())})),p&&s.previewMarkdownInContainer(u.instance.getText(),p,h.token,void 0,c.event).then(E=>{a.addDispose(E)}),a.addDispose(u)}),()=>{a.dispose()}}}),r.default.createElement("div",{ref:a=>{p=a},style:{height:"100%"}})};t.MarkdownEditorComponent=v},31101:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownModule=t.Markdown=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(21066),_=e(89637);var v=e(6001);Object.defineProperty(t,"Markdown",{enumerable:!0,get:function(){return v.Markdown}});let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IMarkdownService,useClass:_.MarkdownServiceImpl}]}};t.MarkdownModule=m,t.MarkdownModule=m=n.__decorate([(0,r.Injectable)()],m)},86422:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
32213
32213
  /*---------------------------------------------------------------------------------------------
32214
32214
  * Copyright (c) Microsoft Corporation. All rights reserved.