1import{b as F}from"./chunk-JXZHDPXA.js";import{a as U}from"./chunk-SORVIIVG.js";import{a as N}from"./chunk-5KHC7EZS.js";import{b as yt,c as wt}from"./chunk-GRXDDXEX.js";import{a as xt,b as St,c as bt}from"./chunk-FWTG5XIZ.js";import{i as _t}from"./chunk-ACJ3NLO5.js";import{G as vt,J as At,d as mt,f as lt,g as dt,l as ht,m as ft,y as gt,z as Ct}from"./chunk-GPVZISOV.js";import"./chunk-45WCVJBT.js";import"./chunk-74CDSVWG.js";import{R as at,U as ct,Z as pt,ga as E,na as ut,q as f}from"./chunk-SEQCRKB6.js";import{$a as tt,Aa as I,C as $,D as L,Db as D,E as _,Ea as O,F as W,Fa as T,Ga as p,Oa as Y,Pb as rt,Tb as st,U as x,V as q,Y as s,Ya as Z,Z as y,_ as w,cb as M,db as j,eb as et,ga as J,ia as u,la as K,ma as Q,n as H,ob as nt,pa as X,pb as it,qa as b,rb as ot,s as v,u as A,xa as a,ya as d,za as h}from"./chunk-HBLARLGW.js";var P=(()=>{let n=class n{constructor(){this.http=s(D)}getOAuth2ConsentManagementUiConfig(){return this.http.get(f(["protected","self-service","ui","configuration","oauth2","consents"]))}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=x({token:n,factory:n.\u0275fac});let i=n;return i})();var S=class extends pt{};var m=class m{constructor(){this.service=s(P),this.accessService=s(N),this.routes=s(ct)}resolve(){return this.service.getOAuth2ConsentManagementUiConfig().pipe(_(n=>(n.status===404?this.routes.error.notFound.navigate():this.accessService.handleAccessError(n,this.routes.protected.oauth2Consents.url),$)))}static resolveConfig(n){return n.snapshot.data.consentManagementUiConfig}};m.PROVIDER={provide:S,useFactory:m.resolveConfig,deps:[rt]},m.\u0275fac=function(r){return new(r||m)},m.\u0275prov=x({token:m,factory:m.\u0275fac});var g=m;var G=class{},R=class{},k=class{},C=(function(i){return i.GRANTED="Granted",i.DENIED="Denied",i})(C||{});var V=(()=>{let n=class n{constructor(){this.http=s(D),this.pages=s(ut),this.config=s(S),this.protectedUiService=s(F),this.accessService=s(N),this.flowService=s(U)}getUiConfig(){return H(this.config)}getOAuth2ConsentManagement(){return this.retrieveOAuth2Consents().pipe(W(e=>this.flowService.retrieveSelfServiceFlows().pipe(v(t=>this.createConsentManagement(e,t)))))}grantOAuth2Consent(e){return this.protectedUiService.startFlow(this.config.flowToGrantAConsent).pipe(A(()=>this.selectOAuth2ConsentToGrant(e)),_(t=>this.accessService.handleAccessError(t,this.pages.routes.protected.oauth2Consents.url,this.config.flowToGrantAConsent)))}denyOAuth2Consent(e){return this.protectedUiService.startFlow(this.config.flowToDenyAConsent).pipe(A(()=>this.selectOAuth2ConsentToDeny(e)),_(t=>this.accessService.handleAccessError(t,this.pages.routes.protected.oauth2Consents.url,this.config.flowToDenyAConsent)))}deleteOAuth2ConsentsByClient(e){return this.protectedUiService.startFlow(this.config.flowToDeleteConsentsByClient).pipe(A(()=>this.selectOAuth2ClientToDelete(e)),_(t=>this.accessService.handleAccessError(t,this.pages.routes.protected.oauth2Consents.url,this.config.flowToDeleteConsentsByClient)))}navigateToExitTarget(){this.pages.routes.navigateTo(this.config.pageExitTarget)}selectOAuth2ConsentToGrant(e){return this.http.post(f(["/protected","self-service","oauth2","consents",e.id,"grant"]),null,{observe:"response"}).pipe(v(t=>new E(t)))}selectOAuth2ConsentToDeny(e){return this.http.post(f(["/protected","self-service","oauth2","consents",e.id,"deny"]),null,{observe:"response"}).pipe(v(t=>new E(t)))}selectOAuth2ClientToDelete(e){return this.http.post(f(["/protected","self-service","oauth2","authorization-servers",e.authorizationServerName,"clients",e.clientName,"consents","remove"]),null,{observe:"response"}).pipe(v(t=>new E(t)))}retrieveOAuth2Consents(){return this.http.get(f(["/protected","self-service","oauth2","consents"])).pipe(v(e=>this.toOAuth2Consents(e.data)))}toOAuth2Consents(e){return e.map(t=>this.toOAuth2Consent(t))}toOAuth2Consent(e){return{id:e.id,clientName:e.attributes.clientId,authorizationServerName:e.attributes.authorizationServerId,updatedAt:e.attributes.updatedAt,scopeName:e.attributes.scope,consentStatus:C[e.attributes.status.toUpperCase()]}}createConsentManagement(e,t){let o=new G;return o.consents=this.mapConsentsByClient(e),o.hasExitTarget=!!this.config.pageExitTarget,o.canGrant=t.isAccessibleAndAuthorized(this.config.flowToGrantAConsent),o.canDeny=t.isAccessibleAndAuthorized(this.config.flowToDenyAConsent),o.canDelete=t.isAccessibleAndAuthorized(this.config.flowToDeleteConsentsByClient),o}mapConsentsByClient(e){let t=[];return e.forEach(o=>{let c=this.findPair(o,t);if(c)t.filter(l=>
1l===c).map(l=>l.consents.push(o));else{let l=new k;this.findAndMarkClientsWithSameName(t,o.clientName)&&(l.showAsInfo=!0),l.clientName=o.clientName,l.authorizationServerName=o.authorizationServerName;let z=new R;z.consents=[o],z.clientId=l,t.push(z)}}),t}findPair(e,t){return t.find(o=>o.clientId.clientName===e.clientName&&o.clientId.authorizationServerName===e.authorizationServerName)}findAndMarkClientsWithSameName(e,t){return e.filter(o=>o.clientId.clientName===t).map(o=>o.clientId.showAsInfo=!0).length>0}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=x({token:n,factory:n.\u0275fac});let i=n;return i})();var Ot=(i,n)=>({clientName:i,authorizationServerName:n});function Tt(i,n){i&1&&I(0,"iam-alert",5),i&2&&a("id","oAuth2ConsentsMissing")("text","protected.oauth2.consents.consent.missing")("type","info")}function Mt(i,n){if(i&1){let r=O();d(0,"iam-button",12),T("buttonClick",function(){y(r);let t=p().$implicit,o=p(3);return w(o.isGranted(t.consentStatus)?o.denyOAuth2Consent(t):o.grantOAuth2Consent(t))}),h()}if(i&2){let r=p(),e=r.$implicit,t=r.index,o=p().index,c=p(2);a("id",c.isGranted(e.consentStatus)?"denyButton"+c.doubleIndex(o,t):"grantButton"+c.doubleIndex(o,t))("text",c.isGranted(e.consentStatus)?c.getStatusTranslation("actions.deny"):c.getStatusTranslation("actions.grant"))}}function Dt(i,n){if(i&1&&(d(0,"iam-card",9),I(1,"iam-text-row",10)(2,"iam-text-row",10),M(3,"formatDate"),d(4,"iam-button-row"),b(5,Mt,1,2,"iam-button",11),h()()),i&2){let r=n.$implicit,e=n.index,t=p().index,o=p().ngIf,c=p();a("id","oAuth2Consent"+c.doubleIndex(t,e))("detailCard",!0)("title",r.scopeName),u(),a("id","oAuth2ConsentStatus"+c.doubleIndex(t,e))("label","protected.oauth2.consents.consent.status.label")("value",c.isGranted(r.consentStatus)?c.getStatusTranslation("granted"):c.getStatusTranslation("denied")),u(),a("id","oAuth2ConsentUpdatedAt"+c.doubleIndex(t,e))("label","protected.oauth2.consents.consent.updated")("value",j(3,10,r.updatedAt)),u(3),a("ngIf",c.isFlowAccessible(r.consentStatus,o))}}function Et(i,n){if(i&1){let r=O();d(0,"iam-button-row")(1,"iam-button",13),T("buttonClick",function(){y(r);let t=p().$implicit,o=p(2);return w(o.showDeleteConsentDialog(t.clientId))}),h()()}if(i&2){let r=p().index;u(),a("id","deleteOAuth2Consents["+r+"]")("text","protected.oauth2.consents.client.actions.delete")("type","error")}}
1function Nt(i,n){if(i&1&&(d(0,"div",6),I(1,"h2",7),M(2,"translate"),b(3,Dt,6,12,"iam-card",8)(4,Et,2,3,"iam-button-row",4),h()),i&2){let r=n.$implicit,e=n.index,t=p().ngIf,o=p();Y("iam-mb-5"),a("id","oAuth2ClientGroup["+e+"]"),u(),a("innerHTML",et(2,6,"protected.oauth2.consents.client.title",tt(9,Ot,r.clientId.clientName,r.clientId.showAsInfo?o.translate("protected.oauth2.consents.client.on")+" "+r.clientId.authorizationServerName:"")),J),u(2),a("ngForOf",r.consents),u(),a("ngIf",t.canDelete)}}function Ft(i,n){if(i&1){let r=O();d(0,"iam-button-row")(1,"iam-button",12),T("buttonClick",function(){y(r);let t=p(2);return w(t.navigateToExitTarget())}),h()()}i&2&&(u(),a("id","exitOAuth2ConsentManagement")("text","protected.oauth2.consents.actions.exit"))}function Ut(i,n){if(i&1&&(d(0,"iam-page",1),b(1,Tt,1,3,"iam-alert",2)(2,Nt,5,12,"div",3)(3,Ft,2,2,"iam-button-row",4),h()),i&2){let r=n.ngIf,e=p();a("pageId",e.pageId)("bodyAttributes",e.bodyAttributes)("title","protected.oauth2.consents.title")("hideMaintenanceMessages",!0),u(),a("ngIf",r.consents.length===0),u(),a("ngForOf",r.consents),u(),a("ngIf",r.hasExitTarget)}}var It=(()=>{let n=class n extends St{constructor(){super(),this.bodyAttributes={[xt]:bt.ProtectedSelfService},this.pageId="iamProtectedOAuth2ConsentManagement",this.protectedUiService=s(F),this.oAuth2ConsentService=s(V),this.languageService=s(at),this.pageDialog=s(vt)}ngOnInit(){this.oAuth2ConsentManagement=this.initUiConfig().pipe(A(()=>this.oAuth2ConsentService.getOAuth2ConsentManagement()))}translate(e){return this.languageService.translate(e)}getStatusTranslation(e){return this.translate("protected.oauth2.consents.consent.status.".concat(e))}navigateToExitTarget(){this.oAuth2ConsentService.navigateToExitTarget()}getUiConfig(){return this.oAuth2ConsentService.getUiConfig()}isGranted(e){return e===C.GRANTED}grantOAuth2Consent(e){this.oAuth2ConsentService.grantOAuth2Consent(e).subscribe({next:t=>this.protectedUiService.handleSuccessfulStep(t),error:t=>this.protectedUiService.handleErrorResponse(t)})}denyOAuth2Consent(e){this.oAuth2ConsentService.denyOAuth2Consent(e).subscribe({next:t=>this.protectedUiService.handleSuccessfulStep(t),error:t=>this.protectedUiService.handleErrorResponse(t)})}showDeleteConsentDialog(e){this.pageDialog.show({title:"protected.oauth2.consents.client.deletion.dialog.title",text:"protected.oauth2.consents.client.deletion.dialog.text"}).pipe(L(t=>t.ok)).subscribe(()=>this.deleteOAuth2ConsentsByClient(e))}doubleIndex(e,t){return"["+e+"]["+t+"]"}isFlowAccessible(e,t){switch(e){case C.GRANTED:return t.canDeny;case C.DENIED:return t.canGrant}}deleteOAuth2ConsentsByClient(e){this.oAuth2ConsentService.deleteOAuth2ConsentsByClient(e).subscribe({next:t=>this.protectedUiService.handleSuccessfulStep(t),error:t=>this.protectedUiService.handleErrorResponse(t)})}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=K({type:n,selectors:[["ng-component"]],standalone:!1,features:[Z([V,g.PROVIDER]),X],decls:2,vars:3,consts:[[3,"pageId","bodyAttributes","title","hideMaintenanceMessages",4,"ngIf"],[3,"pageId","bodyAttributes","title","hideMaintenanceMessages"],[3,"id","text","type",4,"ngIf"],[3,"id","class",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"id","text","type"],[3,"id"],[1,"iam-font-weight-bold",3,"innerHTML"],[3,"id","detailCard","title",4,"ngFor","ngForOf"],[3,"id","detailCard","title"],[3,"id","label","value"],[3,"id","text","buttonClick",4,"ngIf"],[3,"buttonClick","id","text"],[3,"buttonClick","id","text","type"]],template:function(t,o){t&1&&(b(0,Ut,4,7,"iam-page",0),M(1,"async")),t&2&&a("ngIf",j(1,1,o.oAuth2ConsentManagement))},dependencies:[nt,it,ft,lt,dt,ht,gt,At,ot,mt,Ct],encapsulation:2});let i=n;return i})();var Bt=[{path:"",pathMatch:"full",component:It,resolve:{consentManagementUiConfig:()=>s(g).resolve()},runGuardsAndResolvers:"always"}],We=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Q({type:n}),n.\u0275inj=q({providers:[U,wt,yt,P,g],imports:[st.forChild(Bt),_t]});let i=n;return i})();export{We as OAuth2ConsentManagementModule};
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.