"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["505"],{6103(e,i,o){o.d(i,{n:()=>a});var t=o(9763);o(9701);var n=o(2574);let a=({modalRoot:e,containerSx:i,...o})=>(0,t.Y)(n.Modal,{...o,portalRoot:e,containerSx:[[{alignItems:"center"},e?e=>({position:"absolute",insetInlineEnd:0,bottom:0,backgroundColor:"inherit",backdropFilter:`blur(${e.sizes.$2})`,display:"flex",justifyContent:"center",minHeight:"100%",height:"100%",width:"100%",borderRadius:e.radii.$lg}):{}],i]})},3860(e,i,o){o.d(i,{RevokeAPIKeyConfirmationModal:()=>h});var t=o(9763),n=o(2959),a=o(6447),r=o(7904),l=o(7447),s=o(6600),d=o(5870),p=o(4722),c=o(8342),m=o(1637),u=o(6103);let h=({isOpen:e,onOpen:i,onClose:o,apiKeyID:h,apiKeyName:k,onRevokeSuccess:v,modalRoot:b})=>{let y=(0,n.ho)(),{t:f}=(0,p._)(),C=(0,m.tJ)("apiKeyRevokeConfirmation","",{type:"text",label:(0,c.G)("apiKeys.revokeConfirmation.inputLabel"),placeholder:(0,c.G)("apiKeys.revokeConfirmation.confirmationText"),isRequired:!0}),R=C.value===(f((0,c.G)("apiKeys.revokeConfirmation.confirmationText"))||"Revoke"),$=()=>{o(),C.setValue("")},K=async e=>{e.preventDefault(),h&&R&&(await y.apiKeys.revoke({apiKeyID:h}),v?.(),$())};return e?(0,t.Y)(u.n,{handleOpen:i,handleClose:$,canCloseModal:!1,modalRoot:b,children:(0,t.Y)(r.Z.Root,{role:"alertdialog",elementDescriptor:a.$z.apiKeysRevokeModal,children:(0,t.Y)(r.Z.Content,{sx:e=>({textAlign:"start",padding:`${e.sizes.$4} ${e.sizes.$5} ${e.sizes.$4} ${e.sizes.$6}`}),children:(0,t.Y)(d.M,{headerTitle:(0,c.G)("apiKeys.revokeConfirmation.formTitle",{apiKeyName:k}),headerSubtitle:(0,c.G)("apiKeys.revokeConfirmation.formHint"),children:(0,t.FD)(l.l.Root,{onSubmit:K,children:[(0,t.Y)(l.l.ControlRow,{elementId:C.id,elementDescriptor:a.$z.apiKeysRevokeModalInput,children:(0,t.Y)(l.l.PlainInput,{...C.props})}),(0,t.Y)(s.G,{submitLabel:(0,c.G)("apiKeys.revokeConfirmation.formButtonPrimary__revoke"),colorScheme:"danger",isDisabled:!R,onReset:$,elementDescriptor:a.$z.apiKeysRevokeModalSubmitButton})]})})})})}):null}}}]);