"use strict";var e=require("react/jsx-runtime"),r=require("lucide-react"),t=require("react"),i=require("./context-rs-ygOK2.js"),o=require("./errors-CBapWvRs.js"),n=require("./internal-context-CdsQ3LEl.js"),s=require("./modal-context-BgeioxwT.js"),c=require("./ScreenLayout-DaFW0I3a.js");require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("./ModalHeader-Cpls13mi.js"),require("styled-components"),require("./useActiveWallet-dTc6deka.js"),require("viem/utils"),require("./wallet-connect-BuohfvHK.js"),require("./getPublicClient-CFd_sHBk.js"),require("viem"),require("viem/chains"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("./privy-context-UTJouJ1x.js"),require("@privy-io/are-addresses-equal"),require("./index-Ub4KpwSY.js"),require("zustand"),require("react-device-detect"),require("./get-entropy-details-for-user-D63rM5_a.js"),require("./user-D2oPA-vS.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./Screen-8NusMFtu.js"),require("./index-ByFhjjzH.js");const u=({appName:t,success:i,error:o,onRevoke:n,onDeny:s,onClose:u})=>i||o?/*#__PURE__*/e.jsx(c.ScreenLayout,{title:o?"Something went wrong":"Success!",subtitle:o?"Please try again.":"You've successfully revoked permissions.",icon:o?r.AlertCircle:r.CheckCircle,iconVariant:o?"error":"success",onBack:u,watermark:!0}):/*#__PURE__*/e.jsx(c.ScreenLayout,{title:"Revoke offline access to wallet",subtitle:`By confirming, ${t} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r.Ban,primaryCta:{label:"Confirm",onClick:n},secondaryCta:{label:"Deny",onClick:s},onBack:u,watermark:!0}),a={component:()=>{let{data:r}=s.usePrivyModal(),c=i.useAppConfig(),{closePrivyModal:a}=n.usePrivyInternal(),[l,q]=t.useState(!1),[d,y]=t.useState(),{onRevoke:v,onSuccess:j,onError:m}=r.delegatedActions.revoke,k=async()=>{l?j():m(d??new o.PrivyClientError("User declined revoking access to their delegated wallet.")),a({shouldCallAuthOnSuccess:!1})};return t.useEffect((()=>{if(!l&&!d)return;let e=setTimeout(k,i.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS);return()=>clearTimeout(e)}),[l,d]),/*#__PURE__*/e.jsx(u,{appName:c.name,success:l,error:d,onRevoke:async()=>{try{await v(),q(!0)}catch(e){y(e)}},onDeny:()=>{k()},onClose:k})}};exports.DelegatedActionsRevokeScreen=a,exports.DelegatedActionsRevokeScreenView=u,exports.default=a;
//# sourceMappingURL=DelegatedActionsRevokeScreen-D9OZ2qBl.js.map
