import { c as _c } from "react/compiler-runtime"; import React from 'react'; import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'; import { Box, Text } from '../../ink.js'; import { useKeybinding } from '../../keybindings/useKeybinding.js'; import type { SettingsJson } from '../../utils/settings/types.js'; import { Select } from '../CustomSelect/index.js'; import { PermissionDialog } from '../permissions/PermissionDialog.js'; import { extractDangerousSettings, formatDangerousSettingsList } from './utils.js'; type Props = { settings: SettingsJson; onAccept: () => void; onReject: () => void; }; export function ManagedSettingsSecurityDialog(t0) { const $ = _c(26); const { settings, onAccept, onReject } = t0; const dangerous = extractDangerousSettings(settings); const settingsList = formatDangerousSettingsList(dangerous); const exitState = useExitOnCtrlCDWithKeybindings(); let t1; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t1 = { context: "Confirmation" }; $[0] = t1; } else { t1 = $[0]; } useKeybinding("confirm:no", onReject, t1); let t2; if ($[1] !== onAccept || $[2] !== onReject) { t2 = function onChange(value) { if (value === "exit") { onReject(); return; } onAccept(); }; $[1] = onAccept; $[2] = onReject; $[3] = t2; } else { t2 = $[3]; } const onChange = t2; const T0 = PermissionDialog; const t3 = "warning"; const t4 = "warning"; const t5 = "Managed settings require approval"; const T1 = Box; const t6 = "column"; const t7 = 1; const t8 = 1; let t9; if ($[4] === Symbol.for("react.memo_cache_sentinel")) { t9 = Your organization has configured managed settings that could allow execution of arbitrary code or interception of your prompts and responses.; $[4] = t9; } else { t9 = $[4]; } const T2 = Box; const t10 = "column"; let t11; if ($[5] === Symbol.for("react.memo_cache_sentinel")) { t11 = Settings requiring approval:; $[5] = t11; } else { t11 = $[5]; } const t12 = settingsList.map(_temp); let t13; if ($[6] !== T2 || $[7] !== t11 || $[8] !== t12) { t13 = {t11}{t12}; $[6] = T2; $[7] = t11; $[8] = t12; $[9] = t13; } else { t13 = $[9]; } let t14; if ($[10] === Symbol.for("react.memo_cache_sentinel")) { t14 = Only accept if you trust your organization's IT administration and expect these settings to be configured.; $[10] = t14; } else { t14 = $[10]; } let t15; if ($[11] === Symbol.for("react.memo_cache_sentinel")) { t15 = [{ label: "Yes, I trust these settings", value: "accept" }, { label: "No, exit Claude Code", value: "exit" }]; $[11] = t15; } else { t15 = $[11]; } let t16; if ($[12] !== onChange) { t16 =