admins-components 5.0.20 → 5.0.21

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.
@@ -488,4 +488,4 @@ Project '${d.projectName}' (${jI[d.projectKind]}) ${o}
488
488
  `,o++};this.projectService.externalProjects.forEach(c),this.projectService.configuredProjects.forEach(c),this.projectService.inferredProjects.forEach(c)}}this.logger.msg(a,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${bT(t)}`);return}this.writeMessage(t)}writeMessage(t){const n=kye(t,this.logger,this.byteLength,this.host.newLine);this.host.write(n)}event(t,n){this.send(Cye(n,t))}doOutput(t,n,i,a,o,c){const d={seq:0,type:"response",command:n,request_seq:i,success:a,performanceData:o&&IMe(o)};if(a){let p;if(qa(t))d.body=t,p=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){const{metadata:y,...b}=t;d.body=b,p=y}else d.body=t;else d.body=t;p&&(d.metadata=p)}else F.assert(t===void 0);c&&(d.message=c),this.send(d)}semanticCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"semanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});const c=SMe(n,t)?of:n.getLanguageService().getSemanticDiagnostics(t).filter(d=>!!d.file);this.sendDiagnosticsEvent(t,n,c,"semanticDiag",o),(a=Hn)==null||a.pop()}syntacticCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"syntacticCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag",o),(a=Hn)==null||a.pop()}suggestionCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"suggestionCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag",o),(a=Hn)==null||a.pop()}regionSemanticCheck(t,n,i){var a,o,c;const d=Rc();(a=Hn)==null||a.push(Hn.Phase.Session,"regionSemanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});let p;if(!this.shouldDoRegionCheck(t)||!(p=n.getLanguageService().getRegionSemanticDiagnostics(t,i))){(o=Hn)==null||o.pop();return}this.sendDiagnosticsEvent(t,n,p.diagnostics,"regionSemanticDiag",d,p.spans),(c=Hn)==null||c.pop()}shouldDoRegionCheck(t){var n;const i=(n=this.projectService.getScriptInfoForNormalizedPath(t))==null?void 0:n.textStorage.getLineInfo().getLineCount();return!!(i&&i>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(t,n,i,a,o,c){try{const d=F.checkDefined(n.getScriptInfo(t)),p=Rc()-o,y={file:t,diagnostics:i.map(b=>TMe(t,n,b)),spans:c==null?void 0:c.map(b=>M0(b,d))};this.event(y,a),this.addDiagnosticsPerformanceData(t,a,p)}catch(d){this.logError(d,a)}}updateErrorCheck(t,n,i,a=!0){if(n.length===0)return;F.assert(!this.suppressDiagnosticEvents);const o=this.changeSeq,c=Math.min(i,200);let d=0;const p=()=>{if(d++,n.length>d)return t.delay("checkOne",c,b)},y=(S,E)=>{if(this.semanticCheck(S,E),this.changeSeq===o){if(this.getPreferences(S).disableSuggestions)return p();t.immediate("suggestionCheck",()=>{this.suggestionCheck(S,E),p()})}},b=()=>{if(this.changeSeq!==o)return;let S,E=n[d];if(ba(E)?E=this.toPendingErrorCheck(E):"ranges"in E&&(S=E.ranges,E=this.toPendingErrorCheck(E.file)),!E)return p();const{fileName:D,project:O}=E;if(jg(O),!!O.containsFile(D,a)&&(this.syntacticCheck(D,O),this.changeSeq===o)){if(O.projectService.serverMode!==0)return p();if(S)return t.immediate("regionSemanticCheck",()=>{const M=this.projectService.getScriptInfoForNormalizedPath(D);M&&this.regionSemanticCheck(D,O,S.map(L=>this.getRange({file:D,...L},M))),this.changeSeq===o&&t.immediate("semanticCheck",()=>y(D,O))});t.immediate("semanticCheck",()=>y(D,O))}};n.length>d&&this.changeSeq===o&&t.delay("checkOne",i,b)}cleanProjects(t,n){if(n){this.logger.info(`cleaning ${t}`);for(const i of n)i.getLanguageService(!1).cleanupSemanticCache(),i.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",ma(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t);return i.getEncodedSyntacticClassifications(n,t)}getEncodedSemanticClassifications(t){const{file:n,project:i}=this.getFileAndProject(t),a=t.format==="2020"?"2020":"original";return i.getLanguageService().getEncodedSemanticClassifications(n,t,a)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){const n=this.getProject(t.projectFileName),i=Ac(t.file);return{configFile:n&&n.hasConfigFile(i)?i:void 0,project:n}}getConfigFileDiagnostics(t,n,i){const a=n.getAllProjectErrors(),o=n.getLanguageService().getCompilerOptionsDiagnostics(),c=sr(bn(a,o),d=>!!d.file&&d.file.fileName===t);return i?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):Dt(c,d=>i9(d,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(n=>({message:N0(n.messageText,this.host.newLine),start:n.start,length:n.length,category:dC(n),code:n.code,source:n.source,startLocation:n.file&&X4(ro(n.file,n.start)),endLocation:n.file&&X4(ro(n.file,n.start+n.length)),reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated,relatedInformation:Dt(n.relatedInformation,Tee)}))}getCompilerOptionsDiagnostics(t){const n=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(sr(n.getLanguageService().getCompilerOptionsDiagnostics(),i=>!i.file),void 0)}convertToDiagnosticsWithLinePosition(t,n){return t.map(i=>({message:N0(i.messageText,this.host.newLine),start:i.start,length:i.length,category:dC(i),code:i.code,source:i.source,startLocation:n&&n.positionToLineOffset(i.start),endLocation:n&&n.positionToLineOffset(i.start+i.length),reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated,relatedInformation:Dt(i.relatedInformation,Tee)}))}getDiagnosticsWorker(t,n,i,a){const{project:o,file:c}=this.getFileAndProject(t);if(n&&SMe(o,c))return of;const d=o.getScriptInfoForNormalizedPath(c),p=i(o,c);return a?this.convertToDiagnosticsWithLinePosition(p,d):p.map(y=>TMe(c,o,y))}getDefinition(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(a.getLanguageService().getDefinitionAtPosition(i,o)||of,a);return n?this.mapDefinitionInfo(c,a):c.map(une.mapToOriginalLocation)}mapDefinitionInfoLocations(t,n){return t.map(i=>{const a=AMe(i,n);return a?{...a,containerKind:i.containerKind,containerName:i.containerName,kind:i.kind,name:i.name,failedAliasResolution:i.failedAliasResolution,...i.unverified&&{unverified:i.unverified}}:i})}getDefinitionAndBoundSpan(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=F.checkDefined(a.getScriptInfo(i)),d=a.getLanguageService().getDefinitionAndBoundSpan(i,o);if(!d||!d.definitions)return{definitions:of,textSpan:void 0};const p=this.mapDefinitionInfoLocations(d.definitions,a),{textSpan:y}=d;return n?{definitions:this.mapDefinitionInfo(p,a),textSpan:M0(y,c)}:{definitions:p.map(une.mapToOriginalLocation),textSpan:y}}findSourceDefinition(t){var n;const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDefinitionAtPosition(i,o);let d=this.mapDefinitionInfoLocations(c||of,a).slice();if(this.projectService.serverMode===0&&(!ft(d,D=>Ac(D.fileName)!==i&&!D.isAmbient)||ft(d,D=>!!D.failedAliasResolution))){const D=Kd(J=>J.textSpan.start,FQ(this.host.useCaseSensitiveFileNames));d==null||d.forEach(J=>D.add(J));const O=a.getNoDtsResolutionProject(i),M=O.getLanguageService(),L=(n=M.getDefinitionAtPosition(i,o,!0,!1))==null?void 0:n.filter(J=>Ac(J.fileName)!==i);if(ft(L))for(const J of L){if(J.unverified){const q=S(J,a.getLanguageService().getProgram(),M.getProgram());if(ft(q)){for(const z of q)D.add(z);continue}}D.add(J)}else{const J=d.filter(q=>Ac(q.fileName)!==i&&q.isAmbient);for(const q of ft(J)?J:b()){const z=y(q.fileName,i,O);if(!z)continue;const G=this.projectService.getOrCreateScriptInfoNotOpenedByClient(z,O.currentDirectory,O.directoryStructureHost,!1);if(!G)continue;O.containsScriptInfo(G)||(O.addRoot(G),O.updateGraph());const ee=M.getProgram(),ne=F.checkDefined(ee.getSourceFile(z));for(const oe of E(q.name,ne,ee))D.add(oe)}}d=ma(D.values())}return d=d.filter(D=>!D.isAmbient&&!D.failedAliasResolution),this.mapDefinitionInfo(d,a);function y(D,O,M){var L,J,q;const z=gj(D);if(z&&D.lastIndexOf(fy)===z.topLevelNodeModulesIndex){const G=D.substring(0,z.packageRootIndex),ee=(L=a.getModuleResolutionCache())==null?void 0:L.getPackageJsonInfoCache(),ne=a.getCompilationSettings(),oe=VN(ns(G,a.getCurrentDirectory()),qN(ee,a,ne));if(!oe)return;const re=tY(oe,{moduleResolution:2},a,a.getModuleResolutionCache()),Ee=D.substring(z.topLevelPackageNameIndex+1,z.packageRootIndex),pe=WN(wF(Ee)),K=a.toPath(D);if(re&&ft(re,ve=>a.toPath(ve)===K))return(J=M.resolutionCache.resolveSingleModuleNameWithoutWatching(pe,O).resolvedModule)==null?void 0:J.resolvedFileName;{const ve=D.substring(z.packageRootIndex+1),ge=`${pe}/${gp(ve)}`;return(q=M.resolutionCache.resolveSingleModuleNameWithoutWatching(ge,O).resolvedModule)==null?void 0:q.resolvedFileName}}}function b(){const D=a.getLanguageService(),O=D.getProgram(),M=qp(O.getSourceFile(i),o);return(ic(M)||Ze(M))&&Yc(M.parent)&&wce(M,L=>{var J;if(L===M)return;const q=(J=D.getDefinitionAtPosition(i,L.getStart(),!0,!1))==null?void 0:J.filter(z=>Ac(z.fileName)!==i&&z.isAmbient).map(z=>({fileName:z.fileName,name:Xm(M)}));if(ft(q))return q})||of}function S(D,O,M){var L;const J=M.getSourceFile(D.fileName);if(!J)return;const q=qp(O.getSourceFile(i),o),z=O.getTypeChecker().getSymbolAtLocation(q),G=z&&_l(z,276);if(!G)return;const ee=((L=G.propertyName)==null?void 0:L.text)||G.name.text;return E(ee,J,M)}function E(D,O,M){const L=Qc.Core.getTopMostDeclarationNamesInFile(D,O);return Or(L,J=>{const q=M.getTypeChecker().getSymbolAtLocation(J),z=q3(J);if(q&&z)return V4.createDefinitionInfo(z,M.getTypeChecker(),q,z,!0)})}}getEmitOutput(t){const{file:n,project:i}=this.getFileAndProject(t);if(!i.shouldEmitFile(i.getScriptInfo(n)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};const a=i.getLanguageService().getEmitOutput(n);return t.richResponse?{...a,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(a.diagnostics):a.diagnostics.map(o=>i9(o,!0))}:a}mapJSDocTagInfo(t,n,i){return t?t.map(a=>{var o;return{...a,text:i?this.mapDisplayParts(a.text,n):(o=a.text)==null?void 0:o.map(c=>c.text).join("")}}):[]}mapDisplayParts(t,n){return t?t.map(i=>i.kind!=="linkName"?i:{...i,target:this.toFileSpan(i.target.fileName,i.target.textSpan,n)}):[]}mapSignatureHelpItems(t,n,i){return t.map(a=>({...a,documentation:this.mapDisplayParts(a.documentation,n),parameters:a.parameters.map(o=>({...o,documentation:this.mapDisplayParts(o.documentation,n)})),tags:this.mapJSDocTagInfo(a.tags,n,i)}))}mapDefinitionInfo(t,n){return t.map(i=>({...this.toFileSpanWithContext(i.fileName,i.textSpan,i.contextSpan,n),...i.unverified&&{unverified:i.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(F.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,n,i){const a=i.getLanguageService(),o=a.toLineColumnOffset(t,n.start),c=a.toLineColumnOffset(t,Il(n));return{file:t,start:{line:o.line+1,offset:o.character+1},end:{line:c.line+1,offset:c.character+1}}}toFileSpanWithContext(t,n,i,a){const o=this.toFileSpan(t,n,a),c=i&&this.toFileSpan(t,i,a);return c?{...o,contextStart:c.start,contextEnd:c.end}:o}getTypeDefinition(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(n,a)||of,i);return this.mapDefinitionInfo(o,i)}mapImplementationLocations(t,n){return t.map(i=>{const a=AMe(i,n);return a?{...a,kind:i.kind,displayParts:i.displayParts}:i})}getImplementation(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapImplementationLocations(a.getLanguageService().getImplementationAtPosition(i,o)||of,a);return n?c.map(({fileName:d,textSpan:p,contextSpan:y})=>this.toFileSpanWithContext(d,p,y,a)):c.map(une.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!1,(i,a)=>i.getLanguageService().getSyntacticDiagnostics(a),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){const{configFile:n,project:i}=this.getConfigFileAndProject(t);return n?this.getConfigFileDiagnostics(n,i,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(a,o)=>a.getLanguageService().getSemanticDiagnostics(o).filter(c=>!!c.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!0,(i,a)=>i.getLanguageService().getSuggestionDiagnostics(a),!!t.includeLinePosition)}getJsxClosingTag(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getJsxClosingTagAtPosition(n,a);return o===void 0?void 0:{newText:o.newText,caretOffset:0}}getLinkedEditingRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getLinkedEditingRangeAtPosition(n,a),c=this.projectService.getScriptInfoForNormalizedPath(n);if(!(c===void 0||o===void 0))return vvt(o,c)}getDocumentHighlights(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDocumentHighlights(i,o,t.filesToSearch);return c?n?c.map(({fileName:d,highlightSpans:p})=>{const y=a.getScriptInfo(d);return{file:d,highlightSpans:p.map(({textSpan:b,kind:S,contextSpan:E})=>({...wye(b,E,y),kind:S}))}}):c:of}provideInlayHints(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);return i.getLanguageService().provideInlayHints(n,t,this.getPreferences(n)).map(c=>{const{position:d,displayParts:p}=c;return{...c,position:a.positionToLineOffset(d),displayParts:p==null?void 0:p.map(({text:y,span:b,file:S})=>{if(b){F.assertIsDefined(S,"Target file should be defined together with its span.");const E=this.projectService.getScriptInfo(S);return{text:y,span:{start:E.positionToLineOffset(b.start),end:E.positionToLineOffset(b.start+b.length),file:S}}}else return{text:y}})}})}mapCode(t){var n;const i=this.getHostFormatOptions(),a=this.getHostPreferences(),{file:o,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),d=this.projectService.getScriptInfoForNormalizedPath(o),p=(n=t.mapping.focusLocations)==null?void 0:n.map(b=>b.map(S=>{const E=d.lineOffsetToPosition(S.start.line,S.start.offset),D=d.lineOffsetToPosition(S.end.line,S.end.offset);return{start:E,length:D-E}})),y=c.mapCode(o,t.mapping.contents,p,i,a);return this.mapTextChangesToCodeEdits(y)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,t.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(t,n,i,a,o){const{project:c}=this.getFileAndProjectWorker(t,n);return jg(c),{configFileName:c.getProjectName(),languageServiceDisabled:!c.languageServiceEnabled,fileNames:i?c.getFileNames(!1,o):void 0,configuredProjectInfo:a?this.getDefaultConfiguredProjectInfo(t):void 0}}getDefaultConfiguredProjectInfo(t){var n;const i=this.projectService.getScriptInfo(t);if(!i)return;const a=this.projectService.findDefaultConfiguredProjectWorker(i,3);if(!a)return;let o,c;return a.seenProjects.forEach((d,p)=>{p!==a.defaultProject&&(d!==3?(o??(o=[])).push(Ac(p.getConfigFilePath())):(c??(c=[])).push(Ac(p.getConfigFilePath())))}),(n=a.seenConfigs)==null||n.forEach(d=>(o??(o=[])).push(d)),{notMatchedByConfig:o,notInProject:c,defaultProject:a.defaultProject&&Ac(a.defaultProject.getConfigFilePath())}}getRenameInfo(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.getPreferences(n);return i.getLanguageService().getRenameInfo(n,a,o)}getProjects(t,n,i){let a,o;if(t.projectFileName){const c=this.getProject(t.projectFileName);c&&(a=[c])}else{const c=n?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(c)n||this.projectService.ensureDefaultProjectForFile(c);else return i?of:(this.projectService.logErrorForScriptInfoNotFound(t.file),f1.ThrowNoProject());a=c.containingProjects,o=this.projectService.getSymlinkedProjects(c)}return a=sr(a,c=>c.languageServiceEnabled&&!c.isOrphan()),!i&&(!a||!a.length)&&!o?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),f1.ThrowNoProject()):o?{projects:a,symLinkedProjects:o}:a}getDefaultProject(t){if(t.projectFileName){const i=this.getProject(t.projectFileName);if(i)return i;if(!t.file)return f1.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,n){const i=Ac(t.file),a=this.getPositionInFile(t,i),o=this.getProjects(t),c=this.getDefaultProject(t),d=this.getPreferences(i),p=this.mapRenameInfo(c.getLanguageService().getRenameInfo(i,a,d),F.checkDefined(this.projectService.getScriptInfo(i)));if(!p.canRename)return n?{info:p,locs:[]}:[];const y=_vt(o,c,{fileName:t.file,pos:a},!!t.findInStrings,!!t.findInComments,d,this.host.useCaseSensitiveFileNames);return n?{info:p,locs:this.toSpanGroups(y)}:y}mapRenameInfo(t,n){if(t.canRename){const{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:y}=t;return{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:M0(y,n)}}else return t}toSpanGroups(t){const n=new Map;for(const{fileName:i,textSpan:a,contextSpan:o,originalContextSpan:c,originalTextSpan:d,originalFileName:p,...y}of t){let b=n.get(i);b||n.set(i,b={file:i,locs:[]});const S=F.checkDefined(this.projectService.getScriptInfo(i));b.locs.push({...wye(a,o,S),...y})}return ma(n.values())}getReferences(t,n){const i=Ac(t.file),a=this.getProjects(t),o=this.getPositionInFile(t,i),c=pvt(a,this.getDefaultProject(t),{fileName:t.file,pos:o},this.host.useCaseSensitiveFileNames,this.logger);if(!n)return c;const d=this.getPreferences(i),p=this.getDefaultProject(t),y=p.getScriptInfoForNormalizedPath(i),b=p.getLanguageService().getQuickInfoAtPosition(i,o),S=b?D5(b.displayParts):"",E=b&&b.textSpan,D=E?y.positionToLineOffset(E.start).offset:0,O=E?y.getSnapshot().getText(E.start,Il(E)):"";return{refs:pn(c,L=>L.references.map(J=>FMe(this.projectService,J,d))),symbolName:O,symbolStartOffset:D,symbolDisplayString:S}}getFileReferences(t,n){const i=this.getProjects(t),a=Ac(t.file),o=this.getPreferences(a),c={fileName:a,pos:0},d=Eye(i,this.getDefaultProject(t),c,c,EMe,b=>(this.logger.info(`Finding references to file ${a} in project ${b.getProjectName()}`),b.getLanguageService().getFileReferences(a)));let p;if(qa(d))p=d;else{p=[];const b=xee(this.host.useCaseSensitiveFileNames);d.forEach(S=>{for(const E of S)b.has(E)||(p.push(E),b.add(E))})}return n?{refs:p.map(b=>FMe(this.projectService,b,o)),symbolName:`"${t.file}"`}:p}openClientFile(t,n,i,a){this.projectService.openClientFileWithNormalizedPath(t,n,i,!1,a)}getPosition(t,n){return t.position!==void 0?t.position:n.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,n){const i=this.projectService.getScriptInfoForNormalizedPath(n);return this.getPosition(t,i)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){const{file:n,project:i}=this.getFileAndProject(t);return{file:n,languageService:i.getLanguageService(!1)}}getFileAndProjectWorker(t,n){const i=Ac(t),a=this.getProject(n)||this.projectService.ensureDefaultProjectForFile(i);return{file:i,project:a}}getOutliningSpans(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getOutliningSpans(i);if(n){const c=this.projectService.getScriptInfoForNormalizedPath(i);return o.map(d=>({textSpan:M0(d.textSpan,c),hintSpan:M0(d.hintSpan,c),bannerText:d.bannerText,autoCollapse:d.autoCollapse,kind:d.kind}))}else return o}getTodoComments(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().getTodoComments(n,t.descriptors)}getDocCommentTemplate(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getDocCommentTemplateAtPosition(n,a,this.getPreferences(n),this.getFormatOptions(n))}getSpanOfEnclosingComment(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.onlyMultiLine,o=this.getPositionInFile(t,n);return i.getSpanOfEnclosingComment(n,o,a)}getIndentation(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=t.options?Y4(t.options):this.getFormatOptions(n),c=i.getIndentationAtPosition(n,a,o);return{position:a,indentation:c}}getBreakpointStatement(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getBreakpointStatementAtPosition(n,a)}getNameOrDottedNameSpan(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getNameOrDottedNameSpan(n,a,a)}isValidBraceCompletion(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.isValidBraceCompletionAtPosition(n,a,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getQuickInfoAtPosition(i,this.getPosition(t,o));if(!c)return;const d=!!this.getPreferences(i).displayPartsForJSDoc;if(n){const p=D5(c.displayParts);return{kind:c.kind,kindModifiers:c.kindModifiers,start:o.positionToLineOffset(c.textSpan.start),end:o.positionToLineOffset(Il(c.textSpan)),displayString:p,documentation:d?this.mapDisplayParts(c.documentation,a):D5(c.documentation),tags:this.mapJSDocTagInfo(c.tags,a,d)}}else return d?c:{...c,tags:this.mapJSDocTagInfo(c.tags,a,!1)}}getFormattingEditsForRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=a.lineOffsetToPosition(t.endLine,t.endOffset),d=i.getFormattingEditsForRange(n,o,c,this.getFormatOptions(n));if(d)return d.map(p=>this.convertTextChangeToCodeEdit(p,a))}getFormattingEditsForRangeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForRange(n,t.position,t.endPosition,a)}getFormattingEditsForDocumentFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForDocument(n,a)}getFormattingEditsAfterKeystrokeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsAfterKeystroke(n,t.position,t.key,a)}getFormattingEditsAfterKeystroke(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=this.getFormatOptions(n),d=i.getFormattingEditsAfterKeystroke(n,o,t.key,c);if(t.key===`
489
489
  `&&(!d||d.length===0||lvt(d,o))){const{lineText:p,absolutePosition:y}=a.textStorage.getAbsolutePositionAndLineText(t.line);if(p&&p.search("\\S")<0){const b=i.getIndentationAtPosition(n,o,c);let S=0,E,D;for(E=0,D=p.length;E<D;E++)if(p.charAt(E)===" ")S++;else if(p.charAt(E)===" ")S+=c.tabSize;else break;if(b!==S){const O=y+E;d.push({span:su(y,O),newText:Lu.getIndentationString(b,c)})}}}if(d)return d.map(p=>({start:a.positionToLineOffset(p.span.start),end:a.positionToLineOffset(Il(p.span)),newText:p.newText?p.newText:""}))}getCompletions(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getCompletionsAtPosition(i,c,{...cye(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},a.projectService.getFormatCodeOptions(i));if(d===void 0)return;if(n==="completions-full")return d;const p=t.prefix||"",y=Or(d.entries,S=>{if(d.isMemberCompletion||Va(S.name.toLowerCase(),p.toLowerCase())){const E=S.replacementSpan?M0(S.replacementSpan,o):void 0;return{...S,replacementSpan:E,hasAction:S.hasAction||void 0,symbol:void 0}}});return n==="completions"?(d.metadata&&(y.metadata=d.metadata),y):{...d,optionalReplacementSpan:d.optionalReplacementSpan&&M0(d.optionalReplacementSpan,o),entries:y}}getCompletionEntryDetails(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.projectService.getFormatCodeOptions(i),p=!!this.getPreferences(i).displayPartsForJSDoc,y=Or(t.entryNames,b=>{const{name:S,source:E,data:D}=typeof b=="string"?{name:b,source:void 0,data:void 0}:b;return a.getLanguageService().getCompletionEntryDetails(i,c,S,d,E,this.getPreferences(i),D?Ms(D,xvt):void 0)});return n?p?y:y.map(b=>({...b,tags:this.mapJSDocTagInfo(b.tags,a,!1)})):y.map(b=>({...b,codeActions:Dt(b.codeActions,S=>this.mapCodeAction(S)),documentation:this.mapDisplayParts(b.documentation,a),tags:this.mapJSDocTagInfo(b.tags,a,p)}))}getCompileOnSaveAffectedFileList(t){const n=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?fvt(i,a=>this.projectService.getScriptInfoForPath(a),n,(a,o)=>{if(!a.compileOnSaveEnabled||!a.languageServiceEnabled||a.isOrphan())return;const c=a.getCompilationSettings();if(!(c.noEmit||sf(o.fileName)&&!cvt(c)))return{projectFileName:a.getProjectName(),fileNames:a.getCompileOnSaveAffectedFileList(o),projectUsesOutFile:!!c.outFile}}):of}emitFile(t){const{file:n,project:i}=this.getFileAndProject(t);if(i||f1.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;const a=i.getScriptInfo(n),{emitSkipped:o,diagnostics:c}=i.emitFile(a,(d,p,y)=>this.host.writeFile(d,p,y));return t.richResponse?{emitSkipped:o,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(d=>i9(d,!0))}:!o}getSignatureHelpItems(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getSignatureHelpItems(i,c,t),p=!!this.getPreferences(i).displayPartsForJSDoc;if(d&&n){const y=d.applicableSpan;return{...d,applicableSpan:{start:o.positionToLineOffset(y.start),end:o.positionToLineOffset(y.start+y.length)},items:this.mapSignatureHelpItems(d.items,a,p)}}else return p||!d?d:{...d,items:d.items.map(y=>({...y,tags:this.mapJSDocTagInfo(y.tags,a,!1)}))}}toPendingErrorCheck(t){const n=Ac(t),i=this.projectService.tryGetDefaultProjectForFile(n);return i&&{fileName:n,project:i}}getDiagnostics(t,n,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,n)}change(t){const n=this.projectService.getScriptInfo(t.file);F.assert(!!n),n.textStorage.switchToScriptVersionCache();const i=n.lineOffsetToPosition(t.line,t.offset),a=n.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(n,ri({span:{start:i,length:a-i},newText:t.insertString})))}reload(t){const n=Ac(t.file),i=t.tmpfile===void 0?void 0:Ac(t.tmpfile),a=this.projectService.getScriptInfoForNormalizedPath(n);a&&(this.changeSeq++,a.reloadFromFile(i))}saveToTmp(t,n){const i=this.projectService.getScriptInfo(t);i&&i.saveTo(n)}closeClientFile(t){if(!t)return;const n=co(t);this.projectService.closeClientFile(n)}mapLocationNavigationBarItems(t,n){return Dt(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(a=>M0(a,n)),childItems:this.mapLocationNavigationBarItems(i.childItems,n),indent:i.indent}))}getNavigationBarItems(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationBarItems(i);return o?n?this.mapLocationNavigationBarItems(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}toLocationNavigationTree(t,n){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>M0(i,n)),nameSpan:t.nameSpan&&M0(t.nameSpan,n),childItems:Dt(t.childItems,i=>this.toLocationNavigationTree(i,n))}}getNavigationTree(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationTree(i);return o?n?this.toLocationNavigationTree(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}getNavigateToItems(t,n){const i=this.getFullNavigateToItems(t);return n?pn(i,({project:a,navigateToItems:o})=>o.map(c=>{const d=a.getScriptInfo(c.fileName),p={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:d.positionToLineOffset(c.textSpan.start),end:d.positionToLineOffset(Il(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(p.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(p.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(p.containerKind=c.containerKind),p})):pn(i,({navigateToItems:a})=>a)}getFullNavigateToItems(t){const{currentFileOnly:n,searchValue:i,maxResultCount:a,projectFileName:o}=t;if(n){F.assertIsDefined(t.file);const{file:E,project:D}=this.getFileAndProject(t);return[{project:D,navigateToItems:D.getLanguageService().getNavigateToItems(i,a,E)}]}const c=this.getHostPreferences(),d=[],p=new Map;if(!t.file&&!o)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(E=>y(E));else{const E=this.getProjects(t);CMe(E,void 0,D=>y(D))}return d;function y(E){const D=E.getLanguageService().getNavigateToItems(i,a,void 0,E.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),O=sr(D,M=>b(M)&&!kee(BI(M),E));O.length&&d.push({project:E,navigateToItems:O})}function b(E){const D=E.name;if(!p.has(D))return p.set(D,[E]),!0;const O=p.get(D);for(const M of O)if(S(M,E))return!1;return O.push(E),!0}function S(E,D){return E===D?!0:!E||!D?!1:E.containerKind===D.containerKind&&E.containerName===D.containerName&&E.fileName===D.fileName&&E.isCaseSensitive===D.isCaseSensitive&&E.kind===D.kind&&E.kindModifiers===D.kindModifiers&&E.matchKind===D.matchKind&&E.name===D.name&&E.textSpan.start===D.textSpan.start&&E.textSpan.length===D.textSpan.length}}getSupportedCodeFixes(t){if(!t)return JK();if(t.file){const{file:i,project:a}=this.getFileAndProject(t);return a.getLanguageService().getSupportedCodeFixes(i)}const n=this.getProject(t.projectFileName);return n||f1.ThrowNoProject(),n.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,n){let i,a;return this.isLocation(t)?i=o(t):a=this.getRange(t,n),F.checkDefined(i===void 0?a:i);function o(c){return c.position!==void 0?c.position:n.lineOffsetToPosition(c.line,c.offset)}}getRange(t,n){const{startPosition:i,endPosition:a}=this.getStartAndEndPosition(t,n);return{pos:i,end:a}}getApplicableRefactors(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getApplicableRefactors(n,this.extractPositionOrRange(t,a),this.getPreferences(n),t.triggerReason,t.kind,t.includeInteractiveActions).map(c=>({...c,actions:c.actions.map(d=>({...d,range:d.range?{start:X4({line:d.range.start.line,character:d.range.start.offset}),end:X4({line:d.range.end.line,character:d.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,o),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(n){const{renameFilename:d,renameLocation:p,edits:y}=c;let b;if(d!==void 0&&p!==void 0){const S=a.getScriptInfoForNormalizedPath(Ac(d));b=Dye(RD(S.getSnapshot()),d,p,y)}return{renameLocation:b,renameFilename:d,edits:this.mapTextChangesToCodeEdits(y),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getMoveToRefactoringFileSuggestions(n,this.extractPositionOrRange(t,a),this.getPreferences(n))}preparePasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().preparePasteEditsForFile(n,t.copiedTextSpan.map(a=>this.getRange({file:n,startLine:a.start.line,startOffset:a.start.offset,endLine:a.end.line,endOffset:a.end.offset},this.projectService.getScriptInfoForNormalizedPath(n))))}getPasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);if(RI(n))return;const a=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(c=>this.getRange({file:t.copiedFrom.file,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(Ac(t.copiedFrom.file))))}:void 0,o=i.getLanguageService().getPasteEdits({targetFile:n,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(c=>this.getRange({file:n,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(n))),copiedFrom:a,preferences:this.getPreferences(n)},this.getFormatOptions(n));return o&&this.mapPasteEditsAction(o)}organizeImports(t,n){F.assert(t.scope.type==="file");const{file:i,project:a}=this.getFileAndProject(t.scope.args),o=a.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return n?this.mapTextChangesToCodeEdits(o):o}getEditsForFileRename(t,n){const i=Ac(t.oldFilePath),a=Ac(t.newFilePath),o=this.getHostFormatOptions(),c=this.getHostPreferences(),d=new Set,p=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(y=>{const b=y.getLanguageService().getEditsForFileRename(i,a,o,c),S=[];for(const E of b)d.has(E.fileName)||(p.push(E),S.push(E.fileName));for(const E of S)d.add(E)}),n?p.map(y=>this.mapTextChangeToCodeEdit(y)):p}getCodeFixes(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:d}=this.getStartAndEndPosition(t,o);let p;try{p=a.getLanguageService().getCodeFixesAtPosition(i,c,d,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(y){const b=a.getLanguageService(),S=[...b.getSyntacticDiagnostics(i),...b.getSemanticDiagnostics(i),...b.getSuggestionDiagnostics(i)].map(D=>h7(c,d-c,D.start,D.length)&&D.code),E=t.errorCodes.find(D=>!S.includes(D));throw E!==void 0&&(y.message=`BADCLIENT: Bad error code, ${E} not found in range ${c}..${d} (found: ${S.join(", ")}); could have caused this error:
490
490
  ${y.message}`),y}return n?p.map(y=>this.mapCodeFixAction(y)):p}getCombinedCodeFix({scope:t,fixId:n},i){F.assert(t.type==="file");const{file:a,project:o}=this.getFileAndProject(t.args),c=o.getLanguageService().getCombinedCodeFix({type:"file",fileName:a},n,this.getFormatOptions(a),this.getPreferences(a));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){const n=t.command;for(const i of Ch(n)){const{file:a,project:o}=this.getFileAndProject(i);o.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(a)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,n){let i,a;return t.startPosition!==void 0?i=t.startPosition:(i=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?a=t.endPosition:(a=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=a),{startPosition:i,endPosition:a}}mapCodeAction({description:t,changes:n,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:i}}mapCodeFixAction({fixName:t,description:n,changes:i,commands:a,fixId:o,fixAllDescription:c}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(i),commands:a,fixId:o,fixAllDescription:c}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(n=>this.mapTextChangeToCodeEdit(n))}mapTextChangeToCodeEdit(t){const n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),F.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(i=>hvt(i,n))}:bvt(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getBraceMatchingAtPosition(i,c);return d?n?d.map(p=>M0(p,o)):d:void 0}getDiagnosticsForProject(t,n,i){if(this.suppressDiagnosticEvents)return;const{fileNames:a,languageServiceDisabled:o}=this.getProjectInfoWorker(i,void 0,!0,void 0,!0);if(o)return;const c=a.filter(M=>!M.includes("lib.d.ts"));if(c.length===0)return;const d=[],p=[],y=[],b=[],S=Ac(i),E=this.projectService.ensureDefaultProjectForFile(S);for(const M of c)this.getCanonicalFileName(M)===this.getCanonicalFileName(i)?d.push(M):this.projectService.getScriptInfo(M).isScriptOpen()?p.push(M):sf(M)?b.push(M):y.push(M);const O=[...d,...p,...y,...b].map(M=>({fileName:M,project:E}));this.updateErrorCheck(t,O,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){const{locations:i}=t,{file:a,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=F.checkDefined(this.projectService.getScriptInfo(a));return Dt(i,d=>{const p=this.getPosition(d,c),y=o.getSmartSelectionRange(a,p);return n?this.mapSelectionRange(y,c):y})}toggleLineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfo(i),c=this.getRange(t,o),d=a.toggleLineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}toggleMultilineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.toggleMultilineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}commentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.commentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}uncommentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.uncommentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}mapSelectionRange(t,n){const i={textSpan:M0(t.textSpan,n)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,n)),i}getScriptInfoFromProjectService(t){const n=Ac(t),i=this.projectService.getScriptInfoForNormalizedPath(n);return i||(this.projectService.logErrorForScriptInfoNotFound(n),f1.ThrowNoProject())}toProtocolCallHierarchyItem(t){const n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:M0(t.span,n),selectionSpan:M0(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){const n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>M0(i,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>M0(i,n))}}prepareCallHierarchy(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);if(a){const o=this.getPosition(t,a),c=i.getLanguageService().prepareCallHierarchy(n,o);return c&&QQ(c,d=>this.toProtocolCallHierarchyItem(d))}}provideCallHierarchyIncomingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,a))}getCanonicalFileName(t){const n=this.host.useCaseSensitiveFileNames?t:f0(t);return co(n)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){F.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){F.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,i){const a=this.performanceData;try{return this.performanceData=i,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=a}}executeCommand(t){const n=this.handlers.get(t.command);if(n){const i=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${bT(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,i,a,o,c,d,p;this.gcTimer.scheduleCollect();let y;const b=this.performanceData;this.logger.hasLevel(2)&&(y=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${lI(this.toStringMessage(t))}`));let S,E;try{S=this.parseMessage(t),E=S.arguments&&S.arguments.file?S.arguments:void 0,(n=Hn)==null||n.instant(Hn.Phase.Session,"request",{seq:S.seq,command:S.command}),(i=Hn)==null||i.push(Hn.Phase.Session,"executeCommand",{seq:S.seq,command:S.command},!0);const{response:D,responseRequired:O,performanceData:M}=this.executeCommand(S);if((a=Hn)==null||a.pop(),this.logger.hasLevel(2)){const L=ovt(this.hrtime(y)).toFixed(4);O?this.logger.perftrc(`${S.seq}::${S.command}: elapsed time (in milliseconds) ${L}`):this.logger.perftrc(`${S.seq}::${S.command}: async elapsed time (in milliseconds) ${L}`)}(o=Hn)==null||o.instant(Hn.Phase.Session,"response",{seq:S.seq,command:S.command,success:!!D}),D?this.doOutput(D,S.command,S.seq,!0,M):O&&this.doOutput(void 0,S.command,S.seq,!1,M,"No content available.")}catch(D){if((c=Hn)==null||c.popAll(),D instanceof c3){(d=Hn)==null||d.instant(Hn.Phase.Session,"commandCanceled",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command}),this.doOutput({canceled:!0},S.command,S.seq,!0,this.performanceData);return}this.logErrorWorker(D,this.toStringMessage(t),E),(p=Hn)==null||p.instant(Hn.Phase.Session,"commandError",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command,message:D.message}),this.doOutput(void 0,S?S.command:"unknown",S?S.seq:0,!1,this.performanceData,"Error processing request. "+D.message+`
491
- `+D.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function IMe(e){const t=e.diagnosticsDuration&&ma(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function M0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function wye(e,t,n){const i=M0(e,n),a=t&&M0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function hvt(e,t){return{start:OMe(t,e.span.start),end:OMe(t,Il(e.span)),newText:e.newText}}function OMe(e,t){return bye(e)?yvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function vvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function yvt(e){return{line:e.line+1,offset:e.character+1}}function bvt(e){F.assert(e.textChanges.length===1);const t=Fs(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Dye(e,t,n,i){const a=Svt(e,t,i),{line:o,character:c}=_A(ww(a),n);return{line:o+1,offset:c+1}}function Svt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function FMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=wye(n,i,d),y=c?void 0:Tvt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Tvt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function xvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var Q4=4,Aye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Aye||{}),kvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new a9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new K4,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=a9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new iU(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new K4;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new iU(""):new K4}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Cvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return v7(Gf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Cee=class fw{constructor(){this.changes=[],this.versions=new Array(fw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%fw.maxVersions}currentVersionToIndex(){return this.currentVersion%fw.maxVersions}edit(t,n,i){this.changes.push(new Cvt(t,n,i)),(this.changes.length>fw.changeNumberThreshold||n>fw.changeLengthThreshold||i&&i.length>fw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new MMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=fw.maxVersions&&(this.minVersion=this.currentVersion-fw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Gf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return TL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new fw,i=new MMe(0,n,new a9);n.versions[n.currentVersion]=i;const a=a9.linesFromText(t);return i.index.load(a.lines),n}};Cee.changeNumberThreshold=8,Cee.changeLengthThreshold=256,Cee.maxVersions=8;var Eee=Cee,MMe=class gQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof gQe&&this.cache===t.cache)return this.version<=t.version?TL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},a9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new iU(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new K4}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new kvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<Q4)return new K4(t);const n=new Array(Math.ceil(t.length/Q4));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+Q4,t.length);n[a]=new K4(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=ww(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},K4=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<Q4&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<Q4&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/Q4),p=new Array(y);let b=0;for(let E=0;E<y;E++)p[E]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===Q4&&(b++,S=p[b]);for(let E=p.length-1;E>=0;E--)p[E].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=Q4)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},iU=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},LMe=class hQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Op(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Lve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${bT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${bT(t)}`),t.kind){case GX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case T$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case $pe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case YX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case XX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case S$:{this.projectService.updateTypingsForProject(t);break}case b$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case ZF:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${bT(t)}`),this.installer.send(t)},hQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};LMe.requestDelayMillis=100;var RMe=LMe,jMe={};T(jMe,{ActionInvalidate:()=>S$,ActionPackageInstalled:()=>T$,ActionSet:()=>b$,ActionWatchTypingLocations:()=>ZF,Arguments:()=>QX,AutoImportProviderProject:()=>nye,AuxiliaryProject:()=>tye,CharRangeSection:()=>Aye,CloseFileWatcherEvent:()=>dee,CommandNames:()=>xMe,ConfigFileDiagEvent:()=>lee,ConfiguredProject:()=>iye,ConfiguredProjectLoadKind:()=>uye,CreateDirectoryWatcherEvent:()=>pee,CreateFileWatcherEvent:()=>_ee,Errors:()=>f1,EventBeginInstallTypes:()=>YX,EventEndInstallTypes:()=>XX,EventInitializationFailed:()=>$pe,EventTypesRegistry:()=>GX,ExternalProject:()=>nee,GcTimer:()=>zve,InferredProject:()=>eye,LargeFileReferencedEvent:()=>cee,LineIndex:()=>a9,LineLeaf:()=>iU,LineNode:()=>K4,LogLevel:()=>Fve,Msg:()=>Mve,OpenFileInfoTelemetryEvent:()=>aye,Project:()=>QD,ProjectInfoTelemetryEvent:()=>fee,ProjectKind:()=>jI,ProjectLanguageServiceStateEvent:()=>uee,ProjectLoadingFinishEvent:()=>oee,ProjectLoadingStartEvent:()=>see,ProjectService:()=>yye,ProjectsUpdatedInBackgroundEvent:()=>tU,ScriptInfo:()=>Hve,ScriptVersionCache:()=>Eee,Session:()=>NMe,TextStorage:()=>Wve,ThrottledOperations:()=>Uve,TypingsInstallerAdapter:()=>RMe,allFilesAreJsOrDts:()=>Qve,allRootFilesAreJsOrDts:()=>Xve,asNormalizedPath:()=>Y9e,convertCompilerOptions:()=>rU,convertFormatOptions:()=>Y4,convertScriptKindName:()=>gee,convertTypeAcquisition:()=>oye,convertUserPreferences:()=>cye,convertWatchOptions:()=>n9,countEachFileTypes:()=>Z5,createInstallTypingsRequest:()=>Lve,createModuleSpecifierCache:()=>Tye,createNormalizedPathMap:()=>X9e,createPackageJsonCache:()=>xye,createSortedArray:()=>Jve,emptyArray:()=>of,findArgument:()=>XAe,formatDiagnosticToProtocol:()=>i9,formatMessage:()=>kye,getBaseConfigFileName:()=>ree,getDetailWatchInfo:()=>bee,getLocationInNewDocument:()=>Dye,hasArgument:()=>YAe,hasNoTypeScriptSource:()=>Kve,indent:()=>lI,isBackgroundProject:()=>t9,isConfigFile:()=>bye,isConfiguredProject:()=>Db,isDynamicFileName:()=>RI,isExternalProject:()=>e9,isInferredProject:()=>G4,isInferredProjectName:()=>Rve,isProjectDeferredClose:()=>r9,makeAutoImportProviderProjectName:()=>Bve,makeAuxiliaryProjectName:()=>$ve,makeInferredProjectName:()=>jve,maxFileSize:()=>aee,maxProgramSizeForNonTsFiles:()=>iee,normalizedPathToPath:()=>H4,nowString:()=>QAe,nullCancellationToken:()=>bMe,nullTypingsInstaller:()=>nU,protocol:()=>qve,scriptInfoIsContainedByBackgroundProject:()=>Gve,scriptInfoIsContainedByDeferredClosedProject:()=>Yve,stringifyIndented:()=>bT,toEvent:()=>Cye,toNormalizedPath:()=>Ac,tryConvertScriptKindName:()=>mee,typingsInstaller:()=>Ove,updateProjectIfDirty:()=>jg}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return u},set exports(_){u=_,l.exports&&(l.exports=_)}})})(ZSe)),ZSe.exports}enr();const tnr=oA({name:"PartnerPickerElement",setup(l,u){const{value:_}=u.element,g=w.ref(""),T=w.ref("");w.watch(_,W=>{W&&I(W)},{deep:!0});const A=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,Z,R)=>{g.value=Z,T.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:T,value:_,fetchData:I,onFetchData:A,gotData:$}}}),rnr={class:"d-flex flex-column flex-md-row gap-2"},nnr={class:"d-flex flex-row gap-2 w-100"},inr=["src"],anr={class:"w-100"},snr=["value"],onr={class:"w-100"},cnr=["value"];function lnr(l,u,_,g,T,A){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({element:w.withCtx(()=>[w.createElementVNode("div",rnr,[w.createElementVNode("div",nnr,[w.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,inr),w.createElementVNode("div",anr,[w.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,snr)])]),w.createElementVNode("div",onr,[w.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:u[0]||(u[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,cnr)])])]),_:2},[w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const unr=sC(tnr,[["render",lnr]]);exports.gisConfig=void 0;const fnr=l=>(exports.gisConfig=l,exports.gisConfig),_nr=oA({name:"GalleryImageSelectorElement",setup(l,u){const{value:_}=u.element,g=w.ref([]),T=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,Z=>{g.value=Z.items||[],$()})};w.watch(()=>_.value,(W,Z)=>{!W||(W==null?void 0:W.galleryId)===(Z==null?void 0:Z.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const A=W=>{_.value.activeImageIndex=W.target.value,$()},I=w.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const Z=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=Z;return}I.value=null};return{onGalleryIdChanged:T,onActiveIndexChanged:A,imageUrl:I,value:_}}}),pnr={key:0},dnr=["src"],mnr={key:1},gnr=["value"],hnr=["value"];function vnr(l,u,_,g,T,A){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({_:2},[l.value?{name:"element",fn:w.withCtx(()=>[l.imageUrl?(w.openBlock(),w.createElementBlock("div",pnr,[w.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,dnr)])):w.createCommentVNode("",!0),l.imageUrl?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",mnr,[...u[2]||(u[2]=[w.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),w.createElementVNode("div",null,[u[3]||(u[3]=w.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),w.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:u[0]||(u[0]=$=>l.onGalleryIdChanged($))},null,40,gnr)]),w.createElementVNode("div",null,[u[4]||(u[4]=w.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),w.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:u[1]||(u[1]=$=>l.onActiveIndexChanged($))},null,40,hnr)])]),key:"0"}:void 0,w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const ynr=sC(_nr,[["render",vnr]]);function bnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}function Snr(l,u,_,g){Tnr(u,_).then(T=>{l.use(z6t,{config:{url:T.url,realm:T.realm,clientId:g},init:{onLoad:"login-required",checkLoginIframe:!!T.silentSsoCheckUrl,silentCheckSsoRedirectUri:T.silentSsoCheckUrl}})})}async function Tnr(l,u){const _=Kqe(l);return new Promise((g,T)=>{_.getKeycloakConfig.routeParams.value.name="keycloak-jwt",_.getKeycloakConfig.successCallback=A=>{console.info("got raw config: ",A);const I=A.environments.find($=>$.name===u);I?(console.info("selected keycloak config: ",I),g(I)):(console.error(`No matching environment was found in response for ${u}`),T(`No matching environment was found in response for ${u}`))},_.getKeycloakConfig.execute()})}function xnr(l){const u=l.createLoginUrl(),_=600,g=700,T=window.screen.width/2-_/2,A=window.screen.height/2-g/2,I=window.open(u,"KeycloakLoginPopup",`width=${_},height=${g},top=${A},left=${T},resizable=yes,scrollbars=yes`);if(!I){alert("Popup blocked! Please allow popups for this site.");return}const $=setInterval(()=>{I.closed&&clearInterval($)},500)}const knr={CheckBox:nq,CheckBoxList:Wqe,DropDown:BM,DropDownButton:Hqe,DropDownMenu:Ine,DropDownCallBack:$Te,ExternalArticleOfferComponent:YTe,FilterCompact:JTe,FilterControl:zTe,IconButton:L8,ImagePickerComponent:$M,InternalArticleOfferComponent:GTe,PaginatorControl:qTe,RadioButton:VTe,RadioButtonGroup:tVe,SpinningProgress:WTe,TableToList:rVe,TableToListOptions:nVe,TextListBox:iVe,ToastComponent:HTe,ToastWrapper:aVe,CalendarComponent:UTe,HeaderComponent:sVe},Cnr={install(l){Object.entries(knr).forEach(([u,_])=>{l.component(u,_)})}};exports.ArticleEditorService=eVe;exports.ArticleOfferElement=frr;exports.ArticlePickerElement=Irr;exports.CalendarComponent=UTe;exports.CheckBox=nq;exports.CheckBoxList=Wqe;exports.ConfigService=Zqe;exports.DateTimePickerElement=Yrr;exports.DropDown=BM;exports.DropDownButton=Hqe;exports.DropDownCallBack=$Te;exports.DropDownMenu=Ine;exports.ExternalArticleOfferComponent=YTe;exports.ExternalArticleOfferElement=Wrr;exports.FetchDetails=JP;exports.FetchError=One;exports.FilterCompact=JTe;exports.FilterControl=zTe;exports.FilterDate=YAt;exports.FilterDropDown=GAt;exports.FilterText=HAt;exports.GalleryImageSelectorElement=ynr;exports.HeaderComponent=sVe;exports.IconButton=L8;exports.ImagePickerComponent=$M;exports.ImagePickerDetailsElement=jrr;exports.ImagePickerElement=Mrr;exports.InternalArticleOfferComponent=GTe;exports.InternalArticleOfferElement=Urr;exports.Methods=_w;exports.PaginatorControl=qTe;exports.PartnerPickerElement=unr;exports.RadioButton=VTe;exports.RadioButtonGroup=tVe;exports.SpinningProgress=WTe;exports.TableToList=rVe;exports.TableToListOptions=nVe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=iVe;exports.ToastComponent=HTe;exports.ToastWrapper=aVe;exports.configureArticleOfferElement=err;exports.configureArticlePickerElement=_rr;exports.configureExternalArticleOfferElement=zrr;exports.configureGalleryImageSelectorElement=fnr;exports.configureImagePickerElement=prr;exports.configureInternalArticleOfferElement=Brr;exports.configurePartnerPickerElement=Xrr;exports.debounce=dAt;exports.default=Cnr;exports.initRequest=UP;exports.localDateTimeToDate=pAt;exports.localDateTimeToUTC=fAt;exports.localDateTimeToUTCDate=_At;exports.localToDateStr=iq;exports.localToStr=Qqe;exports.localToUtcStr=_ne;exports.loginWithPopup=xnr;exports.sendMsgToToast=bnr;exports.toDateString=oAt;exports.toDateStringFromUtc=uAt;exports.toDateTimeString=cAt;exports.toDateTimeStringFromUtc=lAt;exports.useAdminKeycloak=Snr;exports.useArticleEditorService=mAt;exports.useConfigService=Kqe;
491
+ `+D.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function IMe(e){const t=e.diagnosticsDuration&&ma(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function M0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function wye(e,t,n){const i=M0(e,n),a=t&&M0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function hvt(e,t){return{start:OMe(t,e.span.start),end:OMe(t,Il(e.span)),newText:e.newText}}function OMe(e,t){return bye(e)?yvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function vvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function yvt(e){return{line:e.line+1,offset:e.character+1}}function bvt(e){F.assert(e.textChanges.length===1);const t=Fs(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Dye(e,t,n,i){const a=Svt(e,t,i),{line:o,character:c}=_A(ww(a),n);return{line:o+1,offset:c+1}}function Svt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function FMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=wye(n,i,d),y=c?void 0:Tvt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Tvt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function xvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var Q4=4,Aye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Aye||{}),kvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new a9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new K4,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=a9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new iU(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new K4;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new iU(""):new K4}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Cvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return v7(Gf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Cee=class fw{constructor(){this.changes=[],this.versions=new Array(fw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%fw.maxVersions}currentVersionToIndex(){return this.currentVersion%fw.maxVersions}edit(t,n,i){this.changes.push(new Cvt(t,n,i)),(this.changes.length>fw.changeNumberThreshold||n>fw.changeLengthThreshold||i&&i.length>fw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new MMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=fw.maxVersions&&(this.minVersion=this.currentVersion-fw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Gf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return TL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new fw,i=new MMe(0,n,new a9);n.versions[n.currentVersion]=i;const a=a9.linesFromText(t);return i.index.load(a.lines),n}};Cee.changeNumberThreshold=8,Cee.changeLengthThreshold=256,Cee.maxVersions=8;var Eee=Cee,MMe=class gQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof gQe&&this.cache===t.cache)return this.version<=t.version?TL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},a9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new iU(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new K4}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new kvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<Q4)return new K4(t);const n=new Array(Math.ceil(t.length/Q4));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+Q4,t.length);n[a]=new K4(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=ww(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},K4=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<Q4&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<Q4&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/Q4),p=new Array(y);let b=0;for(let E=0;E<y;E++)p[E]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===Q4&&(b++,S=p[b]);for(let E=p.length-1;E>=0;E--)p[E].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=Q4)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},iU=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},LMe=class hQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Op(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Lve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${bT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${bT(t)}`),t.kind){case GX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case T$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case $pe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case YX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case XX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case S$:{this.projectService.updateTypingsForProject(t);break}case b$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case ZF:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${bT(t)}`),this.installer.send(t)},hQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};LMe.requestDelayMillis=100;var RMe=LMe,jMe={};T(jMe,{ActionInvalidate:()=>S$,ActionPackageInstalled:()=>T$,ActionSet:()=>b$,ActionWatchTypingLocations:()=>ZF,Arguments:()=>QX,AutoImportProviderProject:()=>nye,AuxiliaryProject:()=>tye,CharRangeSection:()=>Aye,CloseFileWatcherEvent:()=>dee,CommandNames:()=>xMe,ConfigFileDiagEvent:()=>lee,ConfiguredProject:()=>iye,ConfiguredProjectLoadKind:()=>uye,CreateDirectoryWatcherEvent:()=>pee,CreateFileWatcherEvent:()=>_ee,Errors:()=>f1,EventBeginInstallTypes:()=>YX,EventEndInstallTypes:()=>XX,EventInitializationFailed:()=>$pe,EventTypesRegistry:()=>GX,ExternalProject:()=>nee,GcTimer:()=>zve,InferredProject:()=>eye,LargeFileReferencedEvent:()=>cee,LineIndex:()=>a9,LineLeaf:()=>iU,LineNode:()=>K4,LogLevel:()=>Fve,Msg:()=>Mve,OpenFileInfoTelemetryEvent:()=>aye,Project:()=>QD,ProjectInfoTelemetryEvent:()=>fee,ProjectKind:()=>jI,ProjectLanguageServiceStateEvent:()=>uee,ProjectLoadingFinishEvent:()=>oee,ProjectLoadingStartEvent:()=>see,ProjectService:()=>yye,ProjectsUpdatedInBackgroundEvent:()=>tU,ScriptInfo:()=>Hve,ScriptVersionCache:()=>Eee,Session:()=>NMe,TextStorage:()=>Wve,ThrottledOperations:()=>Uve,TypingsInstallerAdapter:()=>RMe,allFilesAreJsOrDts:()=>Qve,allRootFilesAreJsOrDts:()=>Xve,asNormalizedPath:()=>Y9e,convertCompilerOptions:()=>rU,convertFormatOptions:()=>Y4,convertScriptKindName:()=>gee,convertTypeAcquisition:()=>oye,convertUserPreferences:()=>cye,convertWatchOptions:()=>n9,countEachFileTypes:()=>Z5,createInstallTypingsRequest:()=>Lve,createModuleSpecifierCache:()=>Tye,createNormalizedPathMap:()=>X9e,createPackageJsonCache:()=>xye,createSortedArray:()=>Jve,emptyArray:()=>of,findArgument:()=>XAe,formatDiagnosticToProtocol:()=>i9,formatMessage:()=>kye,getBaseConfigFileName:()=>ree,getDetailWatchInfo:()=>bee,getLocationInNewDocument:()=>Dye,hasArgument:()=>YAe,hasNoTypeScriptSource:()=>Kve,indent:()=>lI,isBackgroundProject:()=>t9,isConfigFile:()=>bye,isConfiguredProject:()=>Db,isDynamicFileName:()=>RI,isExternalProject:()=>e9,isInferredProject:()=>G4,isInferredProjectName:()=>Rve,isProjectDeferredClose:()=>r9,makeAutoImportProviderProjectName:()=>Bve,makeAuxiliaryProjectName:()=>$ve,makeInferredProjectName:()=>jve,maxFileSize:()=>aee,maxProgramSizeForNonTsFiles:()=>iee,normalizedPathToPath:()=>H4,nowString:()=>QAe,nullCancellationToken:()=>bMe,nullTypingsInstaller:()=>nU,protocol:()=>qve,scriptInfoIsContainedByBackgroundProject:()=>Gve,scriptInfoIsContainedByDeferredClosedProject:()=>Yve,stringifyIndented:()=>bT,toEvent:()=>Cye,toNormalizedPath:()=>Ac,tryConvertScriptKindName:()=>mee,typingsInstaller:()=>Ove,updateProjectIfDirty:()=>jg}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return u},set exports(_){u=_,l.exports&&(l.exports=_)}})})(ZSe)),ZSe.exports}enr();const tnr=oA({name:"PartnerPickerElement",setup(l,u){const{value:_}=u.element,g=w.ref(""),T=w.ref("");w.watch(_,W=>{W&&I(W)},{deep:!0});const A=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,Z,R)=>{g.value=Z,T.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:T,value:_,fetchData:I,onFetchData:A,gotData:$}}}),rnr={class:"d-flex flex-column flex-md-row gap-2"},nnr={class:"d-flex flex-row gap-2 w-100"},inr=["src"],anr={class:"w-100"},snr=["value"],onr={class:"w-100"},cnr=["value"];function lnr(l,u,_,g,T,A){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({element:w.withCtx(()=>[w.createElementVNode("div",rnr,[w.createElementVNode("div",nnr,[w.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,inr),w.createElementVNode("div",anr,[w.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,snr)])]),w.createElementVNode("div",onr,[w.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:u[0]||(u[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,cnr)])])]),_:2},[w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const unr=sC(tnr,[["render",lnr]]);exports.gisConfig=void 0;const fnr=l=>(exports.gisConfig=l,exports.gisConfig),_nr=oA({name:"GalleryImageSelectorElement",setup(l,u){const{value:_}=u.element,g=w.ref([]),T=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,Z=>{g.value=Z.items||[],$()})};w.watch(()=>_.value,(W,Z)=>{!W||(W==null?void 0:W.galleryId)===(Z==null?void 0:Z.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const A=W=>{_.value.activeImageIndex=W.target.value,$()},I=w.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const Z=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=Z;return}I.value=null};return{onGalleryIdChanged:T,onActiveIndexChanged:A,imageUrl:I,value:_}}}),pnr={key:0},dnr=["src"],mnr={key:1},gnr=["value"],hnr=["value"];function vnr(l,u,_,g,T,A){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({_:2},[l.value?{name:"element",fn:w.withCtx(()=>[l.imageUrl?(w.openBlock(),w.createElementBlock("div",pnr,[w.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,dnr)])):w.createCommentVNode("",!0),l.imageUrl?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",mnr,[...u[2]||(u[2]=[w.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),w.createElementVNode("div",null,[u[3]||(u[3]=w.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),w.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:u[0]||(u[0]=$=>l.onGalleryIdChanged($))},null,40,gnr)]),w.createElementVNode("div",null,[u[4]||(u[4]=w.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),w.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:u[1]||(u[1]=$=>l.onActiveIndexChanged($))},null,40,hnr)])]),key:"0"}:void 0,w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const ynr=sC(_nr,[["render",vnr]]);function bnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}function Snr(l,u,_,g){Tnr(u,_).then(T=>{l.use(z6t,{config:{url:T.url,realm:T.realm,clientId:g},init:{onLoad:"check-sso",checkLoginIframe:!!T.silentSsoCheckUrl,silentCheckSsoRedirectUri:T.silentSsoCheckUrl},onReady(A){xnr(A)}})})}async function Tnr(l,u){const _=Kqe(l);return new Promise((g,T)=>{_.getKeycloakConfig.routeParams.value.name="keycloak-jwt",_.getKeycloakConfig.successCallback=A=>{console.info("got raw config: ",A);const I=A.environments.find($=>$.name===u);I?(console.info("selected keycloak config: ",I),g(I)):(console.error(`No matching environment was found in response for ${u}`),T(`No matching environment was found in response for ${u}`))},_.getKeycloakConfig.execute()})}function xnr(l){const u=l.createLoginUrl(),_=600,g=700,T=window.screen.width/2-_/2,A=window.screen.height/2-g/2,I=window.open(u,"KeycloakLoginPopup",`width=${_},height=${g},top=${A},left=${T},resizable=yes,scrollbars=yes`);if(!I){alert("Popup blocked! Please allow popups for this site.");return}const $=setInterval(()=>{I.closed&&clearInterval($)},500)}const knr={CheckBox:nq,CheckBoxList:Wqe,DropDown:BM,DropDownButton:Hqe,DropDownMenu:Ine,DropDownCallBack:$Te,ExternalArticleOfferComponent:YTe,FilterCompact:JTe,FilterControl:zTe,IconButton:L8,ImagePickerComponent:$M,InternalArticleOfferComponent:GTe,PaginatorControl:qTe,RadioButton:VTe,RadioButtonGroup:tVe,SpinningProgress:WTe,TableToList:rVe,TableToListOptions:nVe,TextListBox:iVe,ToastComponent:HTe,ToastWrapper:aVe,CalendarComponent:UTe,HeaderComponent:sVe},Cnr={install(l){Object.entries(knr).forEach(([u,_])=>{l.component(u,_)})}};exports.ArticleEditorService=eVe;exports.ArticleOfferElement=frr;exports.ArticlePickerElement=Irr;exports.CalendarComponent=UTe;exports.CheckBox=nq;exports.CheckBoxList=Wqe;exports.ConfigService=Zqe;exports.DateTimePickerElement=Yrr;exports.DropDown=BM;exports.DropDownButton=Hqe;exports.DropDownCallBack=$Te;exports.DropDownMenu=Ine;exports.ExternalArticleOfferComponent=YTe;exports.ExternalArticleOfferElement=Wrr;exports.FetchDetails=JP;exports.FetchError=One;exports.FilterCompact=JTe;exports.FilterControl=zTe;exports.FilterDate=YAt;exports.FilterDropDown=GAt;exports.FilterText=HAt;exports.GalleryImageSelectorElement=ynr;exports.HeaderComponent=sVe;exports.IconButton=L8;exports.ImagePickerComponent=$M;exports.ImagePickerDetailsElement=jrr;exports.ImagePickerElement=Mrr;exports.InternalArticleOfferComponent=GTe;exports.InternalArticleOfferElement=Urr;exports.Methods=_w;exports.PaginatorControl=qTe;exports.PartnerPickerElement=unr;exports.RadioButton=VTe;exports.RadioButtonGroup=tVe;exports.SpinningProgress=WTe;exports.TableToList=rVe;exports.TableToListOptions=nVe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=iVe;exports.ToastComponent=HTe;exports.ToastWrapper=aVe;exports.configureArticleOfferElement=err;exports.configureArticlePickerElement=_rr;exports.configureExternalArticleOfferElement=zrr;exports.configureGalleryImageSelectorElement=fnr;exports.configureImagePickerElement=prr;exports.configureInternalArticleOfferElement=Brr;exports.configurePartnerPickerElement=Xrr;exports.debounce=dAt;exports.default=Cnr;exports.initRequest=UP;exports.localDateTimeToDate=pAt;exports.localDateTimeToUTC=fAt;exports.localDateTimeToUTCDate=_At;exports.localToDateStr=iq;exports.localToStr=Qqe;exports.localToUtcStr=_ne;exports.sendMsgToToast=bnr;exports.toDateString=oAt;exports.toDateStringFromUtc=uAt;exports.toDateTimeString=cAt;exports.toDateTimeStringFromUtc=lAt;exports.useAdminKeycloak=Snr;exports.useArticleEditorService=mAt;exports.useConfigService=Kqe;
@@ -1969,29 +1969,29 @@ function ZAt(l, u, _) {
1969
1969
  g += `${T}=${D}`;
1970
1970
  })), g;
1971
1971
  }
1972
- const eir = (l) => {
1972
+ const tir = (l) => {
1973
1973
  if (l == "NaN-NaN-NaN" || !l) return null;
1974
1974
  const u = new Date(Date.parse(l));
1975
1975
  return `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${u.getDate().toString().padStart(2, "0")}`;
1976
- }, tir = (l) => {
1976
+ }, rir = (l) => {
1977
1977
  if (!l) return "-";
1978
1978
  const u = new Date(Date.parse(l));
1979
1979
  return `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${u.getDate().toString().padStart(2, "0")} ${u.getHours()}:${u.getMinutes()}`;
1980
- }, rir = (l) => {
1980
+ }, nir = (l) => {
1981
1981
  if (!l) return "-";
1982
1982
  const u = new Date(Date.parse(l));
1983
1983
  return `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${u.getDate().toString().padStart(2, "0")} ${u.getHours()}:${u.getMinutes()}`;
1984
- }, nir = (l) => {
1984
+ }, iir = (l) => {
1985
1985
  if (!l) return "-";
1986
1986
  const u = new Date(Date.parse(l));
1987
1987
  return `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${u.getDate().toString().padStart(2, "0")}`;
1988
- }, iir = (l) => {
1988
+ }, air = (l) => {
1989
1989
  const u = new Date(Date.parse(l)), _ = u.getUTCFullYear(), g = String(u.getUTCMonth() + 1).padStart(2, "0"), T = String(u.getUTCDate()).padStart(2, "0"), D = String(u.getUTCHours()).padStart(2, "0"), I = String(u.getUTCMinutes()).padStart(2, "0"), B = String(u.getUTCSeconds()).padStart(2, "0");
1990
1990
  return `${_}-${g}-${T}T${D}:${I}:${B}Z`;
1991
- }, air = (l) => {
1991
+ }, sir = (l) => {
1992
1992
  const u = new Date(Date.parse(l)), _ = u.getUTCFullYear(), g = String(u.getUTCMonth() + 1).padStart(2, "0"), T = String(u.getUTCDate()).padStart(2, "0");
1993
1993
  return `${_}-${g}-${T}`;
1994
- }, sir = (l) => {
1994
+ }, oir = (l) => {
1995
1995
  const u = new Date(Date.parse(l)), _ = u.getFullYear(), g = String(u.getMonth() + 1).padStart(2, "0"), T = String(u.getDate()).padStart(2, "0");
1996
1996
  return `${_}-${g}-${T}`;
1997
1997
  }, e4t = (l) => {
@@ -2092,7 +2092,7 @@ class r4t {
2092
2092
  );
2093
2093
  }
2094
2094
  }
2095
- const oir = (l, u = 500) => {
2095
+ const cir = (l, u = 500) => {
2096
2096
  let _;
2097
2097
  return () => {
2098
2098
  clearTimeout(_), _ = setTimeout(() => {
@@ -2100,7 +2100,7 @@ const oir = (l, u = 500) => {
2100
2100
  }, u);
2101
2101
  };
2102
2102
  };
2103
- function cir(l) {
2103
+ function lir(l) {
2104
2104
  return new n4t(l);
2105
2105
  }
2106
2106
  class n4t {
@@ -2531,19 +2531,19 @@ const i4t = { class: "d-flex flex-column w-100 gap-2" }, a4t = { class: "d-flex
2531
2531
  key: 1,
2532
2532
  class: "d-flex flex-row input-group align-items-center"
2533
2533
  };
2534
- class lir {
2534
+ class uir {
2535
2535
  constructor(u, _, g) {
2536
2536
  Ph(this, "type");
2537
2537
  this.key = u, this.placeholder = _, this.filtered = g, this.type = "text";
2538
2538
  }
2539
2539
  }
2540
- class uir {
2540
+ class fir {
2541
2541
  constructor(u, _, g, T, D, I, B) {
2542
2542
  Ph(this, "type");
2543
2543
  this.key = u, this.label = _, this.options = g, this.filterevent = T, this.onfiltered = D, this.filtered = I, this.selected = B, this.type = "dropdown";
2544
2544
  }
2545
2545
  }
2546
- class fir {
2546
+ class _ir {
2547
2547
  constructor(u, _, g, T, D) {
2548
2548
  Ph(this, "type");
2549
2549
  this.key = u, this.label = _, this.filtered = g, this.defFrom = T, this.defTil = D, this.type = "date";
@@ -5499,22 +5499,22 @@ ch.getAdapter = uVe.getAdapter;
5499
5499
  ch.HttpStatusCode = VTe;
5500
5500
  ch.default = ch;
5501
5501
  const {
5502
- Axios: dir,
5503
- AxiosError: mir,
5504
- CanceledError: gir,
5505
- isCancel: hir,
5506
- CancelToken: vir,
5507
- VERSION: yir,
5508
- all: bir,
5509
- Cancel: Sir,
5510
- isAxiosError: Tir,
5511
- spread: xir,
5512
- toFormData: kir,
5513
- AxiosHeaders: Cir,
5514
- HttpStatusCode: Eir,
5515
- formToJSON: wir,
5516
- getAdapter: Dir,
5517
- mergeConfig: Air
5502
+ Axios: mir,
5503
+ AxiosError: gir,
5504
+ CanceledError: hir,
5505
+ isCancel: vir,
5506
+ CancelToken: yir,
5507
+ VERSION: bir,
5508
+ all: Sir,
5509
+ Cancel: Tir,
5510
+ isAxiosError: xir,
5511
+ spread: kir,
5512
+ toFormData: Cir,
5513
+ AxiosHeaders: Eir,
5514
+ HttpStatusCode: wir,
5515
+ formToJSON: Dir,
5516
+ getAdapter: Air,
5517
+ mergeConfig: Pir
5518
5518
  } = ch;
5519
5519
  //! moment.js
5520
5520
  //! version : 2.30.1
@@ -33705,7 +33705,7 @@ JYe(void 0, Zn({}, Urr), Zn({}, AQt), {
33705
33705
  moment: xo
33706
33706
  });
33707
33707
  let dA;
33708
- function Pir(l) {
33708
+ function Iir(l) {
33709
33709
  return dA = l, dA;
33710
33710
  }
33711
33711
  const Wrr = LA({
@@ -33854,13 +33854,13 @@ function enr(l, u, _, g, T, D) {
33854
33854
  }))
33855
33855
  ]), 1024);
33856
33856
  }
33857
- const Iir = /* @__PURE__ */ DC(Wrr, [["render", enr]]);
33857
+ const Nir = /* @__PURE__ */ DC(Wrr, [["render", enr]]);
33858
33858
  let qne;
33859
- function Nir(l) {
33859
+ function Oir(l) {
33860
33860
  qne = l;
33861
33861
  }
33862
33862
  let vA;
33863
- function Oir(l) {
33863
+ function Fir(l) {
33864
33864
  return vA = l, l;
33865
33865
  }
33866
33866
  const tnr = LA({
@@ -34052,7 +34052,7 @@ function vnr(l, u, _, g, T, D) {
34052
34052
  }))
34053
34053
  ]), 1024);
34054
34054
  }
34055
- const Fir = /* @__PURE__ */ DC(tnr, [["render", vnr]]), ynr = LA({
34055
+ const Mir = /* @__PURE__ */ DC(tnr, [["render", vnr]]), ynr = LA({
34056
34056
  name: "ImagePickerElement",
34057
34057
  components: { ImagePickerComponent: Vq },
34058
34058
  setup(l, u) {
@@ -34103,7 +34103,7 @@ function bnr(l, u, _, g, T, D) {
34103
34103
  }))
34104
34104
  ]), 1024);
34105
34105
  }
34106
- const Mir = /* @__PURE__ */ DC(ynr, [["render", bnr]]), Snr = LA({
34106
+ const Lir = /* @__PURE__ */ DC(ynr, [["render", bnr]]), Snr = LA({
34107
34107
  name: "ImagePickerDetailsElement",
34108
34108
  components: { ImagePickerComponent: Vq },
34109
34109
  setup(l, u) {
@@ -34155,9 +34155,9 @@ function Tnr(l, u, _, g, T, D) {
34155
34155
  }))
34156
34156
  ]), 1024);
34157
34157
  }
34158
- const Lir = /* @__PURE__ */ DC(Snr, [["render", Tnr]]);
34158
+ const Rir = /* @__PURE__ */ DC(Snr, [["render", Tnr]]);
34159
34159
  let vxe;
34160
- function Rir(l) {
34160
+ function jir(l) {
34161
34161
  return vxe = l, vxe;
34162
34162
  }
34163
34163
  const xnr = LA({
@@ -34201,9 +34201,9 @@ function knr(l, u, _, g, T, D) {
34201
34201
  }))
34202
34202
  ]), 1024);
34203
34203
  }
34204
- const jir = /* @__PURE__ */ DC(xnr, [["render", knr]]);
34204
+ const Bir = /* @__PURE__ */ DC(xnr, [["render", knr]]);
34205
34205
  let yxe;
34206
- function Bir(l) {
34206
+ function $ir(l) {
34207
34207
  return yxe = l, yxe;
34208
34208
  }
34209
34209
  const Cnr = LA({
@@ -34245,7 +34245,7 @@ function Enr(l, u, _, g, T, D) {
34245
34245
  }))
34246
34246
  ]), 1024);
34247
34247
  }
34248
- const $ir = /* @__PURE__ */ DC(Cnr, [["render", Enr]]), wnr = LA({
34248
+ const Jir = /* @__PURE__ */ DC(Cnr, [["render", Enr]]), wnr = LA({
34249
34249
  name: "DateTimePickerElement",
34250
34250
  setup(l, u) {
34251
34251
  hb().appContext && !hb().appContext.components.DateTimePicker && (hb().appContext.components.DateTimePicker = JTe);
@@ -34288,9 +34288,9 @@ function Dnr(l, u, _, g, T, D) {
34288
34288
  }))
34289
34289
  ]), 1024);
34290
34290
  }
34291
- const Jir = /* @__PURE__ */ DC(wnr, [["render", Dnr]]);
34291
+ const zir = /* @__PURE__ */ DC(wnr, [["render", Dnr]]);
34292
34292
  let die;
34293
- function zir(l) {
34293
+ function Uir(l) {
34294
34294
  return die = l, die;
34295
34295
  }
34296
34296
  var xWe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
@@ -51525,7 +51525,7 @@ ${Nt.join(`
51525
51525
  const t = Y_(e);
51526
51526
  return 3 <= t && t <= 99 || uF(e) || fF(e);
51527
51527
  }
51528
- function Qnr(e) {
51528
+ function Knr(e) {
51529
51529
  return e;
51530
51530
  }
51531
51531
  var __ = {
@@ -193407,9 +193407,9 @@ function Jnr(l, u, _, g, T, D) {
193407
193407
  }))
193408
193408
  ]), 1024);
193409
193409
  }
