1(function() { 2 try { 3 var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 4 e.SENTRY_RELEASE = { id: "b96dc26" }; 5 var n = new e.Error().stack; 6 n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4e5042d7-aa16-4f6e-9842-145977f4bdc6", e._sentryDebugIdIdentifier = "sentry-dbid-4e5042d7-aa16-4f6e-9842-145977f4bdc6"); 7 } catch (e) {} 8})(); 9import { n as __esmMin } from "./rolldown-runtime-sLwMD6dS.js"; 10import { t as require_jsx_runtime } from "./jsx-runtime-CHSMGLHp.js"; 11import { t as require_react } from "./react-CrLPhuc5.js"; 12import { r as init_button, t as Button } from "./button-DOiPZHfy.js"; 13import { a as DialogFooter, i as DialogContent, n as DialogBody, o as DialogHeader, r as DialogCloseButton, s as DialogTitle, t as Dialog, u as init_dialog } from "./dialog-XgiZyeRA.js"; 14//#region app/frontend/react/components/email_accounts_table/components/confirmation-dialog.tsx 15function ConfirmationDialog({ open, onClose, onConfirm, title, description, children, confirmLabel, cancelLabel = i18n.t("js.cancel"), variant = "danger", disabled = false }) { 16 const dialogRef = (0, import_react.useRef)(null); 17 const [loading, setLoading] = (0, import_react.useState)(false); 18 (0, import_react.useEffect)(() => { 19 if (open) { 20 dialogRef.current?.showModal(); 21 setLoading(false); 22 } else dialogRef.current?.close(); 23 }, [open]); 24 if (!open) return null; 25 const isDisabled = loading || disabled; 26 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dialog, { 27 ref: dialogRef, 28 onCancel: (event) => { 29 event.preventDefault(); 30 if (!isDisabled) onClose(); 31 }, 32 children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogContent, { children: [ 33 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogHeader, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogTitle, { children: title }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogCloseButton, { 34 onClick: onClose, 35 disabled: isDisabled 36 })] }), 37 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogBody, { children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: description }) }), 38 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { 39 variant: "ghost", 40 onClick: onClose, 41 disabled: isDisabled, 42 children: cancelLabel 43 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { 44 variant, 45 disabled: isDisabled, 46 "data-loading": isDisabled ? "true" : "none", 47 onClick: async () => { 48 setLoading(true); 49 try { 50 await onConfirm(); 51 } finally { 52 onClose(); 53 } 54 }, 55 children: confirmLabel 56 })] }) 57 ] }) 58 }); 59} 60var import_react, import_jsx_runtime; 61function init_confirmation_dialog() { 62 return (init_confirmation_dialog = __esmMin((() => { 63 import_react = require_react(); 64 init_button(); 65 init_dialog(); 66 import_jsx_runtime = require_jsx_runtime(); 67 })))(); 68} 69//#endregion 70export { init_confirmation_dialog as n, ConfirmationDialog as t };
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.