@meirblachman/azure-pipelines-visualizer 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +2 -2
- package/dist/web/assets/{index-Oedmib0W.js → index-C-vxesL2.js} +4 -4
- package/dist/web/assets/react-vendor-Bdswto6F.js +1 -0
- package/dist/web/assets/reactflow-BBgD8bXw.js +62 -0
- package/dist/web/assets/{yaml-C-D6Mpno.js → yaml-DGeXk3xG.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/lib/index.js +1612 -0
- package/dist/web/lib/style.css +1 -0
- package/package.json +1 -1
- package/dist/web/assets/react-vendor-C7bvnQIN.js +0 -1
- package/dist/web/assets/reactflow-N78VftLX.js +0 -62
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./yaml-
|
|
2
|
-
var wre=Object.defineProperty;var Sre=(s,e,t)=>e in s?wre(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Pi=(s,e,t)=>Sre(s,typeof e!="symbol"?e+"":e,t);import{r as je,R as Au,a as yre,c as xre,u as Lre,j as me,H as hV,P as uV,g as kre,B as Ire,E as Dre,M as yk,b as Ere,d as Nre,i as Tre,e as Rre,f as Mre,C as Are}from"./reactflow-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./yaml-DGeXk3xG.js","./reactflow-BBgD8bXw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var wre=Object.defineProperty;var Sre=(s,e,t)=>e in s?wre(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Pi=(s,e,t)=>Sre(s,typeof e!="symbol"?e+"":e,t);import{r as je,R as Au,a as yre,c as xre,u as Lre,j as me,H as hV,P as uV,g as kre,B as Ire,E as Dre,M as yk,b as Ere,d as Nre,i as Tre,e as Rre,f as Mre,C as Are}from"./reactflow-BBgD8bXw.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}})();function fV(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=Array(e);t<e;t++)i[t]=s[t];return i}function Pre(s){if(Array.isArray(s))return s}function Ore(s,e,t){return(e=Ure(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Fre(s,e){var t=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var i,n,o,r,a=[],l=!0,c=!1;try{if(o=(t=t.call(s)).next,e!==0)for(;!(l=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(d){c=!0,n=d}finally{try{if(!l&&t.return!=null&&(r=t.return(),Object(r)!==r))return}finally{if(c)throw n}}return a}}function Wre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gV(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function pV(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gV(Object(t),!0).forEach(function(i){Ore(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):gV(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function Bre(s,e){if(s==null)return{};var t,i,n=Hre(s,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(s,t)&&(n[t]=s[t])}return n}function Hre(s,e){if(s==null)return{};var t={};for(var i in s)if({}.hasOwnProperty.call(s,i)){if(e.indexOf(i)!==-1)continue;t[i]=s[i]}return t}function Vre(s,e){return Pre(s)||Fre(s,e)||$re(s,e)||Wre()}function zre(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function Ure(s){var e=zre(s,"string");return typeof e=="symbol"?e:e+""}function $re(s,e){if(s){if(typeof s=="string")return fV(s,e);var t={}.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fV(s,e):void 0}}function jre(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function mV(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function _V(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mV(Object(t),!0).forEach(function(i){jre(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):mV(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function qre(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return function(i){return e.reduceRight(function(n,o){return o(n)},i)}}function Fw(s){return function e(){for(var t=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l];return e.apply(t,[].concat(n,a))}}}function xk(s){return{}.toString.call(s).includes("Object")}function Kre(s){return!Object.keys(s).length}function _0(s){return typeof s=="function"}function Gre(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function Yre(s,e){return xk(e)||Pu("changeType"),Object.keys(e).some(function(t){return!Gre(s,t)})&&Pu("changeField"),e}function Zre(s){_0(s)||Pu("selectorType")}function Xre(s){_0(s)||xk(s)||Pu("handlerType"),xk(s)&&Object.values(s).some(function(e){return!_0(e)})&&Pu("handlersType")}function Qre(s){s||Pu("initialIsRequired"),xk(s)||Pu("initialType"),Kre(s)&&Pu("initialContent")}function Jre(s,e){throw new Error(s[e]||s.default)}var eae={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Pu=Fw(Jre)(eae),ax={changes:Yre,selector:Zre,handler:Xre,initial:Qre};function tae(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ax.initial(s),ax.handler(e);var t={current:s},i=Fw(sae)(t,e),n=Fw(nae)(t),o=Fw(ax.changes)(s),r=Fw(iae)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ax.selector(c),c(t.current)}function l(c){qre(i,n,o,r)(c)}return[a,l]}function iae(s,e){return _0(e)?e(s.current):e}function nae(s,e){return s.current=_V(_V({},s.current),e),e}function sae(s,e,t){return _0(e)?e(s.current):Object.keys(t).forEach(function(i){var n;return(n=e[i])===null||n===void 0?void 0:n.call(e,s.current[i])}),t}var oae={create:tae},rae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function aae(s){return function e(){for(var t=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l];return e.apply(t,[].concat(n,a))}}}function lae(s){return{}.toString.call(s).includes("Object")}function cae(s){return s||bV("configIsRequired"),lae(s)||bV("configType"),s.urls?(dae(),{paths:{vs:s.urls.monacoBase}}):s}function dae(){console.warn(IY.deprecation)}function hae(s,e){throw new Error(s[e]||s.default)}var IY={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
4
4
|
You are using deprecated way of configuration.
|
|
5
5
|
|
|
@@ -911,7 +911,7 @@ ${l}
|
|
|
911
911
|
`):void 0}:{range:I.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
912
912
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
|
|
913
913
|
`)};const r=await o.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m(1380,"No result.")),n);return r}}async function Z7e(s,e,t,i){const n=new SH(e,t,s),o=await n.resolveRenameLocation(et.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,et.None)}var mm;let If=(mm=class{static get(e){return e.getContribution(tW.ID)}constructor(e,t,i,n,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new Q,this._cts=new ni,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(eW,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ni,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new SH(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new Lh(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const _=i.resolveRenameLocation(n.token);this._progressService.showWhile(_,250),o=await _,e("resolved rename location")}catch(_){_ instanceof ca?e("resolve rename location cancelled",JSON.stringify(_,null," ")):(e("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||rh(_))&&((g=qo.get(this.editor))==null||g.showMessage(_||m(1381,"An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),(p=qo.get(this.editor))==null||p.showMessage(o.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Lh(this.editor,5,o.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async _=>[_,await _.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(_,v)=>{let b=c.slice();return _===x0.Automatic&&(b=b.filter(([w,C])=>C)),b.map(([w])=>w.provideNewSymbolNames(a,o.range,_,v))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=$v(i.provideRenameEdits(u.newName,r.token),r.token).then(async _=>{if(!_){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(_.rejectReason){e(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(I.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:u.wantsPreview,label:m(1382,"Renaming '{0}' to '{1}'",o==null?void 0:o.text,u.newName),code:"undoredo.rename",quotableLabel:m(1383,"Renaming {0} to {1}",o==null?void 0:o.text,u.newName),respectAutoSaveConfig:!0,reason:as.rename()}).then(v=>{e("edits applied"),v.ariaSummary&&eo(m(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,v.ariaSummary))}).catch(v=>{e(`error when applying edits ${JSON.stringify(v,null," ")}`),this._notificationService.error(m(1385,"Rename failed to apply edits")),this._logService.error(v)})},_=>{e("error when providing rename edits",JSON.stringify(_,null," ")),this._notificationService.error(m(1386,"Rename failed to compute edits")),this._logService.error(_)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},tW=mm,mm.ID="editor.contrib.renameController",mm);If=tW=Y7e([ig(1,ke),ig(2,Di),ig(3,Hy),ig(4,yh),ig(5,jt),ig(6,pR),ig(7,Se)],If);class X7e extends Ce{constructor(){super({id:"editor.action.rename",label:G(1388,"Rename Symbol"),precondition:ne.and(P.writable,P.hasRenameProvider),kbOpts:{kbExpr:P.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(gt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ee.isUri(n)&&B.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},He):super.runCommand(e,t)}run(e,t){const i=e.get(jt),n=If.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}ht(If.ID,If,4);pe(X7e);const yH=hn.bindToContribution(If.get);_e(new yH({id:"acceptRenameInput",precondition:QC,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ne.and(P.focus,ne.not("isComposing")),primary:3}}));_e(new yH({id:"acceptRenameInputWithPreview",precondition:ne.and(QC,ne.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ne.and(P.focus,ne.not("isComposing")),primary:2051}}));_e(new yH({id:"cancelRenameInput",precondition:QC,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:P.focus,primary:9,secondary:[1033]}}));Et(class extends Dn{constructor(){super({id:"focusNextRenameSuggestion",title:{...G(1389,"Focus Next Rename Suggestion")},precondition:QC,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(gt).getFocusedCodeEditor();if(!t)return;const i=If.get(t);i&&i.focusNextRenameSuggestion()}});Et(class extends Dn{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...G(1390,"Focus Previous Rename Suggestion")},precondition:QC,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(gt).getFocusedCodeEditor();if(!t)return;const i=If.get(t);i&&i.focusPreviousRenameSuggestion()}});Io("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;ft(typeof n=="string");const{renameProvider:o}=s.get(Se);return Z7e(o,e,t,n)});Io("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(Se),o=await new SH(e,t,i).resolveRenameLocation(et.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});mi.as(Wl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:m(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Q7e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},OG=function(s,e){return function(t,i){e(t,i,s)}},Pv;let AE=(Pv=class extends U{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var r;const o=(r=this.editor.getModel())==null?void 0:r.getLanguageId();o&&n.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Mt(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(o=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(o)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>J7e(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=r.length;a<l;a++){const c={sectionHeader:e[a],decorationId:r[a]};this.currentOccurrences[c.decorationId]=c}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},Pv.ID="editor.sectionHeaderDetector",Pv);AE=Q7e([OG(1,di),OG(2,Do)],AE);function J7e(s){return{range:s.range,options:ze.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}ht(AE.ID,AE,1);function eWe(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],o=s[e+2],r=s[e+3];s[e+0]=r,s[e+1]=o,s[e+2]=n,s[e+3]=i}}function tWe(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return qY()||eWe(e),Fu.wrap(e)}function Ose(s){const e=new Uint32Array(iWe(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return tWe(e)}function iWe(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function v2(s){return s&&!!s.data}function Fse(s){return s&&Array.isArray(s.edits)}class nWe{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Wse(s,e){return s.has(e)}function sWe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Bse(s,e,t,i,n){const o=sWe(s,e),r=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){c=d,l=null}return(!l||!v2(l)&&!Fse(l))&&(l=null),new nWe(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function oWe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class rWe{constructor(e,t){this.provider=e,this.tokens=t}}function aWe(s,e){return s.has(e)}function Hse(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function xH(s,e,t,i){const n=Hse(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Ki(l),a=null}return(!a||!v2(a))&&(a=null),new rWe(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}dt.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;ft(t instanceof Ee);const i=s.get(ci).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Se),o=oWe(n,i);return o?o[0].getLegend():s.get(qt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});dt.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;ft(t instanceof Ee);const i=s.get(ci).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Se);if(!Wse(n,i))return s.get(qt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await Bse(n,i,null,null,et.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!v2(a))return;const l=Ose({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});dt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;ft(t instanceof Ee);const n=s.get(ci).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Se),r=Hse(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!I.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await xH(o,n,I.lift(i),et.None);if(a)return a.provider.getLegend()});dt.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;ft(t instanceof Ee),ft(I.isIRange(i));const n=s.get(ci).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Se),r=await xH(o,n,I.lift(i),et.None);if(!(!r||!r.tokens))return Ose({id:0,type:"full",data:r.tokens.data})});const LH="editor.semanticHighlighting";function wk(s,e,t){var n;const i=(n=t.getValue(LH,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var Vse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pc=function(s,e){return function(t,i){e(t,i,s)}},Xh;let iW=class extends U{constructor(e,t,i,n,o,r){super(),this._watchers=new Hi;const a=d=>{var h;(h=this._watchers.get(d.uri))==null||h.dispose(),this._watchers.set(d.uri,new nW(d,e,i,o,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);wk(d,i,n)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{wk(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{wk(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(LH)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){kt(this._watchers.values()),this._watchers.clear(),super.dispose()}};iW=Vse([pc(0,PR),pc(1,ci),pc(2,_i),pc(3,qe),pc(4,Ca),pc(5,Se)],iW);var df;let nW=(df=class extends U{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Xh.REQUEST_MIN_DELAY,max:Xh.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Mt(()=>this._fetchDocumentSemanticTokensNow(),Xh.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{kt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),kt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Wse(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ni,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Bse(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Cn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,o)}},l=>{l&&(Ar(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||He(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let r=0;r<o;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,r=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(Fse(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(Xh._copy(l,d-g,c,h-g,g),h-=g),f.data&&(Xh._copy(f.data,0,c,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&Xh._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(v2(t)){this._currentDocumentResponse=new lWe(e,t.resultId,t.data);const a=AJ(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},Xh=df,df.REQUEST_MIN_DELAY=300,df.REQUEST_MAX_DELAY=2e3,df);nW=Xh=Vse([pc(1,PR),pc(2,_i),pc(3,Ca),pc(4,Se)],nW);class lWe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}KC(iW);var cWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ow=function(s,e){return function(t,i){e(t,i,s)}},Ov;let PE=(Ov=class extends U{constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Mt(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{var c;if(this._cleanupProviderListeners(),this._editor.hasModel()){const d=this._editor.getModel();for(const h of this._provider.all(d)){const u=(c=h.onDidChange)==null?void 0:c.call(h,()=>{this._cancelAll(),a()});u&&this._rangeProvidersChangeListeners.push(u)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(LH)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){kt(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!wk(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!aWe(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=an(r=>Promise.resolve(xH(this._provider,e,t,r))),o=new Cn(!1);return n.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,AJ(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},Ov.ID="editor.contrib.viewportSemanticTokens",Ov);PE=cWe([Ow(1,PR),Ow(2,_i),Ow(3,qe),Ow(4,Ca),Ow(5,Se)],PE);ht(PE.ID,PE,1);class dWe{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=o.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(_u(h)&&uc(d))break;d=h}for(l+=1;c<o.length;c++){const h=o.charCodeAt(c);if(uc(h)&&_u(d))break;if(h===95||h===45)break;d=h}l<c&&e.push({range:new I(i.lineNumber,r+l,i.lineNumber,r+c)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new I(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new I(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var hWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uWe=function(s,e){return function(t,i){e(t,i,s)}},sW;class kH{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new kH(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var _m;let iy=(_m=class{static get(e){return e.getContribution(sW.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Use(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(129),et.None).then(o=>{var r;if(!(!Ms(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!ii(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new kH(0,a)),(r=this._selectionListener)==null||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>ve.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},sW=_m,_m.ID="editor.contrib.smartSelectController",_m);iy=sW=hWe([uWe(1,Se)],iy);class zse extends Ce{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=iy.get(t);i&&await i.run(this._forward)}}class fWe extends zse{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:G(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:P.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ye.MenubarSelectionMenu,group:"1_basic",title:m(1398,"&&Expand Selection"),order:2}})}}dt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class gWe extends zse{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:G(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:P.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ye.MenubarSelectionMenu,group:"1_basic",title:m(1399,"&&Shrink Selection"),order:3}})}}ht(iy.ID,iy,4);pe(fWe);pe(gWe);async function Use(s,e,t,i,n){const o=s.all(e).concat(new dWe(i.selectSubwords));o.length===1&&o.unshift(new vE);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(c=>{if(Ms(c)&&c.length===t.length)for(let d=0;d<t.length;d++){a[d]||(a[d]=[]);for(const h of c[d])I.isIRange(h.range)&&I.containsPosition(h.range,t[d])&&a[d].push(I.lift(h.range))}},Ki));return await Promise.all(r),a.map(l=>{if(l.length===0)return[];l.sort((u,f)=>B.isBefore(u.getStartPosition(),f.getStartPosition())?1:B.isBefore(f.getStartPosition(),u.getStartPosition())||B.isBefore(u.getEndPosition(),f.getEndPosition())?-1:B.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||I.containsRange(u,d)&&!I.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;u<c.length;u++){const f=c[u-1],g=c[u];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const p=new I(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));p.containsRange(f)&&!p.equalsRange(f)&&g.containsRange(p)&&!g.equalsRange(p)&&h.push(p);const _=new I(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));_.containsRange(f)&&!_.equalsRange(p)&&g.containsRange(_)&&!g.equalsRange(_)&&h.push(_)}h.push(g)}return h})}dt.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;ft(Ee.isUri(t)),ft(ele(i,r=>B.isIPosition(r)));const n=s.get(Se).selectionRangeProvider,o=await s.get(Os).createModelReference(t);try{return Use(n,o.object.textEditorModel,i.map(B.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},et.None)}finally{o.dispose()}});const oW=Object.freeze({View:G(1638,"View"),Help:G(1639,"Help"),Test:G(1640,"Test"),File:G(1641,"File"),Preferences:G(1642,"Preferences"),Developer:G(1643,"Developer")});class pWe extends Ka{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...G(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:m(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:G(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:oW.View,toggled:{condition:ne.equals("config.editor.stickyScroll.enabled",!0),title:m(1445,"Sticky Scroll"),mnemonicTitle:m(1446,"&&Sticky Scroll")},menu:[{id:ye.CommandPalette},{id:ye.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ye.StickyScrollContext}]})}async runEditorCommand(e,t){var r;const i=e.get(qe),n=!i.getValue("editor.stickyScroll.enabled"),o=(r=ja.get(t))==null?void 0:r.isFocused();i.updateValue("editor.stickyScroll.enabled",n),o&&t.focus()}}const C2=100;class mWe extends Ka{constructor(){super({id:"editor.action.focusStickyScroll",title:{...G(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:m(1447,"&&Focus Editor Sticky Scroll")},precondition:ne.and(ne.has("config.editor.stickyScroll.enabled"),P.stickyScrollVisible),menu:[{id:ye.CommandPalette}]})}runEditorCommand(e,t){var i;(i=ja.get(t))==null||i.focus()}}class _We extends Ka{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:G(1451,"Select the next editor sticky scroll line"),precondition:P.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:C2,primary:18}})}runEditorCommand(e,t){var i;(i=ja.get(t))==null||i.focusNext()}}class bWe extends Ka{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:G(1452,"Select the previous sticky scroll line"),precondition:P.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:C2,primary:16}})}runEditorCommand(e,t){var i;(i=ja.get(t))==null||i.focusPrevious()}}class vWe extends Ka{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:G(1453,"Go to the focused sticky scroll line"),precondition:P.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:C2,primary:3}})}runEditorCommand(e,t){var i;(i=ja.get(t))==null||i.goToFocused()}}class CWe extends Ka{constructor(){super({id:"editor.action.selectEditor",title:G(1454,"Select Editor"),precondition:P.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:C2,primary:9}})}runEditorCommand(e,t){var i;(i=ja.get(t))==null||i.selectEditor()}}ht(ja.ID,ja,1);Et(pWe);Et(mWe);Et(bWe);Et(_We);Et(vWe);Et(CWe);var $se=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},t1=function(s,e){return function(t,i){e(t,i,s)}};class wWe{constructor(e,t,i,n,o,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.gutterMenuLinkAction=r,this.completion=a}}let rW=class extends _le{constructor(e,t,i,n,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=lt.slice(t,i),o=lt.slice(t,0,i);let r=5;for(const a of lt.concat(n,o)){if(a.score===Ha.Default)continue;const l=new I(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new wWe(l,c,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a.completion.action,a)),r-->=0&&a.resolve(et.None)}return e}};rW=$se([t1(5,m2)],rW);let aW=class extends U{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var f;if(i.selectedSuggestionInfo)return;let o;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){o=g;break}if(!o)return;const r=o.getOption(102);if(Eb.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Eb.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new I(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new aG(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await dH(this._languageFeatureService.completionProvider,e,t,new $S(void 0,wE.createSuggestFilter(o).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},n);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const _=new gu(g.items,t.column,new aG(u,0),CE.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new rW(e,t.lineNumber,c,_,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(et.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var o;const i=e.getValueInRange(I.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))(o=r.triggerCharacters)!=null&&o.includes(i)&&n.add(r);if(n.size!==0)return{providers:n,ch:i}}};aW=$se([t1(0,Se),t1(1,Jo),t1(2,m2),t1(3,gt)],aW);KC(aW);class SWe extends Ce{constructor(){super({id:"editor.action.forceRetokenize",label:G(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Cn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}pe(SWe);const ET=class ET extends Dn{constructor(){super({id:ET.ID,title:G(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:G(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!Qv.getTabFocusMode();Qv.setTabFocusMode(t),eo(t?m(1528,"Pressing Tab will now move focus to the next focusable element"):m(1529,"Pressing Tab will now insert the tab character"))}};ET.ID="editor.action.toggleTabFocusMode";let lW=ET;Et(lW);var yWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},FG=function(s,e){return function(t,i){e(t,i,s)}};let cW=class extends U{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=re(e,he("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Zc("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new It(this.el,"click")),a=this._register(new It(this.el,"keypress")),l=ge.chain(a.event,h=>h.map(u=>new Ot(u)).filter(u=>u.keyCode===3)),c=this._register(new It(this.el,$t.Tap)).event;this._register(ms.addTarget(this.el));const d=ge.any(r.event,l,c);this._register(d(h=>{this.enabled&&(mt.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};cW=yWe([FG(3,so),FG(4,Ah)],cW);var jse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},dW=function(s,e){return function(t,i){e(t,i,s)}};const xWe=26;let hW=class extends U{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(uW))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,xWe)}};hW=jse([dW(1,ke)],hW);let uW=class extends U{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=he("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=he("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Pn(this.element)}show(e){Pn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=re(this.element,he("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(he(`div${Te.asCSSSelector(e.icon)}`));const n=re(this.element,he("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=re(this.element,he("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(cW,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=re(this.element,he("div.action-container"));this.actionBar=this._register(new Co(o)),this.actionBar.push(this._register(new kr("banner.close",m(1533,"Close Banner"),Te.asClassName(Pte),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};uW=jse([dW(0,ke),dW(1,Ga)],uW);var IH=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Z1=function(s,e){return function(t,i){e(t,i,s)}};const LWe=Xt("extensions-warning-message",oe.warning,m(1534,"Icon shown with a warning message in the extensions editor."));var Fv;let ny=(Fv=class extends U{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:m(1535,"This document contains many non-basic ASCII unicode characters"),command:new oy};else if(o.ambiguousCharacterCount>=r)a={message:m(1536,"This document contains many ambiguous unicode characters"),command:new n_};else if(o.invisibleCharacterCount>=r)a={message:m(1537,"This document contains many invisible unicode characters"),command:new sy};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:LWe,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(hW,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=kWe(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?c_.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?hle:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new fW(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new IWe(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},Fv.ID="editor.contrib.unicodeHighlighter",Fv);ny=IH([Z1(1,Do),Z1(2,Tee),Z1(3,ke)],ny);function kWe(s,e){return{nonBasicASCII:e.nonBasicASCII===ur?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===ur?!s:e.includeComments,includeStrings:e.includeStrings===ur?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let fW=class extends U{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Mt(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:OE.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!a8(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Kse(i,this._options),inComment:l8(t,e),inString:c8(t,e)}}};fW=IH([Z1(3,Do)],fW);class IWe extends U{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Mt(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const o=LB.computeUnicodeHighlights(this._model,this._options,n);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:OE.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return a8(t,e)?{reason:Kse(i,this._options),inComment:l8(t,e),inString:c8(t,e)}:null}}const qse=m(1538,"Configure Unicode Highlight Options");let gW=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(ny.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=n.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=JA(h);let f;switch(c.reason.kind){case 0:{vy(c.reason.confusableWith)?f=m(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,JA(c.reason.confusableWith.codePointAt(0))):f=m(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,JA(c.reason.confusableWith.codePointAt(0)));break}case 1:f=m(1541,"The character {0} is invisible.",u);break;case 2:f=m(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const g={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m(1543,"Adjust settings"),_=eee(FE.ID,g),v=new cs("",!0).appendMarkdown(f).appendText(" ").appendLink(_,p,qse);o.push(new Oa(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return $Ae(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(`
|
|
914
|
-
`)}};gW=IH([Z1(1,Ga)],gW);function pW(s){return`U+${s.toString(16).padStart(4,"0")}`}function JA(s){let e=`\`${pW(s)}\``;return lp.isInvisibleCharacter(s)||(e+=` "${`${DWe(s)}`}"`),e}function DWe(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Kse(s,e){return LB.computeUnicodeHighlightReason(s,e)}const NT=class NT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=ze.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};NT.instance=new NT;let OE=NT;class EWe extends Ce{constructor(){super({id:n_.ID,label:G(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.includeComments,!1,2)}}class NWe extends Ce{constructor(){super({id:n_.ID,label:G(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.includeStrings,!1,2)}}const TT=class TT extends Dn{constructor(){super({id:TT.ID,title:G(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.ambiguousCharacters,!1,2)}};TT.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let n_=TT;const RT=class RT extends Dn{constructor(){super({id:RT.ID,title:G(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.invisibleCharacters,!1,2)}};RT.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let sy=RT;const MT=class MT extends Dn{constructor(){super({id:MT.ID,title:G(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.nonBasicASCII,!1,2)}};MT.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let oy=MT;const AT=class AT extends Dn{constructor(){super({id:AT.ID,title:G(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(_s),c=e.get(qe);function d(g){return lp.isInvisibleCharacter(g)?m(1549,"Exclude {0} (invisible character) from being highlighted",pW(g)):m(1550,"Exclude {0} from being highlighted",`${pW(g)} "${a}"`)}const h=[];if(n.kind===0)for(const g of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{RWe(c,[g])}});if(h.push({label:d(i),run:()=>TWe(c,[i])}),r){const g=new EWe;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new NWe;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(n.kind===0){const g=new n_;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===1){const g=new sy;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===2){const g=new oy;h.push({label:u(g),run:async()=>g.runAction(c)})}else MWe(n);const f=await l.pick(h,{title:qse});f&&await f.run()}};AT.ID="editor.action.unicodeHighlight.showExcludeOptions";let FE=AT;async function TWe(s,e){const t=s.getValue(po.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(po.allowedCharacters,i,2)}async function RWe(s,e){var n;const t=(n=s.inspect(po.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await s.updateValue(po.allowedLocales,i,2)}function MWe(s){throw new Error(`Unexpected value: ${s}`)}Et(n_);Et(sy);Et(oy);Et(FE);ht(ny.ID,ny,1);C_.register(gW);var AWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WG=function(s,e){return function(t,i){e(t,i,s)}};const Gse="ignoreUnusualLineTerminators";function PWe(s,e,t){s.setModelProperty(e.uri,Gse,t)}function OWe(s,e){return s.getModelProperty(e.uri,Gse)}var Wv;let WE=(Wv=class extends U{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||OWe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",fa(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){PWe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Wv.ID="editor.contrib.unusualLineTerminatorsDetector",Wv);WE=AWe([WG(1,Py),WG(2,gt)],WE);ht(WE.ID,WE,1);var FWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WWe=function(s,e){return function(t,i){e(t,i,s)}};class BG{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,Ak,!1).map(a=>({range:a.range,kind:zv.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const o=new Hi,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,Ak,!1).map(d=>({range:d.range,kind:zv.Text}));c&&o.set(a.uri,c)}return o}}let mW=class extends U{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new BG)),this._register(e.multiDocumentHighlightProvider.register("*",new BG))}};mW=FWe([WWe(0,Se)],mW);var Yse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mc=function(s,e){return function(t,i){e(t,i,s)}},vi,_W;const DH=new be("hasWordHighlights",!1);function Zse(s,e,t,i){const n=s.ordered(e);return rB(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Ki)),o=>o!=null).then(o=>{if(o){const r=new Hi;return r.set(e.uri,o),r}return new Hi})}function BWe(s,e,t,i,n){const o=s.ordered(e);return rB(o.map(r=>()=>{const a=n.filter(l=>wX(l)).filter(l=>N8(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Ki)}),r=>r!=null)}class Xse{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=an(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class HWe extends Xse{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Zse(this._providers,e,t.getPosition(),n).then(o=>o||new Hi)}}class VWe extends Xse{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return BWe(this._providers,e,t.getPosition(),n,this._otherModels).then(o=>o||new Hi)}}function zWe(s,e,t,i){return new HWe(e,t,i,s)}function UWe(s,e,t,i,n){return new VWe(e,t,i,s,n)}Io("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(Se),n=await Zse(i.documentHighlightProvider,e,t,et.None);return n==null?void 0:n.get(e.uri)});var hf;let bW=(hf=class{constructor(e,t,i,n,o,r,a,l){this.toUnhook=new Q,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Hi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ha(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=DH.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{KT(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():vi.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=vi.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":vi.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Oe.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Oe.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,vi.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);eo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);eo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=vi.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),vi.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||mf(n.getModel().uri,e))continue;const o=vi.storedDecorationIDs.get(n.getModel().uri);if(!o)continue;n.removeDecorations(o),i.push(n.getModel().uri);const r=Df.get(n);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)vi.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Oe.vscodeNotebookCell&&((i=(t=vi.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Oe.vscodeNotebookCell?(vi.query=null,this._run()):(n=vi.query)!=null&&n.modelInfo&&(vi.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Oe.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Oe.vscodeNotebookCell&&o.push(l)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!N6(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var n,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){vi.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn<c){vi.query=null,this._stopAll();return}vi.query={modelInfo:{modelURI:this.model.uri,selection:a}}}else if(!vi.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),mf(this.editor.getModel().uri,(n=vi.query.modelInfo)==null?void 0:n.modelURI)){if(!e){const d=this.decorations.getRanges();for(const h of d)if(h.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const l=this.getOtherModelsToHighlight(this.editor.getModel());if(!vi.query||!vi.query.modelInfo)return;const c=await this.textModelService.createModelReference(vi.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(c.object.textEditorModel,vi.query.modelInfo.selection,l),(o=this.workerRequest)==null||o.result.then(d=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Oe.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!vi.query||!vi.query.modelInfo)return;const l=await this.textModelService.createModelReference(vi.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,vi.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?UWe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):zWe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=Df.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=vi.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:b7e(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),vi.storedDecorationIDs=vi.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(n=r.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},vi=hf,hf.storedDecorationIDs=new Hi,hf.query=null,hf);bW=vi=Yse([mc(4,Os),mc(5,gt),mc(6,qe),mc(7,jt)],bW);var bm;let Df=(bm=class extends U{static get(e){return e.getContribution(_W.ID)}constructor(e,t,i,n,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Oe.accessibleView&&(this._wordHighlighter=new bW(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Oe.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},_W=bm,bm.ID="editor.contrib.wordHighlighter",bm);Df=_W=Yse([mc(1,Be),mc(2,Se),mc(3,gt),mc(4,Os),mc(5,qe),mc(6,jt)],Df);class Qse extends Ce{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Df.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class $We extends Qse{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:G(1572,"Go to Next Symbol Highlight"),precondition:DH,kbOpts:{kbExpr:P.editorTextFocus,primary:65,weight:100}})}}class jWe extends Qse{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:G(1573,"Go to Previous Symbol Highlight"),precondition:DH,kbOpts:{kbExpr:P.editorTextFocus,primary:1089,weight:100}})}}class qWe extends Ce{constructor(){super({id:"editor.action.wordHighlight.trigger",label:G(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:P.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Df.get(t);n&&n.restoreViewState(!0)}}ht(Df.ID,Df,0);pe($We);pe(jWe);pe(qWe);KC(mW);class w2 extends hn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ga(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new B(c.positionLineNumber,c.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>pt.fromModelSelection(c))),l.length===1){const c=new B(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new ve(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ve(t.lineNumber,t.column,t.lineNumber,t.column)}}class Wf extends w2{_move(e,t,i,n,o){return xt.moveWordLeft(e,t,i,n,o)}}class Bf extends w2{_move(e,t,i,n,o){return xt.moveWordRight(e,t,i,n)}}class KWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class GWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class YWe extends Wf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ZWe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class XWe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class QWe extends Wf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class JWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class eBe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class tBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class iBe extends Bf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class nBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class sBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class oBe extends Bf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class rBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class aBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class lBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class S2 extends hn{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e==null?void 0:e.get(di);if(!t.hasModel()||!n)return;const o=ga(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Zn(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class EH extends S2{_delete(e,t){const i=xt.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class NH extends S2{_delete(e,t){const i=xt.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class cBe extends EH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:P.writable})}}class dBe extends EH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:P.writable})}}class hBe extends EH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class uBe extends NH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:P.writable})}}class fBe extends NH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:P.writable})}}class gBe extends NH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class pBe extends Ce{constructor(){super({id:"deleteInsideWord",precondition:P.writable,label:G(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=ga(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=xt.deleteInsideWord(n,o,l);return new Zn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}_e(new KWe);_e(new GWe);_e(new YWe);_e(new ZWe);_e(new XWe);_e(new QWe);_e(new tBe);_e(new iBe);_e(new nBe);_e(new sBe);_e(new oBe);_e(new rBe);_e(new JWe);_e(new eBe);_e(new aBe);_e(new lBe);_e(new cBe);_e(new dBe);_e(new hBe);_e(new uBe);_e(new fBe);_e(new gBe);pe(pBe);class mBe extends S2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=DR.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class _Be extends S2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=DR.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class Jse extends w2{_move(e,t,i,n,o){return DR.moveWordPartLeft(e,t,i,o)}}class bBe extends Jse{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}dt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class vBe extends Jse{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}dt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class eoe extends w2{_move(e,t,i,n,o){return DR.moveWordPartRight(e,t,i)}}class CBe extends eoe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class wBe extends eoe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}_e(new mBe);_e(new _Be);_e(new bBe);_e(new vBe);_e(new CBe);_e(new wBe);const XH=class XH extends U{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=qo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new cs(m(1378,"Cannot edit in read-only input")):t=new cs(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};XH.ID="editor.contrib.readOnlyMessageController";let BE=XH;ht(BE.ID,BE,2);var SBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},HG=function(s,e){return function(t,i){e(t,i,s)}};let vW=class extends U{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=We(this,void 0);const n=Bo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Bo("_textModel.onDidChangeContent",ge.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(gs(async(r,a)=>{n.read(r),o.read(r);const l=a.add(new CNe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(WY(Jn(o=>o.range.endLineNumber-o.range.startLineNumber,$o))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};vW=SBe([HG(1,Se),HG(2,tx)],vW);DD.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(vW,s));var yBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eP=function(s,e){return function(t,i){e(t,i,s)}},Bv;let HE=(Bv=class extends U{constructor(e,t,i,n){super();const o=this._register(li(e)),r=this._register(n.createMenu(ye.EditorContent,e.contextKeyService)),a=Ct(this,r.onDidChange,()=>r.getActions().length===0);this._register(Ae(l=>{if(a.read(l))return;const d=ut("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(ES,d.root,ye.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof Ir))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends yf{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(Ae(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:zt(0),position:zt({preference:1})}))}))}},Bv.ID="editor.contrib.floatingToolbar",Bv);HE=yBe([eP(1,ke),eP(2,_t),eP(3,_a)],HE);ht(HE.ID,HE,1);const QH=class QH extends U{constructor(e){super(),this.editor=e,this.widget=null,da&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new CW(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};QH.ID="editor.contrib.iPadShowKeyboard";let VE=QH;const PT=class PT extends U{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(j(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(j(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return PT.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};PT.ID="editor.contrib.ShowKeyboardWidget";let CW=PT;ht(VE.ID,VE,3);var xBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VG=function(s,e){return function(t,i){e(t,i,s)}},wW,vm;let ry=(vm=class extends U{static get(e){return e.getContribution(wW.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(wi.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new SW(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},wW=vm,vm.ID="editor.contrib.inspectTokens",vm);ry=wW=xBe([VG(1,Fr),VG(2,Ii)],ry);class LBe extends Ce{constructor(){super({id:"editor.action.inspectTokens",label:GF.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=ry.get(t);i==null||i.launch()}}function kBe(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function IBe(s,e){const t=wi.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>Xv,tokenize:(n,o,r)=>TB(e,r),tokenizeEncoded:(n,o,r)=>mR(i,r)}}const OT=class OT extends U{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=IBe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return OT._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(l,c)}vn(this._domNode,he("h2.tm-token",void 0,kBe(r),he("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),re(this._domNode,he("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;re(this._domNode,he("table.tm-metadata-table",void 0,he("tbody",void 0,he("tr",void 0,he("td.tm-metadata-key",void 0,"language"),he("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"token type"),he("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"font style"),he("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"foreground"),he("td.tm-metadata-value",void 0,`${a?ee.Format.CSS.formatHex(a.foreground):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"background"),he("td.tm-metadata-value",void 0,`${a?ee.Format.CSS.formatHex(a.background):"-?-"}`))))),re(this._domNode,he("hr.tokens-inspect-separator")),i<t.tokens1.length&&re(this._domNode,he("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=wi.getColorMap(),i=ls.getLanguageId(e),n=ls.getTokenType(e),o=ls.getFontStyle(e),r=ls.getForeground(e),a=ls.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};OT._ID="editor.contrib.inspectTokensWidget";let SW=OT;ht(ry.ID,ry,4);pe(LBe);var DBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zG=function(s,e){return function(t,i){e(t,i,s)}},i1,Cm;let yW=(Cm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=mi.as(p_.Quickaccess)}provide(e){const t=new Q;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(i1.PREFIX.length));n&&n.prefix&&n.prefix!==i1.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==i1.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}},i1=Cm,Cm.PREFIX="?",Cm);yW=i1=DBe([zG(0,_s),zG(1,_t)],yW);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:yW,prefix:"",helpEntries:[{description:YF.helpQuickAccessActionLabel}]});class toe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const n=new Q;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new St);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Q,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=Jte(o);if(a){let l=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},n.add(ym(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}n.add(xe(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Dl(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return N6(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Si(NQ),position:Er.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const zg=class zg extends toe{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(zg.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(zg.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Q;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(zg.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(n);return}const g=this.toRange(h,u);n.revealRangeInCenter(g,0),this.addDecorations(n,g)},a=new Oh({title:m(1336,"Use Zero-Based Offset"),icon:oe.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:de(Dy),inputActiveOptionForeground:de(Ey),inputActiveOptionBackground:de(BC)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=Jte(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(xe(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var n,o;const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",a-1):m(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((n=r[0])==null?void 0:n.trim(),10);if(r.length<1||isNaN(l))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};zg.PREFIX=":",zg.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let xW=zg;var EBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UG=function(s,e){return function(t,i){e(t,i,s)}};let ay=class extends xW{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ay=EBe([UG(0,gt),UG(1,Fs)],ay);var wm;let ioe=(wm=class extends Ce{constructor(){super({id:wm.ID,label:YI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:P.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(_s).quickAccess.show(ay.PREFIX)}},wm.ID="editor.action.gotoLine",wm);pe(ioe);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:ay,prefix:ay.PREFIX,helpEntries:[{description:YI.gotoLineActionLabel,commandId:ioe.ID}]});const noe=[void 0,[]];function tP(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?NBe(s,n.values,t,i):soe(s,e,t,i)}function NBe(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=soe(s,r,t,i);if(typeof a!="number")return noe;n+=a,o.push(...l)}return[n,TBe(o)]}function soe(s,e,t,i){const n=Fm(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Oy(n)]:noe}function TBe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!RBe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function RBe(s,e){return!(s.end<e.start||e.end<s.start)}function $G(s){return s.startsWith('"')&&s.endsWith('"')}const ooe=" ";function LW(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=jG(s),o=t.indexOf(wl)>=0,r=$G(s);let a;const l=s.split(ooe);if(l.length>1)for(const c of l){const d=$G(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=jG(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function jG(s){let e;On?e=s.replace(/\//g,wl):e=s.replace(/\\/g,wl);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function qG(s){return Array.isArray(s)?LW(s.map(e=>e.original).join(ooe)):LW(s.original)}var MBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},KG=function(s,e){return function(t,i){e(t,i,s)}},Sk,pl;let wp=(pl=class extends toe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),U.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):U.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Q;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new o_,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(xe(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){var h;const r=e.editor,a=new Q;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new St),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new ni,i.busy=!0;try{const g=LW(i.value.substr(Sk.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const _=F0(p,v=>!!(v.type!=="separator"&&v.range&&I.containsPosition(v.range.decoration,u)));_&&(i.activeItems=[_])}}else g.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){var _,v;const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(Sk.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=qG(t.values[0]),d=qG(t.values.slice(1))):c=t;let h;const u=(v=(_=this.options)==null?void 0:_.openSideBySideDirection)==null?void 0:v.call(_);u&&(h=[{iconClass:u==="right"?Te.asClassName(oe.splitHorizontal):Te.asClassName(oe.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const f=[];for(let b=0;b<r.length;b++){const w=r[b],C=sde(w.name),S=`$(${Vk.toIcon(w.kind).id}) ${C}`,y=S.length-C.length;let x=w.containerName;i!=null&&i.extraContainerLabel&&(x?x=`${i.extraContainerLabel} • ${x}`:x=i.extraContainerLabel);let L,D,E,T;if(t.original.length>l){let A=!1;if(c!==t&&([L,D]=tP(S,{...t,values:void 0},l,y),typeof L=="number"&&(A=!0)),typeof L!="number"&&([L,D]=tP(S,c,l,y),typeof L!="number"))continue;if(!A&&d){if(x&&d.original.length>0&&([E,T]=tP(x,d)),typeof E!="number")continue;typeof L=="number"&&(L+=E)}}const N=w.tags&&w.tags.indexOf(1)>=0;f.push({index:b,kind:w.kind,score:L,label:S,ariaLabel:Xce(w.name,w.kind),description:x,highlights:N?void 0:{label:D,description:T},range:{selection:I.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:C,strikethrough:N,buttons:h})}const g=f.sort((b,w)=>a?this.compareByKindAndScore(b,w):this.compareByScore(b,w));let p=[];if(a){let S=function(){w&&typeof b=="number"&&C>0&&(w.label=Im(nP[b]||iP,C))},b,w,C=0;for(const y of g)b!==y.kind?(S(),b=y.kind,C=1,w={type:"separator"},p.push(w)):C++,p.push(y);S()}else g.length>0&&(p=[{label:m(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=nP[e.kind]||iP,n=nP[t.kind]||iP,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},Sk=pl,pl.PREFIX="@",pl.SCOPE_PREFIX=":",pl.PREFIX_BY_CATEGORY=`${pl.PREFIX}${pl.SCOPE_PREFIX}`,pl);wp=Sk=MBe([KG(0,Se),KG(1,tx)],wp);const iP=m(1352,"properties ({0})"),nP={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var ABe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sP=function(s,e){return function(t,i){e(t,i,s)}};let kW=class extends wp{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};kW=ABe([sP(0,gt),sP(1,Se),sP(2,tx)],kW);const FT=class FT extends Ce{constructor(){super({id:FT.ID,label:mS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:P.hasDocumentSymbolProvider,kbOpts:{kbExpr:P.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(_s).quickAccess.show(wp.PREFIX,{itemActivation:al.NONE})}};FT.ID="editor.action.quickOutline";let zE=FT;pe(zE);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:kW,prefix:wp.PREFIX,helpEntries:[{description:mS.quickOutlineActionLabel,prefix:wp.PREFIX,commandId:zE.ID},{description:mS.quickOutlineByCategoryActionLabel,prefix:wp.PREFIX_BY_CATEGORY}]});function PBe(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class X1{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return PBe(X1.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const o=X1.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=X1.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function OBe(s){var i;const e=s.slice(0);e.sort((n,o)=>o.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var Rb;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(Rb||(Rb={}));function oP(s){const e=s;return Array.isArray(e.items)}function GG(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class FBe extends U{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const n=new Q;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new St),a=async()=>{var _;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new Q;o=d.add(new ni(t));const h=o.token;let u=e.value.substring(this.prefix.length);(_=this.options)!=null&&_.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(v,b)=>{var S;let w,C;if(oP(v)?(w=v.items,C=v.active):w=v,w.length===0){if(b)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(Sm(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async v=>{let b=!1,w=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Oc(v.mergeDelay),h.isCancellationRequested)||w||(b=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await v.additionalPicks;if(h.isCancellationRequested)return;let S,y;oP(v.picks)?(S=v.picks.items,y=v.picks.active):S=v.picks;let x,L;if(oP(C)?(x=C.items,L=C.active):x=C,x.length>0||!b){let D;if(!y&&!L){const E=e.activeItems[0];E&&S.indexOf(E)!==-1&&(D=E)}g({items:[...S,...x],active:y||L||D})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(GG(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(h.isCancellationRequested)return;GG(v)?await p(v):g(v)}finally{h.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case Rb.NO_ACTION:break;case Rb.CLOSE_PICKER:e.hide();break;case Rb.REFRESH_PICKER:a();break;case Rb.REMOVE_ITEM:{const _=e.items.indexOf(h);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),w=e.activeItems.filter(S=>S!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),n.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),n}}new qa(1e4);const WBe=new qa(1e4);function BBe(s){return VBe(s,"NFD",WBe)}const HBe=/[^\u0000-\u0080]/;function VBe(s,e,t){if(!s)return s;const i=t.get(s);if(i)return i;let n;return HBe.test(s)?n=s.normalize(e):n=s,t.set(s,n),n}const zBe=function(){const s=/[\u0300-\u036f]/g;return function(e){return BBe(e).replace(s,"")}}();var roe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pu=function(s,e){return function(t,i){e(t,i,s)}},gg,en,xc;let IW=(xc=class extends FBe{constructor(e,t,i,n,o,r){super(gg.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(DW)),this.options=e}async _getPicks(e,t,i,n){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=ym(()=>{const _=new X1;_.updateDocuments(o.map(b=>({key:b.commandId,textChunks:[this.getTfIdfChunk(b)]})));const v=_.calculateScores(e,i);return OBe(v).filter(b=>b.score>gg.TFIDF_THRESHOLD).slice(0,gg.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const _ of o){_.labelNoAccents??(_.labelNoAccents=this.normalizeForFiltering(_.label));const v=gg.WORD_FILTER(a,_.labelNoAccents)??void 0;let b;if(_.commandAlias&&(_.aliasNoAccents??(_.aliasNoAccents=this.normalizeForFiltering(_.commandAlias)),b=gg.WORD_FILTER(a,_.aliasNoAccents)??void 0),v||b)_.highlights={label:v,detail:this.options.showAlias?b:void 0},l.push(_);else if(e===_.commandId)l.push(_);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===_.commandId);C&&(_.tfIdfScore=C.score,l.push(_))}}const c=new Map;for(const _ of l){const v=c.get(_.label);v?(_.description=_.commandId,v.description=v.commandId):c.set(_.label,_)}l.sort((_,v)=>{if(_.tfIdfScore&&v.tfIdfScore)return _.tfIdfScore===v.tfIdfScore?_.label.localeCompare(v.label):v.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(v.tfIdfScore)return-1;const b=this.commandsHistory.peek(_.commandId),w=this.commandsHistory.peek(v.commandId);if(b&&w)return b>w?-1:1;if(b)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(_.commandId),x=this.options.suggestedCommandIds.has(v.commandId);if(y&&x)return 0;if(y)return-1;if(x)return 1}const C=_.commandCategory===oW.Developer.value,S=v.commandCategory===oW.Developer.value;return C&&!S?1:!C&&S?-1:_.label.localeCompare(v.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let _=0;_<l.length;_++){const v=l[_];_===0&&this.commandsHistory.peek(v.commandId)&&(d.push({type:"separator",label:m(1740,"recently used")}),h=!0),u&&v.tfIdfScore!==void 0&&(d.push({type:"separator",label:m(1741,"similar commands")}),u=!1),f&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&((g=this.options.suggestedCommandIds)!=null&&g.has(v.commandId))&&(d.push({type:"separator",label:m(1742,"commonly used")}),h=!0,f=!1),h&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&!((p=this.options.suggestedCommandIds)!=null&&p.has(v.commandId))&&(d.push({type:"separator",label:m(1743,"other commands")}),h=!1),d.push(this.toCommandPick(v,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var b;const _=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const v=_.map(w=>this.toCommandPick(w,n));return u&&((b=v[0])==null?void 0:b.type)!=="separator"&&v.unshift({type:"separator",label:m(1744,"similar commands")}),v})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){Ar(r)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),PD(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=zBe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},gg=xc,xc.PREFIX=">",xc.TFIDF_THRESHOLD=.5,xc.TFIDF_MAX_RESULTS=5,xc.WORD_FILTER=R8(cS,QSe,UJ),xc);IW=gg=roe([pu(1,ke),pu(2,_t),pu(3,qt),pu(4,vs),pu(5,Py)],IW);var ml;let DW=(ml=class extends U{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Vu.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=en.getConfiguredCommandHistoryLength(this.configurationService),en.cache&&en.cache.limit!==this.configuredCommandsHistoryLength&&(en.cache.limit=this.configuredCommandsHistoryLength,en.hasChanges=!0))}load(){const e=this.storageService.get(en.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=en.cache=new qa(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}en.counter=this.storageService.getNumber(en.PREF_KEY_COUNTER,0,en.counter)}push(e){en.cache&&(en.cache.set(e,en.counter++),en.hasChanges=!0)}peek(e){var t;return(t=en.cache)==null?void 0:t.peek(e)}saveState(){if(!en.cache||!en.hasChanges)return;const e={usesLRU:!0,entries:[]};en.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(en.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(en.PREF_KEY_COUNTER,en.counter,0,0),en.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,o;const i=(o=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:en.DEFAULT_COMMANDS_HISTORY_LENGTH}},en=ml,ml.DEFAULT_COMMANDS_HISTORY_LENGTH=50,ml.PREF_KEY_CACHE="commandPalette.mru.cache",ml.PREF_KEY_COUNTER="commandPalette.mru.counter",ml.counter=1,ml.hasChanges=!1,ml);DW=en=roe([pu(0,Fs),pu(1,qe),pu(2,jt)],DW);class UBe extends IW{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let o;(i=n.metadata)!=null&&i.description&&(Hke(n.metadata.description)?o=n.metadata.description:o={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:o,label:W8(n.label)||n.id})}return t}}var $Be=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Z_=function(s,e){return function(t,i){e(t,i,s)}};let ly=class extends UBe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};ly=$Be([Z_(0,ke),Z_(1,gt),Z_(2,_t),Z_(3,qt),Z_(4,vs),Z_(5,Py)],ly);const WT=class WT extends Ce{constructor(){super({id:WT.ID,label:ZI.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:P.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(_s).quickAccess.show(ly.PREFIX)}};WT.ID="editor.action.quickCommand";let UE=WT;pe(UE);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:ly,prefix:ly.PREFIX,helpEntries:[{description:ZI.quickCommandHelp,commandId:UE.ID}]});var jBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},X_=function(s,e){return function(t,i){e(t,i,s)}};let EW=class extends Jm{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};EW=jBe([X_(1,Be),X_(2,gt),X_(3,Di),X_(4,ke),X_(5,Fs),X_(6,qe)],EW);ht(Jm.ID,EW,4);class qBe extends Ce{constructor(){super({id:"editor.action.toggleHighContrast",label:XF.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Fr),n=i.getColorTheme();xl(n.type)?(i.setTheme(this._originalThemeName||(wh(n.type)?bv:Wd)),this._originalThemeName=null):(i.setTheme(wh(n.type)?bp:vp),this._originalThemeName=n.themeName)}}pe(qBe);const aoe={},rP={};class TH{static getOrCreate(e){return rP[e]||(rP[e]=new TH(e)),rP[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,aoe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function KBe(s){const e=s.id;aoe[e]=s,kb.register(s);const t=TH.getOrCreate(e);kb.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),kb.onLanguageEncountered(e,async()=>{const i=await t.load();kb.setLanguageConfiguration(e,i.conf)})}KBe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>l2e(()=>import("./yaml-C-D6Mpno.js"),__vite__mapDeps([0,1]),import.meta.url)});globalThis.MonacoEnvironment={getWorker:()=>new Worker(new URL(""+new URL("editor.worker-CKy7Pnvo.js",import.meta.url).href,import.meta.url),{type:"module"})};FW.config({monaco:o2e});var NW={},YG=yre;NW.createRoot=YG.createRoot,NW.hydrateRoot=YG.hydrateRoot;function GBe(s,e){return e.find(t=>t.repository===s)}function loe(s,e){const t=GBe(s,e);if(!t)return;const i=t.name.indexOf("/");return i>0?{project:t.name.slice(0,i),repoName:t.name.slice(i+1),ref:t.ref}:{repoName:t.name,ref:t.ref}}function coe(s){let e=s,t;const i=e.lastIndexOf("@");return i>0&&(t=e.slice(i+1),e=e.slice(0,i),t==="self"&&(t=void 0)),e=e.replace(/\\/g,"/"),e=e.replace(/^\.\//,""),{normalizedPath:e,repoAlias:t}}function Lv(s,e,t,i=!1,n={},o){const{normalizedPath:r,repoAlias:a}=coe(s);return{rawPath:s,normalizedPath:r,repoAlias:a,contextRepoAlias:a??n.contextRepoAlias,sourcePath:n.sourcePath,parameters:t,location:e,conditional:i,conditionExpression:o}}function Sp(s){return s.repoAlias??s.contextRepoAlias}function doe(s){if(s.normalizedPath.startsWith("/"))return{primary:s.normalizedPath};if(s.repoAlias||!s.sourcePath)return{primary:s.normalizedPath};const e=YBe(s.sourcePath);if(!e)return{primary:s.normalizedPath};const t=hoe(`${e}/${s.normalizedPath}`);return t===s.normalizedPath?{primary:t}:{primary:t,fallback:s.normalizedPath}}function YBe(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t<0?"":t===0?"/":e.slice(0,t)}function hoe(s){const e=s.startsWith("/"),t=s.split("/").filter(o=>o!==""&&o!=="."),i=[];for(const o of t)o===".."?i.length>0&&i[i.length-1]!==".."?i.pop():e||i.push(o):i.push(o);const n=i.join("/");return e?`/${n}`:n}function ZBe(s){try{const e=new URL(s);if(!e.hostname.endsWith("dev.azure.com"))return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<4||t[2]!=="_git")return null;const i=decodeURIComponent(t[0]),n=decodeURIComponent(t[1]),o=decodeURIComponent(t[3]),r=e.searchParams.get("path")||"",a=e.searchParams.get("version");let l,c;return a!=null&&a.startsWith("GB")?(l=a.slice(2),c=`refs/heads/${l}`):a!=null&&a.startsWith("GT")&&(c=`refs/tags/${a.slice(2)}`),r?{org:i,project:n,repoName:o,filePath:r,branch:l,ref:c}:null}catch{return null}}function uoe(s){var i,n;const e=`https://dev.azure.com/${encodeURIComponent(s.org)}/${encodeURIComponent(s.project)}/_git/${encodeURIComponent(s.repoName)}`,t=new URLSearchParams({path:s.filePath});return(i=s.ref)!=null&&i.startsWith("refs/tags/")?t.set("version",`GT${s.ref.replace("refs/tags/","")}`):(n=s.ref)!=null&&n.startsWith("refs/heads/")?t.set("version",`GB${s.ref.replace("refs/heads/","")}`):s.branch&&t.set("version",`GB${s.branch}`),`${e}?${t}`}function XBe(s){const e=[];let t=0;for(;t<s.length;){if(/\s/.test(s[t])){t++;continue}if(s[t]==="'"){let i="";for(t++;t<s.length&&s[t]!=="'";)s[t]==="\\"&&t+1<s.length&&t++,i+=s[t],t++;t++,e.push({type:"STRING",value:i});continue}if(s[t]==="("){e.push({type:"LPAREN",value:"("}),t++;continue}if(s[t]===")"){e.push({type:"RPAREN",value:")"}),t++;continue}if(s[t]===","){e.push({type:"COMMA",value:","}),t++;continue}if(s[t]==="."){e.push({type:"DOT",value:"."}),t++;continue}if(s[t]==="["){e.push({type:"LBRACKET",value:"["}),t++;continue}if(s[t]==="]"){e.push({type:"RBRACKET",value:"]"}),t++;continue}if(/\d/.test(s[t])||s[t]==="-"&&t+1<s.length&&/\d/.test(s[t+1])){let i="";for(s[t]==="-"&&(i+="-",t++);t<s.length&&/[\d.]/.test(s[t]);)i+=s[t],t++;e.push({type:"NUMBER",value:i});continue}if(/[a-zA-Z_]/.test(s[t])){let i="";for(;t<s.length&&/[a-zA-Z0-9_]/.test(s[t]);)i+=s[t],t++;i==="true"||i==="false"?e.push({type:"BOOL",value:i}):i==="null"?e.push({type:"NULL",value:"null"}):e.push({type:"IDENT",value:i});continue}t++}return e}class QBe{constructor(e){Pi(this,"tokens");Pi(this,"pos",0);this.tokens=e}parse(){return this.parseExpression()}peek(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(e){const t=this.advance();if(!t||t.type!==e)throw new Error(`Expected ${e} but got ${(t==null?void 0:t.type)??"EOF"} (${t==null?void 0:t.value})`);return t}parseExpression(){const e=this.peek();if(!e)throw new Error("Unexpected end of expression");switch(e.type){case"STRING":return this.advance(),{kind:"string",value:e.value};case"NUMBER":return this.advance(),{kind:"number",value:Number(e.value)};case"BOOL":return this.advance(),{kind:"boolean",value:e.value==="true"};case"NULL":return this.advance(),{kind:"null"};case"IDENT":return this.parseIdentifierOrCall();default:throw new Error(`Unexpected token: ${e.type} (${e.value})`)}}parseIdentifierOrCall(){var t,i,n,o,r,a,l,c;const e=this.advance();if(((t=this.peek())==null?void 0:t.type)==="LPAREN"){this.advance();const d=[];if(((i=this.peek())==null?void 0:i.type)!=="RPAREN")for(d.push(this.parseExpression());((n=this.peek())==null?void 0:n.type)==="COMMA";)this.advance(),d.push(this.parseExpression());return this.expect("RPAREN"),{kind:"functionCall",name:e.value,args:d}}if(((o=this.peek())==null?void 0:o.type)==="DOT"){const d=[e.value];for(;((r=this.peek())==null?void 0:r.type)==="DOT";){this.advance();const h=this.peek();if((h==null?void 0:h.type)==="IDENT")d.push(this.advance().value);else if((h==null?void 0:h.type)==="BOOL")d.push(this.advance().value);else break}for(;((a=this.peek())==null?void 0:a.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}if(((l=this.peek())==null?void 0:l.type)==="LBRACKET"){const d=[e.value];for(;((c=this.peek())==null?void 0:c.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}return{kind:"identifier",name:e.value}}}function ZG(s,e){let t=s;for(const i of e){if(t==null||typeof t!="object")return;t=t[i]}return t}function Ui(s){return s==null?"":typeof s=="boolean"?s?"True":"False":typeof s=="object"?JSON.stringify(s):String(s)}function aP(s){return typeof s=="boolean"?s:typeof s=="string"?s!==""&&s.toLowerCase()!=="false":typeof s=="number"?s!==0:s!=null}function ML(s,e){return s==null&&e==null?!0:s==null||e==null?!1:typeof s=="boolean"&&typeof e=="string"?s===(e.toLowerCase()==="true"):typeof e=="boolean"&&typeof s=="string"?e===(s.toLowerCase()==="true"):typeof s=="string"&&typeof e=="string"?s.toLowerCase()===e.toLowerCase():s===e}const JBe={coalesce:s=>{for(const e of s)if(e!=null&&e!=="")return e;return null},eq:s=>ML(s[0],s[1]),ne:s=>!ML(s[0],s[1]),and:s=>s.every(aP),or:s=>s.some(aP),not:s=>!aP(s[0]),gt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>t:Ui(e)>Ui(t)},ge:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>=t:Ui(e)>=Ui(t)},lt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<t:Ui(e)<Ui(t)},le:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<=t:Ui(e)<=Ui(t)},replace:s=>{const e=Ui(s[0]),t=Ui(s[1]),i=Ui(s[2]);return e.split(t).join(i)},in:s=>{const e=s[0];return s.slice(1).some(i=>ML(e,i))},startswith:s=>Ui(s[0]).toLowerCase().startsWith(Ui(s[1]).toLowerCase()),endswith:s=>Ui(s[0]).toLowerCase().endsWith(Ui(s[1]).toLowerCase()),contains:s=>{const e=s[0],t=Ui(s[1]);return Array.isArray(e)?e.some(i=>ML(i,t)):Ui(e).toLowerCase().includes(t.toLowerCase())},join:s=>{const e=Ui(s[0]),t=s.slice(1);return t.length===1&&Array.isArray(t[0])?t[0].map(Ui).join(e):t.map(Ui).join(e)},lower:s=>Ui(s[0]).toLowerCase(),upper:s=>Ui(s[0]).toUpperCase(),length:s=>{const e=s[0];return typeof e=="string"||Array.isArray(e)?e.length:e&&typeof e=="object"?Object.keys(e).length:0},format:s=>{let e=Ui(s[0]);for(let t=1;t<s.length;t++)e=e.split(`{${t-1}}`).join(Ui(s[t]));return e},converttojson:s=>{const e=s[0];return e==null?"null":JSON.stringify(e)},counter:s=>Ui(s[0])};function TW(s,e){switch(s.kind){case"string":return s.value;case"number":return s.value;case"boolean":return s.value;case"null":return null;case"parameterAccess":return ZG(e.parameters??{},s.path);case"variableAccess":return ZG(e.variables??{},s.path);case"identifier":return s.name;case"functionCall":{const t=JBe[s.name.toLowerCase()];if(!t){const n=s.args.map(o=>TW(o,e));return`${s.name}(${n.map(Ui).join(", ")})`}const i=s.args.map(n=>TW(n,e));return t(i,e)}}}function foe(s,e={}){const t=s.trim();if(!t)return"";try{const i=XBe(t);if(i.length===0)return"";const o=new QBe(i).parse();return TW(o,e)}catch{return s}}function goe(s,e={}){const t=/\$\{\{\s*(.*?)\s*\}\}/g,i=[],n=[];let o=!1;return{result:s.replace(t,(a,l)=>{o=!0;const c=foe(l,e),d=Ui(c);return/\$\{\{/.test(d)||c===l||c===void 0?(n.push(l),a):(i.push(l),d)}),hadExpressions:o,isFullyResolved:o&&n.length===0,substituted:i,unresolved:n}}function yp(s){return/\$\{\{.*?\}\}/.test(s)}function $E(s,e,t,i){if(!yp(s))return{resolvedPath:s,isFullyResolved:!0,hadExpressions:!1,substituted:[],unresolved:[]};const o={parameters:{...e??{}},variables:i},{result:r,hadExpressions:a,isFullyResolved:l,substituted:c,unresolved:d}=goe(s,o);return{resolvedPath:r,isFullyResolved:a?l:!0,hadExpressions:a,substituted:c,unresolved:d}}function lP(s){const e=s.parameters;if(!Array.isArray(e))return{};const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"default"in i){const n=i;t[n.name]=n.default}return t}function XG(s){const e=s.parameters;return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object"&&"name"in t&&typeof t.name=="string").map(t=>t.name):[]}function AL(s){const e=s.variables;if(!e)return{};if(Array.isArray(e)){const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"value"in i){const n=i;t[n.name]=String(n.value)}return t}if(typeof e=="object"){const t={};for(const[i,n]of Object.entries(e))t[i]=String(n);return t}return{}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function poe(s){return typeof s>"u"||s===null}function e8e(s){return typeof s=="object"&&s!==null}function t8e(s){return Array.isArray(s)?s:poe(s)?[]:[s]}function i8e(s,e){var t,i,n,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)n=o[t],s[n]=e[n];return s}function n8e(s,e){var t="",i;for(i=0;i<e;i+=1)t+=s;return t}function s8e(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}var o8e=poe,r8e=e8e,a8e=t8e,l8e=n8e,c8e=s8e,d8e=i8e,us={isNothing:o8e,isObject:r8e,toArray:a8e,repeat:l8e,isNegativeZero:c8e,extend:d8e};function moe(s,e){var t="",i=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(t+='in "'+s.mark.name+'" '),t+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!e&&s.mark.snippet&&(t+=`
|
|
914
|
+
`)}};gW=IH([Z1(1,Ga)],gW);function pW(s){return`U+${s.toString(16).padStart(4,"0")}`}function JA(s){let e=`\`${pW(s)}\``;return lp.isInvisibleCharacter(s)||(e+=` "${`${DWe(s)}`}"`),e}function DWe(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Kse(s,e){return LB.computeUnicodeHighlightReason(s,e)}const NT=class NT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=ze.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};NT.instance=new NT;let OE=NT;class EWe extends Ce{constructor(){super({id:n_.ID,label:G(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.includeComments,!1,2)}}class NWe extends Ce{constructor(){super({id:n_.ID,label:G(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.includeStrings,!1,2)}}const TT=class TT extends Dn{constructor(){super({id:TT.ID,title:G(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.ambiguousCharacters,!1,2)}};TT.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let n_=TT;const RT=class RT extends Dn{constructor(){super({id:RT.ID,title:G(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.invisibleCharacters,!1,2)}};RT.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let sy=RT;const MT=class MT extends Dn{constructor(){super({id:MT.ID,title:G(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(po.nonBasicASCII,!1,2)}};MT.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let oy=MT;const AT=class AT extends Dn{constructor(){super({id:AT.ID,title:G(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(_s),c=e.get(qe);function d(g){return lp.isInvisibleCharacter(g)?m(1549,"Exclude {0} (invisible character) from being highlighted",pW(g)):m(1550,"Exclude {0} from being highlighted",`${pW(g)} "${a}"`)}const h=[];if(n.kind===0)for(const g of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{RWe(c,[g])}});if(h.push({label:d(i),run:()=>TWe(c,[i])}),r){const g=new EWe;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new NWe;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(n.kind===0){const g=new n_;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===1){const g=new sy;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===2){const g=new oy;h.push({label:u(g),run:async()=>g.runAction(c)})}else MWe(n);const f=await l.pick(h,{title:qse});f&&await f.run()}};AT.ID="editor.action.unicodeHighlight.showExcludeOptions";let FE=AT;async function TWe(s,e){const t=s.getValue(po.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(po.allowedCharacters,i,2)}async function RWe(s,e){var n;const t=(n=s.inspect(po.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await s.updateValue(po.allowedLocales,i,2)}function MWe(s){throw new Error(`Unexpected value: ${s}`)}Et(n_);Et(sy);Et(oy);Et(FE);ht(ny.ID,ny,1);C_.register(gW);var AWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WG=function(s,e){return function(t,i){e(t,i,s)}};const Gse="ignoreUnusualLineTerminators";function PWe(s,e,t){s.setModelProperty(e.uri,Gse,t)}function OWe(s,e){return s.getModelProperty(e.uri,Gse)}var Wv;let WE=(Wv=class extends U{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||OWe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",fa(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){PWe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Wv.ID="editor.contrib.unusualLineTerminatorsDetector",Wv);WE=AWe([WG(1,Py),WG(2,gt)],WE);ht(WE.ID,WE,1);var FWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WWe=function(s,e){return function(t,i){e(t,i,s)}};class BG{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,Ak,!1).map(a=>({range:a.range,kind:zv.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const o=new Hi,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,Ak,!1).map(d=>({range:d.range,kind:zv.Text}));c&&o.set(a.uri,c)}return o}}let mW=class extends U{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new BG)),this._register(e.multiDocumentHighlightProvider.register("*",new BG))}};mW=FWe([WWe(0,Se)],mW);var Yse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mc=function(s,e){return function(t,i){e(t,i,s)}},vi,_W;const DH=new be("hasWordHighlights",!1);function Zse(s,e,t,i){const n=s.ordered(e);return rB(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Ki)),o=>o!=null).then(o=>{if(o){const r=new Hi;return r.set(e.uri,o),r}return new Hi})}function BWe(s,e,t,i,n){const o=s.ordered(e);return rB(o.map(r=>()=>{const a=n.filter(l=>wX(l)).filter(l=>N8(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Ki)}),r=>r!=null)}class Xse{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=an(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class HWe extends Xse{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Zse(this._providers,e,t.getPosition(),n).then(o=>o||new Hi)}}class VWe extends Xse{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return BWe(this._providers,e,t.getPosition(),n,this._otherModels).then(o=>o||new Hi)}}function zWe(s,e,t,i){return new HWe(e,t,i,s)}function UWe(s,e,t,i,n){return new VWe(e,t,i,s,n)}Io("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(Se),n=await Zse(i.documentHighlightProvider,e,t,et.None);return n==null?void 0:n.get(e.uri)});var hf;let bW=(hf=class{constructor(e,t,i,n,o,r,a,l){this.toUnhook=new Q,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Hi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ha(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=DH.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{KT(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():vi.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=vi.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":vi.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Oe.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Oe.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,vi.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);eo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);eo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=vi.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),vi.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||mf(n.getModel().uri,e))continue;const o=vi.storedDecorationIDs.get(n.getModel().uri);if(!o)continue;n.removeDecorations(o),i.push(n.getModel().uri);const r=Df.get(n);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)vi.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Oe.vscodeNotebookCell&&((i=(t=vi.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Oe.vscodeNotebookCell?(vi.query=null,this._run()):(n=vi.query)!=null&&n.modelInfo&&(vi.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Oe.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Oe.vscodeNotebookCell&&o.push(l)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!N6(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var n,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){vi.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn<c){vi.query=null,this._stopAll();return}vi.query={modelInfo:{modelURI:this.model.uri,selection:a}}}else if(!vi.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),mf(this.editor.getModel().uri,(n=vi.query.modelInfo)==null?void 0:n.modelURI)){if(!e){const d=this.decorations.getRanges();for(const h of d)if(h.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const l=this.getOtherModelsToHighlight(this.editor.getModel());if(!vi.query||!vi.query.modelInfo)return;const c=await this.textModelService.createModelReference(vi.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(c.object.textEditorModel,vi.query.modelInfo.selection,l),(o=this.workerRequest)==null||o.result.then(d=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Oe.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!vi.query||!vi.query.modelInfo)return;const l=await this.textModelService.createModelReference(vi.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,vi.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?UWe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):zWe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=Df.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=vi.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:b7e(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),vi.storedDecorationIDs=vi.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(n=r.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},vi=hf,hf.storedDecorationIDs=new Hi,hf.query=null,hf);bW=vi=Yse([mc(4,Os),mc(5,gt),mc(6,qe),mc(7,jt)],bW);var bm;let Df=(bm=class extends U{static get(e){return e.getContribution(_W.ID)}constructor(e,t,i,n,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Oe.accessibleView&&(this._wordHighlighter=new bW(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Oe.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},_W=bm,bm.ID="editor.contrib.wordHighlighter",bm);Df=_W=Yse([mc(1,Be),mc(2,Se),mc(3,gt),mc(4,Os),mc(5,qe),mc(6,jt)],Df);class Qse extends Ce{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Df.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class $We extends Qse{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:G(1572,"Go to Next Symbol Highlight"),precondition:DH,kbOpts:{kbExpr:P.editorTextFocus,primary:65,weight:100}})}}class jWe extends Qse{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:G(1573,"Go to Previous Symbol Highlight"),precondition:DH,kbOpts:{kbExpr:P.editorTextFocus,primary:1089,weight:100}})}}class qWe extends Ce{constructor(){super({id:"editor.action.wordHighlight.trigger",label:G(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:P.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Df.get(t);n&&n.restoreViewState(!0)}}ht(Df.ID,Df,0);pe($We);pe(jWe);pe(qWe);KC(mW);class w2 extends hn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ga(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new B(c.positionLineNumber,c.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>pt.fromModelSelection(c))),l.length===1){const c=new B(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new ve(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ve(t.lineNumber,t.column,t.lineNumber,t.column)}}class Wf extends w2{_move(e,t,i,n,o){return xt.moveWordLeft(e,t,i,n,o)}}class Bf extends w2{_move(e,t,i,n,o){return xt.moveWordRight(e,t,i,n)}}class KWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class GWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class YWe extends Wf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ZWe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class XWe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class QWe extends Wf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class JWe extends Wf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class eBe extends Wf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class tBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class iBe extends Bf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class nBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class sBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class oBe extends Bf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(P.textInputFocus,(e=ne.and(OC,qR))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class rBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class aBe extends Bf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class lBe extends Bf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ga(Ds.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class S2 extends hn{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e==null?void 0:e.get(di);if(!t.hasModel()||!n)return;const o=ga(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Zn(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class EH extends S2{_delete(e,t){const i=xt.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class NH extends S2{_delete(e,t){const i=xt.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class cBe extends EH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:P.writable})}}class dBe extends EH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:P.writable})}}class hBe extends EH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class uBe extends NH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:P.writable})}}class fBe extends NH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:P.writable})}}class gBe extends NH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class pBe extends Ce{constructor(){super({id:"deleteInsideWord",precondition:P.writable,label:G(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=ga(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=xt.deleteInsideWord(n,o,l);return new Zn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}_e(new KWe);_e(new GWe);_e(new YWe);_e(new ZWe);_e(new XWe);_e(new QWe);_e(new tBe);_e(new iBe);_e(new nBe);_e(new sBe);_e(new oBe);_e(new rBe);_e(new JWe);_e(new eBe);_e(new aBe);_e(new lBe);_e(new cBe);_e(new dBe);_e(new hBe);_e(new uBe);_e(new fBe);_e(new gBe);pe(pBe);class mBe extends S2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=DR.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class _Be extends S2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:P.writable,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=DR.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class Jse extends w2{_move(e,t,i,n,o){return DR.moveWordPartLeft(e,t,i,o)}}class bBe extends Jse{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}dt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class vBe extends Jse{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}dt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class eoe extends w2{_move(e,t,i,n,o){return DR.moveWordPartRight(e,t,i)}}class CBe extends eoe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class wBe extends eoe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:P.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}_e(new mBe);_e(new _Be);_e(new bBe);_e(new vBe);_e(new CBe);_e(new wBe);const XH=class XH extends U{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=qo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new cs(m(1378,"Cannot edit in read-only input")):t=new cs(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};XH.ID="editor.contrib.readOnlyMessageController";let BE=XH;ht(BE.ID,BE,2);var SBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},HG=function(s,e){return function(t,i){e(t,i,s)}};let vW=class extends U{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=We(this,void 0);const n=Bo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Bo("_textModel.onDidChangeContent",ge.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(gs(async(r,a)=>{n.read(r),o.read(r);const l=a.add(new CNe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(WY(Jn(o=>o.range.endLineNumber-o.range.startLineNumber,$o))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};vW=SBe([HG(1,Se),HG(2,tx)],vW);DD.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(vW,s));var yBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eP=function(s,e){return function(t,i){e(t,i,s)}},Bv;let HE=(Bv=class extends U{constructor(e,t,i,n){super();const o=this._register(li(e)),r=this._register(n.createMenu(ye.EditorContent,e.contextKeyService)),a=Ct(this,r.onDidChange,()=>r.getActions().length===0);this._register(Ae(l=>{if(a.read(l))return;const d=ut("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(ES,d.root,ye.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof Ir))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends yf{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(Ae(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:zt(0),position:zt({preference:1})}))}))}},Bv.ID="editor.contrib.floatingToolbar",Bv);HE=yBe([eP(1,ke),eP(2,_t),eP(3,_a)],HE);ht(HE.ID,HE,1);const QH=class QH extends U{constructor(e){super(),this.editor=e,this.widget=null,da&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new CW(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};QH.ID="editor.contrib.iPadShowKeyboard";let VE=QH;const PT=class PT extends U{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(j(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(j(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return PT.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};PT.ID="editor.contrib.ShowKeyboardWidget";let CW=PT;ht(VE.ID,VE,3);var xBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VG=function(s,e){return function(t,i){e(t,i,s)}},wW,vm;let ry=(vm=class extends U{static get(e){return e.getContribution(wW.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(wi.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new SW(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},wW=vm,vm.ID="editor.contrib.inspectTokens",vm);ry=wW=xBe([VG(1,Fr),VG(2,Ii)],ry);class LBe extends Ce{constructor(){super({id:"editor.action.inspectTokens",label:GF.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=ry.get(t);i==null||i.launch()}}function kBe(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function IBe(s,e){const t=wi.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>Xv,tokenize:(n,o,r)=>TB(e,r),tokenizeEncoded:(n,o,r)=>mR(i,r)}}const OT=class OT extends U{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=IBe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return OT._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(l,c)}vn(this._domNode,he("h2.tm-token",void 0,kBe(r),he("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),re(this._domNode,he("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;re(this._domNode,he("table.tm-metadata-table",void 0,he("tbody",void 0,he("tr",void 0,he("td.tm-metadata-key",void 0,"language"),he("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"token type"),he("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"font style"),he("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"foreground"),he("td.tm-metadata-value",void 0,`${a?ee.Format.CSS.formatHex(a.foreground):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"background"),he("td.tm-metadata-value",void 0,`${a?ee.Format.CSS.formatHex(a.background):"-?-"}`))))),re(this._domNode,he("hr.tokens-inspect-separator")),i<t.tokens1.length&&re(this._domNode,he("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=wi.getColorMap(),i=ls.getLanguageId(e),n=ls.getTokenType(e),o=ls.getFontStyle(e),r=ls.getForeground(e),a=ls.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};OT._ID="editor.contrib.inspectTokensWidget";let SW=OT;ht(ry.ID,ry,4);pe(LBe);var DBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zG=function(s,e){return function(t,i){e(t,i,s)}},i1,Cm;let yW=(Cm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=mi.as(p_.Quickaccess)}provide(e){const t=new Q;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(i1.PREFIX.length));n&&n.prefix&&n.prefix!==i1.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==i1.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}},i1=Cm,Cm.PREFIX="?",Cm);yW=i1=DBe([zG(0,_s),zG(1,_t)],yW);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:yW,prefix:"",helpEntries:[{description:YF.helpQuickAccessActionLabel}]});class toe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const n=new Q;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new St);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Q,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=Jte(o);if(a){let l=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},n.add(ym(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}n.add(xe(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Dl(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return N6(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Si(NQ),position:Er.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const zg=class zg extends toe{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(zg.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(zg.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Q;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(zg.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(n);return}const g=this.toRange(h,u);n.revealRangeInCenter(g,0),this.addDecorations(n,g)},a=new Oh({title:m(1336,"Use Zero-Based Offset"),icon:oe.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:de(Dy),inputActiveOptionForeground:de(Ey),inputActiveOptionBackground:de(BC)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=Jte(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(xe(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var n,o;const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",a-1):m(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((n=r[0])==null?void 0:n.trim(),10);if(r.length<1||isNaN(l))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};zg.PREFIX=":",zg.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let xW=zg;var EBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UG=function(s,e){return function(t,i){e(t,i,s)}};let ay=class extends xW{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ay=EBe([UG(0,gt),UG(1,Fs)],ay);var wm;let ioe=(wm=class extends Ce{constructor(){super({id:wm.ID,label:YI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:P.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(_s).quickAccess.show(ay.PREFIX)}},wm.ID="editor.action.gotoLine",wm);pe(ioe);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:ay,prefix:ay.PREFIX,helpEntries:[{description:YI.gotoLineActionLabel,commandId:ioe.ID}]});const noe=[void 0,[]];function tP(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?NBe(s,n.values,t,i):soe(s,e,t,i)}function NBe(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=soe(s,r,t,i);if(typeof a!="number")return noe;n+=a,o.push(...l)}return[n,TBe(o)]}function soe(s,e,t,i){const n=Fm(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Oy(n)]:noe}function TBe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!RBe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function RBe(s,e){return!(s.end<e.start||e.end<s.start)}function $G(s){return s.startsWith('"')&&s.endsWith('"')}const ooe=" ";function LW(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=jG(s),o=t.indexOf(wl)>=0,r=$G(s);let a;const l=s.split(ooe);if(l.length>1)for(const c of l){const d=$G(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=jG(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function jG(s){let e;On?e=s.replace(/\//g,wl):e=s.replace(/\\/g,wl);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function qG(s){return Array.isArray(s)?LW(s.map(e=>e.original).join(ooe)):LW(s.original)}var MBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},KG=function(s,e){return function(t,i){e(t,i,s)}},Sk,pl;let wp=(pl=class extends toe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),U.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):U.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Q;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new o_,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(xe(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){var h;const r=e.editor,a=new Q;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new St),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new ni,i.busy=!0;try{const g=LW(i.value.substr(Sk.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const _=F0(p,v=>!!(v.type!=="separator"&&v.range&&I.containsPosition(v.range.decoration,u)));_&&(i.activeItems=[_])}}else g.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){var _,v;const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(Sk.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=qG(t.values[0]),d=qG(t.values.slice(1))):c=t;let h;const u=(v=(_=this.options)==null?void 0:_.openSideBySideDirection)==null?void 0:v.call(_);u&&(h=[{iconClass:u==="right"?Te.asClassName(oe.splitHorizontal):Te.asClassName(oe.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const f=[];for(let b=0;b<r.length;b++){const w=r[b],C=sde(w.name),S=`$(${Vk.toIcon(w.kind).id}) ${C}`,y=S.length-C.length;let x=w.containerName;i!=null&&i.extraContainerLabel&&(x?x=`${i.extraContainerLabel} • ${x}`:x=i.extraContainerLabel);let L,D,E,T;if(t.original.length>l){let A=!1;if(c!==t&&([L,D]=tP(S,{...t,values:void 0},l,y),typeof L=="number"&&(A=!0)),typeof L!="number"&&([L,D]=tP(S,c,l,y),typeof L!="number"))continue;if(!A&&d){if(x&&d.original.length>0&&([E,T]=tP(x,d)),typeof E!="number")continue;typeof L=="number"&&(L+=E)}}const N=w.tags&&w.tags.indexOf(1)>=0;f.push({index:b,kind:w.kind,score:L,label:S,ariaLabel:Xce(w.name,w.kind),description:x,highlights:N?void 0:{label:D,description:T},range:{selection:I.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:C,strikethrough:N,buttons:h})}const g=f.sort((b,w)=>a?this.compareByKindAndScore(b,w):this.compareByScore(b,w));let p=[];if(a){let S=function(){w&&typeof b=="number"&&C>0&&(w.label=Im(nP[b]||iP,C))},b,w,C=0;for(const y of g)b!==y.kind?(S(),b=y.kind,C=1,w={type:"separator"},p.push(w)):C++,p.push(y);S()}else g.length>0&&(p=[{label:m(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=nP[e.kind]||iP,n=nP[t.kind]||iP,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},Sk=pl,pl.PREFIX="@",pl.SCOPE_PREFIX=":",pl.PREFIX_BY_CATEGORY=`${pl.PREFIX}${pl.SCOPE_PREFIX}`,pl);wp=Sk=MBe([KG(0,Se),KG(1,tx)],wp);const iP=m(1352,"properties ({0})"),nP={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var ABe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sP=function(s,e){return function(t,i){e(t,i,s)}};let kW=class extends wp{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};kW=ABe([sP(0,gt),sP(1,Se),sP(2,tx)],kW);const FT=class FT extends Ce{constructor(){super({id:FT.ID,label:mS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:P.hasDocumentSymbolProvider,kbOpts:{kbExpr:P.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(_s).quickAccess.show(wp.PREFIX,{itemActivation:al.NONE})}};FT.ID="editor.action.quickOutline";let zE=FT;pe(zE);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:kW,prefix:wp.PREFIX,helpEntries:[{description:mS.quickOutlineActionLabel,prefix:wp.PREFIX,commandId:zE.ID},{description:mS.quickOutlineByCategoryActionLabel,prefix:wp.PREFIX_BY_CATEGORY}]});function PBe(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class X1{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return PBe(X1.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const o=X1.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=X1.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function OBe(s){var i;const e=s.slice(0);e.sort((n,o)=>o.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var Rb;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(Rb||(Rb={}));function oP(s){const e=s;return Array.isArray(e.items)}function GG(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class FBe extends U{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const n=new Q;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new St),a=async()=>{var _;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new Q;o=d.add(new ni(t));const h=o.token;let u=e.value.substring(this.prefix.length);(_=this.options)!=null&&_.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(v,b)=>{var S;let w,C;if(oP(v)?(w=v.items,C=v.active):w=v,w.length===0){if(b)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(Sm(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async v=>{let b=!1,w=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Oc(v.mergeDelay),h.isCancellationRequested)||w||(b=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await v.additionalPicks;if(h.isCancellationRequested)return;let S,y;oP(v.picks)?(S=v.picks.items,y=v.picks.active):S=v.picks;let x,L;if(oP(C)?(x=C.items,L=C.active):x=C,x.length>0||!b){let D;if(!y&&!L){const E=e.activeItems[0];E&&S.indexOf(E)!==-1&&(D=E)}g({items:[...S,...x],active:y||L||D})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(GG(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(h.isCancellationRequested)return;GG(v)?await p(v):g(v)}finally{h.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case Rb.NO_ACTION:break;case Rb.CLOSE_PICKER:e.hide();break;case Rb.REFRESH_PICKER:a();break;case Rb.REMOVE_ITEM:{const _=e.items.indexOf(h);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),w=e.activeItems.filter(S=>S!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),n.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),n}}new qa(1e4);const WBe=new qa(1e4);function BBe(s){return VBe(s,"NFD",WBe)}const HBe=/[^\u0000-\u0080]/;function VBe(s,e,t){if(!s)return s;const i=t.get(s);if(i)return i;let n;return HBe.test(s)?n=s.normalize(e):n=s,t.set(s,n),n}const zBe=function(){const s=/[\u0300-\u036f]/g;return function(e){return BBe(e).replace(s,"")}}();var roe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pu=function(s,e){return function(t,i){e(t,i,s)}},gg,en,xc;let IW=(xc=class extends FBe{constructor(e,t,i,n,o,r){super(gg.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(DW)),this.options=e}async _getPicks(e,t,i,n){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=ym(()=>{const _=new X1;_.updateDocuments(o.map(b=>({key:b.commandId,textChunks:[this.getTfIdfChunk(b)]})));const v=_.calculateScores(e,i);return OBe(v).filter(b=>b.score>gg.TFIDF_THRESHOLD).slice(0,gg.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const _ of o){_.labelNoAccents??(_.labelNoAccents=this.normalizeForFiltering(_.label));const v=gg.WORD_FILTER(a,_.labelNoAccents)??void 0;let b;if(_.commandAlias&&(_.aliasNoAccents??(_.aliasNoAccents=this.normalizeForFiltering(_.commandAlias)),b=gg.WORD_FILTER(a,_.aliasNoAccents)??void 0),v||b)_.highlights={label:v,detail:this.options.showAlias?b:void 0},l.push(_);else if(e===_.commandId)l.push(_);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===_.commandId);C&&(_.tfIdfScore=C.score,l.push(_))}}const c=new Map;for(const _ of l){const v=c.get(_.label);v?(_.description=_.commandId,v.description=v.commandId):c.set(_.label,_)}l.sort((_,v)=>{if(_.tfIdfScore&&v.tfIdfScore)return _.tfIdfScore===v.tfIdfScore?_.label.localeCompare(v.label):v.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(v.tfIdfScore)return-1;const b=this.commandsHistory.peek(_.commandId),w=this.commandsHistory.peek(v.commandId);if(b&&w)return b>w?-1:1;if(b)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(_.commandId),x=this.options.suggestedCommandIds.has(v.commandId);if(y&&x)return 0;if(y)return-1;if(x)return 1}const C=_.commandCategory===oW.Developer.value,S=v.commandCategory===oW.Developer.value;return C&&!S?1:!C&&S?-1:_.label.localeCompare(v.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let _=0;_<l.length;_++){const v=l[_];_===0&&this.commandsHistory.peek(v.commandId)&&(d.push({type:"separator",label:m(1740,"recently used")}),h=!0),u&&v.tfIdfScore!==void 0&&(d.push({type:"separator",label:m(1741,"similar commands")}),u=!1),f&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&((g=this.options.suggestedCommandIds)!=null&&g.has(v.commandId))&&(d.push({type:"separator",label:m(1742,"commonly used")}),h=!0,f=!1),h&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&!((p=this.options.suggestedCommandIds)!=null&&p.has(v.commandId))&&(d.push({type:"separator",label:m(1743,"other commands")}),h=!1),d.push(this.toCommandPick(v,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var b;const _=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const v=_.map(w=>this.toCommandPick(w,n));return u&&((b=v[0])==null?void 0:b.type)!=="separator"&&v.unshift({type:"separator",label:m(1744,"similar commands")}),v})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){Ar(r)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),PD(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=zBe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},gg=xc,xc.PREFIX=">",xc.TFIDF_THRESHOLD=.5,xc.TFIDF_MAX_RESULTS=5,xc.WORD_FILTER=R8(cS,QSe,UJ),xc);IW=gg=roe([pu(1,ke),pu(2,_t),pu(3,qt),pu(4,vs),pu(5,Py)],IW);var ml;let DW=(ml=class extends U{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Vu.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=en.getConfiguredCommandHistoryLength(this.configurationService),en.cache&&en.cache.limit!==this.configuredCommandsHistoryLength&&(en.cache.limit=this.configuredCommandsHistoryLength,en.hasChanges=!0))}load(){const e=this.storageService.get(en.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=en.cache=new qa(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}en.counter=this.storageService.getNumber(en.PREF_KEY_COUNTER,0,en.counter)}push(e){en.cache&&(en.cache.set(e,en.counter++),en.hasChanges=!0)}peek(e){var t;return(t=en.cache)==null?void 0:t.peek(e)}saveState(){if(!en.cache||!en.hasChanges)return;const e={usesLRU:!0,entries:[]};en.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(en.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(en.PREF_KEY_COUNTER,en.counter,0,0),en.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,o;const i=(o=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:en.DEFAULT_COMMANDS_HISTORY_LENGTH}},en=ml,ml.DEFAULT_COMMANDS_HISTORY_LENGTH=50,ml.PREF_KEY_CACHE="commandPalette.mru.cache",ml.PREF_KEY_COUNTER="commandPalette.mru.counter",ml.counter=1,ml.hasChanges=!1,ml);DW=en=roe([pu(0,Fs),pu(1,qe),pu(2,jt)],DW);class UBe extends IW{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let o;(i=n.metadata)!=null&&i.description&&(Hke(n.metadata.description)?o=n.metadata.description:o={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:o,label:W8(n.label)||n.id})}return t}}var $Be=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Z_=function(s,e){return function(t,i){e(t,i,s)}};let ly=class extends UBe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};ly=$Be([Z_(0,ke),Z_(1,gt),Z_(2,_t),Z_(3,qt),Z_(4,vs),Z_(5,Py)],ly);const WT=class WT extends Ce{constructor(){super({id:WT.ID,label:ZI.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:P.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(_s).quickAccess.show(ly.PREFIX)}};WT.ID="editor.action.quickCommand";let UE=WT;pe(UE);mi.as(p_.Quickaccess).registerQuickAccessProvider({ctor:ly,prefix:ly.PREFIX,helpEntries:[{description:ZI.quickCommandHelp,commandId:UE.ID}]});var jBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},X_=function(s,e){return function(t,i){e(t,i,s)}};let EW=class extends Jm{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};EW=jBe([X_(1,Be),X_(2,gt),X_(3,Di),X_(4,ke),X_(5,Fs),X_(6,qe)],EW);ht(Jm.ID,EW,4);class qBe extends Ce{constructor(){super({id:"editor.action.toggleHighContrast",label:XF.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Fr),n=i.getColorTheme();xl(n.type)?(i.setTheme(this._originalThemeName||(wh(n.type)?bv:Wd)),this._originalThemeName=null):(i.setTheme(wh(n.type)?bp:vp),this._originalThemeName=n.themeName)}}pe(qBe);const aoe={},rP={};class TH{static getOrCreate(e){return rP[e]||(rP[e]=new TH(e)),rP[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,aoe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function KBe(s){const e=s.id;aoe[e]=s,kb.register(s);const t=TH.getOrCreate(e);kb.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),kb.onLanguageEncountered(e,async()=>{const i=await t.load();kb.setLanguageConfiguration(e,i.conf)})}KBe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>l2e(()=>import("./yaml-DGeXk3xG.js"),__vite__mapDeps([0,1]),import.meta.url)});globalThis.MonacoEnvironment={getWorker:()=>new Worker(new URL(""+new URL("editor.worker-CKy7Pnvo.js",import.meta.url).href,import.meta.url),{type:"module"})};FW.config({monaco:o2e});var NW={},YG=yre;NW.createRoot=YG.createRoot,NW.hydrateRoot=YG.hydrateRoot;function GBe(s,e){return e.find(t=>t.repository===s)}function loe(s,e){const t=GBe(s,e);if(!t)return;const i=t.name.indexOf("/");return i>0?{project:t.name.slice(0,i),repoName:t.name.slice(i+1),ref:t.ref}:{repoName:t.name,ref:t.ref}}function coe(s){let e=s,t;const i=e.lastIndexOf("@");return i>0&&(t=e.slice(i+1),e=e.slice(0,i),t==="self"&&(t=void 0)),e=e.replace(/\\/g,"/"),e=e.replace(/^\.\//,""),{normalizedPath:e,repoAlias:t}}function Lv(s,e,t,i=!1,n={},o){const{normalizedPath:r,repoAlias:a}=coe(s);return{rawPath:s,normalizedPath:r,repoAlias:a,contextRepoAlias:a??n.contextRepoAlias,sourcePath:n.sourcePath,parameters:t,location:e,conditional:i,conditionExpression:o}}function Sp(s){return s.repoAlias??s.contextRepoAlias}function doe(s){if(s.normalizedPath.startsWith("/"))return{primary:s.normalizedPath};if(s.repoAlias||!s.sourcePath)return{primary:s.normalizedPath};const e=YBe(s.sourcePath);if(!e)return{primary:s.normalizedPath};const t=hoe(`${e}/${s.normalizedPath}`);return t===s.normalizedPath?{primary:t}:{primary:t,fallback:s.normalizedPath}}function YBe(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t<0?"":t===0?"/":e.slice(0,t)}function hoe(s){const e=s.startsWith("/"),t=s.split("/").filter(o=>o!==""&&o!=="."),i=[];for(const o of t)o===".."?i.length>0&&i[i.length-1]!==".."?i.pop():e||i.push(o):i.push(o);const n=i.join("/");return e?`/${n}`:n}function ZBe(s){try{const e=new URL(s);if(!e.hostname.endsWith("dev.azure.com"))return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<4||t[2]!=="_git")return null;const i=decodeURIComponent(t[0]),n=decodeURIComponent(t[1]),o=decodeURIComponent(t[3]),r=e.searchParams.get("path")||"",a=e.searchParams.get("version");let l,c;return a!=null&&a.startsWith("GB")?(l=a.slice(2),c=`refs/heads/${l}`):a!=null&&a.startsWith("GT")&&(c=`refs/tags/${a.slice(2)}`),r?{org:i,project:n,repoName:o,filePath:r,branch:l,ref:c}:null}catch{return null}}function uoe(s){var i,n;const e=`https://dev.azure.com/${encodeURIComponent(s.org)}/${encodeURIComponent(s.project)}/_git/${encodeURIComponent(s.repoName)}`,t=new URLSearchParams({path:s.filePath});return(i=s.ref)!=null&&i.startsWith("refs/tags/")?t.set("version",`GT${s.ref.replace("refs/tags/","")}`):(n=s.ref)!=null&&n.startsWith("refs/heads/")?t.set("version",`GB${s.ref.replace("refs/heads/","")}`):s.branch&&t.set("version",`GB${s.branch}`),`${e}?${t}`}function XBe(s){const e=[];let t=0;for(;t<s.length;){if(/\s/.test(s[t])){t++;continue}if(s[t]==="'"){let i="";for(t++;t<s.length&&s[t]!=="'";)s[t]==="\\"&&t+1<s.length&&t++,i+=s[t],t++;t++,e.push({type:"STRING",value:i});continue}if(s[t]==="("){e.push({type:"LPAREN",value:"("}),t++;continue}if(s[t]===")"){e.push({type:"RPAREN",value:")"}),t++;continue}if(s[t]===","){e.push({type:"COMMA",value:","}),t++;continue}if(s[t]==="."){e.push({type:"DOT",value:"."}),t++;continue}if(s[t]==="["){e.push({type:"LBRACKET",value:"["}),t++;continue}if(s[t]==="]"){e.push({type:"RBRACKET",value:"]"}),t++;continue}if(/\d/.test(s[t])||s[t]==="-"&&t+1<s.length&&/\d/.test(s[t+1])){let i="";for(s[t]==="-"&&(i+="-",t++);t<s.length&&/[\d.]/.test(s[t]);)i+=s[t],t++;e.push({type:"NUMBER",value:i});continue}if(/[a-zA-Z_]/.test(s[t])){let i="";for(;t<s.length&&/[a-zA-Z0-9_]/.test(s[t]);)i+=s[t],t++;i==="true"||i==="false"?e.push({type:"BOOL",value:i}):i==="null"?e.push({type:"NULL",value:"null"}):e.push({type:"IDENT",value:i});continue}t++}return e}class QBe{constructor(e){Pi(this,"tokens");Pi(this,"pos",0);this.tokens=e}parse(){return this.parseExpression()}peek(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(e){const t=this.advance();if(!t||t.type!==e)throw new Error(`Expected ${e} but got ${(t==null?void 0:t.type)??"EOF"} (${t==null?void 0:t.value})`);return t}parseExpression(){const e=this.peek();if(!e)throw new Error("Unexpected end of expression");switch(e.type){case"STRING":return this.advance(),{kind:"string",value:e.value};case"NUMBER":return this.advance(),{kind:"number",value:Number(e.value)};case"BOOL":return this.advance(),{kind:"boolean",value:e.value==="true"};case"NULL":return this.advance(),{kind:"null"};case"IDENT":return this.parseIdentifierOrCall();default:throw new Error(`Unexpected token: ${e.type} (${e.value})`)}}parseIdentifierOrCall(){var t,i,n,o,r,a,l,c;const e=this.advance();if(((t=this.peek())==null?void 0:t.type)==="LPAREN"){this.advance();const d=[];if(((i=this.peek())==null?void 0:i.type)!=="RPAREN")for(d.push(this.parseExpression());((n=this.peek())==null?void 0:n.type)==="COMMA";)this.advance(),d.push(this.parseExpression());return this.expect("RPAREN"),{kind:"functionCall",name:e.value,args:d}}if(((o=this.peek())==null?void 0:o.type)==="DOT"){const d=[e.value];for(;((r=this.peek())==null?void 0:r.type)==="DOT";){this.advance();const h=this.peek();if((h==null?void 0:h.type)==="IDENT")d.push(this.advance().value);else if((h==null?void 0:h.type)==="BOOL")d.push(this.advance().value);else break}for(;((a=this.peek())==null?void 0:a.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}if(((l=this.peek())==null?void 0:l.type)==="LBRACKET"){const d=[e.value];for(;((c=this.peek())==null?void 0:c.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}return{kind:"identifier",name:e.value}}}function ZG(s,e){let t=s;for(const i of e){if(t==null||typeof t!="object")return;t=t[i]}return t}function Ui(s){return s==null?"":typeof s=="boolean"?s?"True":"False":typeof s=="object"?JSON.stringify(s):String(s)}function aP(s){return typeof s=="boolean"?s:typeof s=="string"?s!==""&&s.toLowerCase()!=="false":typeof s=="number"?s!==0:s!=null}function ML(s,e){return s==null&&e==null?!0:s==null||e==null?!1:typeof s=="boolean"&&typeof e=="string"?s===(e.toLowerCase()==="true"):typeof e=="boolean"&&typeof s=="string"?e===(s.toLowerCase()==="true"):typeof s=="string"&&typeof e=="string"?s.toLowerCase()===e.toLowerCase():s===e}const JBe={coalesce:s=>{for(const e of s)if(e!=null&&e!=="")return e;return null},eq:s=>ML(s[0],s[1]),ne:s=>!ML(s[0],s[1]),and:s=>s.every(aP),or:s=>s.some(aP),not:s=>!aP(s[0]),gt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>t:Ui(e)>Ui(t)},ge:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>=t:Ui(e)>=Ui(t)},lt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<t:Ui(e)<Ui(t)},le:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<=t:Ui(e)<=Ui(t)},replace:s=>{const e=Ui(s[0]),t=Ui(s[1]),i=Ui(s[2]);return e.split(t).join(i)},in:s=>{const e=s[0];return s.slice(1).some(i=>ML(e,i))},startswith:s=>Ui(s[0]).toLowerCase().startsWith(Ui(s[1]).toLowerCase()),endswith:s=>Ui(s[0]).toLowerCase().endsWith(Ui(s[1]).toLowerCase()),contains:s=>{const e=s[0],t=Ui(s[1]);return Array.isArray(e)?e.some(i=>ML(i,t)):Ui(e).toLowerCase().includes(t.toLowerCase())},join:s=>{const e=Ui(s[0]),t=s.slice(1);return t.length===1&&Array.isArray(t[0])?t[0].map(Ui).join(e):t.map(Ui).join(e)},lower:s=>Ui(s[0]).toLowerCase(),upper:s=>Ui(s[0]).toUpperCase(),length:s=>{const e=s[0];return typeof e=="string"||Array.isArray(e)?e.length:e&&typeof e=="object"?Object.keys(e).length:0},format:s=>{let e=Ui(s[0]);for(let t=1;t<s.length;t++)e=e.split(`{${t-1}}`).join(Ui(s[t]));return e},converttojson:s=>{const e=s[0];return e==null?"null":JSON.stringify(e)},counter:s=>Ui(s[0])};function TW(s,e){switch(s.kind){case"string":return s.value;case"number":return s.value;case"boolean":return s.value;case"null":return null;case"parameterAccess":return ZG(e.parameters??{},s.path);case"variableAccess":return ZG(e.variables??{},s.path);case"identifier":return s.name;case"functionCall":{const t=JBe[s.name.toLowerCase()];if(!t){const n=s.args.map(o=>TW(o,e));return`${s.name}(${n.map(Ui).join(", ")})`}const i=s.args.map(n=>TW(n,e));return t(i,e)}}}function foe(s,e={}){const t=s.trim();if(!t)return"";try{const i=XBe(t);if(i.length===0)return"";const o=new QBe(i).parse();return TW(o,e)}catch{return s}}function goe(s,e={}){const t=/\$\{\{\s*(.*?)\s*\}\}/g,i=[],n=[];let o=!1;return{result:s.replace(t,(a,l)=>{o=!0;const c=foe(l,e),d=Ui(c);return/\$\{\{/.test(d)||c===l||c===void 0?(n.push(l),a):(i.push(l),d)}),hadExpressions:o,isFullyResolved:o&&n.length===0,substituted:i,unresolved:n}}function yp(s){return/\$\{\{.*?\}\}/.test(s)}function $E(s,e,t,i){if(!yp(s))return{resolvedPath:s,isFullyResolved:!0,hadExpressions:!1,substituted:[],unresolved:[]};const o={parameters:{...e??{}},variables:i},{result:r,hadExpressions:a,isFullyResolved:l,substituted:c,unresolved:d}=goe(s,o);return{resolvedPath:r,isFullyResolved:a?l:!0,hadExpressions:a,substituted:c,unresolved:d}}function lP(s){const e=s.parameters;if(!Array.isArray(e))return{};const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"default"in i){const n=i;t[n.name]=n.default}return t}function XG(s){const e=s.parameters;return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object"&&"name"in t&&typeof t.name=="string").map(t=>t.name):[]}function AL(s){const e=s.variables;if(!e)return{};if(Array.isArray(e)){const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"value"in i){const n=i;t[n.name]=String(n.value)}return t}if(typeof e=="object"){const t={};for(const[i,n]of Object.entries(e))t[i]=String(n);return t}return{}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function poe(s){return typeof s>"u"||s===null}function e8e(s){return typeof s=="object"&&s!==null}function t8e(s){return Array.isArray(s)?s:poe(s)?[]:[s]}function i8e(s,e){var t,i,n,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)n=o[t],s[n]=e[n];return s}function n8e(s,e){var t="",i;for(i=0;i<e;i+=1)t+=s;return t}function s8e(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}var o8e=poe,r8e=e8e,a8e=t8e,l8e=n8e,c8e=s8e,d8e=i8e,us={isNothing:o8e,isObject:r8e,toArray:a8e,repeat:l8e,isNegativeZero:c8e,extend:d8e};function moe(s,e){var t="",i=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(t+='in "'+s.mark.name+'" '),t+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!e&&s.mark.snippet&&(t+=`
|
|
915
915
|
|
|
916
916
|
`+s.mark.snippet),i+" "+t):i}function cy(s,e){Error.call(this),this.name="YAMLException",this.reason=s,this.mark=e,this.message=moe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}cy.prototype=Object.create(Error.prototype);cy.prototype.constructor=cy;cy.prototype.toString=function(e){return this.name+": "+moe(this,e)};var Ho=cy;function cP(s,e,t,i,n){var o="",r="",a=Math.floor(n/2)-1;return i-e>a&&(o=" ... ",e=i-a+o.length),t-i>a&&(r=" ...",t=i+a-r.length),{str:o+s.slice(e,t).replace(/\t/g,"→")+r,pos:i-e+o.length}}function dP(s,e){return us.repeat(" ",e-s.length)+s}function h8e(s,e){if(e=Object.create(e||null),!s.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,i=[0],n=[],o,r=-1;o=t.exec(s.buffer);)n.push(o.index),i.push(o.index+o[0].length),s.position<=o.index&&r<0&&(r=i.length-2);r<0&&(r=i.length-1);var a="",l,c,d=Math.min(s.line+e.linesAfter,n.length).toString().length,h=e.maxLength-(e.indent+d+3);for(l=1;l<=e.linesBefore&&!(r-l<0);l++)c=cP(s.buffer,i[r-l],n[r-l],s.position-(i[r]-i[r-l]),h),a=us.repeat(" ",e.indent)+dP((s.line-l+1).toString(),d)+" | "+c.str+`
|
|
917
917
|
`+a;for(c=cP(s.buffer,i[r],n[r],s.position,h),a+=us.repeat(" ",e.indent)+dP((s.line+1).toString(),d)+" | "+c.str+`
|
|
@@ -943,4 +943,4 @@ ${l}
|
|
|
943
943
|
`,s.length-n>e&&r>n?l+=s.slice(n,r)+`
|
|
944
944
|
`+s.slice(r+1):l+=s.slice(n),l.slice(1)}function X6e(s){for(var e="",t=0,i,n=0;n<s.length;t>=65536?n+=2:n++)t=n1(s,n),i=Eo[t],!i&&uy(t)?(e+=s[n],t>=65536&&(e+=s[n+1])):e+=i||z6e(t);return e}function Q6e(s,e,t){var i="",n=s.tag,o,r,a;for(o=0,r=t.length;o<r;o+=1)a=t[o],s.replacer&&(a=s.replacer.call(t,String(o),a)),(Nh(s,e,a,!1,!1)||typeof a>"u"&&Nh(s,e,null,!1,!1))&&(i!==""&&(i+=","+(s.condenseFlow?"":" ")),i+=s.dump);s.tag=n,s.dump="["+i+"]"}function hY(s,e,t,i){var n="",o=s.tag,r,a,l;for(r=0,a=t.length;r<a;r+=1)l=t[r],s.replacer&&(l=s.replacer.call(t,String(r),l)),(Nh(s,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&Nh(s,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=AW(s,e)),s.dump&&dy===s.dump.charCodeAt(0)?n+="-":n+="- ",n+=s.dump);s.tag=o,s.dump=n||"[]"}function J6e(s,e,t){var i="",n=s.tag,o=Object.keys(t),r,a,l,c,d;for(r=0,a=o.length;r<a;r+=1)d="",i!==""&&(d+=", "),s.condenseFlow&&(d+='"'),l=o[r],c=t[l],s.replacer&&(c=s.replacer.call(t,l,c)),Nh(s,e,l,!1,!1)&&(s.dump.length>1024&&(d+="? "),d+=s.dump+(s.condenseFlow?'"':"")+":"+(s.condenseFlow?"":" "),Nh(s,e,c,!1,!1)&&(d+=s.dump,i+=d));s.tag=n,s.dump="{"+i+"}"}function eHe(s,e,t,i){var n="",o=s.tag,r=Object.keys(t),a,l,c,d,h,u;if(s.sortKeys===!0)r.sort();else if(typeof s.sortKeys=="function")r.sort(s.sortKeys);else if(s.sortKeys)throw new Ho("sortKeys must be a boolean or a function");for(a=0,l=r.length;a<l;a+=1)u="",(!i||n!=="")&&(u+=AW(s,e)),c=r[a],d=t[c],s.replacer&&(d=s.replacer.call(t,c,d)),Nh(s,e+1,c,!0,!0,!0)&&(h=s.tag!==null&&s.tag!=="?"||s.dump&&s.dump.length>1024,h&&(s.dump&&dy===s.dump.charCodeAt(0)?u+="?":u+="? "),u+=s.dump,h&&(u+=AW(s,e)),Nh(s,e+1,d,!0,h)&&(s.dump&&dy===s.dump.charCodeAt(0)?u+=":":u+=": ",u+=s.dump,n+=u));s.tag=o,s.dump=n||"{}"}function uY(s,e,t){var i,n,o,r,a,l;for(n=t?s.explicitTypes:s.implicitTypes,o=0,r=n.length;o<r;o+=1)if(a=n[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t?a.multi&&a.representName?s.tag=a.representName(e):s.tag=a.tag:s.tag="?",a.represent){if(l=s.styleMap[a.tag]||a.defaultStyle,qoe.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(Koe.call(a.represent,l))i=a.represent[l](e,l);else throw new Ho("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');s.dump=i}return!0}return!1}function Nh(s,e,t,i,n,o,r){s.tag=null,s.dump=t,uY(s,t,!1)||uY(s,t,!0);var a=qoe.call(s.dump),l=i,c;i&&(i=s.flowLevel<0||s.flowLevel>e);var d=a==="[object Object]"||a==="[object Array]",h,u;if(d&&(h=s.duplicates.indexOf(t),u=h!==-1),(s.tag!==null&&s.tag!=="?"||u||s.indent!==2&&e>0)&&(n=!1),u&&s.usedDuplicates[h])s.dump="*ref_"+h;else{if(d&&u&&!s.usedDuplicates[h]&&(s.usedDuplicates[h]=!0),a==="[object Object]")i&&Object.keys(s.dump).length!==0?(eHe(s,e,s.dump,n),u&&(s.dump="&ref_"+h+s.dump)):(J6e(s,e,s.dump),u&&(s.dump="&ref_"+h+" "+s.dump));else if(a==="[object Array]")i&&s.dump.length!==0?(s.noArrayIndent&&!r&&e>0?hY(s,e-1,s.dump,n):hY(s,e,s.dump,n),u&&(s.dump="&ref_"+h+s.dump)):(Q6e(s,e,s.dump),u&&(s.dump="&ref_"+h+" "+s.dump));else if(a==="[object String]")s.tag!=="?"&&Y6e(s,s.dump,e,o,l);else{if(a==="[object Undefined]")return!1;if(s.skipInvalid)return!1;throw new Ho("unacceptable kind of an object to dump "+a)}s.tag!==null&&s.tag!=="?"&&(c=encodeURI(s.tag[0]==="!"?s.tag.slice(1):s.tag).replace(/!/g,"%21"),s.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",s.dump=c+" "+s.dump)}return!0}function tHe(s,e){var t=[],i=[],n,o;for(OW(s,t,i),n=0,o=i.length;n<o;n+=1)e.duplicates.push(t[i[n]]);e.usedDuplicates=new Array(o)}function OW(s,e,t){var i,n,o;if(s!==null&&typeof s=="object")if(n=e.indexOf(s),n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(s),Array.isArray(s))for(n=0,o=s.length;n<o;n+=1)OW(s[n],e,t);else for(i=Object.keys(s),n=0,o=i.length;n<o;n+=1)OW(s[i[n]],e,t)}function iHe(s,e){e=e||{};var t=new $6e(e);t.noRefs||tHe(s,t);var i=s;return t.replacer&&(i=t.replacer.call({"":i},"",i)),Nh(t,0,i,!0,!0)?t.dump+`
|
|
945
945
|
`:""}var nHe=iHe,sHe={dump:nHe};function FH(s,e){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var oHe=Qs,rHe=_oe,aHe=woe,lHe=koe,cHe=Ioe,dHe=MH,hHe=joe.load,uHe=joe.loadAll,fHe=sHe.dump,gHe=Ho,pHe={binary:Roe,float:Loe,map:Coe,null:Soe,pairs:Aoe,set:Poe,timestamp:Noe,bool:yoe,int:xoe,merge:Toe,omap:Moe,seq:voe,str:boe},mHe=FH("safeLoad","load"),_He=FH("safeLoadAll","loadAll"),bHe=FH("safeDump","dump"),vHe={Type:oHe,Schema:rHe,FAILSAFE_SCHEMA:aHe,JSON_SCHEMA:lHe,CORE_SCHEMA:cHe,DEFAULT_SCHEMA:dHe,load:hHe,loadAll:uHe,dump:fHe,YAMLException:gHe,types:pHe,safeLoad:mHe,safeLoadAll:_He,safeDump:bHe};const CHe=/^(\s*-\s*|\s*)(\$\{\{.+?\}\})(\s*:\s*(?:#.*)?)$/;function lb(s){return vHe.load(wHe(s))}function wHe(s){let e=0;return s.split(/\r?\n/).map(t=>t.replace(CHe,(i,n,o,r)=>{const a=`${o}__apv_${e++}`;return`${n}${JSON.stringify(a)}${r}`})).join(`
|
|
946
|
-
`)}const SHe={DotNetCoreCLI:"dotnet-core-cli","AdvancedSecurity-Codeql-Init":"advanced-security-codeql-init","AdvancedSecurity-Codeql-Analyze":"advanced-security-codeql-analyze","AdvancedSecurity-Publish":"advanced-security-publish",AndroidBuild:"android-build",AndroidSigning:"android-signing",Ant:"ant",AzureIoTEdge:"azure-iot-edge",CMake:"cmake",ContainerBuild:"container-build",Docker:"docker",DockerCompose:"docker-compose",DownloadGitHubNugetPackage:"download-github-nuget-package",Go:"go",Gradle:"gradle",Grunt:"grunt",gulp:"gulp",PublishSymbols:"publish-symbols",JenkinsQueueJob:"jenkins-queue-job",Maven:"maven",MSBuild:"msbuild",SonarQubePrepare:"sonar-qube-prepare",SonarQubePublish:"sonar-qube-publish",SonarQubeAnalyze:"sonar-qube-analyze",VSBuild:"vsbuild",Xcode:"xcode",XcodePackageiOS:"xcode-package-ios",AppCenterDistribute:"app-center-distribute",AzureResourceManagerTemplateDeployment:"azure-resource-manager-template-deployment",AzureAppConfigurationExport:"azure-app-configuration-export",AzureAppConfigurationImport:"azure-app-configuration-import",AzureAppConfigurationSnapshot:"azure-app-configuration-snapshot",AzureWebPowerShellDeployment:"azure-web-powershell-deployment",AzureRmWebAppDeployment:"azure-rm-web-app-deployment",AzureAppServiceManage:"azure-app-service-manage",AzureAppServiceSettings:"azure-app-service-settings",AzureCLI:"azure-cli",AzureCloudPowerShellDeployment:"azure-cloud-powershell-deployment",AzureContainerApps:"azure-container-apps",AzureMysqlDeployment:"azure-mysql-deployment",AzureFileCopy:"azure-file-copy",AzureFunctionOnKubernetes:"azure-function-on-kubernetes",AzureFunctionApp:"azure-function-app",AzureFunctionAppContainer:"azure-function-app-container",AzureKeyVault:"azure-key-vault",AzureMonitorAlerts:"azure-monitor-alerts",AzurePowerShell:"azure-powershell",AzureResourceGroupDeployment:"azure-resource-group-deployment",AzureSpringCloud:"azure-spring-cloud",SqlAzureDacpacDeployment:"sql-azure-dacpac-deployment",AzureVmssDeployment:"azure-vmss-deployment",AzureWebApp:"azure-web-app",AzureWebAppContainer:"azure-web-app-container",PackerBuild:"packer-build",AzurePolicyCheckGate:"azure-policy-check-gate",Chef:"chef",ChefKnife:"chef-knife",CopyFilesOverSSH:"copy-files-over-ssh",KubernetesManifest:"kubernetes-manifest",IISWebAppDeploymentOnMachineGroup:"iisweb-app-deployment-on-machine-group",IISWebAppDeployment:"iisweb-app-deployment",IISWebAppManagementOnMachineGroup:"iisweb-app-management-on-machine-group",InvokeRESTAPI:"invoke-rest-api",Kubernetes:"kubernetes",ManualIntervention:"manual-intervention",ManualValidation:"manual-validation",MysqlDeploymentOnMachineGroup:"mysql-deployment-on-machine-group",HelmDeploy:"helm-deploy",PowerShellOnTargetMachines:"powershell-on-target-machines",ServiceFabricDeploy:"service-fabric-deploy",ServiceFabricComposeDeploy:"service-fabric-compose-deploy",SqlDacpacDeploymentOnMachineGroup:"sql-dacpac-deployment-on-machine-group",SqlServerDacpacDeployment:"sql-server-dacpac-deployment",SSH:"ssh",WindowsMachineFileCopy:"windows-machine-file-copy",CargoAuthenticate:"cargo-authenticate",CocoaPods:"cocoa-pods",CondaEnvironment:"conda-environment",DownloadGithubNpmPackage:"download-github-npm-package",MavenAuthenticate:"maven-authenticate",Npm:"npm",npmAuthenticate:"npm-authenticate",NuGetCommand:"nuget-command",NuGet:"nuget",NuGetAuthenticate:"nuget-authenticate",NuGetInstaller:"nuget-installer",NuGetPackager:"nuget-packager",NuGetPublisher:"nuget-publisher",NuGetRestore:"nuget-restore",PyPIPublisher:"py-pi-publisher",PipAuthenticate:"pip-authenticate",TwineAuthenticate:"twine-authenticate",UniversalPackages:"universal-packages",AppCenterTest:"app-center-test",AzureLoadTest:"azure-load-test",AzureTestPlan:"azure-test-plan",ContainerStructureTest:"container-structure-test",VSMobileCenterTest:"vsmobile-center-test",PublishCodeCoverageResults:"publish-code-coverage-results",PublishTestResults:"publish-test-results",RunVisualStudioTestsusingTestAgent:"run-visual-studio-testsusing-test-agent",VSTest:"vstest",DeployVisualStudioTestAgent:"deploy-visual-studio-test-agent",DotNetCoreInstaller:"dotnet-core-installer",DockerInstaller:"docker-installer",DuffleInstaller:"duffle-installer",GoTool:"go-tool",HelmInstaller:"helm-installer",FuncToolsInstaller:"func-tools-installer",JavaToolInstaller:"java-tool-installer",KubectlInstaller:"kubectl-installer",KubeloginInstaller:"kubelogin-installer",NuGetToolInstaller:"nuget-tool-installer",UseDotNet:"use-dotnet",UseNode:"use-node",NodeTool:"node-tool",UsePythonVersion:"use-python-version",UseRubyVersion:"use-ruby-version",VisualStudioTestPlatformInstaller:"visual-studio-test-platform-installer","AdvancedSecurity-Dependency-Scanning":"advanced-security-dependency-scanning",ArchiveFiles:"archive-files",AzureNLBManagement:"azure-nlb-management",Bash:"bash",BatchScript:"batch-script",Cache:"cache",CacheBeta:"cache-beta",CmdLine:"cmd-line",CopyPublishBuildArtifacts:"copy-publish-build-artifacts",CopyFiles:"copy-files",cURLUploader:"curl-uploader",DecryptFile:"decrypt-file",Delay:"delay",DeleteFiles:"delete-files",AzureStaticWebApp:"azure-static-web-app",DownloadFileshareArtifacts:"download-fileshare-artifacts",DownloadBuildArtifacts:"download-build-artifacts",DownloadGitHubRelease:"download-github-release",DownloadPackage:"download-package",DownloadPipelineArtifact:"download-pipeline-artifact",DownloadSecureFile:"download-secure-file",ExtractFiles:"extract-files",FileTransform:"file-transform",FtpUpload:"ftp-upload",GitHubComment:"github-comment",GitHubRelease:"github-release",InstallAppleCertificate:"install-apple-certificate",InstallAppleProvisioningProfile:"install-apple-provisioning-profile",InstallSSHKey:"install-ssh-key",AzureFunction:"azure-function",JenkinsDownloadArtifacts:"jenkins-download-artifacts",NodeTaskRunnerInstaller:"node-task-runner-installer",Notation:"notation",PowerShell:"powershell",PublishBuildArtifacts:"publish-build-artifacts",PublishPipelineArtifact:"publish-pipeline-artifact",PublishPipelineMetadata:"publish-pipeline-metadata",PublishToAzureServiceBus:"publish-to-azure-service-bus",PythonScript:"python-script",AzureMonitor:"azure-monitor",queryWorkItems:"query-work-items",ReviewApp:"review-app",ServiceFabricPowerShell:"service-fabric-powershell",ShellScript:"shell-script",ServiceFabricUpdateAppVersions:"service-fabric-update-app-versions",ServiceFabricUpdateManifests:"service-fabric-update-manifests"};function yHe(s){const e=s.trim(),t=e.lastIndexOf("@");if(t>0){const i=e.slice(0,t),n=Number.parseInt(e.slice(t+1),10);return{raw:e,name:i,version:Number.isNaN(n)?0:n}}return{raw:e,name:e,version:0}}function xHe(s){return s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}const fY="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference";function LHe(s,e){if(e){const n=`${s.name}@${s.version}`;if(e[n])return e[n];if(e[s.name])return e[s.name]}if(s.name.includes("."))return null;const t=SHe[s.name];if(t)return`${fY}/${t}-v${s.version}`;const i=xHe(s.name);return`${fY}/${i}-v${s.version}`}function kHe(s){const e=[],t=new Set;function i(l){typeof l=="string"&&!t.has(l)&&(t.add(l),e.push(yHe(l)))}function n(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function o(l){if(Array.isArray(l))for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task),Array.isArray(d.steps)&&n(d.steps),Array.isArray(d.jobs)&&r(d.jobs),Array.isArray(d.stages)&&a(d.stages);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}else if(l&&typeof l=="object"){const c=l;"task"in c&&i(c.task);for(const d of Object.keys(c))d.startsWith("${{")&&o(c[d]);Array.isArray(c.steps)&&n(c.steps),Array.isArray(c.jobs)&&r(c.jobs),Array.isArray(c.stages)&&a(c.stages)}}function r(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.steps)&&n(d.steps);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function a(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.jobs)&&r(d.jobs);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}Array.isArray(s.steps)&&n(s.steps),Array.isArray(s.jobs)&&r(s.jobs),Array.isArray(s.stages)&&a(s.stages);for(const l of Object.keys(s))l.startsWith("${{")&&o(s[l]);return e}function uP(s,e={}){const t=[];if(s.extends&&typeof s.extends=="object"){const i=s.extends;typeof i.template=="string"&&t.push(Lv(i.template,"extends",i.parameters,!1,e));for(const n of Object.keys(i))if(WH(n)){const o=i[n];if(o&&typeof o=="object"&&!Array.isArray(o)){const r=o;typeof r.template=="string"&&t.push(Lv(r.template,"extends",r.parameters??i.parameters,!0,e,BH(n)))}}i.parameters&&typeof i.parameters=="object"&&IHe(i.parameters,t,e)}if(Array.isArray(s.variables))for(const i of s.variables)i&&typeof i=="object"&&typeof i.template=="string"&&t.push(Lv(i.template,"variables",i.parameters,!1,e));return Array.isArray(s.stages)&&wr(s.stages,"stages",t,e),Array.isArray(s.jobs)&&wr(s.jobs,"jobs",t,e),Array.isArray(s.steps)&&wr(s.steps,"steps",t,e),t}function wr(s,e,t,i){for(const n of s){if(!n||typeof n!="object")continue;const o=n;if(typeof o.template=="string"){t.push(Lv(o.template,e,o.parameters,!1,i));continue}for(const r of Object.keys(o))if(WH(r)){const a=o[r];nre(a,e,t,i,BH(r))}Array.isArray(o.jobs)&&wr(o.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(o.steps)&&wr(o.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(o.stages)&&wr(o.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function nre(s,e,t,i,n){if(Array.isArray(s)){gY(s,e,t,i,n);return}s&&typeof s=="object"&&gY([s],e,t,i,n)}function gY(s,e,t,i,n){for(const o of s){if(!o||typeof o!="object")continue;const r=o;typeof r.template=="string"&&t.push(Lv(r.template,e,r.parameters,!0,i,n));for(const a of Object.keys(r))WH(a)&&nre(r[a],e,t,i,BH(a));Array.isArray(r.jobs)&&wr(r.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(r.steps)&&wr(r.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(r.stages)&&wr(r.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function IHe(s,e,t){Array.isArray(s.stages)&&wr(s.stages,"extends-parameters",e,t),Array.isArray(s.jobs)&&wr(s.jobs,"extends-parameters",e,t),Array.isArray(s.steps)&&wr(s.steps,"extends-parameters",e,t);for(const[,i]of Object.entries(s))if(Array.isArray(i))for(const n of i){if(n&&typeof n=="object"&&typeof n.template=="string"){const o=n;e.push(Lv(o.template,"extends-parameters",o.parameters,!1,t))}if(n&&typeof n=="object"){const o=n;Array.isArray(o.jobs)&&wr(o.jobs,"extends-parameters",e,t),Array.isArray(o.steps)&&wr(o.steps,"extends-parameters",e,t)}}}function WH(s){return s.startsWith("${{")}function BH(s){const e=s.match(/\$\{\{\s*(?:else\s*)?if\s+(.*?)\s*\}\}/);return(e==null?void 0:e[1])||void 0}const sre={},{useDebugValue:DHe}=Au,{useSyncExternalStoreWithSelector:EHe}=Lre;let pY=!1;const NHe=s=>s;function THe(s,e=NHe,t){(sre?"production":void 0)!=="production"&&t&&!pY&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),pY=!0);const i=EHe(s.subscribe,s.getState,s.getServerState||s.getInitialState,e,t);return DHe(i),i}const mY=s=>{(sre?"production":void 0)!=="production"&&typeof s!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof s=="function"?xre(s):s,t=(i,n)=>THe(e,i,n);return Object.assign(t,e),t},RHe=s=>s?mY(s):mY,x2=RHe(s=>({org:"",project:"",setConnection:(e,t)=>s({org:e,project:t}),selectedPipeline:null,selectedPipelineLoading:!1,selectedPipelineError:null,setSelectedPipeline:e=>s({selectedPipeline:e,selectedPipelineError:null,expandedNodes:new Set}),setSelectedPipelineLoading:e=>s({selectedPipelineLoading:e}),setSelectedPipelineError:e=>s({selectedPipelineError:e}),expandedTemplates:new Map(MHe()),setExpandedTemplate:(e,t)=>s(i=>{const n=new Map(i.expandedTemplates);return n.set(e,t),AHe(n),{expandedTemplates:n}}),expandedNodes:new Set,toggleNode:e=>s(t=>{const i=new Set(t.expandedNodes);return i.has(e)?i.delete(e):i.add(e),{expandedNodes:i}}),selectedNodeDetail:null,setSelectedNodeDetail:e=>s({selectedNodeDetail:e}),customTaskDocs:{},setCustomTaskDocs:e=>s({customTaskDocs:e}),taskSchema:new Map,setTaskSchema:e=>s(()=>{const t=new Map;for(const i of e)t.set(`${i.name}@${i.version}`,i);return{taskSchema:t}})})),ore="apv-template-cache";function MHe(){try{const s=localStorage.getItem(ore);if(s)return JSON.parse(s)}catch{}return[]}function AHe(s){try{const t=Array.from(s.entries()).slice(-100);localStorage.setItem(ore,JSON.stringify(t))}catch{}}function PHe(){const{selectedNodeDetail:s,customTaskDocs:e,taskSchema:t,setSelectedNodeDetail:i}=x2(),n=je.useMemo(()=>{if(!(s!=null&&s.yaml))return[];try{const o=lb(s.yaml);return kHe(o??{})}catch{return[]}},[s==null?void 0:s.yaml]);return s?me.jsxs("div",{className:"detail-panel",children:[me.jsxs("div",{className:"detail-panel__header",children:[me.jsxs("div",{className:"detail-panel__header-row",children:[me.jsx("h3",{className:"detail-panel__title",children:s.label}),me.jsx("button",{className:"detail-panel__close",onClick:()=>i(null),"aria-label":"Close detail panel",title:"Close",children:"✕"})]}),me.jsxs("div",{className:"detail-panel__path",children:[s.filePath,s.repoAlias&&me.jsxs("span",{className:"detail-panel__repo",children:[" ","@",s.repoAlias]})]})]}),n.length>0&&me.jsxs("div",{className:"detail-panel__tasks",children:[me.jsxs("h4",{className:"detail-panel__section-title",children:["Tasks (",n.length,")"]}),me.jsx("ul",{className:"task-list",children:n.map(o=>me.jsx(OHe,{ref_:o,customDocs:e,schemaEntry:t.get(o.raw)??t.get(`${o.name}@${o.version}`)},o.raw))})]}),me.jsx("div",{className:"detail-panel__editor",children:me.jsx(Uae,{height:"100%",language:"yaml",value:s.yaml,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",renderLineHighlight:"none",wordWrap:"on",padding:{top:8}}})})]}):me.jsx("div",{className:"detail-panel detail-panel--empty",children:me.jsx("p",{children:"Click a node to view its contents"})})}function OHe({ref_:s,customDocs:e,schemaEntry:t}){const i=LHe(s,e);return me.jsxs("li",{className:"task-item",children:[me.jsx("span",{className:"task-item__icon",children:"⚙️"}),me.jsxs("div",{className:"task-item__content",children:[i?me.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"task-item__link",title:(t==null?void 0:t.description)||`Open docs for ${s.name}`,children:[s.name,me.jsxs("span",{className:"task-item__version",children:["@",s.version]}),me.jsx("span",{className:"task-item__external",children:"↗"})]}):me.jsxs("span",{className:"task-item__name",children:[s.name,me.jsxs("span",{className:"task-item__version",children:["@",s.version]})]}),(t==null?void 0:t.description)&&me.jsx("div",{className:"task-item__description",children:t.description})]})]})}class fP extends je.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){var e;return this.state.hasError?this.props.fallback||me.jsxs("div",{className:"error",children:[me.jsx("h3",{children:"Something went wrong"}),me.jsx("p",{children:(e=this.state.error)==null?void 0:e.message}),me.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),style:{marginTop:8,cursor:"pointer"},children:"Try again"})]}):this.props.children}}const rre=je.createContext(null),FHe=rre.Provider;function WHe(){const s=je.useContext(rre);if(!s)throw new Error("useFileFetch must be used within a FileFetchProvider. Wrap your component tree with <FileFetchProvider value={...}>.");return s}var Ai=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Ol=Ai((s,e)=>{var t=Object.defineProperty,i=(A,O,F)=>O in A?t(A,O,{enumerable:!0,configurable:!0,writable:!0,value:F}):A[O]=F,n=(A,O)=>()=>(O||A((O={exports:{}}).exports,O),O.exports),o=(A,O,F)=>i(A,typeof O!="symbol"?O+"":O,F),r=n((A,O)=>{var F="\0",W="\0",V="",$=class{constructor(q){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),q&&(this._isDirected=Object.hasOwn(q,"directed")?q.directed:!0,this._isMultigraph=Object.hasOwn(q,"multigraph")?q.multigraph:!1,this._isCompound=Object.hasOwn(q,"compound")?q.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[W]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(q){return this._label=q,this}graph(){return this._label}setDefaultNodeLabel(q){return this._defaultNodeLabelFn=q,typeof q!="function"&&(this._defaultNodeLabelFn=()=>q),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var q=this;return this.nodes().filter(z=>Object.keys(q._in[z]).length===0)}sinks(){var q=this;return this.nodes().filter(z=>Object.keys(q._out[z]).length===0)}setNodes(q,z){var J=arguments,ae=this;return q.forEach(function(fe){J.length>1?ae.setNode(fe,z):ae.setNode(fe)}),this}setNode(q,z){return Object.hasOwn(this._nodes,q)?(arguments.length>1&&(this._nodes[q]=z),this):(this._nodes[q]=arguments.length>1?z:this._defaultNodeLabelFn(q),this._isCompound&&(this._parent[q]=W,this._children[q]={},this._children[W][q]=!0),this._in[q]={},this._preds[q]={},this._out[q]={},this._sucs[q]={},++this._nodeCount,this)}node(q){return this._nodes[q]}hasNode(q){return Object.hasOwn(this._nodes,q)}removeNode(q){var z=this;if(Object.hasOwn(this._nodes,q)){var J=ae=>z.removeEdge(z._edgeObjs[ae]);delete this._nodes[q],this._isCompound&&(this._removeFromParentsChildList(q),delete this._parent[q],this.children(q).forEach(function(ae){z.setParent(ae)}),delete this._children[q]),Object.keys(this._in[q]).forEach(J),delete this._in[q],delete this._preds[q],Object.keys(this._out[q]).forEach(J),delete this._out[q],delete this._sucs[q],--this._nodeCount}return this}setParent(q,z){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(z===void 0)z=W;else{z+="";for(var J=z;J!==void 0;J=this.parent(J))if(J===q)throw new Error("Setting "+z+" as parent of "+q+" would create a cycle");this.setNode(z)}return this.setNode(q),this._removeFromParentsChildList(q),this._parent[q]=z,this._children[z][q]=!0,this}_removeFromParentsChildList(q){delete this._children[this._parent[q]][q]}parent(q){if(this._isCompound){var z=this._parent[q];if(z!==W)return z}}children(q=W){if(this._isCompound){var z=this._children[q];if(z)return Object.keys(z)}else{if(q===W)return this.nodes();if(this.hasNode(q))return[]}}predecessors(q){var z=this._preds[q];if(z)return Object.keys(z)}successors(q){var z=this._sucs[q];if(z)return Object.keys(z)}neighbors(q){var z=this.predecessors(q);if(z){let ae=new Set(z);for(var J of this.successors(q))ae.add(J);return Array.from(ae.values())}}isLeaf(q){var z;return this.isDirected()?z=this.successors(q):z=this.neighbors(q),z.length===0}filterNodes(q){var z=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});z.setGraph(this.graph());var J=this;Object.entries(this._nodes).forEach(function([we,Re]){q(we)&&z.setNode(we,Re)}),Object.values(this._edgeObjs).forEach(function(we){z.hasNode(we.v)&&z.hasNode(we.w)&&z.setEdge(we,J.edge(we))});var ae={};function fe(we){var Re=J.parent(we);return Re===void 0||z.hasNode(Re)?(ae[we]=Re,Re):Re in ae?ae[Re]:fe(Re)}return this._isCompound&&z.nodes().forEach(we=>z.setParent(we,fe(we))),z}setDefaultEdgeLabel(q){return this._defaultEdgeLabelFn=q,typeof q!="function"&&(this._defaultEdgeLabelFn=()=>q),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(q,z){var J=this,ae=arguments;return q.reduce(function(fe,we){return ae.length>1?J.setEdge(fe,we,z):J.setEdge(fe,we),we}),this}setEdge(){var q,z,J,ae,fe=!1,we=arguments[0];typeof we=="object"&&we!==null&&"v"in we?(q=we.v,z=we.w,J=we.name,arguments.length===2&&(ae=arguments[1],fe=!0)):(q=we,z=arguments[1],J=arguments[3],arguments.length>2&&(ae=arguments[2],fe=!0)),q=""+q,z=""+z,J!==void 0&&(J=""+J);var Re=Y(this._isDirected,q,z,J);if(Object.hasOwn(this._edgeLabels,Re))return fe&&(this._edgeLabels[Re]=ae),this;if(J!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(q),this.setNode(z),this._edgeLabels[Re]=fe?ae:this._defaultEdgeLabelFn(q,z,J);var Pe=X(this._isDirected,q,z,J);return q=Pe.v,z=Pe.w,Object.freeze(Pe),this._edgeObjs[Re]=Pe,K(this._preds[z],q),K(this._sucs[q],z),this._in[z][Re]=Pe,this._out[q][Re]=Pe,this._edgeCount++,this}edge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J);return this._edgeLabels[ae]}edgeAsObj(){let q=this.edge(...arguments);return typeof q!="object"?{label:q}:q}hasEdge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J);return Object.hasOwn(this._edgeLabels,ae)}removeEdge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J),fe=this._edgeObjs[ae];return fe&&(q=fe.v,z=fe.w,delete this._edgeLabels[ae],delete this._edgeObjs[ae],Z(this._preds[z],q),Z(this._sucs[q],z),delete this._in[z][ae],delete this._out[q][ae],this._edgeCount--),this}inEdges(q,z){return this.isDirected()?this.filterEdges(this._in[q],q,z):this.nodeEdges(q,z)}outEdges(q,z){return this.isDirected()?this.filterEdges(this._out[q],q,z):this.nodeEdges(q,z)}nodeEdges(q,z){if(q in this._nodes)return this.filterEdges({...this._in[q],...this._out[q]},q,z)}filterEdges(q,z,J){if(q){var ae=Object.values(q);return J?ae.filter(function(fe){return fe.v===z&&fe.w===J||fe.v===J&&fe.w===z}):ae}}};function K(q,z){q[z]?q[z]++:q[z]=1}function Z(q,z){--q[z]||delete q[z]}function Y(q,z,J,ae){var fe=""+z,we=""+J;if(!q&&fe>we){var Re=fe;fe=we,we=Re}return fe+V+we+V+(ae===void 0?F:ae)}function X(q,z,J,ae){var fe=""+z,we=""+J;if(!q&&fe>we){var Re=fe;fe=we,we=Re}var Pe={v:fe,w:we};return ae&&(Pe.name=ae),Pe}function le(q,z){return Y(q,z.v,z.w,z.name)}O.exports=$}),a=n((A,O)=>{O.exports="3.0.2"}),l=n((A,O)=>{O.exports={Graph:r(),version:a()}}),c=n((A,O)=>{var F=r();O.exports={write:W,read:K};function W(Z){var Y={options:{directed:Z.isDirected(),multigraph:Z.isMultigraph(),compound:Z.isCompound()},nodes:V(Z),edges:$(Z)};return Z.graph()!==void 0&&(Y.value=structuredClone(Z.graph())),Y}function V(Z){return Z.nodes().map(function(Y){var X=Z.node(Y),le=Z.parent(Y),q={v:Y};return X!==void 0&&(q.value=X),le!==void 0&&(q.parent=le),q})}function $(Z){return Z.edges().map(function(Y){var X=Z.edge(Y),le={v:Y.v,w:Y.w};return Y.name!==void 0&&(le.name=Y.name),X!==void 0&&(le.value=X),le})}function K(Z){var Y=new F(Z.options).setGraph(Z.value);return Z.nodes.forEach(function(X){Y.setNode(X.v,X.value),X.parent&&Y.setParent(X.v,X.parent)}),Z.edges.forEach(function(X){Y.setEdge({v:X.v,w:X.w,name:X.name},X.value)}),Y}}),d=n((A,O)=>{O.exports=W;var F=()=>1;function W($,K,Z,Y){return V($,String(K),Z||F,Y||function(X){return $.outEdges(X)})}function V($,K,Z,Y){var X={},le=!0,q=0,z=$.nodes(),J=function(Re){var Pe=Z(Re);X[Re.v].distance+Pe<X[Re.w].distance&&(X[Re.w]={distance:X[Re.v].distance+Pe,predecessor:Re.v},le=!0)},ae=function(){z.forEach(function(Re){Y(Re).forEach(function(Pe){var Qe=Pe.v===Re?Pe.v:Pe.w,Yi=Qe===Pe.v?Pe.w:Pe.v;J({v:Qe,w:Yi})})})};z.forEach(function(Re){var Pe=Re===K?0:Number.POSITIVE_INFINITY;X[Re]={distance:Pe}});for(var fe=z.length,we=1;we<fe&&(le=!1,q++,ae(),!!le);we++);if(q===fe-1&&(le=!1,ae(),le))throw new Error("The graph contains a negative weight cycle");return X}}),h=n((A,O)=>{O.exports=F;function F(W){var V={},$=[],K;function Z(Y){Object.hasOwn(V,Y)||(V[Y]=!0,K.push(Y),W.successors(Y).forEach(Z),W.predecessors(Y).forEach(Z))}return W.nodes().forEach(function(Y){K=[],Z(Y),K.length&&$.push(K)}),$}}),u=n((A,O)=>{var F=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(W){return W.key})}has(W){return Object.hasOwn(this._keyIndices,W)}priority(W){var V=this._keyIndices[W];if(V!==void 0)return this._arr[V].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(W,V){var $=this._keyIndices;if(W=String(W),!Object.hasOwn($,W)){var K=this._arr,Z=K.length;return $[W]=Z,K.push({key:W,priority:V}),this._decrease(Z),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var W=this._arr.pop();return delete this._keyIndices[W.key],this._heapify(0),W.key}decrease(W,V){var $=this._keyIndices[W];if(V>this._arr[$].priority)throw new Error("New priority is greater than current priority. Key: "+W+" Old: "+this._arr[$].priority+" New: "+V);this._arr[$].priority=V,this._decrease($)}_heapify(W){var V=this._arr,$=2*W,K=$+1,Z=W;$<V.length&&(Z=V[$].priority<V[Z].priority?$:Z,K<V.length&&(Z=V[K].priority<V[Z].priority?K:Z),Z!==W&&(this._swap(W,Z),this._heapify(Z)))}_decrease(W){for(var V=this._arr,$=V[W].priority,K;W!==0&&(K=W>>1,!(V[K].priority<$));)this._swap(W,K),W=K}_swap(W,V){var $=this._arr,K=this._keyIndices,Z=$[W],Y=$[V];$[W]=Y,$[V]=Z,K[Y.key]=W,K[Z.key]=V}};O.exports=F}),f=n((A,O)=>{var F=u();O.exports=V;var W=()=>1;function V(K,Z,Y,X){var le=function(q){return K.outEdges(q)};return $(K,String(Z),Y||W,X||le)}function $(K,Z,Y,X){var le={},q=new F,z,J,ae=function(fe){var we=fe.v!==z?fe.v:fe.w,Re=le[we],Pe=Y(fe),Qe=J.distance+Pe;if(Pe<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+fe+" Weight: "+Pe);Qe<Re.distance&&(Re.distance=Qe,Re.predecessor=z,q.decrease(we,Qe))};for(K.nodes().forEach(function(fe){var we=fe===Z?0:Number.POSITIVE_INFINITY;le[fe]={distance:we},q.add(fe,we)});q.size()>0&&(z=q.removeMin(),J=le[z],J.distance!==Number.POSITIVE_INFINITY);)X(z).forEach(ae);return le}}),g=n((A,O)=>{var F=f();O.exports=W;function W(V,$,K){return V.nodes().reduce(function(Z,Y){return Z[Y]=F(V,Y,$,K),Z},{})}}),p=n((A,O)=>{O.exports=F;function F(V,$,K){if(V[$].predecessor!==void 0)throw new Error("Invalid source vertex");if(V[K].predecessor===void 0&&K!==$)throw new Error("Invalid destination vertex");return{weight:V[K].distance,path:W(V,$,K)}}function W(V,$,K){for(var Z=[],Y=K;Y!==$;)Z.push(Y),Y=V[Y].predecessor;return Z.push($),Z.reverse()}}),_=n((A,O)=>{O.exports=F;function F(W){var V=0,$=[],K={},Z=[];function Y(X){var le=K[X]={onStack:!0,lowlink:V,index:V++};if($.push(X),W.successors(X).forEach(function(J){Object.hasOwn(K,J)?K[J].onStack&&(le.lowlink=Math.min(le.lowlink,K[J].index)):(Y(J),le.lowlink=Math.min(le.lowlink,K[J].lowlink))}),le.lowlink===le.index){var q=[],z;do z=$.pop(),K[z].onStack=!1,q.push(z);while(X!==z);Z.push(q)}}return W.nodes().forEach(function(X){Object.hasOwn(K,X)||Y(X)}),Z}}),v=n((A,O)=>{var F=_();O.exports=W;function W(V){return F(V).filter(function($){return $.length>1||$.length===1&&V.hasEdge($[0],$[0])})}}),b=n((A,O)=>{O.exports=W;var F=()=>1;function W($,K,Z){return V($,K||F,Z||function(Y){return $.outEdges(Y)})}function V($,K,Z){var Y={},X=$.nodes();return X.forEach(function(le){Y[le]={},Y[le][le]={distance:0},X.forEach(function(q){le!==q&&(Y[le][q]={distance:Number.POSITIVE_INFINITY})}),Z(le).forEach(function(q){var z=q.v===le?q.w:q.v,J=K(q);Y[le][z]={distance:J,predecessor:le}})}),X.forEach(function(le){var q=Y[le];X.forEach(function(z){var J=Y[z];X.forEach(function(ae){var fe=J[le],we=q[ae],Re=J[ae],Pe=fe.distance+we.distance;Pe<Re.distance&&(Re.distance=Pe,Re.predecessor=we.predecessor)})})}),Y}}),w=n((A,O)=>{function F(V){var $={},K={},Z=[];function Y(X){if(Object.hasOwn(K,X))throw new W;Object.hasOwn($,X)||(K[X]=!0,$[X]=!0,V.predecessors(X).forEach(Y),delete K[X],Z.push(X))}if(V.sinks().forEach(Y),Object.keys($).length!==V.nodeCount())throw new W;return Z}var W=class extends Error{constructor(){super(...arguments)}};O.exports=F,F.CycleException=W}),C=n((A,O)=>{var F=w();O.exports=W;function W(V){try{F(V)}catch($){if($ instanceof F.CycleException)return!1;throw $}return!0}}),S=n((A,O)=>{O.exports=F;function F(V,$,K,Z,Y){Array.isArray($)||($=[$]);var X=(V.isDirected()?V.successors:V.neighbors).bind(V),le={};return $.forEach(function(q){if(!V.hasNode(q))throw new Error("Graph does not have node: "+q);Y=W(V,q,K==="post",le,X,Z,Y)}),Y}function W(V,$,K,Z,Y,X,le){return Object.hasOwn(Z,$)||(Z[$]=!0,K||(le=X(le,$)),Y($).forEach(function(q){le=W(V,q,K,Z,Y,X,le)}),K&&(le=X(le,$))),le}}),y=n((A,O)=>{var F=S();O.exports=W;function W(V,$,K){return F(V,$,K,function(Z,Y){return Z.push(Y),Z},[])}}),x=n((A,O)=>{var F=y();O.exports=W;function W(V,$){return F(V,$,"post")}}),L=n((A,O)=>{var F=y();O.exports=W;function W(V,$){return F(V,$,"pre")}}),D=n((A,O)=>{var F=r(),W=u();O.exports=V;function V($,K){var Z=new F,Y={},X=new W,le;function q(J){var ae=J.v===le?J.w:J.v,fe=X.priority(ae);if(fe!==void 0){var we=K(J);we<fe&&(Y[ae]=le,X.decrease(ae,we))}}if($.nodeCount()===0)return Z;$.nodes().forEach(function(J){X.add(J,Number.POSITIVE_INFINITY),Z.setNode(J)}),X.decrease($.nodes()[0],0);for(var z=!1;X.size()>0;){if(le=X.removeMin(),Object.hasOwn(Y,le))Z.setEdge(le,Y[le]);else{if(z)throw new Error("Input graph is not connected: "+$);z=!0}$.nodeEdges(le).forEach(q)}return Z}}),E=n((A,O)=>{var F=f(),W=d();O.exports=V;function V(K,Z,Y,X){return $(K,Z,Y,X||function(le){return K.outEdges(le)})}function $(K,Z,Y,X){if(Y===void 0)return F(K,Z,Y,X);for(var le=!1,q=K.nodes(),z=0;z<q.length;z++){for(var J=X(q[z]),ae=0;ae<J.length;ae++){var fe=J[ae],we=fe.v===q[z]?fe.v:fe.w,Re=we===fe.v?fe.w:fe.v;Y({v:we,w:Re})<0&&(le=!0)}if(le)return W(K,Z,Y,X)}return F(K,Z,Y,X)}}),T=n((A,O)=>{O.exports={bellmanFord:d(),components:h(),dijkstra:f(),dijkstraAll:g(),extractPath:p(),findCycles:v(),floydWarshall:b(),isAcyclic:C(),postorder:x(),preorder:L(),prim:D(),shortestPaths:E(),reduce:S(),tarjan:_(),topsort:w()}}),N=l();e.exports={Graph:N.Graph,json:c(),alg:T(),version:N.version}}),BHe=Ai((s,e)=>{var t=class{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,r=o._prev;if(r!==o)return i(r),r}enqueue(o){let r=this._sentinel;o._prev&&o._next&&i(o),o._next=r._next,r._next._prev=o,r._next=o,o._prev=r}toString(){let o=[],r=this._sentinel,a=r._prev;for(;a!==r;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}};function i(o){o._prev._next=o._next,o._next._prev=o._prev,delete o._next,delete o._prev}function n(o,r){if(o!=="_next"&&o!=="_prev")return r}e.exports=t}),HHe=Ai((s,e)=>{var t=Ol().Graph,i=BHe();e.exports=o;var n=()=>1;function o(h,u){if(h.nodeCount()<=1)return[];let f=l(h,u||n);return r(f.graph,f.buckets,f.zeroIdx).flatMap(g=>h.outEdges(g.v,g.w))}function r(h,u,f){let g=[],p=u[u.length-1],_=u[0],v;for(;h.nodeCount();){for(;v=_.dequeue();)a(h,u,f,v);for(;v=p.dequeue();)a(h,u,f,v);if(h.nodeCount()){for(let b=u.length-2;b>0;--b)if(v=u[b].dequeue(),v){g=g.concat(a(h,u,f,v,!0));break}}}return g}function a(h,u,f,g,p){let _=p?[]:void 0;return h.inEdges(g.v).forEach(v=>{let b=h.edge(v),w=h.node(v.v);p&&_.push({v:v.v,w:v.w}),w.out-=b,c(u,f,w)}),h.outEdges(g.v).forEach(v=>{let b=h.edge(v),w=v.w,C=h.node(w);C.in-=b,c(u,f,C)}),h.removeNode(g.v),_}function l(h,u){let f=new t,g=0,p=0;h.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let w=f.edge(b.v,b.w)||0,C=u(b),S=w+C;f.setEdge(b.v,b.w,S),p=Math.max(p,f.node(b.v).out+=C),g=Math.max(g,f.node(b.w).in+=C)});let _=d(p+g+3).map(()=>new i),v=g+1;return f.nodes().forEach(b=>{c(_,v,f.node(b))}),{graph:f,buckets:_,zeroIdx:v}}function c(h,u,f){f.out?f.in?h[f.out-f.in+u].enqueue(f):h[h.length-1].enqueue(f):h[0].enqueue(f)}function d(h){let u=[];for(let f=0;f<h;f++)u.push(f);return u}}),ts=Ai((s,e)=>{var t=Ol().Graph;e.exports={addBorderNode:u,addDummyNode:i,applyWithChunking:p,asNonCompoundGraph:o,buildLayerMatrix:c,intersectRect:l,mapValues:L,maxRank:_,normalizeRanks:d,notime:w,partition:v,pick:x,predecessorWeights:a,range:y,removeEmptyRanks:h,simplify:n,successorWeights:r,time:b,uniqueId:S,zipObject:D};function i(E,T,N,A){for(var O=A;E.hasNode(O);)O=S(A);return N.dummy=T,E.setNode(O,N),O}function n(E){let T=new t().setGraph(E.graph());return E.nodes().forEach(N=>T.setNode(N,E.node(N))),E.edges().forEach(N=>{let A=T.edge(N.v,N.w)||{weight:0,minlen:1},O=E.edge(N);T.setEdge(N.v,N.w,{weight:A.weight+O.weight,minlen:Math.max(A.minlen,O.minlen)})}),T}function o(E){let T=new t({multigraph:E.isMultigraph()}).setGraph(E.graph());return E.nodes().forEach(N=>{E.children(N).length||T.setNode(N,E.node(N))}),E.edges().forEach(N=>{T.setEdge(N,E.edge(N))}),T}function r(E){let T=E.nodes().map(N=>{let A={};return E.outEdges(N).forEach(O=>{A[O.w]=(A[O.w]||0)+E.edge(O).weight}),A});return D(E.nodes(),T)}function a(E){let T=E.nodes().map(N=>{let A={};return E.inEdges(N).forEach(O=>{A[O.v]=(A[O.v]||0)+E.edge(O).weight}),A});return D(E.nodes(),T)}function l(E,T){let N=E.x,A=E.y,O=T.x-N,F=T.y-A,W=E.width/2,V=E.height/2;if(!O&&!F)throw new Error("Not possible to find intersection inside of the rectangle");let $,K;return Math.abs(F)*W>Math.abs(O)*V?(F<0&&(V=-V),$=V*O/F,K=V):(O<0&&(W=-W),$=W,K=W*F/O),{x:N+$,y:A+K}}function c(E){let T=y(_(E)+1).map(()=>[]);return E.nodes().forEach(N=>{let A=E.node(N),O=A.rank;O!==void 0&&(T[O][A.order]=N)}),T}function d(E){let T=E.nodes().map(A=>{let O=E.node(A).rank;return O===void 0?Number.MAX_VALUE:O}),N=p(Math.min,T);E.nodes().forEach(A=>{let O=E.node(A);Object.hasOwn(O,"rank")&&(O.rank-=N)})}function h(E){let T=E.nodes().map(W=>E.node(W).rank).filter(W=>W!==void 0),N=p(Math.min,T),A=[];E.nodes().forEach(W=>{let V=E.node(W).rank-N;A[V]||(A[V]=[]),A[V].push(W)});let O=0,F=E.graph().nodeRankFactor;Array.from(A).forEach((W,V)=>{W===void 0&&V%F!==0?--O:W!==void 0&&O&&W.forEach($=>E.node($).rank+=O)})}function u(E,T,N,A){let O={width:0,height:0};return arguments.length>=4&&(O.rank=N,O.order=A),i(E,"border",O,T)}function f(E,T=g){let N=[];for(let A=0;A<E.length;A+=T){let O=E.slice(A,A+T);N.push(O)}return N}var g=65535;function p(E,T){if(T.length>g){let N=f(T);return E.apply(null,N.map(A=>E.apply(null,A)))}else return E.apply(null,T)}function _(E){let T=E.nodes().map(N=>{let A=E.node(N).rank;return A===void 0?Number.MIN_VALUE:A});return p(Math.max,T)}function v(E,T){let N={lhs:[],rhs:[]};return E.forEach(A=>{T(A)?N.lhs.push(A):N.rhs.push(A)}),N}function b(E,T){let N=Date.now();try{return T()}finally{console.log(E+" time: "+(Date.now()-N)+"ms")}}function w(E,T){return T()}var C=0;function S(E){var T=++C;return E+(""+T)}function y(E,T,N=1){T==null&&(T=E,E=0);let A=F=>F<T;N<0&&(A=F=>T<F);let O=[];for(let F=E;A(F);F+=N)O.push(F);return O}function x(E,T){let N={};for(let A of T)E[A]!==void 0&&(N[A]=E[A]);return N}function L(E,T){let N=T;return typeof T=="string"&&(N=A=>A[T]),Object.entries(E).reduce((A,[O,F])=>(A[O]=N(F,O),A),{})}function D(E,T){return E.reduce((N,A,O)=>(N[A]=T[O],N),{})}}),VHe=Ai((s,e)=>{var t=HHe(),i=ts().uniqueId;e.exports={run:n,undo:r};function n(a){(a.graph().acyclicer==="greedy"?t(a,l(a)):o(a)).forEach(c=>{let d=a.edge(c);a.removeEdge(c),d.forwardName=c.name,d.reversed=!0,a.setEdge(c.w,c.v,d,i("rev"))});function l(c){return d=>c.edge(d).weight}}function o(a){let l=[],c={},d={};function h(u){Object.hasOwn(d,u)||(d[u]=!0,c[u]=!0,a.outEdges(u).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):h(f.w)}),delete c[u])}return a.nodes().forEach(h),l}function r(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let d=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,d)}})}}),zHe=Ai((s,e)=>{var t=ts();e.exports={run:i,undo:o};function i(r){r.graph().dummyChains=[],r.edges().forEach(a=>n(r,a))}function n(r,a){let l=a.v,c=r.node(l).rank,d=a.w,h=r.node(d).rank,u=a.name,f=r.edge(a),g=f.labelRank;if(h===c+1)return;r.removeEdge(a);let p,_,v;for(v=0,++c;c<h;++v,++c)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},p=t.addDummyNode(r,"edge",_,"_d"),c===g&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),r.setEdge(l,p,{weight:f.weight},u),v===0&&r.graph().dummyChains.push(p),l=p;r.setEdge(l,d,{weight:f.weight},u)}function o(r){r.graph().dummyChains.forEach(a=>{let l=r.node(a),c=l.edgeLabel,d;for(r.setEdge(l.edgeObj,c);l.dummy;)d=r.successors(a)[0],r.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=d,l=r.node(a)})}}),ZE=Ai((s,e)=>{var{applyWithChunking:t}=ts();e.exports={longestPath:i,slack:n};function i(o){var r={};function a(l){var c=o.node(l);if(Object.hasOwn(r,l))return c.rank;r[l]=!0;let d=o.outEdges(l).map(u=>u==null?Number.POSITIVE_INFINITY:a(u.w)-o.edge(u).minlen);var h=t(Math.min,d);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}o.sources().forEach(a)}function n(o,r){return o.node(r.w).rank-o.node(r.v).rank-o.edge(r).minlen}}),are=Ai((s,e)=>{var t=Ol().Graph,i=ZE().slack;e.exports=n;function n(l){var c=new t({directed:!1}),d=l.nodes()[0],h=l.nodeCount();c.setNode(d,{});for(var u,f;o(c,l)<h;)u=r(c,l),f=c.hasNode(u.v)?i(l,u):-i(l,u),a(c,l,f);return c}function o(l,c){function d(h){c.nodeEdges(h).forEach(u=>{var f=u.v,g=h===f?u.w:f;!l.hasNode(g)&&!i(c,u)&&(l.setNode(g,{}),l.setEdge(h,g,{}),d(g))})}return l.nodes().forEach(d),l.nodeCount()}function r(l,c){return c.edges().reduce((d,h)=>{let u=Number.POSITIVE_INFINITY;return l.hasNode(h.v)!==l.hasNode(h.w)&&(u=i(c,h)),u<d[0]?[u,h]:d},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,d){l.nodes().forEach(h=>c.node(h).rank+=d)}}),UHe=Ai((s,e)=>{var t=are(),i=ZE().slack,n=ZE().longestPath,o=Ol().alg.preorder,r=Ol().alg.postorder,a=ts().simplify;e.exports=l,l.initLowLimValues=u,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=p,l.exchangeEdges=_;function l(C){C=a(C),n(C);var S=t(C);u(S),c(S,C);for(var y,x;y=g(S);)x=p(S,C,y),_(S,C,y,x)}function c(C,S){var y=r(C,C.nodes());y=y.slice(0,y.length-1),y.forEach(x=>d(C,S,x))}function d(C,S,y){var x=C.node(y),L=x.parent;C.edge(y,L).cutvalue=h(C,S,y)}function h(C,S,y){var x=C.node(y),L=x.parent,D=!0,E=S.edge(y,L),T=0;return E||(D=!1,E=S.edge(L,y)),T=E.weight,S.nodeEdges(y).forEach(N=>{var A=N.v===y,O=A?N.w:N.v;if(O!==L){var F=A===D,W=S.edge(N).weight;if(T+=F?W:-W,b(C,y,O)){var V=C.edge(y,O).cutvalue;T+=F?-V:V}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),f(C,{},1,S)}function f(C,S,y,x,L){var D=y,E=C.node(x);return S[x]=!0,C.neighbors(x).forEach(T=>{Object.hasOwn(S,T)||(y=f(C,S,y,T,x))}),E.low=D,E.lim=y++,L?E.parent=L:delete E.parent,y}function g(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,y){var x=y.v,L=y.w;S.hasEdge(x,L)||(x=y.w,L=y.v);var D=C.node(x),E=C.node(L),T=D,N=!1;D.lim>E.lim&&(T=E,N=!0);var A=S.edges().filter(O=>N===w(C,C.node(O.v),T)&&N!==w(C,C.node(O.w),T));return A.reduce((O,F)=>i(S,F)<i(S,O)?F:O)}function _(C,S,y,x){var L=y.v,D=y.w;C.removeEdge(L,D),C.setEdge(x.v,x.w,{}),u(C),c(C,S),v(C,S)}function v(C,S){var y=C.nodes().find(L=>!S.node(L).parent),x=o(C,y);x=x.slice(1),x.forEach(L=>{var D=C.node(L).parent,E=S.edge(L,D),T=!1;E||(E=S.edge(D,L),T=!0),S.node(L).rank=S.node(D).rank+(T?E.minlen:-E.minlen)})}function b(C,S,y){return C.hasEdge(S,y)}function w(C,S,y){return y.low<=S.lim&&S.lim<=y.lim}}),$He=Ai((s,e)=>{var t=ZE(),i=t.longestPath,n=are(),o=UHe();e.exports=r;function r(d){var h=d.graph().ranker;if(h instanceof Function)return h(d);switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":a(d);break;case"none":break;default:c(d)}}var a=i;function l(d){i(d),n(d)}function c(d){o(d)}}),jHe=Ai((s,e)=>{e.exports=t;function t(o){let r=n(o);o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeObj,d=i(o,r,c.v,c.w),h=d.path,u=d.lca,f=0,g=h[f],p=!0;for(;a!==c.w;){if(l=o.node(a),p){for(;(g=h[f])!==u&&o.node(g).maxRank<l.rank;)f++;g===u&&(p=!1)}if(!p){for(;f<h.length-1&&o.node(g=h[f+1]).minRank<=l.rank;)f++;g=h[f]}o.setParent(a,g),a=o.successors(a)[0]}})}function i(o,r,a,l){let c=[],d=[],h=Math.min(r[a].low,r[l].low),u=Math.max(r[a].lim,r[l].lim),f,g;f=a;do f=o.parent(f),c.push(f);while(f&&(r[f].low>h||u>r[f].lim));for(g=f,f=l;(f=o.parent(f))!==g;)d.push(f);return{path:c.concat(d.reverse()),lca:g}}function n(o){let r={},a=0;function l(c){let d=a;o.children(c).forEach(l),r[c]={low:d,lim:a++}}return o.children().forEach(l),r}}),qHe=Ai((s,e)=>{var t=ts();e.exports={run:i,cleanup:a};function i(l){let c=t.addDummyNode(l,"root",{},"_root"),d=o(l),h=Object.values(d),u=t.applyWithChunking(Math.max,h)-1,f=2*u+1;l.graph().nestingRoot=c,l.edges().forEach(p=>l.edge(p).minlen*=f);let g=r(l)+1;l.children().forEach(p=>n(l,c,f,g,u,d,p)),l.graph().nodeRankFactor=f}function n(l,c,d,h,u,f,g){let p=l.children(g);if(!p.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:d});return}let _=t.addBorderNode(l,"_bt"),v=t.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(_,g),b.borderTop=_,l.setParent(v,g),b.borderBottom=v,p.forEach(w=>{n(l,c,d,h,u,f,w);let C=l.node(w),S=C.borderTop?C.borderTop:w,y=C.borderBottom?C.borderBottom:w,x=C.borderTop?h:2*h,L=S!==y?1:u-f[g]+1;l.setEdge(_,S,{weight:x,minlen:L,nestingEdge:!0}),l.setEdge(y,v,{weight:x,minlen:L,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,_,{weight:0,minlen:u+f[g]})}function o(l){var c={};function d(h,u){var f=l.children(h);f&&f.length&&f.forEach(g=>d(g,u+1)),c[h]=u}return l.children().forEach(h=>d(h,1)),c}function r(l){return l.edges().reduce((c,d)=>c+l.edge(d).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(d=>{var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}}),KHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(o){function r(a){let l=o.children(a),c=o.node(a);if(l.length&&l.forEach(r),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let d=c.minRank,h=c.maxRank+1;d<h;++d)n(o,"borderLeft","_bl",a,c,d),n(o,"borderRight","_br",a,c,d)}}o.children().forEach(r)}function n(o,r,a,l,c,d){let h={width:0,height:0,rank:d,borderType:r},u=c[r][d-1],f=t.addDummyNode(o,"border",h,a);c[r][d]=f,o.setParent(f,l),u&&o.setEdge(u,f,{weight:1})}}),GHe=Ai((s,e)=>{e.exports={adjust:t,undo:i};function t(d){let h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(d)}function i(d){let h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&r(d),(h==="lr"||h==="rl")&&(l(d),n(d))}function n(d){d.nodes().forEach(h=>o(d.node(h))),d.edges().forEach(h=>o(d.edge(h)))}function o(d){let h=d.width;d.width=d.height,d.height=h}function r(d){d.nodes().forEach(h=>a(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(a),Object.hasOwn(u,"y")&&a(u)})}function a(d){d.y=-d.y}function l(d){d.nodes().forEach(h=>c(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(c),Object.hasOwn(u,"x")&&c(u)})}function c(d){let h=d.x;d.x=d.y,d.y=h}}),YHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(n){let o={},r=n.nodes().filter(h=>!n.children(h).length),a=r.map(h=>n.node(h).rank),l=t.applyWithChunking(Math.max,a),c=t.range(l+1).map(()=>[]);function d(h){if(o[h])return;o[h]=!0;let u=n.node(h);c[u.rank].push(h),n.successors(h).forEach(d)}return r.sort((h,u)=>n.node(h).rank-n.node(u).rank).forEach(d),c}}),ZHe=Ai((s,e)=>{var t=ts().zipObject;e.exports=i;function i(o,r){let a=0;for(let l=1;l<r.length;++l)a+=n(o,r[l-1],r[l]);return a}function n(o,r,a){let l=t(a,a.map((g,p)=>p)),c=r.flatMap(g=>o.outEdges(g).map(p=>({pos:l[p.w],weight:o.edge(p).weight})).sort((p,_)=>p.pos-_.pos)),d=1;for(;d<a.length;)d<<=1;let h=2*d-1;d-=1;let u=new Array(h).fill(0),f=0;return c.forEach(g=>{let p=g.pos+d;u[p]+=g.weight;let _=0;for(;p>0;)p%2&&(_+=u[p+1]),p=p-1>>1,u[p]+=g.weight;f+=g.weight*_}),f}}),XHe=Ai((s,e)=>{e.exports=t;function t(i,n=[]){return n.map(o=>{let r=i.inEdges(o);if(r.length){let a=r.reduce((l,c)=>{let d=i.edge(c),h=i.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:o}})}}),QHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(r,a){let l={};r.forEach((d,h)=>{let u=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};d.barycenter!==void 0&&(u.barycenter=d.barycenter,u.weight=d.weight)}),a.edges().forEach(d=>{let h=l[d.v],u=l[d.w];h!==void 0&&u!==void 0&&(u.indegree++,h.out.push(l[d.w]))});let c=Object.values(l).filter(d=>!d.indegree);return n(c)}function n(r){let a=[];function l(d){return h=>{h.merged||(h.barycenter===void 0||d.barycenter===void 0||h.barycenter>=d.barycenter)&&o(d,h)}}function c(d){return h=>{h.in.push(d),--h.indegree===0&&r.push(h)}}for(;r.length;){let d=r.pop();a.push(d),d.in.reverse().forEach(l(d)),d.out.forEach(c(d))}return a.filter(d=>!d.merged).map(d=>t.pick(d,["vs","i","barycenter","weight"]))}function o(r,a){let l=0,c=0;r.weight&&(l+=r.barycenter*r.weight,c+=r.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),r.vs=a.vs.concat(r.vs),r.barycenter=l/c,r.weight=c,r.i=Math.min(a.i,r.i),a.merged=!0}}),JHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(r,a){let l=t.partition(r,_=>Object.hasOwn(_,"barycenter")),c=l.lhs,d=l.rhs.sort((_,v)=>v.i-_.i),h=[],u=0,f=0,g=0;c.sort(o(!!a)),g=n(h,d,g),c.forEach(_=>{g+=_.vs.length,h.push(_.vs),u+=_.barycenter*_.weight,f+=_.weight,g=n(h,d,g)});let p={vs:h.flat(!0)};return f&&(p.barycenter=u/f,p.weight=f),p}function n(r,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),r.push(c.vs),l++;return l}function o(r){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:r?l.i-a.i:a.i-l.i}}),eVe=Ai((s,e)=>{var t=XHe(),i=QHe(),n=JHe();e.exports=o;function o(l,c,d,h){let u=l.children(c),f=l.node(c),g=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,_={};g&&(u=u.filter(C=>C!==g&&C!==p));let v=t(l,u);v.forEach(C=>{if(l.children(C.v).length){let S=o(l,C.v,d,h);_[C.v]=S,Object.hasOwn(S,"barycenter")&&a(C,S)}});let b=i(v,d);r(b,_);let w=n(b,h);if(g&&(w.vs=[g,w.vs,p].flat(!0),l.predecessors(g).length)){let C=l.node(l.predecessors(g)[0]),S=l.node(l.predecessors(p)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+C.order+S.order)/(w.weight+2),w.weight+=2}return w}function r(l,c){l.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),tVe=Ai((s,e)=>{var t=Ol().Graph,i=ts();e.exports=n;function n(r,a,l,c){c||(c=r.nodes());let d=o(r),h=new t({compound:!0}).setGraph({root:d}).setDefaultNodeLabel(u=>r.node(u));return c.forEach(u=>{let f=r.node(u),g=r.parent(u);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(h.setNode(u),h.setParent(u,g||d),r[l](u).forEach(p=>{let _=p.v===u?p.w:p.v,v=h.edge(_,u),b=v!==void 0?v.weight:0;h.setEdge(_,u,{weight:r.edge(p).weight+b})}),Object.hasOwn(f,"minRank")&&h.setNode(u,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),h}function o(r){for(var a;r.hasNode(a=i.uniqueId("_root")););return a}}),iVe=Ai((s,e)=>{e.exports=t;function t(i,n,o){let r={},a;o.forEach(l=>{let c=i.parent(l),d,h;for(;c;){if(d=i.parent(c),d?(h=r[d],r[d]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=d}})}}),nVe=Ai((s,e)=>{var t=YHe(),i=ZHe(),n=eVe(),o=tVe(),r=iVe(),a=Ol().Graph,l=ts();e.exports=c;function c(f,g={}){if(typeof g.customOrder=="function"){g.customOrder(f,c);return}let p=l.maxRank(f),_=d(f,l.range(1,p+1),"inEdges"),v=d(f,l.range(p-1,-1,-1),"outEdges"),b=t(f);if(u(f,b),g.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,C,S=g.constraints||[];for(let y=0,x=0;x<4;++y,++x){h(y%2?_:v,y%4>=2,S),b=l.buildLayerMatrix(f);let L=i(f,b);L<w?(x=0,C=Object.assign({},b),w=L):L===w&&(C=structuredClone(b))}u(f,C)}function d(f,g,p){let _=new Map,v=(b,w)=>{_.has(b)||_.set(b,[]),_.get(b).push(w)};for(let b of f.nodes()){let w=f.node(b);if(typeof w.rank=="number"&&v(w.rank,b),typeof w.minRank=="number"&&typeof w.maxRank=="number")for(let C=w.minRank;C<=w.maxRank;C++)C!==w.rank&&v(C,b)}return g.map(function(b){return o(f,b,p,_.get(b)||[])})}function h(f,g,p){let _=new a;f.forEach(function(v){p.forEach(C=>_.setEdge(C.left,C.right));let b=v.graph().root,w=n(v,b,_,g);w.vs.forEach((C,S)=>v.node(C).order=S),r(v,_,w.vs)})}function u(f,g){Object.values(g).forEach(p=>p.forEach((_,v)=>f.node(_).order=v))}}),sVe=Ai((s,e)=>{var t=Ol().Graph,i=ts();e.exports={positionX:p,findType1Conflicts:n,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:u,balance:g};function n(b,w){let C={};function S(y,x){let L=0,D=0,E=y.length,T=x[x.length-1];return x.forEach((N,A)=>{let O=r(b,N),F=O?b.node(O).order:E;(O||N===T)&&(x.slice(D,A+1).forEach(W=>{b.predecessors(W).forEach(V=>{let $=b.node(V),K=$.order;(K<L||F<K)&&!($.dummy&&b.node(W).dummy)&&a(C,V,W)})}),D=A+1,L=F)}),x}return w.length&&w.reduce(S),C}function o(b,w){let C={};function S(x,L,D,E,T){let N;i.range(L,D).forEach(A=>{N=x[A],b.node(N).dummy&&b.predecessors(N).forEach(O=>{let F=b.node(O);F.dummy&&(F.order<E||F.order>T)&&a(C,O,N)})})}function y(x,L){let D=-1,E,T=0;return L.forEach((N,A)=>{if(b.node(N).dummy==="border"){let O=b.predecessors(N);O.length&&(E=b.node(O[0]).order,S(L,T,A,D,E),T=A,D=E)}S(L,T,L.length,E,x.length)}),L}return w.length&&w.reduce(y),C}function r(b,w){if(b.node(w).dummy)return b.predecessors(w).find(C=>b.node(C).dummy)}function a(b,w,C){if(w>C){let y=w;w=C,C=y}let S=b[w];S||(b[w]=S={}),S[C]=!0}function l(b,w,C){if(w>C){let S=w;w=C,C=S}return!!b[w]&&Object.hasOwn(b[w],C)}function c(b,w,C,S){let y={},x={},L={};return w.forEach(D=>{D.forEach((E,T)=>{y[E]=E,x[E]=E,L[E]=T})}),w.forEach(D=>{let E=-1;D.forEach(T=>{let N=S(T);if(N.length){N=N.sort((O,F)=>L[O]-L[F]);let A=(N.length-1)/2;for(let O=Math.floor(A),F=Math.ceil(A);O<=F;++O){let W=N[O];x[T]===T&&E<L[W]&&!l(C,T,W)&&(x[W]=T,x[T]=y[T]=y[W],E=L[W])}}})}),{root:y,align:x}}function d(b,w,C,S,y){let x={},L=h(b,w,C,y),D=y?"borderLeft":"borderRight";function E(A,O){let F=L.nodes().slice(),W={},V=F.pop();for(;V;){if(W[V])A(V);else{W[V]=!0,F.push(V);for(let $ of O(V))F.push($)}V=F.pop()}}function T(A){x[A]=L.inEdges(A).reduce((O,F)=>Math.max(O,x[F.v]+L.edge(F)),0)}function N(A){let O=L.outEdges(A).reduce((W,V)=>Math.min(W,x[V.w]-L.edge(V)),Number.POSITIVE_INFINITY),F=b.node(A);O!==Number.POSITIVE_INFINITY&&F.borderType!==D&&(x[A]=Math.max(x[A],O))}return E(T,L.predecessors.bind(L)),E(N,L.successors.bind(L)),Object.keys(S).forEach(A=>x[A]=x[C[A]]),x}function h(b,w,C,S){let y=new t,x=b.graph(),L=_(x.nodesep,x.edgesep,S);return w.forEach(D=>{let E;D.forEach(T=>{let N=C[T];if(y.setNode(N),E){var A=C[E],O=y.edge(A,N);y.setEdge(A,N,Math.max(L(b,T,E),O||0))}E=T})}),y}function u(b,w){return Object.values(w).reduce((C,S)=>{let y=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([D,E])=>{let T=v(b,D)/2;y=Math.max(E+T,y),x=Math.min(E-T,x)});let L=y-x;return L<C[0]&&(C=[L,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function f(b,w){let C=Object.values(w),S=i.applyWithChunking(Math.min,C),y=i.applyWithChunking(Math.max,C);["u","d"].forEach(x=>{["l","r"].forEach(L=>{let D=x+L,E=b[D];if(E===w)return;let T=Object.values(E),N=S-i.applyWithChunking(Math.min,T);L!=="l"&&(N=y-i.applyWithChunking(Math.max,T)),N&&(b[D]=i.mapValues(E,A=>A+N))})})}function g(b,w){return i.mapValues(b.ul,(C,S)=>{if(w)return b[w.toLowerCase()][S];{let y=Object.values(b).map(x=>x[S]).sort((x,L)=>x-L);return(y[1]+y[2])/2}})}function p(b){let w=i.buildLayerMatrix(b),C=Object.assign(n(b,w),o(b,w)),S={},y;["u","d"].forEach(L=>{y=L==="u"?w:Object.values(w).reverse(),["l","r"].forEach(D=>{D==="r"&&(y=y.map(A=>Object.values(A).reverse()));let E=(L==="u"?b.predecessors:b.successors).bind(b),T=c(b,y,C,E),N=d(b,y,T.root,T.align,D==="r");D==="r"&&(N=i.mapValues(N,A=>-A)),S[L+D]=N})});let x=u(b,S);return f(S,x),g(S,b.graph().align)}function _(b,w,C){return(S,y,x)=>{let L=S.node(y),D=S.node(x),E=0,T;if(E+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":T=-L.width/2;break;case"r":T=L.width/2;break}if(T&&(E+=C?T:-T),T=0,E+=(L.dummy?w:b)/2,E+=(D.dummy?w:b)/2,E+=D.width/2,Object.hasOwn(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":T=D.width/2;break;case"r":T=-D.width/2;break}return T&&(E+=C?T:-T),T=0,E}}function v(b,w){return b.node(w).width}}),oVe=Ai((s,e)=>{var t=ts(),i=sVe().positionX;e.exports=n;function n(r){r=t.asNonCompoundGraph(r),o(r),Object.entries(i(r)).forEach(([a,l])=>r.node(a).x=l)}function o(r){let a=t.buildLayerMatrix(r),l=r.graph().ranksep,c=r.graph().rankalign,d=0;a.forEach(h=>{let u=h.reduce((f,g)=>{let p=r.node(g).height;return f>p?f:p},0);h.forEach(f=>{let g=r.node(f);c==="top"?g.y=d+g.height/2:c==="bottom"?g.y=d+u-g.height/2:g.y=d+u/2}),d+=u+l})}}),rVe=Ai((s,e)=>{var t=VHe(),i=zHe(),n=$He(),o=ts().normalizeRanks,r=jHe(),a=ts().removeEmptyRanks,l=qHe(),c=KHe(),d=GHe(),h=nVe(),u=oVe(),f=ts(),g=Ol().Graph;e.exports=p;function p(z,J={}){let ae=J.debugTiming?f.time:f.notime;return ae("layout",()=>{let fe=ae(" buildLayoutGraph",()=>E(z));return ae(" runLayout",()=>_(fe,ae,J)),ae(" updateInputGraph",()=>v(z,fe)),fe})}function _(z,J,ae){J(" makeSpaceForEdgeLabels",()=>T(z)),J(" removeSelfEdges",()=>Z(z)),J(" acyclic",()=>t.run(z)),J(" nestingGraph.run",()=>l.run(z)),J(" rank",()=>n(f.asNonCompoundGraph(z))),J(" injectEdgeLabelProxies",()=>N(z)),J(" removeEmptyRanks",()=>a(z)),J(" nestingGraph.cleanup",()=>l.cleanup(z)),J(" normalizeRanks",()=>o(z)),J(" assignRankMinMax",()=>A(z)),J(" removeEdgeLabelProxies",()=>O(z)),J(" normalize.run",()=>i.run(z)),J(" parentDummyChains",()=>r(z)),J(" addBorderSegments",()=>c(z)),J(" order",()=>h(z,ae)),J(" insertSelfEdges",()=>Y(z)),J(" adjustCoordinateSystem",()=>d.adjust(z)),J(" position",()=>u(z)),J(" positionSelfEdges",()=>X(z)),J(" removeBorderNodes",()=>K(z)),J(" normalize.undo",()=>i.undo(z)),J(" fixupEdgeLabelCoords",()=>V(z)),J(" undoCoordinateSystem",()=>d.undo(z)),J(" translateGraph",()=>F(z)),J(" assignNodeIntersects",()=>W(z)),J(" reversePoints",()=>$(z)),J(" acyclic.undo",()=>t.undo(z))}function v(z,J){z.nodes().forEach(ae=>{let fe=z.node(ae),we=J.node(ae);fe&&(fe.x=we.x,fe.y=we.y,fe.order=we.order,fe.rank=we.rank,J.children(ae).length&&(fe.width=we.width,fe.height=we.height))}),z.edges().forEach(ae=>{let fe=z.edge(ae),we=J.edge(ae);fe.points=we.points,Object.hasOwn(we,"x")&&(fe.x=we.x,fe.y=we.y)}),z.graph().width=J.graph().width,z.graph().height=J.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],S=["width","height","rank"],y={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function E(z){let J=new g({multigraph:!0,compound:!0}),ae=q(z.graph());return J.setGraph(Object.assign({},w,le(ae,b),f.pick(ae,C))),z.nodes().forEach(fe=>{let we=q(z.node(fe)),Re=le(we,S);Object.keys(y).forEach(Pe=>{Re[Pe]===void 0&&(Re[Pe]=y[Pe])}),J.setNode(fe,Re),J.setParent(fe,z.parent(fe))}),z.edges().forEach(fe=>{let we=q(z.edge(fe));J.setEdge(fe,Object.assign({},L,le(we,x),f.pick(we,D)))}),J}function T(z){let J=z.graph();J.ranksep/=2,z.edges().forEach(ae=>{let fe=z.edge(ae);fe.minlen*=2,fe.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?fe.width+=fe.labeloffset:fe.height+=fe.labeloffset)})}function N(z){z.edges().forEach(J=>{let ae=z.edge(J);if(ae.width&&ae.height){let fe=z.node(J.v),we={rank:(z.node(J.w).rank-fe.rank)/2+fe.rank,e:J};f.addDummyNode(z,"edge-proxy",we,"_ep")}})}function A(z){let J=0;z.nodes().forEach(ae=>{let fe=z.node(ae);fe.borderTop&&(fe.minRank=z.node(fe.borderTop).rank,fe.maxRank=z.node(fe.borderBottom).rank,J=Math.max(J,fe.maxRank))}),z.graph().maxRank=J}function O(z){z.nodes().forEach(J=>{let ae=z.node(J);ae.dummy==="edge-proxy"&&(z.edge(ae.e).labelRank=ae.rank,z.removeNode(J))})}function F(z){let J=Number.POSITIVE_INFINITY,ae=0,fe=Number.POSITIVE_INFINITY,we=0,Re=z.graph(),Pe=Re.marginx||0,Qe=Re.marginy||0;function Yi(Qt){let Ji=Qt.x,ao=Qt.y,lo=Qt.width,No=Qt.height;J=Math.min(J,Ji-lo/2),ae=Math.max(ae,Ji+lo/2),fe=Math.min(fe,ao-No/2),we=Math.max(we,ao+No/2)}z.nodes().forEach(Qt=>Yi(z.node(Qt))),z.edges().forEach(Qt=>{let Ji=z.edge(Qt);Object.hasOwn(Ji,"x")&&Yi(Ji)}),J-=Pe,fe-=Qe,z.nodes().forEach(Qt=>{let Ji=z.node(Qt);Ji.x-=J,Ji.y-=fe}),z.edges().forEach(Qt=>{let Ji=z.edge(Qt);Ji.points.forEach(ao=>{ao.x-=J,ao.y-=fe}),Object.hasOwn(Ji,"x")&&(Ji.x-=J),Object.hasOwn(Ji,"y")&&(Ji.y-=fe)}),Re.width=ae-J+Pe,Re.height=we-fe+Qe}function W(z){z.edges().forEach(J=>{let ae=z.edge(J),fe=z.node(J.v),we=z.node(J.w),Re,Pe;ae.points?(Re=ae.points[0],Pe=ae.points[ae.points.length-1]):(ae.points=[],Re=we,Pe=fe),ae.points.unshift(f.intersectRect(fe,Re)),ae.points.push(f.intersectRect(we,Pe))})}function V(z){z.edges().forEach(J=>{let ae=z.edge(J);if(Object.hasOwn(ae,"x"))switch((ae.labelpos==="l"||ae.labelpos==="r")&&(ae.width-=ae.labeloffset),ae.labelpos){case"l":ae.x-=ae.width/2+ae.labeloffset;break;case"r":ae.x+=ae.width/2+ae.labeloffset;break}})}function $(z){z.edges().forEach(J=>{let ae=z.edge(J);ae.reversed&&ae.points.reverse()})}function K(z){z.nodes().forEach(J=>{if(z.children(J).length){let ae=z.node(J),fe=z.node(ae.borderTop),we=z.node(ae.borderBottom),Re=z.node(ae.borderLeft[ae.borderLeft.length-1]),Pe=z.node(ae.borderRight[ae.borderRight.length-1]);ae.width=Math.abs(Pe.x-Re.x),ae.height=Math.abs(we.y-fe.y),ae.x=Re.x+ae.width/2,ae.y=fe.y+ae.height/2}}),z.nodes().forEach(J=>{z.node(J).dummy==="border"&&z.removeNode(J)})}function Z(z){z.edges().forEach(J=>{if(J.v===J.w){var ae=z.node(J.v);ae.selfEdges||(ae.selfEdges=[]),ae.selfEdges.push({e:J,label:z.edge(J)}),z.removeEdge(J)}})}function Y(z){var J=f.buildLayerMatrix(z);J.forEach(ae=>{var fe=0;ae.forEach((we,Re)=>{var Pe=z.node(we);Pe.order=Re+fe,(Pe.selfEdges||[]).forEach(Qe=>{f.addDummyNode(z,"selfedge",{width:Qe.label.width,height:Qe.label.height,rank:Pe.rank,order:Re+ ++fe,e:Qe.e,label:Qe.label},"_se")}),delete Pe.selfEdges})})}function X(z){z.nodes().forEach(J=>{var ae=z.node(J);if(ae.dummy==="selfedge"){var fe=z.node(ae.e.v),we=fe.x+fe.width/2,Re=fe.y,Pe=ae.x-we,Qe=fe.height/2;z.setEdge(ae.e,ae.label),z.removeNode(J),ae.label.points=[{x:we+2*Pe/3,y:Re-Qe},{x:we+5*Pe/6,y:Re-Qe},{x:we+Pe,y:Re},{x:we+5*Pe/6,y:Re+Qe},{x:we+2*Pe/3,y:Re+Qe}],ae.label.x=ae.x,ae.label.y=ae.y}})}function le(z,J){return f.mapValues(f.pick(z,J),Number)}function q(z){var J={};return z&&Object.entries(z).forEach(([ae,fe])=>{typeof ae=="string"&&(ae=ae.toLowerCase()),J[ae]=fe}),J}}),aVe=Ai((s,e)=>{var t=ts(),i=Ol().Graph;e.exports={debugOrdering:n};function n(o){let r=t.buildLayerMatrix(o),a=new i({compound:!0,multigraph:!0}).setGraph({});return o.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+o.node(l).rank)}),o.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),r.forEach((l,c)=>{let d="layer"+c;a.setNode(d,{rank:"same"}),l.reduce((h,u)=>(a.setEdge(h,u,{style:"invis"}),u))}),a}}),lVe=Ai((s,e)=>{e.exports="2.0.4"}),cVe=Ai((s,e)=>{e.exports={graphlib:Ol(),layout:rVe(),debug:aVe(),util:{time:ts().time,notime:ts().notime},version:lVe()}});const _Y=cVe();/*! For license information please see dagre.esm.js.LEGAL.txt */const bY=300,vY=100;function gP(s,e,t="TB"){const i=new _Y.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:t,ranksep:80,nodesep:40});for(const o of s)i.setNode(o.id,{width:bY,height:vY});for(const o of e)i.setEdge(o.source,o.target);return _Y.layout(i),{nodes:s.map(o=>{const r=i.node(o.id);return{...o,position:{x:r.x-bY/2,y:r.y-vY/2}}}),edges:e}}function dVe({data:s}){var r;const e=s,[t,i]=je.useState(!1),n=e.status==="root"?"file-node--root":e.status==="expanded"?"file-node--expanded":e.status==="loading"?"file-node--loading":e.status==="error"?"file-node--error":"file-node--collapsed",o=e.repoAlias?"file-node--cross-repo":"";return me.jsxs("div",{className:`file-node ${n} ${o}`,children:[!e.isRoot&&me.jsx(hV,{type:"target",position:uV.Top}),me.jsxs("div",{className:"file-node__header",children:[me.jsx("span",{className:"file-node__icon",children:e.isRoot?"📄":e.status==="expanded"?"📋":e.repoAlias?"🔗":"📁"}),me.jsx("span",{className:"file-node__label",title:e.filePath,children:e.label}),me.jsx("span",{className:"file-node__actions",children:e.adoUrl&&me.jsx("a",{href:e.adoUrl,target:"_blank",rel:"noopener noreferrer",className:"file-node__action-btn",title:"Open in Azure DevOps",onClick:a=>a.stopPropagation(),children:me.jsx(hVe,{})})})]}),e.repoAlias&&me.jsxs("div",{className:"file-node__repo-row",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[me.jsxs("span",{className:"file-node__repo",children:["@",e.repoAlias]}),e.repoInfo&&t&&me.jsxs("div",{className:"file-node__repo-tooltip",children:[me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Repo"}),me.jsx("span",{children:e.repoInfo.fullName})]}),me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Type"}),me.jsx("span",{children:e.repoInfo.type})]}),e.repoInfo.ref&&me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Ref"}),me.jsx("span",{children:e.repoInfo.ref})]}),e.repoInfo.project&&me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Project"}),me.jsx("span",{children:e.repoInfo.project})]})]})]}),me.jsxs("div",{className:"file-node__meta",children:[e.status==="loading"&&me.jsx("span",{className:"file-node__spinner",children:"⏳ Loading..."}),e.status==="error"&&me.jsxs("span",{className:"file-node__error",title:e.errorMessage,children:["❌ ",(r=e.errorMessage)==null?void 0:r.slice(0,80)]}),e.status==="collapsed"&&me.jsx("span",{className:"file-node__hint",children:"Click to expand"}),e.status==="expanded"&&e.templateCount===0&&!e.isRoot&&me.jsx("span",{className:"file-node__leaf",children:"✓ no nested templates"}),(e.status==="root"||e.status==="expanded")&&e.templateCount>0&&me.jsxs("span",{className:"file-node__count",children:[e.templateCount," template ref(s)"]})]}),me.jsx(hV,{type:"source",position:uV.Bottom})]})}function hVe(){return me.jsx("svg",{width:"14",height:"14",viewBox:"0 0 18 18",className:"file-node__ado-icon","aria-label":"Azure DevOps",children:me.jsx("path",{d:"M17 4v9.74l-4 3.28-6.2-2.26V17l-3.51-4.59 10.23.8V4.44zm-3.41.49L7.85 1v2.29L2.58 4.84 1 6.87v4.61l2.26 1V6.57z",fill:"#3c91e5"})})}const uVe=je.memo(dVe);function pP({className:s,label:e,children:t}){const[i,n]=je.useState(!1);return me.jsxs("span",{className:s,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[e,i&&me.jsx("div",{className:"template-edge__badge-tooltip",children:t})]})}function fVe({id:s,sourceX:e,sourceY:t,targetX:i,targetY:n,sourcePosition:o,targetPosition:r,data:a,markerEnd:l,style:c}){var w;const d=a,[h,u]=je.useState(!1),[f,g,p]=kre({sourceX:e,sourceY:t,sourcePosition:o,targetX:i,targetY:n,targetPosition:r}),_=je.useCallback(()=>u(!0),[]),v=je.useCallback(()=>u(!1),[]),b=((w=d==null?void 0:d.parameterNames)==null?void 0:w.length)??0;return me.jsxs(me.Fragment,{children:[me.jsx(Ire,{id:s,path:f,markerEnd:l,style:c}),me.jsx(Dre,{children:me.jsxs("div",{className:"template-edge__label-container",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${g}px,${p}px)`,pointerEvents:"all"},children:[me.jsxs("div",{className:"template-edge__top-row",children:[me.jsx("span",{className:"template-edge__category",children:d==null?void 0:d.edgeLabel}),(d==null?void 0:d.conditional)&&me.jsxs(pP,{className:`template-edge__badge template-edge__badge--conditional${d.conditionResult===!1?" template-edge__badge--condition-false":d.conditionResult===!0?" template-edge__badge--condition-true":""}`,label:d.conditionResult===!1?"⊘ false":d.conditionResult===!0?"✓ conditional":"conditional",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚡ Conditional Reference"}),me.jsx("p",{children:d.conditionResult===!0?"Condition evaluated to true — this template will be included.":d.conditionResult===!1?"Condition evaluated to false — this template will NOT be included in this pipeline run.":"This template is inside a conditional block. The condition could not be fully evaluated."}),d.conditionExpression&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Condition"}),me.jsx("code",{children:d.conditionExpression})]}),d.conditionResult!=null&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Result"}),me.jsx("code",{children:String(d.conditionResult)})]})]}),(d==null?void 0:d.dynamicPath)&&d.expressionResolved&&me.jsxs(pP,{className:"template-edge__badge template-edge__badge--resolved",label:"🔮 resolved",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"🔮 Expression Resolved"}),me.jsx("p",{children:"The template path contained expressions that were successfully evaluated."}),me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),me.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Resolved"}),me.jsx("code",{children:d.resolvedPath})]})]}),(d==null?void 0:d.dynamicPath)&&!d.expressionResolved&&me.jsxs(pP,{className:"template-edge__badge template-edge__badge--unresolved",label:"⚠️ dynamic",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚠️ Unresolved Expressions"}),me.jsx("p",{children:"The template path contains expressions that could not be evaluated at analysis time."}),me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),me.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&d.resolvedPath!==d.originalPath&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Partial"}),me.jsx("code",{children:d.resolvedPath})]}),d.unresolvedExpressions&&d.unresolvedExpressions.length>0&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Unresolved"}),me.jsx("span",{children:d.unresolvedExpressions.join(", ")})]})]})]}),b>0&&me.jsxs("span",{className:"template-edge__params-badge",onMouseEnter:_,onMouseLeave:v,children:[gVe(d),h&&me.jsx(pVe,{data:d})]})]})})]})}function gVe(s){var t;const e=((t=s.parameterNames)==null?void 0:t.length)??0;return s.totalParameterCount!=null?`${e}/${s.totalParameterCount} params`:`${e} params`}function pVe({data:s}){var t,i;const e=(t=s.declaredParameterNames)==null?void 0:t.filter(n=>{var o;return!((o=s.parameterNames)!=null&&o.includes(n))});return me.jsxs("div",{className:"template-edge__params-tooltip",children:[s.parameterNames&&s.parameterNames.length>0&&me.jsxs("div",{className:"template-edge__params-section",children:[me.jsxs("div",{className:"template-edge__params-heading",children:["✓ Passed (",s.parameterNames.length,")"]}),me.jsx("ul",{className:"template-edge__params-list",children:s.parameterNames.map(n=>me.jsx("li",{className:"template-edge__params-item template-edge__params-item--passed",children:n},n))})]}),e&&e.length>0&&me.jsxs("div",{className:"template-edge__params-section",children:[me.jsxs("div",{className:"template-edge__params-heading",children:["○ Not passed (",e.length,")"]}),me.jsx("ul",{className:"template-edge__params-list",children:e.map(n=>me.jsx("li",{className:"template-edge__params-item template-edge__params-item--missing",children:n},n))})]}),s.totalParameterCount==null&&!((i=s.declaredParameterNames)!=null&&i.length)&&me.jsx("div",{className:"template-edge__params-hint",children:"Expand node to see all declared params"})]})}const mVe=je.memo(fVe),_Ve={fileNode:uVe},bVe={templateEdge:mVe},vVe={animated:!0,style:{stroke:"var(--accent)",strokeWidth:2},markerEnd:{type:yk.ArrowClosed,color:"var(--accent)"}};function CVe(){var O,F;const{org:s,project:e,selectedPipeline:t,selectedPipelineLoading:i,selectedPipelineError:n,expandedTemplates:o,setExpandedTemplate:r,setSelectedNodeDetail:a}=x2(),l=WHe(),[c,d,h]=Ere([]),[u,f,g]=Nre([]),p=je.useRef(null),_=je.useRef(null),v=je.useRef(""),b=je.useRef([]);je.useEffect(()=>{b.current=u},[u]);const[w,C]=je.useState(new Set),S=je.useRef(new Set),[y,x]=je.useState(!1),L=((F=(O=t==null?void 0:t.definition)==null?void 0:O.repository)==null?void 0:F.name)??"",D=je.useMemo(()=>{if(!(t!=null&&t.yaml))return[];try{const W=lb(t.yaml),V=W==null?void 0:W.resources;return(V==null?void 0:V.repositories)??[]}catch{return[]}},[t==null?void 0:t.yaml]),E=je.useMemo(()=>{if(!(t!=null&&t.yaml))return{};try{const W=lb(t.yaml);return AL(W??{})}catch{return{}}},[t==null?void 0:t.yaml]);je.useEffect(()=>{var Qe,Yi,Qt,Ji,ao,lo,No;if(!(t!=null&&t.yaml)){d([]),f([]);return}const W=lb(t.yaml),V=((Qe=t.definition)==null?void 0:Qe.path)??"",$=uP(W??{},{sourcePath:V}),K=((Yi=t.definition)==null?void 0:Yi.name)??V.split("/").pop()??"Pipeline",Z=QE(V),Y=lP(W??{}),X=((Ji=(Qt=t.definition)==null?void 0:Qt.repository)==null?void 0:Ji.name)??"",le=(No=(lo=(ao=t.definition)==null?void 0:ao.repository)==null?void 0:lo.defaultBranch)==null?void 0:No.replace(/^refs\/heads\//,""),q=s&&e&&X?uoe({org:s,project:e,repoName:X,filePath:V,branch:le}):void 0,z={id:"root",type:"fileNode",position:{x:0,y:0},data:{label:K,filePath:V,templateCount:$.length,status:"root",isRoot:!0,baseDir:Z,adoUrl:q}},{templateNodes:J,templateEdges:ae}=mP("root",$,s,e,L,D,Y,void 0,E),fe=[z,...J],we=[...ae],{nodes:Re,edges:Pe}=gP(fe,we);d(Re),f(Pe),S.current=new Set},[t,d,f]);const T=je.useRef(!1);je.useEffect(()=>{if(!y||!p.current||c.length===0)return;const W=`${c.length}:${u.length}`;if(W!==v.current)return v.current=W,_.current!=null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{var V;(V=p.current)==null||V.fitView({padding:.2,duration:300}),_.current=null}),()=>{_.current!=null&&(cancelAnimationFrame(_.current),_.current=null)}},[y,c.length,u.length]),je.useEffect(()=>{if(T.current)return;const W=c.filter(V=>{const $=V.data;if($.status!=="collapsed"||S.current.has(V.id)||w.has(V.id))return!1;const K=$._conditionResult;return!(K===!1||K==="unknown"&&!y)});if(W.length!==0){W.sort((V,$)=>{const K=V.data.templateLocation==="variables"?0:1,Z=$.data.templateLocation==="variables"?0:1;return K-Z});for(const V of W){const $=V.data;$.dynamicPath&&!$.expressionResolved||S.current.add(V.id)}T.current=!0,(async()=>{for(const V of W){const $=V.data;if(!($.dynamicPath&&!$.expressionResolved))try{const{content:K,actualPath:Z}=await _P(s,e,L,$,D,o,r,l),Y=lb(K)??{},X=$._ref,le=uP(Y,{contextRepoAlias:Sp(X??{}),sourcePath:Z}),q=XG(Y);if(le.length===0){const J=$.templateLocation==="variables"?AL(Y):void 0,ae=J&&Object.keys(J).length>0,fe=new Set,we=new Set,Re=new Map;if(ae)for(const Pe of c){const Qe=Pe.data;if(Qe.dynamicPath&&!Qe.expressionResolved){const Yi=OL(Pe,J,s,e,L,D);if(Yi!==Pe){fe.add(Pe.id);const Qt=Yi.data;Qt.repoAlias&&we.add(Pe.id),Re.set(Pe.id,Qt.filePath)}}}d(Pe=>Pe.map(Qe=>Qe.id===V.id?{...Qe,data:{...Qe.data,status:"expanded",templateCount:0,totalParameterCount:q.length||void 0,declaredParameterNames:q.length?q:void 0}}:ae&&fe.has(Qe.id)?OL(Qe,J,s,e,L,D):Qe)),fe.size>0&&f(Pe=>Pe.map(Qe=>{if(!fe.has(Qe.target))return Qe;const Yi=Qe.data;if(!(Yi!=null&&Yi.dynamicPath))return Qe;const Qt=we.has(Qe.target);return{...Qe,data:{...Yi,expressionResolved:!0,isExternal:Qt||Yi.isExternal||void 0,resolvedPath:Re.get(Qe.target)??Yi.resolvedPath,unresolvedExpressions:void 0},style:Qt?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:Qe.style,markerEnd:Qt?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:Qe.markerEnd}}))}else if(y){const z=lP(Y),J=$._parentParamContext,ae=$._accumulatedVariables,fe=X==null?void 0:X.parameters,we=XE(fe,J,ae),Re={...z,...we},Pe=AL(Y),Qe={...ae??E,...Pe},Yi=$._accumulatedResources,Qt=CY(Y),Ji=wY([...Yi??D,...Qt]);await new Promise(ss=>setTimeout(ss,0));const ao=new Set(c.map(ss=>ss.id)),{templateNodes:lo,templateEdges:No}=mP(V.id,le,s,e,L,Ji,Re,ao,Qe);d(ss=>{const Hl=new Set(ss.map(bi=>bi.id)),Hf=lo.filter(bi=>!Hl.has(bi.id)),Hh=[...ss.map(bi=>bi.id===V.id?{...bi,data:{...bi.data,status:"expanded",templateCount:le.length,totalParameterCount:q.length||void 0,declaredParameterNames:q.length?q:void 0}}:bi),...Hf],Ws=[...q.length?PL(b.current,V.id,q):b.current,...No];return gP(Hh,Ws).nodes}),f(ss=>[...q.length?PL(ss,V.id,q):ss,...No]),await new Promise(ss=>setTimeout(ss,50))}}catch{}}T.current=!1,y&&d(V=>[...V])})()}},[c,s,e,L,D,o,r,w,d,f,y,l]);const N=je.useCallback(async(W,V)=>{const $=V.data;if($.status==="root"&&(t!=null&&t.yaml)){a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:t.yaml});return}if($.status==="expanded"){const K=$._ref,Z=Sp(K??{})||"",Y=`${Z}:${$.filePath}`,X=$._fallbackPath,le=X?`${Z}:${X}`:void 0,q=o.get(Y)??(le?o.get(le):void 0);if(q){a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:q,repoAlias:$.repoAlias});return}try{const{content:z}=await _P(s,e,L,$,D,o,r,l);a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:z,repoAlias:$.repoAlias})}catch{}return}if($.status==="collapsed"&&!w.has(V.id)){C(K=>new Set(K).add(V.id)),d(K=>K.map(Z=>Z.id===V.id?{...Z,data:{...Z.data,status:"loading"}}:Z));try{const{content:K,actualPath:Z}=await _P(s,e,L,$,D,o,r,l),Y=lb(K)??{},X=$._ref,le=uP(Y,{contextRepoAlias:Sp(X??{}),sourcePath:Z}),q=lP(Y),z=$._parentParamContext,J=$._accumulatedVariables,ae=X==null?void 0:X.parameters,fe=XE(ae,z,J),we={...q,...fe},Re=XG(Y),Pe=QE(Z),Qe=AL(Y),Yi={...J??E,...Qe},Qt=$._accumulatedResources,Ji=CY(Y),ao=wY([...Qt??D,...Ji]),lo=new Set(c.map(En=>En.id)),{templateNodes:No,templateEdges:ss}=mP(V.id,le,s,e,L,ao,we,lo,Yi),Hl=new Set,Hf=new Set,JC=new Map,Hh=$.templateLocation==="variables"&&Object.keys(Qe).length>0;if(Hh)for(const En of c){const Ws=En.data;if(Ws.dynamicPath&&!Ws.expressionResolved){const bi=OL(En,Qe,s,e,L,D);if(bi!==En){Hl.add(En.id);const Wr=bi.data;Wr.repoAlias&&Hf.add(En.id),JC.set(En.id,Wr.filePath)}}}d(En=>{const Ws=new Set(En.map(Br=>Br.id)),bi=No.filter(Br=>!Ws.has(Br.id)),Vh=[...En.map(Br=>Br.id===V.id?{...Br,data:{...Br.data,status:"expanded",templateCount:le.length,totalParameterCount:Re.length||void 0,declaredParameterNames:Re.length?Re:void 0}}:Hh&&Hl.has(Br.id)?OL(Br,Qe,s,e,L,D):Br),...bi],ew=[...Re.length?PL(b.current,V.id,Re):b.current,...ss];return gP(Vh,ew).nodes}),f(En=>{let Ws=Re.length?PL(En,V.id,Re):En;return Hl.size>0&&(Ws=Ws.map(bi=>{if(!Hl.has(bi.target))return bi;const Wr=bi.data;if(!(Wr!=null&&Wr.dynamicPath))return bi;const Vh=Hf.has(bi.target);return{...bi,data:{...Wr,expressionResolved:!0,isExternal:Vh||Wr.isExternal||void 0,resolvedPath:JC.get(bi.target)??Wr.resolvedPath,unresolvedExpressions:void 0},style:Vh?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:bi.style,markerEnd:Vh?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:bi.markerEnd}})),[...Ws,...ss]}),a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:K,repoAlias:$.repoAlias})}catch(K){const Z=K instanceof Error?K.message:String(K);d(Y=>Y.map(X=>X.id===V.id?{...X,data:{...X.data,status:"error",errorMessage:Z}}:X))}finally{C(K=>{const Z=new Set(K);return Z.delete(V.id),Z})}}},[s,e,L,t,D,o,r,a,w,d,f,l]),A=je.useCallback(()=>{x(W=>(W||(S.current=new Set,v.current=""),!W))},[]);return i?me.jsx("div",{className:"pipeline-tree__empty",children:me.jsxs("div",{className:"loading-indicator",children:[me.jsx("span",{className:"loading-indicator__spinner",children:"⏳"}),me.jsx("span",{children:"Loading pipeline..."})]})}):n?me.jsx("div",{className:"error",children:n}):t?me.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[me.jsxs(Tre,{nodes:c,edges:u,onInit:W=>{p.current=W},onNodesChange:h,onEdgesChange:g,onNodeClick:N,nodeTypes:_Ve,edgeTypes:bVe,defaultEdgeOptions:vVe,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[me.jsx(Rre,{variant:Mre.Dots,color:"var(--border)",gap:20}),me.jsx(Are,{})]}),me.jsxs("label",{className:"auto-expand-toggle",children:[me.jsx("input",{type:"checkbox",checked:y,onChange:A}),me.jsx("span",{children:"Auto-expand all"})]})]}):me.jsx("div",{className:"pipeline-tree__empty",children:"Select a pipeline to visualize"})}function PL(s,e,t){return s.map(i=>{if(i.target!==e)return i;const n=i.data??{};return{...i,data:{...n,totalParameterCount:t.length,declaredParameterNames:t}}})}function XE(s,e,t){if(!s||!e&&!t)return s;const i={};for(const[n,o]of Object.entries(s))if(typeof o=="string"&&yp(o)){const{result:r,isFullyResolved:a}=goe(o,{parameters:e,variables:t});i[n]=a?wVe(r):o}else o&&typeof o=="object"&&!Array.isArray(o)?i[n]=XE(o,e,t)??o:i[n]=o;return i}function wVe(s){if(s==="True"||s==="true")return!0;if(s==="False"||s==="false")return!1;if(s==="null")return null;if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return JSON.parse(s)}catch{}return s}function CY(s){const e=s.resources;if(!e)return[];const t=e.repositories;return Array.isArray(t)?t.filter(i=>i!=null&&typeof i=="object"&&"repository"in i&&"name"in i&&typeof i.repository=="string"&&typeof i.name=="string"):[]}function wY(s){const e=new Map;for(const t of s)e.set(t.repository,t);return Array.from(e.values())}function SVe(s,e){return`tpl::${s||"self"}::${e}`}function mP(s,e,t,i,n,o,r,a,l){const c=new Set,d=[],h=[];for(let u=0;u<e.length;u++){const f=e[u];let g=f.normalizedPath,p=!1,_=!0,v,b;if(yp(f.normalizedPath)){p=!0,v=f.normalizedPath;const W=$E(f.normalizedPath,r,void 0,l);g=W.resolvedPath,_=W.isFullyResolved,b=W.unresolved.length?W.unresolved:void 0}let w=Sp(f),C=!1,S=!0;if(w&&yp(w)){C=!0;const W=$E(w,r,void 0,l);W.isFullyResolved?w=W.resolvedPath:(S=!1,b=[...b??[],...W.unresolved])}const y=p||C,x=_&&S,{primary:L,fallback:D}=doe({...f,normalizedPath:g,repoAlias:f.repoAlias,sourcePath:f.sourcePath}),E=SVe(w,L);if(c.has(E))continue;c.add(E);const T=a==null?void 0:a.has(E);let N;if(f.conditional&&f.conditionExpression)try{const W=foe(f.conditionExpression,{parameters:r,variables:l});typeof W=="boolean"?N=W:W===void 0||W===f.conditionExpression?N="unknown":N=!!W}catch{N="unknown"}else f.conditional&&(N="unknown");if(N===!1)continue;if(!T){const W=g.length>40?`...${g.slice(-37)}`:g,{repoInfo:V,adoUrl:$}=lre(f,w,L,t,i,n,o),K=XE(f.parameters,r,l),Z=w!==Sp(f)||K!==f.parameters?{...f,repoAlias:w||f.repoAlias,contextRepoAlias:w||f.contextRepoAlias,parameters:K}:f;d.push({id:E,type:"fileNode",position:{x:0,y:0},data:{label:W,filePath:L,repoAlias:w,templateCount:0,status:"collapsed",isRoot:!1,baseDir:QE(L),adoUrl:$,repoInfo:V,templateLocation:f.location,dynamicPath:y||void 0,expressionResolved:y?x:void 0,_ref:Z,_fallbackPath:D,_parentParamContext:r,_accumulatedResources:o,_accumulatedVariables:l,_conditionResult:N}})}const A=f.location==="extends"?"extends":f.location==="extends-parameters"?"extends param":f.location,O=!!w,F=f.parameters?Object.keys(f.parameters):void 0;h.push({id:`${s}->${E}`,source:s,target:E,type:"templateEdge",data:{edgeLabel:A,parameterNames:F,isExternal:O||void 0,conditional:f.conditional||void 0,conditionExpression:f.conditionExpression,conditionResult:N,dynamicPath:y||void 0,expressionResolved:y?x:void 0,originalPath:v||(C?f.rawPath:void 0),resolvedPath:y?L:void 0,unresolvedExpressions:b},style:O?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:void 0,markerEnd:O?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:void 0})}return{templateNodes:d,templateEdges:h}}async function _P(s,e,t,i,n,o,r,a){const l=i._ref;if(!l)throw new Error("No template reference on this node");const c=i.filePath,d=i._fallbackPath,h=Sp(l),u=`${h||""}:${c}`,f=o.get(u);if(f)return{content:f,actualPath:c};if(d){const S=`${h||""}:${d}`,y=o.get(S);if(y)return{content:y,actualPath:d}}const p=i._accumulatedResources??n;let _=e,v=t,b;if(h&&p.length){const S=loe(h,p);S?(_=S.project||e,v=S.repoName,b=S.ref):v=h}else h&&(v=h);let w,C=c;try{w=await a(s,_,v,c,b)}catch(S){if(d)w=await a(s,_,v,d,b),C=d;else throw S}return r(`${h||""}:${C}`,w.content),{content:w.content,actualPath:C}}function QE(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t>0?e.slice(0,t):""}function lre(s,e,t,i,n,o,r){let a=n,l=o,c,d;if(e&&r.length){const u=loe(e,r),f=r.find(g=>g.repository===e);u?(a=u.project||n,l=u.repoName,c=u.ref):l=e,f&&(d={alias:e,fullName:f.name,type:f.type,ref:f.ref,project:u==null?void 0:u.project})}else e&&(l=e);const h=i&&a&&l?uoe({org:i,project:a,repoName:l,filePath:t,ref:c}):void 0;return{repoInfo:d,adoUrl:h}}function OL(s,e,t,i,n,o){const r=s.data,l={...r._accumulatedVariables??{},...e},c=r._ref;if(!c)return s;const d=r._parentParamContext;let h=c.normalizedPath,u=!1,f=!0,g=Sp(c);if(yp(c.normalizedPath)){u=!0;const S=$E(c.normalizedPath,d,void 0,l);if(h=S.resolvedPath,f=S.isFullyResolved,f&&!yp(h)){const y=coe(h);h=y.normalizedPath,y.repoAlias&&(g=y.repoAlias)}}if(g&&yp(g)){u=!0;const S=$E(g,d,void 0,l);S.isFullyResolved?g=S.resolvedPath:f=!1}const p={...c,normalizedPath:h,repoAlias:g||c.repoAlias,contextRepoAlias:g||c.contextRepoAlias},{primary:_,fallback:v}=doe({...p,normalizedPath:h,repoAlias:p.repoAlias,sourcePath:c.sourcePath}),b=h.length>40?`...${h.slice(-37)}`:h,{repoInfo:w,adoUrl:C}=t&&i&&n&&o?lre(p,g,_,t,i,n,o):{repoInfo:void 0,adoUrl:void 0};return{...s,data:{...s.data,label:b,filePath:_,repoAlias:g,baseDir:QE(_),dynamicPath:u||void 0,expressionResolved:u?f:void 0,adoUrl:C||s.data.adoUrl,repoInfo:w||s.data.repoInfo,_ref:p,_accumulatedVariables:l,_fallbackPath:v}}}const cre="7.1";function dre(s,e){return`https://dev.azure.com/${encodeURIComponent(s)}/${encodeURIComponent(e)}/_apis`}function yVe(s){return s.startsWith("refs/heads/")?{version:s.slice(11),versionType:"branch"}:s.startsWith("refs/tags/")?{version:s.slice(10),versionType:"tag"}:/^[0-9a-f]{40}$/i.test(s)?{version:s,versionType:"commit"}:{version:s,versionType:"branch"}}async function hre(s){const e=await fetch(s,{credentials:"include"});if(!e.ok){const t=await e.text();throw new Error(`ADO API error (${e.status}): ${t}`)}return e}async function ure(s,e,t,i,n){const o=i.startsWith("/")?i:`/${i}`,r=hoe(o);let a=`${dre(s,e)}/git/repositories/${encodeURIComponent(t)}/items?path=${encodeURIComponent(r)}&api-version=${cre}&includeContent=true&$format=text`;if(n){const c=yVe(n);a+=`&versionDescriptor.version=${encodeURIComponent(c.version)}&versionDescriptor.versionType=${c.versionType}`}return(await hre(a)).text()}async function xVe(s,e,t){var l,c,d,h,u;const i=`${dre(s,e)}/build/definitions/${t}?api-version=${cre}`,o=await(await hre(i)).json(),r={id:o.id,name:o.name,path:((l=o.process)==null?void 0:l.yamlFilename)??o.path,repository:{id:(c=o.repository)==null?void 0:c.id,name:(d=o.repository)==null?void 0:d.name,type:(h=o.repository)==null?void 0:h.type,defaultBranch:(u=o.repository)==null?void 0:u.defaultBranch}},a=await ure(s,e,r.repository.id,r.path,r.repository.defaultBranch);return{definition:r,yaml:a}}async function LVe(s,e,t,i,n){return{content:await ure(s,e,t,i,n),path:i,repoId:t,repoName:t,branch:n||""}}async function kVe(){return{customTaskDocs:{}}}async function IVe(s){return{tasks:[],cached:!1}}const DVe="/api";var kY;const L2=typeof window<"u"&&((kY=window.location)==null?void 0:kY.protocol)==="chrome-extension:";async function k2(s){const e=await fetch(`${DVe}${s}`);if(!e.ok){const t=await e.text();throw new Error(`API error (${e.status}): ${t}`)}return e.json()}function EVe(s,e,t){return L2?xVe(s,e,t):k2(`/${s}/${e}/pipelines/${t}/yaml`)}function fre(s,e,t,i,n){if(L2)return LVe(s,e,t,i,n);const o=new URLSearchParams({repo:t,path:i});return n&&o.set("branch",n),k2(`/${s}/${e}/file-by-repo-name?${o}`)}function NVe(){return L2?kVe():k2("/config/task-docs")}function TVe(s){return L2?IVe():k2(`/${s}/schema/tasks`)}function RVe(){const{setConnection:s,setSelectedPipeline:e,setSelectedPipelineLoading:t,setSelectedPipelineError:i}=x2(),[n,o]=je.useState(""),[r,a]=je.useState(null),[l,c]=je.useState(!1),d=je.useRef(!1);je.useEffect(()=>{if(d.current)return;d.current=!0;const p=new URLSearchParams(window.location.search),_=p.get("url"),v=p.get("org"),b=p.get("project"),w=p.get("repo"),C=p.get("path"),S=p.get("branch")??void 0,y=p.get("pipelineId");if(_)o(_),h(_);else if(v&&b&&w&&C){const x=`https://dev.azure.com/${v}/${b}/_git/${w}?path=${C}${S?`&version=GB${S}`:""}`;o(x),h(x)}else v&&b&&y&&u(v,b,Number(y))},[]);const h=async p=>{const _=ZBe(p);if(!_){a("Invalid Azure DevOps URL");return}s(_.org,_.project),t(!0),i(null),c(!0);try{const v=await fre(_.org,_.project,_.repoName,_.filePath,_.branch);e({definition:{id:0,name:_.filePath.split("/").pop()||_.filePath,path:_.filePath,repository:{id:v.repoId,name:v.repoName,type:"git",defaultBranch:v.branch||""}},yaml:v.content})}catch(v){i(v instanceof Error?v.message:String(v))}finally{t(!1),c(!1)}},u=async(p,_,v)=>{s(p,_),t(!0),i(null);try{const b=await EVe(p,_,v);e(b)}catch(b){i(b instanceof Error?b.message:String(b))}finally{t(!1)}},f=async()=>{n.trim()&&(a(null),await h(n.trim()))},g=p=>{p.key==="Enter"&&(p.preventDefault(),f())};return me.jsxs("div",{className:"pipeline-url-bar",children:[me.jsx("input",{type:"text",className:"pipeline-url-bar__input",placeholder:"https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",value:n,onChange:p=>o(p.target.value),onKeyDown:g}),me.jsx("button",{className:"pipeline-url-bar__btn",onClick:f,disabled:!n.trim()||l,children:l?"⏳ Loading...":"Load"}),r&&me.jsx("div",{className:"pipeline-url-bar__error",children:r})]})}const MVe=280,AVe=900,PVe=420;function OVe(){const{setCustomTaskDocs:s,setTaskSchema:e,selectedNodeDetail:t,org:i}=x2(),[n,o]=je.useState(PVe),r=je.useRef(!1);je.useEffect(()=>{NVe().then(l=>s(l.customTaskDocs)).catch(()=>{})},[s]),je.useEffect(()=>{i&&TVe(i).then(l=>e(l.tasks)).catch(()=>{})},[i,e]);const a=je.useCallback(l=>{l.preventDefault(),r.current=!0;const c=l.clientX,d=n;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const h=f=>{const g=c-f.clientX,p=Math.min(AVe,Math.max(MVe,d+g));o(p)},u=()=>{r.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",u)},[n]);return me.jsx(FHe,{value:fre,children:me.jsxs("div",{className:"app",children:[me.jsxs("header",{className:"app__header",children:[me.jsx("h1",{children:"🔧 Azure Pipelines Visualizer"}),me.jsx(fP,{children:me.jsx(RVe,{})})]}),me.jsxs("main",{className:"app__main",children:[me.jsx("section",{className:"app__content",children:me.jsx(fP,{children:me.jsx(CVe,{})})}),t&&me.jsxs(me.Fragment,{children:[me.jsx("div",{className:"app__detail-resize-handle",onMouseDown:a,title:"Drag to resize"}),me.jsx("aside",{className:"app__detail",style:{width:n},children:me.jsx(fP,{children:me.jsx(PHe,{})})})]})]})]})})}NW.createRoot(document.getElementById("root")).render(me.jsx(Au.StrictMode,{children:me.jsx(OVe,{})}));export{kb as l};
|
|
946
|
+
`)}const SHe={DotNetCoreCLI:"dotnet-core-cli","AdvancedSecurity-Codeql-Init":"advanced-security-codeql-init","AdvancedSecurity-Codeql-Analyze":"advanced-security-codeql-analyze","AdvancedSecurity-Publish":"advanced-security-publish",AndroidBuild:"android-build",AndroidSigning:"android-signing",Ant:"ant",AzureIoTEdge:"azure-iot-edge",CMake:"cmake",ContainerBuild:"container-build",Docker:"docker",DockerCompose:"docker-compose",DownloadGitHubNugetPackage:"download-github-nuget-package",Go:"go",Gradle:"gradle",Grunt:"grunt",gulp:"gulp",PublishSymbols:"publish-symbols",JenkinsQueueJob:"jenkins-queue-job",Maven:"maven",MSBuild:"msbuild",SonarQubePrepare:"sonar-qube-prepare",SonarQubePublish:"sonar-qube-publish",SonarQubeAnalyze:"sonar-qube-analyze",VSBuild:"vsbuild",Xcode:"xcode",XcodePackageiOS:"xcode-package-ios",AppCenterDistribute:"app-center-distribute",AzureResourceManagerTemplateDeployment:"azure-resource-manager-template-deployment",AzureAppConfigurationExport:"azure-app-configuration-export",AzureAppConfigurationImport:"azure-app-configuration-import",AzureAppConfigurationSnapshot:"azure-app-configuration-snapshot",AzureWebPowerShellDeployment:"azure-web-powershell-deployment",AzureRmWebAppDeployment:"azure-rm-web-app-deployment",AzureAppServiceManage:"azure-app-service-manage",AzureAppServiceSettings:"azure-app-service-settings",AzureCLI:"azure-cli",AzureCloudPowerShellDeployment:"azure-cloud-powershell-deployment",AzureContainerApps:"azure-container-apps",AzureMysqlDeployment:"azure-mysql-deployment",AzureFileCopy:"azure-file-copy",AzureFunctionOnKubernetes:"azure-function-on-kubernetes",AzureFunctionApp:"azure-function-app",AzureFunctionAppContainer:"azure-function-app-container",AzureKeyVault:"azure-key-vault",AzureMonitorAlerts:"azure-monitor-alerts",AzurePowerShell:"azure-powershell",AzureResourceGroupDeployment:"azure-resource-group-deployment",AzureSpringCloud:"azure-spring-cloud",SqlAzureDacpacDeployment:"sql-azure-dacpac-deployment",AzureVmssDeployment:"azure-vmss-deployment",AzureWebApp:"azure-web-app",AzureWebAppContainer:"azure-web-app-container",PackerBuild:"packer-build",AzurePolicyCheckGate:"azure-policy-check-gate",Chef:"chef",ChefKnife:"chef-knife",CopyFilesOverSSH:"copy-files-over-ssh",KubernetesManifest:"kubernetes-manifest",IISWebAppDeploymentOnMachineGroup:"iisweb-app-deployment-on-machine-group",IISWebAppDeployment:"iisweb-app-deployment",IISWebAppManagementOnMachineGroup:"iisweb-app-management-on-machine-group",InvokeRESTAPI:"invoke-rest-api",Kubernetes:"kubernetes",ManualIntervention:"manual-intervention",ManualValidation:"manual-validation",MysqlDeploymentOnMachineGroup:"mysql-deployment-on-machine-group",HelmDeploy:"helm-deploy",PowerShellOnTargetMachines:"powershell-on-target-machines",ServiceFabricDeploy:"service-fabric-deploy",ServiceFabricComposeDeploy:"service-fabric-compose-deploy",SqlDacpacDeploymentOnMachineGroup:"sql-dacpac-deployment-on-machine-group",SqlServerDacpacDeployment:"sql-server-dacpac-deployment",SSH:"ssh",WindowsMachineFileCopy:"windows-machine-file-copy",CargoAuthenticate:"cargo-authenticate",CocoaPods:"cocoa-pods",CondaEnvironment:"conda-environment",DownloadGithubNpmPackage:"download-github-npm-package",MavenAuthenticate:"maven-authenticate",Npm:"npm",npmAuthenticate:"npm-authenticate",NuGetCommand:"nuget-command",NuGet:"nuget",NuGetAuthenticate:"nuget-authenticate",NuGetInstaller:"nuget-installer",NuGetPackager:"nuget-packager",NuGetPublisher:"nuget-publisher",NuGetRestore:"nuget-restore",PyPIPublisher:"py-pi-publisher",PipAuthenticate:"pip-authenticate",TwineAuthenticate:"twine-authenticate",UniversalPackages:"universal-packages",AppCenterTest:"app-center-test",AzureLoadTest:"azure-load-test",AzureTestPlan:"azure-test-plan",ContainerStructureTest:"container-structure-test",VSMobileCenterTest:"vsmobile-center-test",PublishCodeCoverageResults:"publish-code-coverage-results",PublishTestResults:"publish-test-results",RunVisualStudioTestsusingTestAgent:"run-visual-studio-testsusing-test-agent",VSTest:"vstest",DeployVisualStudioTestAgent:"deploy-visual-studio-test-agent",DotNetCoreInstaller:"dotnet-core-installer",DockerInstaller:"docker-installer",DuffleInstaller:"duffle-installer",GoTool:"go-tool",HelmInstaller:"helm-installer",FuncToolsInstaller:"func-tools-installer",JavaToolInstaller:"java-tool-installer",KubectlInstaller:"kubectl-installer",KubeloginInstaller:"kubelogin-installer",NuGetToolInstaller:"nuget-tool-installer",UseDotNet:"use-dotnet",UseNode:"use-node",NodeTool:"node-tool",UsePythonVersion:"use-python-version",UseRubyVersion:"use-ruby-version",VisualStudioTestPlatformInstaller:"visual-studio-test-platform-installer","AdvancedSecurity-Dependency-Scanning":"advanced-security-dependency-scanning",ArchiveFiles:"archive-files",AzureNLBManagement:"azure-nlb-management",Bash:"bash",BatchScript:"batch-script",Cache:"cache",CacheBeta:"cache-beta",CmdLine:"cmd-line",CopyPublishBuildArtifacts:"copy-publish-build-artifacts",CopyFiles:"copy-files",cURLUploader:"curl-uploader",DecryptFile:"decrypt-file",Delay:"delay",DeleteFiles:"delete-files",AzureStaticWebApp:"azure-static-web-app",DownloadFileshareArtifacts:"download-fileshare-artifacts",DownloadBuildArtifacts:"download-build-artifacts",DownloadGitHubRelease:"download-github-release",DownloadPackage:"download-package",DownloadPipelineArtifact:"download-pipeline-artifact",DownloadSecureFile:"download-secure-file",ExtractFiles:"extract-files",FileTransform:"file-transform",FtpUpload:"ftp-upload",GitHubComment:"github-comment",GitHubRelease:"github-release",InstallAppleCertificate:"install-apple-certificate",InstallAppleProvisioningProfile:"install-apple-provisioning-profile",InstallSSHKey:"install-ssh-key",AzureFunction:"azure-function",JenkinsDownloadArtifacts:"jenkins-download-artifacts",NodeTaskRunnerInstaller:"node-task-runner-installer",Notation:"notation",PowerShell:"powershell",PublishBuildArtifacts:"publish-build-artifacts",PublishPipelineArtifact:"publish-pipeline-artifact",PublishPipelineMetadata:"publish-pipeline-metadata",PublishToAzureServiceBus:"publish-to-azure-service-bus",PythonScript:"python-script",AzureMonitor:"azure-monitor",queryWorkItems:"query-work-items",ReviewApp:"review-app",ServiceFabricPowerShell:"service-fabric-powershell",ShellScript:"shell-script",ServiceFabricUpdateAppVersions:"service-fabric-update-app-versions",ServiceFabricUpdateManifests:"service-fabric-update-manifests"};function yHe(s){const e=s.trim(),t=e.lastIndexOf("@");if(t>0){const i=e.slice(0,t),n=Number.parseInt(e.slice(t+1),10);return{raw:e,name:i,version:Number.isNaN(n)?0:n}}return{raw:e,name:e,version:0}}function xHe(s){return s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}const fY="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference";function LHe(s,e){if(e){const n=`${s.name}@${s.version}`;if(e[n])return e[n];if(e[s.name])return e[s.name]}if(s.name.includes("."))return null;const t=SHe[s.name];if(t)return`${fY}/${t}-v${s.version}`;const i=xHe(s.name);return`${fY}/${i}-v${s.version}`}function kHe(s){const e=[],t=new Set;function i(l){typeof l=="string"&&!t.has(l)&&(t.add(l),e.push(yHe(l)))}function n(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function o(l){if(Array.isArray(l))for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task),Array.isArray(d.steps)&&n(d.steps),Array.isArray(d.jobs)&&r(d.jobs),Array.isArray(d.stages)&&a(d.stages);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}else if(l&&typeof l=="object"){const c=l;"task"in c&&i(c.task);for(const d of Object.keys(c))d.startsWith("${{")&&o(c[d]);Array.isArray(c.steps)&&n(c.steps),Array.isArray(c.jobs)&&r(c.jobs),Array.isArray(c.stages)&&a(c.stages)}}function r(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.steps)&&n(d.steps);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function a(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.jobs)&&r(d.jobs);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}Array.isArray(s.steps)&&n(s.steps),Array.isArray(s.jobs)&&r(s.jobs),Array.isArray(s.stages)&&a(s.stages);for(const l of Object.keys(s))l.startsWith("${{")&&o(s[l]);return e}function uP(s,e={}){const t=[];if(s.extends&&typeof s.extends=="object"){const i=s.extends;typeof i.template=="string"&&t.push(Lv(i.template,"extends",i.parameters,!1,e));for(const n of Object.keys(i))if(WH(n)){const o=i[n];if(o&&typeof o=="object"&&!Array.isArray(o)){const r=o;typeof r.template=="string"&&t.push(Lv(r.template,"extends",r.parameters??i.parameters,!0,e,BH(n)))}}i.parameters&&typeof i.parameters=="object"&&IHe(i.parameters,t,e)}if(Array.isArray(s.variables))for(const i of s.variables)i&&typeof i=="object"&&typeof i.template=="string"&&t.push(Lv(i.template,"variables",i.parameters,!1,e));return Array.isArray(s.stages)&&wr(s.stages,"stages",t,e),Array.isArray(s.jobs)&&wr(s.jobs,"jobs",t,e),Array.isArray(s.steps)&&wr(s.steps,"steps",t,e),t}function wr(s,e,t,i){for(const n of s){if(!n||typeof n!="object")continue;const o=n;if(typeof o.template=="string"){t.push(Lv(o.template,e,o.parameters,!1,i));continue}for(const r of Object.keys(o))if(WH(r)){const a=o[r];nre(a,e,t,i,BH(r))}Array.isArray(o.jobs)&&wr(o.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(o.steps)&&wr(o.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(o.stages)&&wr(o.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function nre(s,e,t,i,n){if(Array.isArray(s)){gY(s,e,t,i,n);return}s&&typeof s=="object"&&gY([s],e,t,i,n)}function gY(s,e,t,i,n){for(const o of s){if(!o||typeof o!="object")continue;const r=o;typeof r.template=="string"&&t.push(Lv(r.template,e,r.parameters,!0,i,n));for(const a of Object.keys(r))WH(a)&&nre(r[a],e,t,i,BH(a));Array.isArray(r.jobs)&&wr(r.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(r.steps)&&wr(r.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(r.stages)&&wr(r.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function IHe(s,e,t){Array.isArray(s.stages)&&wr(s.stages,"extends-parameters",e,t),Array.isArray(s.jobs)&&wr(s.jobs,"extends-parameters",e,t),Array.isArray(s.steps)&&wr(s.steps,"extends-parameters",e,t);for(const[,i]of Object.entries(s))if(Array.isArray(i))for(const n of i){if(n&&typeof n=="object"&&typeof n.template=="string"){const o=n;e.push(Lv(o.template,"extends-parameters",o.parameters,!1,t))}if(n&&typeof n=="object"){const o=n;Array.isArray(o.jobs)&&wr(o.jobs,"extends-parameters",e,t),Array.isArray(o.steps)&&wr(o.steps,"extends-parameters",e,t)}}}function WH(s){return s.startsWith("${{")}function BH(s){const e=s.match(/\$\{\{\s*(?:else\s*)?if\s+(.*?)\s*\}\}/);return(e==null?void 0:e[1])||void 0}const sre={},{useDebugValue:DHe}=Au,{useSyncExternalStoreWithSelector:EHe}=Lre;let pY=!1;const NHe=s=>s;function THe(s,e=NHe,t){(sre?"production":void 0)!=="production"&&t&&!pY&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),pY=!0);const i=EHe(s.subscribe,s.getState,s.getServerState||s.getInitialState,e,t);return DHe(i),i}const mY=s=>{(sre?"production":void 0)!=="production"&&typeof s!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof s=="function"?xre(s):s,t=(i,n)=>THe(e,i,n);return Object.assign(t,e),t},RHe=s=>s?mY(s):mY,x2=RHe(s=>({org:"",project:"",setConnection:(e,t)=>s({org:e,project:t}),selectedPipeline:null,selectedPipelineLoading:!1,selectedPipelineError:null,setSelectedPipeline:e=>s({selectedPipeline:e,selectedPipelineError:null,expandedNodes:new Set}),setSelectedPipelineLoading:e=>s({selectedPipelineLoading:e}),setSelectedPipelineError:e=>s({selectedPipelineError:e}),expandedTemplates:new Map(MHe()),setExpandedTemplate:(e,t)=>s(i=>{const n=new Map(i.expandedTemplates);return n.set(e,t),AHe(n),{expandedTemplates:n}}),expandedNodes:new Set,toggleNode:e=>s(t=>{const i=new Set(t.expandedNodes);return i.has(e)?i.delete(e):i.add(e),{expandedNodes:i}}),selectedNodeDetail:null,setSelectedNodeDetail:e=>s({selectedNodeDetail:e}),customTaskDocs:{},setCustomTaskDocs:e=>s({customTaskDocs:e}),taskSchema:new Map,setTaskSchema:e=>s(()=>{const t=new Map;for(const i of e)t.set(`${i.name}@${i.version}`,i);return{taskSchema:t}})})),ore="apv-template-cache";function MHe(){try{const s=localStorage.getItem(ore);if(s)return JSON.parse(s)}catch{}return[]}function AHe(s){try{const t=Array.from(s.entries()).slice(-100);localStorage.setItem(ore,JSON.stringify(t))}catch{}}function PHe(){const{selectedNodeDetail:s,customTaskDocs:e,taskSchema:t,setSelectedNodeDetail:i}=x2(),n=je.useMemo(()=>{if(!(s!=null&&s.yaml))return[];try{const o=lb(s.yaml);return kHe(o??{})}catch{return[]}},[s==null?void 0:s.yaml]);return s?me.jsxs("div",{className:"detail-panel",children:[me.jsxs("div",{className:"detail-panel__header",children:[me.jsxs("div",{className:"detail-panel__header-row",children:[me.jsx("h3",{className:"detail-panel__title",children:s.label}),me.jsx("button",{className:"detail-panel__close",onClick:()=>i(null),"aria-label":"Close detail panel",title:"Close",children:"✕"})]}),me.jsxs("div",{className:"detail-panel__path",children:[s.filePath,s.repoAlias&&me.jsxs("span",{className:"detail-panel__repo",children:[" ","@",s.repoAlias]})]})]}),n.length>0&&me.jsxs("div",{className:"detail-panel__tasks",children:[me.jsxs("h4",{className:"detail-panel__section-title",children:["Tasks (",n.length,")"]}),me.jsx("ul",{className:"task-list",children:n.map(o=>me.jsx(OHe,{ref_:o,customDocs:e,schemaEntry:t.get(o.raw)??t.get(`${o.name}@${o.version}`)},o.raw))})]}),me.jsx("div",{className:"detail-panel__editor",children:me.jsx(Uae,{height:"100%",language:"yaml",value:s.yaml,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",renderLineHighlight:"none",wordWrap:"on",padding:{top:8}}})})]}):me.jsx("div",{className:"detail-panel detail-panel--empty",children:me.jsx("p",{children:"Click a node to view its contents"})})}function OHe({ref_:s,customDocs:e,schemaEntry:t}){const i=LHe(s,e);return me.jsxs("li",{className:"task-item",children:[me.jsx("span",{className:"task-item__icon",children:"⚙️"}),me.jsxs("div",{className:"task-item__content",children:[i?me.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"task-item__link",title:(t==null?void 0:t.description)||`Open docs for ${s.name}`,children:[s.name,me.jsxs("span",{className:"task-item__version",children:["@",s.version]}),me.jsx("span",{className:"task-item__external",children:"↗"})]}):me.jsxs("span",{className:"task-item__name",children:[s.name,me.jsxs("span",{className:"task-item__version",children:["@",s.version]})]}),(t==null?void 0:t.description)&&me.jsx("div",{className:"task-item__description",children:t.description})]})]})}class fP extends je.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){var e;return this.state.hasError?this.props.fallback||me.jsxs("div",{className:"error",children:[me.jsx("h3",{children:"Something went wrong"}),me.jsx("p",{children:(e=this.state.error)==null?void 0:e.message}),me.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),style:{marginTop:8,cursor:"pointer"},children:"Try again"})]}):this.props.children}}const rre=je.createContext(null),FHe=rre.Provider;function WHe(){const s=je.useContext(rre);if(!s)throw new Error("useFileFetch must be used within a FileFetchProvider. Wrap your component tree with <FileFetchProvider value={...}>.");return s}var Ai=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Ol=Ai((s,e)=>{var t=Object.defineProperty,i=(A,O,F)=>O in A?t(A,O,{enumerable:!0,configurable:!0,writable:!0,value:F}):A[O]=F,n=(A,O)=>()=>(O||A((O={exports:{}}).exports,O),O.exports),o=(A,O,F)=>i(A,typeof O!="symbol"?O+"":O,F),r=n((A,O)=>{var F="\0",W="\0",V="",$=class{constructor(q){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),q&&(this._isDirected=Object.hasOwn(q,"directed")?q.directed:!0,this._isMultigraph=Object.hasOwn(q,"multigraph")?q.multigraph:!1,this._isCompound=Object.hasOwn(q,"compound")?q.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[W]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(q){return this._label=q,this}graph(){return this._label}setDefaultNodeLabel(q){return this._defaultNodeLabelFn=q,typeof q!="function"&&(this._defaultNodeLabelFn=()=>q),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var q=this;return this.nodes().filter(z=>Object.keys(q._in[z]).length===0)}sinks(){var q=this;return this.nodes().filter(z=>Object.keys(q._out[z]).length===0)}setNodes(q,z){var J=arguments,ae=this;return q.forEach(function(fe){J.length>1?ae.setNode(fe,z):ae.setNode(fe)}),this}setNode(q,z){return Object.hasOwn(this._nodes,q)?(arguments.length>1&&(this._nodes[q]=z),this):(this._nodes[q]=arguments.length>1?z:this._defaultNodeLabelFn(q),this._isCompound&&(this._parent[q]=W,this._children[q]={},this._children[W][q]=!0),this._in[q]={},this._preds[q]={},this._out[q]={},this._sucs[q]={},++this._nodeCount,this)}node(q){return this._nodes[q]}hasNode(q){return Object.hasOwn(this._nodes,q)}removeNode(q){var z=this;if(Object.hasOwn(this._nodes,q)){var J=ae=>z.removeEdge(z._edgeObjs[ae]);delete this._nodes[q],this._isCompound&&(this._removeFromParentsChildList(q),delete this._parent[q],this.children(q).forEach(function(ae){z.setParent(ae)}),delete this._children[q]),Object.keys(this._in[q]).forEach(J),delete this._in[q],delete this._preds[q],Object.keys(this._out[q]).forEach(J),delete this._out[q],delete this._sucs[q],--this._nodeCount}return this}setParent(q,z){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(z===void 0)z=W;else{z+="";for(var J=z;J!==void 0;J=this.parent(J))if(J===q)throw new Error("Setting "+z+" as parent of "+q+" would create a cycle");this.setNode(z)}return this.setNode(q),this._removeFromParentsChildList(q),this._parent[q]=z,this._children[z][q]=!0,this}_removeFromParentsChildList(q){delete this._children[this._parent[q]][q]}parent(q){if(this._isCompound){var z=this._parent[q];if(z!==W)return z}}children(q=W){if(this._isCompound){var z=this._children[q];if(z)return Object.keys(z)}else{if(q===W)return this.nodes();if(this.hasNode(q))return[]}}predecessors(q){var z=this._preds[q];if(z)return Object.keys(z)}successors(q){var z=this._sucs[q];if(z)return Object.keys(z)}neighbors(q){var z=this.predecessors(q);if(z){let ae=new Set(z);for(var J of this.successors(q))ae.add(J);return Array.from(ae.values())}}isLeaf(q){var z;return this.isDirected()?z=this.successors(q):z=this.neighbors(q),z.length===0}filterNodes(q){var z=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});z.setGraph(this.graph());var J=this;Object.entries(this._nodes).forEach(function([we,Re]){q(we)&&z.setNode(we,Re)}),Object.values(this._edgeObjs).forEach(function(we){z.hasNode(we.v)&&z.hasNode(we.w)&&z.setEdge(we,J.edge(we))});var ae={};function fe(we){var Re=J.parent(we);return Re===void 0||z.hasNode(Re)?(ae[we]=Re,Re):Re in ae?ae[Re]:fe(Re)}return this._isCompound&&z.nodes().forEach(we=>z.setParent(we,fe(we))),z}setDefaultEdgeLabel(q){return this._defaultEdgeLabelFn=q,typeof q!="function"&&(this._defaultEdgeLabelFn=()=>q),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(q,z){var J=this,ae=arguments;return q.reduce(function(fe,we){return ae.length>1?J.setEdge(fe,we,z):J.setEdge(fe,we),we}),this}setEdge(){var q,z,J,ae,fe=!1,we=arguments[0];typeof we=="object"&&we!==null&&"v"in we?(q=we.v,z=we.w,J=we.name,arguments.length===2&&(ae=arguments[1],fe=!0)):(q=we,z=arguments[1],J=arguments[3],arguments.length>2&&(ae=arguments[2],fe=!0)),q=""+q,z=""+z,J!==void 0&&(J=""+J);var Re=Y(this._isDirected,q,z,J);if(Object.hasOwn(this._edgeLabels,Re))return fe&&(this._edgeLabels[Re]=ae),this;if(J!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(q),this.setNode(z),this._edgeLabels[Re]=fe?ae:this._defaultEdgeLabelFn(q,z,J);var Pe=X(this._isDirected,q,z,J);return q=Pe.v,z=Pe.w,Object.freeze(Pe),this._edgeObjs[Re]=Pe,K(this._preds[z],q),K(this._sucs[q],z),this._in[z][Re]=Pe,this._out[q][Re]=Pe,this._edgeCount++,this}edge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J);return this._edgeLabels[ae]}edgeAsObj(){let q=this.edge(...arguments);return typeof q!="object"?{label:q}:q}hasEdge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J);return Object.hasOwn(this._edgeLabels,ae)}removeEdge(q,z,J){var ae=arguments.length===1?le(this._isDirected,arguments[0]):Y(this._isDirected,q,z,J),fe=this._edgeObjs[ae];return fe&&(q=fe.v,z=fe.w,delete this._edgeLabels[ae],delete this._edgeObjs[ae],Z(this._preds[z],q),Z(this._sucs[q],z),delete this._in[z][ae],delete this._out[q][ae],this._edgeCount--),this}inEdges(q,z){return this.isDirected()?this.filterEdges(this._in[q],q,z):this.nodeEdges(q,z)}outEdges(q,z){return this.isDirected()?this.filterEdges(this._out[q],q,z):this.nodeEdges(q,z)}nodeEdges(q,z){if(q in this._nodes)return this.filterEdges({...this._in[q],...this._out[q]},q,z)}filterEdges(q,z,J){if(q){var ae=Object.values(q);return J?ae.filter(function(fe){return fe.v===z&&fe.w===J||fe.v===J&&fe.w===z}):ae}}};function K(q,z){q[z]?q[z]++:q[z]=1}function Z(q,z){--q[z]||delete q[z]}function Y(q,z,J,ae){var fe=""+z,we=""+J;if(!q&&fe>we){var Re=fe;fe=we,we=Re}return fe+V+we+V+(ae===void 0?F:ae)}function X(q,z,J,ae){var fe=""+z,we=""+J;if(!q&&fe>we){var Re=fe;fe=we,we=Re}var Pe={v:fe,w:we};return ae&&(Pe.name=ae),Pe}function le(q,z){return Y(q,z.v,z.w,z.name)}O.exports=$}),a=n((A,O)=>{O.exports="3.0.2"}),l=n((A,O)=>{O.exports={Graph:r(),version:a()}}),c=n((A,O)=>{var F=r();O.exports={write:W,read:K};function W(Z){var Y={options:{directed:Z.isDirected(),multigraph:Z.isMultigraph(),compound:Z.isCompound()},nodes:V(Z),edges:$(Z)};return Z.graph()!==void 0&&(Y.value=structuredClone(Z.graph())),Y}function V(Z){return Z.nodes().map(function(Y){var X=Z.node(Y),le=Z.parent(Y),q={v:Y};return X!==void 0&&(q.value=X),le!==void 0&&(q.parent=le),q})}function $(Z){return Z.edges().map(function(Y){var X=Z.edge(Y),le={v:Y.v,w:Y.w};return Y.name!==void 0&&(le.name=Y.name),X!==void 0&&(le.value=X),le})}function K(Z){var Y=new F(Z.options).setGraph(Z.value);return Z.nodes.forEach(function(X){Y.setNode(X.v,X.value),X.parent&&Y.setParent(X.v,X.parent)}),Z.edges.forEach(function(X){Y.setEdge({v:X.v,w:X.w,name:X.name},X.value)}),Y}}),d=n((A,O)=>{O.exports=W;var F=()=>1;function W($,K,Z,Y){return V($,String(K),Z||F,Y||function(X){return $.outEdges(X)})}function V($,K,Z,Y){var X={},le=!0,q=0,z=$.nodes(),J=function(Re){var Pe=Z(Re);X[Re.v].distance+Pe<X[Re.w].distance&&(X[Re.w]={distance:X[Re.v].distance+Pe,predecessor:Re.v},le=!0)},ae=function(){z.forEach(function(Re){Y(Re).forEach(function(Pe){var Qe=Pe.v===Re?Pe.v:Pe.w,Yi=Qe===Pe.v?Pe.w:Pe.v;J({v:Qe,w:Yi})})})};z.forEach(function(Re){var Pe=Re===K?0:Number.POSITIVE_INFINITY;X[Re]={distance:Pe}});for(var fe=z.length,we=1;we<fe&&(le=!1,q++,ae(),!!le);we++);if(q===fe-1&&(le=!1,ae(),le))throw new Error("The graph contains a negative weight cycle");return X}}),h=n((A,O)=>{O.exports=F;function F(W){var V={},$=[],K;function Z(Y){Object.hasOwn(V,Y)||(V[Y]=!0,K.push(Y),W.successors(Y).forEach(Z),W.predecessors(Y).forEach(Z))}return W.nodes().forEach(function(Y){K=[],Z(Y),K.length&&$.push(K)}),$}}),u=n((A,O)=>{var F=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(W){return W.key})}has(W){return Object.hasOwn(this._keyIndices,W)}priority(W){var V=this._keyIndices[W];if(V!==void 0)return this._arr[V].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(W,V){var $=this._keyIndices;if(W=String(W),!Object.hasOwn($,W)){var K=this._arr,Z=K.length;return $[W]=Z,K.push({key:W,priority:V}),this._decrease(Z),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var W=this._arr.pop();return delete this._keyIndices[W.key],this._heapify(0),W.key}decrease(W,V){var $=this._keyIndices[W];if(V>this._arr[$].priority)throw new Error("New priority is greater than current priority. Key: "+W+" Old: "+this._arr[$].priority+" New: "+V);this._arr[$].priority=V,this._decrease($)}_heapify(W){var V=this._arr,$=2*W,K=$+1,Z=W;$<V.length&&(Z=V[$].priority<V[Z].priority?$:Z,K<V.length&&(Z=V[K].priority<V[Z].priority?K:Z),Z!==W&&(this._swap(W,Z),this._heapify(Z)))}_decrease(W){for(var V=this._arr,$=V[W].priority,K;W!==0&&(K=W>>1,!(V[K].priority<$));)this._swap(W,K),W=K}_swap(W,V){var $=this._arr,K=this._keyIndices,Z=$[W],Y=$[V];$[W]=Y,$[V]=Z,K[Y.key]=W,K[Z.key]=V}};O.exports=F}),f=n((A,O)=>{var F=u();O.exports=V;var W=()=>1;function V(K,Z,Y,X){var le=function(q){return K.outEdges(q)};return $(K,String(Z),Y||W,X||le)}function $(K,Z,Y,X){var le={},q=new F,z,J,ae=function(fe){var we=fe.v!==z?fe.v:fe.w,Re=le[we],Pe=Y(fe),Qe=J.distance+Pe;if(Pe<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+fe+" Weight: "+Pe);Qe<Re.distance&&(Re.distance=Qe,Re.predecessor=z,q.decrease(we,Qe))};for(K.nodes().forEach(function(fe){var we=fe===Z?0:Number.POSITIVE_INFINITY;le[fe]={distance:we},q.add(fe,we)});q.size()>0&&(z=q.removeMin(),J=le[z],J.distance!==Number.POSITIVE_INFINITY);)X(z).forEach(ae);return le}}),g=n((A,O)=>{var F=f();O.exports=W;function W(V,$,K){return V.nodes().reduce(function(Z,Y){return Z[Y]=F(V,Y,$,K),Z},{})}}),p=n((A,O)=>{O.exports=F;function F(V,$,K){if(V[$].predecessor!==void 0)throw new Error("Invalid source vertex");if(V[K].predecessor===void 0&&K!==$)throw new Error("Invalid destination vertex");return{weight:V[K].distance,path:W(V,$,K)}}function W(V,$,K){for(var Z=[],Y=K;Y!==$;)Z.push(Y),Y=V[Y].predecessor;return Z.push($),Z.reverse()}}),_=n((A,O)=>{O.exports=F;function F(W){var V=0,$=[],K={},Z=[];function Y(X){var le=K[X]={onStack:!0,lowlink:V,index:V++};if($.push(X),W.successors(X).forEach(function(J){Object.hasOwn(K,J)?K[J].onStack&&(le.lowlink=Math.min(le.lowlink,K[J].index)):(Y(J),le.lowlink=Math.min(le.lowlink,K[J].lowlink))}),le.lowlink===le.index){var q=[],z;do z=$.pop(),K[z].onStack=!1,q.push(z);while(X!==z);Z.push(q)}}return W.nodes().forEach(function(X){Object.hasOwn(K,X)||Y(X)}),Z}}),v=n((A,O)=>{var F=_();O.exports=W;function W(V){return F(V).filter(function($){return $.length>1||$.length===1&&V.hasEdge($[0],$[0])})}}),b=n((A,O)=>{O.exports=W;var F=()=>1;function W($,K,Z){return V($,K||F,Z||function(Y){return $.outEdges(Y)})}function V($,K,Z){var Y={},X=$.nodes();return X.forEach(function(le){Y[le]={},Y[le][le]={distance:0},X.forEach(function(q){le!==q&&(Y[le][q]={distance:Number.POSITIVE_INFINITY})}),Z(le).forEach(function(q){var z=q.v===le?q.w:q.v,J=K(q);Y[le][z]={distance:J,predecessor:le}})}),X.forEach(function(le){var q=Y[le];X.forEach(function(z){var J=Y[z];X.forEach(function(ae){var fe=J[le],we=q[ae],Re=J[ae],Pe=fe.distance+we.distance;Pe<Re.distance&&(Re.distance=Pe,Re.predecessor=we.predecessor)})})}),Y}}),w=n((A,O)=>{function F(V){var $={},K={},Z=[];function Y(X){if(Object.hasOwn(K,X))throw new W;Object.hasOwn($,X)||(K[X]=!0,$[X]=!0,V.predecessors(X).forEach(Y),delete K[X],Z.push(X))}if(V.sinks().forEach(Y),Object.keys($).length!==V.nodeCount())throw new W;return Z}var W=class extends Error{constructor(){super(...arguments)}};O.exports=F,F.CycleException=W}),C=n((A,O)=>{var F=w();O.exports=W;function W(V){try{F(V)}catch($){if($ instanceof F.CycleException)return!1;throw $}return!0}}),S=n((A,O)=>{O.exports=F;function F(V,$,K,Z,Y){Array.isArray($)||($=[$]);var X=(V.isDirected()?V.successors:V.neighbors).bind(V),le={};return $.forEach(function(q){if(!V.hasNode(q))throw new Error("Graph does not have node: "+q);Y=W(V,q,K==="post",le,X,Z,Y)}),Y}function W(V,$,K,Z,Y,X,le){return Object.hasOwn(Z,$)||(Z[$]=!0,K||(le=X(le,$)),Y($).forEach(function(q){le=W(V,q,K,Z,Y,X,le)}),K&&(le=X(le,$))),le}}),y=n((A,O)=>{var F=S();O.exports=W;function W(V,$,K){return F(V,$,K,function(Z,Y){return Z.push(Y),Z},[])}}),x=n((A,O)=>{var F=y();O.exports=W;function W(V,$){return F(V,$,"post")}}),L=n((A,O)=>{var F=y();O.exports=W;function W(V,$){return F(V,$,"pre")}}),D=n((A,O)=>{var F=r(),W=u();O.exports=V;function V($,K){var Z=new F,Y={},X=new W,le;function q(J){var ae=J.v===le?J.w:J.v,fe=X.priority(ae);if(fe!==void 0){var we=K(J);we<fe&&(Y[ae]=le,X.decrease(ae,we))}}if($.nodeCount()===0)return Z;$.nodes().forEach(function(J){X.add(J,Number.POSITIVE_INFINITY),Z.setNode(J)}),X.decrease($.nodes()[0],0);for(var z=!1;X.size()>0;){if(le=X.removeMin(),Object.hasOwn(Y,le))Z.setEdge(le,Y[le]);else{if(z)throw new Error("Input graph is not connected: "+$);z=!0}$.nodeEdges(le).forEach(q)}return Z}}),E=n((A,O)=>{var F=f(),W=d();O.exports=V;function V(K,Z,Y,X){return $(K,Z,Y,X||function(le){return K.outEdges(le)})}function $(K,Z,Y,X){if(Y===void 0)return F(K,Z,Y,X);for(var le=!1,q=K.nodes(),z=0;z<q.length;z++){for(var J=X(q[z]),ae=0;ae<J.length;ae++){var fe=J[ae],we=fe.v===q[z]?fe.v:fe.w,Re=we===fe.v?fe.w:fe.v;Y({v:we,w:Re})<0&&(le=!0)}if(le)return W(K,Z,Y,X)}return F(K,Z,Y,X)}}),T=n((A,O)=>{O.exports={bellmanFord:d(),components:h(),dijkstra:f(),dijkstraAll:g(),extractPath:p(),findCycles:v(),floydWarshall:b(),isAcyclic:C(),postorder:x(),preorder:L(),prim:D(),shortestPaths:E(),reduce:S(),tarjan:_(),topsort:w()}}),N=l();e.exports={Graph:N.Graph,json:c(),alg:T(),version:N.version}}),BHe=Ai((s,e)=>{var t=class{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,r=o._prev;if(r!==o)return i(r),r}enqueue(o){let r=this._sentinel;o._prev&&o._next&&i(o),o._next=r._next,r._next._prev=o,r._next=o,o._prev=r}toString(){let o=[],r=this._sentinel,a=r._prev;for(;a!==r;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}};function i(o){o._prev._next=o._next,o._next._prev=o._prev,delete o._next,delete o._prev}function n(o,r){if(o!=="_next"&&o!=="_prev")return r}e.exports=t}),HHe=Ai((s,e)=>{var t=Ol().Graph,i=BHe();e.exports=o;var n=()=>1;function o(h,u){if(h.nodeCount()<=1)return[];let f=l(h,u||n);return r(f.graph,f.buckets,f.zeroIdx).flatMap(g=>h.outEdges(g.v,g.w))}function r(h,u,f){let g=[],p=u[u.length-1],_=u[0],v;for(;h.nodeCount();){for(;v=_.dequeue();)a(h,u,f,v);for(;v=p.dequeue();)a(h,u,f,v);if(h.nodeCount()){for(let b=u.length-2;b>0;--b)if(v=u[b].dequeue(),v){g=g.concat(a(h,u,f,v,!0));break}}}return g}function a(h,u,f,g,p){let _=p?[]:void 0;return h.inEdges(g.v).forEach(v=>{let b=h.edge(v),w=h.node(v.v);p&&_.push({v:v.v,w:v.w}),w.out-=b,c(u,f,w)}),h.outEdges(g.v).forEach(v=>{let b=h.edge(v),w=v.w,C=h.node(w);C.in-=b,c(u,f,C)}),h.removeNode(g.v),_}function l(h,u){let f=new t,g=0,p=0;h.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let w=f.edge(b.v,b.w)||0,C=u(b),S=w+C;f.setEdge(b.v,b.w,S),p=Math.max(p,f.node(b.v).out+=C),g=Math.max(g,f.node(b.w).in+=C)});let _=d(p+g+3).map(()=>new i),v=g+1;return f.nodes().forEach(b=>{c(_,v,f.node(b))}),{graph:f,buckets:_,zeroIdx:v}}function c(h,u,f){f.out?f.in?h[f.out-f.in+u].enqueue(f):h[h.length-1].enqueue(f):h[0].enqueue(f)}function d(h){let u=[];for(let f=0;f<h;f++)u.push(f);return u}}),ts=Ai((s,e)=>{var t=Ol().Graph;e.exports={addBorderNode:u,addDummyNode:i,applyWithChunking:p,asNonCompoundGraph:o,buildLayerMatrix:c,intersectRect:l,mapValues:L,maxRank:_,normalizeRanks:d,notime:w,partition:v,pick:x,predecessorWeights:a,range:y,removeEmptyRanks:h,simplify:n,successorWeights:r,time:b,uniqueId:S,zipObject:D};function i(E,T,N,A){for(var O=A;E.hasNode(O);)O=S(A);return N.dummy=T,E.setNode(O,N),O}function n(E){let T=new t().setGraph(E.graph());return E.nodes().forEach(N=>T.setNode(N,E.node(N))),E.edges().forEach(N=>{let A=T.edge(N.v,N.w)||{weight:0,minlen:1},O=E.edge(N);T.setEdge(N.v,N.w,{weight:A.weight+O.weight,minlen:Math.max(A.minlen,O.minlen)})}),T}function o(E){let T=new t({multigraph:E.isMultigraph()}).setGraph(E.graph());return E.nodes().forEach(N=>{E.children(N).length||T.setNode(N,E.node(N))}),E.edges().forEach(N=>{T.setEdge(N,E.edge(N))}),T}function r(E){let T=E.nodes().map(N=>{let A={};return E.outEdges(N).forEach(O=>{A[O.w]=(A[O.w]||0)+E.edge(O).weight}),A});return D(E.nodes(),T)}function a(E){let T=E.nodes().map(N=>{let A={};return E.inEdges(N).forEach(O=>{A[O.v]=(A[O.v]||0)+E.edge(O).weight}),A});return D(E.nodes(),T)}function l(E,T){let N=E.x,A=E.y,O=T.x-N,F=T.y-A,W=E.width/2,V=E.height/2;if(!O&&!F)throw new Error("Not possible to find intersection inside of the rectangle");let $,K;return Math.abs(F)*W>Math.abs(O)*V?(F<0&&(V=-V),$=V*O/F,K=V):(O<0&&(W=-W),$=W,K=W*F/O),{x:N+$,y:A+K}}function c(E){let T=y(_(E)+1).map(()=>[]);return E.nodes().forEach(N=>{let A=E.node(N),O=A.rank;O!==void 0&&(T[O][A.order]=N)}),T}function d(E){let T=E.nodes().map(A=>{let O=E.node(A).rank;return O===void 0?Number.MAX_VALUE:O}),N=p(Math.min,T);E.nodes().forEach(A=>{let O=E.node(A);Object.hasOwn(O,"rank")&&(O.rank-=N)})}function h(E){let T=E.nodes().map(W=>E.node(W).rank).filter(W=>W!==void 0),N=p(Math.min,T),A=[];E.nodes().forEach(W=>{let V=E.node(W).rank-N;A[V]||(A[V]=[]),A[V].push(W)});let O=0,F=E.graph().nodeRankFactor;Array.from(A).forEach((W,V)=>{W===void 0&&V%F!==0?--O:W!==void 0&&O&&W.forEach($=>E.node($).rank+=O)})}function u(E,T,N,A){let O={width:0,height:0};return arguments.length>=4&&(O.rank=N,O.order=A),i(E,"border",O,T)}function f(E,T=g){let N=[];for(let A=0;A<E.length;A+=T){let O=E.slice(A,A+T);N.push(O)}return N}var g=65535;function p(E,T){if(T.length>g){let N=f(T);return E.apply(null,N.map(A=>E.apply(null,A)))}else return E.apply(null,T)}function _(E){let T=E.nodes().map(N=>{let A=E.node(N).rank;return A===void 0?Number.MIN_VALUE:A});return p(Math.max,T)}function v(E,T){let N={lhs:[],rhs:[]};return E.forEach(A=>{T(A)?N.lhs.push(A):N.rhs.push(A)}),N}function b(E,T){let N=Date.now();try{return T()}finally{console.log(E+" time: "+(Date.now()-N)+"ms")}}function w(E,T){return T()}var C=0;function S(E){var T=++C;return E+(""+T)}function y(E,T,N=1){T==null&&(T=E,E=0);let A=F=>F<T;N<0&&(A=F=>T<F);let O=[];for(let F=E;A(F);F+=N)O.push(F);return O}function x(E,T){let N={};for(let A of T)E[A]!==void 0&&(N[A]=E[A]);return N}function L(E,T){let N=T;return typeof T=="string"&&(N=A=>A[T]),Object.entries(E).reduce((A,[O,F])=>(A[O]=N(F,O),A),{})}function D(E,T){return E.reduce((N,A,O)=>(N[A]=T[O],N),{})}}),VHe=Ai((s,e)=>{var t=HHe(),i=ts().uniqueId;e.exports={run:n,undo:r};function n(a){(a.graph().acyclicer==="greedy"?t(a,l(a)):o(a)).forEach(c=>{let d=a.edge(c);a.removeEdge(c),d.forwardName=c.name,d.reversed=!0,a.setEdge(c.w,c.v,d,i("rev"))});function l(c){return d=>c.edge(d).weight}}function o(a){let l=[],c={},d={};function h(u){Object.hasOwn(d,u)||(d[u]=!0,c[u]=!0,a.outEdges(u).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):h(f.w)}),delete c[u])}return a.nodes().forEach(h),l}function r(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let d=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,d)}})}}),zHe=Ai((s,e)=>{var t=ts();e.exports={run:i,undo:o};function i(r){r.graph().dummyChains=[],r.edges().forEach(a=>n(r,a))}function n(r,a){let l=a.v,c=r.node(l).rank,d=a.w,h=r.node(d).rank,u=a.name,f=r.edge(a),g=f.labelRank;if(h===c+1)return;r.removeEdge(a);let p,_,v;for(v=0,++c;c<h;++v,++c)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},p=t.addDummyNode(r,"edge",_,"_d"),c===g&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),r.setEdge(l,p,{weight:f.weight},u),v===0&&r.graph().dummyChains.push(p),l=p;r.setEdge(l,d,{weight:f.weight},u)}function o(r){r.graph().dummyChains.forEach(a=>{let l=r.node(a),c=l.edgeLabel,d;for(r.setEdge(l.edgeObj,c);l.dummy;)d=r.successors(a)[0],r.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=d,l=r.node(a)})}}),ZE=Ai((s,e)=>{var{applyWithChunking:t}=ts();e.exports={longestPath:i,slack:n};function i(o){var r={};function a(l){var c=o.node(l);if(Object.hasOwn(r,l))return c.rank;r[l]=!0;let d=o.outEdges(l).map(u=>u==null?Number.POSITIVE_INFINITY:a(u.w)-o.edge(u).minlen);var h=t(Math.min,d);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}o.sources().forEach(a)}function n(o,r){return o.node(r.w).rank-o.node(r.v).rank-o.edge(r).minlen}}),are=Ai((s,e)=>{var t=Ol().Graph,i=ZE().slack;e.exports=n;function n(l){var c=new t({directed:!1}),d=l.nodes()[0],h=l.nodeCount();c.setNode(d,{});for(var u,f;o(c,l)<h;)u=r(c,l),f=c.hasNode(u.v)?i(l,u):-i(l,u),a(c,l,f);return c}function o(l,c){function d(h){c.nodeEdges(h).forEach(u=>{var f=u.v,g=h===f?u.w:f;!l.hasNode(g)&&!i(c,u)&&(l.setNode(g,{}),l.setEdge(h,g,{}),d(g))})}return l.nodes().forEach(d),l.nodeCount()}function r(l,c){return c.edges().reduce((d,h)=>{let u=Number.POSITIVE_INFINITY;return l.hasNode(h.v)!==l.hasNode(h.w)&&(u=i(c,h)),u<d[0]?[u,h]:d},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,d){l.nodes().forEach(h=>c.node(h).rank+=d)}}),UHe=Ai((s,e)=>{var t=are(),i=ZE().slack,n=ZE().longestPath,o=Ol().alg.preorder,r=Ol().alg.postorder,a=ts().simplify;e.exports=l,l.initLowLimValues=u,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=p,l.exchangeEdges=_;function l(C){C=a(C),n(C);var S=t(C);u(S),c(S,C);for(var y,x;y=g(S);)x=p(S,C,y),_(S,C,y,x)}function c(C,S){var y=r(C,C.nodes());y=y.slice(0,y.length-1),y.forEach(x=>d(C,S,x))}function d(C,S,y){var x=C.node(y),L=x.parent;C.edge(y,L).cutvalue=h(C,S,y)}function h(C,S,y){var x=C.node(y),L=x.parent,D=!0,E=S.edge(y,L),T=0;return E||(D=!1,E=S.edge(L,y)),T=E.weight,S.nodeEdges(y).forEach(N=>{var A=N.v===y,O=A?N.w:N.v;if(O!==L){var F=A===D,W=S.edge(N).weight;if(T+=F?W:-W,b(C,y,O)){var V=C.edge(y,O).cutvalue;T+=F?-V:V}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),f(C,{},1,S)}function f(C,S,y,x,L){var D=y,E=C.node(x);return S[x]=!0,C.neighbors(x).forEach(T=>{Object.hasOwn(S,T)||(y=f(C,S,y,T,x))}),E.low=D,E.lim=y++,L?E.parent=L:delete E.parent,y}function g(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,y){var x=y.v,L=y.w;S.hasEdge(x,L)||(x=y.w,L=y.v);var D=C.node(x),E=C.node(L),T=D,N=!1;D.lim>E.lim&&(T=E,N=!0);var A=S.edges().filter(O=>N===w(C,C.node(O.v),T)&&N!==w(C,C.node(O.w),T));return A.reduce((O,F)=>i(S,F)<i(S,O)?F:O)}function _(C,S,y,x){var L=y.v,D=y.w;C.removeEdge(L,D),C.setEdge(x.v,x.w,{}),u(C),c(C,S),v(C,S)}function v(C,S){var y=C.nodes().find(L=>!S.node(L).parent),x=o(C,y);x=x.slice(1),x.forEach(L=>{var D=C.node(L).parent,E=S.edge(L,D),T=!1;E||(E=S.edge(D,L),T=!0),S.node(L).rank=S.node(D).rank+(T?E.minlen:-E.minlen)})}function b(C,S,y){return C.hasEdge(S,y)}function w(C,S,y){return y.low<=S.lim&&S.lim<=y.lim}}),$He=Ai((s,e)=>{var t=ZE(),i=t.longestPath,n=are(),o=UHe();e.exports=r;function r(d){var h=d.graph().ranker;if(h instanceof Function)return h(d);switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":a(d);break;case"none":break;default:c(d)}}var a=i;function l(d){i(d),n(d)}function c(d){o(d)}}),jHe=Ai((s,e)=>{e.exports=t;function t(o){let r=n(o);o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeObj,d=i(o,r,c.v,c.w),h=d.path,u=d.lca,f=0,g=h[f],p=!0;for(;a!==c.w;){if(l=o.node(a),p){for(;(g=h[f])!==u&&o.node(g).maxRank<l.rank;)f++;g===u&&(p=!1)}if(!p){for(;f<h.length-1&&o.node(g=h[f+1]).minRank<=l.rank;)f++;g=h[f]}o.setParent(a,g),a=o.successors(a)[0]}})}function i(o,r,a,l){let c=[],d=[],h=Math.min(r[a].low,r[l].low),u=Math.max(r[a].lim,r[l].lim),f,g;f=a;do f=o.parent(f),c.push(f);while(f&&(r[f].low>h||u>r[f].lim));for(g=f,f=l;(f=o.parent(f))!==g;)d.push(f);return{path:c.concat(d.reverse()),lca:g}}function n(o){let r={},a=0;function l(c){let d=a;o.children(c).forEach(l),r[c]={low:d,lim:a++}}return o.children().forEach(l),r}}),qHe=Ai((s,e)=>{var t=ts();e.exports={run:i,cleanup:a};function i(l){let c=t.addDummyNode(l,"root",{},"_root"),d=o(l),h=Object.values(d),u=t.applyWithChunking(Math.max,h)-1,f=2*u+1;l.graph().nestingRoot=c,l.edges().forEach(p=>l.edge(p).minlen*=f);let g=r(l)+1;l.children().forEach(p=>n(l,c,f,g,u,d,p)),l.graph().nodeRankFactor=f}function n(l,c,d,h,u,f,g){let p=l.children(g);if(!p.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:d});return}let _=t.addBorderNode(l,"_bt"),v=t.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(_,g),b.borderTop=_,l.setParent(v,g),b.borderBottom=v,p.forEach(w=>{n(l,c,d,h,u,f,w);let C=l.node(w),S=C.borderTop?C.borderTop:w,y=C.borderBottom?C.borderBottom:w,x=C.borderTop?h:2*h,L=S!==y?1:u-f[g]+1;l.setEdge(_,S,{weight:x,minlen:L,nestingEdge:!0}),l.setEdge(y,v,{weight:x,minlen:L,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,_,{weight:0,minlen:u+f[g]})}function o(l){var c={};function d(h,u){var f=l.children(h);f&&f.length&&f.forEach(g=>d(g,u+1)),c[h]=u}return l.children().forEach(h=>d(h,1)),c}function r(l){return l.edges().reduce((c,d)=>c+l.edge(d).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(d=>{var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}}),KHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(o){function r(a){let l=o.children(a),c=o.node(a);if(l.length&&l.forEach(r),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let d=c.minRank,h=c.maxRank+1;d<h;++d)n(o,"borderLeft","_bl",a,c,d),n(o,"borderRight","_br",a,c,d)}}o.children().forEach(r)}function n(o,r,a,l,c,d){let h={width:0,height:0,rank:d,borderType:r},u=c[r][d-1],f=t.addDummyNode(o,"border",h,a);c[r][d]=f,o.setParent(f,l),u&&o.setEdge(u,f,{weight:1})}}),GHe=Ai((s,e)=>{e.exports={adjust:t,undo:i};function t(d){let h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(d)}function i(d){let h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&r(d),(h==="lr"||h==="rl")&&(l(d),n(d))}function n(d){d.nodes().forEach(h=>o(d.node(h))),d.edges().forEach(h=>o(d.edge(h)))}function o(d){let h=d.width;d.width=d.height,d.height=h}function r(d){d.nodes().forEach(h=>a(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(a),Object.hasOwn(u,"y")&&a(u)})}function a(d){d.y=-d.y}function l(d){d.nodes().forEach(h=>c(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(c),Object.hasOwn(u,"x")&&c(u)})}function c(d){let h=d.x;d.x=d.y,d.y=h}}),YHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(n){let o={},r=n.nodes().filter(h=>!n.children(h).length),a=r.map(h=>n.node(h).rank),l=t.applyWithChunking(Math.max,a),c=t.range(l+1).map(()=>[]);function d(h){if(o[h])return;o[h]=!0;let u=n.node(h);c[u.rank].push(h),n.successors(h).forEach(d)}return r.sort((h,u)=>n.node(h).rank-n.node(u).rank).forEach(d),c}}),ZHe=Ai((s,e)=>{var t=ts().zipObject;e.exports=i;function i(o,r){let a=0;for(let l=1;l<r.length;++l)a+=n(o,r[l-1],r[l]);return a}function n(o,r,a){let l=t(a,a.map((g,p)=>p)),c=r.flatMap(g=>o.outEdges(g).map(p=>({pos:l[p.w],weight:o.edge(p).weight})).sort((p,_)=>p.pos-_.pos)),d=1;for(;d<a.length;)d<<=1;let h=2*d-1;d-=1;let u=new Array(h).fill(0),f=0;return c.forEach(g=>{let p=g.pos+d;u[p]+=g.weight;let _=0;for(;p>0;)p%2&&(_+=u[p+1]),p=p-1>>1,u[p]+=g.weight;f+=g.weight*_}),f}}),XHe=Ai((s,e)=>{e.exports=t;function t(i,n=[]){return n.map(o=>{let r=i.inEdges(o);if(r.length){let a=r.reduce((l,c)=>{let d=i.edge(c),h=i.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:o}})}}),QHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(r,a){let l={};r.forEach((d,h)=>{let u=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};d.barycenter!==void 0&&(u.barycenter=d.barycenter,u.weight=d.weight)}),a.edges().forEach(d=>{let h=l[d.v],u=l[d.w];h!==void 0&&u!==void 0&&(u.indegree++,h.out.push(l[d.w]))});let c=Object.values(l).filter(d=>!d.indegree);return n(c)}function n(r){let a=[];function l(d){return h=>{h.merged||(h.barycenter===void 0||d.barycenter===void 0||h.barycenter>=d.barycenter)&&o(d,h)}}function c(d){return h=>{h.in.push(d),--h.indegree===0&&r.push(h)}}for(;r.length;){let d=r.pop();a.push(d),d.in.reverse().forEach(l(d)),d.out.forEach(c(d))}return a.filter(d=>!d.merged).map(d=>t.pick(d,["vs","i","barycenter","weight"]))}function o(r,a){let l=0,c=0;r.weight&&(l+=r.barycenter*r.weight,c+=r.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),r.vs=a.vs.concat(r.vs),r.barycenter=l/c,r.weight=c,r.i=Math.min(a.i,r.i),a.merged=!0}}),JHe=Ai((s,e)=>{var t=ts();e.exports=i;function i(r,a){let l=t.partition(r,_=>Object.hasOwn(_,"barycenter")),c=l.lhs,d=l.rhs.sort((_,v)=>v.i-_.i),h=[],u=0,f=0,g=0;c.sort(o(!!a)),g=n(h,d,g),c.forEach(_=>{g+=_.vs.length,h.push(_.vs),u+=_.barycenter*_.weight,f+=_.weight,g=n(h,d,g)});let p={vs:h.flat(!0)};return f&&(p.barycenter=u/f,p.weight=f),p}function n(r,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),r.push(c.vs),l++;return l}function o(r){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:r?l.i-a.i:a.i-l.i}}),eVe=Ai((s,e)=>{var t=XHe(),i=QHe(),n=JHe();e.exports=o;function o(l,c,d,h){let u=l.children(c),f=l.node(c),g=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,_={};g&&(u=u.filter(C=>C!==g&&C!==p));let v=t(l,u);v.forEach(C=>{if(l.children(C.v).length){let S=o(l,C.v,d,h);_[C.v]=S,Object.hasOwn(S,"barycenter")&&a(C,S)}});let b=i(v,d);r(b,_);let w=n(b,h);if(g&&(w.vs=[g,w.vs,p].flat(!0),l.predecessors(g).length)){let C=l.node(l.predecessors(g)[0]),S=l.node(l.predecessors(p)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+C.order+S.order)/(w.weight+2),w.weight+=2}return w}function r(l,c){l.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),tVe=Ai((s,e)=>{var t=Ol().Graph,i=ts();e.exports=n;function n(r,a,l,c){c||(c=r.nodes());let d=o(r),h=new t({compound:!0}).setGraph({root:d}).setDefaultNodeLabel(u=>r.node(u));return c.forEach(u=>{let f=r.node(u),g=r.parent(u);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(h.setNode(u),h.setParent(u,g||d),r[l](u).forEach(p=>{let _=p.v===u?p.w:p.v,v=h.edge(_,u),b=v!==void 0?v.weight:0;h.setEdge(_,u,{weight:r.edge(p).weight+b})}),Object.hasOwn(f,"minRank")&&h.setNode(u,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),h}function o(r){for(var a;r.hasNode(a=i.uniqueId("_root")););return a}}),iVe=Ai((s,e)=>{e.exports=t;function t(i,n,o){let r={},a;o.forEach(l=>{let c=i.parent(l),d,h;for(;c;){if(d=i.parent(c),d?(h=r[d],r[d]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=d}})}}),nVe=Ai((s,e)=>{var t=YHe(),i=ZHe(),n=eVe(),o=tVe(),r=iVe(),a=Ol().Graph,l=ts();e.exports=c;function c(f,g={}){if(typeof g.customOrder=="function"){g.customOrder(f,c);return}let p=l.maxRank(f),_=d(f,l.range(1,p+1),"inEdges"),v=d(f,l.range(p-1,-1,-1),"outEdges"),b=t(f);if(u(f,b),g.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,C,S=g.constraints||[];for(let y=0,x=0;x<4;++y,++x){h(y%2?_:v,y%4>=2,S),b=l.buildLayerMatrix(f);let L=i(f,b);L<w?(x=0,C=Object.assign({},b),w=L):L===w&&(C=structuredClone(b))}u(f,C)}function d(f,g,p){let _=new Map,v=(b,w)=>{_.has(b)||_.set(b,[]),_.get(b).push(w)};for(let b of f.nodes()){let w=f.node(b);if(typeof w.rank=="number"&&v(w.rank,b),typeof w.minRank=="number"&&typeof w.maxRank=="number")for(let C=w.minRank;C<=w.maxRank;C++)C!==w.rank&&v(C,b)}return g.map(function(b){return o(f,b,p,_.get(b)||[])})}function h(f,g,p){let _=new a;f.forEach(function(v){p.forEach(C=>_.setEdge(C.left,C.right));let b=v.graph().root,w=n(v,b,_,g);w.vs.forEach((C,S)=>v.node(C).order=S),r(v,_,w.vs)})}function u(f,g){Object.values(g).forEach(p=>p.forEach((_,v)=>f.node(_).order=v))}}),sVe=Ai((s,e)=>{var t=Ol().Graph,i=ts();e.exports={positionX:p,findType1Conflicts:n,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:u,balance:g};function n(b,w){let C={};function S(y,x){let L=0,D=0,E=y.length,T=x[x.length-1];return x.forEach((N,A)=>{let O=r(b,N),F=O?b.node(O).order:E;(O||N===T)&&(x.slice(D,A+1).forEach(W=>{b.predecessors(W).forEach(V=>{let $=b.node(V),K=$.order;(K<L||F<K)&&!($.dummy&&b.node(W).dummy)&&a(C,V,W)})}),D=A+1,L=F)}),x}return w.length&&w.reduce(S),C}function o(b,w){let C={};function S(x,L,D,E,T){let N;i.range(L,D).forEach(A=>{N=x[A],b.node(N).dummy&&b.predecessors(N).forEach(O=>{let F=b.node(O);F.dummy&&(F.order<E||F.order>T)&&a(C,O,N)})})}function y(x,L){let D=-1,E,T=0;return L.forEach((N,A)=>{if(b.node(N).dummy==="border"){let O=b.predecessors(N);O.length&&(E=b.node(O[0]).order,S(L,T,A,D,E),T=A,D=E)}S(L,T,L.length,E,x.length)}),L}return w.length&&w.reduce(y),C}function r(b,w){if(b.node(w).dummy)return b.predecessors(w).find(C=>b.node(C).dummy)}function a(b,w,C){if(w>C){let y=w;w=C,C=y}let S=b[w];S||(b[w]=S={}),S[C]=!0}function l(b,w,C){if(w>C){let S=w;w=C,C=S}return!!b[w]&&Object.hasOwn(b[w],C)}function c(b,w,C,S){let y={},x={},L={};return w.forEach(D=>{D.forEach((E,T)=>{y[E]=E,x[E]=E,L[E]=T})}),w.forEach(D=>{let E=-1;D.forEach(T=>{let N=S(T);if(N.length){N=N.sort((O,F)=>L[O]-L[F]);let A=(N.length-1)/2;for(let O=Math.floor(A),F=Math.ceil(A);O<=F;++O){let W=N[O];x[T]===T&&E<L[W]&&!l(C,T,W)&&(x[W]=T,x[T]=y[T]=y[W],E=L[W])}}})}),{root:y,align:x}}function d(b,w,C,S,y){let x={},L=h(b,w,C,y),D=y?"borderLeft":"borderRight";function E(A,O){let F=L.nodes().slice(),W={},V=F.pop();for(;V;){if(W[V])A(V);else{W[V]=!0,F.push(V);for(let $ of O(V))F.push($)}V=F.pop()}}function T(A){x[A]=L.inEdges(A).reduce((O,F)=>Math.max(O,x[F.v]+L.edge(F)),0)}function N(A){let O=L.outEdges(A).reduce((W,V)=>Math.min(W,x[V.w]-L.edge(V)),Number.POSITIVE_INFINITY),F=b.node(A);O!==Number.POSITIVE_INFINITY&&F.borderType!==D&&(x[A]=Math.max(x[A],O))}return E(T,L.predecessors.bind(L)),E(N,L.successors.bind(L)),Object.keys(S).forEach(A=>x[A]=x[C[A]]),x}function h(b,w,C,S){let y=new t,x=b.graph(),L=_(x.nodesep,x.edgesep,S);return w.forEach(D=>{let E;D.forEach(T=>{let N=C[T];if(y.setNode(N),E){var A=C[E],O=y.edge(A,N);y.setEdge(A,N,Math.max(L(b,T,E),O||0))}E=T})}),y}function u(b,w){return Object.values(w).reduce((C,S)=>{let y=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([D,E])=>{let T=v(b,D)/2;y=Math.max(E+T,y),x=Math.min(E-T,x)});let L=y-x;return L<C[0]&&(C=[L,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function f(b,w){let C=Object.values(w),S=i.applyWithChunking(Math.min,C),y=i.applyWithChunking(Math.max,C);["u","d"].forEach(x=>{["l","r"].forEach(L=>{let D=x+L,E=b[D];if(E===w)return;let T=Object.values(E),N=S-i.applyWithChunking(Math.min,T);L!=="l"&&(N=y-i.applyWithChunking(Math.max,T)),N&&(b[D]=i.mapValues(E,A=>A+N))})})}function g(b,w){return i.mapValues(b.ul,(C,S)=>{if(w)return b[w.toLowerCase()][S];{let y=Object.values(b).map(x=>x[S]).sort((x,L)=>x-L);return(y[1]+y[2])/2}})}function p(b){let w=i.buildLayerMatrix(b),C=Object.assign(n(b,w),o(b,w)),S={},y;["u","d"].forEach(L=>{y=L==="u"?w:Object.values(w).reverse(),["l","r"].forEach(D=>{D==="r"&&(y=y.map(A=>Object.values(A).reverse()));let E=(L==="u"?b.predecessors:b.successors).bind(b),T=c(b,y,C,E),N=d(b,y,T.root,T.align,D==="r");D==="r"&&(N=i.mapValues(N,A=>-A)),S[L+D]=N})});let x=u(b,S);return f(S,x),g(S,b.graph().align)}function _(b,w,C){return(S,y,x)=>{let L=S.node(y),D=S.node(x),E=0,T;if(E+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":T=-L.width/2;break;case"r":T=L.width/2;break}if(T&&(E+=C?T:-T),T=0,E+=(L.dummy?w:b)/2,E+=(D.dummy?w:b)/2,E+=D.width/2,Object.hasOwn(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":T=D.width/2;break;case"r":T=-D.width/2;break}return T&&(E+=C?T:-T),T=0,E}}function v(b,w){return b.node(w).width}}),oVe=Ai((s,e)=>{var t=ts(),i=sVe().positionX;e.exports=n;function n(r){r=t.asNonCompoundGraph(r),o(r),Object.entries(i(r)).forEach(([a,l])=>r.node(a).x=l)}function o(r){let a=t.buildLayerMatrix(r),l=r.graph().ranksep,c=r.graph().rankalign,d=0;a.forEach(h=>{let u=h.reduce((f,g)=>{let p=r.node(g).height;return f>p?f:p},0);h.forEach(f=>{let g=r.node(f);c==="top"?g.y=d+g.height/2:c==="bottom"?g.y=d+u-g.height/2:g.y=d+u/2}),d+=u+l})}}),rVe=Ai((s,e)=>{var t=VHe(),i=zHe(),n=$He(),o=ts().normalizeRanks,r=jHe(),a=ts().removeEmptyRanks,l=qHe(),c=KHe(),d=GHe(),h=nVe(),u=oVe(),f=ts(),g=Ol().Graph;e.exports=p;function p(z,J={}){let ae=J.debugTiming?f.time:f.notime;return ae("layout",()=>{let fe=ae(" buildLayoutGraph",()=>E(z));return ae(" runLayout",()=>_(fe,ae,J)),ae(" updateInputGraph",()=>v(z,fe)),fe})}function _(z,J,ae){J(" makeSpaceForEdgeLabels",()=>T(z)),J(" removeSelfEdges",()=>Z(z)),J(" acyclic",()=>t.run(z)),J(" nestingGraph.run",()=>l.run(z)),J(" rank",()=>n(f.asNonCompoundGraph(z))),J(" injectEdgeLabelProxies",()=>N(z)),J(" removeEmptyRanks",()=>a(z)),J(" nestingGraph.cleanup",()=>l.cleanup(z)),J(" normalizeRanks",()=>o(z)),J(" assignRankMinMax",()=>A(z)),J(" removeEdgeLabelProxies",()=>O(z)),J(" normalize.run",()=>i.run(z)),J(" parentDummyChains",()=>r(z)),J(" addBorderSegments",()=>c(z)),J(" order",()=>h(z,ae)),J(" insertSelfEdges",()=>Y(z)),J(" adjustCoordinateSystem",()=>d.adjust(z)),J(" position",()=>u(z)),J(" positionSelfEdges",()=>X(z)),J(" removeBorderNodes",()=>K(z)),J(" normalize.undo",()=>i.undo(z)),J(" fixupEdgeLabelCoords",()=>V(z)),J(" undoCoordinateSystem",()=>d.undo(z)),J(" translateGraph",()=>F(z)),J(" assignNodeIntersects",()=>W(z)),J(" reversePoints",()=>$(z)),J(" acyclic.undo",()=>t.undo(z))}function v(z,J){z.nodes().forEach(ae=>{let fe=z.node(ae),we=J.node(ae);fe&&(fe.x=we.x,fe.y=we.y,fe.order=we.order,fe.rank=we.rank,J.children(ae).length&&(fe.width=we.width,fe.height=we.height))}),z.edges().forEach(ae=>{let fe=z.edge(ae),we=J.edge(ae);fe.points=we.points,Object.hasOwn(we,"x")&&(fe.x=we.x,fe.y=we.y)}),z.graph().width=J.graph().width,z.graph().height=J.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],S=["width","height","rank"],y={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function E(z){let J=new g({multigraph:!0,compound:!0}),ae=q(z.graph());return J.setGraph(Object.assign({},w,le(ae,b),f.pick(ae,C))),z.nodes().forEach(fe=>{let we=q(z.node(fe)),Re=le(we,S);Object.keys(y).forEach(Pe=>{Re[Pe]===void 0&&(Re[Pe]=y[Pe])}),J.setNode(fe,Re),J.setParent(fe,z.parent(fe))}),z.edges().forEach(fe=>{let we=q(z.edge(fe));J.setEdge(fe,Object.assign({},L,le(we,x),f.pick(we,D)))}),J}function T(z){let J=z.graph();J.ranksep/=2,z.edges().forEach(ae=>{let fe=z.edge(ae);fe.minlen*=2,fe.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?fe.width+=fe.labeloffset:fe.height+=fe.labeloffset)})}function N(z){z.edges().forEach(J=>{let ae=z.edge(J);if(ae.width&&ae.height){let fe=z.node(J.v),we={rank:(z.node(J.w).rank-fe.rank)/2+fe.rank,e:J};f.addDummyNode(z,"edge-proxy",we,"_ep")}})}function A(z){let J=0;z.nodes().forEach(ae=>{let fe=z.node(ae);fe.borderTop&&(fe.minRank=z.node(fe.borderTop).rank,fe.maxRank=z.node(fe.borderBottom).rank,J=Math.max(J,fe.maxRank))}),z.graph().maxRank=J}function O(z){z.nodes().forEach(J=>{let ae=z.node(J);ae.dummy==="edge-proxy"&&(z.edge(ae.e).labelRank=ae.rank,z.removeNode(J))})}function F(z){let J=Number.POSITIVE_INFINITY,ae=0,fe=Number.POSITIVE_INFINITY,we=0,Re=z.graph(),Pe=Re.marginx||0,Qe=Re.marginy||0;function Yi(Qt){let Ji=Qt.x,ao=Qt.y,lo=Qt.width,No=Qt.height;J=Math.min(J,Ji-lo/2),ae=Math.max(ae,Ji+lo/2),fe=Math.min(fe,ao-No/2),we=Math.max(we,ao+No/2)}z.nodes().forEach(Qt=>Yi(z.node(Qt))),z.edges().forEach(Qt=>{let Ji=z.edge(Qt);Object.hasOwn(Ji,"x")&&Yi(Ji)}),J-=Pe,fe-=Qe,z.nodes().forEach(Qt=>{let Ji=z.node(Qt);Ji.x-=J,Ji.y-=fe}),z.edges().forEach(Qt=>{let Ji=z.edge(Qt);Ji.points.forEach(ao=>{ao.x-=J,ao.y-=fe}),Object.hasOwn(Ji,"x")&&(Ji.x-=J),Object.hasOwn(Ji,"y")&&(Ji.y-=fe)}),Re.width=ae-J+Pe,Re.height=we-fe+Qe}function W(z){z.edges().forEach(J=>{let ae=z.edge(J),fe=z.node(J.v),we=z.node(J.w),Re,Pe;ae.points?(Re=ae.points[0],Pe=ae.points[ae.points.length-1]):(ae.points=[],Re=we,Pe=fe),ae.points.unshift(f.intersectRect(fe,Re)),ae.points.push(f.intersectRect(we,Pe))})}function V(z){z.edges().forEach(J=>{let ae=z.edge(J);if(Object.hasOwn(ae,"x"))switch((ae.labelpos==="l"||ae.labelpos==="r")&&(ae.width-=ae.labeloffset),ae.labelpos){case"l":ae.x-=ae.width/2+ae.labeloffset;break;case"r":ae.x+=ae.width/2+ae.labeloffset;break}})}function $(z){z.edges().forEach(J=>{let ae=z.edge(J);ae.reversed&&ae.points.reverse()})}function K(z){z.nodes().forEach(J=>{if(z.children(J).length){let ae=z.node(J),fe=z.node(ae.borderTop),we=z.node(ae.borderBottom),Re=z.node(ae.borderLeft[ae.borderLeft.length-1]),Pe=z.node(ae.borderRight[ae.borderRight.length-1]);ae.width=Math.abs(Pe.x-Re.x),ae.height=Math.abs(we.y-fe.y),ae.x=Re.x+ae.width/2,ae.y=fe.y+ae.height/2}}),z.nodes().forEach(J=>{z.node(J).dummy==="border"&&z.removeNode(J)})}function Z(z){z.edges().forEach(J=>{if(J.v===J.w){var ae=z.node(J.v);ae.selfEdges||(ae.selfEdges=[]),ae.selfEdges.push({e:J,label:z.edge(J)}),z.removeEdge(J)}})}function Y(z){var J=f.buildLayerMatrix(z);J.forEach(ae=>{var fe=0;ae.forEach((we,Re)=>{var Pe=z.node(we);Pe.order=Re+fe,(Pe.selfEdges||[]).forEach(Qe=>{f.addDummyNode(z,"selfedge",{width:Qe.label.width,height:Qe.label.height,rank:Pe.rank,order:Re+ ++fe,e:Qe.e,label:Qe.label},"_se")}),delete Pe.selfEdges})})}function X(z){z.nodes().forEach(J=>{var ae=z.node(J);if(ae.dummy==="selfedge"){var fe=z.node(ae.e.v),we=fe.x+fe.width/2,Re=fe.y,Pe=ae.x-we,Qe=fe.height/2;z.setEdge(ae.e,ae.label),z.removeNode(J),ae.label.points=[{x:we+2*Pe/3,y:Re-Qe},{x:we+5*Pe/6,y:Re-Qe},{x:we+Pe,y:Re},{x:we+5*Pe/6,y:Re+Qe},{x:we+2*Pe/3,y:Re+Qe}],ae.label.x=ae.x,ae.label.y=ae.y}})}function le(z,J){return f.mapValues(f.pick(z,J),Number)}function q(z){var J={};return z&&Object.entries(z).forEach(([ae,fe])=>{typeof ae=="string"&&(ae=ae.toLowerCase()),J[ae]=fe}),J}}),aVe=Ai((s,e)=>{var t=ts(),i=Ol().Graph;e.exports={debugOrdering:n};function n(o){let r=t.buildLayerMatrix(o),a=new i({compound:!0,multigraph:!0}).setGraph({});return o.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+o.node(l).rank)}),o.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),r.forEach((l,c)=>{let d="layer"+c;a.setNode(d,{rank:"same"}),l.reduce((h,u)=>(a.setEdge(h,u,{style:"invis"}),u))}),a}}),lVe=Ai((s,e)=>{e.exports="2.0.4"}),cVe=Ai((s,e)=>{e.exports={graphlib:Ol(),layout:rVe(),debug:aVe(),util:{time:ts().time,notime:ts().notime},version:lVe()}});const _Y=cVe();/*! For license information please see dagre.esm.js.LEGAL.txt */const bY=300,vY=100;function gP(s,e,t="TB"){const i=new _Y.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:t,ranksep:80,nodesep:40});for(const o of s)i.setNode(o.id,{width:bY,height:vY});for(const o of e)i.setEdge(o.source,o.target);return _Y.layout(i),{nodes:s.map(o=>{const r=i.node(o.id);return{...o,position:{x:r.x-bY/2,y:r.y-vY/2}}}),edges:e}}function dVe({data:s}){var r;const e=s,[t,i]=je.useState(!1),n=e.status==="root"?"file-node--root":e.status==="expanded"?"file-node--expanded":e.status==="loading"?"file-node--loading":e.status==="error"?"file-node--error":"file-node--collapsed",o=e.repoAlias?"file-node--cross-repo":"";return me.jsxs("div",{className:`file-node ${n} ${o}`,children:[!e.isRoot&&me.jsx(hV,{type:"target",position:uV.Top}),me.jsxs("div",{className:"file-node__header",children:[me.jsx("span",{className:"file-node__icon",children:e.isRoot?"📄":e.status==="expanded"?"📋":e.repoAlias?"🔗":"📁"}),me.jsx("span",{className:"file-node__label",title:e.filePath,children:e.label}),me.jsx("span",{className:"file-node__actions",children:e.adoUrl&&me.jsx("a",{href:e.adoUrl,target:"_blank",rel:"noopener noreferrer",className:"file-node__action-btn",title:"Open in Azure DevOps",onClick:a=>a.stopPropagation(),children:me.jsx(hVe,{})})})]}),e.repoAlias&&me.jsxs("div",{className:"file-node__repo-row",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[me.jsxs("span",{className:"file-node__repo",children:["@",e.repoAlias]}),e.repoInfo&&t&&me.jsxs("div",{className:"file-node__repo-tooltip",children:[me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Repo"}),me.jsx("span",{children:e.repoInfo.fullName})]}),me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Type"}),me.jsx("span",{children:e.repoInfo.type})]}),e.repoInfo.ref&&me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Ref"}),me.jsx("span",{children:e.repoInfo.ref})]}),e.repoInfo.project&&me.jsxs("div",{className:"file-node__repo-tooltip-row",children:[me.jsx("span",{className:"file-node__repo-tooltip-label",children:"Project"}),me.jsx("span",{children:e.repoInfo.project})]})]})]}),me.jsxs("div",{className:"file-node__meta",children:[e.status==="loading"&&me.jsx("span",{className:"file-node__spinner",children:"⏳ Loading..."}),e.status==="error"&&me.jsxs("span",{className:"file-node__error",title:e.errorMessage,children:["❌ ",(r=e.errorMessage)==null?void 0:r.slice(0,80)]}),e.status==="collapsed"&&me.jsx("span",{className:"file-node__hint",children:"Click to expand"}),e.status==="expanded"&&e.templateCount===0&&!e.isRoot&&me.jsx("span",{className:"file-node__leaf",children:"✓ no nested templates"}),(e.status==="root"||e.status==="expanded")&&e.templateCount>0&&me.jsxs("span",{className:"file-node__count",children:[e.templateCount," template ref(s)"]})]}),me.jsx(hV,{type:"source",position:uV.Bottom})]})}function hVe(){return me.jsx("svg",{width:"14",height:"14",viewBox:"0 0 18 18",className:"file-node__ado-icon","aria-label":"Azure DevOps",children:me.jsx("path",{d:"M17 4v9.74l-4 3.28-6.2-2.26V17l-3.51-4.59 10.23.8V4.44zm-3.41.49L7.85 1v2.29L2.58 4.84 1 6.87v4.61l2.26 1V6.57z",fill:"#3c91e5"})})}const uVe=je.memo(dVe);function pP({className:s,label:e,children:t}){const[i,n]=je.useState(!1);return me.jsxs("span",{className:s,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[e,i&&me.jsx("div",{className:"template-edge__badge-tooltip",children:t})]})}function fVe({id:s,sourceX:e,sourceY:t,targetX:i,targetY:n,sourcePosition:o,targetPosition:r,data:a,markerEnd:l,style:c}){var w;const d=a,[h,u]=je.useState(!1),[f,g,p]=kre({sourceX:e,sourceY:t,sourcePosition:o,targetX:i,targetY:n,targetPosition:r}),_=je.useCallback(()=>u(!0),[]),v=je.useCallback(()=>u(!1),[]),b=((w=d==null?void 0:d.parameterNames)==null?void 0:w.length)??0;return me.jsxs(me.Fragment,{children:[me.jsx(Ire,{id:s,path:f,markerEnd:l,style:c}),me.jsx(Dre,{children:me.jsxs("div",{className:"template-edge__label-container",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${g}px,${p}px)`,pointerEvents:"all"},children:[me.jsxs("div",{className:"template-edge__top-row",children:[me.jsx("span",{className:"template-edge__category",children:d==null?void 0:d.edgeLabel}),(d==null?void 0:d.conditional)&&me.jsxs(pP,{className:`template-edge__badge template-edge__badge--conditional${d.conditionResult===!1?" template-edge__badge--condition-false":d.conditionResult===!0?" template-edge__badge--condition-true":""}`,label:d.conditionResult===!1?"⊘ false":d.conditionResult===!0?"✓ conditional":"conditional",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚡ Conditional Reference"}),me.jsx("p",{children:d.conditionResult===!0?"Condition evaluated to true — this template will be included.":d.conditionResult===!1?"Condition evaluated to false — this template will NOT be included in this pipeline run.":"This template is inside a conditional block. The condition could not be fully evaluated."}),d.conditionExpression&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Condition"}),me.jsx("code",{children:d.conditionExpression})]}),d.conditionResult!=null&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Result"}),me.jsx("code",{children:String(d.conditionResult)})]})]}),(d==null?void 0:d.dynamicPath)&&d.expressionResolved&&me.jsxs(pP,{className:"template-edge__badge template-edge__badge--resolved",label:"🔮 resolved",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"🔮 Expression Resolved"}),me.jsx("p",{children:"The template path contained expressions that were successfully evaluated."}),me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),me.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Resolved"}),me.jsx("code",{children:d.resolvedPath})]})]}),(d==null?void 0:d.dynamicPath)&&!d.expressionResolved&&me.jsxs(pP,{className:"template-edge__badge template-edge__badge--unresolved",label:"⚠️ dynamic",children:[me.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚠️ Unresolved Expressions"}),me.jsx("p",{children:"The template path contains expressions that could not be evaluated at analysis time."}),me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),me.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&d.resolvedPath!==d.originalPath&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Partial"}),me.jsx("code",{children:d.resolvedPath})]}),d.unresolvedExpressions&&d.unresolvedExpressions.length>0&&me.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[me.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Unresolved"}),me.jsx("span",{children:d.unresolvedExpressions.join(", ")})]})]})]}),b>0&&me.jsxs("span",{className:"template-edge__params-badge",onMouseEnter:_,onMouseLeave:v,children:[gVe(d),h&&me.jsx(pVe,{data:d})]})]})})]})}function gVe(s){var t;const e=((t=s.parameterNames)==null?void 0:t.length)??0;return s.totalParameterCount!=null?`${e}/${s.totalParameterCount} params`:`${e} params`}function pVe({data:s}){var t,i;const e=(t=s.declaredParameterNames)==null?void 0:t.filter(n=>{var o;return!((o=s.parameterNames)!=null&&o.includes(n))});return me.jsxs("div",{className:"template-edge__params-tooltip",children:[s.parameterNames&&s.parameterNames.length>0&&me.jsxs("div",{className:"template-edge__params-section",children:[me.jsxs("div",{className:"template-edge__params-heading",children:["✓ Passed (",s.parameterNames.length,")"]}),me.jsx("ul",{className:"template-edge__params-list",children:s.parameterNames.map(n=>me.jsx("li",{className:"template-edge__params-item template-edge__params-item--passed",children:n},n))})]}),e&&e.length>0&&me.jsxs("div",{className:"template-edge__params-section",children:[me.jsxs("div",{className:"template-edge__params-heading",children:["○ Not passed (",e.length,")"]}),me.jsx("ul",{className:"template-edge__params-list",children:e.map(n=>me.jsx("li",{className:"template-edge__params-item template-edge__params-item--missing",children:n},n))})]}),s.totalParameterCount==null&&!((i=s.declaredParameterNames)!=null&&i.length)&&me.jsx("div",{className:"template-edge__params-hint",children:"Expand node to see all declared params"})]})}const mVe=je.memo(fVe),_Ve={fileNode:uVe},bVe={templateEdge:mVe},vVe={animated:!0,style:{stroke:"var(--accent)",strokeWidth:2},markerEnd:{type:yk.ArrowClosed,color:"var(--accent)"}};function CVe(){var O,F;const{org:s,project:e,selectedPipeline:t,selectedPipelineLoading:i,selectedPipelineError:n,expandedTemplates:o,setExpandedTemplate:r,setSelectedNodeDetail:a}=x2(),l=WHe(),[c,d,h]=Ere([]),[u,f,g]=Nre([]),p=je.useRef(null),_=je.useRef(null),v=je.useRef(""),b=je.useRef([]);je.useEffect(()=>{b.current=u},[u]);const[w,C]=je.useState(new Set),S=je.useRef(new Set),[y,x]=je.useState(!1),L=((F=(O=t==null?void 0:t.definition)==null?void 0:O.repository)==null?void 0:F.name)??"",D=je.useMemo(()=>{if(!(t!=null&&t.yaml))return[];try{const W=lb(t.yaml),V=W==null?void 0:W.resources;return(V==null?void 0:V.repositories)??[]}catch{return[]}},[t==null?void 0:t.yaml]),E=je.useMemo(()=>{if(!(t!=null&&t.yaml))return{};try{const W=lb(t.yaml);return AL(W??{})}catch{return{}}},[t==null?void 0:t.yaml]);je.useEffect(()=>{var Qe,Yi,Qt,Ji,ao,lo,No;if(!(t!=null&&t.yaml)){d([]),f([]);return}const W=lb(t.yaml),V=((Qe=t.definition)==null?void 0:Qe.path)??"",$=uP(W??{},{sourcePath:V}),K=((Yi=t.definition)==null?void 0:Yi.name)??V.split("/").pop()??"Pipeline",Z=QE(V),Y=lP(W??{}),X=((Ji=(Qt=t.definition)==null?void 0:Qt.repository)==null?void 0:Ji.name)??"",le=(No=(lo=(ao=t.definition)==null?void 0:ao.repository)==null?void 0:lo.defaultBranch)==null?void 0:No.replace(/^refs\/heads\//,""),q=s&&e&&X?uoe({org:s,project:e,repoName:X,filePath:V,branch:le}):void 0,z={id:"root",type:"fileNode",position:{x:0,y:0},data:{label:K,filePath:V,templateCount:$.length,status:"root",isRoot:!0,baseDir:Z,adoUrl:q}},{templateNodes:J,templateEdges:ae}=mP("root",$,s,e,L,D,Y,void 0,E),fe=[z,...J],we=[...ae],{nodes:Re,edges:Pe}=gP(fe,we);d(Re),f(Pe),S.current=new Set},[t,d,f]);const T=je.useRef(!1);je.useEffect(()=>{if(!y||!p.current||c.length===0)return;const W=`${c.length}:${u.length}`;if(W!==v.current)return v.current=W,_.current!=null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{var V;(V=p.current)==null||V.fitView({padding:.2,duration:300}),_.current=null}),()=>{_.current!=null&&(cancelAnimationFrame(_.current),_.current=null)}},[y,c.length,u.length]),je.useEffect(()=>{if(T.current)return;const W=c.filter(V=>{const $=V.data;if($.status!=="collapsed"||S.current.has(V.id)||w.has(V.id))return!1;const K=$._conditionResult;return!(K===!1||K==="unknown"&&!y)});if(W.length!==0){W.sort((V,$)=>{const K=V.data.templateLocation==="variables"?0:1,Z=$.data.templateLocation==="variables"?0:1;return K-Z});for(const V of W){const $=V.data;$.dynamicPath&&!$.expressionResolved||S.current.add(V.id)}T.current=!0,(async()=>{for(const V of W){const $=V.data;if(!($.dynamicPath&&!$.expressionResolved))try{const{content:K,actualPath:Z}=await _P(s,e,L,$,D,o,r,l),Y=lb(K)??{},X=$._ref,le=uP(Y,{contextRepoAlias:Sp(X??{}),sourcePath:Z}),q=XG(Y);if(le.length===0){const J=$.templateLocation==="variables"?AL(Y):void 0,ae=J&&Object.keys(J).length>0,fe=new Set,we=new Set,Re=new Map;if(ae)for(const Pe of c){const Qe=Pe.data;if(Qe.dynamicPath&&!Qe.expressionResolved){const Yi=OL(Pe,J,s,e,L,D);if(Yi!==Pe){fe.add(Pe.id);const Qt=Yi.data;Qt.repoAlias&&we.add(Pe.id),Re.set(Pe.id,Qt.filePath)}}}d(Pe=>Pe.map(Qe=>Qe.id===V.id?{...Qe,data:{...Qe.data,status:"expanded",templateCount:0,totalParameterCount:q.length||void 0,declaredParameterNames:q.length?q:void 0}}:ae&&fe.has(Qe.id)?OL(Qe,J,s,e,L,D):Qe)),fe.size>0&&f(Pe=>Pe.map(Qe=>{if(!fe.has(Qe.target))return Qe;const Yi=Qe.data;if(!(Yi!=null&&Yi.dynamicPath))return Qe;const Qt=we.has(Qe.target);return{...Qe,data:{...Yi,expressionResolved:!0,isExternal:Qt||Yi.isExternal||void 0,resolvedPath:Re.get(Qe.target)??Yi.resolvedPath,unresolvedExpressions:void 0},style:Qt?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:Qe.style,markerEnd:Qt?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:Qe.markerEnd}}))}else if(y){const z=lP(Y),J=$._parentParamContext,ae=$._accumulatedVariables,fe=X==null?void 0:X.parameters,we=XE(fe,J,ae),Re={...z,...we},Pe=AL(Y),Qe={...ae??E,...Pe},Yi=$._accumulatedResources,Qt=CY(Y),Ji=wY([...Yi??D,...Qt]);await new Promise(ss=>setTimeout(ss,0));const ao=new Set(c.map(ss=>ss.id)),{templateNodes:lo,templateEdges:No}=mP(V.id,le,s,e,L,Ji,Re,ao,Qe);d(ss=>{const Hl=new Set(ss.map(bi=>bi.id)),Hf=lo.filter(bi=>!Hl.has(bi.id)),Hh=[...ss.map(bi=>bi.id===V.id?{...bi,data:{...bi.data,status:"expanded",templateCount:le.length,totalParameterCount:q.length||void 0,declaredParameterNames:q.length?q:void 0}}:bi),...Hf],Ws=[...q.length?PL(b.current,V.id,q):b.current,...No];return gP(Hh,Ws).nodes}),f(ss=>[...q.length?PL(ss,V.id,q):ss,...No]),await new Promise(ss=>setTimeout(ss,50))}}catch{}}T.current=!1,y&&d(V=>[...V])})()}},[c,s,e,L,D,o,r,w,d,f,y,l]);const N=je.useCallback(async(W,V)=>{const $=V.data;if($.status==="root"&&(t!=null&&t.yaml)){a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:t.yaml});return}if($.status==="expanded"){const K=$._ref,Z=Sp(K??{})||"",Y=`${Z}:${$.filePath}`,X=$._fallbackPath,le=X?`${Z}:${X}`:void 0,q=o.get(Y)??(le?o.get(le):void 0);if(q){a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:q,repoAlias:$.repoAlias});return}try{const{content:z}=await _P(s,e,L,$,D,o,r,l);a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:z,repoAlias:$.repoAlias})}catch{}return}if($.status==="collapsed"&&!w.has(V.id)){C(K=>new Set(K).add(V.id)),d(K=>K.map(Z=>Z.id===V.id?{...Z,data:{...Z.data,status:"loading"}}:Z));try{const{content:K,actualPath:Z}=await _P(s,e,L,$,D,o,r,l),Y=lb(K)??{},X=$._ref,le=uP(Y,{contextRepoAlias:Sp(X??{}),sourcePath:Z}),q=lP(Y),z=$._parentParamContext,J=$._accumulatedVariables,ae=X==null?void 0:X.parameters,fe=XE(ae,z,J),we={...q,...fe},Re=XG(Y),Pe=QE(Z),Qe=AL(Y),Yi={...J??E,...Qe},Qt=$._accumulatedResources,Ji=CY(Y),ao=wY([...Qt??D,...Ji]),lo=new Set(c.map(En=>En.id)),{templateNodes:No,templateEdges:ss}=mP(V.id,le,s,e,L,ao,we,lo,Yi),Hl=new Set,Hf=new Set,JC=new Map,Hh=$.templateLocation==="variables"&&Object.keys(Qe).length>0;if(Hh)for(const En of c){const Ws=En.data;if(Ws.dynamicPath&&!Ws.expressionResolved){const bi=OL(En,Qe,s,e,L,D);if(bi!==En){Hl.add(En.id);const Wr=bi.data;Wr.repoAlias&&Hf.add(En.id),JC.set(En.id,Wr.filePath)}}}d(En=>{const Ws=new Set(En.map(Br=>Br.id)),bi=No.filter(Br=>!Ws.has(Br.id)),Vh=[...En.map(Br=>Br.id===V.id?{...Br,data:{...Br.data,status:"expanded",templateCount:le.length,totalParameterCount:Re.length||void 0,declaredParameterNames:Re.length?Re:void 0}}:Hh&&Hl.has(Br.id)?OL(Br,Qe,s,e,L,D):Br),...bi],ew=[...Re.length?PL(b.current,V.id,Re):b.current,...ss];return gP(Vh,ew).nodes}),f(En=>{let Ws=Re.length?PL(En,V.id,Re):En;return Hl.size>0&&(Ws=Ws.map(bi=>{if(!Hl.has(bi.target))return bi;const Wr=bi.data;if(!(Wr!=null&&Wr.dynamicPath))return bi;const Vh=Hf.has(bi.target);return{...bi,data:{...Wr,expressionResolved:!0,isExternal:Vh||Wr.isExternal||void 0,resolvedPath:JC.get(bi.target)??Wr.resolvedPath,unresolvedExpressions:void 0},style:Vh?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:bi.style,markerEnd:Vh?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:bi.markerEnd}})),[...Ws,...ss]}),a({nodeId:V.id,label:$.label,filePath:$.filePath,yaml:K,repoAlias:$.repoAlias})}catch(K){const Z=K instanceof Error?K.message:String(K);d(Y=>Y.map(X=>X.id===V.id?{...X,data:{...X.data,status:"error",errorMessage:Z}}:X))}finally{C(K=>{const Z=new Set(K);return Z.delete(V.id),Z})}}},[s,e,L,t,D,o,r,a,w,d,f,l]),A=je.useCallback(()=>{x(W=>(W||(S.current=new Set,v.current=""),!W))},[]);return i?me.jsx("div",{className:"pipeline-tree__empty",children:me.jsxs("div",{className:"loading-indicator",children:[me.jsx("span",{className:"loading-indicator__spinner",children:"⏳"}),me.jsx("span",{children:"Loading pipeline..."})]})}):n?me.jsx("div",{className:"error",children:n}):t?me.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[me.jsxs(Tre,{nodes:c,edges:u,onInit:W=>{p.current=W},onNodesChange:h,onEdgesChange:g,onNodeClick:N,nodeTypes:_Ve,edgeTypes:bVe,defaultEdgeOptions:vVe,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[me.jsx(Rre,{variant:Mre.Dots,color:"var(--border)",gap:20}),me.jsx(Are,{})]}),me.jsxs("label",{className:"auto-expand-toggle",children:[me.jsx("input",{type:"checkbox",checked:y,onChange:A}),me.jsx("span",{children:"Auto-expand all"})]})]}):me.jsx("div",{className:"pipeline-tree__empty",children:"Select a pipeline to visualize"})}function PL(s,e,t){return s.map(i=>{if(i.target!==e)return i;const n=i.data??{};return{...i,data:{...n,totalParameterCount:t.length,declaredParameterNames:t}}})}function XE(s,e,t){if(!s||!e&&!t)return s;const i={};for(const[n,o]of Object.entries(s))if(typeof o=="string"&&yp(o)){const{result:r,isFullyResolved:a}=goe(o,{parameters:e,variables:t});i[n]=a?wVe(r):o}else o&&typeof o=="object"&&!Array.isArray(o)?i[n]=XE(o,e,t)??o:i[n]=o;return i}function wVe(s){if(s==="True"||s==="true")return!0;if(s==="False"||s==="false")return!1;if(s==="null")return null;if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return JSON.parse(s)}catch{}return s}function CY(s){const e=s.resources;if(!e)return[];const t=e.repositories;return Array.isArray(t)?t.filter(i=>i!=null&&typeof i=="object"&&"repository"in i&&"name"in i&&typeof i.repository=="string"&&typeof i.name=="string"):[]}function wY(s){const e=new Map;for(const t of s)e.set(t.repository,t);return Array.from(e.values())}function SVe(s,e){return`tpl::${s||"self"}::${e}`}function mP(s,e,t,i,n,o,r,a,l){const c=new Set,d=[],h=[];for(let u=0;u<e.length;u++){const f=e[u];let g=f.normalizedPath,p=!1,_=!0,v,b;if(yp(f.normalizedPath)){p=!0,v=f.normalizedPath;const W=$E(f.normalizedPath,r,void 0,l);g=W.resolvedPath,_=W.isFullyResolved,b=W.unresolved.length?W.unresolved:void 0}let w=Sp(f),C=!1,S=!0;if(w&&yp(w)){C=!0;const W=$E(w,r,void 0,l);W.isFullyResolved?w=W.resolvedPath:(S=!1,b=[...b??[],...W.unresolved])}const y=p||C,x=_&&S,{primary:L,fallback:D}=doe({...f,normalizedPath:g,repoAlias:f.repoAlias,sourcePath:f.sourcePath}),E=SVe(w,L);if(c.has(E))continue;c.add(E);const T=a==null?void 0:a.has(E);let N;if(f.conditional&&f.conditionExpression)try{const W=foe(f.conditionExpression,{parameters:r,variables:l});typeof W=="boolean"?N=W:W===void 0||W===f.conditionExpression?N="unknown":N=!!W}catch{N="unknown"}else f.conditional&&(N="unknown");if(N===!1)continue;if(!T){const W=g.length>40?`...${g.slice(-37)}`:g,{repoInfo:V,adoUrl:$}=lre(f,w,L,t,i,n,o),K=XE(f.parameters,r,l),Z=w!==Sp(f)||K!==f.parameters?{...f,repoAlias:w||f.repoAlias,contextRepoAlias:w||f.contextRepoAlias,parameters:K}:f;d.push({id:E,type:"fileNode",position:{x:0,y:0},data:{label:W,filePath:L,repoAlias:w,templateCount:0,status:"collapsed",isRoot:!1,baseDir:QE(L),adoUrl:$,repoInfo:V,templateLocation:f.location,dynamicPath:y||void 0,expressionResolved:y?x:void 0,_ref:Z,_fallbackPath:D,_parentParamContext:r,_accumulatedResources:o,_accumulatedVariables:l,_conditionResult:N}})}const A=f.location==="extends"?"extends":f.location==="extends-parameters"?"extends param":f.location,O=!!w,F=f.parameters?Object.keys(f.parameters):void 0;h.push({id:`${s}->${E}`,source:s,target:E,type:"templateEdge",data:{edgeLabel:A,parameterNames:F,isExternal:O||void 0,conditional:f.conditional||void 0,conditionExpression:f.conditionExpression,conditionResult:N,dynamicPath:y||void 0,expressionResolved:y?x:void 0,originalPath:v||(C?f.rawPath:void 0),resolvedPath:y?L:void 0,unresolvedExpressions:b},style:O?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:void 0,markerEnd:O?{type:yk.ArrowClosed,color:"var(--badge-resources)"}:void 0})}return{templateNodes:d,templateEdges:h}}async function _P(s,e,t,i,n,o,r,a){const l=i._ref;if(!l)throw new Error("No template reference on this node");const c=i.filePath,d=i._fallbackPath,h=Sp(l),u=`${h||""}:${c}`,f=o.get(u);if(f)return{content:f,actualPath:c};if(d){const S=`${h||""}:${d}`,y=o.get(S);if(y)return{content:y,actualPath:d}}const p=i._accumulatedResources??n;let _=e,v=t,b;if(h&&p.length){const S=loe(h,p);S?(_=S.project||e,v=S.repoName,b=S.ref):v=h}else h&&(v=h);let w,C=c;try{w=await a(s,_,v,c,b)}catch(S){if(d)w=await a(s,_,v,d,b),C=d;else throw S}return r(`${h||""}:${C}`,w.content),{content:w.content,actualPath:C}}function QE(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t>0?e.slice(0,t):""}function lre(s,e,t,i,n,o,r){let a=n,l=o,c,d;if(e&&r.length){const u=loe(e,r),f=r.find(g=>g.repository===e);u?(a=u.project||n,l=u.repoName,c=u.ref):l=e,f&&(d={alias:e,fullName:f.name,type:f.type,ref:f.ref,project:u==null?void 0:u.project})}else e&&(l=e);const h=i&&a&&l?uoe({org:i,project:a,repoName:l,filePath:t,ref:c}):void 0;return{repoInfo:d,adoUrl:h}}function OL(s,e,t,i,n,o){const r=s.data,l={...r._accumulatedVariables??{},...e},c=r._ref;if(!c)return s;const d=r._parentParamContext;let h=c.normalizedPath,u=!1,f=!0,g=Sp(c);if(yp(c.normalizedPath)){u=!0;const S=$E(c.normalizedPath,d,void 0,l);if(h=S.resolvedPath,f=S.isFullyResolved,f&&!yp(h)){const y=coe(h);h=y.normalizedPath,y.repoAlias&&(g=y.repoAlias)}}if(g&&yp(g)){u=!0;const S=$E(g,d,void 0,l);S.isFullyResolved?g=S.resolvedPath:f=!1}const p={...c,normalizedPath:h,repoAlias:g||c.repoAlias,contextRepoAlias:g||c.contextRepoAlias},{primary:_,fallback:v}=doe({...p,normalizedPath:h,repoAlias:p.repoAlias,sourcePath:c.sourcePath}),b=h.length>40?`...${h.slice(-37)}`:h,{repoInfo:w,adoUrl:C}=t&&i&&n&&o?lre(p,g,_,t,i,n,o):{repoInfo:void 0,adoUrl:void 0};return{...s,data:{...s.data,label:b,filePath:_,repoAlias:g,baseDir:QE(_),dynamicPath:u||void 0,expressionResolved:u?f:void 0,adoUrl:C||s.data.adoUrl,repoInfo:w||s.data.repoInfo,_ref:p,_accumulatedVariables:l,_fallbackPath:v}}}const cre="7.1";function dre(s,e){return`https://dev.azure.com/${encodeURIComponent(s)}/${encodeURIComponent(e)}/_apis`}function yVe(s){return s.startsWith("refs/heads/")?{version:s.slice(11),versionType:"branch"}:s.startsWith("refs/tags/")?{version:s.slice(10),versionType:"tag"}:/^[0-9a-f]{40}$/i.test(s)?{version:s,versionType:"commit"}:{version:s,versionType:"branch"}}async function hre(s){const e=await fetch(s,{credentials:"include"});if(!e.ok){const t=await e.text();throw new Error(`ADO API error (${e.status}): ${t}`)}return e}async function ure(s,e,t,i,n){const o=i.startsWith("/")?i:`/${i}`,r=hoe(o);let a=`${dre(s,e)}/git/repositories/${encodeURIComponent(t)}/items?path=${encodeURIComponent(r)}&api-version=${cre}&includeContent=true&$format=text`;if(n){const c=yVe(n);a+=`&versionDescriptor.version=${encodeURIComponent(c.version)}&versionDescriptor.versionType=${c.versionType}`}return(await hre(a)).text()}async function xVe(s,e,t){var l,c,d,h,u;const i=`${dre(s,e)}/build/definitions/${t}?api-version=${cre}`,o=await(await hre(i)).json(),r={id:o.id,name:o.name,path:((l=o.process)==null?void 0:l.yamlFilename)??o.path,repository:{id:(c=o.repository)==null?void 0:c.id,name:(d=o.repository)==null?void 0:d.name,type:(h=o.repository)==null?void 0:h.type,defaultBranch:(u=o.repository)==null?void 0:u.defaultBranch}},a=await ure(s,e,r.repository.id,r.path,r.repository.defaultBranch);return{definition:r,yaml:a}}async function LVe(s,e,t,i,n){return{content:await ure(s,e,t,i,n),path:i,repoId:t,repoName:t,branch:n||""}}async function kVe(){return{customTaskDocs:{}}}async function IVe(s){return{tasks:[],cached:!1}}const DVe="/api";var kY;const L2=typeof window<"u"&&((kY=window.location)==null?void 0:kY.protocol)==="chrome-extension:";async function k2(s){const e=await fetch(`${DVe}${s}`);if(!e.ok){const t=await e.text();throw new Error(`API error (${e.status}): ${t}`)}return e.json()}function EVe(s,e,t){return L2?xVe(s,e,t):k2(`/${s}/${e}/pipelines/${t}/yaml`)}function fre(s,e,t,i,n){if(L2)return LVe(s,e,t,i,n);const o=new URLSearchParams({repo:t,path:i});return n&&o.set("branch",n),k2(`/${s}/${e}/file-by-repo-name?${o}`)}function NVe(){return L2?kVe():k2("/config/task-docs")}function TVe(s){return L2?IVe():k2(`/${s}/schema/tasks`)}function RVe(s){const{setConnection:e,setSelectedPipeline:t,setSelectedPipelineLoading:i,setSelectedPipelineError:n}=x2(),[o,r]=je.useState(""),[a,l]=je.useState(null),[c,d]=je.useState(!1),h=je.useRef(!1);je.useEffect(()=>{if(h.current)return;h.current=!0;const _=new URLSearchParams(window.location.search),v=s.fileUrl||_.get("url"),b=s.org||_.get("org"),w=s.project||_.get("project"),C=s.repo||_.get("repo"),S=s.path||_.get("path"),y=s.branch||_.get("branch")||void 0,x=s.pipelineId??(_.get("pipelineId")?Number(_.get("pipelineId")):null);if(v)r(v),u(v);else if(b&&w&&C&&S){const L=`https://dev.azure.com/${b}/${w}/_git/${C}?path=${S}${y?`&version=GB${y}`:""}`;r(L),u(L)}else b&&w&&x!=null&&f(b,w,x)},[]);const u=async _=>{const v=ZBe(_);if(!v){l("Invalid Azure DevOps URL");return}e(v.org,v.project),i(!0),n(null),d(!0);try{const b=await fre(v.org,v.project,v.repoName,v.filePath,v.branch);t({definition:{id:0,name:v.filePath.split("/").pop()||v.filePath,path:v.filePath,repository:{id:b.repoId,name:b.repoName,type:"git",defaultBranch:b.branch||""}},yaml:b.content})}catch(b){n(b instanceof Error?b.message:String(b))}finally{i(!1),d(!1)}},f=async(_,v,b)=>{e(_,v),i(!0),n(null);try{const w=await EVe(_,v,b);t(w)}catch(w){n(w instanceof Error?w.message:String(w))}finally{i(!1)}},g=async()=>{o.trim()&&(l(null),await u(o.trim()))},p=_=>{_.key==="Enter"&&(_.preventDefault(),g())};return me.jsxs("div",{className:"pipeline-url-bar",children:[me.jsx("input",{type:"text",className:"pipeline-url-bar__input",placeholder:"https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",value:o,onChange:_=>r(_.target.value),onKeyDown:p}),me.jsx("button",{className:"pipeline-url-bar__btn",onClick:g,disabled:!o.trim()||c,children:c?"⏳ Loading...":"Load"}),a&&me.jsx("div",{className:"pipeline-url-bar__error",children:a})]})}const MVe=280,AVe=900,PVe=420;function OVe(s){const{setCustomTaskDocs:e,setTaskSchema:t,selectedNodeDetail:i,org:n}=x2(),[o,r]=je.useState(PVe),a=je.useRef(!1);je.useEffect(()=>{NVe().then(c=>e(c.customTaskDocs)).catch(()=>{})},[e]),je.useEffect(()=>{n&&TVe(n).then(c=>t(c.tasks)).catch(()=>{})},[n,t]);const l=je.useCallback(c=>{c.preventDefault(),a.current=!0;const d=c.clientX,h=o;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const u=g=>{const p=d-g.clientX,_=Math.min(AVe,Math.max(MVe,h+p));r(_)},f=()=>{a.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",f)};window.addEventListener("mousemove",u),window.addEventListener("mouseup",f)},[o]);return me.jsx(FHe,{value:fre,children:me.jsxs("div",{className:"app",children:[me.jsxs("header",{className:"app__header",children:[me.jsx("h1",{children:"🔧 Azure Pipelines Visualizer"}),me.jsx(fP,{children:me.jsx(RVe,{...s})})]}),me.jsxs("main",{className:"app__main",children:[me.jsx("section",{className:"app__content",children:me.jsx(fP,{children:me.jsx(CVe,{})})}),i&&me.jsxs(me.Fragment,{children:[me.jsx("div",{className:"app__detail-resize-handle",onMouseDown:l,title:"Drag to resize"}),me.jsx("aside",{className:"app__detail",style:{width:o},children:me.jsx(fP,{children:me.jsx(PHe,{})})})]})]})]})})}NW.createRoot(document.getElementById("root")).render(me.jsx(Au.StrictMode,{children:me.jsx(OVe,{})}));export{kb as l};
|