193410
- const Uir = /* @__PURE__ */ DC(Onr, [["render", Jnr]]);
193410
+ const qir = /* @__PURE__ */ DC(Onr, [["render", Jnr]]);
193411
193411
  let mie;
193412
- const qir = (l) => (mie = l, mie), znr = LA({
193412
+ const Wir = (l) => (mie = l, mie), znr = LA({
193413
193413
  name: "GalleryImageSelectorElement",
193414
193414
  setup(l, u) {
193415
193415
  const { value: _ } = u.element, g = Kr([]), T = (W) => {
@@ -193498,15 +193498,15 @@ function Gnr(l, u, _, g, T, D) {
193498
193498
  }))
193499
193499
  ]), 1024);
193500
193500
  }
193501
- const Wir = /* @__PURE__ */ DC(znr, [["render", Gnr]]);
193502
- function Vir(l) {
193501
+ const Vir = /* @__PURE__ */ DC(znr, [["render", Gnr]]);
193502
+ function Hir(l) {
193503
193503
  window.dispatchEvent(
193504
193504
  new CustomEvent("toast-notification-message", {
193505
193505
  detail: l
193506
193506
  })
193507
193507
  );
193508
193508
  }
193509
- function Hir(l, u, _, g) {
193509
+ function Gir(l, u, _, g) {
193510
193510
  Ynr(u, _).then((T) => {
193511
193511
  l.use(LAt, {
193512
193512
  config: {
@@ -193515,9 +193515,12 @@ function Hir(l, u, _, g) {
193515
193515
  clientId: g
193516
193516
  },
193517
193517
  init: {
193518
- onLoad: "login-required",
193518
+ onLoad: "check-sso",
193519
193519
  checkLoginIframe: !!T.silentSsoCheckUrl,
193520
193520
  silentCheckSsoRedirectUri: T.silentSsoCheckUrl
193521
+ },
193522
+ onReady(D) {
193523
+ Xnr(D);
193521
193524
  }
193522
193525
  });
193523
193526
  });
@@ -193532,7 +193535,7 @@ async function Ynr(l, u) {
193532
193535
  }, _.getKeycloakConfig.execute();
193533
193536
  });
193534
193537
  }
193535
- function Gir(l) {
193538
+ function Xnr(l) {
193536
193539
  const u = l.createLoginUrl(), _ = 600, g = 700, T = window.screen.width / 2 - _ / 2, D = window.screen.height / 2 - g / 2, I = window.open(
193537
193540
  u,
193538
193541
  "KeycloakLoginPopup",
@@ -193546,7 +193549,7 @@ function Gir(l) {
193546
193549
  I.closed && clearInterval(B);
193547
193550
  }, 500);
193548
193551
  }
193549
- const Xnr = {
193552
+ const Qnr = {
193550
193553
  CheckBox: Vne,
193551
193554
  CheckBoxList: rAt,
193552
193555
  DropDown: Wq,
@@ -193572,44 +193575,44 @@ const Xnr = {
193572
193575
  HeaderComponent: JPt
193573
193576
  }, Yir = {
193574
193577
  install(l) {
193575
- Object.entries(Xnr).forEach(([u, _]) => {
193578
+ Object.entries(Qnr).forEach(([u, _]) => {
193576
193579
  l.component(u, _);
193577
193580
  });
193578
193581
  }
193579
193582
  };
193580
193583
  export {
193581
193584
  n4t as ArticleEditorService,
193582
- Iir as ArticleOfferElement,
193583
- Fir as ArticlePickerElement,
193585
+ Nir as ArticleOfferElement,
193586
+ Mir as ArticlePickerElement,
193584
193587
  MWe as CalendarComponent,
193585
193588
  Vne as CheckBox,
193586
193589
  rAt as CheckBoxList,
193587
193590
  r4t as ConfigService,
193588
- Jir as DateTimePickerElement,
193591
+ zir as DateTimePickerElement,
193589
193592
  Wq as DropDown,
193590
193593
  CAt as DropDownButton,
193591
193594
  PWe as DropDownCallBack,
193592
193595
  Cxe as DropDownMenu,
193593
193596
  UWe as ExternalArticleOfferComponent,
193594
- $ir as ExternalArticleOfferElement,
193597
+ Jir as ExternalArticleOfferElement,
193595
193598
  o7 as FetchDetails,
193596
193599
  Exe as FetchError,
193597
193600
  IWe as FilterCompact,
193598
193601
  LWe as FilterControl,
193599
- fir as FilterDate,
193600
- uir as FilterDropDown,
193601
- lir as FilterText,
193602
- Wir as GalleryImageSelectorElement,
193602
+ _ir as FilterDate,
193603
+ fir as FilterDropDown,
193604
+ uir as FilterText,
193605
+ Vir as GalleryImageSelectorElement,
193603
193606
  JPt as HeaderComponent,
193604
193607
  iL as IconButton,
193605
193608
  Vq as ImagePickerComponent,
193606
- Lir as ImagePickerDetailsElement,
193607
- Mir as ImagePickerElement,
193609
+ Rir as ImagePickerDetailsElement,
193610
+ Lir as ImagePickerElement,
193608
193611
  zWe as InternalArticleOfferComponent,
193609
- jir as InternalArticleOfferElement,
193612
+ Bir as InternalArticleOfferElement,
193610
193613
  mA as Methods,
193611
193614
  RWe as PaginatorControl,
193612
- Uir as PartnerPickerElement,
193615
+ qir as PartnerPickerElement,
193613
193616
  jWe as RadioButton,
193614
193617
  z4t as RadioButtonGroup,
193615
193618
  BWe as SpinningProgress,
@@ -193621,34 +193624,33 @@ export {
193621
193624
  FPt as ToastWrapper,
193622
193625
  dA as aoeConfig,
193623
193626
  qne as apeConfig,
193624
- Pir as configureArticleOfferElement,
193625
- Nir as configureArticlePickerElement,
193626
- Bir as configureExternalArticleOfferElement,
193627
- qir as configureGalleryImageSelectorElement,
193628
- Oir as configureImagePickerElement,
193629
- Rir as configureInternalArticleOfferElement,
193630
- zir as configurePartnerPickerElement,
193631
- oir as debounce,
193627
+ Iir as configureArticleOfferElement,
193628
+ Oir as configureArticlePickerElement,
193629
+ $ir as configureExternalArticleOfferElement,
193630
+ Wir as configureGalleryImageSelectorElement,
193631
+ Fir as configureImagePickerElement,
193632
+ jir as configureInternalArticleOfferElement,
193633
+ Uir as configurePartnerPickerElement,
193634
+ cir as debounce,
193632
193635
  Yir as default,
193633
193636
  yxe as eaoeConfig,
193634
193637
  mie as gisConfig,
193635
193638
  vxe as iaoeConfig,
193636
193639
  c7 as initRequest,
193637
193640
  vA as ipeConfig,
193638
- sir as localDateTimeToDate,
193639
- iir as localDateTimeToUTC,
193640
- air as localDateTimeToUTCDate,
193641
+ oir as localDateTimeToDate,
193642
+ air as localDateTimeToUTC,
193643
+ sir as localDateTimeToUTCDate,
193641
193644
  Gne as localToDateStr,
193642
193645
  e4t as localToStr,
193643
193646
  $Te as localToUtcStr,
193644
- Gir as loginWithPopup,
193645
193647
  die as ppeconfig,
193646
- Vir as sendMsgToToast,
193647
- eir as toDateString,
193648
- nir as toDateStringFromUtc,
193649
- tir as toDateTimeString,
193650
- rir as toDateTimeStringFromUtc,
193651
- Hir as useAdminKeycloak,
193652
- cir as useArticleEditorService,
193648
+ Hir as sendMsgToToast,
193649
+ tir as toDateString,
193650
+ iir as toDateStringFromUtc,
193651
+ rir as toDateTimeString,
193652
+ nir as toDateTimeStringFromUtc,
193653
+ Gir as useAdminKeycloak,
193654
+ lir as useArticleEditorService,
193653
193655
  t4t as useConfigService
193654
193656
  };
@@ -1,3 +1,2 @@
1
1
  import { App } from 'vue';
2
2
  export declare function useAdminKeycloak(app: App, configUrl: string, configEnvironment: string, clientId: string): void;
3
- export declare function loginWithPopup(keycloak: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "5.0.20",
3
+ "version": "5.0.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"