import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,s as m}from"./context-BKnOUECq.mjs";import{P as a}from"./errors-Dd6zfYtp.mjs";import{u as c}from"./internal-context-dfitw7Ot.mjs";import{u as l}from"./modal-context-DBwfUxD-.mjs";import{S as p}from"./ScreenLayout-Caq5mGD8.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-DffkxvO4.mjs";import"styled-components";import"./useActiveWallet-BEfvREjE.mjs";import"viem/utils";import"./wallet-connect-58EobR5U.mjs";import"./getPublicClient-D4yNgeGy.mjs";import"viem";import"viem/chains";import"eventemitter3";import"./events-context-BJ75xIIf.mjs";import"./privy-context-Bi6vqCPc.mjs";import"@privy-io/are-addresses-equal";import"./index-BtwxknTg.mjs";import"zustand";import"react-device-detect";import"./get-entropy-details-for-user-BIWg0YxF.mjs";import"./user-D5cqJNp9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D8KNyGVj.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:m,onDeny:a,onClose:c})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:c,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:m},secondaryCta:{label:"Deny",onClick:a},onBack:c,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,f]=i(),{onRevoke:j,onSuccess:v,onError:h}=o.delegatedActions.revoke,k=async()=>{p?v():h(y??new a("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(k,m);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await j(),d(!0)}catch(e){f(e)}},onDeny:()=>{k()},onClose:k})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
//# sourceMappingURL=DelegatedActionsRevokeScreen-DdjqlDX_.mjs.map
