1import {B,R}from'./chunk-CgWtf2Ds.js';import {r as re}from'./chunk-u3jEdhXT.js';import {J,s as se}from'./chunk-CLWs2Yaj.js';import {F,B as B$1}from'./chunk-C2s3G7o7.js';import {j}from'./chunk-DJe9b1rJ.js';import {h}from'./chunk-CmFZtQYh.js';import {b}from'./chunk-JcVt1VGO.js';import {g,W as Ss,C as Ce,B as wi,bs as DE,d as de,bi as G,aW as H,Y as YG,s as st$1,q as qd,O as On,e as Es,v as Qn,a1 as s$1,a2 as r$1,ac as qG,bE as Uf,_ as H$1,f as qS,H as yt$1,l as le,aA as zt,aB as mt$1,L as gv,T as cN,bd as Me,aE as $,j1 as i5,im as F$1,j2 as a,gp as s,X as X8,h8 as e3,J as J8,af as Ix,i as ta,I as eM,P as Pd,S as SN,u as uT,N as tM,j3 as B5,gF as J1,j4 as W1,j5 as f1,j6 as m1,j7 as V,aG as fM,Z as Zv,aH as sh,ar as yM,aI as ah,j as Vv,Q as QM,y as yD,bL as Va,bm as ON,aC as oM,aD as iM,g3 as E,fE as Qi,G as Gd,ak as jv,k as Pv,m as iD,ap as BM,aJ as TM,bQ as fN,aK as $v,dd as pN,j8 as DD,dc as Gm}from'./main-DZECCSYF.js';import'./chunk-DSuDGZwv.js';import'./chunk-CtXdtpcZ.js';import'./chunk-BDpCYFWE.js';var qe=(t,l)=>l.value;function Qe(t,l){if(t&1){let e=fM();ta(0,"button",2),Zv("click",function(){let o=sh(e).$implicit,s=yM();return ah(s.select(o.value))}),Vv(1,"ng-icon",3),Pd();}if(t&2){let e=l.$implicit,i=yM();BM(i._value()===e.value?e.activeClass:"text-text-subtle hover:bg-backgrounds-hover"),jv("matTooltip",e.label)("disabled",i._isDisabled()),Pv("aria-pressed",i._value()===e.value)("aria-label",e.label),uT(),jv("name",e.icon);}}var Fe=(()=>{class t{constructor(){this._cdr=g(Va),this.options=X8.required(),this.value=X8(""),this.disabled=X8(false),this.valueChange=J8(),this._value=ON(()=>this.value()),this._cvaDisabled=On(false),this._isDisabled=qd(()=>this.disabled()||this._cvaDisabled()),this._onChange=()=>{},this._onTouched=()=>{};}select(e){this._isDisabled()||(this._value.set(e),this._onChange(e),this._onTouched(),this.valueChange.emit(e));}writeValue(e){this._value.set(e??""),this._cdr.markForCheck();}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this._cvaDisabled.set(e);}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=qS({type:t,selectors:[["mspot-policy-toggle"]],hostAttrs:[1,"inline-flex"],inputs:{options:[1,"options"],value:[1,"value"],disabled:[1,"disabled"]},outputs:{valueChange:"valueChange"},features:[cN([$({heroBolt:V,heroHandRaised:f1,heroNoSymbol:W1}),{provide:E,useExisting:Qi(()=>t),multi:true}])],decls:3,vars:0,consts:[[1,"border-borders-primary","inline-flex","overflow-hidden","rounded-lg","border"],["type","button",1,"flex","items-center","justify-center","px-2.5","py-1.5","transition-colors",3,"class","matTooltip","disabled"],["type","button",1,"flex","items-center","justify-center","px-2.5","py-1.5","transition-colors",3,"click","matTooltip","disabled"],["size","18",3,"name"]],template:function(i,o){i&1&&(ta(0,"div",0),oM(1,Qe,2,7,"button",1,qe),Pd()),i&2&&(uT(),iM(o.options()));},dependencies:[le,mt$1],encapsulation:2});}}return t})();var Le=t=>({$implicit:t}),ze=(t,l)=>l.key;function Ue(t,l){t&1&&$v(0);}function je(t,l){if(t&1&&gv(0,Ue,1,0,"ng-container",11),t&2){let e=l.$implicit;yM(2);let i=TM(4);jv("ngTemplateOutlet",i)("ngTemplateOutletContext",fN(2,Le,e));}}function Be(t,l){if(t&1){let e=fM();ta(0,"div",2)(1,"div",3)(2,"div",4),Vv(3,"ng-icon",5),ta(4,"span",6),QM(5),Pd(),ta(6,"span",7),QM(7),Pd()(),ta(8,"mspot-policy-toggle",8),Zv("valueChange",function(o){sh(e);let s=yM();return ah(s.readPolicy.set(o))}),Pd()(),ta(9,"mspot-expandable-item",9)(10,"div",10),oM(11,je,1,4,"ng-container",null,ze),Pd()()();}if(t&2){let e=yM();uT(5),Gd(" ",e.labels().read," "),uT(2),Gd(" (",e.readActions().length,") "),uT(),jv("options",e.policyOptions())("value",e.readPolicy()),uT(),jv("title",e.labels().overrides)("hideIcon",true)("noBorder",true)("roun
1ded",false),uT(2),iM(e.readActions());}}function He(t,l){t&1&&$v(0);}function We(t,l){if(t&1&&gv(0,He,1,0,"ng-container",11),t&2){let e=l.$implicit;yM(2);let i=TM(4);jv("ngTemplateOutlet",i)("ngTemplateOutletContext",fN(2,Le,e));}}function Ke(t,l){if(t&1){let e=fM();ta(0,"div",2)(1,"div",3)(2,"div",4),Vv(3,"ng-icon",12),ta(4,"span",6),QM(5),Pd(),ta(6,"span",7),QM(7),Pd()(),ta(8,"mspot-policy-toggle",8),Zv("valueChange",function(o){sh(e);let s=yM();return ah(s.writePolicy.set(o))}),Pd()(),ta(9,"mspot-expandable-item",9)(10,"div",10),oM(11,We,1,4,"ng-container",null,ze),Pd()()();}if(t&2){let e=yM();uT(5),Gd(" ",e.labels().write," "),uT(2),Gd(" (",e.writeActions().length,") "),uT(),jv("options",e.policyOptions())("value",e.writePolicy()),uT(),jv("title",e.labels().overrides)("hideIcon",true)("noBorder",true)("rounded",false),uT(2),iM(e.writeActions());}}function Ze(t,l){if(t&1&&(ta(0,"span",16),QM(1),Pd()),t&2){let e=yM().$implicit;uT(),Gd(" ",e.httpMethod," ");}}function Je(t,l){if(t&1&&(ta(0,"span",17),QM(1),Pd()),t&2){let e=yM().$implicit;uT(),Gd(" ",e.httpPath," ");}}function Xe(t,l){if(t&1&&(ta(0,"span",18),QM(1),Pd()),t&2){let e=yM().$implicit;jv("matTooltip",e.description),uT(),Gd(" ",e.description," ");}}function Ye(t,l){if(t&1&&(ta(0,"span",7),QM(1),Pd()),t&2){let e=yM().$implicit;uT(),yD(e.metaText);}}function et(t,l){if(t&1){let e=fM();ta(0,"button",20),Zv("click",function(){sh(e);let o=yM().$implicit,s=yM();return ah(s.editAction.emit(o.key))}),Vv(1,"ng-icon",21),Pd(),ta(2,"button",22),Zv("click",function(){sh(e);let o=yM().$implicit,s=yM();return ah(s.removeAction.emit(o.key))}),Vv(3,"ng-icon",23),Pd();}}function tt(t,l){if(t&1){let e=fM();ta(0,"div",13)(1,"div",14)(2,"div",4)(3,"span",15),QM(4),Pd(),eM(5,Ze,2,1,"span",16),eM(6,Je,2,1,"span",17),Pd(),eM(7,Xe,2,2,"span",18),eM(8,Ye,2,1,"span",7),Pd(),ta(9,"div",19)(10,"mspot-policy-toggle",8),Zv("valueChange",function(o){let s=sh(e).$implicit,b=yM();return ah(b.actionPolicyChange.emit({key:s.key,policy:o}))}),Pd(),eM(11,et,4,0),Pd()();}if(t&2){let e=l.$implicit,i=yM();uT(4),Gd(" ",e.name," "),uT(),tM(e.httpMethod?5:-1),uT(),tM(e.httpPath?6:-1),uT(),tM(e.description?7:-1),uT(),tM(e.metaText?8:-1),uT(2),jv("options",i.policyOptions())("value",e.policy),uT(),tM(i.editable()?11:-1);}}var W=(()=>{class t{constructor(){this.readActions=X8([]),this.writeActions=X8([]),this.readPolicy=e3.required(),this.writePolicy=e3.required(),this.editable=X8(false),this.labels=X8.required(),this.actionPolicyChange=J8(),this.editAction=J8(),this.removeAction=J8(),this.policyOptions=qd(()=>{let e=this.labels();return [{value:"disabled",icon:"heroNoSymbol",label:e.policyDisabled,activeClass:"bg-backgrounds-fill-danger-subtle text-text-danger"},{value:"ask_user",icon:"heroHandRaised",label:e.policyAsk,activeClass:"bg-backgrounds-fill-warning-subtle text-text-warning"},{value:"auto",icon:"heroBolt",label:e.policyAuto,activeClass:"bg-backgrounds-fill-success-subtle text-text-success"}]});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=qS({type:t,selectors:[["mspot-action-policy-groups"]],hostAttrs:[1,"block"],inputs:{readActions:[1,"readActions"],writeActions:[1,"writeActions"],readPolicy:[1,"readPolicy"],writePolicy:[1,"writePolicy"],editable:[1,"editable"],labels:[1,"labels"]},outputs:{readPolicy:"readPolicyChange",writePolicy:"writePolicyChange",actionPolicyChange:"actionPolicyChange",editAction:"editAction",removeAction:"removeAction"},features:[cN([$({heroBolt:V,heroEye:m1,heroHandRaised:f1,heroNoSymbol:W1,heroPencilSquare:J1,heroTrash:B5})])],decls:5,vars:2,consts:[["actionRow",""],[1,"flex","flex-col","gap-4"],[1,"border-borders-primary","overflow-hidden","rounded-lg","border"],[1,"bg-backgrounds-subtle","flex","items-center","justify-between","gap-3","px-4","py-3"],[1,"flex","items-center","gap-2"],["name","heroEye",1,"text-icons-default","text-lg"],[1,"text-text-strong","text-sm","font-semibold"],[1,"text-text-subtle","text-xs"],[3,"valueChange","options","value"],[3,"title","hideIcon","noBorder","rounded"],[1,"flex","flex-col","gap-2"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["name","heroPencilSquare",1,"text-icons-default","text-lg"],[1,"bg-backgrounds-surface-raised","border-borders-primary","flex","items-center","justify-between","gap-3","rounded-lg","border","p-3"],[1,"flex","min-w-0","flex-1","flex-col","gap-1"],[1,"text-text-strong","truncate","text-sm","font-medium"],[1,"bg-backgrounds-subtle","text-text-default","rounded","px-1.5","py-0.5","font-mono","text-[10px]","font-semibold"],[1,"text-text-subtle","truncate","font-mono","text-xs"],[1,"text-text-subtle","block","truncate","text-xs",3,"matTooltip"],[1,"flex","shrink-0","items-center","gap-2"],["type","button",1,"text-icons-subtle","hover:text-icons-primary","transition-colors",3,"click"],["name","heroPencilSquare",1,"text-lg"],["type","button",1,"text-icons-subtle","hover:text-icons-danger","transition-colors",3,"click"],["name","heroTrash",1,"text-lg"]],template:function(i,o){i&1&&(ta(0,"div",1),eM(1,Be,13,8,"div",2),eM(2,Ke,13,8,"div",2),Pd(),gv(3,tt,12,8,"ng-template",null,0,SN)),i&2&&(uT(),tM(o.readActions().length>0?1:-1),uT(),tM(o.writeActions().length>0?2:-1));},dependencies:[Ix,le,mt$1,Fe,re],encapsulation:2});}}return t})();var it=(t,l)=>({installations:t,repositories:l}),nt=(t,l)=>l.accountLogin;function ot(t,l){if(t&1){let e=fM();ta(0,"img",26),Zv("error",function(o){sh(e);let s=yM(3);return ah(s.onFaviconError(o))}),Pd();}if(t&2){let e=yM();jv("src",l,Gm)("alt",e.name);}}function at(t,l){if(t&1&&(ta(0,"span",10),QM(1),Pd()),t&2){let e=yM();uT(),yD(e.icon);}}function rt(t,l){t&1&&Vv(0,"ng-icon",11);}function ct(t,l){if(t&1&&(ta(0,"span",14),Vv(1,"ng-icon",27),QM(2),Pd()),t&2){let e=yM(2).$implicit;uT(2),Gd(" ",e("extensionConnections.connected")," ");}}function lt(t,l){if(t&1&&(ta(0,"span",15),QM(1),Pd()),t&2){let e=yM(2).$implicit;uT(),Gd(" ",e("extensionConnections.notConnected")," ");}}function st(t,l){if(t&1){let e=fM();ta(0,"button",28),Zv("click",function(){sh(e);let o=yM(3);return ah(o.reDiscover())}),Vv(1,"ng-icon",29),QM(2),Pd();}if(t&2){let e=yM(2).$implicit,i=yM();jv("disabled",i.rediscovering()),uT(),iD("animate-spin",i.rediscovering()),uT(),Gd(" ",e("extensionConnections.rediscover")," ");}}function dt(t,l){if(t&1){let e=fM();ta(0,"button",30),Zv("click",function(){sh(e);let o=yM(3);return ah(o.disconnect())}),QM(1),Pd();}if(t&2){let e=yM(2).$implicit;uT(),Gd(" ",e("extensionConnections.disconnect")," ");}}function pt(t,l){if(t&1&&(ta(0,"p",6),QM(1),Pd()),t&2){let e=yM(3).$implicit;uT(),yD(e("common.loading"));}}function _t(t,l){if(t&1&&(ta(0,"p",34),QM(1),Pd()),t&2){let e=yM(5).$implicit;uT(),Gd(" ",e("extensionConnections.githubPublicOnly")," ");}}function mt(t,l){if(t&1&&(ta(0,"p",36),QM(1),Pd()),t&2){let e=l.$implicit,i=yM(6).$implicit;uT(),DD(" ",e.accountLogin," \xB7 ",e.repositoryCount," ",i("extensionConnections.githubRepositories")," ");}}function ut(t,l){if(t&1&&(ta(0,"p",34),QM(1),Pd(),oM(2,mt,2,3,"p",36,nt)),t&2){let e=yM(2),i=yM(3).$implicit;uT(),Gd(" ",i("extensionConnections.githubAccessSummary",pN(1,it,e.installationCount,e.repositoryCount))," "),uT(),iM(e.installations);}}function xt(t,l){if(t&1&&(ta(0,"div",32)(1,"p",33),QM(2),Pd(),eM(3,_t,2,1,"p",34)(4,ut,4,4),ta(5,"a",35),QM(6),Pd()()),t&2){let e=yM(),i=yM(3).$implicit;uT(2),Gd(" ","@"+e.login," "),uT(),tM(e.publicOnly?3:4),uT(2),jv("href",e.appActionUrl,Gm),uT(),Gd(" ",e.appAction==="install"?i("extensionConnections.githubInstall"):i("extensionConnections.githubManage")," ");}}function Ct(t,l){if(t&1&&(ta(0,"p",31),QM(1),Pd()),t&2){let e=yM(4).$implicit;uT(),Gd(" ",e("extensionConnections.githubReconnectRequired")," ");}}function gt(t,l){if(t&1&&(ta(0,"p",31),QM(1),Pd()),t&2){let e=yM(4).$implicit;uT(),Gd(" ",e("extensionConnections.githubUnavailable")," ");}}function ht(t,l){if(t&1&&(ta(0,"p",6),QM(1),Pd()),t&2){let e=yM(4).$implicit;uT(),Gd(" ",e("extensionConnections.notConnected")," ");}}function vt(t,l){if(t&1&&eM(0,xt,7,4,"div",32)(1,Ct,2,1,"p",31)(2,gt,2,1,"p",31)(3,ht,2,1,"p",6),t&2){let e;tM((e=l.state)==="connected"?0:e==="reauthorization_required"?1:e==="unavailable"?2:3);}}function yt(t,l){if(t&1&&(ta(0,"p",31),QM(1),Pd()),t&2){let e=yM(3).$implicit;uT(),Gd(" ",e("extensionConnections.githubUnavailable")," ");}}function bt(t,l){if(t&1&&(ta(0,"mspot-card",20),Vv(1,"mspot-card-header",22),ta(2,"mspot-card-content",23),eM(3,pt,2,1,"p",6)(4,vt,4,1)(5,yt,2,1,"p",31),Pd()()),t&2){let e,i=yM(2).$implicit,o=yM();uT(),jv("title",i("extensionConnections.githubTitle"))("subtitle",i("extensionConnections.githubSubtitle")),uT(2),tM(o.githubStatusLoading()?3:(e=o.githubStatus())?4:5,e);}}function ft(t,l){if(t&1&&(ta(0,"p",6),QM(1),Pd()),t&2){let e=yM(2).$implicit;uT(),yD(e("common.loading"));}}function Pt(t,l){if(t&1&&(ta(0,"p",6),QM(1),Pd()),t&2){let e=yM(2).$implicit;uT(),Gd(" ",e("extensionConnections.noActions")," ");}}function wt(t,l){if(t&1){let e=fM();ta(0,"mspot-action-policy-groups",37),Zv("readPolicyChange",function(o){sh(e);let s=yM(3);return ah(s.setReadPolicy(o))})("writePolicyChange",function(o){sh(e);let s=yM(3);return ah(s.setWritePolicy(o))})("actionPolicyChange",function(o){sh(e);let s=yM(3);return ah(s.setActionPolicy(o))}),Pd();}if(t&2){let e=yM(3);jv("readActions",e.readActions())("writeActions",e.writeActions())("readPolicy",e.readPolicy())("writePolicy",e.writePolicy())("labels",e.policyLabels());}}
1function Dt(t,l){if(t&1){let e=fM();ta(0,"div",25)(1,"button",38),Zv("click",function(){sh(e);let o=yM(3);return ah(o.savePolicies())}),QM(2),Pd()();}if(t&2){let e=yM(2).$implicit,i=yM();uT(),jv("disabled",i.savingPolicies()||!i.policyDirty()),uT(),Gd(" ",e("extensionConnections.save")," ");}}function Tt(t,l){if(t&1){let e=fM();ta(0,"div",7)(1,"div",8),eM(2,ot,1,2,"img",9)(3,at,2,1,"span",10)(4,rt,1,0,"ng-icon",11),ta(5,"h2",12),QM(6),Pd(),ta(7,"span",13),QM(8),Pd(),eM(9,ct,3,1,"span",14)(10,lt,2,1,"span",15),Pd(),ta(11,"div",16)(12,"button",17),Zv("click",function(){sh(e);let o=yM(2);return ah(o.reconnect())}),QM(13),Pd(),eM(14,st,3,4,"button",18),eM(15,dt,2,1,"button",19),Pd()(),eM(16,bt,6,3,"mspot-card",20),ta(17,"mspot-card",21),Vv(18,"mspot-card-header",22),ta(19,"mspot-card-content",23),eM(20,ft,2,1,"p",6)(21,Pt,2,1,"p",6)(22,wt,1,5,"mspot-action-policy-groups",24),Pd(),eM(23,Dt,3,2,"div",25),Pd();}if(t&2){let e,i=l,o=yM().$implicit,s=yM();uT(2),tM((e=s.faviconUrl(i.url))?2:i.icon?3:4,e),uT(4),Gd(" ",i.name," "),uT(),jv("matTooltip",i.provider==="github"?o("extensionConnections.githubMcpTooltip"):"")("matTooltipDisabled",i.provider!=="github"),Pv("tabindex",i.provider==="github"?0:null)("data-cy",i.provider==="github"?"github-mcp-badge":null)("aria-label",i.provider==="github"?"MCP. "+o("extensionConnections.githubMcpTooltip"):null),uT(),Gd(" ",s.isMcp()?"MCP":"HTTP"," "),uT(),tM(i.connected?9:10),uT(3),iD("btn-primary",!i.connected)("btn-secondary",i.connected),uT(),Gd(" ",i.connected?o("extensionConnections.reconnect"):o("extensionConnections.connect")," "),uT(),tM(s.isMcp()&&i.connected?14:-1),uT(),tM(i.connected?15:-1),uT(),tM(s.isGithub()?16:-1),uT(2),jv("title",o("extensionConnections.actionsTitle"))("subtitle",o("extensionConnections.actionsSubtitle")),uT(2),tM(s.detailLoading()?20:s.hasActions()?22:21),uT(3),tM(s.hasActions()?23:-1);}}function Mt(t,l){if(t&1&&(ta(0,"p",6),QM(1),Pd()),t&2){let e=yM().$implicit;uT(),Gd(" ",e("extensionConnections.notFound")," ");}}function At(t,l){if(t&1){let e=fM();ta(0,"div",1)(1,"div",2)(2,"button",3),Zv("click",function(){sh(e);let o=yM();return ah(o.goBack())}),Vv(3,"ng-icon",4),ta(4,"span",5),QM(5),Pd()()(),eM(6,Tt,24,21)(7,Mt,2,1,"p",6),Pd();}if(t&2){let e,i=l.$implicit,o=yM();uT(5),yD(i("extensionConnections.title")),uT(),tM((e=o.connection())?6:o.connectionLoaded()?7:-1,e);}}var Ci=(()=>{class t{constructor(){this._gate=g(F),this._dialogService=g(Ss),this._transloco=g(Ce),this._noti=g(wi),this._location=g(DE),this._destroyRef=g(de),this._route=g(G),this._router=g(H),this._extensionId=YG(this._route.paramMap.pipe(st$1(e=>e.get("extensionId"))),{initialValue:null}),this._connectionsQuery=this._gate.myConnectionsQuery(),this._detailQuery=this._gate.connectionDetailQuery(this._extensionId),this.connection=qd(()=>(this._connectionsQuery.data()??[]).find(e=>e.extensionId===this._extensionId())??null),this.connectionLoaded=qd(()=>!this._connectionsQuery.isPending()),this.detail=qd(()=>this._detailQuery.data()?.credential??null),this.detailLoading=qd(()=>this._detailQuery.isPending()),this.savingPolicies=On(false),this.rediscovering=On(false),this.readPolicy=On("auto"),this.writePolicy=On("ask_user"),this.actionOverrides=On({}),this.policyDirty=On(false),this.isMcp=qd(()=>this.connection()?.type==="mcp_sse"),this.isGithub=qd(()=>this.connection()?.provider==="github"),this._githubStatusQuery=this._gate.githubConnectionStatusQuery(this._extensionId,this.isGithub),this.githubStatus=qd(()=>this._githubStatusQuery.data()),this.githubStatusLoading=qd(()=>this._githubStatusQuery.isPending()),this.isOAuth=qd(()=>this.connection()?.userAuthConfig.type==="oauth"),this.policyLabels=qd(()=>{let e=i=>this._transloco.translate(i);return {read:e("extensionConnections.readActions"),write:e("extensionConnections.writeActions"),overrides:e("extensionConnections.individualOverrides"),policyDisabled:e("extensionConnections.policyDisabled"),policyAsk:e("extensionConnections.policyAsk"),policyAuto:e("extensionConnections.policyAuto")}}),this._actionItems=qd(()=>{let e=this.detail();if(!e)return [];let i=this.actionOverrides(),o=this.readPolicy(),s=this.writePolicy();return e.discoveredActions.map(b=>{let K=j({name:b.name,httpMethod:b.httpMethod});return {key:b.name,name:b.name,description:b.description,httpMethod:b.httpMethod,group:K,policy:i[b.name]??(K==="read"?o:s)}})}),this.readActions=qd(()=>this._actionItems().filter(e=>e.group==="read")),this.writeActions=qd(()=>this._actionItems().filter(e=>e.group==="write")),this.hasActions=qd(()=>this._actionItems().length>0),this._seedEffect=Es(()=>{let e=this.detail();Qn(()=>{this.policyDirty()||(this.readPolicy.set(e?.readPolicy??"auto"),this.writePolicy.set(e?.writePolicy??"ask_user"),this.actionOverrides.set(Object.fromEntries((e?.actionOverrides??[]).map(i=>[i.actionName,i.policy]))));});}),this._consumeOAuthRedirectParams();}goBack(){this._location.back();}faviconUrl(e){return B(e)}onFaviconError(e){e.target.style.display="none";}setReadPolicy(e){this.readPolicy.set(e),this.policyDirty.set(true);}setWritePolicy(e){this.writePolicy.set(e),this.policyDirty.set(true);}setActionPolicy(e){this.actionOverrides.update(i=>s$1(r$1({},i),{[e.key]:e.policy})),this.policyDirty.set(true);}savePolicies(){let e=this._extensionId();if(!e||this.savingPolicies())return;this.savingPolicies.set(true);let i=this.actionOverrides();this._gate.updatePolicies(e,{readPolicy:this.readPolicy(),writePolicy:this.writePolicy(),actionOverrides:Object.entries(i).map(([o,s])=>({actionName:o,policy:s}))}).pipe(qG(this._destroyRef)).subscribe({next:()=>{this.savingPolicies.set(false),this.policyDirty.set(false),this._gate.invali
1dateConnections(),this._noti.successIntl("common.noti.saved");},error:()=>this.savingPolicies.set(false)});}reconnect(){let e=this.connection();if(e){if(this.isOAuth()){this._gate.initiateUserOAuth(e.extensionId).pipe(qG(this._destroyRef)).subscribe({next:({authorizationUrl:i})=>{window.location.href=i;},error:i=>{let o=J(i);o?this._noti.error(o):this._noti.errorIntl("extensionConnections.reconnectError");}});return}this._reenterSecret(e);}}reDiscover(){let e=this._extensionId();!e||this.rediscovering()||(this.rediscovering.set(true),this._gate.testCredential(e).pipe(qG(this._destroyRef)).subscribe({next:()=>{this.rediscovering.set(false),this._gate.invalidateConnections(),this._noti.successIntl("extensionConnections.rediscoverSuccess");},error:()=>this.rediscovering.set(false)}));}disconnect(){let e=this._extensionId();e&&this._gate.disconnect(e).pipe(qG(this._destroyRef)).subscribe(()=>{this._gate.invalidateConnections(),this._location.back();});}_consumeOAuthRedirectParams(){let e=this._route.snapshot.queryParamMap,i=e.get("oauthError"),o=e.get("extensionConnected");if(!(!i&&!o)){if(i){let s=e.get("oauthErrorDetail")??i;this._transloco.selectTranslate("oauthFailed",{},B$1).pipe(Uf(),qG(this._destroyRef)).subscribe(b=>this._noti.error(`${b}: ${s}`));}else this._transloco.selectTranslate("connectedSuccess",{},B$1).pipe(Uf(),qG(this._destroyRef)).subscribe(s=>this._noti.success(s));this._router.navigate([],{relativeTo:this._route,queryParams:{oauthError:null,oauthErrorDetail:null,extensionConnected:null},queryParamsHandling:"merge",replaceUrl:true});}}_reenterSecret(e){this._dialogService.open(se,{data:{status:e},dialogConfig:{panelClass:H$1.SIZE_420,disableClose:true}}).pipe(qG(this._destroyRef)).subscribe(i=>{if(!i)return;let o=e.userAuthConfig.type==="bearer"?{type:"bearer",token:i}:{type:"api_key",apiKey:i};this._gate.setCredential(e.extensionId,o).pipe(qG(this._destroyRef)).subscribe(()=>this._gate.invalidateConnections());});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=qS({type:t,selectors:[["mspot-my-connection-detail"]],hostAttrs:[1,"block"],features:[cN([$({heroArrowLeft:s,heroArrowPath:a,heroCheckCircle:F$1,heroPuzzlePiece:i5}),{provide:Me,useValue:B$1,multi:true}])],decls:1,vars:0,consts:[["class","motion-opacity-in mx-auto max-w-4xl px-4 py-6",4,"transloco"],[1,"motion-opacity-in","mx-auto","max-w-4xl","px-4","py-6"],[1,"mb-4","flex","items-center","gap-3"],["type","button",1,"text-icons-subtle","hover:text-icons-primary","flex","items-center","gap-1","transition-colors",3,"click"],["name","heroArrowLeft",1,"text-lg"],[1,"text-sm"],[1,"text-text-subtle","text-sm"],[1,"mb-6","flex","flex-col","items-start","gap-3","sm:flex-row","sm:items-center","sm:justify-between"],[1,"flex","flex-wrap","items-center","gap-x-3","gap-y-2"],["loading","lazy",1,"size-7","rounded",3,"src","alt"],[1,"text-2xl"],["name","heroPuzzlePiece",1,"text-icons-subtle","text-2xl"],[1,"text-text-strong","text-2xl","font-semibold"],[1,"bg-backgrounds-subtle","text-text-default","rounded-full","px-2","py-0.5","text-xs","font-medium",3,"matTooltip","matTooltipDisabled"],[1,"bg-backgrounds-fill-success-subtle","text-text-success","inline-flex","items-center","gap-1","rounded-full","px-2.5","py-0.5","text-xs","font-medium"],[1,"text-text-subtle","bg-backgrounds-subtle","inline-flex","items-center","rounded-full","px-2.5","py-0.5","text-xs","font-medium"],[1,"flex","shrink-0","flex-wrap","gap-2"],["type","button",1,"btn","btn-sm","whitespace-nowrap",3,"click"],["type","button",1,"btn","btn-secondary","btn-sm","whitespace-nowrap",3,"disabled"],["type","button",1,"btn","btn-secondary","btn-sm","whitespace-nowrap"],["data-cy","github-connection-status",1,"mb-6","block"],[1,"block"],["variant","divided",3,"title","subtitle"],["variant","divided"],[3,"readActions","writeActions","readPolicy","writePolicy","labels"],[1,"border-borders-primary","flex","items-center","justify-end","border-t","px-4","py-3","sm:px-6"],["loading","lazy",1,"size-7","rounded",3,"error","src","alt"],["name","heroCheckCircle",1,"text-sm"],["type","button",1,"btn","btn-secondary","btn-sm","whitespace-nowrap",3,"click","disabled"],["name","heroArrowPath",1,"mr-1","text-sm"],["type","button",1,"btn","btn-secondary","btn-sm","whitespace-nowrap",3,"click"],[1,"text-text-danger","text-sm"],[1,"flex","flex-col","gap-3"],[1,"text-text-strong","text-sm","font-medium"],[1,"text-text-default","text-sm"],["data-cy","github-app-action","target","_blank","rel","noopener noreferrer",1,"text-text-link","text-sm","font-medium",3,"href"],[1,"text-text-subtle","text-xs"],[3,"readPolicyChange","writePolicyChange","actionPolicyChange","readActions","writeActions","readPolicy","writePolicy","labels"],["type","button",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,o){i&1&&gv(0,At,8,2,"div",0);},dependencies:[yt$1,le,b,R,h,W,zt,mt$1],encapsulation:2});}}return t})();export{Ci as MyConnectionDetailComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.