import{c as e,l as t}from"./editor.main-f3Fao0jc.js";import{C as s,H as r,D as i,a as n,R as o,b as a,c as h,d as g,F as l,e as u,S as d,f as c,g as m}from"./lspLanguageFeatures-DNFhCTG-.js";import{h as p,i as _,j as w,t as f,k}from"./lspLanguageFeatures-DNFhCTG-.js";import"./index-GOw94_lK.js";class v{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>12e4&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=e({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL(""+new URL("css.worker-CqmadvsI.js",import.meta.url).href,import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}}function I(e){const p=[],_=[],w=new v(e);p.push(w);const f=(...e)=>w.getLanguageServiceWorker(...e);return function(){const{languageId:p,modeConfiguration:w}=e;R(_),w.completionItems&&_.push(t.registerCompletionItemProvider(p,new s(f,["/","-",":"]))),w.hovers&&_.push(t.registerHoverProvider(p,new r(f))),w.documentHighlights&&_.push(t.registerDocumentHighlightProvider(p,new i(f))),w.definitions&&_.push(t.registerDefinitionProvider(p,new n(f))),w.references&&_.push(t.registerReferenceProvider(p,new o(f))),w.documentSymbols&&_.push(t.registerDocumentSymbolProvider(p,new a(f))),w.rename&&_.push(t.registerRenameProvider(p,new h(f))),w.colors&&_.push(t.registerColorProvider(p,new g(f))),w.foldingRanges&&_.push(t.registerFoldingRangeProvider(p,new l(f))),w.diagnostics&&_.push(new u(p,f,e.onDidChange)),w.selectionRanges&&_.push(t.registerSelectionRangeProvider(p,new d(f))),w.documentFormattingEdits&&_.push(t.registerDocumentFormattingEditProvider(p,new c(f))),w.documentRangeFormattingEdits&&_.push(t.registerDocumentRangeFormattingEditProvider(p,new m(f)))}(),p.push(P(_)),P(p)}function P(e){return{dispose:()=>R(e)}}function R(e){for(;e.length;)e.pop().dispose()}export{s as CompletionAdapter,n as DefinitionAdapter,u as DiagnosticsAdapter,g as DocumentColorAdapter,c as DocumentFormattingEditProvider,i as DocumentHighlightAdapter,p as DocumentLinkAdapter,m as DocumentRangeFormattingEditProvider,a as DocumentSymbolAdapter,l as FoldingRangeAdapter,r as HoverAdapter,o as ReferenceAdapter,h as RenameAdapter,d as SelectionRangeAdapter,v as WorkerManager,_ as fromPosition,w as fromRange,I as setupMode,f as toRange,k as toTextEdit};
