"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[8100],{50472:(e,t,n)=>{n.d(t,{c:()=>u});var i=n(69060),s=n(66152),a=n(95705),c=n(66156),o=n(70780),l=n(61180),r=n(78256),d=n(82496);const u=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,idp:u,idpType:p}=e;const f=(0,c.Ab)(),[x,y]=(0,i.useState)(!1);if(!u)return null;const b="_"===u?"Default":u;return(0,d.jsx)(o.c,{title:"Delete ".concat(b),confirmText:"Delete",isOpen:n,titleIcon:(0,d.jsx)(s.sB6,{}),isLoading:x,onConfirm:()=>{y(!0),l.m.idp.deleteConfiguration(u,p).then((e=>{(e=>{t(!0),f((0,a.s$)(!0===e.restart))})(e.data)})).catch((e=>f((0,a.aW)((0,r.K)(e.error))))).finally((()=>y(!1)))},onClose:()=>t(!1),confirmButtonProps:{disabled:x},confirmationContent:(0,d.jsxs)(i.Fragment,{children:["Are you sure you want to delete IDP ",(0,d.jsx)("b",{children:b})," ","configuration? ",(0,d.jsx)("br",{})]})})}},28100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var i=n(69060),s=n(66152),a=n(51560),c=n(61180),o=n(78256),l=n(66156),r=n(21124),d=n(3992),u=n(95705),p=n(61628),f=n(84612),x=n(50472),y=n(3428),b=n(48504),j=n(82496);const m=e=>{let{idpType:t}=e;const n=(0,l.Ab)(),m=(0,a.i6)(),[h,C]=(0,i.useState)(!1),[D,_]=(0,i.useState)(""),[A,N]=(0,i.useState)(!1),[g,O]=(0,i.useState)([]),I=(0,d.i)(r.Gc,[r.Oi.ADMIN_CONFIG_UPDATE]),G=(0,d.i)(r.Gc,[r.Oi.ADMIN_CONFIG_UPDATE]),T=(0,d.i)(r.Gc,[r.Oi.ADMIN_CONFIG_UPDATE]);(0,i.useEffect)((()=>{E()}),[]),(0,i.useEffect)((()=>{A&&(T?c.m.idp.listConfigurations(t).then((e=>{N(!1),e.data.results&&O(e.data.results.map((e=>(e.name="_"===e.name?"Default":e.name,e.enabled=!0===e.enabled?"Enabled":"Disabled",e))))})).catch((e=>{N(!1),n((0,u.aW)((0,o.K)(e.error)))})):N(!1))}),[A,N,O,n,T,t]);const E=()=>{N(!0)},F=[{type:"view",onClick:e=>{let n="Default"===e.name?"_":e.name;m("/identity/idp/".concat(t,"/configurations/").concat(n))},disableButtonFunction:()=>!G},{type:"delete",onClick:e=>{C(!0),_(e="Default"===e?"_":e)},sendOnlyId:!0,disableButtonFunction:e=>!I||"Default"===e}];return(0,i.useEffect)((()=>{n((0,u.i8)("idp_configs"))}),[]),(0,j.jsxs)(i.Fragment,{children:[h&&(0,j.jsx)(x.c,{deleteOpen:h,idp:D,idpType:t,closeDeleteModalAndRefresh:async e=>{C(!1),e&&E()}}),(0,j.jsx)(y.c,{label:"".concat(t.toUpperCase()," Configurations"),actions:(0,j.jsx)(b.c,{})}),(0,j.jsx)(s._al,{children:(0,j.jsxs)(s.yeN,{container:!0,children:[(0,j.jsxs)(s.yeN,{item:!0,xs:12,sx:{...p.GR.actionsTray,justifyContent:"flex-end",gap:8},children:[(0,j.jsx)(d.K,{scopes:[r.Oi.ADMIN_CONFIG_UPDATE],resource:r.Gc,errorProps:{disabled:!0},children:(0,j.jsx)(f.c,{tooltip:"Refresh",children:(0,j.jsx)(s.qaq,{id:"refresh-keys",variant:"regular",icon:(0,j.jsx)(s.W5k,{}),onClick:()=>N(!0)})})}),(0,j.jsx)(d.K,{scopes:[r.Oi.ADMIN_CONFIG_UPDATE],resource:r.Gc,errorProps:{disabled:!0},children:(0,j.jsx)(f.c,{tooltip:"Create ".concat(t," configuration"),children:(0,j.jsx)(s.qaq,{id:"create-idp",label:"Create Configuration",variant:"callAction",icon:(0,j.jsx)(s.EgV,{}),onClick:()=>m("/identity/idp/".concat(t,"/configurations/add-idp"))})})})]}),(0,j.jsx)(s.yeN,{item:!0,xs:12,children:(0,j.jsx)(d.K,{scopes:[r.Oi.ADMIN_CONFIG_UPDATE],resource:r.Gc,errorProps:{disabled:!0},children:(0,j.jsx)(s.iSL,{itemActions:F,columns:[{label:"Name",elementKey:"name"},{label:"Type",elementKey:"type"},{label:"Enabled",elementKey:"enabled"}],isLoading:A,records:g,entityName:"Keys",idField:"name"})})})]})})]})},h=()=>(0,j.jsx)(m,{idpType:"openid"})}}]);
//# sourceMappingURL=8100.67b80931.chunk.js.map